@vm0/cli 9.84.7 → 9.85.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.
@@ -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.84.7",
50
+ release: "9.85.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.84.7",
69
+ version: "9.85.0",
70
70
  command: process.argv.slice(2).join(" ")
71
71
  });
72
72
  Sentry.setContext("runtime", {
@@ -18315,6 +18315,20 @@ async function getComposeByName(name, org) {
18315
18315
  }
18316
18316
  handleError(result, `Compose not found: ${name}`);
18317
18317
  }
18318
+ var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
18319
+ async function resolveCompose(identifier, org) {
18320
+ if (UUID_PATTERN.test(identifier)) {
18321
+ try {
18322
+ return await getComposeById(identifier);
18323
+ } catch (error) {
18324
+ if (error instanceof ApiRequestError && error.status === 404) {
18325
+ return null;
18326
+ }
18327
+ throw error;
18328
+ }
18329
+ }
18330
+ return getComposeByName(identifier, org);
18331
+ }
18318
18332
  async function getComposeById(id) {
18319
18333
  const config = await getClientConfig();
18320
18334
  const client = initClient(composesByIdContract, config);
@@ -19109,22 +19123,22 @@ async function disableZeroSchedule(params) {
19109
19123
  }
19110
19124
  handleError(result, `Failed to disable schedule "${params.name}"`);
19111
19125
  }
19112
- async function resolveZeroScheduleByAgent(agentName, scheduleName) {
19113
- const compose = await getComposeByName(agentName);
19126
+ async function resolveZeroScheduleByAgent(agentIdentifier, scheduleName) {
19127
+ const compose = await resolveCompose(agentIdentifier);
19114
19128
  if (!compose) {
19115
- throw new Error(`Agent not found: ${agentName}`);
19129
+ throw new Error(`Agent not found: ${agentIdentifier}`);
19116
19130
  }
19117
19131
  const { schedules } = await listZeroSchedules();
19118
19132
  const agentSchedules = schedules.filter((s) => s.agentId === compose.id);
19119
19133
  if (agentSchedules.length === 0) {
19120
- throw new Error(`No schedule found for agent "${agentName}"`);
19134
+ throw new Error(`No schedule found for agent "${agentIdentifier}"`);
19121
19135
  }
19122
19136
  if (scheduleName) {
19123
19137
  const match = agentSchedules.find((s) => s.name === scheduleName);
19124
19138
  if (!match) {
19125
19139
  const available2 = agentSchedules.map((s) => s.name).join(", ");
19126
19140
  throw new Error(
19127
- `Schedule "${scheduleName}" not found for agent "${agentName}". Available schedules: ${available2}`
19141
+ `Schedule "${scheduleName}" not found for agent "${agentIdentifier}". Available schedules: ${available2}`
19128
19142
  );
19129
19143
  }
19130
19144
  return match;
@@ -19134,10 +19148,30 @@ async function resolveZeroScheduleByAgent(agentName, scheduleName) {
19134
19148
  }
19135
19149
  const available = agentSchedules.map((s) => s.name).join(", ");
19136
19150
  throw new Error(
19137
- `Agent "${agentName}" has multiple schedules. Use --name to specify which one: ${available}`
19151
+ `Agent "${agentIdentifier}" has multiple schedules. Use --name to specify which one: ${available}`
19138
19152
  );
19139
19153
  }
19140
19154
 
19155
+ // src/lib/api/domains/zero-ask-user.ts
19156
+ import { initClient as initClient18 } from "@ts-rest/core";
19157
+ async function postAskUserQuestion(body) {
19158
+ const config = await getClientConfig();
19159
+ const client = initClient18(zeroAskUserQuestionContract, config);
19160
+ const result = await client.postQuestion({ body, headers: {} });
19161
+ if (result.status === 200) return result.body;
19162
+ handleError(result, "Failed to post question");
19163
+ }
19164
+ async function getAskUserAnswer(pendingId) {
19165
+ const config = await getClientConfig();
19166
+ const client = initClient18(zeroAskUserAnswerContract, config);
19167
+ const result = await client.getAnswer({
19168
+ query: { pendingId },
19169
+ headers: {}
19170
+ });
19171
+ if (result.status === 200) return result.body;
19172
+ handleError(result, "Failed to get answer");
19173
+ }
19174
+
19141
19175
  // src/lib/utils/prompt-utils.ts
19142
19176
  import prompts from "prompts";
19143
19177
  function isInteractive() {
@@ -19266,6 +19300,7 @@ export {
19266
19300
  getBaseUrl,
19267
19301
  withErrorHandler,
19268
19302
  getComposeByName,
19303
+ resolveCompose,
19269
19304
  getComposeById,
19270
19305
  getComposeVersion,
19271
19306
  createOrUpdateCompose,
@@ -19335,10 +19370,12 @@ export {
19335
19370
  getAgentEvents,
19336
19371
  getNetworkLogs,
19337
19372
  searchLogs,
19373
+ postAskUserQuestion,
19374
+ getAskUserAnswer,
19338
19375
  isInteractive,
19339
19376
  promptText,
19340
19377
  promptConfirm,
19341
19378
  promptSelect,
19342
19379
  promptPassword
19343
19380
  };
19344
- //# sourceMappingURL=chunk-2D3ANUQI.js.map
19381
+ //# sourceMappingURL=chunk-JCPJKFQI.js.map