@vm0/cli 9.75.2 → 9.76.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.
Files changed (2) hide show
  1. package/index.js +1169 -46
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -47,7 +47,7 @@ if (DSN) {
47
47
  Sentry.init({
48
48
  dsn: DSN,
49
49
  environment: process.env.SENTRY_ENVIRONMENT ?? "production",
50
- release: "9.75.2",
50
+ release: "9.76.0",
51
51
  sendDefaultPii: false,
52
52
  tracesSampleRate: 0,
53
53
  shutdownTimeout: 500,
@@ -66,7 +66,7 @@ if (DSN) {
66
66
  }
67
67
  });
68
68
  Sentry.setContext("cli", {
69
- version: "9.75.2",
69
+ version: "9.76.0",
70
70
  command: process.argv.slice(2).join(" ")
71
71
  });
72
72
  Sentry.setContext("runtime", {
@@ -85,7 +85,7 @@ process.stdout.on("error", handleEpipe);
85
85
  process.stderr.on("error", handleEpipe);
86
86
 
87
87
  // src/index.ts
88
- import { Command as Command93 } from "commander";
88
+ import { Command as Command122 } from "commander";
89
89
 
90
90
  // src/lib/network/proxy.ts
91
91
  import { EnvHttpProxyAgent, setGlobalDispatcher } from "undici";
@@ -13071,6 +13071,11 @@ var zeroAgentRequestSchema = z31.object({
13071
13071
  sound: z31.string().optional(),
13072
13072
  connectors: z31.array(z31.string())
13073
13073
  });
13074
+ var zeroAgentMetadataRequestSchema = z31.object({
13075
+ displayName: z31.string().optional(),
13076
+ description: z31.string().optional(),
13077
+ sound: z31.string().optional()
13078
+ });
13074
13079
  var zeroAgentInstructionsResponseSchema = z31.object({
13075
13080
  content: z31.string().nullable(),
13076
13081
  filename: z31.string().nullable()
@@ -13131,6 +13136,19 @@ var zeroAgentsByNameContract = c27.router({
13131
13136
  },
13132
13137
  summary: "Update zero agent"
13133
13138
  },
13139
+ updateMetadata: {
13140
+ method: "PATCH",
13141
+ path: "/api/zero/agents/:name",
13142
+ headers: authHeadersSchema,
13143
+ pathParams: z31.object({ name: z31.string() }),
13144
+ body: zeroAgentMetadataRequestSchema,
13145
+ responses: {
13146
+ 200: zeroAgentResponseSchema,
13147
+ 401: apiErrorSchema,
13148
+ 404: apiErrorSchema
13149
+ },
13150
+ summary: "Update zero agent metadata"
13151
+ },
13134
13152
  delete: {
13135
13153
  method: "DELETE",
13136
13154
  path: "/api/zero/agents/:name",
@@ -14691,7 +14709,7 @@ function getConfigPath() {
14691
14709
  return join2(homedir2(), ".vm0", "config.json");
14692
14710
  }
14693
14711
  var infoCommand = new Command6().name("info").description("Display environment and debug information").action(async () => {
14694
- console.log(chalk4.bold(`VM0 CLI v${"9.75.2"}`));
14712
+ console.log(chalk4.bold(`VM0 CLI v${"9.76.0"}`));
14695
14713
  console.log();
14696
14714
  const config = await loadConfig();
14697
14715
  const hasEnvToken = !!process.env.VM0_TOKEN;
@@ -15450,6 +15468,278 @@ async function resolveSkills(skillUrls) {
15450
15468
  }
15451
15469
  }
15452
15470
 
15471
+ // src/lib/api/domains/zero-orgs.ts
15472
+ import { initClient as initClient14 } from "@ts-rest/core";
15473
+ async function getUserTokenClientConfig2() {
15474
+ const baseUrl = await getBaseUrl();
15475
+ const token = await getToken();
15476
+ if (!token) {
15477
+ throw new Error("Not authenticated. Run: vm0 auth login");
15478
+ }
15479
+ const headers = {
15480
+ Authorization: `Bearer ${token}`
15481
+ };
15482
+ const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
15483
+ if (bypassSecret) {
15484
+ headers["x-vercel-protection-bypass"] = bypassSecret;
15485
+ }
15486
+ return { baseUrl, baseHeaders: headers, jsonQuery: false };
15487
+ }
15488
+ async function getZeroOrg() {
15489
+ const config = await getClientConfig();
15490
+ const client = initClient14(zeroOrgContract, config);
15491
+ const result = await client.get({ headers: {} });
15492
+ if (result.status === 200) {
15493
+ return result.body;
15494
+ }
15495
+ handleError(result, "Failed to get organization");
15496
+ }
15497
+ async function updateZeroOrg(body) {
15498
+ const config = await getClientConfig();
15499
+ const client = initClient14(zeroOrgContract, config);
15500
+ const result = await client.update({ body });
15501
+ if (result.status === 200) {
15502
+ return result.body;
15503
+ }
15504
+ handleError(result, "Failed to update organization");
15505
+ }
15506
+ async function listZeroOrgs() {
15507
+ const config = await getUserTokenClientConfig2();
15508
+ const client = initClient14(zeroOrgListContract, config);
15509
+ const result = await client.list({ headers: {} });
15510
+ if (result.status === 200) {
15511
+ return result.body;
15512
+ }
15513
+ handleError(result, "Failed to list organizations");
15514
+ }
15515
+ async function getZeroOrgMembers() {
15516
+ const config = await getClientConfig();
15517
+ const client = initClient14(zeroOrgMembersContract, config);
15518
+ const result = await client.members({ headers: {} });
15519
+ if (result.status === 200) {
15520
+ return result.body;
15521
+ }
15522
+ handleError(result, "Failed to get organization members");
15523
+ }
15524
+ async function inviteZeroOrgMember(email) {
15525
+ const config = await getClientConfig();
15526
+ const client = initClient14(zeroOrgInviteContract, config);
15527
+ const result = await client.invite({
15528
+ body: { email }
15529
+ });
15530
+ if (result.status === 200) {
15531
+ return;
15532
+ }
15533
+ handleError(result, "Failed to invite member");
15534
+ }
15535
+ async function removeZeroOrgMember(email) {
15536
+ const config = await getClientConfig();
15537
+ const client = initClient14(zeroOrgMembersContract, config);
15538
+ const result = await client.removeMember({
15539
+ body: { email }
15540
+ });
15541
+ if (result.status === 200) {
15542
+ return;
15543
+ }
15544
+ handleError(result, "Failed to remove member");
15545
+ }
15546
+ async function leaveZeroOrg() {
15547
+ const config = await getClientConfig();
15548
+ const client = initClient14(zeroOrgLeaveContract, config);
15549
+ const result = await client.leave({
15550
+ body: {}
15551
+ });
15552
+ if (result.status === 200) {
15553
+ return;
15554
+ }
15555
+ handleError(result, "Failed to leave organization");
15556
+ }
15557
+ async function deleteZeroOrg(slug) {
15558
+ const config = await getClientConfig();
15559
+ const client = initClient14(zeroOrgDeleteContract, config);
15560
+ const result = await client.delete({
15561
+ body: { slug }
15562
+ });
15563
+ if (result.status === 200) {
15564
+ return;
15565
+ }
15566
+ handleError(result, "Failed to delete organization");
15567
+ }
15568
+
15569
+ // src/lib/api/domains/zero-org-secrets.ts
15570
+ import { initClient as initClient15 } from "@ts-rest/core";
15571
+ async function listZeroOrgSecrets() {
15572
+ const config = await getClientConfig();
15573
+ const client = initClient15(zeroSecretsContract, config);
15574
+ const result = await client.list({ headers: {} });
15575
+ if (result.status === 200) {
15576
+ return result.body;
15577
+ }
15578
+ handleError(result, "Failed to list org secrets");
15579
+ }
15580
+ async function setZeroOrgSecret(body) {
15581
+ const config = await getClientConfig();
15582
+ const client = initClient15(zeroSecretsContract, config);
15583
+ const result = await client.set({ body });
15584
+ if (result.status === 200 || result.status === 201) {
15585
+ return result.body;
15586
+ }
15587
+ handleError(result, "Failed to set org secret");
15588
+ }
15589
+ async function deleteZeroOrgSecret(name) {
15590
+ const config = await getClientConfig();
15591
+ const client = initClient15(zeroSecretsByNameContract, config);
15592
+ const result = await client.delete({
15593
+ params: { name }
15594
+ });
15595
+ if (result.status === 204) {
15596
+ return;
15597
+ }
15598
+ handleError(result, `Org secret "${name}" not found`);
15599
+ }
15600
+
15601
+ // src/lib/api/domains/zero-org-variables.ts
15602
+ import { initClient as initClient16 } from "@ts-rest/core";
15603
+ async function listZeroOrgVariables() {
15604
+ const config = await getClientConfig();
15605
+ const client = initClient16(zeroVariablesContract, config);
15606
+ const result = await client.list({ headers: {} });
15607
+ if (result.status === 200) {
15608
+ return result.body;
15609
+ }
15610
+ handleError(result, "Failed to list org variables");
15611
+ }
15612
+ async function setZeroOrgVariable(body) {
15613
+ const config = await getClientConfig();
15614
+ const client = initClient16(zeroVariablesContract, config);
15615
+ const result = await client.set({ body });
15616
+ if (result.status === 200 || result.status === 201) {
15617
+ return result.body;
15618
+ }
15619
+ handleError(result, "Failed to set org variable");
15620
+ }
15621
+ async function deleteZeroOrgVariable(name) {
15622
+ const config = await getClientConfig();
15623
+ const client = initClient16(zeroVariablesByNameContract, config);
15624
+ const result = await client.delete({
15625
+ params: { name }
15626
+ });
15627
+ if (result.status === 204) {
15628
+ return;
15629
+ }
15630
+ handleError(result, `Org variable "${name}" not found`);
15631
+ }
15632
+
15633
+ // src/lib/api/domains/zero-org-model-providers.ts
15634
+ import { initClient as initClient17 } from "@ts-rest/core";
15635
+ async function listZeroOrgModelProviders() {
15636
+ const config = await getClientConfig();
15637
+ const client = initClient17(zeroModelProvidersMainContract, config);
15638
+ const result = await client.list({ headers: {} });
15639
+ if (result.status === 200) {
15640
+ return result.body;
15641
+ }
15642
+ handleError(result, "Failed to list org model providers");
15643
+ }
15644
+ async function upsertZeroOrgModelProvider(body) {
15645
+ const config = await getClientConfig();
15646
+ const client = initClient17(zeroModelProvidersMainContract, config);
15647
+ const result = await client.upsert({ body });
15648
+ if (result.status === 200 || result.status === 201) {
15649
+ return result.body;
15650
+ }
15651
+ handleError(result, "Failed to set org model provider");
15652
+ }
15653
+ async function deleteZeroOrgModelProvider(type2) {
15654
+ const config = await getClientConfig();
15655
+ const client = initClient17(zeroModelProvidersByTypeContract, config);
15656
+ const result = await client.delete({
15657
+ params: { type: type2 }
15658
+ });
15659
+ if (result.status === 204) {
15660
+ return;
15661
+ }
15662
+ handleError(result, `Org model provider "${type2}" not found`);
15663
+ }
15664
+ async function setZeroOrgModelProviderDefault(type2) {
15665
+ const config = await getClientConfig();
15666
+ const client = initClient17(zeroModelProvidersDefaultContract, config);
15667
+ const result = await client.setDefault({
15668
+ params: { type: type2 }
15669
+ });
15670
+ if (result.status === 200) {
15671
+ return result.body;
15672
+ }
15673
+ handleError(result, "Failed to set default org model provider");
15674
+ }
15675
+ async function updateZeroOrgModelProviderModel(type2, selectedModel) {
15676
+ const config = await getClientConfig();
15677
+ const client = initClient17(zeroModelProvidersUpdateModelContract, config);
15678
+ const result = await client.updateModel({
15679
+ params: { type: type2 },
15680
+ body: { selectedModel }
15681
+ });
15682
+ if (result.status === 200) {
15683
+ return result.body;
15684
+ }
15685
+ handleError(result, "Failed to update org model provider");
15686
+ }
15687
+
15688
+ // src/lib/api/domains/zero-agents.ts
15689
+ import { initClient as initClient18 } from "@ts-rest/core";
15690
+ async function createZeroAgent(body) {
15691
+ const config = await getClientConfig();
15692
+ const client = initClient18(zeroAgentsMainContract, config);
15693
+ const result = await client.create({ body });
15694
+ if (result.status === 201) return result.body;
15695
+ handleError(result, "Failed to create zero agent");
15696
+ }
15697
+ async function listZeroAgents() {
15698
+ const config = await getClientConfig();
15699
+ const client = initClient18(zeroAgentsMainContract, config);
15700
+ const result = await client.list({ headers: {} });
15701
+ if (result.status === 200) return result.body;
15702
+ handleError(result, "Failed to list zero agents");
15703
+ }
15704
+ async function getZeroAgent(name) {
15705
+ const config = await getClientConfig();
15706
+ const client = initClient18(zeroAgentsByNameContract, config);
15707
+ const result = await client.get({ params: { name } });
15708
+ if (result.status === 200) return result.body;
15709
+ handleError(result, `Zero agent "${name}" not found`);
15710
+ }
15711
+ async function updateZeroAgent(name, body) {
15712
+ const config = await getClientConfig();
15713
+ const client = initClient18(zeroAgentsByNameContract, config);
15714
+ const result = await client.update({ params: { name }, body });
15715
+ if (result.status === 200) return result.body;
15716
+ handleError(result, `Failed to update zero agent "${name}"`);
15717
+ }
15718
+ async function deleteZeroAgent(name) {
15719
+ const config = await getClientConfig();
15720
+ const client = initClient18(zeroAgentsByNameContract, config);
15721
+ const result = await client.delete({ params: { name } });
15722
+ if (result.status === 204) return;
15723
+ handleError(result, `Zero agent "${name}" not found`);
15724
+ }
15725
+ async function getZeroAgentInstructions(name) {
15726
+ const config = await getClientConfig();
15727
+ const client = initClient18(zeroAgentInstructionsContract, config);
15728
+ const result = await client.get({ params: { name } });
15729
+ if (result.status === 200) return result.body;
15730
+ handleError(result, `Failed to get instructions for zero agent "${name}"`);
15731
+ }
15732
+ async function updateZeroAgentInstructions(name, content) {
15733
+ const config = await getClientConfig();
15734
+ const client = initClient18(zeroAgentInstructionsContract, config);
15735
+ const result = await client.update({
15736
+ params: { name },
15737
+ body: { content }
15738
+ });
15739
+ if (result.status === 200) return;
15740
+ handleError(result, `Failed to update instructions for zero agent "${name}"`);
15741
+ }
15742
+
15453
15743
  // src/lib/domain/yaml-validator.ts
15454
15744
  import { z as z43 } from "zod";
15455
15745
  var cliAgentNameSchema = z43.string().min(3, "Agent name must be at least 3 characters").max(64, "Agent name must be 64 characters or less").regex(
@@ -16722,7 +17012,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
16722
17012
  options.autoUpdate = false;
16723
17013
  }
16724
17014
  if (options.autoUpdate !== false) {
16725
- await startSilentUpgrade("9.75.2");
17015
+ await startSilentUpgrade("9.76.0");
16726
17016
  }
16727
17017
  try {
16728
17018
  let result;
@@ -17557,7 +17847,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
17557
17847
  withErrorHandler(
17558
17848
  async (identifier, prompt, options) => {
17559
17849
  if (options.autoUpdate !== false) {
17560
- await startSilentUpgrade("9.75.2");
17850
+ await startSilentUpgrade("9.76.0");
17561
17851
  }
17562
17852
  const { org, name, version } = parseIdentifier(identifier);
17563
17853
  let composeId;
@@ -19313,7 +19603,7 @@ var cookAction = new Command35().name("cook").description("Quick start: prepare,
19313
19603
  withErrorHandler(
19314
19604
  async (prompt, options) => {
19315
19605
  if (options.autoUpdate !== false) {
19316
- const shouldExit = await checkAndUpgrade("9.75.2", prompt);
19606
+ const shouldExit = await checkAndUpgrade("9.76.0", prompt);
19317
19607
  if (shouldExit) {
19318
19608
  process.exit(0);
19319
19609
  }
@@ -19499,7 +19789,7 @@ import { Command as Command40 } from "commander";
19499
19789
  import chalk36 from "chalk";
19500
19790
 
19501
19791
  // src/lib/api/api-client.ts
19502
- import { initClient as initClient14 } from "@ts-rest/core";
19792
+ import { initClient as initClient19 } from "@ts-rest/core";
19503
19793
  var ApiClient = class {
19504
19794
  async getHeaders() {
19505
19795
  const token = await getActiveToken();
@@ -19525,7 +19815,7 @@ var ApiClient = class {
19525
19815
  async getComposeByName(name, org) {
19526
19816
  const baseUrl = await this.getBaseUrl();
19527
19817
  const headers = await this.getHeaders();
19528
- const client = initClient14(composesMainContract, {
19818
+ const client = initClient19(composesMainContract, {
19529
19819
  baseUrl,
19530
19820
  baseHeaders: headers,
19531
19821
  jsonQuery: false
@@ -19546,7 +19836,7 @@ var ApiClient = class {
19546
19836
  async getComposeById(id) {
19547
19837
  const baseUrl = await this.getBaseUrl();
19548
19838
  const headers = await this.getHeaders();
19549
- const client = initClient14(composesByIdContract, {
19839
+ const client = initClient19(composesByIdContract, {
19550
19840
  baseUrl,
19551
19841
  baseHeaders: headers,
19552
19842
  jsonQuery: false
@@ -19568,7 +19858,7 @@ var ApiClient = class {
19568
19858
  async getComposeVersion(composeId, version) {
19569
19859
  const baseUrl = await this.getBaseUrl();
19570
19860
  const headers = await this.getHeaders();
19571
- const client = initClient14(composesVersionsContract, {
19861
+ const client = initClient19(composesVersionsContract, {
19572
19862
  baseUrl,
19573
19863
  baseHeaders: headers,
19574
19864
  jsonQuery: false
@@ -19589,7 +19879,7 @@ var ApiClient = class {
19589
19879
  async createOrUpdateCompose(body) {
19590
19880
  const baseUrl = await this.getBaseUrl();
19591
19881
  const headers = await this.getHeaders();
19592
- const client = initClient14(composesMainContract, {
19882
+ const client = initClient19(composesMainContract, {
19593
19883
  baseUrl,
19594
19884
  baseHeaders: headers,
19595
19885
  jsonQuery: false
@@ -19612,7 +19902,7 @@ var ApiClient = class {
19612
19902
  async createRun(body) {
19613
19903
  const baseUrl = await this.getBaseUrl();
19614
19904
  const headers = await this.getHeaders();
19615
- const client = initClient14(runsMainContract, {
19905
+ const client = initClient19(runsMainContract, {
19616
19906
  baseUrl,
19617
19907
  baseHeaders: headers,
19618
19908
  jsonQuery: false
@@ -19627,7 +19917,7 @@ var ApiClient = class {
19627
19917
  }
19628
19918
  async getEvents(runId, options) {
19629
19919
  const config = await getClientConfig();
19630
- const client = initClient14(runEventsContract, config);
19920
+ const client = initClient19(runEventsContract, config);
19631
19921
  const result = await client.getEvents({
19632
19922
  params: { id: runId },
19633
19923
  query: {
@@ -19644,7 +19934,7 @@ var ApiClient = class {
19644
19934
  }
19645
19935
  async getSystemLog(runId, options) {
19646
19936
  const config = await getClientConfig();
19647
- const client = initClient14(runSystemLogContract, config);
19937
+ const client = initClient19(runSystemLogContract, config);
19648
19938
  const result = await client.getSystemLog({
19649
19939
  params: { id: runId },
19650
19940
  query: {
@@ -19662,7 +19952,7 @@ var ApiClient = class {
19662
19952
  }
19663
19953
  async getMetrics(runId, options) {
19664
19954
  const config = await getClientConfig();
19665
- const client = initClient14(runMetricsContract, config);
19955
+ const client = initClient19(runMetricsContract, config);
19666
19956
  const result = await client.getMetrics({
19667
19957
  params: { id: runId },
19668
19958
  query: {
@@ -19680,7 +19970,7 @@ var ApiClient = class {
19680
19970
  }
19681
19971
  async getAgentEvents(runId, options) {
19682
19972
  const config = await getClientConfig();
19683
- const client = initClient14(runAgentEventsContract, config);
19973
+ const client = initClient19(runAgentEventsContract, config);
19684
19974
  const result = await client.getAgentEvents({
19685
19975
  params: { id: runId },
19686
19976
  query: {
@@ -19698,7 +19988,7 @@ var ApiClient = class {
19698
19988
  }
19699
19989
  async getNetworkLogs(runId, options) {
19700
19990
  const config = await getClientConfig();
19701
- const client = initClient14(runNetworkLogsContract, config);
19991
+ const client = initClient19(runNetworkLogsContract, config);
19702
19992
  const result = await client.getNetworkLogs({
19703
19993
  params: { id: runId },
19704
19994
  query: {
@@ -19720,7 +20010,7 @@ var ApiClient = class {
19720
20010
  async getOrg() {
19721
20011
  const baseUrl = await this.getBaseUrl();
19722
20012
  const headers = await this.getHeaders();
19723
- const client = initClient14(orgContract, {
20013
+ const client = initClient19(orgContract, {
19724
20014
  baseUrl,
19725
20015
  baseHeaders: headers,
19726
20016
  jsonQuery: false
@@ -19739,7 +20029,7 @@ var ApiClient = class {
19739
20029
  async updateOrg(body) {
19740
20030
  const baseUrl = await this.getBaseUrl();
19741
20031
  const headers = await this.getHeaders();
19742
- const client = initClient14(orgContract, {
20032
+ const client = initClient19(orgContract, {
19743
20033
  baseUrl,
19744
20034
  baseHeaders: headers,
19745
20035
  jsonQuery: false
@@ -19759,7 +20049,7 @@ var ApiClient = class {
19759
20049
  async getSession(sessionId) {
19760
20050
  const baseUrl = await this.getBaseUrl();
19761
20051
  const headers = await this.getHeaders();
19762
- const client = initClient14(sessionsByIdContract, {
20052
+ const client = initClient19(sessionsByIdContract, {
19763
20053
  baseUrl,
19764
20054
  baseHeaders: headers,
19765
20055
  jsonQuery: false
@@ -19780,7 +20070,7 @@ var ApiClient = class {
19780
20070
  */
19781
20071
  async getCheckpoint(checkpointId) {
19782
20072
  const config = await getClientConfig();
19783
- const client = initClient14(checkpointsByIdContract, config);
20073
+ const client = initClient19(checkpointsByIdContract, config);
19784
20074
  const result = await client.getById({
19785
20075
  params: { id: checkpointId }
19786
20076
  });
@@ -19797,7 +20087,7 @@ var ApiClient = class {
19797
20087
  async prepareStorage(body) {
19798
20088
  const baseUrl = await this.getBaseUrl();
19799
20089
  const headers = await this.getHeaders();
19800
- const client = initClient14(storagesPrepareContract, {
20090
+ const client = initClient19(storagesPrepareContract, {
19801
20091
  baseUrl,
19802
20092
  baseHeaders: headers,
19803
20093
  jsonQuery: false
@@ -19816,7 +20106,7 @@ var ApiClient = class {
19816
20106
  async commitStorage(body) {
19817
20107
  const baseUrl = await this.getBaseUrl();
19818
20108
  const headers = await this.getHeaders();
19819
- const client = initClient14(storagesCommitContract, {
20109
+ const client = initClient19(storagesCommitContract, {
19820
20110
  baseUrl,
19821
20111
  baseHeaders: headers,
19822
20112
  jsonQuery: false
@@ -19835,7 +20125,7 @@ var ApiClient = class {
19835
20125
  async getStorageDownload(query) {
19836
20126
  const baseUrl = await this.getBaseUrl();
19837
20127
  const headers = await this.getHeaders();
19838
- const client = initClient14(storagesDownloadContract, {
20128
+ const client = initClient19(storagesDownloadContract, {
19839
20129
  baseUrl,
19840
20130
  baseHeaders: headers,
19841
20131
  jsonQuery: false
@@ -19860,7 +20150,7 @@ var ApiClient = class {
19860
20150
  async listStorages(query) {
19861
20151
  const baseUrl = await this.getBaseUrl();
19862
20152
  const headers = await this.getHeaders();
19863
- const client = initClient14(storagesListContract, {
20153
+ const client = initClient19(storagesListContract, {
19864
20154
  baseUrl,
19865
20155
  baseHeaders: headers,
19866
20156
  jsonQuery: false
@@ -19880,7 +20170,7 @@ var ApiClient = class {
19880
20170
  async deploySchedule(body) {
19881
20171
  const baseUrl = await this.getBaseUrl();
19882
20172
  const headers = await this.getHeaders();
19883
- const client = initClient14(schedulesMainContract, {
20173
+ const client = initClient19(schedulesMainContract, {
19884
20174
  baseUrl,
19885
20175
  baseHeaders: headers,
19886
20176
  jsonQuery: false
@@ -19899,7 +20189,7 @@ var ApiClient = class {
19899
20189
  async listSchedules() {
19900
20190
  const baseUrl = await this.getBaseUrl();
19901
20191
  const headers = await this.getHeaders();
19902
- const client = initClient14(schedulesMainContract, {
20192
+ const client = initClient19(schedulesMainContract, {
19903
20193
  baseUrl,
19904
20194
  baseHeaders: headers,
19905
20195
  jsonQuery: false
@@ -19918,7 +20208,7 @@ var ApiClient = class {
19918
20208
  async getScheduleByName(params) {
19919
20209
  const baseUrl = await this.getBaseUrl();
19920
20210
  const headers = await this.getHeaders();
19921
- const client = initClient14(schedulesByNameContract, {
20211
+ const client = initClient19(schedulesByNameContract, {
19922
20212
  baseUrl,
19923
20213
  baseHeaders: headers,
19924
20214
  jsonQuery: false
@@ -19940,7 +20230,7 @@ var ApiClient = class {
19940
20230
  async deleteSchedule(params) {
19941
20231
  const baseUrl = await this.getBaseUrl();
19942
20232
  const headers = await this.getHeaders();
19943
- const client = initClient14(schedulesByNameContract, {
20233
+ const client = initClient19(schedulesByNameContract, {
19944
20234
  baseUrl,
19945
20235
  baseHeaders: headers,
19946
20236
  jsonQuery: false
@@ -19962,7 +20252,7 @@ var ApiClient = class {
19962
20252
  async enableSchedule(params) {
19963
20253
  const baseUrl = await this.getBaseUrl();
19964
20254
  const headers = await this.getHeaders();
19965
- const client = initClient14(schedulesEnableContract, {
20255
+ const client = initClient19(schedulesEnableContract, {
19966
20256
  baseUrl,
19967
20257
  baseHeaders: headers,
19968
20258
  jsonQuery: false
@@ -19984,7 +20274,7 @@ var ApiClient = class {
19984
20274
  async disableSchedule(params) {
19985
20275
  const baseUrl = await this.getBaseUrl();
19986
20276
  const headers = await this.getHeaders();
19987
- const client = initClient14(schedulesDisableContract, {
20277
+ const client = initClient19(schedulesDisableContract, {
19988
20278
  baseUrl,
19989
20279
  baseHeaders: headers,
19990
20280
  jsonQuery: false
@@ -20006,7 +20296,7 @@ var ApiClient = class {
20006
20296
  async listScheduleRuns(params) {
20007
20297
  const baseUrl = await this.getBaseUrl();
20008
20298
  const headers = await this.getHeaders();
20009
- const client = initClient14(scheduleRunsContract, {
20299
+ const client = initClient19(scheduleRunsContract, {
20010
20300
  baseUrl,
20011
20301
  baseHeaders: headers,
20012
20302
  jsonQuery: false
@@ -20094,7 +20384,7 @@ var ApiClient = class {
20094
20384
  }
20095
20385
  async searchLogs(options) {
20096
20386
  const config = await getClientConfig();
20097
- const client = initClient14(logsSearchContract, config);
20387
+ const client = initClient19(logsSearchContract, config);
20098
20388
  const result = await client.searchLogs({
20099
20389
  query: {
20100
20390
  keyword: options.keyword,
@@ -23200,7 +23490,7 @@ import { Command as Command88 } from "commander";
23200
23490
  // src/commands/connector/connect.ts
23201
23491
  import { Command as Command84 } from "commander";
23202
23492
  import chalk74 from "chalk";
23203
- import { initClient as initClient15 } from "@ts-rest/core";
23493
+ import { initClient as initClient20 } from "@ts-rest/core";
23204
23494
 
23205
23495
  // src/commands/connector/lib/computer/start-services.ts
23206
23496
  import { spawn as spawn2 } from "child_process";
@@ -23447,7 +23737,7 @@ async function connectViaApiToken(connectorType, tokenValue) {
23447
23737
  async function connectComputer(apiUrl, headers) {
23448
23738
  await checkComputerDependencies();
23449
23739
  console.log(chalk74.cyan("Setting up computer connector..."));
23450
- const computerClient = initClient15(computerConnectorContract, {
23740
+ const computerClient = initClient20(computerConnectorContract, {
23451
23741
  baseUrl: apiUrl,
23452
23742
  baseHeaders: headers,
23453
23743
  jsonQuery: false
@@ -23503,7 +23793,7 @@ async function resolveAuthMethod(connectorType, tokenFlag) {
23503
23793
  }
23504
23794
  async function connectViaOAuth(connectorType, apiUrl, headers) {
23505
23795
  console.log(`Connecting ${chalk74.cyan(connectorType)}...`);
23506
- const sessionsClient = initClient15(connectorSessionsContract, {
23796
+ const sessionsClient = initClient20(connectorSessionsContract, {
23507
23797
  baseUrl: apiUrl,
23508
23798
  baseHeaders: headers,
23509
23799
  jsonQuery: false
@@ -23526,7 +23816,7 @@ To connect, visit: ${verificationUrl}`));
23526
23816
  The session expires in ${Math.floor(session.expiresIn / 60)} minutes.`
23527
23817
  );
23528
23818
  console.log("\nWaiting for authorization...");
23529
- const sessionClient = initClient15(connectorSessionByIdContract, {
23819
+ const sessionClient = initClient20(connectorSessionByIdContract, {
23530
23820
  baseUrl: apiUrl,
23531
23821
  baseHeaders: headers,
23532
23822
  jsonQuery: false
@@ -23866,13 +24156,13 @@ var upgradeCommand = new Command90().name("upgrade").description("Upgrade vm0 CL
23866
24156
  if (latestVersion === null) {
23867
24157
  throw new Error("Could not check for updates. Please try again later.");
23868
24158
  }
23869
- if (latestVersion === "9.75.2") {
23870
- console.log(chalk79.green(`\u2713 Already up to date (${"9.75.2"})`));
24159
+ if (latestVersion === "9.76.0") {
24160
+ console.log(chalk79.green(`\u2713 Already up to date (${"9.76.0"})`));
23871
24161
  return;
23872
24162
  }
23873
24163
  console.log(
23874
24164
  chalk79.yellow(
23875
- `Current version: ${"9.75.2"} -> Latest version: ${latestVersion}`
24165
+ `Current version: ${"9.76.0"} -> Latest version: ${latestVersion}`
23876
24166
  )
23877
24167
  );
23878
24168
  console.log();
@@ -23899,7 +24189,7 @@ var upgradeCommand = new Command90().name("upgrade").description("Upgrade vm0 CL
23899
24189
  const success = await performUpgrade(packageManager);
23900
24190
  if (success) {
23901
24191
  console.log(
23902
- chalk79.green(`\u2713 Upgraded from ${"9.75.2"} to ${latestVersion}`)
24192
+ chalk79.green(`\u2713 Upgraded from ${"9.76.0"} to ${latestVersion}`)
23903
24193
  );
23904
24194
  return;
23905
24195
  }
@@ -23972,14 +24262,847 @@ var whoamiCommand = new Command91().name("whoami").description("Show current ide
23972
24262
  );
23973
24263
 
23974
24264
  // src/commands/zero/index.ts
24265
+ import { Command as Command121 } from "commander";
24266
+
24267
+ // src/commands/zero/org/index.ts
24268
+ import { Command as Command114 } from "commander";
24269
+
24270
+ // src/commands/zero/org/status.ts
23975
24271
  import { Command as Command92 } from "commander";
23976
- var zeroCommand = new Command92("zero").description(
23977
- "Zero platform commands"
24272
+ import chalk81 from "chalk";
24273
+ var statusCommand9 = new Command92().name("status").description("View current organization status").action(
24274
+ withErrorHandler(async () => {
24275
+ try {
24276
+ const org = await getZeroOrg();
24277
+ console.log(chalk81.bold("Organization Information:"));
24278
+ console.log(` Slug: ${chalk81.green(org.slug)}`);
24279
+ } catch (error) {
24280
+ if (error instanceof ApiRequestError && error.status === 404) {
24281
+ throw new Error("No organization configured", {
24282
+ cause: new Error(
24283
+ "Set your organization with: vm0 zero org set <slug>"
24284
+ )
24285
+ });
24286
+ }
24287
+ throw error;
24288
+ }
24289
+ })
24290
+ );
24291
+
24292
+ // src/commands/zero/org/set.ts
24293
+ import { Command as Command93 } from "commander";
24294
+ import chalk82 from "chalk";
24295
+ var setCommand6 = new Command93().name("set").description("Rename your organization slug").argument("<slug>", "The new organization slug").option(
24296
+ "--force",
24297
+ "Force change existing organization (may break references)"
24298
+ ).action(
24299
+ withErrorHandler(async (slug, options) => {
24300
+ try {
24301
+ const existingOrg = await getZeroOrg();
24302
+ if (!options.force) {
24303
+ throw new Error(
24304
+ `You already have an organization: ${existingOrg.slug}`,
24305
+ {
24306
+ cause: new Error(
24307
+ `To change, use: vm0 zero org set ${slug} --force`
24308
+ )
24309
+ }
24310
+ );
24311
+ }
24312
+ const org = await updateZeroOrg({ slug, force: true });
24313
+ await saveConfig({ activeOrg: org.slug });
24314
+ console.log(chalk82.green(`\u2713 Organization updated to ${org.slug}`));
24315
+ console.log();
24316
+ console.log("Your agents will now be namespaced as:");
24317
+ console.log(chalk82.cyan(` ${org.slug}/<agent-name>`));
24318
+ } catch (error) {
24319
+ if (error instanceof Error && error.message.includes("already exists")) {
24320
+ throw new Error(
24321
+ `Organization "${slug}" is already taken. Please choose a different slug.`
24322
+ );
24323
+ }
24324
+ throw error;
24325
+ }
24326
+ })
23978
24327
  );
23979
24328
 
24329
+ // src/commands/zero/org/list.ts
24330
+ import { Command as Command94 } from "commander";
24331
+ import chalk83 from "chalk";
24332
+ var listCommand14 = new Command94().name("list").description("List all accessible organizations").action(
24333
+ withErrorHandler(async () => {
24334
+ const result = await listZeroOrgs();
24335
+ const activeOrg = await getActiveOrg();
24336
+ console.log(chalk83.bold("Available organizations:"));
24337
+ for (const org of result.orgs) {
24338
+ const isCurrent = org.slug === activeOrg;
24339
+ const marker = isCurrent ? chalk83.green("* ") : " ";
24340
+ const roleLabel = org.role ? ` (${org.role})` : "";
24341
+ const currentLabel = isCurrent ? chalk83.dim(" \u2190 current") : "";
24342
+ console.log(`${marker}${org.slug}${roleLabel}${currentLabel}`);
24343
+ }
24344
+ })
24345
+ );
24346
+
24347
+ // src/commands/zero/org/use.ts
24348
+ import { Command as Command95 } from "commander";
24349
+ import chalk84 from "chalk";
24350
+ var useCommand2 = new Command95().name("use").description("Switch to a different organization").argument("<slug>", "Organization slug to switch to").action(
24351
+ withErrorHandler(async (slug) => {
24352
+ const orgList = await listZeroOrgs();
24353
+ const target = orgList.orgs.find((s) => s.slug === slug);
24354
+ if (!target) {
24355
+ throw new Error(`Organization '${slug}' not found or not accessible.`);
24356
+ }
24357
+ await saveConfig({ activeOrg: slug });
24358
+ console.log(chalk84.green(`\u2713 Switched to organization: ${slug}`));
24359
+ })
24360
+ );
24361
+
24362
+ // src/commands/zero/org/members.ts
24363
+ import { Command as Command96 } from "commander";
24364
+ import chalk85 from "chalk";
24365
+ var membersCommand2 = new Command96().name("members").description("View organization members").action(
24366
+ withErrorHandler(async () => {
24367
+ const status = await getZeroOrgMembers();
24368
+ console.log(chalk85.bold(`Organization: ${status.slug}`));
24369
+ console.log(` Role: ${status.role}`);
24370
+ console.log(
24371
+ ` Created: ${new Date(status.createdAt).toLocaleDateString()}`
24372
+ );
24373
+ console.log();
24374
+ console.log(chalk85.bold("Members:"));
24375
+ for (const member of status.members) {
24376
+ const roleTag = member.role === "admin" ? chalk85.yellow(` (${member.role})`) : chalk85.dim(` (${member.role})`);
24377
+ console.log(` ${member.email}${roleTag}`);
24378
+ }
24379
+ })
24380
+ );
24381
+
24382
+ // src/commands/zero/org/invite.ts
24383
+ import { Command as Command97 } from "commander";
24384
+ import chalk86 from "chalk";
24385
+ var inviteCommand2 = new Command97().name("invite").description("Invite a member to the current organization").requiredOption("--email <email>", "Email address of the member to invite").action(
24386
+ withErrorHandler(async (options) => {
24387
+ await inviteZeroOrgMember(options.email);
24388
+ console.log(chalk86.green(`\u2713 Invitation sent to ${options.email}`));
24389
+ })
24390
+ );
24391
+
24392
+ // src/commands/zero/org/remove.ts
24393
+ import { Command as Command98 } from "commander";
24394
+ import chalk87 from "chalk";
24395
+ var removeCommand5 = new Command98().name("remove").description("Remove a member from the current organization").argument("<email>", "Email address of the member to remove").action(
24396
+ withErrorHandler(async (email) => {
24397
+ await removeZeroOrgMember(email);
24398
+ console.log(chalk87.green(`\u2713 Removed ${email} from organization`));
24399
+ })
24400
+ );
24401
+
24402
+ // src/commands/zero/org/leave.ts
24403
+ import { Command as Command99 } from "commander";
24404
+ import chalk88 from "chalk";
24405
+ var leaveCommand2 = new Command99().name("leave").description("Leave the current organization").action(
24406
+ withErrorHandler(async () => {
24407
+ await leaveZeroOrg();
24408
+ const { orgs } = await listZeroOrgs();
24409
+ if (orgs.length === 0) {
24410
+ await saveConfig({ activeOrg: void 0 });
24411
+ console.log(chalk88.green("\u2713 Left organization."));
24412
+ console.log(
24413
+ chalk88.yellow("No remaining organizations. Run: vm0 auth login")
24414
+ );
24415
+ return;
24416
+ }
24417
+ const nextOrg = orgs[0].slug;
24418
+ await saveConfig({ activeOrg: nextOrg });
24419
+ console.log(chalk88.green(`\u2713 Left organization. Switched to: ${nextOrg}`));
24420
+ })
24421
+ );
24422
+
24423
+ // src/commands/zero/org/delete.ts
24424
+ import { Command as Command100 } from "commander";
24425
+ import chalk89 from "chalk";
24426
+ var deleteCommand5 = new Command100().name("delete").description("Delete the current organization (admin only)").argument("<slug>", "Organization slug to confirm deletion").action(
24427
+ withErrorHandler(async (slug) => {
24428
+ await deleteZeroOrg(slug);
24429
+ console.log(chalk89.green(`\u2713 Organization '${slug}' has been deleted.`));
24430
+ })
24431
+ );
24432
+
24433
+ // src/commands/zero/org/secret/index.ts
24434
+ import { Command as Command104 } from "commander";
24435
+
24436
+ // src/commands/zero/org/secret/list.ts
24437
+ import { Command as Command101 } from "commander";
24438
+ import chalk90 from "chalk";
24439
+ var listCommand15 = new Command101().name("list").alias("ls").description("List all org-level secrets").action(
24440
+ withErrorHandler(async () => {
24441
+ const result = await listZeroOrgSecrets();
24442
+ if (result.secrets.length === 0) {
24443
+ console.log(chalk90.dim("No org secrets found"));
24444
+ console.log();
24445
+ console.log("To add an org secret:");
24446
+ console.log(
24447
+ chalk90.cyan(" vm0 zero org secret set MY_API_KEY --body <value>")
24448
+ );
24449
+ return;
24450
+ }
24451
+ console.log(chalk90.bold("Org Secrets:"));
24452
+ console.log();
24453
+ for (const secret of result.secrets) {
24454
+ console.log(` ${chalk90.cyan(secret.name)}`);
24455
+ if (secret.description) {
24456
+ console.log(` ${chalk90.dim(secret.description)}`);
24457
+ }
24458
+ console.log(
24459
+ ` ${chalk90.dim(`Updated: ${new Date(secret.updatedAt).toLocaleString()}`)}`
24460
+ );
24461
+ console.log();
24462
+ }
24463
+ console.log(chalk90.dim(`Total: ${result.secrets.length} secret(s)`));
24464
+ })
24465
+ );
24466
+
24467
+ // src/commands/zero/org/secret/set.ts
24468
+ import { Command as Command102 } from "commander";
24469
+ import chalk91 from "chalk";
24470
+ var setCommand7 = new Command102().name("set").description("Create or update an org-level secret (admin only)").argument("<name>", "Secret name (uppercase, e.g., MY_API_KEY)").option(
24471
+ "-b, --body <value>",
24472
+ "Secret value (required in non-interactive mode)"
24473
+ ).option("-d, --description <description>", "Optional description").action(
24474
+ withErrorHandler(
24475
+ async (name, options) => {
24476
+ let value;
24477
+ if (options.body !== void 0) {
24478
+ value = options.body;
24479
+ } else if (isInteractive()) {
24480
+ const prompted = await promptPassword("Enter secret value:");
24481
+ if (prompted === void 0) {
24482
+ process.exit(0);
24483
+ }
24484
+ value = prompted;
24485
+ } else {
24486
+ throw new Error("--body is required in non-interactive mode", {
24487
+ cause: new Error(
24488
+ `Usage: vm0 zero org secret set ${name} --body "your-secret-value"`
24489
+ )
24490
+ });
24491
+ }
24492
+ let secret;
24493
+ try {
24494
+ secret = await setZeroOrgSecret({
24495
+ name,
24496
+ value,
24497
+ description: options.description
24498
+ });
24499
+ } catch (error) {
24500
+ if (error instanceof Error && error.message.includes("must contain only uppercase")) {
24501
+ throw new Error(error.message, {
24502
+ cause: new Error(
24503
+ "Examples of valid secret names: MY_API_KEY, GITHUB_TOKEN, AWS_ACCESS_KEY_ID"
24504
+ )
24505
+ });
24506
+ }
24507
+ throw error;
24508
+ }
24509
+ console.log(chalk91.green(`\u2713 Org secret "${secret.name}" saved`));
24510
+ console.log();
24511
+ console.log("Use in vm0.yaml:");
24512
+ console.log(chalk91.cyan(` environment:`));
24513
+ console.log(chalk91.cyan(` ${name}: \${{ secrets.${name} }}`));
24514
+ }
24515
+ )
24516
+ );
24517
+
24518
+ // src/commands/zero/org/secret/remove.ts
24519
+ import { Command as Command103 } from "commander";
24520
+ import chalk92 from "chalk";
24521
+ var removeCommand6 = new Command103().name("remove").description("Delete an org-level secret (admin only)").argument("<name>", "Secret name to delete").option("-y, --yes", "Skip confirmation prompt").action(
24522
+ withErrorHandler(async (name, options) => {
24523
+ if (!options.yes) {
24524
+ if (!isInteractive()) {
24525
+ throw new Error("--yes flag is required in non-interactive mode");
24526
+ }
24527
+ const confirmed = await promptConfirm(
24528
+ `Are you sure you want to delete org secret "${name}"?`,
24529
+ false
24530
+ );
24531
+ if (!confirmed) {
24532
+ console.log(chalk92.dim("Cancelled"));
24533
+ return;
24534
+ }
24535
+ }
24536
+ await deleteZeroOrgSecret(name);
24537
+ console.log(chalk92.green(`\u2713 Org secret "${name}" deleted`));
24538
+ })
24539
+ );
24540
+
24541
+ // src/commands/zero/org/secret/index.ts
24542
+ var zeroOrgSecretCommand = new Command104().name("secret").description("Manage org-level secrets (admin)").addCommand(listCommand15).addCommand(setCommand7).addCommand(removeCommand6);
24543
+
24544
+ // src/commands/zero/org/variable/index.ts
24545
+ import { Command as Command108 } from "commander";
24546
+
24547
+ // src/commands/zero/org/variable/list.ts
24548
+ import { Command as Command105 } from "commander";
24549
+ import chalk93 from "chalk";
24550
+ function truncateValue3(value, maxLength = 60) {
24551
+ if (value.length <= maxLength) {
24552
+ return value;
24553
+ }
24554
+ return value.slice(0, maxLength - 15) + "... [truncated]";
24555
+ }
24556
+ var listCommand16 = new Command105().name("list").alias("ls").description("List all org-level variables").action(
24557
+ withErrorHandler(async () => {
24558
+ const result = await listZeroOrgVariables();
24559
+ if (result.variables.length === 0) {
24560
+ console.log(chalk93.dim("No org variables found"));
24561
+ console.log();
24562
+ console.log("To add an org variable:");
24563
+ console.log(chalk93.cyan(" vm0 zero org variable set MY_VAR <value>"));
24564
+ return;
24565
+ }
24566
+ console.log(chalk93.bold("Org Variables:"));
24567
+ console.log();
24568
+ for (const variable of result.variables) {
24569
+ const displayValue = truncateValue3(variable.value);
24570
+ console.log(` ${chalk93.cyan(variable.name)} = ${displayValue}`);
24571
+ if (variable.description) {
24572
+ console.log(` ${chalk93.dim(variable.description)}`);
24573
+ }
24574
+ console.log(
24575
+ ` ${chalk93.dim(`Updated: ${new Date(variable.updatedAt).toLocaleString()}`)}`
24576
+ );
24577
+ console.log();
24578
+ }
24579
+ console.log(chalk93.dim(`Total: ${result.variables.length} variable(s)`));
24580
+ })
24581
+ );
24582
+
24583
+ // src/commands/zero/org/variable/set.ts
24584
+ import { Command as Command106 } from "commander";
24585
+ import chalk94 from "chalk";
24586
+ var setCommand8 = new Command106().name("set").description("Create or update an org-level variable (admin only)").argument("<name>", "Variable name (uppercase, e.g., MY_VAR)").argument("<value>", "Variable value").option("-d, --description <description>", "Optional description").action(
24587
+ withErrorHandler(
24588
+ async (name, value, options) => {
24589
+ let variable;
24590
+ try {
24591
+ variable = await setZeroOrgVariable({
24592
+ name,
24593
+ value,
24594
+ description: options.description
24595
+ });
24596
+ } catch (error) {
24597
+ if (error instanceof Error && error.message.includes("must contain only uppercase")) {
24598
+ throw new Error(error.message, {
24599
+ cause: new Error(
24600
+ "Examples of valid variable names: MY_VAR, API_URL, DEBUG_MODE"
24601
+ )
24602
+ });
24603
+ }
24604
+ throw error;
24605
+ }
24606
+ console.log(chalk94.green(`\u2713 Org variable "${variable.name}" saved`));
24607
+ console.log();
24608
+ console.log("Use in vm0.yaml:");
24609
+ console.log(chalk94.cyan(` environment:`));
24610
+ console.log(chalk94.cyan(` ${name}: \${{ vars.${name} }}`));
24611
+ }
24612
+ )
24613
+ );
24614
+
24615
+ // src/commands/zero/org/variable/remove.ts
24616
+ import { Command as Command107 } from "commander";
24617
+ import chalk95 from "chalk";
24618
+ var removeCommand7 = new Command107().name("remove").description("Delete an org-level variable (admin only)").argument("<name>", "Variable name to delete").option("-y, --yes", "Skip confirmation prompt").action(
24619
+ withErrorHandler(async (name, options) => {
24620
+ if (!options.yes) {
24621
+ if (!isInteractive()) {
24622
+ throw new Error("--yes flag is required in non-interactive mode");
24623
+ }
24624
+ const confirmed = await promptConfirm(
24625
+ `Are you sure you want to delete org variable "${name}"?`,
24626
+ false
24627
+ );
24628
+ if (!confirmed) {
24629
+ console.log(chalk95.dim("Cancelled"));
24630
+ return;
24631
+ }
24632
+ }
24633
+ await deleteZeroOrgVariable(name);
24634
+ console.log(chalk95.green(`\u2713 Org variable "${name}" deleted`));
24635
+ })
24636
+ );
24637
+
24638
+ // src/commands/zero/org/variable/index.ts
24639
+ var zeroOrgVariableCommand = new Command108().name("variable").description("Manage org-level variables (admin)").addCommand(listCommand16).addCommand(setCommand8).addCommand(removeCommand7);
24640
+
24641
+ // src/commands/zero/org/model-provider/index.ts
24642
+ import { Command as Command113 } from "commander";
24643
+
24644
+ // src/commands/zero/org/model-provider/list.ts
24645
+ import { Command as Command109 } from "commander";
24646
+ import chalk96 from "chalk";
24647
+ var listCommand17 = new Command109().name("list").alias("ls").description("List all org-level model providers").action(
24648
+ withErrorHandler(async () => {
24649
+ const result = await listZeroOrgModelProviders();
24650
+ if (result.modelProviders.length === 0) {
24651
+ console.log(chalk96.dim("No org-level model providers configured"));
24652
+ console.log();
24653
+ console.log("To add an org-level model provider:");
24654
+ console.log(chalk96.cyan(" vm0 zero org model-provider setup"));
24655
+ return;
24656
+ }
24657
+ const byFramework = result.modelProviders.reduce(
24658
+ (acc, p) => {
24659
+ const fw = p.framework;
24660
+ if (!acc[fw]) {
24661
+ acc[fw] = [];
24662
+ }
24663
+ acc[fw].push(p);
24664
+ return acc;
24665
+ },
24666
+ {}
24667
+ );
24668
+ console.log(chalk96.bold("Org Model Providers:"));
24669
+ console.log();
24670
+ for (const [framework, providers] of Object.entries(byFramework)) {
24671
+ console.log(` ${chalk96.cyan(framework)}:`);
24672
+ for (const provider of providers) {
24673
+ const defaultTag = provider.isDefault ? chalk96.green(" (default)") : "";
24674
+ const modelTag = provider.selectedModel ? chalk96.dim(` [${provider.selectedModel}]`) : "";
24675
+ console.log(` ${provider.type}${defaultTag}${modelTag}`);
24676
+ console.log(
24677
+ chalk96.dim(
24678
+ ` Updated: ${new Date(provider.updatedAt).toLocaleString()}`
24679
+ )
24680
+ );
24681
+ }
24682
+ console.log();
24683
+ }
24684
+ console.log(
24685
+ chalk96.dim(`Total: ${result.modelProviders.length} provider(s)`)
24686
+ );
24687
+ })
24688
+ );
24689
+
24690
+ // src/commands/zero/org/model-provider/setup.ts
24691
+ import { Command as Command110 } from "commander";
24692
+ import chalk97 from "chalk";
24693
+ import prompts4 from "prompts";
24694
+ async function handleInteractiveMode2() {
24695
+ if (!isInteractive()) {
24696
+ throw new Error("Interactive mode requires a TTY", {
24697
+ cause: new Error(
24698
+ 'Use non-interactive mode: vm0 zero org model-provider setup --type <type> --secret "<value>"'
24699
+ )
24700
+ });
24701
+ }
24702
+ const { modelProviders: configuredProviders } = await listZeroOrgModelProviders();
24703
+ const configuredTypes = new Set(configuredProviders.map((p) => p.type));
24704
+ const annotatedChoices = getSelectableProviderTypes().map((type3) => {
24705
+ const config2 = MODEL_PROVIDER_TYPES[type3];
24706
+ const isConfigured = configuredTypes.has(type3);
24707
+ const isExperimental = hasAuthMethods(type3);
24708
+ let title = config2.label;
24709
+ if (isConfigured) {
24710
+ title = `${title} \u2713`;
24711
+ }
24712
+ if (isExperimental) {
24713
+ title = `${title} ${chalk97.dim("(experimental)")}`;
24714
+ }
24715
+ return {
24716
+ title,
24717
+ value: type3
24718
+ };
24719
+ });
24720
+ const typeResponse = await prompts4(
24721
+ {
24722
+ type: "select",
24723
+ name: "type",
24724
+ message: "Select provider type:",
24725
+ choices: annotatedChoices
24726
+ },
24727
+ { onCancel: () => process.exit(0) }
24728
+ );
24729
+ const type2 = typeResponse.type;
24730
+ const existingProvider = configuredProviders.find((p) => p.type === type2);
24731
+ if (existingProvider) {
24732
+ console.log();
24733
+ console.log(`"${type2}" is already configured`);
24734
+ console.log();
24735
+ const actionResponse = await prompts4(
24736
+ {
24737
+ type: "select",
24738
+ name: "action",
24739
+ message: "",
24740
+ choices: [
24741
+ { title: "Keep existing secret", value: "keep" },
24742
+ { title: "Update secret", value: "update" }
24743
+ ]
24744
+ },
24745
+ { onCancel: () => process.exit(0) }
24746
+ );
24747
+ if (actionResponse.action === "keep") {
24748
+ const selectedModel2 = await promptForModelSelection(type2);
24749
+ return {
24750
+ type: type2,
24751
+ keepExistingSecret: true,
24752
+ selectedModel: selectedModel2,
24753
+ isInteractiveMode: true
24754
+ };
24755
+ }
24756
+ }
24757
+ const config = MODEL_PROVIDER_TYPES[type2];
24758
+ console.log();
24759
+ if ("helpText" in config) {
24760
+ console.log(chalk97.dim(config.helpText));
24761
+ }
24762
+ console.log();
24763
+ if (hasAuthMethods(type2)) {
24764
+ const authMethod = await promptForAuthMethod(type2);
24765
+ const secrets = await promptForSecrets(type2, authMethod);
24766
+ const selectedModel2 = await promptForModelSelection(type2);
24767
+ return {
24768
+ type: type2,
24769
+ authMethod,
24770
+ secrets,
24771
+ selectedModel: selectedModel2,
24772
+ isInteractiveMode: true
24773
+ };
24774
+ }
24775
+ const secretLabel = "secretLabel" in config ? config.secretLabel : "secret";
24776
+ const secretResponse = await prompts4(
24777
+ {
24778
+ type: "password",
24779
+ name: "secret",
24780
+ message: `Enter your ${secretLabel}:`,
24781
+ validate: (value) => value.length > 0 || `${secretLabel} is required`
24782
+ },
24783
+ { onCancel: () => process.exit(0) }
24784
+ );
24785
+ const secret = secretResponse.secret;
24786
+ const selectedModel = await promptForModelSelection(type2);
24787
+ return { type: type2, secret, selectedModel, isInteractiveMode: true };
24788
+ }
24789
+ async function promptSetAsDefault2(type2, framework, isDefault) {
24790
+ if (isDefault) return;
24791
+ const response = await prompts4(
24792
+ {
24793
+ type: "confirm",
24794
+ name: "setDefault",
24795
+ message: "Set this provider as default?",
24796
+ initial: false
24797
+ },
24798
+ { onCancel: () => process.exit(0) }
24799
+ );
24800
+ if (response.setDefault) {
24801
+ await setZeroOrgModelProviderDefault(type2);
24802
+ console.log(chalk97.green(`\u2713 Default for ${framework} set to "${type2}"`));
24803
+ }
24804
+ }
24805
+ var setupCommand3 = new Command110().name("setup").description("Configure an org-level model provider").option("-t, --type <type>", "Provider type (for non-interactive mode)").option(
24806
+ "-s, --secret <value>",
24807
+ "Secret value (can be used multiple times, supports VALUE or KEY=VALUE format)",
24808
+ collectSecrets,
24809
+ []
24810
+ ).option(
24811
+ "-a, --auth-method <method>",
24812
+ "Auth method (required for multi-auth providers like aws-bedrock)"
24813
+ ).option("-m, --model <model>", "Model selection (for non-interactive mode)").action(
24814
+ withErrorHandler(
24815
+ async (options) => {
24816
+ let input;
24817
+ const secretArgs = options.secret ?? [];
24818
+ if (options.type && secretArgs.length > 0) {
24819
+ input = handleNonInteractiveMode({
24820
+ type: options.type,
24821
+ secret: secretArgs,
24822
+ authMethod: options.authMethod,
24823
+ model: options.model,
24824
+ commandPrefix: "vm0 zero org model-provider setup"
24825
+ });
24826
+ } else if (options.type || secretArgs.length > 0) {
24827
+ throw new Error("Both --type and --secret are required");
24828
+ } else {
24829
+ const result = await handleInteractiveMode2();
24830
+ if (result === null) {
24831
+ return;
24832
+ }
24833
+ input = result;
24834
+ }
24835
+ if (input.keepExistingSecret) {
24836
+ const provider2 = await updateZeroOrgModelProviderModel(
24837
+ input.type,
24838
+ input.selectedModel
24839
+ );
24840
+ const defaultNote2 = provider2.isDefault ? ` (default for ${provider2.framework})` : "";
24841
+ const modelNote2 = provider2.selectedModel ? ` with model: ${provider2.selectedModel}` : "";
24842
+ if (!hasModelSelection(input.type)) {
24843
+ console.log(
24844
+ chalk97.green(`\u2713 Org model provider "${input.type}" unchanged`)
24845
+ );
24846
+ } else {
24847
+ console.log(
24848
+ chalk97.green(
24849
+ `\u2713 Org model provider "${input.type}" updated${defaultNote2}${modelNote2}`
24850
+ )
24851
+ );
24852
+ }
24853
+ if (input.isInteractiveMode) {
24854
+ await promptSetAsDefault2(
24855
+ input.type,
24856
+ provider2.framework,
24857
+ provider2.isDefault
24858
+ );
24859
+ }
24860
+ return;
24861
+ }
24862
+ const { provider, created } = await upsertZeroOrgModelProvider({
24863
+ type: input.type,
24864
+ secret: input.secret,
24865
+ authMethod: input.authMethod,
24866
+ secrets: input.secrets,
24867
+ selectedModel: input.selectedModel
24868
+ });
24869
+ const action = created ? "created" : "updated";
24870
+ const defaultNote = provider.isDefault ? ` (default for ${provider.framework})` : "";
24871
+ const modelNote = provider.selectedModel ? ` with model: ${provider.selectedModel}` : "";
24872
+ console.log(
24873
+ chalk97.green(
24874
+ `\u2713 Org model provider "${input.type}" ${action}${defaultNote}${modelNote}`
24875
+ )
24876
+ );
24877
+ if (input.isInteractiveMode) {
24878
+ await promptSetAsDefault2(
24879
+ input.type,
24880
+ provider.framework,
24881
+ provider.isDefault
24882
+ );
24883
+ }
24884
+ }
24885
+ )
24886
+ );
24887
+
24888
+ // src/commands/zero/org/model-provider/remove.ts
24889
+ import { Command as Command111 } from "commander";
24890
+ import chalk98 from "chalk";
24891
+ var removeCommand8 = new Command111().name("remove").description("Remove an org-level model provider").argument("<type>", "Model provider type to remove").action(
24892
+ withErrorHandler(async (type2) => {
24893
+ if (!Object.keys(MODEL_PROVIDER_TYPES).includes(type2)) {
24894
+ const validTypes = Object.keys(MODEL_PROVIDER_TYPES).join(", ");
24895
+ throw new Error(`Invalid type "${type2}"`, {
24896
+ cause: new Error(`Valid types: ${validTypes}`)
24897
+ });
24898
+ }
24899
+ await deleteZeroOrgModelProvider(type2);
24900
+ console.log(chalk98.green(`\u2713 Org model provider "${type2}" removed`));
24901
+ })
24902
+ );
24903
+
24904
+ // src/commands/zero/org/model-provider/set-default.ts
24905
+ import { Command as Command112 } from "commander";
24906
+ import chalk99 from "chalk";
24907
+ var setDefaultCommand2 = new Command112().name("set-default").description("Set an org-level model provider as default for its framework").argument("<type>", "Model provider type to set as default").action(
24908
+ withErrorHandler(async (type2) => {
24909
+ if (!Object.keys(MODEL_PROVIDER_TYPES).includes(type2)) {
24910
+ const validTypes = Object.keys(MODEL_PROVIDER_TYPES).join(", ");
24911
+ throw new Error(`Invalid type "${type2}"`, {
24912
+ cause: new Error(`Valid types: ${validTypes}`)
24913
+ });
24914
+ }
24915
+ const provider = await setZeroOrgModelProviderDefault(
24916
+ type2
24917
+ );
24918
+ console.log(
24919
+ chalk99.green(
24920
+ `\u2713 Default for ${provider.framework} set to "${provider.type}"`
24921
+ )
24922
+ );
24923
+ })
24924
+ );
24925
+
24926
+ // src/commands/zero/org/model-provider/index.ts
24927
+ var zeroOrgModelProviderCommand = new Command113().name("model-provider").description("Manage org-level model providers").addCommand(listCommand17).addCommand(setupCommand3).addCommand(removeCommand8).addCommand(setDefaultCommand2);
24928
+
24929
+ // src/commands/zero/org/index.ts
24930
+ var zeroOrgCommand = new Command114().name("org").description("Manage your organization").addCommand(statusCommand9).addCommand(setCommand6).addCommand(listCommand14).addCommand(useCommand2).addCommand(membersCommand2).addCommand(inviteCommand2).addCommand(removeCommand5).addCommand(leaveCommand2).addCommand(deleteCommand5).addCommand(zeroOrgSecretCommand).addCommand(zeroOrgVariableCommand).addCommand(zeroOrgModelProviderCommand);
24931
+
24932
+ // src/commands/zero/agent/index.ts
24933
+ import { Command as Command120 } from "commander";
24934
+
24935
+ // src/commands/zero/agent/create.ts
24936
+ import { Command as Command115 } from "commander";
24937
+ import { readFileSync } from "fs";
24938
+ import chalk100 from "chalk";
24939
+ var createCommand = new Command115().name("create").description("Create a new zero agent").requiredOption(
24940
+ "--connectors <items>",
24941
+ "Comma-separated connector short names (e.g. github,linear)"
24942
+ ).option("--display-name <name>", "Agent display name").option("--description <text>", "Agent description").option(
24943
+ "--sound <tone>",
24944
+ "Agent tone: professional, friendly, direct, supportive"
24945
+ ).option("--instructions-file <path>", "Path to instructions file").action(
24946
+ withErrorHandler(
24947
+ async (options) => {
24948
+ const connectors = options.connectors.split(",").map((s) => s.trim());
24949
+ const agent = await createZeroAgent({
24950
+ connectors,
24951
+ displayName: options.displayName,
24952
+ description: options.description,
24953
+ sound: options.sound
24954
+ });
24955
+ if (options.instructionsFile) {
24956
+ const content = readFileSync(options.instructionsFile, "utf-8");
24957
+ await updateZeroAgentInstructions(agent.name, content);
24958
+ }
24959
+ console.log(chalk100.green(`\u2713 Zero agent '${agent.name}' created`));
24960
+ console.log(` Compose ID: ${agent.agentComposeId}`);
24961
+ console.log(` Connectors: ${agent.connectors.join(", ")}`);
24962
+ if (agent.displayName) {
24963
+ console.log(` Display Name: ${agent.displayName}`);
24964
+ }
24965
+ }
24966
+ )
24967
+ );
24968
+
24969
+ // src/commands/zero/agent/edit.ts
24970
+ import { Command as Command116 } from "commander";
24971
+ import { readFileSync as readFileSync2 } from "fs";
24972
+ import chalk101 from "chalk";
24973
+ var editCommand = new Command116().name("edit").description("Edit a zero agent").argument("<name>", "Agent name").option(
24974
+ "--connectors <items>",
24975
+ "Comma-separated connector short names (e.g. github,linear)"
24976
+ ).option("--display-name <name>", "New display name").option("--description <text>", "New description").option(
24977
+ "--sound <tone>",
24978
+ "New tone: professional, friendly, direct, supportive"
24979
+ ).option("--instructions-file <path>", "Path to new instructions file").action(
24980
+ withErrorHandler(
24981
+ async (name, options) => {
24982
+ const hasAgentUpdate = options.connectors !== void 0 || options.displayName !== void 0 || options.description !== void 0 || options.sound !== void 0;
24983
+ if (!hasAgentUpdate && !options.instructionsFile) {
24984
+ throw new Error(
24985
+ "At least one option is required (--connectors, --display-name, --description, --sound, --instructions-file)"
24986
+ );
24987
+ }
24988
+ if (hasAgentUpdate) {
24989
+ const current = await getZeroAgent(name);
24990
+ const connectors = options.connectors ? options.connectors.split(",").map((s) => s.trim()) : current.connectors;
24991
+ await updateZeroAgent(name, {
24992
+ connectors,
24993
+ displayName: options.displayName !== void 0 ? options.displayName : current.displayName ?? void 0,
24994
+ description: options.description !== void 0 ? options.description : current.description ?? void 0,
24995
+ sound: options.sound !== void 0 ? options.sound : current.sound ?? void 0
24996
+ });
24997
+ }
24998
+ if (options.instructionsFile) {
24999
+ const content = readFileSync2(options.instructionsFile, "utf-8");
25000
+ await updateZeroAgentInstructions(name, content);
25001
+ }
25002
+ console.log(chalk101.green(`\u2713 Zero agent '${name}' updated`));
25003
+ }
25004
+ )
25005
+ );
25006
+
25007
+ // src/commands/zero/agent/view.ts
25008
+ import { Command as Command117 } from "commander";
25009
+ import chalk102 from "chalk";
25010
+ var viewCommand = new Command117().name("view").description("View a zero agent").argument("<name>", "Agent name").option("--instructions", "Also show instructions content").action(
25011
+ withErrorHandler(
25012
+ async (name, options) => {
25013
+ const agent = await getZeroAgent(name);
25014
+ console.log(chalk102.bold(agent.name));
25015
+ if (agent.displayName) console.log(chalk102.dim(agent.displayName));
25016
+ console.log();
25017
+ console.log(`Compose ID: ${agent.agentComposeId}`);
25018
+ console.log(`Connectors: ${agent.connectors.join(", ") || "-"}`);
25019
+ if (agent.description)
25020
+ console.log(`Description: ${agent.description}`);
25021
+ if (agent.sound) console.log(`Sound: ${agent.sound}`);
25022
+ if (options.instructions) {
25023
+ console.log();
25024
+ const result = await getZeroAgentInstructions(name);
25025
+ if (result.content) {
25026
+ console.log(chalk102.dim("\u2500\u2500 Instructions \u2500\u2500"));
25027
+ console.log(result.content);
25028
+ } else {
25029
+ console.log(chalk102.dim("No instructions set"));
25030
+ }
25031
+ }
25032
+ }
25033
+ )
25034
+ );
25035
+
25036
+ // src/commands/zero/agent/list.ts
25037
+ import { Command as Command118 } from "commander";
25038
+ import chalk103 from "chalk";
25039
+ var listCommand18 = new Command118().name("list").alias("ls").description("List all zero agents").action(
25040
+ withErrorHandler(async () => {
25041
+ const agents = await listZeroAgents();
25042
+ if (agents.length === 0) {
25043
+ console.log(chalk103.dim("No zero agents found"));
25044
+ console.log(
25045
+ chalk103.dim(
25046
+ ' Create one with: vm0 zero agent create --connectors github --display-name "My Agent"'
25047
+ )
25048
+ );
25049
+ return;
25050
+ }
25051
+ const nameWidth = Math.max(4, ...agents.map((a) => a.name.length));
25052
+ const displayWidth = Math.max(
25053
+ 12,
25054
+ ...agents.map((a) => (a.displayName ?? "").length)
25055
+ );
25056
+ const header = [
25057
+ "NAME".padEnd(nameWidth),
25058
+ "DISPLAY NAME".padEnd(displayWidth),
25059
+ "CONNECTORS"
25060
+ ].join(" ");
25061
+ console.log(chalk103.dim(header));
25062
+ for (const agent of agents) {
25063
+ const row = [
25064
+ agent.name.padEnd(nameWidth),
25065
+ (agent.displayName ?? "-").padEnd(displayWidth),
25066
+ agent.connectors.join(", ") || "-"
25067
+ ].join(" ");
25068
+ console.log(row);
25069
+ }
25070
+ })
25071
+ );
25072
+
25073
+ // src/commands/zero/agent/delete.ts
25074
+ import { Command as Command119 } from "commander";
25075
+ import chalk104 from "chalk";
25076
+ var deleteCommand6 = new Command119().name("delete").alias("rm").description("Delete a zero agent").argument("<name>", "Agent name").option("-y, --yes", "Skip confirmation prompt").action(
25077
+ withErrorHandler(async (name, options) => {
25078
+ await getZeroAgent(name);
25079
+ if (!options.yes) {
25080
+ if (!isInteractive()) {
25081
+ throw new Error("--yes flag is required in non-interactive mode");
25082
+ }
25083
+ const confirmed = await promptConfirm(
25084
+ `Delete zero agent '${name}'?`,
25085
+ false
25086
+ );
25087
+ if (!confirmed) {
25088
+ console.log(chalk104.dim("Cancelled"));
25089
+ return;
25090
+ }
25091
+ }
25092
+ await deleteZeroAgent(name);
25093
+ console.log(chalk104.green(`\u2713 Zero agent '${name}' deleted`));
25094
+ })
25095
+ );
25096
+
25097
+ // src/commands/zero/agent/index.ts
25098
+ var agentCommand2 = new Command120("agent").description("Manage zero agents").addCommand(createCommand).addCommand(editCommand).addCommand(viewCommand).addCommand(listCommand18).addCommand(deleteCommand6);
25099
+
25100
+ // src/commands/zero/index.ts
25101
+ var zeroCommand = new Command121("zero").description("Zero platform commands").addCommand(zeroOrgCommand).addCommand(agentCommand2);
25102
+
23980
25103
  // src/index.ts
23981
- var program = new Command93();
23982
- program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.75.2");
25104
+ var program = new Command122();
25105
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.76.0");
23983
25106
  program.addCommand(authCommand);
23984
25107
  program.addCommand(infoCommand);
23985
25108
  program.addCommand(composeCommand);