@vm0/cli 9.90.2 → 9.90.4

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.
@@ -41,13 +41,15 @@ function isOperationalError(error) {
41
41
  return false;
42
42
  }
43
43
  const message = error.message;
44
- return OPERATIONAL_ERROR_PATTERNS.some((pattern) => pattern.test(message));
44
+ return OPERATIONAL_ERROR_PATTERNS.some((pattern) => {
45
+ return pattern.test(message);
46
+ });
45
47
  }
46
48
  if (DSN) {
47
49
  Sentry.init({
48
50
  dsn: DSN,
49
51
  environment: process.env.SENTRY_ENVIRONMENT ?? "production",
50
- release: "9.90.2",
52
+ release: "9.90.4",
51
53
  sendDefaultPii: false,
52
54
  tracesSampleRate: 0,
53
55
  shutdownTimeout: 500,
@@ -66,7 +68,7 @@ if (DSN) {
66
68
  }
67
69
  });
68
70
  Sentry.setContext("cli", {
69
- version: "9.90.2",
71
+ version: "9.90.4",
70
72
  command: process.argv.slice(2).join(" ")
71
73
  });
72
74
  Sentry.setContext("runtime", {
@@ -460,10 +462,9 @@ var agentDefinitionSchema = z3.object({
460
462
  * Path to instructions file (e.g., AGENTS.md).
461
463
  * Auto-uploaded as volume and mounted at /home/user/.claude/CLAUDE.md
462
464
  */
463
- instructions: z3.string().min(1, "Instructions path cannot be empty").refine(
464
- (val) => !val.includes("..") && !val.startsWith("/") && !val.startsWith("\\"),
465
- "Instructions path must be a relative path without '..' segments"
466
- ).optional(),
465
+ instructions: z3.string().min(1, "Instructions path cannot be empty").refine((val) => {
466
+ return !val.includes("..") && !val.startsWith("/") && !val.startsWith("\\");
467
+ }, "Instructions path must be a relative path without '..' segments").optional(),
467
468
  /**
468
469
  * Array of GitHub tree URLs for agent skills.
469
470
  * Each skill is auto-downloaded and mounted at /home/user/.claude/skills/{skillName}/
@@ -543,8 +544,7 @@ var composesMainContract = c.router({
543
544
  path: "/api/agent/composes",
544
545
  headers: authHeadersSchema,
545
546
  query: z3.object({
546
- name: z3.string().min(1, "Missing name query parameter"),
547
- org: z3.string().optional()
547
+ name: z3.string().min(1, "Missing name query parameter")
548
548
  }),
549
549
  responses: {
550
550
  200: composeResponseSchema,
@@ -660,15 +660,13 @@ var composesListContract = c.router({
660
660
  /**
661
661
  * GET /api/agent/composes/list?org={org}
662
662
  * List all agent composes for an org
663
- * If org is not provided, uses the authenticated user's default org
663
+ * Uses the authenticated user's active org.
664
664
  */
665
665
  list: {
666
666
  method: "GET",
667
667
  path: "/api/agent/composes/list",
668
668
  headers: authHeadersSchema,
669
- query: z3.object({
670
- org: z3.string().optional()
671
- }),
669
+ query: z3.object({}),
672
670
  responses: {
673
671
  200: z3.object({
674
672
  composes: z3.array(composeListItemSchema)
@@ -859,7 +857,6 @@ var logsListContract = c2.router({
859
857
  search: z5.string().optional(),
860
858
  agent: z5.string().optional(),
861
859
  name: z5.string().optional(),
862
- org: z5.string().optional(),
863
860
  status: logStatusSchema.optional(),
864
861
  triggerSource: triggerSourceSchema.optional(),
865
862
  scheduleId: z5.string().uuid().optional()
@@ -981,7 +978,9 @@ var orgTierSchema = z7.enum(["free", "pro", "team"]);
981
978
  var orgSlugSchema = z7.string().min(3, "Org slug must be at least 3 characters").max(64, "Org slug must be at most 64 characters").regex(
982
979
  /^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]{1,2}$/,
983
980
  "Org slug must contain only lowercase letters, numbers, and hyphens, and must start and end with an alphanumeric character"
984
- ).transform((s) => s.toLowerCase());
981
+ ).transform((s) => {
982
+ return s.toLowerCase();
983
+ });
985
984
  var orgResponseSchema = z7.object({
986
985
  id: z7.string(),
987
986
  slug: z7.string(),
@@ -996,7 +995,7 @@ var updateOrgRequestSchema = z7.object({
996
995
  });
997
996
  var orgDefaultAgentContract = c3.router({
998
997
  /**
999
- * PUT /api/zero/default-agent?org={slug}
998
+ * PUT /api/zero/default-agent
1000
999
  * Set or unset the default agent for an org.
1001
1000
  * Only org admins can perform this action.
1002
1001
  * The agent must belong to the same org.
@@ -1005,9 +1004,7 @@ var orgDefaultAgentContract = c3.router({
1005
1004
  method: "PUT",
1006
1005
  path: "/api/zero/default-agent",
1007
1006
  headers: authHeadersSchema,
1008
- query: z7.object({
1009
- org: z7.string().optional()
1010
- }),
1007
+ query: z7.object({}),
1011
1008
  body: z7.object({
1012
1009
  agentId: z7.uuid().nullable()
1013
1010
  }),
@@ -2548,7 +2545,9 @@ var HIDDEN_PROVIDER_TYPES = new Set(
2548
2545
  );
2549
2546
  function getSelectableProviderTypes() {
2550
2547
  return Object.keys(MODEL_PROVIDER_TYPES).filter(
2551
- (type) => !HIDDEN_PROVIDER_TYPES.has(type)
2548
+ (type) => {
2549
+ return !HIDDEN_PROVIDER_TYPES.has(type);
2550
+ }
2552
2551
  );
2553
2552
  }
2554
2553
  var ANTHROPIC_API_BASE = "https://api.anthropic.com";
@@ -2740,7 +2739,6 @@ var c10 = initContract();
2740
2739
  var chatThreadListItemSchema = z17.object({
2741
2740
  id: z17.string(),
2742
2741
  title: z17.string().nullable(),
2743
- preview: z17.string().nullable(),
2744
2742
  agentId: z17.string(),
2745
2743
  createdAt: z17.string(),
2746
2744
  updatedAt: z17.string()
@@ -6619,7 +6617,11 @@ function getConnectorDerivedNames(secretName) {
6619
6617
  continue;
6620
6618
  }
6621
6619
  const mapping = getConnectorEnvironmentMapping(type);
6622
- const envVarNames = Object.entries(mapping).filter(([, valueRef]) => valueRef === `$secrets.${secretName}`).map(([envVar]) => envVar);
6620
+ const envVarNames = Object.entries(mapping).filter(([, valueRef]) => {
6621
+ return valueRef === `$secrets.${secretName}`;
6622
+ }).map(([envVar]) => {
6623
+ return envVar;
6624
+ });
6623
6625
  if (envVarNames.length > 0) {
6624
6626
  return { connectorLabel: config.label, envVarNames };
6625
6627
  }
@@ -6636,7 +6638,9 @@ function hasRequiredScopes(connectorType, storedScopes) {
6636
6638
  if (oauthConfig.scopes.length === 0) return true;
6637
6639
  if (!storedScopes) return false;
6638
6640
  const storedSet = new Set(storedScopes);
6639
- return oauthConfig.scopes.every((s) => storedSet.has(s));
6641
+ return oauthConfig.scopes.every((s) => {
6642
+ return storedSet.has(s);
6643
+ });
6640
6644
  }
6641
6645
  function getScopeDiff(connectorType, storedScopes) {
6642
6646
  const oauthConfig = getConnectorOAuthConfig(connectorType);
@@ -6645,8 +6649,12 @@ function getScopeDiff(connectorType, storedScopes) {
6645
6649
  const storedSet = new Set(stored);
6646
6650
  const currentSet = new Set(currentScopes);
6647
6651
  return {
6648
- addedScopes: currentScopes.filter((s) => !storedSet.has(s)),
6649
- removedScopes: stored.filter((s) => !currentSet.has(s)),
6652
+ addedScopes: currentScopes.filter((s) => {
6653
+ return !storedSet.has(s);
6654
+ }),
6655
+ removedScopes: stored.filter((s) => {
6656
+ return !currentSet.has(s);
6657
+ }),
6650
6658
  currentScopes,
6651
6659
  storedScopes: stored
6652
6660
  };
@@ -16396,10 +16404,9 @@ function expandPlaceholders(firewall, connectorType) {
16396
16404
  return { ...firewall, placeholders: expanded };
16397
16405
  }
16398
16406
  var EXPANDED_CONNECTOR_FIREWALLS = Object.fromEntries(
16399
- Object.entries(CONNECTOR_FIREWALLS).map(([type, firewall]) => [
16400
- type,
16401
- expandPlaceholders(firewall, type)
16402
- ])
16407
+ Object.entries(CONNECTOR_FIREWALLS).map(([type, firewall]) => {
16408
+ return [type, expandPlaceholders(firewall, type)];
16409
+ })
16403
16410
  );
16404
16411
  function isFirewallConnectorType(type) {
16405
16412
  return type in CONNECTOR_FIREWALLS;
@@ -16479,7 +16486,9 @@ var updateUserPreferencesRequestSchema = z22.object({
16479
16486
  pinnedAgentIds: z22.array(z22.string()).optional(),
16480
16487
  sendMode: sendModeSchema.optional()
16481
16488
  }).refine(
16482
- (data) => data.timezone !== void 0 || data.pinnedAgentIds !== void 0 || data.sendMode !== void 0,
16489
+ (data) => {
16490
+ return data.timezone !== void 0 || data.pinnedAgentIds !== void 0 || data.sendMode !== void 0;
16491
+ },
16483
16492
  {
16484
16493
  message: "At least one preference must be provided"
16485
16494
  }
@@ -17380,8 +17389,7 @@ var zeroComposesMainContract = c24.router({
17380
17389
  path: "/api/zero/composes",
17381
17390
  headers: authHeadersSchema,
17382
17391
  query: z30.object({
17383
- name: z30.string().min(1, "Missing name query parameter"),
17384
- org: z30.string().optional()
17392
+ name: z30.string().min(1, "Missing name query parameter")
17385
17393
  }),
17386
17394
  responses: {
17387
17395
  200: composeResponseSchema,
@@ -17431,9 +17439,7 @@ var zeroComposesListContract = c24.router({
17431
17439
  method: "GET",
17432
17440
  path: "/api/zero/composes/list",
17433
17441
  headers: authHeadersSchema,
17434
- query: z30.object({
17435
- org: z30.string().optional()
17436
- }),
17442
+ query: z30.object({}),
17437
17443
  responses: {
17438
17444
  200: z30.object({
17439
17445
  composes: z30.array(composeListItemSchema)
@@ -17664,7 +17670,9 @@ var zeroDeployScheduleRequestSchema = z32.object({
17664
17670
  data.cronExpression,
17665
17671
  data.atTime,
17666
17672
  data.intervalSeconds
17667
- ].filter((v) => v !== void 0);
17673
+ ].filter((v) => {
17674
+ return v !== void 0;
17675
+ });
17668
17676
  return triggers.length === 1;
17669
17677
  },
17670
17678
  {
@@ -18541,7 +18549,9 @@ async function sha1(input) {
18541
18549
  const data = new TextEncoder().encode(input);
18542
18550
  const hashBuffer = await crypto.subtle.digest("SHA-1", data);
18543
18551
  const hashArray = Array.from(new Uint8Array(hashBuffer));
18544
- const hex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
18552
+ const hex = hashArray.map((b) => {
18553
+ return b.toString(16).padStart(2, "0");
18554
+ }).join("");
18545
18555
  sha1Cache.set(input, hex);
18546
18556
  return hex;
18547
18557
  }
@@ -18893,11 +18903,11 @@ function withErrorHandler(fn) {
18893
18903
 
18894
18904
  // src/lib/api/domains/composes.ts
18895
18905
  import { initClient } from "@ts-rest/core";
18896
- async function getComposeByName(name, org) {
18906
+ async function getComposeByName(name) {
18897
18907
  const config = await getClientConfig();
18898
18908
  const client = initClient(composesMainContract, config);
18899
18909
  const result = await client.getByName({
18900
- query: { name, org }
18910
+ query: { name }
18901
18911
  });
18902
18912
  if (result.status === 200) {
18903
18913
  return result.body;
@@ -18908,7 +18918,7 @@ async function getComposeByName(name, org) {
18908
18918
  handleError(result, `Compose not found: ${name}`);
18909
18919
  }
18910
18920
  var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
18911
- async function resolveCompose(identifier, org) {
18921
+ async function resolveCompose(identifier) {
18912
18922
  if (UUID_PATTERN.test(identifier)) {
18913
18923
  try {
18914
18924
  return await getComposeById(identifier);
@@ -18919,7 +18929,7 @@ async function resolveCompose(identifier, org) {
18919
18929
  throw error;
18920
18930
  }
18921
18931
  }
18922
- return getComposeByName(identifier, org);
18932
+ return getComposeByName(identifier);
18923
18933
  }
18924
18934
  async function getComposeById(id) {
18925
18935
  const config = await getClientConfig();
@@ -18997,121 +19007,11 @@ async function resolveSkills(skillUrls) {
18997
19007
  }
18998
19008
  }
18999
19009
 
19000
- // src/lib/api/domains/zero-orgs.ts
19001
- import { initClient as initClient4 } from "@ts-rest/core";
19002
- async function getUserTokenClientConfig() {
19003
- const baseUrl = await getBaseUrl();
19004
- const token = await getToken();
19005
- if (!token) {
19006
- throw new ApiRequestError("Not authenticated", "UNAUTHORIZED", 401);
19007
- }
19008
- const headers = {
19009
- Authorization: `Bearer ${token}`
19010
- };
19011
- const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
19012
- if (bypassSecret) {
19013
- headers["x-vercel-protection-bypass"] = bypassSecret;
19014
- }
19015
- return { baseUrl, baseHeaders: headers, jsonQuery: false };
19016
- }
19017
- async function getZeroOrg() {
19018
- const config = await getClientConfig();
19019
- const client = initClient4(zeroOrgContract, config);
19020
- const result = await client.get({ headers: {} });
19021
- if (result.status === 200) {
19022
- return result.body;
19023
- }
19024
- handleError(result, "Failed to get organization");
19025
- }
19026
- async function updateZeroOrg(body) {
19027
- const config = await getClientConfig();
19028
- const client = initClient4(zeroOrgContract, config);
19029
- const result = await client.update({ body });
19030
- if (result.status === 200) {
19031
- return result.body;
19032
- }
19033
- handleError(result, "Failed to update organization");
19034
- }
19035
- async function listZeroOrgs() {
19036
- const config = await getUserTokenClientConfig();
19037
- const client = initClient4(zeroOrgListContract, config);
19038
- const result = await client.list({ headers: {} });
19039
- if (result.status === 200) {
19040
- return result.body;
19041
- }
19042
- handleError(result, "Failed to list organizations");
19043
- }
19044
- async function getZeroOrgMembers() {
19045
- const config = await getClientConfig();
19046
- const client = initClient4(zeroOrgMembersContract, config);
19047
- const result = await client.members({ headers: {} });
19048
- if (result.status === 200) {
19049
- return result.body;
19050
- }
19051
- handleError(result, "Failed to get organization members");
19052
- }
19053
- async function inviteZeroOrgMember(email) {
19054
- const config = await getClientConfig();
19055
- const client = initClient4(zeroOrgInviteContract, config);
19056
- const result = await client.invite({
19057
- body: { email }
19058
- });
19059
- if (result.status === 200) {
19060
- return;
19061
- }
19062
- handleError(result, "Failed to invite member");
19063
- }
19064
- async function removeZeroOrgMember(email) {
19065
- const config = await getClientConfig();
19066
- const client = initClient4(zeroOrgMembersContract, config);
19067
- const result = await client.removeMember({
19068
- body: { email }
19069
- });
19070
- if (result.status === 200) {
19071
- return;
19072
- }
19073
- handleError(result, "Failed to remove member");
19074
- }
19075
- async function leaveZeroOrg() {
19076
- const config = await getClientConfig();
19077
- const client = initClient4(zeroOrgLeaveContract, config);
19078
- const result = await client.leave({
19079
- body: {}
19080
- });
19081
- if (result.status === 200) {
19082
- return;
19083
- }
19084
- handleError(result, "Failed to leave organization");
19085
- }
19086
- async function deleteZeroOrg(slug) {
19087
- const config = await getClientConfig();
19088
- const client = initClient4(zeroOrgDeleteContract, config);
19089
- const result = await client.delete({
19090
- body: { slug }
19091
- });
19092
- if (result.status === 200) {
19093
- return;
19094
- }
19095
- handleError(result, "Failed to delete organization");
19096
- }
19097
- async function switchZeroOrg(slug) {
19098
- const config = await getUserTokenClientConfig();
19099
- const client = initClient4(cliAuthOrgContract, config);
19100
- const result = await client.switchOrg({
19101
- headers: {},
19102
- body: { slug }
19103
- });
19104
- if (result.status === 200) {
19105
- return result.body;
19106
- }
19107
- handleError(result, "Failed to switch organization");
19108
- }
19109
-
19110
19010
  // src/lib/api/domains/zero-secrets.ts
19111
- import { initClient as initClient5 } from "@ts-rest/core";
19011
+ import { initClient as initClient4 } from "@ts-rest/core";
19112
19012
  async function listZeroSecrets() {
19113
19013
  const config = await getClientConfig();
19114
- const client = initClient5(zeroSecretsContract, config);
19014
+ const client = initClient4(zeroSecretsContract, config);
19115
19015
  const result = await client.list({ headers: {} });
19116
19016
  if (result.status === 200) {
19117
19017
  return result.body;
@@ -19120,7 +19020,7 @@ async function listZeroSecrets() {
19120
19020
  }
19121
19021
  async function setZeroSecret(body) {
19122
19022
  const config = await getClientConfig();
19123
- const client = initClient5(zeroSecretsContract, config);
19023
+ const client = initClient4(zeroSecretsContract, config);
19124
19024
  const result = await client.set({ body });
19125
19025
  if (result.status === 200 || result.status === 201) {
19126
19026
  return result.body;
@@ -19129,7 +19029,7 @@ async function setZeroSecret(body) {
19129
19029
  }
19130
19030
  async function deleteZeroSecret(name) {
19131
19031
  const config = await getClientConfig();
19132
- const client = initClient5(zeroSecretsByNameContract, config);
19032
+ const client = initClient4(zeroSecretsByNameContract, config);
19133
19033
  const result = await client.delete({
19134
19034
  params: { name }
19135
19035
  });
@@ -19140,10 +19040,10 @@ async function deleteZeroSecret(name) {
19140
19040
  }
19141
19041
 
19142
19042
  // src/lib/api/domains/zero-variables.ts
19143
- import { initClient as initClient6 } from "@ts-rest/core";
19043
+ import { initClient as initClient5 } from "@ts-rest/core";
19144
19044
  async function listZeroVariables() {
19145
19045
  const config = await getClientConfig();
19146
- const client = initClient6(zeroVariablesContract, config);
19046
+ const client = initClient5(zeroVariablesContract, config);
19147
19047
  const result = await client.list({ headers: {} });
19148
19048
  if (result.status === 200) {
19149
19049
  return result.body;
@@ -19152,7 +19052,7 @@ async function listZeroVariables() {
19152
19052
  }
19153
19053
  async function setZeroVariable(body) {
19154
19054
  const config = await getClientConfig();
19155
- const client = initClient6(zeroVariablesContract, config);
19055
+ const client = initClient5(zeroVariablesContract, config);
19156
19056
  const result = await client.set({ body });
19157
19057
  if (result.status === 200 || result.status === 201) {
19158
19058
  return result.body;
@@ -19161,7 +19061,7 @@ async function setZeroVariable(body) {
19161
19061
  }
19162
19062
  async function deleteZeroVariable(name) {
19163
19063
  const config = await getClientConfig();
19164
- const client = initClient6(zeroVariablesByNameContract, config);
19064
+ const client = initClient5(zeroVariablesByNameContract, config);
19165
19065
  const result = await client.delete({
19166
19066
  params: { name }
19167
19067
  });
@@ -19172,10 +19072,10 @@ async function deleteZeroVariable(name) {
19172
19072
  }
19173
19073
 
19174
19074
  // src/lib/api/domains/zero-connectors.ts
19175
- import { initClient as initClient7 } from "@ts-rest/core";
19075
+ import { initClient as initClient6 } from "@ts-rest/core";
19176
19076
  async function listZeroConnectors() {
19177
19077
  const config = await getClientConfig();
19178
- const client = initClient7(zeroConnectorsMainContract, config);
19078
+ const client = initClient6(zeroConnectorsMainContract, config);
19179
19079
  const result = await client.list({ headers: {} });
19180
19080
  if (result.status === 200) {
19181
19081
  return result.body;
@@ -19184,7 +19084,7 @@ async function listZeroConnectors() {
19184
19084
  }
19185
19085
  async function getZeroConnector(type) {
19186
19086
  const config = await getClientConfig();
19187
- const client = initClient7(zeroConnectorsByTypeContract, config);
19087
+ const client = initClient6(zeroConnectorsByTypeContract, config);
19188
19088
  const result = await client.get({
19189
19089
  params: { type }
19190
19090
  });
@@ -19198,7 +19098,7 @@ async function getZeroConnector(type) {
19198
19098
  }
19199
19099
  async function deleteZeroConnector(type) {
19200
19100
  const config = await getClientConfig();
19201
- const client = initClient7(zeroConnectorsByTypeContract, config);
19101
+ const client = initClient6(zeroConnectorsByTypeContract, config);
19202
19102
  const result = await client.delete({
19203
19103
  params: { type }
19204
19104
  });
@@ -19209,7 +19109,7 @@ async function deleteZeroConnector(type) {
19209
19109
  }
19210
19110
  async function createZeroConnectorSession(type) {
19211
19111
  const config = await getClientConfig();
19212
- const client = initClient7(zeroConnectorSessionsContract, config);
19112
+ const client = initClient6(zeroConnectorSessionsContract, config);
19213
19113
  const result = await client.create({
19214
19114
  params: { type },
19215
19115
  body: {}
@@ -19221,7 +19121,7 @@ async function createZeroConnectorSession(type) {
19221
19121
  }
19222
19122
  async function getZeroConnectorSession(type, sessionId) {
19223
19123
  const config = await getClientConfig();
19224
- const client = initClient7(zeroConnectorSessionByIdContract, config);
19124
+ const client = initClient6(zeroConnectorSessionByIdContract, config);
19225
19125
  const result = await client.get({
19226
19126
  params: { type, sessionId }
19227
19127
  });
@@ -19232,7 +19132,7 @@ async function getZeroConnectorSession(type, sessionId) {
19232
19132
  }
19233
19133
  async function createZeroComputerConnector() {
19234
19134
  const config = await getClientConfig();
19235
- const client = initClient7(zeroComputerConnectorContract, config);
19135
+ const client = initClient6(zeroComputerConnectorContract, config);
19236
19136
  const result = await client.create({
19237
19137
  body: {}
19238
19138
  });
@@ -19243,7 +19143,7 @@ async function createZeroComputerConnector() {
19243
19143
  }
19244
19144
  async function deleteZeroComputerConnector() {
19245
19145
  const config = await getClientConfig();
19246
- const client = initClient7(zeroComputerConnectorContract, config);
19146
+ const client = initClient6(zeroComputerConnectorContract, config);
19247
19147
  const result = await client.delete({});
19248
19148
  if (result.status === 204) {
19249
19149
  return;
@@ -19252,10 +19152,10 @@ async function deleteZeroComputerConnector() {
19252
19152
  }
19253
19153
 
19254
19154
  // src/lib/api/domains/logs.ts
19255
- import { initClient as initClient8 } from "@ts-rest/core";
19155
+ import { initClient as initClient7 } from "@ts-rest/core";
19256
19156
  async function getSystemLog(runId, options) {
19257
19157
  const config = await getClientConfig();
19258
- const client = initClient8(runSystemLogContract, config);
19158
+ const client = initClient7(runSystemLogContract, config);
19259
19159
  const result = await client.getSystemLog({
19260
19160
  params: { id: runId },
19261
19161
  query: {
@@ -19271,7 +19171,7 @@ async function getSystemLog(runId, options) {
19271
19171
  }
19272
19172
  async function getMetrics(runId, options) {
19273
19173
  const config = await getClientConfig();
19274
- const client = initClient8(runMetricsContract, config);
19174
+ const client = initClient7(runMetricsContract, config);
19275
19175
  const result = await client.getMetrics({
19276
19176
  params: { id: runId },
19277
19177
  query: {
@@ -19287,7 +19187,7 @@ async function getMetrics(runId, options) {
19287
19187
  }
19288
19188
  async function getAgentEvents(runId, options) {
19289
19189
  const config = await getClientConfig();
19290
- const client = initClient8(runAgentEventsContract, config);
19190
+ const client = initClient7(runAgentEventsContract, config);
19291
19191
  const result = await client.getAgentEvents({
19292
19192
  params: { id: runId },
19293
19193
  query: {
@@ -19303,7 +19203,7 @@ async function getAgentEvents(runId, options) {
19303
19203
  }
19304
19204
  async function getNetworkLogs(runId, options) {
19305
19205
  const config = await getClientConfig();
19306
- const client = initClient8(runNetworkLogsContract, config);
19206
+ const client = initClient7(runNetworkLogsContract, config);
19307
19207
  const result = await client.getNetworkLogs({
19308
19208
  params: { id: runId },
19309
19209
  query: {
@@ -19319,7 +19219,7 @@ async function getNetworkLogs(runId, options) {
19319
19219
  }
19320
19220
  async function searchLogs(options) {
19321
19221
  const config = await getClientConfig();
19322
- const client = initClient8(logsSearchContract, config);
19222
+ const client = initClient7(logsSearchContract, config);
19323
19223
  const result = await client.searchLogs({
19324
19224
  query: {
19325
19225
  keyword: options.keyword,
@@ -19338,10 +19238,10 @@ async function searchLogs(options) {
19338
19238
  }
19339
19239
 
19340
19240
  // src/lib/api/domains/runs.ts
19341
- import { initClient as initClient9 } from "@ts-rest/core";
19241
+ import { initClient as initClient8 } from "@ts-rest/core";
19342
19242
  async function createRun(body) {
19343
19243
  const config = await getClientConfig();
19344
- const client = initClient9(runsMainContract, config);
19244
+ const client = initClient8(runsMainContract, config);
19345
19245
  const result = await client.create({ body });
19346
19246
  if (result.status === 201) {
19347
19247
  return result.body;
@@ -19350,7 +19250,7 @@ async function createRun(body) {
19350
19250
  }
19351
19251
  async function getEvents(runId, options) {
19352
19252
  const config = await getClientConfig();
19353
- const client = initClient9(runEventsContract, config);
19253
+ const client = initClient8(runEventsContract, config);
19354
19254
  const result = await client.getEvents({
19355
19255
  params: { id: runId },
19356
19256
  query: {
@@ -19365,7 +19265,7 @@ async function getEvents(runId, options) {
19365
19265
  }
19366
19266
  async function listRuns(params) {
19367
19267
  const config = await getClientConfig();
19368
- const client = initClient9(runsMainContract, config);
19268
+ const client = initClient8(runsMainContract, config);
19369
19269
  const result = await client.list({
19370
19270
  query: {
19371
19271
  status: params?.status,
@@ -19382,7 +19282,7 @@ async function listRuns(params) {
19382
19282
  }
19383
19283
  async function getRunQueue() {
19384
19284
  const config = await getClientConfig();
19385
- const client = initClient9(runsQueueContract, config);
19285
+ const client = initClient8(runsQueueContract, config);
19386
19286
  const result = await client.getQueue({ headers: {} });
19387
19287
  if (result.status === 200) {
19388
19288
  return result.body;
@@ -19391,7 +19291,7 @@ async function getRunQueue() {
19391
19291
  }
19392
19292
  async function cancelRun(runId) {
19393
19293
  const config = await getClientConfig();
19394
- const client = initClient9(runsCancelContract, config);
19294
+ const client = initClient8(runsCancelContract, config);
19395
19295
  const result = await client.cancel({
19396
19296
  params: { id: runId }
19397
19297
  });
@@ -19402,10 +19302,10 @@ async function cancelRun(runId) {
19402
19302
  }
19403
19303
 
19404
19304
  // src/lib/api/domains/sessions.ts
19405
- import { initClient as initClient10 } from "@ts-rest/core";
19305
+ import { initClient as initClient9 } from "@ts-rest/core";
19406
19306
  async function getSession(sessionId) {
19407
19307
  const config = await getClientConfig();
19408
- const client = initClient10(sessionsByIdContract, config);
19308
+ const client = initClient9(sessionsByIdContract, config);
19409
19309
  const result = await client.getById({
19410
19310
  params: { id: sessionId }
19411
19311
  });
@@ -19418,7 +19318,7 @@ async function getSession(sessionId) {
19418
19318
  }
19419
19319
  async function getCheckpoint(checkpointId) {
19420
19320
  const config = await getClientConfig();
19421
- const client = initClient10(checkpointsByIdContract, config);
19321
+ const client = initClient9(checkpointsByIdContract, config);
19422
19322
  const result = await client.getById({
19423
19323
  params: { id: checkpointId }
19424
19324
  });
@@ -19429,10 +19329,10 @@ async function getCheckpoint(checkpointId) {
19429
19329
  }
19430
19330
 
19431
19331
  // src/lib/api/domains/storages.ts
19432
- import { initClient as initClient11 } from "@ts-rest/core";
19332
+ import { initClient as initClient10 } from "@ts-rest/core";
19433
19333
  async function prepareStorage(body) {
19434
19334
  const config = await getClientConfig();
19435
- const client = initClient11(storagesPrepareContract, config);
19335
+ const client = initClient10(storagesPrepareContract, config);
19436
19336
  const result = await client.prepare({ body });
19437
19337
  if (result.status === 200) {
19438
19338
  return result.body;
@@ -19441,7 +19341,7 @@ async function prepareStorage(body) {
19441
19341
  }
19442
19342
  async function commitStorage(body) {
19443
19343
  const config = await getClientConfig();
19444
- const client = initClient11(storagesCommitContract, config);
19344
+ const client = initClient10(storagesCommitContract, config);
19445
19345
  const result = await client.commit({ body });
19446
19346
  if (result.status === 200) {
19447
19347
  return result.body;
@@ -19450,7 +19350,7 @@ async function commitStorage(body) {
19450
19350
  }
19451
19351
  async function getStorageDownload(query) {
19452
19352
  const config = await getClientConfig();
19453
- const client = initClient11(storagesDownloadContract, config);
19353
+ const client = initClient10(storagesDownloadContract, config);
19454
19354
  const result = await client.download({
19455
19355
  query: {
19456
19356
  name: query.name,
@@ -19465,7 +19365,7 @@ async function getStorageDownload(query) {
19465
19365
  }
19466
19366
  async function listStorages(query) {
19467
19367
  const config = await getClientConfig();
19468
- const client = initClient11(storagesListContract, config);
19368
+ const client = initClient10(storagesListContract, config);
19469
19369
  const result = await client.list({ query });
19470
19370
  if (result.status === 200) {
19471
19371
  return result.body;
@@ -19473,6 +19373,116 @@ async function listStorages(query) {
19473
19373
  handleError(result, `Failed to list ${query.type}s`);
19474
19374
  }
19475
19375
 
19376
+ // src/lib/api/domains/zero-orgs.ts
19377
+ import { initClient as initClient11 } from "@ts-rest/core";
19378
+ async function getUserTokenClientConfig() {
19379
+ const baseUrl = await getBaseUrl();
19380
+ const token = await getToken();
19381
+ if (!token) {
19382
+ throw new ApiRequestError("Not authenticated", "UNAUTHORIZED", 401);
19383
+ }
19384
+ const headers = {
19385
+ Authorization: `Bearer ${token}`
19386
+ };
19387
+ const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
19388
+ if (bypassSecret) {
19389
+ headers["x-vercel-protection-bypass"] = bypassSecret;
19390
+ }
19391
+ return { baseUrl, baseHeaders: headers, jsonQuery: false };
19392
+ }
19393
+ async function getZeroOrg() {
19394
+ const config = await getClientConfig();
19395
+ const client = initClient11(zeroOrgContract, config);
19396
+ const result = await client.get({ headers: {} });
19397
+ if (result.status === 200) {
19398
+ return result.body;
19399
+ }
19400
+ handleError(result, "Failed to get organization");
19401
+ }
19402
+ async function updateZeroOrg(body) {
19403
+ const config = await getClientConfig();
19404
+ const client = initClient11(zeroOrgContract, config);
19405
+ const result = await client.update({ body });
19406
+ if (result.status === 200) {
19407
+ return result.body;
19408
+ }
19409
+ handleError(result, "Failed to update organization");
19410
+ }
19411
+ async function listZeroOrgs() {
19412
+ const config = await getUserTokenClientConfig();
19413
+ const client = initClient11(zeroOrgListContract, config);
19414
+ const result = await client.list({ headers: {} });
19415
+ if (result.status === 200) {
19416
+ return result.body;
19417
+ }
19418
+ handleError(result, "Failed to list organizations");
19419
+ }
19420
+ async function getZeroOrgMembers() {
19421
+ const config = await getClientConfig();
19422
+ const client = initClient11(zeroOrgMembersContract, config);
19423
+ const result = await client.members({ headers: {} });
19424
+ if (result.status === 200) {
19425
+ return result.body;
19426
+ }
19427
+ handleError(result, "Failed to get organization members");
19428
+ }
19429
+ async function inviteZeroOrgMember(email) {
19430
+ const config = await getClientConfig();
19431
+ const client = initClient11(zeroOrgInviteContract, config);
19432
+ const result = await client.invite({
19433
+ body: { email }
19434
+ });
19435
+ if (result.status === 200) {
19436
+ return;
19437
+ }
19438
+ handleError(result, "Failed to invite member");
19439
+ }
19440
+ async function removeZeroOrgMember(email) {
19441
+ const config = await getClientConfig();
19442
+ const client = initClient11(zeroOrgMembersContract, config);
19443
+ const result = await client.removeMember({
19444
+ body: { email }
19445
+ });
19446
+ if (result.status === 200) {
19447
+ return;
19448
+ }
19449
+ handleError(result, "Failed to remove member");
19450
+ }
19451
+ async function leaveZeroOrg() {
19452
+ const config = await getClientConfig();
19453
+ const client = initClient11(zeroOrgLeaveContract, config);
19454
+ const result = await client.leave({
19455
+ body: {}
19456
+ });
19457
+ if (result.status === 200) {
19458
+ return;
19459
+ }
19460
+ handleError(result, "Failed to leave organization");
19461
+ }
19462
+ async function deleteZeroOrg(slug) {
19463
+ const config = await getClientConfig();
19464
+ const client = initClient11(zeroOrgDeleteContract, config);
19465
+ const result = await client.delete({
19466
+ body: { slug }
19467
+ });
19468
+ if (result.status === 200) {
19469
+ return;
19470
+ }
19471
+ handleError(result, "Failed to delete organization");
19472
+ }
19473
+ async function switchZeroOrg(slug) {
19474
+ const config = await getUserTokenClientConfig();
19475
+ const client = initClient11(cliAuthOrgContract, config);
19476
+ const result = await client.switchOrg({
19477
+ headers: {},
19478
+ body: { slug }
19479
+ });
19480
+ if (result.status === 200) {
19481
+ return result.body;
19482
+ }
19483
+ handleError(result, "Failed to switch organization");
19484
+ }
19485
+
19476
19486
  // src/lib/api/domains/zero-org-secrets.ts
19477
19487
  import { initClient as initClient12 } from "@ts-rest/core";
19478
19488
  async function listZeroOrgSecrets() {
@@ -19782,14 +19792,20 @@ async function resolveZeroScheduleByAgent(agentIdentifier, scheduleName) {
19782
19792
  throw new Error(`Agent not found: ${agentIdentifier}`);
19783
19793
  }
19784
19794
  const { schedules } = await listZeroSchedules();
19785
- const agentSchedules = schedules.filter((s) => s.agentId === compose.id);
19795
+ const agentSchedules = schedules.filter((s) => {
19796
+ return s.agentId === compose.id;
19797
+ });
19786
19798
  if (agentSchedules.length === 0) {
19787
19799
  throw new Error(`No schedule found for agent "${agentIdentifier}"`);
19788
19800
  }
19789
19801
  if (scheduleName) {
19790
- const match = agentSchedules.find((s) => s.name === scheduleName);
19802
+ const match = agentSchedules.find((s) => {
19803
+ return s.name === scheduleName;
19804
+ });
19791
19805
  if (!match) {
19792
- const available2 = agentSchedules.map((s) => s.name).join(", ");
19806
+ const available2 = agentSchedules.map((s) => {
19807
+ return s.name;
19808
+ }).join(", ");
19793
19809
  throw new Error(
19794
19810
  `Schedule "${scheduleName}" not found for agent "${agentIdentifier}". Available schedules: ${available2}`
19795
19811
  );
@@ -19799,7 +19815,9 @@ async function resolveZeroScheduleByAgent(agentIdentifier, scheduleName) {
19799
19815
  if (agentSchedules.length === 1) {
19800
19816
  return agentSchedules[0];
19801
19817
  }
19802
- const available = agentSchedules.map((s) => s.name).join(", ");
19818
+ const available = agentSchedules.map((s) => {
19819
+ return s.name;
19820
+ }).join(", ");
19803
19821
  throw new Error(
19804
19822
  `Agent "${agentIdentifier}" has multiple schedules. Use --name to specify which one: ${available}`
19805
19823
  );
@@ -20061,16 +20079,36 @@ function formatToolHeader(data) {
20061
20079
  return [headline];
20062
20080
  }
20063
20081
  var toolHeadlineFormatters = {
20064
- Read: (input) => `Read${chalk3.dim(`(${String(input.file_path || "")})`)}`,
20065
- Edit: (input) => `Edit${chalk3.dim(`(${String(input.file_path || "")})`)}`,
20066
- Write: (input) => `Write${chalk3.dim(`(${String(input.file_path || "")})`)}`,
20067
- Bash: (input) => `Bash${chalk3.dim(`(${truncate(String(input.command || ""), 60)})`)}`,
20068
- Glob: (input) => `Glob${chalk3.dim(`(${String(input.pattern || "")})`)}`,
20069
- Grep: (input) => `Grep${chalk3.dim(`(${String(input.pattern || "")})`)}`,
20070
- Task: (input) => `Task${chalk3.dim(`(${truncate(String(input.description || ""), 60)})`)}`,
20071
- WebFetch: (input) => `WebFetch${chalk3.dim(`(${truncate(String(input.url || ""), 60)})`)}`,
20072
- WebSearch: (input) => `WebSearch${chalk3.dim(`(${truncate(String(input.query || ""), 60)})`)}`,
20073
- TodoWrite: () => "TodoWrite"
20082
+ Read: (input) => {
20083
+ return `Read${chalk3.dim(`(${String(input.file_path || "")})`)}`;
20084
+ },
20085
+ Edit: (input) => {
20086
+ return `Edit${chalk3.dim(`(${String(input.file_path || "")})`)}`;
20087
+ },
20088
+ Write: (input) => {
20089
+ return `Write${chalk3.dim(`(${String(input.file_path || "")})`)}`;
20090
+ },
20091
+ Bash: (input) => {
20092
+ return `Bash${chalk3.dim(`(${truncate(String(input.command || ""), 60)})`)}`;
20093
+ },
20094
+ Glob: (input) => {
20095
+ return `Glob${chalk3.dim(`(${String(input.pattern || "")})`)}`;
20096
+ },
20097
+ Grep: (input) => {
20098
+ return `Grep${chalk3.dim(`(${String(input.pattern || "")})`)}`;
20099
+ },
20100
+ Task: (input) => {
20101
+ return `Task${chalk3.dim(`(${truncate(String(input.description || ""), 60)})`)}`;
20102
+ },
20103
+ WebFetch: (input) => {
20104
+ return `WebFetch${chalk3.dim(`(${truncate(String(input.url || ""), 60)})`)}`;
20105
+ },
20106
+ WebSearch: (input) => {
20107
+ return `WebSearch${chalk3.dim(`(${truncate(String(input.query || ""), 60)})`)}`;
20108
+ },
20109
+ TodoWrite: () => {
20110
+ return "TodoWrite";
20111
+ }
20074
20112
  };
20075
20113
  function getToolHeadline(tool, input) {
20076
20114
  const formatter = toolHeadlineFormatters[tool];
@@ -20141,7 +20179,9 @@ function formatReadContent(resultText, verbose) {
20141
20179
  contentLines.push(match[1] ?? "");
20142
20180
  }
20143
20181
  }
20144
- const displayLines = contentLines.length > 0 ? contentLines : rawLines.filter((line) => line.trim().length > 0);
20182
+ const displayLines = contentLines.length > 0 ? contentLines : rawLines.filter((line) => {
20183
+ return line.trim().length > 0;
20184
+ });
20145
20185
  const totalLines = displayLines.length;
20146
20186
  if (totalLines === 0) {
20147
20187
  lines.push(`\u2514 \u2713 ${chalk3.dim("(empty)")}`);
@@ -20553,7 +20593,9 @@ Expected format: '{"ref": {"permission": "allow|deny|ask"}}'`
20553
20593
  const result = firewallPoliciesSchema.safeParse(parsed);
20554
20594
  if (!result.success) {
20555
20595
  throw new Error(
20556
- `Invalid --firewall-policies: ${result.error.issues.map((i) => i.message).join(", ")}`
20596
+ `Invalid --firewall-policies: ${result.error.issues.map((i) => {
20597
+ return i.message;
20598
+ }).join(", ")}`
20557
20599
  );
20558
20600
  }
20559
20601
  return result.data;
@@ -20563,15 +20605,21 @@ function isUUID(str) {
20563
20605
  }
20564
20606
  function extractVarNames(composeContent) {
20565
20607
  const grouped = extractAndGroupVariables(composeContent);
20566
- return grouped.vars.map((r) => r.name);
20608
+ return grouped.vars.map((r) => {
20609
+ return r.name;
20610
+ });
20567
20611
  }
20568
20612
  function extractSecretNames(composeContent) {
20569
20613
  const grouped = extractAndGroupVariables(composeContent);
20570
- return grouped.secrets.map((r) => r.name);
20614
+ return grouped.secrets.map((r) => {
20615
+ return r.name;
20616
+ });
20571
20617
  }
20572
20618
  function loadValues(cliValues, configNames, envFilePath) {
20573
20619
  const result = { ...cliValues };
20574
- const missingNames = configNames.filter((name) => !(name in result));
20620
+ const missingNames = configNames.filter((name) => {
20621
+ return !(name in result);
20622
+ });
20575
20623
  if (missingNames.length > 0) {
20576
20624
  const envValues = {};
20577
20625
  for (const name of missingNames) {
@@ -20588,9 +20636,9 @@ function loadValues(cliValues, configNames, envFilePath) {
20588
20636
  const dotenvResult = dotenvConfig({ path: envFilePath, quiet: true });
20589
20637
  if (dotenvResult.parsed) {
20590
20638
  fileValues = Object.fromEntries(
20591
- Object.entries(dotenvResult.parsed).filter(
20592
- ([key]) => missingNames.includes(key)
20593
- )
20639
+ Object.entries(dotenvResult.parsed).filter(([key]) => {
20640
+ return missingNames.includes(key);
20641
+ })
20594
20642
  );
20595
20643
  }
20596
20644
  }
@@ -20602,22 +20650,14 @@ function parseIdentifier(identifier) {
20602
20650
  if (isUUID(identifier)) {
20603
20651
  return { name: identifier };
20604
20652
  }
20605
- let org;
20606
- let rest = identifier;
20607
- const slashIndex = identifier.indexOf("/");
20608
- if (slashIndex > 0) {
20609
- org = identifier.slice(0, slashIndex);
20610
- rest = identifier.slice(slashIndex + 1);
20611
- }
20612
- const colonIndex = rest.indexOf(":");
20613
- if (colonIndex > 0 && colonIndex < rest.length - 1) {
20653
+ const colonIndex = identifier.indexOf(":");
20654
+ if (colonIndex > 0 && colonIndex < identifier.length - 1) {
20614
20655
  return {
20615
- org,
20616
- name: rest.slice(0, colonIndex),
20617
- version: rest.slice(colonIndex + 1)
20656
+ name: identifier.slice(0, colonIndex),
20657
+ version: identifier.slice(colonIndex + 1)
20618
20658
  };
20619
20659
  }
20620
- return { org, name: rest };
20660
+ return { name: identifier };
20621
20661
  }
20622
20662
  function renderRunCreated(response) {
20623
20663
  if (response.status === "queued") {
@@ -20679,7 +20719,9 @@ async function pollEvents(runId, options) {
20679
20719
  result = { succeeded: false, runId };
20680
20720
  }
20681
20721
  if (!complete) {
20682
- await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
20722
+ await new Promise((resolve) => {
20723
+ return setTimeout(resolve, pollIntervalMs);
20724
+ });
20683
20725
  }
20684
20726
  }
20685
20727
  return result;
@@ -20851,4 +20893,4 @@ export {
20851
20893
  pollEvents,
20852
20894
  showNextSteps
20853
20895
  };
20854
- //# sourceMappingURL=chunk-VO3BTEUW.js.map
20896
+ //# sourceMappingURL=chunk-XQKSWAGW.js.map