@vm0/cli 9.154.1 → 9.155.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-GDR4NWU2.js → chunk-D3OXQKM5.js} +422 -240
- package/{chunk-GDR4NWU2.js.map → chunk-D3OXQKM5.js.map} +1 -1
- package/index.js +11 -11
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +5 -5
- package/zero.js.map +1 -1
|
@@ -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.155.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.155.0",
|
|
74106
74106
|
command: process.argv.slice(2).join(" ")
|
|
74107
74107
|
});
|
|
74108
74108
|
setContext("runtime", {
|
|
@@ -74216,10 +74216,10 @@ function decodeZeroTokenPayload(token) {
|
|
|
74216
74216
|
return void 0;
|
|
74217
74217
|
}
|
|
74218
74218
|
|
|
74219
|
-
// src/commands/zero/
|
|
74219
|
+
// src/commands/zero/local-agent/index.ts
|
|
74220
74220
|
init_esm_shims();
|
|
74221
74221
|
|
|
74222
|
-
// src/commands/zero/
|
|
74222
|
+
// src/commands/zero/local-agent/host.ts
|
|
74223
74223
|
init_esm_shims();
|
|
74224
74224
|
import { hostname as hostname4 } from "os";
|
|
74225
74225
|
|
|
@@ -74724,7 +74724,7 @@ var chalk = createChalk();
|
|
|
74724
74724
|
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
74725
74725
|
var source_default = chalk;
|
|
74726
74726
|
|
|
74727
|
-
// src/commands/zero/
|
|
74727
|
+
// src/commands/zero/local-agent/host.ts
|
|
74728
74728
|
import { Realtime as Realtime2 } from "ably";
|
|
74729
74729
|
|
|
74730
74730
|
// src/lib/command/with-error-handler.ts
|
|
@@ -88725,24 +88725,24 @@ async function clearConfig() {
|
|
|
88725
88725
|
await unlink(configFile);
|
|
88726
88726
|
}
|
|
88727
88727
|
}
|
|
88728
|
-
async function
|
|
88729
|
-
await saveConfig({
|
|
88728
|
+
async function saveLocalAgentHost(host) {
|
|
88729
|
+
await saveConfig({ localAgentHost: host });
|
|
88730
88730
|
}
|
|
88731
|
-
async function
|
|
88731
|
+
async function clearLocalAgentHost(hostId) {
|
|
88732
88732
|
const existing = await loadConfig();
|
|
88733
|
-
if (existing.
|
|
88733
|
+
if (existing.localAgentHost?.id !== hostId) {
|
|
88734
88734
|
return;
|
|
88735
88735
|
}
|
|
88736
88736
|
const nextConfig = { ...existing };
|
|
88737
|
-
delete nextConfig.
|
|
88737
|
+
delete nextConfig.localAgentHost;
|
|
88738
88738
|
const configDir = getConfigDir();
|
|
88739
88739
|
const configFile = getConfigFile();
|
|
88740
88740
|
await mkdir(configDir, { recursive: true });
|
|
88741
88741
|
await writeFile(configFile, JSON.stringify(nextConfig, null, 2), "utf8");
|
|
88742
88742
|
}
|
|
88743
|
-
async function
|
|
88743
|
+
async function getLocalAgentHost() {
|
|
88744
88744
|
const config4 = await loadConfig();
|
|
88745
|
-
return config4.
|
|
88745
|
+
return config4.localAgentHost;
|
|
88746
88746
|
}
|
|
88747
88747
|
|
|
88748
88748
|
// src/lib/api/core/client-factory.ts
|
|
@@ -97241,6 +97241,43 @@ var anthropicManagedAgents = {
|
|
|
97241
97241
|
}
|
|
97242
97242
|
};
|
|
97243
97243
|
|
|
97244
|
+
// ../../packages/connectors/src/connectors/bentoml.ts
|
|
97245
|
+
init_esm_shims();
|
|
97246
|
+
var bentoml = {
|
|
97247
|
+
bentoml: {
|
|
97248
|
+
label: "BentoML",
|
|
97249
|
+
category: "data-automation-infrastructure",
|
|
97250
|
+
generation: ["text"],
|
|
97251
|
+
tags: ["bentocloud", "model-serving", "mlops", "inference"],
|
|
97252
|
+
environmentMapping: {
|
|
97253
|
+
BENTO_CLOUD_API_KEY: "$secrets.BENTO_CLOUD_API_KEY",
|
|
97254
|
+
BENTO_CLOUD_API_ENDPOINT: "$vars.BENTO_CLOUD_API_ENDPOINT"
|
|
97255
|
+
},
|
|
97256
|
+
helpText: "Connect your BentoCloud account to manage BentoML deployments and call protected deployment endpoints",
|
|
97257
|
+
authMethods: {
|
|
97258
|
+
"api-token": {
|
|
97259
|
+
featureFlag: "bentomlConnector" /* BentomlConnector */,
|
|
97260
|
+
label: "BentoCloud API Token",
|
|
97261
|
+
helpText: "1. Log in to [BentoCloud](https://cloud.bentoml.com)\n2. Open your profile menu, then go to **API Tokens**\n3. Create a Personal or Organization API token with the access your workflow needs\n4. Copy the token and enter your organization endpoint, for example `https://your-org.cloud.bentoml.com`",
|
|
97262
|
+
secrets: {
|
|
97263
|
+
BENTO_CLOUD_API_KEY: {
|
|
97264
|
+
label: "API Token",
|
|
97265
|
+
required: true,
|
|
97266
|
+
placeholder: "cur7h..."
|
|
97267
|
+
},
|
|
97268
|
+
BENTO_CLOUD_API_ENDPOINT: {
|
|
97269
|
+
label: "BentoCloud Endpoint",
|
|
97270
|
+
required: true,
|
|
97271
|
+
placeholder: "https://your-org.cloud.bentoml.com",
|
|
97272
|
+
type: "variable"
|
|
97273
|
+
}
|
|
97274
|
+
}
|
|
97275
|
+
}
|
|
97276
|
+
},
|
|
97277
|
+
defaultAuthMethod: "api-token"
|
|
97278
|
+
}
|
|
97279
|
+
};
|
|
97280
|
+
|
|
97244
97281
|
// ../../packages/connectors/src/connectors/github.ts
|
|
97245
97282
|
init_esm_shims();
|
|
97246
97283
|
var github = {
|
|
@@ -98877,19 +98914,18 @@ var localBrowser = {
|
|
|
98877
98914
|
}
|
|
98878
98915
|
};
|
|
98879
98916
|
|
|
98880
|
-
// ../../packages/connectors/src/connectors/
|
|
98917
|
+
// ../../packages/connectors/src/connectors/local-agent.ts
|
|
98881
98918
|
init_esm_shims();
|
|
98882
|
-
var
|
|
98883
|
-
"
|
|
98884
|
-
label: "
|
|
98919
|
+
var localAgent = {
|
|
98920
|
+
"local-agent": {
|
|
98921
|
+
label: "Local Agent",
|
|
98885
98922
|
category: "engineering-team-execution",
|
|
98886
98923
|
environmentMapping: {},
|
|
98887
|
-
helpText: "Run local Codex or Claude Code hosts, then call them from chat with `/
|
|
98924
|
+
helpText: "Run local Codex or Claude Code hosts, then call them from chat with `/local-agent ${host} prompt`",
|
|
98888
98925
|
authMethods: {
|
|
98889
98926
|
api: {
|
|
98890
|
-
featureFlag: "remoteAgent" /* RemoteAgent */,
|
|
98891
98927
|
label: "CLI Host",
|
|
98892
|
-
helpText: "1. Run `npx -p @vm0/cli vm0 login`\n2. Start a host with `npx -p @vm0/cli vm0
|
|
98928
|
+
helpText: "1. Run `npx -p @vm0/cli vm0 login`\n2. Start a host with `npx -p @vm0/cli vm0 local-agent start`\n3. Keep the host process running, then return here and click **Connect** once it appears online\n4. Run a connected host from chat with `/local-agent ${host} prompt`",
|
|
98893
98929
|
secrets: {}
|
|
98894
98930
|
}
|
|
98895
98931
|
},
|
|
@@ -98994,6 +99030,48 @@ var reddit = {
|
|
|
98994
99030
|
}
|
|
98995
99031
|
};
|
|
98996
99032
|
|
|
99033
|
+
// ../../packages/connectors/src/connectors/reap.ts
|
|
99034
|
+
init_esm_shims();
|
|
99035
|
+
var reap = {
|
|
99036
|
+
reap: {
|
|
99037
|
+
label: "Reap",
|
|
99038
|
+
category: "sales-crm-business-operations",
|
|
99039
|
+
tags: [
|
|
99040
|
+
"fintech",
|
|
99041
|
+
"embedded-finance",
|
|
99042
|
+
"cards",
|
|
99043
|
+
"wallets",
|
|
99044
|
+
"payments",
|
|
99045
|
+
"compliance"
|
|
99046
|
+
],
|
|
99047
|
+
environmentMapping: {
|
|
99048
|
+
REAP_API_KEY: "$secrets.REAP_API_KEY",
|
|
99049
|
+
REAP_API_BASE_URL: "$vars.REAP_API_BASE_URL"
|
|
99050
|
+
},
|
|
99051
|
+
helpText: "Connect your Reap project to manage users, companies, accounts, cards, virtual assets, activities, and reconciliations",
|
|
99052
|
+
authMethods: {
|
|
99053
|
+
"api-token": {
|
|
99054
|
+
label: "API Key",
|
|
99055
|
+
helpText: "1. Contact the Reap team to obtain an API key for your project\n2. Choose the matching API base URL for the key environment: `https://sandbox.api.reap.global/v1` or `https://prod.api.reap.global/v1`\n3. Copy the API key",
|
|
99056
|
+
secrets: {
|
|
99057
|
+
REAP_API_KEY: {
|
|
99058
|
+
label: "API Key",
|
|
99059
|
+
required: true,
|
|
99060
|
+
placeholder: "YOUR_REAP_API_KEY"
|
|
99061
|
+
},
|
|
99062
|
+
REAP_API_BASE_URL: {
|
|
99063
|
+
label: "API Base URL",
|
|
99064
|
+
required: true,
|
|
99065
|
+
placeholder: "https://sandbox.api.reap.global/v1",
|
|
99066
|
+
type: "variable"
|
|
99067
|
+
}
|
|
99068
|
+
}
|
|
99069
|
+
}
|
|
99070
|
+
},
|
|
99071
|
+
defaultAuthMethod: "api-token"
|
|
99072
|
+
}
|
|
99073
|
+
};
|
|
99074
|
+
|
|
98997
99075
|
// ../../packages/connectors/src/connectors/strava.ts
|
|
98998
99076
|
init_esm_shims();
|
|
98999
99077
|
var strava = {
|
|
@@ -103336,6 +103414,7 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
103336
103414
|
...agentmail,
|
|
103337
103415
|
...airtable,
|
|
103338
103416
|
...anthropicManagedAgents,
|
|
103417
|
+
...bentoml,
|
|
103339
103418
|
...github,
|
|
103340
103419
|
...notion,
|
|
103341
103420
|
...gmail,
|
|
@@ -103384,10 +103463,11 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
103384
103463
|
...minimax,
|
|
103385
103464
|
...reportei,
|
|
103386
103465
|
...localBrowser,
|
|
103387
|
-
...
|
|
103466
|
+
...localAgent,
|
|
103388
103467
|
...serpapi,
|
|
103389
103468
|
...salesforce,
|
|
103390
103469
|
...reddit,
|
|
103470
|
+
...reap,
|
|
103391
103471
|
...strava,
|
|
103392
103472
|
...x,
|
|
103393
103473
|
...neon,
|
|
@@ -103755,10 +103835,10 @@ var zeroComputerConnectorContract = c16.router({
|
|
|
103755
103835
|
summary: "Delete computer connector (zero proxy)"
|
|
103756
103836
|
}
|
|
103757
103837
|
});
|
|
103758
|
-
var
|
|
103838
|
+
var zeroLocalAgentConnectorContract = c16.router({
|
|
103759
103839
|
create: {
|
|
103760
103840
|
method: "POST",
|
|
103761
|
-
path: "/api/zero/connectors/
|
|
103841
|
+
path: "/api/zero/connectors/local-agent",
|
|
103762
103842
|
headers: authHeadersSchema,
|
|
103763
103843
|
body: external_exports.object({}).optional(),
|
|
103764
103844
|
responses: {
|
|
@@ -103768,7 +103848,7 @@ var zeroRemoteAgentConnectorContract = c16.router({
|
|
|
103768
103848
|
403: apiErrorSchema,
|
|
103769
103849
|
409: apiErrorSchema
|
|
103770
103850
|
},
|
|
103771
|
-
summary: "Connect
|
|
103851
|
+
summary: "Connect local-agent connector"
|
|
103772
103852
|
}
|
|
103773
103853
|
});
|
|
103774
103854
|
var zeroLocalBrowserConnectorContract = c16.router({
|
|
@@ -106509,10 +106589,10 @@ async function getComputerUseHost() {
|
|
|
106509
106589
|
handleError(result, "Failed to get computer-use host");
|
|
106510
106590
|
}
|
|
106511
106591
|
|
|
106512
|
-
// src/lib/api/domains/zero-
|
|
106592
|
+
// src/lib/api/domains/zero-local-agent.ts
|
|
106513
106593
|
init_esm_shims();
|
|
106514
106594
|
|
|
106515
|
-
// ../../packages/api-contracts/src/contracts/zero-
|
|
106595
|
+
// ../../packages/api-contracts/src/contracts/zero-local-agent.ts
|
|
106516
106596
|
init_esm_shims();
|
|
106517
106597
|
|
|
106518
106598
|
// ../../packages/api-contracts/src/contracts/realtime.ts
|
|
@@ -106568,34 +106648,34 @@ var platformRealtimeTokenContract = c25.router({
|
|
|
106568
106648
|
}
|
|
106569
106649
|
});
|
|
106570
106650
|
|
|
106571
|
-
// ../../packages/api-contracts/src/contracts/zero-
|
|
106651
|
+
// ../../packages/api-contracts/src/contracts/zero-local-agent.ts
|
|
106572
106652
|
var c26 = initContract();
|
|
106573
|
-
var
|
|
106574
|
-
var
|
|
106653
|
+
var localAgentBackendSchema = external_exports.enum(["codex", "claude-code"]);
|
|
106654
|
+
var localAgentJobStatusSchema = external_exports.enum([
|
|
106575
106655
|
"queued",
|
|
106576
106656
|
"running",
|
|
106577
106657
|
"succeeded",
|
|
106578
106658
|
"failed"
|
|
106579
106659
|
]);
|
|
106580
|
-
var
|
|
106660
|
+
var localAgentHostStatusSchema = external_exports.enum(["online", "closed"]);
|
|
106581
106661
|
var hostNameSchema = external_exports.string().trim().min(1).max(128);
|
|
106582
|
-
var supportedBackendsSchema = external_exports.array(
|
|
106662
|
+
var supportedBackendsSchema = external_exports.array(localAgentBackendSchema).min(1).max(2);
|
|
106583
106663
|
var promptSchema = external_exports.string().trim().min(1).max(6e4);
|
|
106584
|
-
var
|
|
106664
|
+
var localAgentRealtimeSubscriptionSchema = external_exports.object({
|
|
106585
106665
|
channelName: external_exports.string(),
|
|
106586
106666
|
eventName: external_exports.string(),
|
|
106587
106667
|
tokenRequest: ablyTokenRequestSchema
|
|
106588
106668
|
});
|
|
106589
|
-
var
|
|
106669
|
+
var localAgentDeviceStartResponseSchema = external_exports.object({
|
|
106590
106670
|
deviceCode: external_exports.string(),
|
|
106591
106671
|
userCode: external_exports.string(),
|
|
106592
106672
|
verificationPath: external_exports.string(),
|
|
106593
106673
|
expiresIn: external_exports.number().int().positive(),
|
|
106594
106674
|
interval: external_exports.number().int().positive(),
|
|
106595
106675
|
pollToken: external_exports.string(),
|
|
106596
|
-
realtime:
|
|
106676
|
+
realtime: localAgentRealtimeSubscriptionSchema.optional()
|
|
106597
106677
|
});
|
|
106598
|
-
var
|
|
106678
|
+
var localAgentDevicePollResponseSchema = external_exports.discriminatedUnion(
|
|
106599
106679
|
"status",
|
|
106600
106680
|
[
|
|
106601
106681
|
external_exports.object({ status: external_exports.literal("pending") }),
|
|
@@ -106607,23 +106687,23 @@ var remoteAgentDevicePollResponseSchema = external_exports.discriminatedUnion(
|
|
|
106607
106687
|
external_exports.object({ status: external_exports.literal("expired") })
|
|
106608
106688
|
]
|
|
106609
106689
|
);
|
|
106610
|
-
var
|
|
106690
|
+
var localAgentDeviceClaimResponseSchema = external_exports.object({
|
|
106611
106691
|
status: external_exports.literal("approved")
|
|
106612
106692
|
});
|
|
106613
|
-
var
|
|
106693
|
+
var localAgentHeartbeatResponseSchema = external_exports.object({
|
|
106614
106694
|
ok: external_exports.literal(true),
|
|
106615
106695
|
hostId: external_exports.string()
|
|
106616
106696
|
});
|
|
106617
|
-
var
|
|
106697
|
+
var localAgentRunCreateResponseSchema = external_exports.object({
|
|
106618
106698
|
jobId: external_exports.string(),
|
|
106619
|
-
status:
|
|
106699
|
+
status: localAgentJobStatusSchema
|
|
106620
106700
|
});
|
|
106621
|
-
var
|
|
106701
|
+
var localAgentRunResponseSchema = external_exports.object({
|
|
106622
106702
|
id: external_exports.string(),
|
|
106623
106703
|
hostId: external_exports.string().nullable(),
|
|
106624
|
-
backend:
|
|
106704
|
+
backend: localAgentBackendSchema.nullable(),
|
|
106625
106705
|
prompt: external_exports.string(),
|
|
106626
|
-
status:
|
|
106706
|
+
status: localAgentJobStatusSchema,
|
|
106627
106707
|
output: external_exports.string().nullable(),
|
|
106628
106708
|
error: external_exports.string().nullable(),
|
|
106629
106709
|
exitCode: external_exports.number().int().nullable(),
|
|
@@ -106631,13 +106711,13 @@ var remoteAgentRunResponseSchema = external_exports.object({
|
|
|
106631
106711
|
startedAt: external_exports.string().nullable(),
|
|
106632
106712
|
completedAt: external_exports.string().nullable()
|
|
106633
106713
|
});
|
|
106634
|
-
var
|
|
106714
|
+
var localAgentRunListItemSchema = localAgentRunResponseSchema.omit({ output: true, error: true }).extend({
|
|
106635
106715
|
hostName: external_exports.string().nullable()
|
|
106636
106716
|
});
|
|
106637
|
-
var
|
|
106638
|
-
runs: external_exports.array(
|
|
106717
|
+
var localAgentRunListResponseSchema = external_exports.object({
|
|
106718
|
+
runs: external_exports.array(localAgentRunListItemSchema)
|
|
106639
106719
|
});
|
|
106640
|
-
var
|
|
106720
|
+
var localAgentHostJobNextResponseSchema = external_exports.discriminatedUnion(
|
|
106641
106721
|
"status",
|
|
106642
106722
|
[
|
|
106643
106723
|
external_exports.object({ status: external_exports.literal("idle") }),
|
|
@@ -106645,168 +106725,168 @@ var remoteAgentHostJobNextResponseSchema = external_exports.discriminatedUnion(
|
|
|
106645
106725
|
status: external_exports.literal("job"),
|
|
106646
106726
|
job: external_exports.object({
|
|
106647
106727
|
id: external_exports.string(),
|
|
106648
|
-
backend:
|
|
106728
|
+
backend: localAgentBackendSchema,
|
|
106649
106729
|
prompt: external_exports.string()
|
|
106650
106730
|
})
|
|
106651
106731
|
})
|
|
106652
106732
|
]
|
|
106653
106733
|
);
|
|
106654
|
-
var
|
|
106734
|
+
var localAgentHostJobCompleteResponseSchema = external_exports.object({
|
|
106655
106735
|
ok: external_exports.literal(true)
|
|
106656
106736
|
});
|
|
106657
|
-
var
|
|
106737
|
+
var localAgentHostSchema = external_exports.object({
|
|
106658
106738
|
id: external_exports.string(),
|
|
106659
106739
|
displayName: external_exports.string(),
|
|
106660
|
-
supportedBackends: external_exports.array(
|
|
106661
|
-
status:
|
|
106740
|
+
supportedBackends: external_exports.array(localAgentBackendSchema),
|
|
106741
|
+
status: localAgentHostStatusSchema,
|
|
106662
106742
|
lastSeenAt: external_exports.string(),
|
|
106663
106743
|
createdAt: external_exports.string()
|
|
106664
106744
|
});
|
|
106665
|
-
var
|
|
106666
|
-
hosts: external_exports.array(
|
|
106745
|
+
var localAgentHostListResponseSchema = external_exports.object({
|
|
106746
|
+
hosts: external_exports.array(localAgentHostSchema)
|
|
106667
106747
|
});
|
|
106668
|
-
var
|
|
106748
|
+
var localAgentHostStartResponseSchema = external_exports.object({
|
|
106669
106749
|
hostId: external_exports.string(),
|
|
106670
106750
|
hostToken: external_exports.string()
|
|
106671
106751
|
});
|
|
106672
|
-
var
|
|
106752
|
+
var localAgentHostDeleteResponseSchema = external_exports.object({
|
|
106673
106753
|
ok: external_exports.literal(true)
|
|
106674
106754
|
});
|
|
106675
|
-
var
|
|
106755
|
+
var zeroLocalAgentDeviceStartContract = c26.router({
|
|
106676
106756
|
start: {
|
|
106677
106757
|
method: "POST",
|
|
106678
|
-
path: "/api/zero/
|
|
106758
|
+
path: "/api/zero/local-agent/device/start",
|
|
106679
106759
|
body: external_exports.object({
|
|
106680
106760
|
hostName: hostNameSchema,
|
|
106681
106761
|
supportedBackends: supportedBackendsSchema
|
|
106682
106762
|
}),
|
|
106683
106763
|
responses: {
|
|
106684
|
-
200:
|
|
106764
|
+
200: localAgentDeviceStartResponseSchema,
|
|
106685
106765
|
400: apiErrorSchema
|
|
106686
106766
|
},
|
|
106687
|
-
summary: "Start a
|
|
106767
|
+
summary: "Start a local-agent device pairing flow"
|
|
106688
106768
|
}
|
|
106689
106769
|
});
|
|
106690
|
-
var
|
|
106770
|
+
var zeroLocalAgentDevicePollContract = c26.router({
|
|
106691
106771
|
poll: {
|
|
106692
106772
|
method: "POST",
|
|
106693
|
-
path: "/api/zero/
|
|
106773
|
+
path: "/api/zero/local-agent/device/poll",
|
|
106694
106774
|
body: external_exports.object({
|
|
106695
106775
|
deviceCode: external_exports.string().min(1),
|
|
106696
106776
|
pollToken: external_exports.string().min(1)
|
|
106697
106777
|
}),
|
|
106698
106778
|
responses: {
|
|
106699
|
-
200:
|
|
106779
|
+
200: localAgentDevicePollResponseSchema,
|
|
106700
106780
|
400: apiErrorSchema
|
|
106701
106781
|
},
|
|
106702
|
-
summary: "Poll a
|
|
106782
|
+
summary: "Poll a local-agent device pairing flow"
|
|
106703
106783
|
}
|
|
106704
106784
|
});
|
|
106705
|
-
var
|
|
106785
|
+
var zeroLocalAgentDeviceClaimContract = c26.router({
|
|
106706
106786
|
claim: {
|
|
106707
106787
|
method: "POST",
|
|
106708
|
-
path: "/api/zero/
|
|
106788
|
+
path: "/api/zero/local-agent/device/claim",
|
|
106709
106789
|
headers: authHeadersSchema,
|
|
106710
106790
|
body: external_exports.object({
|
|
106711
106791
|
deviceCode: external_exports.string().min(1)
|
|
106712
106792
|
}),
|
|
106713
106793
|
responses: {
|
|
106714
|
-
200:
|
|
106794
|
+
200: localAgentDeviceClaimResponseSchema,
|
|
106715
106795
|
400: apiErrorSchema,
|
|
106716
106796
|
401: apiErrorSchema,
|
|
106717
106797
|
403: apiErrorSchema,
|
|
106718
106798
|
404: apiErrorSchema,
|
|
106719
106799
|
409: apiErrorSchema
|
|
106720
106800
|
},
|
|
106721
|
-
summary: "Approve a
|
|
106801
|
+
summary: "Approve a local-agent device pairing flow"
|
|
106722
106802
|
}
|
|
106723
106803
|
});
|
|
106724
|
-
var
|
|
106804
|
+
var zeroLocalAgentHeartbeatContract = c26.router({
|
|
106725
106805
|
heartbeat: {
|
|
106726
106806
|
method: "POST",
|
|
106727
|
-
path: "/api/zero/
|
|
106807
|
+
path: "/api/zero/local-agent/heartbeat",
|
|
106728
106808
|
headers: authHeadersSchema,
|
|
106729
106809
|
body: external_exports.object({
|
|
106730
106810
|
hostName: hostNameSchema,
|
|
106731
106811
|
supportedBackends: supportedBackendsSchema
|
|
106732
106812
|
}),
|
|
106733
106813
|
responses: {
|
|
106734
|
-
200:
|
|
106814
|
+
200: localAgentHeartbeatResponseSchema,
|
|
106735
106815
|
400: apiErrorSchema,
|
|
106736
106816
|
401: apiErrorSchema
|
|
106737
106817
|
},
|
|
106738
|
-
summary: "Refresh a linked
|
|
106818
|
+
summary: "Refresh a linked local-agent host heartbeat"
|
|
106739
106819
|
}
|
|
106740
106820
|
});
|
|
106741
|
-
var
|
|
106821
|
+
var zeroLocalAgentHostRealtimeContract = c26.router({
|
|
106742
106822
|
create: {
|
|
106743
106823
|
method: "POST",
|
|
106744
|
-
path: "/api/zero/
|
|
106824
|
+
path: "/api/zero/local-agent/host/realtime-token",
|
|
106745
106825
|
headers: authHeadersSchema,
|
|
106746
106826
|
body: external_exports.object({}),
|
|
106747
106827
|
responses: {
|
|
106748
|
-
200:
|
|
106828
|
+
200: localAgentRealtimeSubscriptionSchema,
|
|
106749
106829
|
401: apiErrorSchema
|
|
106750
106830
|
},
|
|
106751
|
-
summary: "Get Ably token for
|
|
106831
|
+
summary: "Get Ably token for local-agent host job notifications"
|
|
106752
106832
|
}
|
|
106753
106833
|
});
|
|
106754
|
-
var
|
|
106834
|
+
var zeroLocalAgentRunContract = c26.router({
|
|
106755
106835
|
list: {
|
|
106756
106836
|
method: "GET",
|
|
106757
|
-
path: "/api/zero/
|
|
106837
|
+
path: "/api/zero/local-agent/runs",
|
|
106758
106838
|
headers: authHeadersSchema,
|
|
106759
106839
|
query: external_exports.object({
|
|
106760
|
-
status:
|
|
106840
|
+
status: localAgentJobStatusSchema.optional(),
|
|
106761
106841
|
hostId: external_exports.string().min(1).optional(),
|
|
106762
106842
|
hostName: external_exports.string().trim().min(1).max(128).optional(),
|
|
106763
106843
|
limit: external_exports.coerce.number().int().min(1).max(100).default(20)
|
|
106764
106844
|
}),
|
|
106765
106845
|
responses: {
|
|
106766
|
-
200:
|
|
106846
|
+
200: localAgentRunListResponseSchema,
|
|
106767
106847
|
401: apiErrorSchema,
|
|
106768
106848
|
403: apiErrorSchema
|
|
106769
106849
|
},
|
|
106770
|
-
summary: "List
|
|
106850
|
+
summary: "List local-agent jobs"
|
|
106771
106851
|
},
|
|
106772
106852
|
create: {
|
|
106773
106853
|
method: "POST",
|
|
106774
|
-
path: "/api/zero/
|
|
106854
|
+
path: "/api/zero/local-agent/run",
|
|
106775
106855
|
headers: authHeadersSchema,
|
|
106776
106856
|
body: external_exports.object({
|
|
106777
106857
|
prompt: promptSchema,
|
|
106778
106858
|
hostName: external_exports.string().trim().min(1).max(128).optional()
|
|
106779
106859
|
}),
|
|
106780
106860
|
responses: {
|
|
106781
|
-
200:
|
|
106861
|
+
200: localAgentRunCreateResponseSchema,
|
|
106782
106862
|
400: apiErrorSchema,
|
|
106783
106863
|
401: apiErrorSchema,
|
|
106784
106864
|
403: apiErrorSchema,
|
|
106785
106865
|
404: apiErrorSchema,
|
|
106786
106866
|
409: apiErrorSchema
|
|
106787
106867
|
},
|
|
106788
|
-
summary: "Create a
|
|
106868
|
+
summary: "Create a local-agent job"
|
|
106789
106869
|
},
|
|
106790
106870
|
get: {
|
|
106791
106871
|
method: "GET",
|
|
106792
|
-
path: "/api/zero/
|
|
106872
|
+
path: "/api/zero/local-agent/run/:jobId",
|
|
106793
106873
|
pathParams: external_exports.object({
|
|
106794
106874
|
jobId: external_exports.string().min(1)
|
|
106795
106875
|
}),
|
|
106796
106876
|
headers: authHeadersSchema,
|
|
106797
106877
|
responses: {
|
|
106798
|
-
200:
|
|
106878
|
+
200: localAgentRunResponseSchema,
|
|
106799
106879
|
401: apiErrorSchema,
|
|
106800
106880
|
403: apiErrorSchema,
|
|
106801
106881
|
404: apiErrorSchema
|
|
106802
106882
|
},
|
|
106803
|
-
summary: "Get a
|
|
106883
|
+
summary: "Get a local-agent job"
|
|
106804
106884
|
}
|
|
106805
106885
|
});
|
|
106806
|
-
var
|
|
106886
|
+
var zeroLocalAgentHostsContract = c26.router({
|
|
106807
106887
|
start: {
|
|
106808
106888
|
method: "POST",
|
|
106809
|
-
path: "/api/zero/
|
|
106889
|
+
path: "/api/zero/local-agent/hosts/start",
|
|
106810
106890
|
headers: authHeadersSchema,
|
|
106811
106891
|
body: external_exports.object({
|
|
106812
106892
|
hostName: hostNameSchema,
|
|
@@ -106814,60 +106894,60 @@ var zeroRemoteAgentHostsContract = c26.router({
|
|
|
106814
106894
|
hostId: external_exports.string().min(1).optional()
|
|
106815
106895
|
}),
|
|
106816
106896
|
responses: {
|
|
106817
|
-
200:
|
|
106897
|
+
200: localAgentHostStartResponseSchema,
|
|
106818
106898
|
400: apiErrorSchema,
|
|
106819
106899
|
401: apiErrorSchema,
|
|
106820
106900
|
403: apiErrorSchema,
|
|
106821
106901
|
404: apiErrorSchema
|
|
106822
106902
|
},
|
|
106823
|
-
summary: "Start or reactivate a
|
|
106903
|
+
summary: "Start or reactivate a local-agent host"
|
|
106824
106904
|
},
|
|
106825
106905
|
list: {
|
|
106826
106906
|
method: "GET",
|
|
106827
|
-
path: "/api/zero/
|
|
106907
|
+
path: "/api/zero/local-agent/hosts",
|
|
106828
106908
|
headers: authHeadersSchema,
|
|
106829
106909
|
responses: {
|
|
106830
|
-
200:
|
|
106910
|
+
200: localAgentHostListResponseSchema,
|
|
106831
106911
|
401: apiErrorSchema,
|
|
106832
106912
|
403: apiErrorSchema
|
|
106833
106913
|
},
|
|
106834
|
-
summary: "List linked
|
|
106914
|
+
summary: "List linked local-agent hosts"
|
|
106835
106915
|
},
|
|
106836
106916
|
delete: {
|
|
106837
106917
|
method: "DELETE",
|
|
106838
|
-
path: "/api/zero/
|
|
106918
|
+
path: "/api/zero/local-agent/hosts/:hostId",
|
|
106839
106919
|
pathParams: external_exports.object({
|
|
106840
106920
|
hostId: external_exports.string().min(1)
|
|
106841
106921
|
}),
|
|
106842
106922
|
headers: authHeadersSchema,
|
|
106843
106923
|
body: c26.noBody(),
|
|
106844
106924
|
responses: {
|
|
106845
|
-
200:
|
|
106925
|
+
200: localAgentHostDeleteResponseSchema,
|
|
106846
106926
|
401: apiErrorSchema,
|
|
106847
106927
|
403: apiErrorSchema,
|
|
106848
106928
|
404: apiErrorSchema
|
|
106849
106929
|
},
|
|
106850
|
-
summary: "Delete a
|
|
106930
|
+
summary: "Delete a local-agent host"
|
|
106851
106931
|
}
|
|
106852
106932
|
});
|
|
106853
|
-
var
|
|
106933
|
+
var zeroLocalAgentHostJobsContract = c26.router({
|
|
106854
106934
|
next: {
|
|
106855
106935
|
method: "POST",
|
|
106856
|
-
path: "/api/zero/
|
|
106936
|
+
path: "/api/zero/local-agent/host/jobs/next",
|
|
106857
106937
|
headers: authHeadersSchema,
|
|
106858
106938
|
body: external_exports.object({
|
|
106859
106939
|
supportedBackends: supportedBackendsSchema
|
|
106860
106940
|
}),
|
|
106861
106941
|
responses: {
|
|
106862
|
-
200:
|
|
106942
|
+
200: localAgentHostJobNextResponseSchema,
|
|
106863
106943
|
400: apiErrorSchema,
|
|
106864
106944
|
401: apiErrorSchema
|
|
106865
106945
|
},
|
|
106866
|
-
summary: "Claim the next
|
|
106946
|
+
summary: "Claim the next local-agent host job"
|
|
106867
106947
|
},
|
|
106868
106948
|
complete: {
|
|
106869
106949
|
method: "POST",
|
|
106870
|
-
path: "/api/zero/
|
|
106950
|
+
path: "/api/zero/local-agent/host/jobs/:jobId/complete",
|
|
106871
106951
|
pathParams: external_exports.object({
|
|
106872
106952
|
jobId: external_exports.string().min(1)
|
|
106873
106953
|
}),
|
|
@@ -106879,21 +106959,21 @@ var zeroRemoteAgentHostJobsContract = c26.router({
|
|
|
106879
106959
|
exitCode: external_exports.number().int().optional()
|
|
106880
106960
|
}),
|
|
106881
106961
|
responses: {
|
|
106882
|
-
200:
|
|
106962
|
+
200: localAgentHostJobCompleteResponseSchema,
|
|
106883
106963
|
400: apiErrorSchema,
|
|
106884
106964
|
401: apiErrorSchema,
|
|
106885
106965
|
404: apiErrorSchema,
|
|
106886
106966
|
409: apiErrorSchema
|
|
106887
106967
|
},
|
|
106888
|
-
summary: "Complete a
|
|
106968
|
+
summary: "Complete a local-agent host job"
|
|
106889
106969
|
}
|
|
106890
106970
|
});
|
|
106891
106971
|
|
|
106892
|
-
// src/lib/api/domains/zero-
|
|
106972
|
+
// src/lib/api/domains/zero-local-agent.ts
|
|
106893
106973
|
function normalizeConfiguredUrl(value) {
|
|
106894
106974
|
return value.startsWith("http") ? value : `https://${value}`;
|
|
106895
106975
|
}
|
|
106896
|
-
function
|
|
106976
|
+
function resolveLocalAgentApiBaseUrl(baseUrl) {
|
|
106897
106977
|
const override = process.env.VM0_API_BACKEND_URL;
|
|
106898
106978
|
if (override) {
|
|
106899
106979
|
return normalizeConfiguredUrl(override).replace(/\/$/, "");
|
|
@@ -106915,8 +106995,8 @@ function buildHeaders2(token) {
|
|
|
106915
106995
|
}
|
|
106916
106996
|
return headers;
|
|
106917
106997
|
}
|
|
106918
|
-
async function
|
|
106919
|
-
const baseUrl =
|
|
106998
|
+
async function getLocalAgentClientConfig() {
|
|
106999
|
+
const baseUrl = resolveLocalAgentApiBaseUrl(await getBaseUrl());
|
|
106920
107000
|
const token = await getActiveToken();
|
|
106921
107001
|
if (!token) {
|
|
106922
107002
|
throw new ApiRequestError("Not authenticated", "UNAUTHORIZED", 401);
|
|
@@ -106930,9 +107010,9 @@ async function getRemoteAgentClientConfig() {
|
|
|
106930
107010
|
function buildBearerHeaders(token) {
|
|
106931
107011
|
return buildHeaders2(token);
|
|
106932
107012
|
}
|
|
106933
|
-
async function
|
|
106934
|
-
const baseUrl =
|
|
106935
|
-
const client = initClient(
|
|
107013
|
+
async function sendLocalAgentHeartbeat(params) {
|
|
107014
|
+
const baseUrl = resolveLocalAgentApiBaseUrl(await getBaseUrl());
|
|
107015
|
+
const client = initClient(zeroLocalAgentHeartbeatContract, {
|
|
106936
107016
|
baseUrl,
|
|
106937
107017
|
baseHeaders: buildBearerHeaders(params.hostToken),
|
|
106938
107018
|
jsonQuery: false
|
|
@@ -106946,11 +107026,11 @@ async function sendRemoteAgentHeartbeat(params) {
|
|
|
106946
107026
|
if (result.status === 200) {
|
|
106947
107027
|
return { hostId: result.body.hostId };
|
|
106948
107028
|
}
|
|
106949
|
-
handleError(result, "Failed to send
|
|
107029
|
+
handleError(result, "Failed to send local-agent heartbeat");
|
|
106950
107030
|
}
|
|
106951
|
-
async function
|
|
106952
|
-
const baseUrl =
|
|
106953
|
-
const client = initClient(
|
|
107031
|
+
async function createLocalAgentHostRealtimeSubscription(params) {
|
|
107032
|
+
const baseUrl = resolveLocalAgentApiBaseUrl(await getBaseUrl());
|
|
107033
|
+
const client = initClient(zeroLocalAgentHostRealtimeContract, {
|
|
106954
107034
|
baseUrl,
|
|
106955
107035
|
baseHeaders: buildBearerHeaders(params.hostToken),
|
|
106956
107036
|
jsonQuery: false
|
|
@@ -106959,58 +107039,58 @@ async function createRemoteAgentHostRealtimeSubscription(params) {
|
|
|
106959
107039
|
if (result.status === 200) {
|
|
106960
107040
|
return result.body;
|
|
106961
107041
|
}
|
|
106962
|
-
handleError(result, "Failed to create
|
|
107042
|
+
handleError(result, "Failed to create local-agent realtime subscription");
|
|
106963
107043
|
}
|
|
106964
|
-
async function
|
|
106965
|
-
const config4 = await
|
|
106966
|
-
const client = initClient(
|
|
107044
|
+
async function createLocalAgentRun(params) {
|
|
107045
|
+
const config4 = await getLocalAgentClientConfig();
|
|
107046
|
+
const client = initClient(zeroLocalAgentRunContract, config4);
|
|
106967
107047
|
const result = await client.create({ body: params });
|
|
106968
107048
|
if (result.status === 200) {
|
|
106969
107049
|
return result.body;
|
|
106970
107050
|
}
|
|
106971
|
-
handleError(result, "Failed to create
|
|
107051
|
+
handleError(result, "Failed to create local-agent run");
|
|
106972
107052
|
}
|
|
106973
|
-
async function
|
|
106974
|
-
const config4 = await
|
|
106975
|
-
const client = initClient(
|
|
107053
|
+
async function startLocalAgentHost(params) {
|
|
107054
|
+
const config4 = await getLocalAgentClientConfig();
|
|
107055
|
+
const client = initClient(zeroLocalAgentHostsContract, config4);
|
|
106976
107056
|
const result = await client.start({ body: params });
|
|
106977
107057
|
if (result.status === 200) {
|
|
106978
107058
|
return result.body;
|
|
106979
107059
|
}
|
|
106980
|
-
handleError(result, "Failed to start
|
|
107060
|
+
handleError(result, "Failed to start local-agent host");
|
|
106981
107061
|
}
|
|
106982
|
-
async function
|
|
106983
|
-
const config4 = await
|
|
106984
|
-
const client = initClient(
|
|
107062
|
+
async function listLocalAgentHosts() {
|
|
107063
|
+
const config4 = await getLocalAgentClientConfig();
|
|
107064
|
+
const client = initClient(zeroLocalAgentHostsContract, config4);
|
|
106985
107065
|
const result = await client.list({ headers: {} });
|
|
106986
107066
|
if (result.status === 200) {
|
|
106987
107067
|
return result.body;
|
|
106988
107068
|
}
|
|
106989
|
-
handleError(result, "Failed to list
|
|
107069
|
+
handleError(result, "Failed to list local-agent hosts");
|
|
106990
107070
|
}
|
|
106991
|
-
async function
|
|
106992
|
-
const config4 = await
|
|
106993
|
-
const client = initClient(
|
|
107071
|
+
async function deleteLocalAgentHost(hostId) {
|
|
107072
|
+
const config4 = await getLocalAgentClientConfig();
|
|
107073
|
+
const client = initClient(zeroLocalAgentHostsContract, config4);
|
|
106994
107074
|
const result = await client.delete({
|
|
106995
107075
|
params: { hostId }
|
|
106996
107076
|
});
|
|
106997
107077
|
if (result.status === 200) {
|
|
106998
107078
|
return;
|
|
106999
107079
|
}
|
|
107000
|
-
handleError(result, "Failed to delete
|
|
107080
|
+
handleError(result, "Failed to delete local-agent host");
|
|
107001
107081
|
}
|
|
107002
|
-
async function
|
|
107003
|
-
const config4 = await
|
|
107004
|
-
const client = initClient(
|
|
107082
|
+
async function getLocalAgentRun(jobId) {
|
|
107083
|
+
const config4 = await getLocalAgentClientConfig();
|
|
107084
|
+
const client = initClient(zeroLocalAgentRunContract, config4);
|
|
107005
107085
|
const result = await client.get({ params: { jobId } });
|
|
107006
107086
|
if (result.status === 200) {
|
|
107007
107087
|
return result.body;
|
|
107008
107088
|
}
|
|
107009
|
-
handleError(result, "Failed to get
|
|
107089
|
+
handleError(result, "Failed to get local-agent run");
|
|
107010
107090
|
}
|
|
107011
|
-
async function
|
|
107012
|
-
const config4 = await
|
|
107013
|
-
const client = initClient(
|
|
107091
|
+
async function listLocalAgentRuns(params) {
|
|
107092
|
+
const config4 = await getLocalAgentClientConfig();
|
|
107093
|
+
const client = initClient(zeroLocalAgentRunContract, config4);
|
|
107014
107094
|
const result = await client.list({
|
|
107015
107095
|
headers: {},
|
|
107016
107096
|
query: {
|
|
@@ -107021,11 +107101,11 @@ async function listRemoteAgentRuns(params) {
|
|
|
107021
107101
|
if (result.status === 200) {
|
|
107022
107102
|
return result.body;
|
|
107023
107103
|
}
|
|
107024
|
-
handleError(result, "Failed to list
|
|
107104
|
+
handleError(result, "Failed to list local-agent runs");
|
|
107025
107105
|
}
|
|
107026
|
-
async function
|
|
107027
|
-
const baseUrl =
|
|
107028
|
-
const client = initClient(
|
|
107106
|
+
async function claimNextLocalAgentHostJob(params) {
|
|
107107
|
+
const baseUrl = resolveLocalAgentApiBaseUrl(await getBaseUrl());
|
|
107108
|
+
const client = initClient(zeroLocalAgentHostJobsContract, {
|
|
107029
107109
|
baseUrl,
|
|
107030
107110
|
baseHeaders: buildBearerHeaders(params.hostToken),
|
|
107031
107111
|
jsonQuery: false
|
|
@@ -107036,11 +107116,11 @@ async function claimNextRemoteAgentHostJob(params) {
|
|
|
107036
107116
|
if (result.status === 200) {
|
|
107037
107117
|
return result.body;
|
|
107038
107118
|
}
|
|
107039
|
-
handleError(result, "Failed to claim
|
|
107119
|
+
handleError(result, "Failed to claim local-agent job");
|
|
107040
107120
|
}
|
|
107041
|
-
async function
|
|
107042
|
-
const baseUrl =
|
|
107043
|
-
const client = initClient(
|
|
107121
|
+
async function completeLocalAgentHostJob(params) {
|
|
107122
|
+
const baseUrl = resolveLocalAgentApiBaseUrl(await getBaseUrl());
|
|
107123
|
+
const client = initClient(zeroLocalAgentHostJobsContract, {
|
|
107044
107124
|
baseUrl,
|
|
107045
107125
|
baseHeaders: buildBearerHeaders(params.hostToken),
|
|
107046
107126
|
jsonQuery: false
|
|
@@ -107057,7 +107137,7 @@ async function completeRemoteAgentHostJob(params) {
|
|
|
107057
107137
|
if (result.status === 200) {
|
|
107058
107138
|
return;
|
|
107059
107139
|
}
|
|
107060
|
-
handleError(result, "Failed to complete
|
|
107140
|
+
handleError(result, "Failed to complete local-agent job");
|
|
107061
107141
|
}
|
|
107062
107142
|
|
|
107063
107143
|
// src/lib/api/domains/zero-local-browser.ts
|
|
@@ -108522,7 +108602,7 @@ async function promptPassword(message) {
|
|
|
108522
108602
|
return response.value;
|
|
108523
108603
|
}
|
|
108524
108604
|
|
|
108525
|
-
// src/lib/
|
|
108605
|
+
// src/lib/local-agent/backends.ts
|
|
108526
108606
|
init_esm_shims();
|
|
108527
108607
|
|
|
108528
108608
|
// src/lib/utils/spawn.ts
|
|
@@ -108537,7 +108617,7 @@ function safeSpawn(command, args, options) {
|
|
|
108537
108617
|
});
|
|
108538
108618
|
}
|
|
108539
108619
|
|
|
108540
|
-
// src/lib/
|
|
108620
|
+
// src/lib/local-agent/backends.ts
|
|
108541
108621
|
var BACKEND_COMMANDS = [
|
|
108542
108622
|
{ backend: "codex", command: "codex" },
|
|
108543
108623
|
{ backend: "claude-code", command: "claude" }
|
|
@@ -108587,7 +108667,7 @@ async function probeBackend(backend, command) {
|
|
|
108587
108667
|
});
|
|
108588
108668
|
});
|
|
108589
108669
|
}
|
|
108590
|
-
async function
|
|
108670
|
+
async function detectLocalAgentBackends() {
|
|
108591
108671
|
return Promise.all(
|
|
108592
108672
|
BACKEND_COMMANDS.map(({ backend, command }) => {
|
|
108593
108673
|
return probeBackend(backend, command);
|
|
@@ -108615,11 +108695,16 @@ function codexPermissionArgs(mode) {
|
|
|
108615
108695
|
}
|
|
108616
108696
|
throw new Error(`Unsupported Codex permission mode: ${mode}`);
|
|
108617
108697
|
}
|
|
108618
|
-
function executionCommand(backend, prompt, permissionMode) {
|
|
108698
|
+
function executionCommand(backend, prompt, permissionMode, claudeArgs = []) {
|
|
108619
108699
|
if (backend === "claude-code") {
|
|
108620
108700
|
return {
|
|
108621
108701
|
command: "claude",
|
|
108622
|
-
args: [
|
|
108702
|
+
args: [
|
|
108703
|
+
"-p",
|
|
108704
|
+
...claudePermissionArgs(permissionMode),
|
|
108705
|
+
...claudeArgs,
|
|
108706
|
+
prompt
|
|
108707
|
+
]
|
|
108623
108708
|
};
|
|
108624
108709
|
}
|
|
108625
108710
|
return {
|
|
@@ -108634,11 +108719,12 @@ function appendLimited(current, chunk) {
|
|
|
108634
108719
|
}
|
|
108635
108720
|
return next.slice(-MAX_OUTPUT_BYTES);
|
|
108636
108721
|
}
|
|
108637
|
-
async function
|
|
108722
|
+
async function executeLocalAgentBackend(params) {
|
|
108638
108723
|
const { command, args } = executionCommand(
|
|
108639
108724
|
params.backend,
|
|
108640
108725
|
params.prompt,
|
|
108641
|
-
params.permissionMode
|
|
108726
|
+
params.permissionMode,
|
|
108727
|
+
params.claudeArgs
|
|
108642
108728
|
);
|
|
108643
108729
|
return new Promise((resolve2) => {
|
|
108644
108730
|
const child = safeSpawn(command, args, {
|
|
@@ -108681,7 +108767,7 @@ async function executeRemoteAgentBackend(params) {
|
|
|
108681
108767
|
});
|
|
108682
108768
|
}
|
|
108683
108769
|
|
|
108684
|
-
// src/commands/zero/
|
|
108770
|
+
// src/commands/zero/local-agent/host.ts
|
|
108685
108771
|
var HEARTBEAT_INTERVAL_MS = 3e4;
|
|
108686
108772
|
var JOB_POLL_INTERVAL_MS = 2e3;
|
|
108687
108773
|
var ABLY_CONNECT_TIMEOUT_MS2 = 1e4;
|
|
@@ -108706,7 +108792,7 @@ function createHostRealtime(hostToken, initialSubscription) {
|
|
|
108706
108792
|
callback(null, current.tokenRequest);
|
|
108707
108793
|
return;
|
|
108708
108794
|
}
|
|
108709
|
-
|
|
108795
|
+
createLocalAgentHostRealtimeSubscription({ hostToken }).then(
|
|
108710
108796
|
(subscription) => {
|
|
108711
108797
|
callback(null, subscription.tokenRequest);
|
|
108712
108798
|
},
|
|
@@ -108747,8 +108833,8 @@ function waitForRealtimeConnected2(ably, timeoutMs = ABLY_CONNECT_TIMEOUT_MS2) {
|
|
|
108747
108833
|
});
|
|
108748
108834
|
});
|
|
108749
108835
|
}
|
|
108750
|
-
async function
|
|
108751
|
-
const subscription = await
|
|
108836
|
+
async function createLocalAgentJobNotifier(hostToken) {
|
|
108837
|
+
const subscription = await createLocalAgentHostRealtimeSubscription({
|
|
108752
108838
|
hostToken
|
|
108753
108839
|
});
|
|
108754
108840
|
const ably = createHostRealtime(hostToken, subscription);
|
|
@@ -108921,7 +109007,7 @@ function assertHostNameAvailable(hostName, hosts) {
|
|
|
108921
109007
|
return;
|
|
108922
109008
|
}
|
|
108923
109009
|
throw new Error(
|
|
108924
|
-
`
|
|
109010
|
+
`Local-agent host name already exists: ${hostName}. Use --host-id ${existingHost.id} to reactivate it, or choose another --name.`
|
|
108925
109011
|
);
|
|
108926
109012
|
}
|
|
108927
109013
|
async function promptNewHostName(params) {
|
|
@@ -108947,7 +109033,7 @@ async function promptNewHostName(params) {
|
|
|
108947
109033
|
}
|
|
108948
109034
|
if (!isInteractive()) {
|
|
108949
109035
|
throw new Error(
|
|
108950
|
-
"
|
|
109036
|
+
"Local-agent start requires a host name in non-interactive mode. Use --name <name>."
|
|
108951
109037
|
);
|
|
108952
109038
|
}
|
|
108953
109039
|
throw new Error("Host name selection cancelled");
|
|
@@ -108956,7 +109042,7 @@ async function chooseHostForStart(params) {
|
|
|
108956
109042
|
if (params.requestedHostId && params.createNew) {
|
|
108957
109043
|
throw new Error("Use either --host-id or --new, not both");
|
|
108958
109044
|
}
|
|
108959
|
-
const { hosts } = await
|
|
109045
|
+
const { hosts } = await listLocalAgentHosts();
|
|
108960
109046
|
const closedHosts = hosts.filter((host) => {
|
|
108961
109047
|
return host.status === "closed";
|
|
108962
109048
|
});
|
|
@@ -108966,7 +109052,7 @@ async function chooseHostForStart(params) {
|
|
|
108966
109052
|
return item.id === params.requestedHostId;
|
|
108967
109053
|
});
|
|
108968
109054
|
if (!host) {
|
|
108969
|
-
throw new Error("
|
|
109055
|
+
throw new Error("Local-agent host not found");
|
|
108970
109056
|
}
|
|
108971
109057
|
return restoreHostSelection(host);
|
|
108972
109058
|
}
|
|
@@ -108984,7 +109070,7 @@ async function chooseHostForStart(params) {
|
|
|
108984
109070
|
});
|
|
108985
109071
|
if (matchingNameHosts.length > 1) {
|
|
108986
109072
|
throw new Error(
|
|
108987
|
-
`Multiple
|
|
109073
|
+
`Multiple local-agent hosts are named ${requestedHostName}. Use --host-id <id> to choose one.`
|
|
108988
109074
|
);
|
|
108989
109075
|
}
|
|
108990
109076
|
const [host] = matchingNameHosts;
|
|
@@ -108995,12 +109081,12 @@ async function chooseHostForStart(params) {
|
|
|
108995
109081
|
return restoreHostSelection(host);
|
|
108996
109082
|
}
|
|
108997
109083
|
throw new Error(
|
|
108998
|
-
`
|
|
109084
|
+
`Local-agent host is already online: ${requestedHostName}. Choose another --name or delete the existing host first.`
|
|
108999
109085
|
);
|
|
109000
109086
|
}
|
|
109001
109087
|
if (!isInteractive()) {
|
|
109002
109088
|
throw new Error(
|
|
109003
|
-
"
|
|
109089
|
+
"Local-agent start requires a host name in non-interactive mode. Use --name <name> or --host-id <id>."
|
|
109004
109090
|
);
|
|
109005
109091
|
}
|
|
109006
109092
|
if (closedHosts.length > 0) {
|
|
@@ -109026,12 +109112,12 @@ async function chooseHostForStart(params) {
|
|
|
109026
109112
|
return host2.id === params.savedHostId;
|
|
109027
109113
|
});
|
|
109028
109114
|
const selected = await promptSelect(
|
|
109029
|
-
"Start
|
|
109115
|
+
"Start local-agent host:",
|
|
109030
109116
|
choices,
|
|
109031
109117
|
savedIndex >= 0 ? savedIndex + 1 : 0
|
|
109032
109118
|
);
|
|
109033
109119
|
if (!selected) {
|
|
109034
|
-
throw new Error("
|
|
109120
|
+
throw new Error("Local-agent host selection cancelled");
|
|
109035
109121
|
}
|
|
109036
109122
|
if (selected === NEW_HOST_SELECTION) {
|
|
109037
109123
|
return {
|
|
@@ -109045,7 +109131,7 @@ async function chooseHostForStart(params) {
|
|
|
109045
109131
|
return item.id === selected;
|
|
109046
109132
|
});
|
|
109047
109133
|
if (!host) {
|
|
109048
|
-
throw new Error("
|
|
109134
|
+
throw new Error("Local-agent host not found");
|
|
109049
109135
|
}
|
|
109050
109136
|
return restoreHostSelection(host);
|
|
109051
109137
|
}
|
|
@@ -109076,7 +109162,7 @@ async function chooseBackend(probes, requestedBackend) {
|
|
|
109076
109162
|
});
|
|
109077
109163
|
if (available.length === 0) {
|
|
109078
109164
|
throw new Error(
|
|
109079
|
-
"No supported agent CLI found. Install Codex CLI (`codex`) or Claude Code (`claude`) before starting
|
|
109165
|
+
"No supported agent CLI found. Install Codex CLI (`codex`) or Claude Code (`claude`) before starting local-agent."
|
|
109080
109166
|
);
|
|
109081
109167
|
}
|
|
109082
109168
|
if (requestedBackend) {
|
|
@@ -109106,7 +109192,7 @@ async function chooseBackend(probes, requestedBackend) {
|
|
|
109106
109192
|
if (!selected) {
|
|
109107
109193
|
if (!isInteractive()) {
|
|
109108
109194
|
throw new Error(
|
|
109109
|
-
"
|
|
109195
|
+
"Local-agent start requires a backend in non-interactive mode. Use --backend codex or --backend claude-code."
|
|
109110
109196
|
);
|
|
109111
109197
|
}
|
|
109112
109198
|
throw new Error("Backend selection cancelled");
|
|
@@ -109131,7 +109217,7 @@ function chooseRestoredBackend(params) {
|
|
|
109131
109217
|
}
|
|
109132
109218
|
if (!params.host.supportedBackends.includes(backend)) {
|
|
109133
109219
|
throw new Error(
|
|
109134
|
-
`
|
|
109220
|
+
`Local-agent host "${params.host.displayName}" was configured for ${formatSupportedBackends(
|
|
109135
109221
|
params.host.supportedBackends
|
|
109136
109222
|
)}.`
|
|
109137
109223
|
);
|
|
@@ -109157,7 +109243,7 @@ async function choosePermissionMode(backend, requestedPermissionMode) {
|
|
|
109157
109243
|
if (!selected) {
|
|
109158
109244
|
if (!isInteractive()) {
|
|
109159
109245
|
throw new Error(
|
|
109160
|
-
"
|
|
109246
|
+
"Local-agent start requires a permission mode in non-interactive mode. Use --permission-mode default or another supported mode."
|
|
109161
109247
|
);
|
|
109162
109248
|
}
|
|
109163
109249
|
throw new Error("Permission mode selection cancelled");
|
|
@@ -109189,12 +109275,12 @@ async function runHostLoop(params) {
|
|
|
109189
109275
|
};
|
|
109190
109276
|
const sendHeartbeat = async () => {
|
|
109191
109277
|
try {
|
|
109192
|
-
await
|
|
109278
|
+
await sendLocalAgentHeartbeat(params);
|
|
109193
109279
|
nextHeartbeatAt = Date.now() + HEARTBEAT_INTERVAL_MS;
|
|
109194
109280
|
latestError = null;
|
|
109195
109281
|
} catch (error49) {
|
|
109196
109282
|
if (isInvalidHostTokenError(error49)) {
|
|
109197
|
-
console.log(source_default.yellow("
|
|
109283
|
+
console.log(source_default.yellow("Local-agent host was deleted; stopping."));
|
|
109198
109284
|
onStop();
|
|
109199
109285
|
return;
|
|
109200
109286
|
}
|
|
@@ -109206,7 +109292,7 @@ async function runHostLoop(params) {
|
|
|
109206
109292
|
}
|
|
109207
109293
|
};
|
|
109208
109294
|
try {
|
|
109209
|
-
jobNotifier = await
|
|
109295
|
+
jobNotifier = await createLocalAgentJobNotifier(params.hostToken);
|
|
109210
109296
|
} catch (error49) {
|
|
109211
109297
|
console.log(
|
|
109212
109298
|
source_default.yellow(
|
|
@@ -109224,13 +109310,13 @@ async function runHostLoop(params) {
|
|
|
109224
109310
|
}
|
|
109225
109311
|
let nextJob;
|
|
109226
109312
|
try {
|
|
109227
|
-
nextJob = await
|
|
109313
|
+
nextJob = await claimNextLocalAgentHostJob({
|
|
109228
109314
|
hostToken: params.hostToken,
|
|
109229
109315
|
supportedBackends: params.supportedBackends
|
|
109230
109316
|
});
|
|
109231
109317
|
} catch (error49) {
|
|
109232
109318
|
if (isInvalidHostTokenError(error49)) {
|
|
109233
|
-
console.log(source_default.yellow("
|
|
109319
|
+
console.log(source_default.yellow("Local-agent host was deleted; stopping."));
|
|
109234
109320
|
onStop();
|
|
109235
109321
|
continue;
|
|
109236
109322
|
}
|
|
@@ -109252,13 +109338,14 @@ async function runHostLoop(params) {
|
|
|
109252
109338
|
`Running ${backendLabel(nextJob.job.backend)} job ${nextJob.job.id}`
|
|
109253
109339
|
)
|
|
109254
109340
|
);
|
|
109255
|
-
const result = await
|
|
109341
|
+
const result = await executeLocalAgentBackend({
|
|
109256
109342
|
backend: nextJob.job.backend,
|
|
109257
109343
|
prompt: nextJob.job.prompt,
|
|
109258
109344
|
workdir: params.workdir,
|
|
109345
|
+
claudeArgs: params.claudeArgs,
|
|
109259
109346
|
permissionMode: params.permissionMode
|
|
109260
109347
|
});
|
|
109261
|
-
await
|
|
109348
|
+
await completeLocalAgentHostJob({
|
|
109262
109349
|
hostToken: params.hostToken,
|
|
109263
109350
|
jobId: nextJob.job.id,
|
|
109264
109351
|
status: result.exitCode === 0 ? "succeeded" : "failed",
|
|
@@ -109275,14 +109362,22 @@ async function runHostLoop(params) {
|
|
|
109275
109362
|
process.removeListener("SIGTERM", onStop);
|
|
109276
109363
|
}
|
|
109277
109364
|
}
|
|
109278
|
-
var startCommand = new Command().name("start").description("Start the
|
|
109365
|
+
var startCommand = new Command().name("start").description("Start the local-agent host daemon").option("--name <name>", "New host name, or a closed host name to reactivate").option("--workdir <path>", "Working directory for Codex/Claude jobs").option("--backend <backend>", "codex or claude-code for a new host").option(
|
|
109366
|
+
"--claude-arg <arg>",
|
|
109367
|
+
"Additional argument to pass to Claude Code jobs",
|
|
109368
|
+
(value, previous) => {
|
|
109369
|
+
return [...previous, value];
|
|
109370
|
+
},
|
|
109371
|
+
[]
|
|
109372
|
+
).option("--permission-mode <mode>", "Permission mode for Codex/Claude jobs").option(
|
|
109279
109373
|
"--host-id <id>",
|
|
109280
|
-
"Reactivate a closed host from vm0
|
|
109374
|
+
"Reactivate a closed host from vm0 local-agent list"
|
|
109281
109375
|
).option("--new", "Create a new host registration").action(
|
|
109282
109376
|
withErrorHandler(async (options) => {
|
|
109283
109377
|
const requestedHostName = options.name?.trim();
|
|
109284
109378
|
const workdir = options.workdir?.trim() || process.cwd();
|
|
109285
|
-
const
|
|
109379
|
+
const claudeArgs = options.claudeArg ?? [];
|
|
109380
|
+
const savedHost = await getLocalAgentHost();
|
|
109286
109381
|
const selection = await chooseHostForStart({
|
|
109287
109382
|
requestedHostName,
|
|
109288
109383
|
requestedHostId: options.hostId?.trim(),
|
|
@@ -109290,7 +109385,7 @@ var startCommand = new Command().name("start").description("Start the remote-age
|
|
|
109290
109385
|
savedHostId: savedHost?.id
|
|
109291
109386
|
});
|
|
109292
109387
|
console.log(source_default.cyan("Detecting local agent CLIs..."));
|
|
109293
|
-
const probes = await
|
|
109388
|
+
const probes = await detectLocalAgentBackends();
|
|
109294
109389
|
const available = probes.filter((probe) => {
|
|
109295
109390
|
return probe.available;
|
|
109296
109391
|
});
|
|
@@ -109305,6 +109400,9 @@ var startCommand = new Command().name("start").description("Start the remote-age
|
|
|
109305
109400
|
probes,
|
|
109306
109401
|
requestedBackend: options.backend
|
|
109307
109402
|
}) : await chooseBackend(probes, options.backend);
|
|
109403
|
+
if (claudeArgs.length > 0 && selectedBackend !== "claude-code") {
|
|
109404
|
+
throw new Error("--claude-arg can only be used with Claude Code jobs");
|
|
109405
|
+
}
|
|
109308
109406
|
const permissionMode = selection.restoredHost ? chooseRestoredPermissionMode({
|
|
109309
109407
|
backend: selectedBackend,
|
|
109310
109408
|
requestedPermissionMode: options.permissionMode,
|
|
@@ -109319,14 +109417,14 @@ var startCommand = new Command().name("start").description("Start the remote-age
|
|
|
109319
109417
|
console.log(`Using ${backendLabel(selectedBackend)}`);
|
|
109320
109418
|
console.log(`Permission mode: ${permissionModeLabel(permissionMode)}`);
|
|
109321
109419
|
const baseUrl = await getBaseUrl();
|
|
109322
|
-
console.log(source_default.cyan("Starting
|
|
109420
|
+
console.log(source_default.cyan("Starting local-agent host..."));
|
|
109323
109421
|
const startParams = {
|
|
109324
109422
|
hostName: selection.hostName,
|
|
109325
109423
|
supportedBackends,
|
|
109326
109424
|
...selection.hostId ? { hostId: selection.hostId } : {}
|
|
109327
109425
|
};
|
|
109328
|
-
const started = await
|
|
109329
|
-
await
|
|
109426
|
+
const started = await startLocalAgentHost(startParams);
|
|
109427
|
+
await saveLocalAgentHost({
|
|
109330
109428
|
id: started.hostId,
|
|
109331
109429
|
token: started.hostToken,
|
|
109332
109430
|
apiUrl: baseUrl,
|
|
@@ -109335,7 +109433,7 @@ var startCommand = new Command().name("start").description("Start the remote-age
|
|
|
109335
109433
|
permissionMode,
|
|
109336
109434
|
linkedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
109337
109435
|
});
|
|
109338
|
-
console.log(source_default.green(`
|
|
109436
|
+
console.log(source_default.green(`Local-agent host active: ${started.hostId}`));
|
|
109339
109437
|
console.log(`Workdir: ${workdir}`);
|
|
109340
109438
|
console.log(source_default.dim("Press ^C to stop"));
|
|
109341
109439
|
console.log();
|
|
@@ -109343,18 +109441,19 @@ var startCommand = new Command().name("start").description("Start the remote-age
|
|
|
109343
109441
|
hostToken: started.hostToken,
|
|
109344
109442
|
hostName: selection.hostName,
|
|
109345
109443
|
supportedBackends,
|
|
109444
|
+
claudeArgs,
|
|
109346
109445
|
permissionMode,
|
|
109347
109446
|
workdir
|
|
109348
109447
|
});
|
|
109349
109448
|
console.log();
|
|
109350
|
-
console.log(source_default.green("
|
|
109449
|
+
console.log(source_default.green("Local-agent host stopped"));
|
|
109351
109450
|
})
|
|
109352
109451
|
);
|
|
109353
109452
|
|
|
109354
|
-
// src/commands/zero/
|
|
109453
|
+
// src/commands/zero/local-agent/delete.ts
|
|
109355
109454
|
init_esm_shims();
|
|
109356
|
-
async function
|
|
109357
|
-
const { hosts } = await
|
|
109455
|
+
async function resolveLocalAgentHost(target) {
|
|
109456
|
+
const { hosts } = await listLocalAgentHosts();
|
|
109358
109457
|
const idMatch = hosts.find((host) => {
|
|
109359
109458
|
return host.id === target;
|
|
109360
109459
|
});
|
|
@@ -109372,24 +109471,22 @@ async function resolveRemoteAgentHost(target) {
|
|
|
109372
109471
|
}
|
|
109373
109472
|
if (nameMatches.length > 1) {
|
|
109374
109473
|
throw new Error(
|
|
109375
|
-
`Multiple
|
|
109474
|
+
`Multiple local-agent hosts are named ${target}. Use the host id from vm0 local-agent list.`
|
|
109376
109475
|
);
|
|
109377
109476
|
}
|
|
109378
|
-
throw new Error(`
|
|
109477
|
+
throw new Error(`Local-agent host not found: ${target}`);
|
|
109379
109478
|
}
|
|
109380
|
-
var deleteCommand = new Command().name("delete").description("Delete a
|
|
109479
|
+
var deleteCommand = new Command().name("delete").description("Delete a local-agent host").argument("<host>", "Host id or name from vm0 local-agent list").action(
|
|
109381
109480
|
withErrorHandler(async (target) => {
|
|
109382
|
-
const host = await
|
|
109383
|
-
await
|
|
109384
|
-
await
|
|
109385
|
-
console.log(
|
|
109386
|
-
source_default.green(`Remote-agent host deleted: ${host.displayName}`)
|
|
109387
|
-
);
|
|
109481
|
+
const host = await resolveLocalAgentHost(target.trim());
|
|
109482
|
+
await deleteLocalAgentHost(host.id);
|
|
109483
|
+
await clearLocalAgentHost(host.id);
|
|
109484
|
+
console.log(source_default.green(`Local-agent host deleted: ${host.displayName}`));
|
|
109388
109485
|
console.log(source_default.dim(` Host id: ${host.id}`));
|
|
109389
109486
|
})
|
|
109390
109487
|
);
|
|
109391
109488
|
|
|
109392
|
-
// src/commands/zero/
|
|
109489
|
+
// src/commands/zero/local-agent/list.ts
|
|
109393
109490
|
init_esm_shims();
|
|
109394
109491
|
function formatAge(value) {
|
|
109395
109492
|
const elapsedSeconds = Math.max(
|
|
@@ -109417,8 +109514,8 @@ function statusLabel(host) {
|
|
|
109417
109514
|
}
|
|
109418
109515
|
function printHosts(hosts) {
|
|
109419
109516
|
if (hosts.length === 0) {
|
|
109420
|
-
console.log("No
|
|
109421
|
-
console.log(source_default.dim(" Run: vm0
|
|
109517
|
+
console.log("No local-agent hosts found.");
|
|
109518
|
+
console.log(source_default.dim(" Run: vm0 local-agent start --name <name>"));
|
|
109422
109519
|
return;
|
|
109423
109520
|
}
|
|
109424
109521
|
const rows = hosts.map((host) => {
|
|
@@ -109470,14 +109567,14 @@ function printHosts(hosts) {
|
|
|
109470
109567
|
);
|
|
109471
109568
|
}
|
|
109472
109569
|
}
|
|
109473
|
-
var listCommand = new Command().name("list").description("List
|
|
109570
|
+
var listCommand = new Command().name("list").description("List local-agent hosts").action(
|
|
109474
109571
|
withErrorHandler(async () => {
|
|
109475
|
-
const result = await
|
|
109572
|
+
const result = await listLocalAgentHosts();
|
|
109476
109573
|
printHosts(result.hosts);
|
|
109477
109574
|
})
|
|
109478
109575
|
);
|
|
109479
109576
|
|
|
109480
|
-
// src/commands/zero/
|
|
109577
|
+
// src/commands/zero/local-agent/run.ts
|
|
109481
109578
|
init_esm_shims();
|
|
109482
109579
|
function sleep2(ms) {
|
|
109483
109580
|
return new Promise((resolve2) => {
|
|
@@ -109492,7 +109589,7 @@ function parseTimeoutSeconds(value) {
|
|
|
109492
109589
|
}
|
|
109493
109590
|
return seconds;
|
|
109494
109591
|
}
|
|
109495
|
-
var runCommand = new Command().name("run").description("Run on a connected
|
|
109592
|
+
var runCommand = new Command().name("run").description("Run on a connected local-agent host").argument("<prompt...>", "Prompt to send to the local agent").option("--host <name>", "Run on a named local-agent host").option("--timeout <seconds>", "Maximum time to wait", "7200").action(
|
|
109496
109593
|
withErrorHandler(async (promptParts, options) => {
|
|
109497
109594
|
const timeoutSeconds = parseTimeoutSeconds(options.timeout);
|
|
109498
109595
|
const prompt = promptParts.join(" ").trim();
|
|
@@ -109504,11 +109601,11 @@ var runCommand = new Command().name("run").description("Run on a connected remot
|
|
|
109504
109601
|
prompt,
|
|
109505
109602
|
...hostName ? { hostName } : {}
|
|
109506
109603
|
};
|
|
109507
|
-
const created = await
|
|
109508
|
-
console.log(source_default.cyan(`
|
|
109604
|
+
const created = await createLocalAgentRun(createParams);
|
|
109605
|
+
console.log(source_default.cyan(`Local-agent job queued: ${created.jobId}`));
|
|
109509
109606
|
const deadline = Date.now() + timeoutSeconds * 1e3;
|
|
109510
109607
|
while (Date.now() <= deadline) {
|
|
109511
|
-
const job = await
|
|
109608
|
+
const job = await getLocalAgentRun(created.jobId);
|
|
109512
109609
|
if (job.status === "queued" || job.status === "running") {
|
|
109513
109610
|
if (process.stdout.isTTY) {
|
|
109514
109611
|
process.stdout.write(".");
|
|
@@ -109530,11 +109627,11 @@ var runCommand = new Command().name("run").description("Run on a connected remot
|
|
|
109530
109627
|
}
|
|
109531
109628
|
return;
|
|
109532
109629
|
}
|
|
109533
|
-
throw new Error(`
|
|
109630
|
+
throw new Error(`Local-agent job timed out: ${created.jobId}`);
|
|
109534
109631
|
})
|
|
109535
109632
|
);
|
|
109536
109633
|
|
|
109537
|
-
// src/commands/zero/
|
|
109634
|
+
// src/commands/zero/local-agent/runs.ts
|
|
109538
109635
|
init_esm_shims();
|
|
109539
109636
|
var VALID_STATUSES = [
|
|
109540
109637
|
"queued",
|
|
@@ -109581,8 +109678,8 @@ function parseLimit(value) {
|
|
|
109581
109678
|
}
|
|
109582
109679
|
function printRunTable(runs) {
|
|
109583
109680
|
if (runs.length === 0) {
|
|
109584
|
-
console.log(source_default.dim("No
|
|
109585
|
-
console.log(source_default.dim(' Run: zero
|
|
109681
|
+
console.log(source_default.dim("No local-agent runs found"));
|
|
109682
|
+
console.log(source_default.dim(' Run: zero local-agent run "your prompt"'));
|
|
109586
109683
|
return;
|
|
109587
109684
|
}
|
|
109588
109685
|
const rows = runs.map((run) => {
|
|
@@ -109655,13 +109752,13 @@ function printRunStatus(job) {
|
|
|
109655
109752
|
console.log(`Exit code: ${job.exitCode ?? "-"}`);
|
|
109656
109753
|
if (job.status === "succeeded" || job.status === "failed") {
|
|
109657
109754
|
console.log();
|
|
109658
|
-
console.log(source_default.dim(` Run: zero
|
|
109755
|
+
console.log(source_default.dim(` Run: zero local-agent runs result ${job.id}`));
|
|
109659
109756
|
}
|
|
109660
109757
|
}
|
|
109661
109758
|
function printRunResult(job) {
|
|
109662
109759
|
if (job.status === "queued" || job.status === "running") {
|
|
109663
|
-
throw new Error(`
|
|
109664
|
-
cause: new Error(`Run: zero
|
|
109760
|
+
throw new Error(`Local-agent job is ${job.status}`, {
|
|
109761
|
+
cause: new Error(`Run: zero local-agent runs status ${job.id}`)
|
|
109665
109762
|
});
|
|
109666
109763
|
}
|
|
109667
109764
|
if (job.status === "failed") {
|
|
@@ -109675,9 +109772,9 @@ function printRunResult(job) {
|
|
|
109675
109772
|
console.log(job.output);
|
|
109676
109773
|
}
|
|
109677
109774
|
}
|
|
109678
|
-
var listCommand2 = new Command().name("list").alias("ls").description("List
|
|
109775
|
+
var listCommand2 = new Command().name("list").alias("ls").description("List local-agent runs").option("--status <status>", `Filter by status: ${VALID_STATUSES.join(",")}`).option("--host <name>", "Filter by local-agent host name").option("--host-id <id>", "Filter by local-agent host id").option("--limit <n>", "Maximum number of results (default: 20, max: 100)").option("--json", "Output JSON").action(
|
|
109679
109776
|
withErrorHandler(async (options) => {
|
|
109680
|
-
const result = await
|
|
109777
|
+
const result = await listLocalAgentRuns({
|
|
109681
109778
|
status: parseStatus(options.status),
|
|
109682
109779
|
hostName: options.host,
|
|
109683
109780
|
hostId: options.hostId,
|
|
@@ -109690,9 +109787,9 @@ var listCommand2 = new Command().name("list").alias("ls").description("List remo
|
|
|
109690
109787
|
printRunTable(result.runs);
|
|
109691
109788
|
})
|
|
109692
109789
|
);
|
|
109693
|
-
var statusCommand = new Command().name("status").description("Show
|
|
109790
|
+
var statusCommand = new Command().name("status").description("Show local-agent run status").argument("<job-id>", "Local-agent job id").option("--json", "Output JSON").action(
|
|
109694
109791
|
withErrorHandler(async (jobId, options) => {
|
|
109695
|
-
const job = await
|
|
109792
|
+
const job = await getLocalAgentRun(jobId);
|
|
109696
109793
|
if (options.json) {
|
|
109697
109794
|
console.log(JSON.stringify(job));
|
|
109698
109795
|
return;
|
|
@@ -109700,9 +109797,9 @@ var statusCommand = new Command().name("status").description("Show remote-agent
|
|
|
109700
109797
|
printRunStatus(job);
|
|
109701
109798
|
})
|
|
109702
109799
|
);
|
|
109703
|
-
var resultCommand = new Command().name("result").description("Print
|
|
109800
|
+
var resultCommand = new Command().name("result").description("Print local-agent run result").argument("<job-id>", "Local-agent job id").option("--json", "Output JSON").action(
|
|
109704
109801
|
withErrorHandler(async (jobId, options) => {
|
|
109705
|
-
const job = await
|
|
109802
|
+
const job = await getLocalAgentRun(jobId);
|
|
109706
109803
|
if (options.json) {
|
|
109707
109804
|
console.log(JSON.stringify(job));
|
|
109708
109805
|
return;
|
|
@@ -109710,11 +109807,11 @@ var resultCommand = new Command().name("result").description("Print remote-agent
|
|
|
109710
109807
|
printRunResult(job);
|
|
109711
109808
|
})
|
|
109712
109809
|
);
|
|
109713
|
-
var runsCommand = new Command().name("runs").description("List and inspect
|
|
109810
|
+
var runsCommand = new Command().name("runs").description("List and inspect local-agent runs").addCommand(listCommand2).addCommand(statusCommand).addCommand(resultCommand);
|
|
109714
109811
|
|
|
109715
|
-
// src/commands/zero/
|
|
109716
|
-
var
|
|
109717
|
-
var
|
|
109812
|
+
// src/commands/zero/local-agent/index.ts
|
|
109813
|
+
var localAgentCommand = new Command().name("local-agent").description("Run local Codex or Claude hosts for vm0").addCommand(startCommand).addCommand(listCommand).addCommand(deleteCommand).addCommand(runCommand).addCommand(runsCommand);
|
|
109814
|
+
var zeroLocalAgentCommand = new Command().name("local-agent").description("Run jobs on local-agent hosts").addCommand(listCommand).addCommand(runCommand).addCommand(runsCommand);
|
|
109718
109815
|
|
|
109719
109816
|
// src/lib/command/index.ts
|
|
109720
109817
|
init_esm_shims();
|
|
@@ -112949,6 +113046,45 @@ var axiomFirewall = {
|
|
|
112949
113046
|
]
|
|
112950
113047
|
};
|
|
112951
113048
|
|
|
113049
|
+
// ../../packages/connectors/src/firewalls/bentoml.generated.ts
|
|
113050
|
+
init_esm_shims();
|
|
113051
|
+
var bentomlFirewall = {
|
|
113052
|
+
name: "bentoml",
|
|
113053
|
+
description: "BentoCloud API and protected deployment endpoints",
|
|
113054
|
+
placeholders: {
|
|
113055
|
+
BENTO_CLOUD_API_KEY: "cur7hCoffeeSafeLocalCoffeeSafeLocalCoffeeSafe"
|
|
113056
|
+
},
|
|
113057
|
+
apis: [
|
|
113058
|
+
{
|
|
113059
|
+
base: "${{ vars.BENTO_CLOUD_API_ENDPOINT }}",
|
|
113060
|
+
auth: {
|
|
113061
|
+
headers: {
|
|
113062
|
+
Authorization: "Bearer ${{ secrets.BENTO_CLOUD_API_KEY }}"
|
|
113063
|
+
}
|
|
113064
|
+
},
|
|
113065
|
+
permissions: []
|
|
113066
|
+
},
|
|
113067
|
+
{
|
|
113068
|
+
base: "https://{deployment+}.bentoml.ai",
|
|
113069
|
+
auth: {
|
|
113070
|
+
headers: {
|
|
113071
|
+
Authorization: "Bearer ${{ secrets.BENTO_CLOUD_API_KEY }}"
|
|
113072
|
+
}
|
|
113073
|
+
},
|
|
113074
|
+
permissions: []
|
|
113075
|
+
},
|
|
113076
|
+
{
|
|
113077
|
+
base: "https://{deployment+}.cloud-apps.bentoml.com",
|
|
113078
|
+
auth: {
|
|
113079
|
+
headers: {
|
|
113080
|
+
Authorization: "Bearer ${{ secrets.BENTO_CLOUD_API_KEY }}"
|
|
113081
|
+
}
|
|
113082
|
+
},
|
|
113083
|
+
permissions: []
|
|
113084
|
+
}
|
|
113085
|
+
]
|
|
113086
|
+
};
|
|
113087
|
+
|
|
112952
113088
|
// ../../packages/connectors/src/firewalls/bitrix.generated.ts
|
|
112953
113089
|
init_esm_shims();
|
|
112954
113090
|
var bitrixFirewall = {
|
|
@@ -118271,6 +118407,44 @@ var redditFirewall = {
|
|
|
118271
118407
|
]
|
|
118272
118408
|
};
|
|
118273
118409
|
|
|
118410
|
+
// ../../packages/connectors/src/firewalls/reap.generated.ts
|
|
118411
|
+
init_esm_shims();
|
|
118412
|
+
var reapFirewall = {
|
|
118413
|
+
name: "reap",
|
|
118414
|
+
description: "Reap API",
|
|
118415
|
+
placeholders: {
|
|
118416
|
+
REAP_API_KEY: "CoffeeSafeLocalCoffeeSafeLocalCoffeeSafeLocal"
|
|
118417
|
+
},
|
|
118418
|
+
apis: [
|
|
118419
|
+
{
|
|
118420
|
+
base: "${{ vars.REAP_API_BASE_URL }}",
|
|
118421
|
+
auth: {
|
|
118422
|
+
headers: {
|
|
118423
|
+
Authorization: "Bearer ${{ secrets.REAP_API_KEY }}",
|
|
118424
|
+
"Reap-Version": "2025-02-14"
|
|
118425
|
+
}
|
|
118426
|
+
},
|
|
118427
|
+
permissions: [
|
|
118428
|
+
{
|
|
118429
|
+
name: "read",
|
|
118430
|
+
description: "Read Reap resources",
|
|
118431
|
+
rules: ["GET /{path+}"]
|
|
118432
|
+
},
|
|
118433
|
+
{
|
|
118434
|
+
name: "write",
|
|
118435
|
+
description: "Create, update, and delete Reap resources",
|
|
118436
|
+
rules: [
|
|
118437
|
+
"POST /{path+}",
|
|
118438
|
+
"PUT /{path+}",
|
|
118439
|
+
"PATCH /{path+}",
|
|
118440
|
+
"DELETE /{path+}"
|
|
118441
|
+
]
|
|
118442
|
+
}
|
|
118443
|
+
]
|
|
118444
|
+
}
|
|
118445
|
+
]
|
|
118446
|
+
};
|
|
118447
|
+
|
|
118274
118448
|
// ../../packages/connectors/src/firewalls/reportei.generated.ts
|
|
118275
118449
|
init_esm_shims();
|
|
118276
118450
|
var reporteiFirewall = {
|
|
@@ -121845,6 +122019,7 @@ var CONNECTOR_FIREWALLS = {
|
|
|
121845
122019
|
attio: attioFirewall,
|
|
121846
122020
|
atlassian: atlassianFirewall,
|
|
121847
122021
|
axiom: axiomFirewall,
|
|
122022
|
+
bentoml: bentomlFirewall,
|
|
121848
122023
|
bitrix: bitrixFirewall,
|
|
121849
122024
|
"brave-search": braveSearchFirewall,
|
|
121850
122025
|
brevo: brevoFirewall,
|
|
@@ -121963,6 +122138,7 @@ var CONNECTOR_FIREWALLS = {
|
|
|
121963
122138
|
qdrant: qdrantFirewall,
|
|
121964
122139
|
qiita: qiitaFirewall,
|
|
121965
122140
|
reddit: redditFirewall,
|
|
122141
|
+
reap: reapFirewall,
|
|
121966
122142
|
reportei: reporteiFirewall,
|
|
121967
122143
|
replicate: replicateFirewall,
|
|
121968
122144
|
resend: resendFirewall,
|
|
@@ -124333,9 +124509,20 @@ var customConnectorResponseSchema = external_exports.object({
|
|
|
124333
124509
|
var customConnectorListResponseSchema = external_exports.object({
|
|
124334
124510
|
connectors: external_exports.array(customConnectorResponseSchema)
|
|
124335
124511
|
});
|
|
124512
|
+
var customConnectorPrefixSchema = external_exports.string().min(1).refine(
|
|
124513
|
+
(value) => {
|
|
124514
|
+
try {
|
|
124515
|
+
new URL(value);
|
|
124516
|
+
return true;
|
|
124517
|
+
} catch {
|
|
124518
|
+
return false;
|
|
124519
|
+
}
|
|
124520
|
+
},
|
|
124521
|
+
{ message: "Invalid URL" }
|
|
124522
|
+
);
|
|
124336
124523
|
var createCustomConnectorBodySchema = external_exports.object({
|
|
124337
124524
|
displayName: external_exports.string().min(1).max(128),
|
|
124338
|
-
prefixes: external_exports.array(
|
|
124525
|
+
prefixes: external_exports.array(customConnectorPrefixSchema).min(1),
|
|
124339
124526
|
headerName: external_exports.string().min(1).max(128),
|
|
124340
124527
|
headerTemplate: external_exports.string().min(1),
|
|
124341
124528
|
slug: external_exports.string().optional()
|
|
@@ -126871,6 +127058,11 @@ var FEATURE_SWITCHES = {
|
|
|
126871
127058
|
description: "Enable the Ahrefs SEO connector",
|
|
126872
127059
|
enabled: false
|
|
126873
127060
|
},
|
|
127061
|
+
["bentomlConnector" /* BentomlConnector */]: {
|
|
127062
|
+
maintainer: "ethan@vm0.ai",
|
|
127063
|
+
description: "Enable the BentoML model serving connector",
|
|
127064
|
+
enabled: false
|
|
127065
|
+
},
|
|
126874
127066
|
["canvaConnector" /* CanvaConnector */]: {
|
|
126875
127067
|
maintainer: "ethan@vm0.ai",
|
|
126876
127068
|
description: "Enable the Canva design connector",
|
|
@@ -127012,11 +127204,6 @@ var FEATURE_SWITCHES = {
|
|
|
127012
127204
|
enabled: false,
|
|
127013
127205
|
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
127014
127206
|
},
|
|
127015
|
-
["remoteAgent" /* RemoteAgent */]: {
|
|
127016
|
-
maintainer: "lancy@vm0.ai",
|
|
127017
|
-
description: "Enable remote-agent device pairing and local Codex/Claude host heartbeat endpoints.",
|
|
127018
|
-
enabled: true
|
|
127019
|
-
},
|
|
127020
127207
|
["lab" /* Lab */]: {
|
|
127021
127208
|
maintainer: "ethan@vm0.ai",
|
|
127022
127209
|
description: "Show the Lab page for toggling experimental features",
|
|
@@ -127126,11 +127313,6 @@ var FEATURE_SWITCHES = {
|
|
|
127126
127313
|
enabled: false,
|
|
127127
127314
|
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
127128
127315
|
},
|
|
127129
|
-
["privateAgents" /* PrivateAgents */]: {
|
|
127130
|
-
maintainer: "ethan@vm0.ai",
|
|
127131
|
-
description: "Enable private agents. Private agents are visible only to their owner, are excluded from the workspace public-agent limit, and can only be managed or run by their owner.",
|
|
127132
|
-
enabled: true
|
|
127133
|
-
},
|
|
127134
127316
|
["hostedSites" /* HostedSites */]: {
|
|
127135
127317
|
maintainer: "lancy@vm0.ai",
|
|
127136
127318
|
description: "Enable static hosted-site deployments from zero host. Staff-only during rollout.",
|
|
@@ -128672,8 +128854,8 @@ export {
|
|
|
128672
128854
|
showNextSteps,
|
|
128673
128855
|
parseTime,
|
|
128674
128856
|
paginate,
|
|
128675
|
-
|
|
128676
|
-
|
|
128857
|
+
localAgentCommand,
|
|
128858
|
+
zeroLocalAgentCommand
|
|
128677
128859
|
};
|
|
128678
128860
|
/*! Bundled license information:
|
|
128679
128861
|
|
|
@@ -128683,4 +128865,4 @@ undici/lib/web/fetch/body.js:
|
|
|
128683
128865
|
undici/lib/web/websocket/frame.js:
|
|
128684
128866
|
(*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
|
|
128685
128867
|
*/
|
|
128686
|
-
//# sourceMappingURL=chunk-
|
|
128868
|
+
//# sourceMappingURL=chunk-D3OXQKM5.js.map
|