@duvoai/cli 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/bin/duvo.js +1356 -300
- package/dist/bin/duvo.js.map +4 -4
- package/package.json +1 -1
package/dist/bin/duvo.js
CHANGED
|
@@ -3341,6 +3341,9 @@ var clarityCurrentProcessSnapshotApiSchema = z16.object({
|
|
|
3341
3341
|
});
|
|
3342
3342
|
var clarityTransformationProposalSnapshotApiSchema = z16.object({
|
|
3343
3343
|
id: z16.guid().describe("Proposal id"),
|
|
3344
|
+
clarity_current_process_id: z16.guid().describe(
|
|
3345
|
+
"The current-process snapshot this proposal was generated against. Use it to detect proposal/current-version anchor mismatches."
|
|
3346
|
+
),
|
|
3344
3347
|
parent_transformation_proposal_id: z16.guid().nullable().describe("Parent transformation-proposal snapshot this draft forked from"),
|
|
3345
3348
|
data: postprocessClarityTransformationProposalDataSchema.describe(
|
|
3346
3349
|
"Opaque BPMN payload for the proposed transformed process. Field names inside `data` are camelCase by design."
|
|
@@ -4788,7 +4791,7 @@ var FREQUENCIES_REQUIRING_TIME = [
|
|
|
4788
4791
|
"weekly",
|
|
4789
4792
|
"monthly"
|
|
4790
4793
|
];
|
|
4791
|
-
var
|
|
4794
|
+
var scheduleUpsertObjectSchema = z30.object({
|
|
4792
4795
|
agent_id: z30.string(),
|
|
4793
4796
|
enabled: z30.boolean(),
|
|
4794
4797
|
frequency: scheduleFrequencySchema,
|
|
@@ -4798,7 +4801,8 @@ var scheduleUpsertRequestSchema = z30.object({
|
|
|
4798
4801
|
day_of_month: z30.int().min(1).max(31).nullable().optional(),
|
|
4799
4802
|
cron: z30.string().nullable().optional(),
|
|
4800
4803
|
recurring: z30.boolean().nullable().optional()
|
|
4801
|
-
})
|
|
4804
|
+
});
|
|
4805
|
+
function refineScheduleFields(data, ctx) {
|
|
4802
4806
|
if (!data.enabled) {
|
|
4803
4807
|
return;
|
|
4804
4808
|
}
|
|
@@ -4832,7 +4836,11 @@ var scheduleUpsertRequestSchema = z30.object({
|
|
|
4832
4836
|
path: ["time"]
|
|
4833
4837
|
});
|
|
4834
4838
|
}
|
|
4835
|
-
}
|
|
4839
|
+
}
|
|
4840
|
+
__name(refineScheduleFields, "refineScheduleFields");
|
|
4841
|
+
__name2(refineScheduleFields, "refineScheduleFields");
|
|
4842
|
+
var scheduleUpsertRequestSchema = scheduleUpsertObjectSchema.superRefine(refineScheduleFields);
|
|
4843
|
+
var scheduleCreateRequestSchema = scheduleUpsertObjectSchema.omit({ agent_id: true }).superRefine(refineScheduleFields);
|
|
4836
4844
|
var buildApiSchema = z30.strictObject({
|
|
4837
4845
|
id: z30.guid(),
|
|
4838
4846
|
copilot_id: z30.guid(),
|
|
@@ -5589,7 +5597,19 @@ var queueAgentConsumerSchema = z41.object({
|
|
|
5589
5597
|
agent_name: z41.string(),
|
|
5590
5598
|
case_trigger_enabled: z41.boolean(),
|
|
5591
5599
|
is_handover_target: z41.boolean(),
|
|
5592
|
-
problems: z41.array(caseQueueAgentProblemSchema)
|
|
5600
|
+
problems: z41.array(caseQueueAgentProblemSchema),
|
|
5601
|
+
/**
|
|
5602
|
+
* Max concurrent Jobs this consumer's enabled trigger allows, after the
|
|
5603
|
+
* platform cap is applied. Populated only by the single-queue agents
|
|
5604
|
+
* endpoint; omitted when the consumer has no enabled trigger.
|
|
5605
|
+
*/
|
|
5606
|
+
concurrency_limit: z41.int().nonnegative().optional(),
|
|
5607
|
+
/**
|
|
5608
|
+
* True when this consumer's active Jobs have reached `concurrency_limit`, so
|
|
5609
|
+
* the dispatcher pauses and new cases stay pending until a Job finishes.
|
|
5610
|
+
* Populated only by the single-queue agents endpoint.
|
|
5611
|
+
*/
|
|
5612
|
+
at_concurrency_limit: z41.boolean().optional()
|
|
5593
5613
|
});
|
|
5594
5614
|
var queueAgentsResponseSchema = z41.object({
|
|
5595
5615
|
queue_name: z41.string(),
|
|
@@ -6265,7 +6285,8 @@ var INTEGRATION_SLUGS = [
|
|
|
6265
6285
|
"github",
|
|
6266
6286
|
"linear-native",
|
|
6267
6287
|
"notion-native",
|
|
6268
|
-
"granola"
|
|
6288
|
+
"granola",
|
|
6289
|
+
"bamboohr"
|
|
6269
6290
|
];
|
|
6270
6291
|
var IntegrationSlugSchema = z48.enum(INTEGRATION_SLUGS);
|
|
6271
6292
|
function isIntegrationSlug(value) {
|
|
@@ -9975,8 +9996,185 @@ var publicScheduleSchema = z65.object({
|
|
|
9975
9996
|
var listSchedulesResponseSchema = z65.object({
|
|
9976
9997
|
schedules: z65.array(publicScheduleSchema)
|
|
9977
9998
|
});
|
|
9999
|
+
var deleteScheduleResponseSchema = z65.object({
|
|
10000
|
+
success: z65.literal(true)
|
|
10001
|
+
});
|
|
10002
|
+
|
|
10003
|
+
// src/commands/agents/schedules/render-schedule.ts
|
|
10004
|
+
function renderScheduleDetails(schedule) {
|
|
10005
|
+
return renderKeyValue([
|
|
10006
|
+
{ label: "ID", value: schedule.id },
|
|
10007
|
+
{ label: "Agent", value: schedule.agent_id },
|
|
10008
|
+
{ label: "Build", value: schedule.build_id },
|
|
10009
|
+
{ label: "Enabled", value: schedule.enabled ? "yes" : "no" },
|
|
10010
|
+
{ label: "Frequency", value: schedule.frequency },
|
|
10011
|
+
{ label: "Time", value: schedule.time ?? "\u2014" },
|
|
10012
|
+
{ label: "Timezone", value: schedule.timezone },
|
|
10013
|
+
{ label: "Day", value: schedule.day ?? "\u2014" },
|
|
10014
|
+
{
|
|
10015
|
+
label: "Day of month",
|
|
10016
|
+
value: schedule.day_of_month === null || schedule.day_of_month === void 0 ? "\u2014" : String(schedule.day_of_month)
|
|
10017
|
+
},
|
|
10018
|
+
{ label: "Cron", value: schedule.cron ?? "\u2014" },
|
|
10019
|
+
{
|
|
10020
|
+
label: "Recurring",
|
|
10021
|
+
value: schedule.recurring === false ? "no" : "yes"
|
|
10022
|
+
},
|
|
10023
|
+
{ label: "Created", value: schedule.created_at },
|
|
10024
|
+
{ label: "Updated", value: schedule.updated_at }
|
|
10025
|
+
]);
|
|
10026
|
+
}
|
|
10027
|
+
__name(renderScheduleDetails, "renderScheduleDetails");
|
|
10028
|
+
|
|
10029
|
+
// src/commands/agents/schedules/schedule-fields.ts
|
|
10030
|
+
var FREQUENCY_HINT = scheduleFrequencySchema.options.join(", ");
|
|
10031
|
+
var DAY_HINT = scheduleDaySchema.options.join(", ");
|
|
10032
|
+
var TIME_PATTERN = /^([01]?\d|2[0-3]):[0-5]\d$/;
|
|
10033
|
+
var INTEGER_PATTERN = /^\d+$/;
|
|
10034
|
+
var MIN_DAY_OF_MONTH = 1;
|
|
10035
|
+
var MAX_DAY_OF_MONTH = 31;
|
|
10036
|
+
function parseFrequency(raw) {
|
|
10037
|
+
const result = scheduleFrequencySchema.safeParse(raw.trim());
|
|
10038
|
+
if (!result.success) {
|
|
10039
|
+
throw new CliError(`--frequency must be one of: ${FREQUENCY_HINT}`);
|
|
10040
|
+
}
|
|
10041
|
+
return result.data;
|
|
10042
|
+
}
|
|
10043
|
+
__name(parseFrequency, "parseFrequency");
|
|
10044
|
+
function parseDay(raw) {
|
|
10045
|
+
const result = scheduleDaySchema.safeParse(raw.trim().toLowerCase());
|
|
10046
|
+
if (!result.success) {
|
|
10047
|
+
throw new CliError(`--day must be one of: ${DAY_HINT}`);
|
|
10048
|
+
}
|
|
10049
|
+
return result.data;
|
|
10050
|
+
}
|
|
10051
|
+
__name(parseDay, "parseDay");
|
|
10052
|
+
function parseTime(raw) {
|
|
10053
|
+
const trimmed = raw.trim();
|
|
10054
|
+
if (!TIME_PATTERN.test(trimmed)) {
|
|
10055
|
+
throw new CliError("--time must be in HH:MM 24-hour format (e.g. 09:30)");
|
|
10056
|
+
}
|
|
10057
|
+
return trimmed;
|
|
10058
|
+
}
|
|
10059
|
+
__name(parseTime, "parseTime");
|
|
10060
|
+
function parseDayOfMonth(raw) {
|
|
10061
|
+
const trimmed = raw.trim();
|
|
10062
|
+
const value = Number(trimmed);
|
|
10063
|
+
if (!INTEGER_PATTERN.test(trimmed) || value < MIN_DAY_OF_MONTH || value > MAX_DAY_OF_MONTH) {
|
|
10064
|
+
throw new CliError(
|
|
10065
|
+
`--day-of-month must be an integer between ${MIN_DAY_OF_MONTH} and ${MAX_DAY_OF_MONTH}`
|
|
10066
|
+
);
|
|
10067
|
+
}
|
|
10068
|
+
return value;
|
|
10069
|
+
}
|
|
10070
|
+
__name(parseDayOfMonth, "parseDayOfMonth");
|
|
10071
|
+
|
|
10072
|
+
// src/commands/agents/schedules/create.ts
|
|
10073
|
+
function registerAgentsSchedulesCreate(schedules) {
|
|
10074
|
+
schedules.command("create <agent-id>").description(
|
|
10075
|
+
"Create a schedule for an agent. The schedule fires against the agent's live build."
|
|
10076
|
+
).requiredOption(
|
|
10077
|
+
"--frequency <frequency>",
|
|
10078
|
+
`how often the schedule fires (one of: ${FREQUENCY_HINT})`
|
|
10079
|
+
).requiredOption(
|
|
10080
|
+
"--timezone <tz>",
|
|
10081
|
+
"IANA timezone the schedule runs in (e.g. America/New_York)"
|
|
10082
|
+
).option(
|
|
10083
|
+
"--time <HH:MM>",
|
|
10084
|
+
"time of day, 24-hour (required for daily, workday, weekly, monthly)"
|
|
10085
|
+
).option(
|
|
10086
|
+
"--day <day>",
|
|
10087
|
+
`day of week for weekly schedules (one of: ${DAY_HINT})`
|
|
10088
|
+
).option("--day-of-month <n>", "day of month (1-31) for monthly schedules").option("--cron <expr>", "cron expression (required for custom schedules)").option(
|
|
10089
|
+
"--disabled",
|
|
10090
|
+
"create the schedule disabled (default: enabled and running)"
|
|
10091
|
+
).option(
|
|
10092
|
+
"--no-recurring",
|
|
10093
|
+
"retire the schedule after its first run (default: recurring)"
|
|
10094
|
+
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function createAction(agentId, options) {
|
|
10095
|
+
const trimmedAgentId = trimRequired(agentId, "<agent-id>");
|
|
10096
|
+
const body = {
|
|
10097
|
+
enabled: options.disabled !== true,
|
|
10098
|
+
frequency: parseFrequency(options.frequency),
|
|
10099
|
+
timezone: trimRequired(options.timezone, "--timezone"),
|
|
10100
|
+
recurring: options.recurring !== false
|
|
10101
|
+
};
|
|
10102
|
+
if (options.time !== void 0) {
|
|
10103
|
+
body.time = parseTime(options.time);
|
|
10104
|
+
}
|
|
10105
|
+
if (options.day !== void 0) {
|
|
10106
|
+
body.day = parseDay(options.day);
|
|
10107
|
+
}
|
|
10108
|
+
if (options.dayOfMonth !== void 0) {
|
|
10109
|
+
body.day_of_month = parseDayOfMonth(options.dayOfMonth);
|
|
10110
|
+
}
|
|
10111
|
+
if (options.cron !== void 0) {
|
|
10112
|
+
body.cron = trimRequired(options.cron, "--cron");
|
|
10113
|
+
}
|
|
10114
|
+
const validation = scheduleCreateRequestSchema.safeParse(body);
|
|
10115
|
+
if (!validation.success) {
|
|
10116
|
+
throw new CliError(
|
|
10117
|
+
validation.error.issues[0]?.message ?? "Invalid schedule"
|
|
10118
|
+
);
|
|
10119
|
+
}
|
|
10120
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
10121
|
+
const raw = await httpRequest({
|
|
10122
|
+
method: "POST",
|
|
10123
|
+
path: `/v1/agents/${encodeURIComponent(trimmedAgentId)}/schedules`,
|
|
10124
|
+
apiKey,
|
|
10125
|
+
apiBaseUrl,
|
|
10126
|
+
body
|
|
10127
|
+
});
|
|
10128
|
+
if (options.json) {
|
|
10129
|
+
printJson(raw);
|
|
10130
|
+
return;
|
|
10131
|
+
}
|
|
10132
|
+
const parsed = publicScheduleSchema.safeParse(raw);
|
|
10133
|
+
if (!parsed.success) {
|
|
10134
|
+
throw new CliError(
|
|
10135
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
10136
|
+
);
|
|
10137
|
+
}
|
|
10138
|
+
console.log(green("Schedule created!"));
|
|
10139
|
+
console.log(renderScheduleDetails(parsed.data));
|
|
10140
|
+
}, "createAction"));
|
|
10141
|
+
}
|
|
10142
|
+
__name(registerAgentsSchedulesCreate, "registerAgentsSchedulesCreate");
|
|
10143
|
+
|
|
10144
|
+
// src/commands/agents/schedules/delete.ts
|
|
10145
|
+
function registerAgentsSchedulesDelete(schedules) {
|
|
10146
|
+
schedules.command("delete <agent-id> <schedule-id>").description("Delete a schedule").option("-y, --yes", "skip the confirmation prompt").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function deleteAction(agentId, scheduleId, options) {
|
|
10147
|
+
const trimmedAgentId = trimRequired(agentId, "<agent-id>");
|
|
10148
|
+
const trimmedScheduleId = trimRequired(scheduleId, "<schedule-id>");
|
|
10149
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
10150
|
+
await confirmDestructive({
|
|
10151
|
+
message: `Delete schedule "${trimmedScheduleId}"?`,
|
|
10152
|
+
skip: options.yes === true
|
|
10153
|
+
});
|
|
10154
|
+
const raw = await httpRequest({
|
|
10155
|
+
method: "DELETE",
|
|
10156
|
+
path: `/v1/agents/${encodeURIComponent(trimmedAgentId)}/schedules/${encodeURIComponent(
|
|
10157
|
+
trimmedScheduleId
|
|
10158
|
+
)}`,
|
|
10159
|
+
apiKey,
|
|
10160
|
+
apiBaseUrl
|
|
10161
|
+
});
|
|
10162
|
+
if (options.json) {
|
|
10163
|
+
printJson(raw);
|
|
10164
|
+
return;
|
|
10165
|
+
}
|
|
10166
|
+
const parsed = deleteScheduleResponseSchema.safeParse(raw);
|
|
10167
|
+
if (!parsed.success) {
|
|
10168
|
+
throw new CliError(
|
|
10169
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
10170
|
+
);
|
|
10171
|
+
}
|
|
10172
|
+
console.log(green("Schedule deleted!"));
|
|
10173
|
+
}, "deleteAction"));
|
|
10174
|
+
}
|
|
10175
|
+
__name(registerAgentsSchedulesDelete, "registerAgentsSchedulesDelete");
|
|
9978
10176
|
|
|
9979
|
-
// src/commands/agents/schedules.ts
|
|
10177
|
+
// src/commands/agents/schedules/list.ts
|
|
9980
10178
|
var TASK_PREVIEW_WIDTH = 40;
|
|
9981
10179
|
var TABLE_COLUMNS5 = [
|
|
9982
10180
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
@@ -10010,12 +10208,15 @@ function whenCell(row) {
|
|
|
10010
10208
|
return row.time ?? "";
|
|
10011
10209
|
}
|
|
10012
10210
|
__name(whenCell, "whenCell");
|
|
10013
|
-
function
|
|
10014
|
-
|
|
10211
|
+
function registerAgentsSchedulesList(schedules) {
|
|
10212
|
+
schedules.command("list <agent-id>", { isDefault: true }).description(
|
|
10213
|
+
"List schedules you own for an agent (use to find the schedule ID for update / delete)"
|
|
10214
|
+
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function listAction(agentId, options) {
|
|
10215
|
+
const id = trimRequired(agentId, "<agent-id>");
|
|
10015
10216
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
10016
10217
|
const raw = await httpRequest({
|
|
10017
10218
|
method: "GET",
|
|
10018
|
-
path: `/v1/agents/${encodeURIComponent(
|
|
10219
|
+
path: `/v1/agents/${encodeURIComponent(id)}/schedules`,
|
|
10019
10220
|
apiKey,
|
|
10020
10221
|
apiBaseUrl
|
|
10021
10222
|
});
|
|
@@ -10029,14 +10230,127 @@ function registerAgentsSchedules(agents) {
|
|
|
10029
10230
|
`Unexpected response from the API: ${parsed.error.message}`
|
|
10030
10231
|
);
|
|
10031
10232
|
}
|
|
10032
|
-
const { schedules } = parsed.data;
|
|
10033
|
-
if (
|
|
10233
|
+
const { schedules: rows } = parsed.data;
|
|
10234
|
+
if (rows.length === 0) {
|
|
10034
10235
|
console.log("No schedules found.");
|
|
10035
10236
|
return;
|
|
10036
10237
|
}
|
|
10037
|
-
console.log(renderTable(TABLE_COLUMNS5,
|
|
10038
|
-
console.log(`Showing ${
|
|
10039
|
-
}, "
|
|
10238
|
+
console.log(renderTable(TABLE_COLUMNS5, rows));
|
|
10239
|
+
console.log(`Showing ${rows.length}`);
|
|
10240
|
+
}, "listAction"));
|
|
10241
|
+
}
|
|
10242
|
+
__name(registerAgentsSchedulesList, "registerAgentsSchedulesList");
|
|
10243
|
+
|
|
10244
|
+
// src/commands/agents/schedules/update.ts
|
|
10245
|
+
function buildBody3(options) {
|
|
10246
|
+
const body = {};
|
|
10247
|
+
if (options.enable === true && options.disable === true) {
|
|
10248
|
+
throw new CliError("Pass either --enable or --disable, not both.");
|
|
10249
|
+
}
|
|
10250
|
+
if (options.enable === true) {
|
|
10251
|
+
body.enabled = true;
|
|
10252
|
+
} else if (options.disable === true) {
|
|
10253
|
+
body.enabled = false;
|
|
10254
|
+
}
|
|
10255
|
+
if (options.recurring === true && options.oneShot === true) {
|
|
10256
|
+
throw new CliError("Pass either --recurring or --one-shot, not both.");
|
|
10257
|
+
}
|
|
10258
|
+
if (options.recurring === true) {
|
|
10259
|
+
body.recurring = true;
|
|
10260
|
+
} else if (options.oneShot === true) {
|
|
10261
|
+
body.recurring = false;
|
|
10262
|
+
}
|
|
10263
|
+
if (options.frequency !== void 0) {
|
|
10264
|
+
body.frequency = parseFrequency(options.frequency);
|
|
10265
|
+
}
|
|
10266
|
+
if (options.timezone !== void 0) {
|
|
10267
|
+
body.timezone = trimRequired(options.timezone, "--timezone");
|
|
10268
|
+
}
|
|
10269
|
+
if (options.time !== void 0 && options.clearTime === true) {
|
|
10270
|
+
throw new CliError("Pass either --time or --clear-time, not both.");
|
|
10271
|
+
}
|
|
10272
|
+
if (options.time !== void 0) {
|
|
10273
|
+
body.time = parseTime(options.time);
|
|
10274
|
+
} else if (options.clearTime === true) {
|
|
10275
|
+
body.time = null;
|
|
10276
|
+
}
|
|
10277
|
+
if (options.day !== void 0 && options.clearDay === true) {
|
|
10278
|
+
throw new CliError("Pass either --day or --clear-day, not both.");
|
|
10279
|
+
}
|
|
10280
|
+
if (options.day !== void 0) {
|
|
10281
|
+
body.day = parseDay(options.day);
|
|
10282
|
+
} else if (options.clearDay === true) {
|
|
10283
|
+
body.day = null;
|
|
10284
|
+
}
|
|
10285
|
+
if (options.dayOfMonth !== void 0 && options.clearDayOfMonth === true) {
|
|
10286
|
+
throw new CliError(
|
|
10287
|
+
"Pass either --day-of-month or --clear-day-of-month, not both."
|
|
10288
|
+
);
|
|
10289
|
+
}
|
|
10290
|
+
if (options.dayOfMonth !== void 0) {
|
|
10291
|
+
body.day_of_month = parseDayOfMonth(options.dayOfMonth);
|
|
10292
|
+
} else if (options.clearDayOfMonth === true) {
|
|
10293
|
+
body.day_of_month = null;
|
|
10294
|
+
}
|
|
10295
|
+
if (options.cron !== void 0 && options.clearCron === true) {
|
|
10296
|
+
throw new CliError("Pass either --cron or --clear-cron, not both.");
|
|
10297
|
+
}
|
|
10298
|
+
if (options.cron !== void 0) {
|
|
10299
|
+
body.cron = trimRequired(options.cron, "--cron");
|
|
10300
|
+
} else if (options.clearCron === true) {
|
|
10301
|
+
body.cron = null;
|
|
10302
|
+
}
|
|
10303
|
+
if (Object.keys(body).length === 0) {
|
|
10304
|
+
throw new CliError(
|
|
10305
|
+
"Provide at least one field to update (e.g. --frequency, --time, --enable, --disable, --recurring, --one-shot)."
|
|
10306
|
+
);
|
|
10307
|
+
}
|
|
10308
|
+
return body;
|
|
10309
|
+
}
|
|
10310
|
+
__name(buildBody3, "buildBody");
|
|
10311
|
+
function registerAgentsSchedulesUpdate(schedules) {
|
|
10312
|
+
schedules.command("update <agent-id> <schedule-id>").description(
|
|
10313
|
+
"Update fields on a schedule. Only supplied fields change; omitted fields keep their current values."
|
|
10314
|
+
).option(
|
|
10315
|
+
"--frequency <frequency>",
|
|
10316
|
+
`new frequency (one of: ${FREQUENCY_HINT})`
|
|
10317
|
+
).option("--timezone <tz>", "new IANA timezone").option("--time <HH:MM>", "new time of day, 24-hour").option("--clear-time", "clear the time of day").option("--day <day>", `new day of week (one of: ${DAY_HINT})`).option("--clear-day", "clear the day of week").option("--day-of-month <n>", "new day of month (1-31)").option("--clear-day-of-month", "clear the day of month").option("--cron <expr>", "new cron expression").option("--clear-cron", "clear the cron expression").option("--enable", "enable the schedule").option("--disable", "disable the schedule").option("--recurring", "make the schedule recurring").option("--one-shot", "retire the schedule after its next run").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function updateAction(agentId, scheduleId, options) {
|
|
10318
|
+
const trimmedAgentId = trimRequired(agentId, "<agent-id>");
|
|
10319
|
+
const trimmedScheduleId = trimRequired(scheduleId, "<schedule-id>");
|
|
10320
|
+
const body = buildBody3(options);
|
|
10321
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
10322
|
+
const raw = await httpRequest({
|
|
10323
|
+
method: "PATCH",
|
|
10324
|
+
path: `/v1/agents/${encodeURIComponent(trimmedAgentId)}/schedules/${encodeURIComponent(
|
|
10325
|
+
trimmedScheduleId
|
|
10326
|
+
)}`,
|
|
10327
|
+
apiKey,
|
|
10328
|
+
apiBaseUrl,
|
|
10329
|
+
body
|
|
10330
|
+
});
|
|
10331
|
+
if (options.json) {
|
|
10332
|
+
printJson(raw);
|
|
10333
|
+
return;
|
|
10334
|
+
}
|
|
10335
|
+
const parsed = publicScheduleSchema.safeParse(raw);
|
|
10336
|
+
if (!parsed.success) {
|
|
10337
|
+
throw new CliError(
|
|
10338
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
10339
|
+
);
|
|
10340
|
+
}
|
|
10341
|
+
console.log(green("Schedule updated!"));
|
|
10342
|
+
console.log(renderScheduleDetails(parsed.data));
|
|
10343
|
+
}, "updateAction"));
|
|
10344
|
+
}
|
|
10345
|
+
__name(registerAgentsSchedulesUpdate, "registerAgentsSchedulesUpdate");
|
|
10346
|
+
|
|
10347
|
+
// src/commands/agents/schedules/index.ts
|
|
10348
|
+
function registerAgentsSchedules(agents) {
|
|
10349
|
+
const schedules = agents.command("schedules").description("Manage schedules for agents");
|
|
10350
|
+
registerAgentsSchedulesList(schedules);
|
|
10351
|
+
registerAgentsSchedulesCreate(schedules);
|
|
10352
|
+
registerAgentsSchedulesUpdate(schedules);
|
|
10353
|
+
registerAgentsSchedulesDelete(schedules);
|
|
10040
10354
|
}
|
|
10041
10355
|
__name(registerAgentsSchedules, "registerAgentsSchedules");
|
|
10042
10356
|
|
|
@@ -10056,7 +10370,7 @@ function parseBoolPair(enable, disable, enableFlag, disableFlag) {
|
|
|
10056
10370
|
return void 0;
|
|
10057
10371
|
}
|
|
10058
10372
|
__name(parseBoolPair, "parseBoolPair");
|
|
10059
|
-
function
|
|
10373
|
+
function buildBody4(options) {
|
|
10060
10374
|
const body = {};
|
|
10061
10375
|
if (options.name !== void 0) {
|
|
10062
10376
|
body.name = trimRequired(options.name, "--name");
|
|
@@ -10104,14 +10418,14 @@ function buildBody3(options) {
|
|
|
10104
10418
|
}
|
|
10105
10419
|
return body;
|
|
10106
10420
|
}
|
|
10107
|
-
__name(
|
|
10421
|
+
__name(buildBody4, "buildBody");
|
|
10108
10422
|
function registerAgentsUpdate(agents) {
|
|
10109
10423
|
agents.command("update <id>").description("Update an agent's display name or delivery settings").option("--name <name>", "new display name").option("--enable-slack", "enable Slack delivery").option("--disable-slack", "disable Slack delivery").option("--enable-microsoft-teams", "enable Microsoft Teams delivery").option("--disable-microsoft-teams", "disable Microsoft Teams delivery").option("--enable-agentic-memory", "enable agentic memory").option("--disable-agentic-memory", "disable agentic memory").option("--thread-id <id>", "associate the agent with a thread").option(
|
|
10110
10424
|
"--clear-thread",
|
|
10111
10425
|
"clear the agent's associated thread (sets thread_id to null)"
|
|
10112
10426
|
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function updateAction(id, options) {
|
|
10113
10427
|
const agentId = trimRequired(id, "<id>");
|
|
10114
|
-
const body =
|
|
10428
|
+
const body = buildBody4(options);
|
|
10115
10429
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
10116
10430
|
const raw = await httpRequest({
|
|
10117
10431
|
method: "PATCH",
|
|
@@ -12089,75 +12403,706 @@ function registerCases(program) {
|
|
|
12089
12403
|
}
|
|
12090
12404
|
__name(registerCases, "registerCases");
|
|
12091
12405
|
|
|
12092
|
-
// src/commands/
|
|
12093
|
-
|
|
12094
|
-
|
|
12095
|
-
|
|
12096
|
-
|
|
12097
|
-
|
|
12098
|
-
|
|
12099
|
-
|
|
12100
|
-
|
|
12406
|
+
// src/commands/clarity/assign-extra-capture-request.ts
|
|
12407
|
+
import { z as z71 } from "zod";
|
|
12408
|
+
var responseSchema2 = z71.object({
|
|
12409
|
+
request: clarityProposalExtraCaptureRequestSchema
|
|
12410
|
+
});
|
|
12411
|
+
function renderRequest(request) {
|
|
12412
|
+
console.log(
|
|
12413
|
+
renderKeyValue([
|
|
12414
|
+
{ label: "ID", value: request.id },
|
|
12415
|
+
{ label: "Step ID", value: request.step_id },
|
|
12416
|
+
{ label: "Status", value: request.status },
|
|
12417
|
+
{ label: "Priority", value: request.priority },
|
|
12418
|
+
{ label: "Assigned to", value: request.requested_user_id ?? "" },
|
|
12419
|
+
{ label: "Gap", value: request.gap },
|
|
12420
|
+
{ label: "Updated", value: request.updated_at }
|
|
12421
|
+
])
|
|
12422
|
+
);
|
|
12423
|
+
}
|
|
12424
|
+
__name(renderRequest, "renderRequest");
|
|
12425
|
+
function registerClarityAssignExtraCaptureRequest(clarity) {
|
|
12426
|
+
clarity.command(
|
|
12427
|
+
"assign-extra-capture-request <process-id> <proposal-id> <request-id>"
|
|
12428
|
+
).description(
|
|
12429
|
+
"Assign (or unassign) a team member to an extra-capture request"
|
|
12430
|
+
).option("--user-id <id>", "team member to assign (omit to unassign)").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, proposalId, requestId, options) {
|
|
12431
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
12432
|
+
const raw = await httpRequest({
|
|
12433
|
+
method: "PATCH",
|
|
12434
|
+
path: `/v1/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposals/${encodeURIComponent(proposalId)}/extra-capture-requests/${encodeURIComponent(requestId)}/assign`,
|
|
12435
|
+
apiKey,
|
|
12436
|
+
apiBaseUrl,
|
|
12437
|
+
body: { user_id: options.userId ?? null }
|
|
12438
|
+
});
|
|
12439
|
+
if (options.json) {
|
|
12440
|
+
printJson(raw);
|
|
12441
|
+
return;
|
|
12442
|
+
}
|
|
12443
|
+
const parsed = responseSchema2.safeParse(raw);
|
|
12444
|
+
if (!parsed.success) {
|
|
12101
12445
|
throw new CliError(
|
|
12102
|
-
|
|
12446
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
12103
12447
|
);
|
|
12104
12448
|
}
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
if (key.length === 0) {
|
|
12108
|
-
throw new CliError(`${flag} key must not be empty (got "${pair}").`);
|
|
12109
|
-
}
|
|
12110
|
-
out[key] = value;
|
|
12111
|
-
}
|
|
12112
|
-
return out;
|
|
12449
|
+
renderRequest(parsed.data.request);
|
|
12450
|
+
}, "action"));
|
|
12113
12451
|
}
|
|
12114
|
-
__name(
|
|
12452
|
+
__name(registerClarityAssignExtraCaptureRequest, "registerClarityAssignExtraCaptureRequest");
|
|
12115
12453
|
|
|
12116
|
-
// src/commands/
|
|
12117
|
-
|
|
12118
|
-
|
|
12119
|
-
|
|
12120
|
-
|
|
12121
|
-
|
|
12122
|
-
|
|
12123
|
-
|
|
12124
|
-
|
|
12125
|
-
|
|
12126
|
-
|
|
12127
|
-
|
|
12128
|
-
|
|
12129
|
-
|
|
12130
|
-
|
|
12131
|
-
|
|
12132
|
-
|
|
12133
|
-
|
|
12134
|
-
|
|
12135
|
-
(
|
|
12136
|
-
|
|
12137
|
-
|
|
12138
|
-
]
|
|
12139
|
-
).option(
|
|
12140
|
-
"--secret-header <KEY=VALUE>",
|
|
12141
|
-
"secret header \u2014 encrypted at rest (repeatable)",
|
|
12142
|
-
(value, previous) => [
|
|
12143
|
-
...previous ?? [],
|
|
12144
|
-
value
|
|
12145
|
-
]
|
|
12146
|
-
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function createAction(options) {
|
|
12147
|
-
if (options.name === void 0 || options.name.trim().length === 0) {
|
|
12148
|
-
throw new CliError("--name must not be empty");
|
|
12149
|
-
}
|
|
12150
|
-
if (options.authMethod === void 0) {
|
|
12151
|
-
throw new CliError("--auth-method is required");
|
|
12454
|
+
// src/commands/clarity/build-automation.ts
|
|
12455
|
+
import { z as z72 } from "zod";
|
|
12456
|
+
var responseSchema3 = z72.object({
|
|
12457
|
+
automation_run: z72.object({
|
|
12458
|
+
id: z72.string(),
|
|
12459
|
+
status: z72.string()
|
|
12460
|
+
})
|
|
12461
|
+
});
|
|
12462
|
+
function registerClarityBuildAutomation(clarity) {
|
|
12463
|
+
clarity.command("build-automation <process-id>").description(
|
|
12464
|
+
"Hand the latest transformation proposal off to the workflow-builder pipeline (async)"
|
|
12465
|
+
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, options) {
|
|
12466
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
12467
|
+
const raw = await httpRequest({
|
|
12468
|
+
method: "POST",
|
|
12469
|
+
path: `/v1/clarity-v2/processes/${encodeURIComponent(processId)}/automation`,
|
|
12470
|
+
apiKey,
|
|
12471
|
+
apiBaseUrl
|
|
12472
|
+
});
|
|
12473
|
+
if (options.json) {
|
|
12474
|
+
printJson(raw);
|
|
12475
|
+
return;
|
|
12152
12476
|
}
|
|
12153
|
-
|
|
12477
|
+
const parsed = responseSchema3.safeParse(raw);
|
|
12478
|
+
if (!parsed.success) {
|
|
12154
12479
|
throw new CliError(
|
|
12155
|
-
|
|
12480
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
12156
12481
|
);
|
|
12157
12482
|
}
|
|
12158
|
-
const
|
|
12159
|
-
|
|
12160
|
-
|
|
12483
|
+
const { automation_run: run } = parsed.data;
|
|
12484
|
+
console.log(
|
|
12485
|
+
renderKeyValue([
|
|
12486
|
+
{ label: "Run ID", value: run.id },
|
|
12487
|
+
{ label: "Status", value: run.status }
|
|
12488
|
+
])
|
|
12489
|
+
);
|
|
12490
|
+
}, "action"));
|
|
12491
|
+
}
|
|
12492
|
+
__name(registerClarityBuildAutomation, "registerClarityBuildAutomation");
|
|
12493
|
+
|
|
12494
|
+
// src/commands/clarity/generate-current-process.ts
|
|
12495
|
+
function registerClarityGenerateCurrentProcess(clarity) {
|
|
12496
|
+
clarity.command("generate-current-process <process-id>").description(
|
|
12497
|
+
"Trigger current-process generation for a Clarity v2 process (async)"
|
|
12498
|
+
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, options) {
|
|
12499
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
12500
|
+
const raw = await httpRequest({
|
|
12501
|
+
method: "POST",
|
|
12502
|
+
path: `/v1/clarity-v2/processes/${encodeURIComponent(processId)}/current-process`,
|
|
12503
|
+
apiKey,
|
|
12504
|
+
apiBaseUrl
|
|
12505
|
+
});
|
|
12506
|
+
if (options.json) {
|
|
12507
|
+
printJson(raw);
|
|
12508
|
+
return;
|
|
12509
|
+
}
|
|
12510
|
+
console.log("Generation started.");
|
|
12511
|
+
}, "action"));
|
|
12512
|
+
}
|
|
12513
|
+
__name(registerClarityGenerateCurrentProcess, "registerClarityGenerateCurrentProcess");
|
|
12514
|
+
|
|
12515
|
+
// src/commands/clarity/generate-transformation-proposal.ts
|
|
12516
|
+
function registerClarityGenerateTransformationProposal(clarity) {
|
|
12517
|
+
clarity.command("generate-transformation-proposal <process-id>").description(
|
|
12518
|
+
"Trigger transformation-proposal generation for a Clarity v2 process (async)"
|
|
12519
|
+
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, options) {
|
|
12520
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
12521
|
+
const raw = await httpRequest({
|
|
12522
|
+
method: "POST",
|
|
12523
|
+
path: `/v1/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposal`,
|
|
12524
|
+
apiKey,
|
|
12525
|
+
apiBaseUrl
|
|
12526
|
+
});
|
|
12527
|
+
if (options.json) {
|
|
12528
|
+
printJson(raw);
|
|
12529
|
+
return;
|
|
12530
|
+
}
|
|
12531
|
+
console.log("Generation started.");
|
|
12532
|
+
}, "action"));
|
|
12533
|
+
}
|
|
12534
|
+
__name(registerClarityGenerateTransformationProposal, "registerClarityGenerateTransformationProposal");
|
|
12535
|
+
|
|
12536
|
+
// src/commands/clarity/get-current-process.ts
|
|
12537
|
+
import { z as z73 } from "zod";
|
|
12538
|
+
var snapshotSchema = z73.object({
|
|
12539
|
+
snapshot: z73.object({
|
|
12540
|
+
id: z73.string(),
|
|
12541
|
+
status: z73.string(),
|
|
12542
|
+
creator_type: z73.string(),
|
|
12543
|
+
user_id: z73.string().nullable(),
|
|
12544
|
+
sandbox_id: z73.string().nullable(),
|
|
12545
|
+
created_at: z73.string(),
|
|
12546
|
+
updated_at: z73.string()
|
|
12547
|
+
})
|
|
12548
|
+
});
|
|
12549
|
+
function registerClarityGetCurrentProcess(clarity) {
|
|
12550
|
+
clarity.command("get-current-process <process-id> <snapshot-id>").description("Get a specific current-process snapshot by ID").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, snapshotId, options) {
|
|
12551
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
12552
|
+
const raw = await httpRequest({
|
|
12553
|
+
method: "GET",
|
|
12554
|
+
path: `/v1/clarity-v2/processes/${encodeURIComponent(processId)}/current-process/${encodeURIComponent(snapshotId)}`,
|
|
12555
|
+
apiKey,
|
|
12556
|
+
apiBaseUrl
|
|
12557
|
+
});
|
|
12558
|
+
if (options.json) {
|
|
12559
|
+
printJson(raw);
|
|
12560
|
+
return;
|
|
12561
|
+
}
|
|
12562
|
+
const parsed = snapshotSchema.safeParse(raw);
|
|
12563
|
+
if (!parsed.success) {
|
|
12564
|
+
throw new CliError(
|
|
12565
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
12566
|
+
);
|
|
12567
|
+
}
|
|
12568
|
+
const { snapshot } = parsed.data;
|
|
12569
|
+
console.log(
|
|
12570
|
+
renderKeyValue([
|
|
12571
|
+
{ label: "ID", value: snapshot.id },
|
|
12572
|
+
{ label: "Status", value: snapshot.status },
|
|
12573
|
+
{ label: "Creator type", value: snapshot.creator_type },
|
|
12574
|
+
{ label: "User ID", value: snapshot.user_id ?? "" },
|
|
12575
|
+
{ label: "Sandbox ID", value: snapshot.sandbox_id ?? "" },
|
|
12576
|
+
{ label: "Created", value: snapshot.created_at },
|
|
12577
|
+
{ label: "Updated", value: snapshot.updated_at }
|
|
12578
|
+
])
|
|
12579
|
+
);
|
|
12580
|
+
}, "action"));
|
|
12581
|
+
}
|
|
12582
|
+
__name(registerClarityGetCurrentProcess, "registerClarityGetCurrentProcess");
|
|
12583
|
+
|
|
12584
|
+
// src/commands/clarity/get-transformation-proposal.ts
|
|
12585
|
+
import { z as z74 } from "zod";
|
|
12586
|
+
var snapshotSchema2 = z74.object({
|
|
12587
|
+
snapshot: z74.object({
|
|
12588
|
+
id: z74.string(),
|
|
12589
|
+
status: z74.string(),
|
|
12590
|
+
creator_type: z74.string(),
|
|
12591
|
+
user_id: z74.string().nullable(),
|
|
12592
|
+
sandbox_id: z74.string().nullable(),
|
|
12593
|
+
created_at: z74.string(),
|
|
12594
|
+
updated_at: z74.string()
|
|
12595
|
+
})
|
|
12596
|
+
});
|
|
12597
|
+
function registerClarityGetTransformationProposal(clarity) {
|
|
12598
|
+
clarity.command("get-transformation-proposal <process-id> <proposal-id>").description("Get a specific transformation-proposal snapshot by ID").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, proposalId, options) {
|
|
12599
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
12600
|
+
const raw = await httpRequest({
|
|
12601
|
+
method: "GET",
|
|
12602
|
+
path: `/v1/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposal/${encodeURIComponent(proposalId)}`,
|
|
12603
|
+
apiKey,
|
|
12604
|
+
apiBaseUrl
|
|
12605
|
+
});
|
|
12606
|
+
if (options.json) {
|
|
12607
|
+
printJson(raw);
|
|
12608
|
+
return;
|
|
12609
|
+
}
|
|
12610
|
+
const parsed = snapshotSchema2.safeParse(raw);
|
|
12611
|
+
if (!parsed.success) {
|
|
12612
|
+
throw new CliError(
|
|
12613
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
12614
|
+
);
|
|
12615
|
+
}
|
|
12616
|
+
const { snapshot } = parsed.data;
|
|
12617
|
+
console.log(
|
|
12618
|
+
renderKeyValue([
|
|
12619
|
+
{ label: "ID", value: snapshot.id },
|
|
12620
|
+
{ label: "Status", value: snapshot.status },
|
|
12621
|
+
{ label: "Creator type", value: snapshot.creator_type },
|
|
12622
|
+
{ label: "User ID", value: snapshot.user_id ?? "" },
|
|
12623
|
+
{ label: "Sandbox ID", value: snapshot.sandbox_id ?? "" },
|
|
12624
|
+
{ label: "Created", value: snapshot.created_at },
|
|
12625
|
+
{ label: "Updated", value: snapshot.updated_at }
|
|
12626
|
+
])
|
|
12627
|
+
);
|
|
12628
|
+
}, "action"));
|
|
12629
|
+
}
|
|
12630
|
+
__name(registerClarityGetTransformationProposal, "registerClarityGetTransformationProposal");
|
|
12631
|
+
|
|
12632
|
+
// src/commands/clarity/get.ts
|
|
12633
|
+
function registerClarityGet(clarity) {
|
|
12634
|
+
clarity.command("get <process-id>").description("Get a Clarity process read model by ID").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function getAction(processId, options) {
|
|
12635
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
12636
|
+
const raw = await httpRequest({
|
|
12637
|
+
method: "GET",
|
|
12638
|
+
path: `/v1/clarity-v2/processes/${encodeURIComponent(processId)}`,
|
|
12639
|
+
apiKey,
|
|
12640
|
+
apiBaseUrl
|
|
12641
|
+
});
|
|
12642
|
+
if (options.json) {
|
|
12643
|
+
printJson(raw);
|
|
12644
|
+
return;
|
|
12645
|
+
}
|
|
12646
|
+
const parsed = clarityV2ProcessReadModelSchema.safeParse(raw);
|
|
12647
|
+
if (!parsed.success) {
|
|
12648
|
+
throw new CliError(
|
|
12649
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
12650
|
+
);
|
|
12651
|
+
}
|
|
12652
|
+
const { process: process2 } = parsed.data;
|
|
12653
|
+
console.log(
|
|
12654
|
+
renderKeyValue([
|
|
12655
|
+
{ label: "ID", value: process2.id },
|
|
12656
|
+
{ label: "Name", value: process2.name },
|
|
12657
|
+
{ label: "Status", value: process2.status },
|
|
12658
|
+
{ label: "Version", value: String(process2.version) },
|
|
12659
|
+
{ label: "Created", value: process2.created_at },
|
|
12660
|
+
{ label: "Updated", value: process2.updated_at },
|
|
12661
|
+
{
|
|
12662
|
+
label: "Error",
|
|
12663
|
+
value: process2.generation_error ?? ""
|
|
12664
|
+
},
|
|
12665
|
+
{
|
|
12666
|
+
label: "Custom prompt",
|
|
12667
|
+
value: process2.custom_prompt ?? ""
|
|
12668
|
+
}
|
|
12669
|
+
])
|
|
12670
|
+
);
|
|
12671
|
+
const {
|
|
12672
|
+
current_process_versions: cpVersions,
|
|
12673
|
+
transformation_proposal_versions: tpVersions
|
|
12674
|
+
} = parsed.data;
|
|
12675
|
+
if (cpVersions.length > 0) {
|
|
12676
|
+
console.log(`
|
|
12677
|
+
Current process versions (${cpVersions.length}):`);
|
|
12678
|
+
for (const v of cpVersions) {
|
|
12679
|
+
console.log(` - ${v.id} ${v.status} ${v.created_at}`);
|
|
12680
|
+
}
|
|
12681
|
+
}
|
|
12682
|
+
if (tpVersions.length > 0) {
|
|
12683
|
+
console.log(
|
|
12684
|
+
`
|
|
12685
|
+
Transformation proposal versions (${tpVersions.length}):`
|
|
12686
|
+
);
|
|
12687
|
+
for (const v of tpVersions) {
|
|
12688
|
+
console.log(` - ${v.id} ${v.status} ${v.created_at}`);
|
|
12689
|
+
}
|
|
12690
|
+
}
|
|
12691
|
+
}, "getAction"));
|
|
12692
|
+
}
|
|
12693
|
+
__name(registerClarityGet, "registerClarityGet");
|
|
12694
|
+
|
|
12695
|
+
// src/commands/clarity/list-extra-capture-requests.ts
|
|
12696
|
+
var DEFAULT_LIMIT5 = 20;
|
|
12697
|
+
var MIN_LIMIT5 = 1;
|
|
12698
|
+
var MAX_LIMIT5 = 100;
|
|
12699
|
+
var TABLE_COLUMNS12 = [
|
|
12700
|
+
{
|
|
12701
|
+
header: "ID",
|
|
12702
|
+
cell: /* @__PURE__ */ __name((row) => row.id, "cell")
|
|
12703
|
+
},
|
|
12704
|
+
{
|
|
12705
|
+
header: "STEP ID",
|
|
12706
|
+
cell: /* @__PURE__ */ __name((row) => row.step_id, "cell")
|
|
12707
|
+
},
|
|
12708
|
+
{
|
|
12709
|
+
header: "STATUS",
|
|
12710
|
+
cell: /* @__PURE__ */ __name((row) => row.status, "cell")
|
|
12711
|
+
},
|
|
12712
|
+
{
|
|
12713
|
+
header: "PRIORITY",
|
|
12714
|
+
cell: /* @__PURE__ */ __name((row) => row.priority, "cell")
|
|
12715
|
+
},
|
|
12716
|
+
{
|
|
12717
|
+
header: "ASSIGNED TO",
|
|
12718
|
+
cell: /* @__PURE__ */ __name((row) => row.requested_user_id ?? "", "cell")
|
|
12719
|
+
},
|
|
12720
|
+
{
|
|
12721
|
+
header: "GAP",
|
|
12722
|
+
cell: /* @__PURE__ */ __name((row) => row.gap, "cell"),
|
|
12723
|
+
maxWidth: 50
|
|
12724
|
+
}
|
|
12725
|
+
];
|
|
12726
|
+
function registerClarityListExtraCaptureRequests(clarity) {
|
|
12727
|
+
clarity.command("list-extra-capture-requests <process-id> <proposal-id>").description("List extra-capture requests for a transformation proposal").option("--limit <n>", `page size (${MIN_LIMIT5}-${MAX_LIMIT5})`).option("--offset <n>", "number of requests to skip").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, proposalId, options) {
|
|
12728
|
+
const limit = parseLimit(options.limit, {
|
|
12729
|
+
defaultValue: DEFAULT_LIMIT5,
|
|
12730
|
+
min: MIN_LIMIT5,
|
|
12731
|
+
max: MAX_LIMIT5
|
|
12732
|
+
});
|
|
12733
|
+
const offset = parseOffset(options.offset);
|
|
12734
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
12735
|
+
const searchParams = new URLSearchParams();
|
|
12736
|
+
searchParams.append("limit", String(limit));
|
|
12737
|
+
searchParams.append("offset", String(offset));
|
|
12738
|
+
const raw = await httpRequest({
|
|
12739
|
+
method: "GET",
|
|
12740
|
+
path: `/v1/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposals/${encodeURIComponent(proposalId)}/extra-capture-requests`,
|
|
12741
|
+
apiKey,
|
|
12742
|
+
apiBaseUrl,
|
|
12743
|
+
searchParams
|
|
12744
|
+
});
|
|
12745
|
+
if (options.json) {
|
|
12746
|
+
printJson(raw);
|
|
12747
|
+
return;
|
|
12748
|
+
}
|
|
12749
|
+
const parsed = clarityProposalExtraCaptureRequestListResponseSchema.safeParse(raw);
|
|
12750
|
+
if (!parsed.success) {
|
|
12751
|
+
throw new CliError(
|
|
12752
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
12753
|
+
);
|
|
12754
|
+
}
|
|
12755
|
+
const response = parsed.data;
|
|
12756
|
+
if (response.requests.length === 0) {
|
|
12757
|
+
console.log("No extra-capture requests found.");
|
|
12758
|
+
return;
|
|
12759
|
+
}
|
|
12760
|
+
console.log(renderTable(TABLE_COLUMNS12, response.requests));
|
|
12761
|
+
console.log(
|
|
12762
|
+
`Showing ${response.requests.length} of ${response.total} \xB7 offset ${response.offset}`
|
|
12763
|
+
);
|
|
12764
|
+
}, "action"));
|
|
12765
|
+
}
|
|
12766
|
+
__name(registerClarityListExtraCaptureRequests, "registerClarityListExtraCaptureRequests");
|
|
12767
|
+
|
|
12768
|
+
// src/commands/clarity/list.ts
|
|
12769
|
+
import { z as z75 } from "zod";
|
|
12770
|
+
var DEFAULT_LIMIT6 = 50;
|
|
12771
|
+
var MIN_LIMIT6 = 1;
|
|
12772
|
+
var MAX_LIMIT6 = 100;
|
|
12773
|
+
var processListItemSchema = z75.object({
|
|
12774
|
+
id: z75.string(),
|
|
12775
|
+
name: z75.string(),
|
|
12776
|
+
status: z75.string(),
|
|
12777
|
+
version: z75.number(),
|
|
12778
|
+
capture_count: z75.number(),
|
|
12779
|
+
created_at: z75.string(),
|
|
12780
|
+
created_by_name: z75.string().nullable()
|
|
12781
|
+
});
|
|
12782
|
+
var responseSchema4 = z75.object({
|
|
12783
|
+
processes: z75.array(processListItemSchema),
|
|
12784
|
+
total: z75.number(),
|
|
12785
|
+
limit: z75.number(),
|
|
12786
|
+
offset: z75.number()
|
|
12787
|
+
});
|
|
12788
|
+
var TABLE_COLUMNS13 = [
|
|
12789
|
+
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
12790
|
+
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
|
|
12791
|
+
{ header: "STATUS", cell: /* @__PURE__ */ __name((row) => row.status, "cell") },
|
|
12792
|
+
{ header: "VERSION", cell: /* @__PURE__ */ __name((row) => String(row.version), "cell") },
|
|
12793
|
+
{
|
|
12794
|
+
header: "CAPTURES",
|
|
12795
|
+
cell: /* @__PURE__ */ __name((row) => String(row.capture_count), "cell")
|
|
12796
|
+
},
|
|
12797
|
+
{ header: "CREATED", cell: /* @__PURE__ */ __name((row) => row.created_at, "cell") }
|
|
12798
|
+
];
|
|
12799
|
+
function registerClarityList(clarity) {
|
|
12800
|
+
clarity.command("list", { isDefault: true }).description("List Clarity processes for your team").option("--limit <n>", `page size (${MIN_LIMIT6}-${MAX_LIMIT6})`).option("--offset <n>", "number of processes to skip").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function listAction(options) {
|
|
12801
|
+
const limit = parseLimit(options.limit, {
|
|
12802
|
+
defaultValue: DEFAULT_LIMIT6,
|
|
12803
|
+
min: MIN_LIMIT6,
|
|
12804
|
+
max: MAX_LIMIT6
|
|
12805
|
+
});
|
|
12806
|
+
const offset = parseOffset(options.offset);
|
|
12807
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
12808
|
+
const searchParams = new URLSearchParams();
|
|
12809
|
+
searchParams.append("limit", String(limit));
|
|
12810
|
+
searchParams.append("offset", String(offset));
|
|
12811
|
+
const raw = await httpRequest({
|
|
12812
|
+
method: "GET",
|
|
12813
|
+
path: "/v1/clarity-v2/processes",
|
|
12814
|
+
apiKey,
|
|
12815
|
+
apiBaseUrl,
|
|
12816
|
+
searchParams
|
|
12817
|
+
});
|
|
12818
|
+
if (options.json) {
|
|
12819
|
+
printJson(raw);
|
|
12820
|
+
return;
|
|
12821
|
+
}
|
|
12822
|
+
const parsed = responseSchema4.safeParse(raw);
|
|
12823
|
+
if (!parsed.success) {
|
|
12824
|
+
throw new CliError(
|
|
12825
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
12826
|
+
);
|
|
12827
|
+
}
|
|
12828
|
+
const response = parsed.data;
|
|
12829
|
+
if (response.processes.length === 0) {
|
|
12830
|
+
console.log("No Clarity processes found.");
|
|
12831
|
+
return;
|
|
12832
|
+
}
|
|
12833
|
+
console.log(renderTable(TABLE_COLUMNS13, response.processes));
|
|
12834
|
+
console.log(
|
|
12835
|
+
`Showing ${response.processes.length} of ${response.total} \xB7 offset ${response.offset}`
|
|
12836
|
+
);
|
|
12837
|
+
}, "listAction"));
|
|
12838
|
+
}
|
|
12839
|
+
__name(registerClarityList, "registerClarityList");
|
|
12840
|
+
|
|
12841
|
+
// src/commands/clarity/postprocess.ts
|
|
12842
|
+
var SNAPSHOT_TYPES = ["current_process", "transformation_proposal"];
|
|
12843
|
+
function registerClarityPostprocess(clarity) {
|
|
12844
|
+
clarity.command("postprocess <process-id> <snapshot-type> <snapshot-id>").description(
|
|
12845
|
+
`Re-run postprocessing agents on an existing snapshot. snapshot-type must be one of: ${SNAPSHOT_TYPES.join(", ")}`
|
|
12846
|
+
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, snapshotType, snapshotId, options) {
|
|
12847
|
+
if (!SNAPSHOT_TYPES.includes(snapshotType)) {
|
|
12848
|
+
throw new CliError(
|
|
12849
|
+
`snapshot-type must be one of: ${SNAPSHOT_TYPES.join(", ")}`
|
|
12850
|
+
);
|
|
12851
|
+
}
|
|
12852
|
+
const type = snapshotType;
|
|
12853
|
+
const body = type === "current_process" ? { type, current_process_id: snapshotId } : { type, transformation_proposal_id: snapshotId };
|
|
12854
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
12855
|
+
const raw = await httpRequest({
|
|
12856
|
+
method: "POST",
|
|
12857
|
+
path: `/v1/clarity-v2/processes/${encodeURIComponent(processId)}/postprocess`,
|
|
12858
|
+
apiKey,
|
|
12859
|
+
apiBaseUrl,
|
|
12860
|
+
body
|
|
12861
|
+
});
|
|
12862
|
+
if (options.json) {
|
|
12863
|
+
printJson(raw);
|
|
12864
|
+
return;
|
|
12865
|
+
}
|
|
12866
|
+
console.log("Postprocessing started.");
|
|
12867
|
+
}, "action"));
|
|
12868
|
+
}
|
|
12869
|
+
__name(registerClarityPostprocess, "registerClarityPostprocess");
|
|
12870
|
+
|
|
12871
|
+
// src/commands/clarity/promote-current-process.ts
|
|
12872
|
+
import { z as z76 } from "zod";
|
|
12873
|
+
var snapshotSchema3 = z76.object({
|
|
12874
|
+
snapshot: z76.object({
|
|
12875
|
+
id: z76.string(),
|
|
12876
|
+
status: z76.string(),
|
|
12877
|
+
creator_type: z76.string(),
|
|
12878
|
+
created_at: z76.string(),
|
|
12879
|
+
updated_at: z76.string()
|
|
12880
|
+
})
|
|
12881
|
+
});
|
|
12882
|
+
function registerClarityPromoteCurrentProcess(clarity) {
|
|
12883
|
+
clarity.command("promote-current-process <process-id> <snapshot-id>").description("Promote a current-process snapshot to live").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, snapshotId, options) {
|
|
12884
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
12885
|
+
const raw = await httpRequest({
|
|
12886
|
+
method: "POST",
|
|
12887
|
+
path: `/v1/clarity-v2/processes/${encodeURIComponent(processId)}/current-process/${encodeURIComponent(snapshotId)}/promote`,
|
|
12888
|
+
apiKey,
|
|
12889
|
+
apiBaseUrl
|
|
12890
|
+
});
|
|
12891
|
+
if (options.json) {
|
|
12892
|
+
printJson(raw);
|
|
12893
|
+
return;
|
|
12894
|
+
}
|
|
12895
|
+
const parsed = snapshotSchema3.safeParse(raw);
|
|
12896
|
+
if (!parsed.success) {
|
|
12897
|
+
throw new CliError(
|
|
12898
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
12899
|
+
);
|
|
12900
|
+
}
|
|
12901
|
+
const { snapshot } = parsed.data;
|
|
12902
|
+
console.log(
|
|
12903
|
+
renderKeyValue([
|
|
12904
|
+
{ label: "ID", value: snapshot.id },
|
|
12905
|
+
{ label: "Status", value: snapshot.status },
|
|
12906
|
+
{ label: "Creator type", value: snapshot.creator_type },
|
|
12907
|
+
{ label: "Created", value: snapshot.created_at },
|
|
12908
|
+
{ label: "Updated", value: snapshot.updated_at }
|
|
12909
|
+
])
|
|
12910
|
+
);
|
|
12911
|
+
}, "action"));
|
|
12912
|
+
}
|
|
12913
|
+
__name(registerClarityPromoteCurrentProcess, "registerClarityPromoteCurrentProcess");
|
|
12914
|
+
|
|
12915
|
+
// src/commands/clarity/promote-transformation-proposal.ts
|
|
12916
|
+
import { z as z77 } from "zod";
|
|
12917
|
+
var snapshotSchema4 = z77.object({
|
|
12918
|
+
snapshot: z77.object({
|
|
12919
|
+
id: z77.string(),
|
|
12920
|
+
status: z77.string(),
|
|
12921
|
+
creator_type: z77.string(),
|
|
12922
|
+
created_at: z77.string(),
|
|
12923
|
+
updated_at: z77.string()
|
|
12924
|
+
})
|
|
12925
|
+
});
|
|
12926
|
+
function registerClarityPromoteTransformationProposal(clarity) {
|
|
12927
|
+
clarity.command("promote-transformation-proposal <process-id> <proposal-id>").description("Promote a transformation-proposal snapshot to live").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, proposalId, options) {
|
|
12928
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
12929
|
+
const raw = await httpRequest({
|
|
12930
|
+
method: "POST",
|
|
12931
|
+
path: `/v1/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposal/${encodeURIComponent(proposalId)}/promote`,
|
|
12932
|
+
apiKey,
|
|
12933
|
+
apiBaseUrl
|
|
12934
|
+
});
|
|
12935
|
+
if (options.json) {
|
|
12936
|
+
printJson(raw);
|
|
12937
|
+
return;
|
|
12938
|
+
}
|
|
12939
|
+
const parsed = snapshotSchema4.safeParse(raw);
|
|
12940
|
+
if (!parsed.success) {
|
|
12941
|
+
throw new CliError(
|
|
12942
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
12943
|
+
);
|
|
12944
|
+
}
|
|
12945
|
+
const { snapshot } = parsed.data;
|
|
12946
|
+
console.log(
|
|
12947
|
+
renderKeyValue([
|
|
12948
|
+
{ label: "ID", value: snapshot.id },
|
|
12949
|
+
{ label: "Status", value: snapshot.status },
|
|
12950
|
+
{ label: "Creator type", value: snapshot.creator_type },
|
|
12951
|
+
{ label: "Created", value: snapshot.created_at },
|
|
12952
|
+
{ label: "Updated", value: snapshot.updated_at }
|
|
12953
|
+
])
|
|
12954
|
+
);
|
|
12955
|
+
}, "action"));
|
|
12956
|
+
}
|
|
12957
|
+
__name(registerClarityPromoteTransformationProposal, "registerClarityPromoteTransformationProposal");
|
|
12958
|
+
|
|
12959
|
+
// src/commands/clarity/revert-current-process.ts
|
|
12960
|
+
function registerClarityRevertCurrentProcess(clarity) {
|
|
12961
|
+
clarity.command("revert-current-process <process-id> <snapshot-id>").description("Delete (revert) a current-process snapshot").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, snapshotId, options) {
|
|
12962
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
12963
|
+
const raw = await httpRequest({
|
|
12964
|
+
method: "DELETE",
|
|
12965
|
+
path: `/v1/clarity-v2/processes/${encodeURIComponent(processId)}/current-process/${encodeURIComponent(snapshotId)}`,
|
|
12966
|
+
apiKey,
|
|
12967
|
+
apiBaseUrl
|
|
12968
|
+
});
|
|
12969
|
+
if (options.json) {
|
|
12970
|
+
printJson(raw);
|
|
12971
|
+
return;
|
|
12972
|
+
}
|
|
12973
|
+
console.log("Snapshot reverted.");
|
|
12974
|
+
}, "action"));
|
|
12975
|
+
}
|
|
12976
|
+
__name(registerClarityRevertCurrentProcess, "registerClarityRevertCurrentProcess");
|
|
12977
|
+
|
|
12978
|
+
// src/commands/clarity/revert-transformation-proposal.ts
|
|
12979
|
+
function registerClarityRevertTransformationProposal(clarity) {
|
|
12980
|
+
clarity.command("revert-transformation-proposal <process-id> <proposal-id>").description("Delete (revert) a transformation-proposal snapshot").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, proposalId, options) {
|
|
12981
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
12982
|
+
const raw = await httpRequest({
|
|
12983
|
+
method: "DELETE",
|
|
12984
|
+
path: `/v1/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposal/${encodeURIComponent(proposalId)}`,
|
|
12985
|
+
apiKey,
|
|
12986
|
+
apiBaseUrl
|
|
12987
|
+
});
|
|
12988
|
+
if (options.json) {
|
|
12989
|
+
printJson(raw);
|
|
12990
|
+
return;
|
|
12991
|
+
}
|
|
12992
|
+
console.log("Snapshot reverted.");
|
|
12993
|
+
}, "action"));
|
|
12994
|
+
}
|
|
12995
|
+
__name(registerClarityRevertTransformationProposal, "registerClarityRevertTransformationProposal");
|
|
12996
|
+
|
|
12997
|
+
// src/commands/clarity/stop-transformation-proposal.ts
|
|
12998
|
+
function registerClarityStopTransformationProposal(clarity) {
|
|
12999
|
+
clarity.command("stop-transformation-proposal <process-id>").description("Stop an in-flight transformation-proposal generation").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, options) {
|
|
13000
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
13001
|
+
const raw = await httpRequest({
|
|
13002
|
+
method: "POST",
|
|
13003
|
+
path: `/v1/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposal/stop`,
|
|
13004
|
+
apiKey,
|
|
13005
|
+
apiBaseUrl
|
|
13006
|
+
});
|
|
13007
|
+
if (options.json) {
|
|
13008
|
+
printJson(raw);
|
|
13009
|
+
return;
|
|
13010
|
+
}
|
|
13011
|
+
console.log("Generation stopped.");
|
|
13012
|
+
}, "action"));
|
|
13013
|
+
}
|
|
13014
|
+
__name(registerClarityStopTransformationProposal, "registerClarityStopTransformationProposal");
|
|
13015
|
+
|
|
13016
|
+
// src/commands/clarity/index.ts
|
|
13017
|
+
function registerClarity(program) {
|
|
13018
|
+
const clarity = program.command("clarity").description("Manage Clarity v2 processes in the Duvo public API");
|
|
13019
|
+
registerClarityList(clarity);
|
|
13020
|
+
registerClarityGet(clarity);
|
|
13021
|
+
registerClarityGenerateCurrentProcess(clarity);
|
|
13022
|
+
registerClarityGetCurrentProcess(clarity);
|
|
13023
|
+
registerClarityPromoteCurrentProcess(clarity);
|
|
13024
|
+
registerClarityRevertCurrentProcess(clarity);
|
|
13025
|
+
registerClarityGenerateTransformationProposal(clarity);
|
|
13026
|
+
registerClarityGetTransformationProposal(clarity);
|
|
13027
|
+
registerClarityPromoteTransformationProposal(clarity);
|
|
13028
|
+
registerClarityRevertTransformationProposal(clarity);
|
|
13029
|
+
registerClarityStopTransformationProposal(clarity);
|
|
13030
|
+
registerClarityListExtraCaptureRequests(clarity);
|
|
13031
|
+
registerClarityAssignExtraCaptureRequest(clarity);
|
|
13032
|
+
registerClarityBuildAutomation(clarity);
|
|
13033
|
+
registerClarityPostprocess(clarity);
|
|
13034
|
+
}
|
|
13035
|
+
__name(registerClarity, "registerClarity");
|
|
13036
|
+
|
|
13037
|
+
// src/commands/connections/auth-methods.ts
|
|
13038
|
+
var AUTH_METHODS = createIntegrationRequestSchema.shape.auth_method.options;
|
|
13039
|
+
|
|
13040
|
+
// src/commands/connections/parse-header-pairs.ts
|
|
13041
|
+
function parseHeaderPairs(flag, pairs) {
|
|
13042
|
+
const out = {};
|
|
13043
|
+
for (const pair of pairs) {
|
|
13044
|
+
const eq = pair.indexOf("=");
|
|
13045
|
+
if (eq < 1) {
|
|
13046
|
+
throw new CliError(
|
|
13047
|
+
`${flag} must be KEY=VALUE (got "${pair}"); each occurrence sets one header.`
|
|
13048
|
+
);
|
|
13049
|
+
}
|
|
13050
|
+
const key = pair.slice(0, eq).trim();
|
|
13051
|
+
const value = pair.slice(eq + 1);
|
|
13052
|
+
if (key.length === 0) {
|
|
13053
|
+
throw new CliError(`${flag} key must not be empty (got "${pair}").`);
|
|
13054
|
+
}
|
|
13055
|
+
out[key] = value;
|
|
13056
|
+
}
|
|
13057
|
+
return out;
|
|
13058
|
+
}
|
|
13059
|
+
__name(parseHeaderPairs, "parseHeaderPairs");
|
|
13060
|
+
|
|
13061
|
+
// src/commands/connections/create.ts
|
|
13062
|
+
function registerConnectionsCreate(connections) {
|
|
13063
|
+
connections.command("create").description(
|
|
13064
|
+
"Create a user-provided connection (custom MCP server). OAuth-based integrations (Gmail, Slack, etc.) must be started via the dedicated `duvo oauth` commands."
|
|
13065
|
+
).requiredOption("--name <name>", "connection name").requiredOption(
|
|
13066
|
+
"--auth-method <method>",
|
|
13067
|
+
`authorization method (${AUTH_METHODS.join(", ")})`
|
|
13068
|
+
).option(
|
|
13069
|
+
"--server-url <url>",
|
|
13070
|
+
"MCP server URL (required unless --custom-integration-id resolves a server URL)"
|
|
13071
|
+
).option(
|
|
13072
|
+
"--type <type>",
|
|
13073
|
+
"integration type slug (defaults to custom_mcp on the backend)"
|
|
13074
|
+
).option(
|
|
13075
|
+
"--custom-integration-id <uuid>",
|
|
13076
|
+
"bind this connection to a team-defined custom integration"
|
|
13077
|
+
).option(
|
|
13078
|
+
"--header <KEY=VALUE>",
|
|
13079
|
+
"plaintext header (repeatable)",
|
|
13080
|
+
(value, previous) => [
|
|
13081
|
+
...previous ?? [],
|
|
13082
|
+
value
|
|
13083
|
+
]
|
|
13084
|
+
).option(
|
|
13085
|
+
"--secret-header <KEY=VALUE>",
|
|
13086
|
+
"secret header \u2014 encrypted at rest (repeatable)",
|
|
13087
|
+
(value, previous) => [
|
|
13088
|
+
...previous ?? [],
|
|
13089
|
+
value
|
|
13090
|
+
]
|
|
13091
|
+
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function createAction(options) {
|
|
13092
|
+
if (options.name === void 0 || options.name.trim().length === 0) {
|
|
13093
|
+
throw new CliError("--name must not be empty");
|
|
13094
|
+
}
|
|
13095
|
+
if (options.authMethod === void 0) {
|
|
13096
|
+
throw new CliError("--auth-method is required");
|
|
13097
|
+
}
|
|
13098
|
+
if (!AUTH_METHODS.includes(options.authMethod)) {
|
|
13099
|
+
throw new CliError(
|
|
13100
|
+
`--auth-method must be one of: ${AUTH_METHODS.join(", ")}`
|
|
13101
|
+
);
|
|
13102
|
+
}
|
|
13103
|
+
const body = {
|
|
13104
|
+
name: options.name.trim(),
|
|
13105
|
+
provider: "user",
|
|
12161
13106
|
auth_method: options.authMethod
|
|
12162
13107
|
};
|
|
12163
13108
|
if (options.type !== void 0) {
|
|
@@ -12345,7 +13290,7 @@ function registerConnectionsGet(connections) {
|
|
|
12345
13290
|
__name(registerConnectionsGet, "registerConnectionsGet");
|
|
12346
13291
|
|
|
12347
13292
|
// src/commands/connections/list.ts
|
|
12348
|
-
var
|
|
13293
|
+
var TABLE_COLUMNS14 = [
|
|
12349
13294
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
12350
13295
|
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
|
|
12351
13296
|
{ header: "TYPE", cell: /* @__PURE__ */ __name((row) => row.type, "cell") },
|
|
@@ -12381,26 +13326,26 @@ function registerConnectionsList(connections) {
|
|
|
12381
13326
|
console.log("No connections found.");
|
|
12382
13327
|
return;
|
|
12383
13328
|
}
|
|
12384
|
-
console.log(renderTable(
|
|
13329
|
+
console.log(renderTable(TABLE_COLUMNS14, rows));
|
|
12385
13330
|
console.log(`Showing ${rows.length}`);
|
|
12386
13331
|
}, "listAction"));
|
|
12387
13332
|
}
|
|
12388
13333
|
__name(registerConnectionsList, "registerConnectionsList");
|
|
12389
13334
|
|
|
12390
13335
|
// src/commands/connections/probe.ts
|
|
12391
|
-
import { z as
|
|
12392
|
-
var toolSchema =
|
|
12393
|
-
name:
|
|
12394
|
-
description:
|
|
12395
|
-
input_schema:
|
|
13336
|
+
import { z as z78 } from "zod";
|
|
13337
|
+
var toolSchema = z78.object({
|
|
13338
|
+
name: z78.string(),
|
|
13339
|
+
description: z78.string().optional(),
|
|
13340
|
+
input_schema: z78.record(z78.string(), z78.unknown()).optional()
|
|
12396
13341
|
});
|
|
12397
|
-
var probeResponseSchema =
|
|
12398
|
-
success:
|
|
12399
|
-
tools:
|
|
12400
|
-
error:
|
|
13342
|
+
var probeResponseSchema = z78.object({
|
|
13343
|
+
success: z78.boolean(),
|
|
13344
|
+
tools: z78.array(toolSchema).optional(),
|
|
13345
|
+
error: z78.string().optional()
|
|
12401
13346
|
});
|
|
12402
13347
|
var DESCRIPTION_MAX_WIDTH = 80;
|
|
12403
|
-
var
|
|
13348
|
+
var TABLE_COLUMNS15 = [
|
|
12404
13349
|
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
|
|
12405
13350
|
{
|
|
12406
13351
|
header: "DESCRIPTION",
|
|
@@ -12456,7 +13401,7 @@ function registerConnectionsProbe(connections) {
|
|
|
12456
13401
|
console.log("No tools found.");
|
|
12457
13402
|
return;
|
|
12458
13403
|
}
|
|
12459
|
-
console.log(renderTable(
|
|
13404
|
+
console.log(renderTable(TABLE_COLUMNS15, tools));
|
|
12460
13405
|
console.log(
|
|
12461
13406
|
`Showing ${tools.length} tool${tools.length === 1 ? "" : "s"}`
|
|
12462
13407
|
);
|
|
@@ -12612,48 +13557,48 @@ function registerConnections(program) {
|
|
|
12612
13557
|
__name(registerConnections, "registerConnections");
|
|
12613
13558
|
|
|
12614
13559
|
// src/api/credential-schemas.ts
|
|
12615
|
-
import { z as
|
|
12616
|
-
var dateLike =
|
|
12617
|
-
var secretSchema =
|
|
12618
|
-
id:
|
|
12619
|
-
team_id:
|
|
12620
|
-
user_id:
|
|
12621
|
-
name:
|
|
12622
|
-
service_slug:
|
|
12623
|
-
env_var_keys:
|
|
12624
|
-
created_by:
|
|
13560
|
+
import { z as z79 } from "zod";
|
|
13561
|
+
var dateLike = z79.string();
|
|
13562
|
+
var secretSchema = z79.object({
|
|
13563
|
+
id: z79.string(),
|
|
13564
|
+
team_id: z79.string(),
|
|
13565
|
+
user_id: z79.string().nullable(),
|
|
13566
|
+
name: z79.string(),
|
|
13567
|
+
service_slug: z79.string().nullable(),
|
|
13568
|
+
env_var_keys: z79.array(z79.string()),
|
|
13569
|
+
created_by: z79.string(),
|
|
12625
13570
|
created_at: dateLike,
|
|
12626
13571
|
updated_at: dateLike
|
|
12627
13572
|
});
|
|
12628
|
-
var secretsListResponseSchema =
|
|
13573
|
+
var secretsListResponseSchema = z79.array(secretSchema);
|
|
12629
13574
|
var secretResponseSchema = secretSchema;
|
|
12630
|
-
var browserLoginSchema =
|
|
12631
|
-
id:
|
|
12632
|
-
user_id:
|
|
12633
|
-
team_id:
|
|
12634
|
-
domain:
|
|
12635
|
-
username:
|
|
13575
|
+
var browserLoginSchema = z79.object({
|
|
13576
|
+
id: z79.string(),
|
|
13577
|
+
user_id: z79.string().nullable(),
|
|
13578
|
+
team_id: z79.string(),
|
|
13579
|
+
domain: z79.string(),
|
|
13580
|
+
username: z79.string().nullable(),
|
|
12636
13581
|
password: encryptedDataSchema.nullable(),
|
|
12637
13582
|
otp_secret: encryptedDataSchema.nullable(),
|
|
12638
13583
|
created_at: dateLike,
|
|
12639
13584
|
updated_at: dateLike
|
|
12640
13585
|
});
|
|
12641
|
-
var browserLoginsListResponseSchema =
|
|
12642
|
-
var revisionLoginSummarySchema =
|
|
12643
|
-
id:
|
|
12644
|
-
user_id:
|
|
12645
|
-
team_id:
|
|
12646
|
-
domain:
|
|
12647
|
-
username:
|
|
13586
|
+
var browserLoginsListResponseSchema = z79.array(credentialPreviewSchema);
|
|
13587
|
+
var revisionLoginSummarySchema = z79.object({
|
|
13588
|
+
id: z79.string(),
|
|
13589
|
+
user_id: z79.string().nullable(),
|
|
13590
|
+
team_id: z79.string().nullable(),
|
|
13591
|
+
domain: z79.string(),
|
|
13592
|
+
username: z79.string().nullable(),
|
|
12648
13593
|
created_at: dateLike,
|
|
12649
13594
|
updated_at: dateLike
|
|
12650
13595
|
});
|
|
12651
|
-
var revisionLoginsListResponseSchema =
|
|
13596
|
+
var revisionLoginsListResponseSchema = z79.array(
|
|
12652
13597
|
revisionLoginSummarySchema
|
|
12653
13598
|
);
|
|
12654
|
-
var revisionSecretsListResponseSchema =
|
|
12655
|
-
var successResponseSchema2 =
|
|
12656
|
-
success:
|
|
13599
|
+
var revisionSecretsListResponseSchema = z79.array(secretSchema);
|
|
13600
|
+
var successResponseSchema2 = z79.object({
|
|
13601
|
+
success: z79.boolean()
|
|
12657
13602
|
});
|
|
12658
13603
|
var attachSuccessResponseSchema = successResponseSchema2;
|
|
12659
13604
|
var deleteSecretResponseSchema = successResponseSchema2;
|
|
@@ -12841,7 +13786,7 @@ function registerCredentialsGet(credentials) {
|
|
|
12841
13786
|
__name(registerCredentialsGet, "registerCredentialsGet");
|
|
12842
13787
|
|
|
12843
13788
|
// src/commands/credentials/list.ts
|
|
12844
|
-
var
|
|
13789
|
+
var TABLE_COLUMNS16 = [
|
|
12845
13790
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
12846
13791
|
{ header: "DOMAIN", cell: /* @__PURE__ */ __name((row) => row.domain, "cell") },
|
|
12847
13792
|
{
|
|
@@ -12896,7 +13841,7 @@ function registerCredentialsList(credentials) {
|
|
|
12896
13841
|
console.log("No credentials found.");
|
|
12897
13842
|
return;
|
|
12898
13843
|
}
|
|
12899
|
-
console.log(renderTable(
|
|
13844
|
+
console.log(renderTable(TABLE_COLUMNS16, rows));
|
|
12900
13845
|
console.log(`Showing ${rows.length}`);
|
|
12901
13846
|
}, "listAction"));
|
|
12902
13847
|
}
|
|
@@ -13156,7 +14101,7 @@ function registerFilesDownloadUrl(files) {
|
|
|
13156
14101
|
__name(registerFilesDownloadUrl, "registerFilesDownloadUrl");
|
|
13157
14102
|
|
|
13158
14103
|
// src/commands/files/list.ts
|
|
13159
|
-
var
|
|
14104
|
+
var TABLE_COLUMNS17 = [
|
|
13160
14105
|
{ header: "PATH", cell: /* @__PURE__ */ __name((row) => row.path, "cell") },
|
|
13161
14106
|
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
|
|
13162
14107
|
{
|
|
@@ -13195,7 +14140,7 @@ function registerFilesList(files) {
|
|
|
13195
14140
|
console.log("No files found.");
|
|
13196
14141
|
return;
|
|
13197
14142
|
}
|
|
13198
|
-
console.log(renderTable(
|
|
14143
|
+
console.log(renderTable(TABLE_COLUMNS17, parsed.data.files));
|
|
13199
14144
|
console.log(`Showing ${parsed.data.files.length}`);
|
|
13200
14145
|
}, "listAction"));
|
|
13201
14146
|
}
|
|
@@ -13445,7 +14390,7 @@ function registerIntegrationsCustom(integrations) {
|
|
|
13445
14390
|
__name(registerIntegrationsCustom, "registerIntegrationsCustom");
|
|
13446
14391
|
|
|
13447
14392
|
// src/commands/integrations/list.ts
|
|
13448
|
-
var
|
|
14393
|
+
var TABLE_COLUMNS18 = [
|
|
13449
14394
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
13450
14395
|
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
|
|
13451
14396
|
{ header: "TYPE", cell: /* @__PURE__ */ __name((row) => row.type, "cell") },
|
|
@@ -13479,7 +14424,7 @@ function registerIntegrationsList(integrations) {
|
|
|
13479
14424
|
console.log("No integrations found.");
|
|
13480
14425
|
return;
|
|
13481
14426
|
}
|
|
13482
|
-
console.log(renderTable(
|
|
14427
|
+
console.log(renderTable(TABLE_COLUMNS18, rows));
|
|
13483
14428
|
console.log(`Showing ${rows.length}`);
|
|
13484
14429
|
}, "listAction"));
|
|
13485
14430
|
}
|
|
@@ -14306,7 +15251,7 @@ function parseHeaders(raw) {
|
|
|
14306
15251
|
return result;
|
|
14307
15252
|
}
|
|
14308
15253
|
__name(parseHeaders, "parseHeaders");
|
|
14309
|
-
var
|
|
15254
|
+
var TABLE_COLUMNS19 = [
|
|
14310
15255
|
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
|
|
14311
15256
|
{ header: "DESCRIPTION", cell: /* @__PURE__ */ __name((row) => row.description, "cell") }
|
|
14312
15257
|
];
|
|
@@ -14360,7 +15305,7 @@ function registerOauthMcpProbe(mcp) {
|
|
|
14360
15305
|
console.log("No tools advertised by this MCP server.");
|
|
14361
15306
|
return;
|
|
14362
15307
|
}
|
|
14363
|
-
console.log(renderTable(
|
|
15308
|
+
console.log(renderTable(TABLE_COLUMNS19, rows));
|
|
14364
15309
|
console.log(`Showing ${rows.length}`);
|
|
14365
15310
|
}, "probeMcpAction"));
|
|
14366
15311
|
}
|
|
@@ -14435,7 +15380,7 @@ function registerOauth(program) {
|
|
|
14435
15380
|
__name(registerOauth, "registerOauth");
|
|
14436
15381
|
|
|
14437
15382
|
// src/commands/plugins/list.ts
|
|
14438
|
-
var
|
|
15383
|
+
var TABLE_COLUMNS20 = [
|
|
14439
15384
|
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
|
|
14440
15385
|
{ header: "TYPE", cell: /* @__PURE__ */ __name((row) => row.type, "cell") },
|
|
14441
15386
|
{
|
|
@@ -14469,7 +15414,7 @@ function registerPluginsList(plugins) {
|
|
|
14469
15414
|
console.log("No plugins found.");
|
|
14470
15415
|
return;
|
|
14471
15416
|
}
|
|
14472
|
-
console.log(renderTable(
|
|
15417
|
+
console.log(renderTable(TABLE_COLUMNS20, parsed.data.plugins));
|
|
14473
15418
|
console.log(`Showing ${parsed.data.plugins.length}`);
|
|
14474
15419
|
}, "listAction"));
|
|
14475
15420
|
}
|
|
@@ -14667,7 +15612,7 @@ function registerProfiles(program) {
|
|
|
14667
15612
|
__name(registerProfiles, "registerProfiles");
|
|
14668
15613
|
|
|
14669
15614
|
// src/commands/queue-labels/index.ts
|
|
14670
|
-
var
|
|
15615
|
+
var TABLE_COLUMNS21 = [
|
|
14671
15616
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
14672
15617
|
{ header: "KEY", cell: /* @__PURE__ */ __name((row) => row.key, "cell") },
|
|
14673
15618
|
{ header: "VALUE", cell: /* @__PURE__ */ __name((row) => row.value, "cell") },
|
|
@@ -14721,7 +15666,7 @@ function registerList2(labels) {
|
|
|
14721
15666
|
console.log("No labels defined on this queue.");
|
|
14722
15667
|
return;
|
|
14723
15668
|
}
|
|
14724
|
-
console.log(renderTable(
|
|
15669
|
+
console.log(renderTable(TABLE_COLUMNS21, parsed.data.labels));
|
|
14725
15670
|
console.log(`Showing ${parsed.data.labels.length}`);
|
|
14726
15671
|
}, "listAction"));
|
|
14727
15672
|
}
|
|
@@ -15079,10 +16024,10 @@ function registerQueuesGet(queues) {
|
|
|
15079
16024
|
__name(registerQueuesGet, "registerQueuesGet");
|
|
15080
16025
|
|
|
15081
16026
|
// src/commands/queues/list.ts
|
|
15082
|
-
var
|
|
15083
|
-
var
|
|
15084
|
-
var
|
|
15085
|
-
var
|
|
16027
|
+
var DEFAULT_LIMIT7 = 20;
|
|
16028
|
+
var MIN_LIMIT7 = 1;
|
|
16029
|
+
var MAX_LIMIT7 = 100;
|
|
16030
|
+
var TABLE_COLUMNS22 = [
|
|
15086
16031
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
15087
16032
|
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
|
|
15088
16033
|
{
|
|
@@ -15093,11 +16038,11 @@ var TABLE_COLUMNS20 = [
|
|
|
15093
16038
|
{ header: "CREATED", cell: /* @__PURE__ */ __name((row) => row.created_at ?? "", "cell") }
|
|
15094
16039
|
];
|
|
15095
16040
|
function registerQueuesList(queues) {
|
|
15096
|
-
queues.command("list", { isDefault: true }).description("List case queues for your team").option("--limit <n>", `page size (${
|
|
16041
|
+
queues.command("list", { isDefault: true }).description("List case queues for your team").option("--limit <n>", `page size (${MIN_LIMIT7}-${MAX_LIMIT7})`).option("--offset <n>", "number of queues to skip").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function listAction(options) {
|
|
15097
16042
|
const limit = parseLimit(options.limit, {
|
|
15098
|
-
defaultValue:
|
|
15099
|
-
min:
|
|
15100
|
-
max:
|
|
16043
|
+
defaultValue: DEFAULT_LIMIT7,
|
|
16044
|
+
min: MIN_LIMIT7,
|
|
16045
|
+
max: MAX_LIMIT7
|
|
15101
16046
|
});
|
|
15102
16047
|
const offset = parseOffset(options.offset);
|
|
15103
16048
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
@@ -15126,7 +16071,7 @@ function registerQueuesList(queues) {
|
|
|
15126
16071
|
console.log("No queues found.");
|
|
15127
16072
|
return;
|
|
15128
16073
|
}
|
|
15129
|
-
console.log(renderTable(
|
|
16074
|
+
console.log(renderTable(TABLE_COLUMNS22, response.queues));
|
|
15130
16075
|
const resolvedOffset = response.offset ?? offset;
|
|
15131
16076
|
const total = response.total ?? null;
|
|
15132
16077
|
const summary = total === null ? `Showing ${response.queues.length} \xB7 offset ${resolvedOffset}` : `Showing ${response.queues.length} of ${total} \xB7 offset ${resolvedOffset}`;
|
|
@@ -15288,7 +16233,7 @@ function registerRevisionLoginsDetach(revisionLogins) {
|
|
|
15288
16233
|
__name(registerRevisionLoginsDetach, "registerRevisionLoginsDetach");
|
|
15289
16234
|
|
|
15290
16235
|
// src/commands/revision-logins/list.ts
|
|
15291
|
-
var
|
|
16236
|
+
var TABLE_COLUMNS23 = [
|
|
15292
16237
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
15293
16238
|
{ header: "DOMAIN", cell: /* @__PURE__ */ __name((row) => row.domain, "cell") },
|
|
15294
16239
|
{
|
|
@@ -15324,7 +16269,7 @@ function registerRevisionLoginsList(revisionLogins) {
|
|
|
15324
16269
|
console.log("No browser logins attached to this revision.");
|
|
15325
16270
|
return;
|
|
15326
16271
|
}
|
|
15327
|
-
console.log(renderTable(
|
|
16272
|
+
console.log(renderTable(TABLE_COLUMNS23, rows));
|
|
15328
16273
|
console.log(`Showing ${rows.length}`);
|
|
15329
16274
|
}, "listAction"));
|
|
15330
16275
|
}
|
|
@@ -15397,7 +16342,7 @@ function registerRevisionSecretsDetach(revisionSecrets) {
|
|
|
15397
16342
|
__name(registerRevisionSecretsDetach, "registerRevisionSecretsDetach");
|
|
15398
16343
|
|
|
15399
16344
|
// src/commands/revision-secrets/list.ts
|
|
15400
|
-
var
|
|
16345
|
+
var TABLE_COLUMNS24 = [
|
|
15401
16346
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
15402
16347
|
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
|
|
15403
16348
|
{
|
|
@@ -15435,7 +16380,7 @@ function registerRevisionSecretsList(revisionSecrets) {
|
|
|
15435
16380
|
console.log("No secrets attached to this revision.");
|
|
15436
16381
|
return;
|
|
15437
16382
|
}
|
|
15438
|
-
console.log(renderTable(
|
|
16383
|
+
console.log(renderTable(TABLE_COLUMNS24, rows));
|
|
15439
16384
|
console.log(`Showing ${rows.length}`);
|
|
15440
16385
|
}, "listAction"));
|
|
15441
16386
|
}
|
|
@@ -15451,91 +16396,91 @@ function registerRevisionSecrets(program) {
|
|
|
15451
16396
|
__name(registerRevisionSecrets, "registerRevisionSecrets");
|
|
15452
16397
|
|
|
15453
16398
|
// src/api/run-schemas.ts
|
|
15454
|
-
import { z as
|
|
15455
|
-
var publicRunSchema =
|
|
15456
|
-
id:
|
|
15457
|
-
agent_id:
|
|
15458
|
-
build_id:
|
|
15459
|
-
status:
|
|
15460
|
-
source:
|
|
15461
|
-
sandbox_id:
|
|
15462
|
-
started_at:
|
|
15463
|
-
completed_at:
|
|
15464
|
-
created_at:
|
|
15465
|
-
updated_at:
|
|
15466
|
-
human_in_the_loop_enabled:
|
|
15467
|
-
});
|
|
15468
|
-
var startRunResponseSchema =
|
|
16399
|
+
import { z as z80 } from "zod";
|
|
16400
|
+
var publicRunSchema = z80.object({
|
|
16401
|
+
id: z80.string(),
|
|
16402
|
+
agent_id: z80.string(),
|
|
16403
|
+
build_id: z80.string(),
|
|
16404
|
+
status: z80.string(),
|
|
16405
|
+
source: z80.string().nullish(),
|
|
16406
|
+
sandbox_id: z80.string().nullish(),
|
|
16407
|
+
started_at: z80.string().nullish(),
|
|
16408
|
+
completed_at: z80.string().nullish(),
|
|
16409
|
+
created_at: z80.string(),
|
|
16410
|
+
updated_at: z80.string().nullish(),
|
|
16411
|
+
human_in_the_loop_enabled: z80.boolean().nullish()
|
|
16412
|
+
});
|
|
16413
|
+
var startRunResponseSchema = z80.object({
|
|
15469
16414
|
run: publicRunSchema
|
|
15470
16415
|
});
|
|
15471
|
-
var questionOptionSchema =
|
|
15472
|
-
label:
|
|
15473
|
-
description:
|
|
15474
|
-
});
|
|
15475
|
-
var questionSchema =
|
|
15476
|
-
question:
|
|
15477
|
-
header:
|
|
15478
|
-
options:
|
|
15479
|
-
multi_select:
|
|
15480
|
-
});
|
|
15481
|
-
var pendingHumanRequestSchema =
|
|
15482
|
-
id:
|
|
15483
|
-
title:
|
|
15484
|
-
description:
|
|
15485
|
-
created_at:
|
|
15486
|
-
type:
|
|
15487
|
-
questions:
|
|
15488
|
-
});
|
|
15489
|
-
var getRunResponseSchema =
|
|
16416
|
+
var questionOptionSchema = z80.object({
|
|
16417
|
+
label: z80.string(),
|
|
16418
|
+
description: z80.string().nullish()
|
|
16419
|
+
});
|
|
16420
|
+
var questionSchema = z80.object({
|
|
16421
|
+
question: z80.string(),
|
|
16422
|
+
header: z80.string().nullish(),
|
|
16423
|
+
options: z80.array(questionOptionSchema).nullish(),
|
|
16424
|
+
multi_select: z80.boolean().nullish()
|
|
16425
|
+
});
|
|
16426
|
+
var pendingHumanRequestSchema = z80.object({
|
|
16427
|
+
id: z80.string(),
|
|
16428
|
+
title: z80.string(),
|
|
16429
|
+
description: z80.string().nullish(),
|
|
16430
|
+
created_at: z80.string(),
|
|
16431
|
+
type: z80.string(),
|
|
16432
|
+
questions: z80.array(questionSchema).nullish()
|
|
16433
|
+
});
|
|
16434
|
+
var getRunResponseSchema = z80.object({
|
|
15490
16435
|
run: publicRunSchema.nullable(),
|
|
15491
16436
|
pending_human_request: pendingHumanRequestSchema.nullish()
|
|
15492
16437
|
});
|
|
15493
|
-
var stopRunResponseSchema =
|
|
15494
|
-
success:
|
|
15495
|
-
message:
|
|
15496
|
-
});
|
|
15497
|
-
var runMessageSchema =
|
|
15498
|
-
id:
|
|
15499
|
-
type:
|
|
15500
|
-
role:
|
|
15501
|
-
timestamp:
|
|
15502
|
-
text_content:
|
|
15503
|
-
tool_call:
|
|
15504
|
-
id:
|
|
15505
|
-
name:
|
|
15506
|
-
arguments:
|
|
16438
|
+
var stopRunResponseSchema = z80.object({
|
|
16439
|
+
success: z80.boolean(),
|
|
16440
|
+
message: z80.string().nullish()
|
|
16441
|
+
});
|
|
16442
|
+
var runMessageSchema = z80.object({
|
|
16443
|
+
id: z80.string(),
|
|
16444
|
+
type: z80.string(),
|
|
16445
|
+
role: z80.string(),
|
|
16446
|
+
timestamp: z80.string(),
|
|
16447
|
+
text_content: z80.string().nullish(),
|
|
16448
|
+
tool_call: z80.object({
|
|
16449
|
+
id: z80.string(),
|
|
16450
|
+
name: z80.string(),
|
|
16451
|
+
arguments: z80.record(z80.string(), z80.unknown()).nullish()
|
|
15507
16452
|
}).nullish(),
|
|
15508
|
-
tool_result:
|
|
15509
|
-
tool_call_id:
|
|
15510
|
-
result:
|
|
15511
|
-
error:
|
|
16453
|
+
tool_result: z80.object({
|
|
16454
|
+
tool_call_id: z80.string(),
|
|
16455
|
+
result: z80.unknown().nullish(),
|
|
16456
|
+
error: z80.string().nullish()
|
|
15512
16457
|
}).nullish()
|
|
15513
16458
|
});
|
|
15514
|
-
var listRunMessagesResponseSchema =
|
|
15515
|
-
messages:
|
|
15516
|
-
total:
|
|
15517
|
-
limit:
|
|
15518
|
-
offset:
|
|
16459
|
+
var listRunMessagesResponseSchema = z80.object({
|
|
16460
|
+
messages: z80.array(runMessageSchema),
|
|
16461
|
+
total: z80.number().nullish(),
|
|
16462
|
+
limit: z80.number().nullish(),
|
|
16463
|
+
offset: z80.number().nullish()
|
|
15519
16464
|
});
|
|
15520
|
-
var postedMessageSchema =
|
|
15521
|
-
id:
|
|
15522
|
-
type:
|
|
15523
|
-
role:
|
|
15524
|
-
timestamp:
|
|
15525
|
-
text_content:
|
|
16465
|
+
var postedMessageSchema = z80.object({
|
|
16466
|
+
id: z80.string(),
|
|
16467
|
+
type: z80.string(),
|
|
16468
|
+
role: z80.string(),
|
|
16469
|
+
timestamp: z80.string(),
|
|
16470
|
+
text_content: z80.string()
|
|
15526
16471
|
});
|
|
15527
|
-
var postRunMessageResponseSchema =
|
|
16472
|
+
var postRunMessageResponseSchema = z80.object({
|
|
15528
16473
|
message: postedMessageSchema
|
|
15529
16474
|
});
|
|
15530
|
-
var respondHumanRequestResponseSchema =
|
|
15531
|
-
human_request:
|
|
15532
|
-
id:
|
|
15533
|
-
run_id:
|
|
15534
|
-
title:
|
|
15535
|
-
description:
|
|
15536
|
-
response:
|
|
15537
|
-
responded_at:
|
|
15538
|
-
created_at:
|
|
16475
|
+
var respondHumanRequestResponseSchema = z80.object({
|
|
16476
|
+
human_request: z80.object({
|
|
16477
|
+
id: z80.string(),
|
|
16478
|
+
run_id: z80.string(),
|
|
16479
|
+
title: z80.string(),
|
|
16480
|
+
description: z80.string().nullish(),
|
|
16481
|
+
response: z80.string().nullish(),
|
|
16482
|
+
responded_at: z80.string().nullish(),
|
|
16483
|
+
created_at: z80.string()
|
|
15539
16484
|
})
|
|
15540
16485
|
});
|
|
15541
16486
|
|
|
@@ -15598,13 +16543,13 @@ function registerRunsGet(runs) {
|
|
|
15598
16543
|
__name(registerRunsGet, "registerRunsGet");
|
|
15599
16544
|
|
|
15600
16545
|
// src/commands/runs/list.ts
|
|
15601
|
-
var
|
|
15602
|
-
var
|
|
15603
|
-
var
|
|
16546
|
+
var DEFAULT_LIMIT8 = 20;
|
|
16547
|
+
var MIN_LIMIT8 = 1;
|
|
16548
|
+
var MAX_LIMIT8 = 100;
|
|
15604
16549
|
var SORT_ORDERS2 = ["asc", "desc"];
|
|
15605
16550
|
var HAS_ISSUES_VALUES = ["true", "false"];
|
|
15606
16551
|
var TITLE_PREVIEW_WIDTH = 50;
|
|
15607
|
-
var
|
|
16552
|
+
var TABLE_COLUMNS25 = [
|
|
15608
16553
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
15609
16554
|
{ header: "RUN#", cell: /* @__PURE__ */ __name((row) => String(row.run_number), "cell") },
|
|
15610
16555
|
{ header: "STATUS", cell: /* @__PURE__ */ __name((row) => row.status, "cell") },
|
|
@@ -15628,7 +16573,7 @@ function isHasIssuesValue(value) {
|
|
|
15628
16573
|
}
|
|
15629
16574
|
__name(isHasIssuesValue, "isHasIssuesValue");
|
|
15630
16575
|
function registerRunsList(runs) {
|
|
15631
|
-
runs.command("list").description("List agent runs for your team").option("--limit <n>", `page size (${
|
|
16576
|
+
runs.command("list").description("List agent runs for your team").option("--limit <n>", `page size (${MIN_LIMIT8}-${MAX_LIMIT8})`).option("--offset <n>", "number of runs to skip").option("--sort-order <order>", `sort direction (${SORT_ORDERS2.join("|")})`).option(
|
|
15632
16577
|
"--status <status>",
|
|
15633
16578
|
"filter by status (e.g. running, completed, failed, waiting, interrupted, stopped, needs_attention)"
|
|
15634
16579
|
).option("--agent <id>", "filter by agent ID").option("--user <id>", "filter by user ID").option("--case-queue <id>", "filter by case queue ID").option("--source <source>", "filter by source").option("--search <query>", "free-text search across runs").option(
|
|
@@ -15636,9 +16581,9 @@ function registerRunsList(runs) {
|
|
|
15636
16581
|
`show only runs with (or without) issues (${HAS_ISSUES_VALUES.join("|")})`
|
|
15637
16582
|
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function listAction(options) {
|
|
15638
16583
|
const limit = parseLimit(options.limit, {
|
|
15639
|
-
defaultValue:
|
|
15640
|
-
min:
|
|
15641
|
-
max:
|
|
16584
|
+
defaultValue: DEFAULT_LIMIT8,
|
|
16585
|
+
min: MIN_LIMIT8,
|
|
16586
|
+
max: MAX_LIMIT8
|
|
15642
16587
|
});
|
|
15643
16588
|
const offset = parseOffset(options.offset);
|
|
15644
16589
|
if (options.sortOrder !== void 0 && !isSortOrder(options.sortOrder)) {
|
|
@@ -15701,7 +16646,7 @@ function registerRunsList(runs) {
|
|
|
15701
16646
|
console.log("No runs found.");
|
|
15702
16647
|
return;
|
|
15703
16648
|
}
|
|
15704
|
-
console.log(renderTable(
|
|
16649
|
+
console.log(renderTable(TABLE_COLUMNS25, response.data));
|
|
15705
16650
|
console.log(
|
|
15706
16651
|
`Showing ${response.data.length} of ${response.total} \xB7 offset ${offset}`
|
|
15707
16652
|
);
|
|
@@ -15709,12 +16654,109 @@ function registerRunsList(runs) {
|
|
|
15709
16654
|
}
|
|
15710
16655
|
__name(registerRunsList, "registerRunsList");
|
|
15711
16656
|
|
|
16657
|
+
// src/commands/runs/follow.ts
|
|
16658
|
+
var TERMINAL_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "stopped", "error"]);
|
|
16659
|
+
var DEFAULT_POLL_INTERVAL_MS = 2e3;
|
|
16660
|
+
var FOLLOW_PAGE_SIZE = 50;
|
|
16661
|
+
function resolvePollIntervalMs() {
|
|
16662
|
+
const envValue = process.env.FOLLOW_POLL_INTERVAL_MS;
|
|
16663
|
+
if (envValue !== void 0) {
|
|
16664
|
+
const parsed = Number(envValue);
|
|
16665
|
+
if (!Number.isFinite(parsed) || parsed < 0) {
|
|
16666
|
+
throw new CliError(
|
|
16667
|
+
"FOLLOW_POLL_INTERVAL_MS must be a non-negative number"
|
|
16668
|
+
);
|
|
16669
|
+
}
|
|
16670
|
+
return parsed;
|
|
16671
|
+
}
|
|
16672
|
+
return DEFAULT_POLL_INTERVAL_MS;
|
|
16673
|
+
}
|
|
16674
|
+
__name(resolvePollIntervalMs, "resolvePollIntervalMs");
|
|
16675
|
+
async function followRunMessages(runId, apiKey, apiBaseUrl, options = {}) {
|
|
16676
|
+
const { startOffset = 0, json = false } = options;
|
|
16677
|
+
const pollIntervalMs = resolvePollIntervalMs();
|
|
16678
|
+
let seenCount = startOffset;
|
|
16679
|
+
while (true) {
|
|
16680
|
+
let batchSize = 1;
|
|
16681
|
+
while (batchSize > 0) {
|
|
16682
|
+
const searchParams = new URLSearchParams();
|
|
16683
|
+
searchParams.append("limit", String(FOLLOW_PAGE_SIZE));
|
|
16684
|
+
searchParams.append("offset", String(seenCount));
|
|
16685
|
+
const raw = await httpRequest({
|
|
16686
|
+
method: "GET",
|
|
16687
|
+
path: `/v1/runs/${encodeURIComponent(runId)}/messages`,
|
|
16688
|
+
apiKey,
|
|
16689
|
+
apiBaseUrl,
|
|
16690
|
+
searchParams
|
|
16691
|
+
});
|
|
16692
|
+
const parsed = listRunMessagesResponseSchema.safeParse(raw);
|
|
16693
|
+
if (!parsed.success) {
|
|
16694
|
+
throw new CliError(
|
|
16695
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
16696
|
+
);
|
|
16697
|
+
}
|
|
16698
|
+
const { messages } = parsed.data;
|
|
16699
|
+
batchSize = messages.length;
|
|
16700
|
+
for (const msg of messages) {
|
|
16701
|
+
if (json) {
|
|
16702
|
+
console.log(JSON.stringify(msg));
|
|
16703
|
+
} else {
|
|
16704
|
+
console.log(formatMessage(msg));
|
|
16705
|
+
}
|
|
16706
|
+
}
|
|
16707
|
+
seenCount += batchSize;
|
|
16708
|
+
}
|
|
16709
|
+
const runRaw = await httpRequest({
|
|
16710
|
+
method: "GET",
|
|
16711
|
+
path: `/v1/runs/${encodeURIComponent(runId)}`,
|
|
16712
|
+
apiKey,
|
|
16713
|
+
apiBaseUrl
|
|
16714
|
+
});
|
|
16715
|
+
const runParsed = getRunResponseSchema.safeParse(runRaw);
|
|
16716
|
+
if (!runParsed.success) {
|
|
16717
|
+
throw new CliError(
|
|
16718
|
+
`Unexpected response from the API: ${runParsed.error.message}`
|
|
16719
|
+
);
|
|
16720
|
+
}
|
|
16721
|
+
const { run } = runParsed.data;
|
|
16722
|
+
if (!run || TERMINAL_STATUSES.has(run.status)) {
|
|
16723
|
+
if (!json) {
|
|
16724
|
+
const status = run?.status ?? "ended";
|
|
16725
|
+
console.log(`
|
|
16726
|
+
Job ${status}.`);
|
|
16727
|
+
}
|
|
16728
|
+
break;
|
|
16729
|
+
}
|
|
16730
|
+
await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
|
|
16731
|
+
}
|
|
16732
|
+
}
|
|
16733
|
+
__name(followRunMessages, "followRunMessages");
|
|
16734
|
+
var ROLE_COLUMN_WIDTH = 9;
|
|
16735
|
+
function formatMessage(msg) {
|
|
16736
|
+
const role = msg.role.padEnd(ROLE_COLUMN_WIDTH);
|
|
16737
|
+
return `${msg.timestamp} ${role} ${getContent(msg)}`;
|
|
16738
|
+
}
|
|
16739
|
+
__name(formatMessage, "formatMessage");
|
|
16740
|
+
function getContent(msg) {
|
|
16741
|
+
if (msg.text_content) {
|
|
16742
|
+
return msg.text_content.replace(/\s+/g, " ").trim();
|
|
16743
|
+
}
|
|
16744
|
+
if (msg.tool_call) {
|
|
16745
|
+
return `tool_call ${msg.tool_call.name}`;
|
|
16746
|
+
}
|
|
16747
|
+
if (msg.tool_result) {
|
|
16748
|
+
return `tool_result ${msg.tool_result.tool_call_id}`;
|
|
16749
|
+
}
|
|
16750
|
+
return "";
|
|
16751
|
+
}
|
|
16752
|
+
__name(getContent, "getContent");
|
|
16753
|
+
|
|
15712
16754
|
// src/commands/runs/messages.ts
|
|
15713
|
-
var
|
|
15714
|
-
var
|
|
15715
|
-
var
|
|
16755
|
+
var DEFAULT_LIMIT9 = 20;
|
|
16756
|
+
var MIN_LIMIT9 = 1;
|
|
16757
|
+
var MAX_LIMIT9 = 50;
|
|
15716
16758
|
var TEXT_PREVIEW_WIDTH2 = 60;
|
|
15717
|
-
var
|
|
16759
|
+
var TABLE_COLUMNS26 = [
|
|
15718
16760
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
15719
16761
|
{ header: "ROLE", cell: /* @__PURE__ */ __name((row) => row.role, "cell") },
|
|
15720
16762
|
{ header: "TYPE", cell: /* @__PURE__ */ __name((row) => row.type, "cell") },
|
|
@@ -15739,14 +16781,21 @@ function previewCell(row) {
|
|
|
15739
16781
|
}
|
|
15740
16782
|
__name(previewCell, "previewCell");
|
|
15741
16783
|
function registerRunsMessages(runs) {
|
|
15742
|
-
runs.command("messages <id>").description("List messages for an agent run").option("--limit <n>", `page size (${
|
|
15743
|
-
const limit = parseLimit(options.limit, {
|
|
15744
|
-
defaultValue: DEFAULT_LIMIT7,
|
|
15745
|
-
min: MIN_LIMIT7,
|
|
15746
|
-
max: MAX_LIMIT7
|
|
15747
|
-
});
|
|
16784
|
+
runs.command("messages <id>").description("List messages for an agent run").option("--limit <n>", `page size (${MIN_LIMIT9}-${MAX_LIMIT9})`).option("--offset <n>", "number of messages to skip").option("--follow", "poll for new messages until the job completes").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function messagesAction(id, options) {
|
|
15748
16785
|
const offset = parseOffset(options.offset);
|
|
15749
16786
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
16787
|
+
if (options.follow) {
|
|
16788
|
+
await followRunMessages(id, apiKey, apiBaseUrl, {
|
|
16789
|
+
startOffset: offset,
|
|
16790
|
+
json: options.json
|
|
16791
|
+
});
|
|
16792
|
+
return;
|
|
16793
|
+
}
|
|
16794
|
+
const limit = parseLimit(options.limit, {
|
|
16795
|
+
defaultValue: DEFAULT_LIMIT9,
|
|
16796
|
+
min: MIN_LIMIT9,
|
|
16797
|
+
max: MAX_LIMIT9
|
|
16798
|
+
});
|
|
15750
16799
|
const searchParams = new URLSearchParams();
|
|
15751
16800
|
searchParams.append("limit", String(limit));
|
|
15752
16801
|
searchParams.append("offset", String(offset));
|
|
@@ -15772,7 +16821,7 @@ function registerRunsMessages(runs) {
|
|
|
15772
16821
|
console.log("No messages found.");
|
|
15773
16822
|
return;
|
|
15774
16823
|
}
|
|
15775
|
-
console.log(renderTable(
|
|
16824
|
+
console.log(renderTable(TABLE_COLUMNS26, response.messages));
|
|
15776
16825
|
const resolvedOffset = response.offset ?? offset;
|
|
15777
16826
|
const summary = response.total === null || response.total === void 0 ? `Showing ${response.messages.length} \xB7 offset ${resolvedOffset}` : `Showing ${response.messages.length} of ${response.total} \xB7 offset ${resolvedOffset}`;
|
|
15778
16827
|
console.log(summary);
|
|
@@ -15806,7 +16855,7 @@ function parseAnswers(raw) {
|
|
|
15806
16855
|
return answers;
|
|
15807
16856
|
}
|
|
15808
16857
|
__name(parseAnswers, "parseAnswers");
|
|
15809
|
-
function
|
|
16858
|
+
function buildBody5(options) {
|
|
15810
16859
|
const approveSet = options.approve === true;
|
|
15811
16860
|
const denySet = options.deny === true;
|
|
15812
16861
|
const answers = options.answer ?? [];
|
|
@@ -15831,7 +16880,7 @@ function buildBody4(options) {
|
|
|
15831
16880
|
"Provide --approve, --deny, or at least one --answer question=answer."
|
|
15832
16881
|
);
|
|
15833
16882
|
}
|
|
15834
|
-
__name(
|
|
16883
|
+
__name(buildBody5, "buildBody");
|
|
15835
16884
|
async function resolvePendingRequestId(runId, apiKey, apiBaseUrl) {
|
|
15836
16885
|
const raw = await httpRequest({
|
|
15837
16886
|
method: "GET",
|
|
@@ -15863,7 +16912,7 @@ function registerRunsRespond(runs) {
|
|
|
15863
16912
|
collectAnswer,
|
|
15864
16913
|
[]
|
|
15865
16914
|
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function respondAction(runId, requestIdArg, options) {
|
|
15866
|
-
const body =
|
|
16915
|
+
const body = buildBody5(options);
|
|
15867
16916
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
15868
16917
|
const requestId = requestIdArg ?? await resolvePendingRequestId(runId, apiKey, apiBaseUrl);
|
|
15869
16918
|
const raw = await httpRequest({
|
|
@@ -15941,7 +16990,7 @@ function registerRunsStart(runs) {
|
|
|
15941
16990
|
runs.command("start").description("Start a new agent run").requiredOption("--agent <id>", "ID of the agent to run").option(
|
|
15942
16991
|
"--message <text>",
|
|
15943
16992
|
"optional initial message to start the run with"
|
|
15944
|
-
).option("--sandbox-id <id>", "optional sandbox ID with pre-uploaded files").option("--webhook-url <url>", "optional webhook URL to POST run events to").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function startAction(options) {
|
|
16993
|
+
).option("--sandbox-id <id>", "optional sandbox ID with pre-uploaded files").option("--webhook-url <url>", "optional webhook URL to POST run events to").option("--follow", "stream messages after starting the job").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function startAction(options) {
|
|
15945
16994
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
15946
16995
|
const body = {
|
|
15947
16996
|
agent_id: options.agent,
|
|
@@ -15977,6 +17026,12 @@ function registerRunsStart(runs) {
|
|
|
15977
17026
|
{ label: "Created", value: run.created_at }
|
|
15978
17027
|
])
|
|
15979
17028
|
);
|
|
17029
|
+
if (options.follow) {
|
|
17030
|
+
console.log("");
|
|
17031
|
+
await followRunMessages(run.id, apiKey, apiBaseUrl, {
|
|
17032
|
+
json: options.json
|
|
17033
|
+
});
|
|
17034
|
+
}
|
|
15980
17035
|
}, "startAction"));
|
|
15981
17036
|
}
|
|
15982
17037
|
__name(registerRunsStart, "registerRunsStart");
|
|
@@ -16029,28 +17084,28 @@ function registerRuns(program) {
|
|
|
16029
17084
|
__name(registerRuns, "registerRuns");
|
|
16030
17085
|
|
|
16031
17086
|
// src/api/sandbox-schemas.ts
|
|
16032
|
-
import { z as
|
|
16033
|
-
var createSandboxResponseSchema =
|
|
16034
|
-
sandbox_id:
|
|
16035
|
-
expires_at:
|
|
17087
|
+
import { z as z81 } from "zod";
|
|
17088
|
+
var createSandboxResponseSchema = z81.object({
|
|
17089
|
+
sandbox_id: z81.string(),
|
|
17090
|
+
expires_at: z81.string()
|
|
16036
17091
|
});
|
|
16037
|
-
var createSandboxUploadUrlResponseSchema =
|
|
16038
|
-
upload_url:
|
|
16039
|
-
path:
|
|
16040
|
-
expires_in_seconds:
|
|
17092
|
+
var createSandboxUploadUrlResponseSchema = z81.object({
|
|
17093
|
+
upload_url: z81.string(),
|
|
17094
|
+
path: z81.string(),
|
|
17095
|
+
expires_in_seconds: z81.number()
|
|
16041
17096
|
});
|
|
16042
|
-
var sandboxFileSchema =
|
|
16043
|
-
name:
|
|
16044
|
-
path:
|
|
16045
|
-
type:
|
|
16046
|
-
size_bytes:
|
|
17097
|
+
var sandboxFileSchema = z81.object({
|
|
17098
|
+
name: z81.string(),
|
|
17099
|
+
path: z81.string(),
|
|
17100
|
+
type: z81.enum(["file", "dir"]),
|
|
17101
|
+
size_bytes: z81.number()
|
|
16047
17102
|
});
|
|
16048
|
-
var listSandboxFilesResponseSchema =
|
|
16049
|
-
files:
|
|
17103
|
+
var listSandboxFilesResponseSchema = z81.object({
|
|
17104
|
+
files: z81.array(sandboxFileSchema)
|
|
16050
17105
|
});
|
|
16051
|
-
var uploadSandboxFileResponseSchema =
|
|
16052
|
-
path:
|
|
16053
|
-
size_bytes:
|
|
17106
|
+
var uploadSandboxFileResponseSchema = z81.object({
|
|
17107
|
+
path: z81.string(),
|
|
17108
|
+
size_bytes: z81.number()
|
|
16054
17109
|
});
|
|
16055
17110
|
var DEFAULT_SANDBOX_FILES_PATH = "/workspace";
|
|
16056
17111
|
|
|
@@ -16087,7 +17142,7 @@ function registerSandboxesCreate(sandboxes) {
|
|
|
16087
17142
|
__name(registerSandboxesCreate, "registerSandboxesCreate");
|
|
16088
17143
|
|
|
16089
17144
|
// src/commands/sandboxes/files.ts
|
|
16090
|
-
var
|
|
17145
|
+
var TABLE_COLUMNS27 = [
|
|
16091
17146
|
{ header: "TYPE", cell: /* @__PURE__ */ __name((row) => row.type, "cell") },
|
|
16092
17147
|
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
|
|
16093
17148
|
{ header: "PATH", cell: /* @__PURE__ */ __name((row) => row.path, "cell") },
|
|
@@ -16125,7 +17180,7 @@ function registerSandboxesFiles(sandboxes) {
|
|
|
16125
17180
|
console.log("No files found.");
|
|
16126
17181
|
return;
|
|
16127
17182
|
}
|
|
16128
|
-
console.log(renderTable(
|
|
17183
|
+
console.log(renderTable(TABLE_COLUMNS27, files));
|
|
16129
17184
|
console.log(`Showing ${files.length}`);
|
|
16130
17185
|
}, "filesAction"));
|
|
16131
17186
|
}
|
|
@@ -16466,7 +17521,7 @@ function registerSecretsGet(secrets) {
|
|
|
16466
17521
|
__name(registerSecretsGet, "registerSecretsGet");
|
|
16467
17522
|
|
|
16468
17523
|
// src/commands/secrets/list.ts
|
|
16469
|
-
var
|
|
17524
|
+
var TABLE_COLUMNS28 = [
|
|
16470
17525
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
16471
17526
|
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
|
|
16472
17527
|
{
|
|
@@ -16506,7 +17561,7 @@ function registerSecretsList(secrets) {
|
|
|
16506
17561
|
console.log("No secrets found.");
|
|
16507
17562
|
return;
|
|
16508
17563
|
}
|
|
16509
|
-
console.log(renderTable(
|
|
17564
|
+
console.log(renderTable(TABLE_COLUMNS28, rows));
|
|
16510
17565
|
console.log(`Showing ${rows.length}`);
|
|
16511
17566
|
}, "listAction"));
|
|
16512
17567
|
}
|
|
@@ -16617,7 +17672,7 @@ function registerSecrets(program) {
|
|
|
16617
17672
|
__name(registerSecrets, "registerSecrets");
|
|
16618
17673
|
|
|
16619
17674
|
// src/commands/skills/assignments.ts
|
|
16620
|
-
var
|
|
17675
|
+
var TABLE_COLUMNS29 = [
|
|
16621
17676
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
16622
17677
|
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") }
|
|
16623
17678
|
];
|
|
@@ -16645,7 +17700,7 @@ function registerSkillsAssignments(skills) {
|
|
|
16645
17700
|
console.log("No assignments use this skill.");
|
|
16646
17701
|
return;
|
|
16647
17702
|
}
|
|
16648
|
-
console.log(renderTable(
|
|
17703
|
+
console.log(renderTable(TABLE_COLUMNS29, assignments));
|
|
16649
17704
|
console.log(`Showing ${assignments.length} of ${total}`);
|
|
16650
17705
|
}, "assignmentsAction"));
|
|
16651
17706
|
}
|
|
@@ -16653,13 +17708,13 @@ __name(registerSkillsAssignments, "registerSkillsAssignments");
|
|
|
16653
17708
|
|
|
16654
17709
|
// src/commands/skills/create.ts
|
|
16655
17710
|
import { readFileSync as readFileSync4 } from "node:fs";
|
|
16656
|
-
import { z as
|
|
16657
|
-
var createSkillResponseSchema =
|
|
16658
|
-
skill:
|
|
16659
|
-
id:
|
|
16660
|
-
name:
|
|
16661
|
-
description:
|
|
16662
|
-
team_id:
|
|
17711
|
+
import { z as z82 } from "zod";
|
|
17712
|
+
var createSkillResponseSchema = z82.object({
|
|
17713
|
+
skill: z82.object({
|
|
17714
|
+
id: z82.string(),
|
|
17715
|
+
name: z82.string(),
|
|
17716
|
+
description: z82.string(),
|
|
17717
|
+
team_id: z82.string()
|
|
16663
17718
|
})
|
|
16664
17719
|
});
|
|
16665
17720
|
function registerSkillsCreate(skills) {
|
|
@@ -16923,7 +17978,7 @@ function readContent2(options) {
|
|
|
16923
17978
|
__name(readContent2, "readContent");
|
|
16924
17979
|
|
|
16925
17980
|
// src/commands/skills/files.ts
|
|
16926
|
-
var
|
|
17981
|
+
var TABLE_COLUMNS30 = [
|
|
16927
17982
|
{ header: "PATH", cell: /* @__PURE__ */ __name((row) => row.path, "cell") },
|
|
16928
17983
|
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
|
|
16929
17984
|
{
|
|
@@ -16962,7 +18017,7 @@ function registerSkillsFiles(skills) {
|
|
|
16962
18017
|
console.log("No files found.");
|
|
16963
18018
|
return;
|
|
16964
18019
|
}
|
|
16965
|
-
console.log(renderTable(
|
|
18020
|
+
console.log(renderTable(TABLE_COLUMNS30, parsed.data.files));
|
|
16966
18021
|
console.log(`Showing ${parsed.data.files.length}`);
|
|
16967
18022
|
}, "filesAction"));
|
|
16968
18023
|
}
|
|
@@ -17019,13 +18074,13 @@ function readExistingContent(source) {
|
|
|
17019
18074
|
__name(readExistingContent, "readExistingContent");
|
|
17020
18075
|
|
|
17021
18076
|
// src/commands/skills/install.ts
|
|
17022
|
-
import { z as
|
|
17023
|
-
var installSkillResponseSchema =
|
|
17024
|
-
skill:
|
|
17025
|
-
id:
|
|
17026
|
-
name:
|
|
17027
|
-
description:
|
|
17028
|
-
team_id:
|
|
18077
|
+
import { z as z83 } from "zod";
|
|
18078
|
+
var installSkillResponseSchema = z83.object({
|
|
18079
|
+
skill: z83.object({
|
|
18080
|
+
id: z83.string(),
|
|
18081
|
+
name: z83.string(),
|
|
18082
|
+
description: z83.string(),
|
|
18083
|
+
team_id: z83.string()
|
|
17029
18084
|
})
|
|
17030
18085
|
});
|
|
17031
18086
|
function registerSkillsInstall(skills) {
|
|
@@ -17207,13 +18262,13 @@ __name(registerSkillsSystem, "registerSkillsSystem");
|
|
|
17207
18262
|
// src/commands/skills/upload.ts
|
|
17208
18263
|
import { readFile as readFile6, stat as stat2 } from "node:fs/promises";
|
|
17209
18264
|
import { basename as basename2 } from "node:path";
|
|
17210
|
-
import { z as
|
|
17211
|
-
var uploadSkillResponseSchema =
|
|
17212
|
-
skill:
|
|
17213
|
-
id:
|
|
17214
|
-
name:
|
|
17215
|
-
description:
|
|
17216
|
-
team_id:
|
|
18265
|
+
import { z as z84 } from "zod";
|
|
18266
|
+
var uploadSkillResponseSchema = z84.object({
|
|
18267
|
+
skill: z84.object({
|
|
18268
|
+
id: z84.string(),
|
|
18269
|
+
name: z84.string(),
|
|
18270
|
+
description: z84.string(),
|
|
18271
|
+
team_id: z84.string()
|
|
17217
18272
|
})
|
|
17218
18273
|
});
|
|
17219
18274
|
function registerSkillsUpload(skills) {
|
|
@@ -17284,8 +18339,8 @@ function registerSkills(program) {
|
|
|
17284
18339
|
__name(registerSkills, "registerSkills");
|
|
17285
18340
|
|
|
17286
18341
|
// src/commands/team/render-team.ts
|
|
17287
|
-
import { z as
|
|
17288
|
-
var teamResponseSchema =
|
|
18342
|
+
import { z as z85 } from "zod";
|
|
18343
|
+
var teamResponseSchema = z85.object({
|
|
17289
18344
|
team: teamApiSchema
|
|
17290
18345
|
});
|
|
17291
18346
|
function renderTeam(team) {
|
|
@@ -17382,10 +18437,10 @@ function registerTeamGet(team) {
|
|
|
17382
18437
|
__name(registerTeamGet, "registerTeamGet");
|
|
17383
18438
|
|
|
17384
18439
|
// src/commands/team/members.ts
|
|
17385
|
-
var
|
|
17386
|
-
var
|
|
17387
|
-
var
|
|
17388
|
-
var
|
|
18440
|
+
var DEFAULT_LIMIT10 = 50;
|
|
18441
|
+
var MIN_LIMIT10 = 1;
|
|
18442
|
+
var MAX_LIMIT10 = 100;
|
|
18443
|
+
var TABLE_COLUMNS31 = [
|
|
17389
18444
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
17390
18445
|
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name ?? "", "cell") },
|
|
17391
18446
|
{ header: "EMAIL", cell: /* @__PURE__ */ __name((row) => row.email, "cell") },
|
|
@@ -17399,11 +18454,11 @@ function registerTeamMembers(team) {
|
|
|
17399
18454
|
team.command("members").description("List members of a team").option(
|
|
17400
18455
|
"--team <id>",
|
|
17401
18456
|
"team ID (defaults to the team scoped to your credentials)"
|
|
17402
|
-
).option("--limit <n>", `page size (${
|
|
18457
|
+
).option("--limit <n>", `page size (${MIN_LIMIT10}-${MAX_LIMIT10})`).option("--offset <n>", "number of members to skip").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function membersAction(options) {
|
|
17403
18458
|
const limit = parseLimit(options.limit, {
|
|
17404
|
-
defaultValue:
|
|
17405
|
-
min:
|
|
17406
|
-
max:
|
|
18459
|
+
defaultValue: DEFAULT_LIMIT10,
|
|
18460
|
+
min: MIN_LIMIT10,
|
|
18461
|
+
max: MAX_LIMIT10
|
|
17407
18462
|
});
|
|
17408
18463
|
const offset = parseOffset(options.offset);
|
|
17409
18464
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
@@ -17433,7 +18488,7 @@ function registerTeamMembers(team) {
|
|
|
17433
18488
|
console.log("No members found.");
|
|
17434
18489
|
return;
|
|
17435
18490
|
}
|
|
17436
|
-
console.log(renderTable(
|
|
18491
|
+
console.log(renderTable(TABLE_COLUMNS31, response.members));
|
|
17437
18492
|
console.log(
|
|
17438
18493
|
`Showing ${response.members.length} of ${response.total} \xB7 offset ${response.offset}`
|
|
17439
18494
|
);
|
|
@@ -17500,7 +18555,7 @@ __name(fetchProfileSummary, "fetchProfileSummary");
|
|
|
17500
18555
|
var version = resolveVersion();
|
|
17501
18556
|
function resolveVersion() {
|
|
17502
18557
|
if (true) {
|
|
17503
|
-
return "0.
|
|
18558
|
+
return "0.7.0";
|
|
17504
18559
|
}
|
|
17505
18560
|
const packageJsonPath = join2(
|
|
17506
18561
|
dirname2(fileURLToPath(import.meta.url)),
|
|
@@ -17541,6 +18596,7 @@ function createProgram() {
|
|
|
17541
18596
|
registerCredentials(program);
|
|
17542
18597
|
registerRevisionSecrets(program);
|
|
17543
18598
|
registerRevisionLogins(program);
|
|
18599
|
+
registerClarity(program);
|
|
17544
18600
|
return program;
|
|
17545
18601
|
}
|
|
17546
18602
|
__name(createProgram, "createProgram");
|
|
@@ -17564,7 +18620,7 @@ function checkForUpdate() {
|
|
|
17564
18620
|
__name(checkForUpdate, "checkForUpdate");
|
|
17565
18621
|
function loadPackageMeta() {
|
|
17566
18622
|
if (true) {
|
|
17567
|
-
return { name: "@duvoai/cli", version: "0.
|
|
18623
|
+
return { name: "@duvoai/cli", version: "0.7.0" };
|
|
17568
18624
|
}
|
|
17569
18625
|
const require2 = createRequire(import.meta.url);
|
|
17570
18626
|
const raw = require2("../package.json");
|