@rudderhq/cli 0.2.10-canary.29 → 0.2.10-canary.30
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/dist/index.js +80 -2
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -920,7 +920,7 @@ var init_chat = __esm({
|
|
|
920
920
|
status: z8.enum(AUTOMATION_STATUSES).optional().default("active"),
|
|
921
921
|
concurrencyPolicy: z8.enum(AUTOMATION_CONCURRENCY_POLICIES).optional().default("coalesce_if_active"),
|
|
922
922
|
catchUpPolicy: z8.enum(AUTOMATION_CATCH_UP_POLICIES).optional().default("skip_missed"),
|
|
923
|
-
outputMode: z8.enum(AUTOMATION_OUTPUT_MODES).optional().default("
|
|
923
|
+
outputMode: z8.enum(AUTOMATION_OUTPUT_MODES).optional().default("track_issue"),
|
|
924
924
|
schedule: z8.object({
|
|
925
925
|
cronExpression: z8.string().trim().min(1),
|
|
926
926
|
timezone: z8.string().trim().min(1),
|
|
@@ -1933,7 +1933,7 @@ var init_automation = __esm({
|
|
|
1933
1933
|
status: z20.enum(AUTOMATION_STATUSES).optional().default("active"),
|
|
1934
1934
|
concurrencyPolicy: z20.enum(AUTOMATION_CONCURRENCY_POLICIES).optional().default("coalesce_if_active"),
|
|
1935
1935
|
catchUpPolicy: z20.enum(AUTOMATION_CATCH_UP_POLICIES).optional().default("skip_missed"),
|
|
1936
|
-
outputMode: z20.enum(AUTOMATION_OUTPUT_MODES).optional().default("
|
|
1936
|
+
outputMode: z20.enum(AUTOMATION_OUTPUT_MODES).optional().default("track_issue"),
|
|
1937
1937
|
chatConversationId: z20.string().uuid().optional().nullable().default(null)
|
|
1938
1938
|
});
|
|
1939
1939
|
createAutomationSchema = automationBodySchema.superRefine((value, ctx) => {
|
|
@@ -10306,6 +10306,18 @@ var AGENT_CLI_CAPABILITIES = [
|
|
|
10306
10306
|
requiresRunId: false,
|
|
10307
10307
|
attachesRunIdWhenAvailable: false
|
|
10308
10308
|
},
|
|
10309
|
+
{
|
|
10310
|
+
id: "agent.update",
|
|
10311
|
+
command: "rudder agent update [agent-id] [--title <title>] [--description <text>]",
|
|
10312
|
+
category: "agent",
|
|
10313
|
+
description: "Update an agent's control-plane identity fields; defaults to the authenticated agent.",
|
|
10314
|
+
mutating: true,
|
|
10315
|
+
contract: "agent-v1",
|
|
10316
|
+
requiresOrgId: false,
|
|
10317
|
+
requiresAgentId: false,
|
|
10318
|
+
requiresRunId: false,
|
|
10319
|
+
attachesRunIdWhenAvailable: true
|
|
10320
|
+
},
|
|
10309
10321
|
{
|
|
10310
10322
|
id: "agent.skills.create",
|
|
10311
10323
|
command: "rudder agent skills create [agent-id] --name <name> [--enable]",
|
|
@@ -12046,6 +12058,32 @@ function registerAgentCommands(program) {
|
|
|
12046
12058
|
}
|
|
12047
12059
|
})
|
|
12048
12060
|
);
|
|
12061
|
+
addCommonClientOptions(
|
|
12062
|
+
agent.command("update").description(getAgentCliCapabilityById("agent.update").description).argument("[agentId]", "Agent ID or shortname/url-key; defaults to RUDDER_AGENT_ID").option("-O, --org-id <id>", "Organization ID").option("--name <name>", "Agent display name").option("--role <role>", "Agent organization role").option("--title <title>", "Agent title shown in mentions and agent labels").option("--clear-title", "Clear the agent title").option("--capabilities <text>", "Agent capabilities/description text").option("--capabilities-file <path>", "Read agent capabilities/description from a local file").option("--description <text>", "Alias for --capabilities").option("--description-file <path>", "Alias for --capabilities-file").option("--clear-capabilities", "Clear the agent capabilities/description").option("--clear-description", "Alias for --clear-capabilities").option("--reports-to <agent-id>", "Manager agent ID").option("--clear-reports-to", "Clear the manager relationship").action(async (agentIdArg, opts) => {
|
|
12063
|
+
try {
|
|
12064
|
+
const ctx = resolveCommandContext(opts);
|
|
12065
|
+
const agentId = agentIdArg?.trim() || ctx.agentId;
|
|
12066
|
+
if (!agentId) {
|
|
12067
|
+
throw new Error("Agent ID is required. Pass [agent-id] or set RUDDER_AGENT_ID.");
|
|
12068
|
+
}
|
|
12069
|
+
const patch = await buildAgentUpdatePatch(opts);
|
|
12070
|
+
if (Object.keys(patch).length === 0) {
|
|
12071
|
+
throw new Error(
|
|
12072
|
+
"No agent fields to update. Pass --name, --role, --title, --capabilities, --description, or --reports-to."
|
|
12073
|
+
);
|
|
12074
|
+
}
|
|
12075
|
+
const query = new URLSearchParams();
|
|
12076
|
+
if (ctx.orgId) query.set("orgId", ctx.orgId);
|
|
12077
|
+
const updated = await ctx.api.patch(
|
|
12078
|
+
`/api/agents/${encodeURIComponent(agentId)}${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
12079
|
+
patch
|
|
12080
|
+
);
|
|
12081
|
+
printOutput(updated, { json: ctx.json });
|
|
12082
|
+
} catch (err) {
|
|
12083
|
+
handleCommandError(err);
|
|
12084
|
+
}
|
|
12085
|
+
})
|
|
12086
|
+
);
|
|
12049
12087
|
addCommonClientOptions(
|
|
12050
12088
|
agent.command("hire").description(getAgentCliCapabilityById("agent.hire").description).option("-O, --org-id <id>", "Organization ID").requiredOption("--payload <json>", "Hire payload as JSON object").action(async (opts) => {
|
|
12051
12089
|
try {
|
|
@@ -12145,6 +12183,46 @@ function registerAgentCommands(program) {
|
|
|
12145
12183
|
{ includeCompany: false }
|
|
12146
12184
|
);
|
|
12147
12185
|
}
|
|
12186
|
+
async function buildAgentUpdatePatch(opts) {
|
|
12187
|
+
const rawPatch = {};
|
|
12188
|
+
if (opts.name !== void 0) rawPatch.name = opts.name;
|
|
12189
|
+
if (opts.role !== void 0) rawPatch.role = opts.role;
|
|
12190
|
+
if (opts.title !== void 0 && opts.clearTitle) {
|
|
12191
|
+
throw new Error("Pass only one of --title or --clear-title.");
|
|
12192
|
+
}
|
|
12193
|
+
if (opts.title !== void 0) rawPatch.title = opts.title;
|
|
12194
|
+
if (opts.clearTitle) rawPatch.title = null;
|
|
12195
|
+
if (opts.reportsTo !== void 0 && opts.clearReportsTo) {
|
|
12196
|
+
throw new Error("Pass only one of --reports-to or --clear-reports-to.");
|
|
12197
|
+
}
|
|
12198
|
+
if (opts.reportsTo !== void 0) rawPatch.reportsTo = opts.reportsTo;
|
|
12199
|
+
if (opts.clearReportsTo) rawPatch.reportsTo = null;
|
|
12200
|
+
const capabilitiesInputs = [
|
|
12201
|
+
opts.capabilities !== void 0 ? "--capabilities" : null,
|
|
12202
|
+
opts.capabilitiesFile !== void 0 ? "--capabilities-file" : null,
|
|
12203
|
+
opts.description !== void 0 ? "--description" : null,
|
|
12204
|
+
opts.descriptionFile !== void 0 ? "--description-file" : null
|
|
12205
|
+
].filter(Boolean);
|
|
12206
|
+
const clearCapabilities = opts.clearCapabilities || opts.clearDescription;
|
|
12207
|
+
if (capabilitiesInputs.length > 1) {
|
|
12208
|
+
throw new Error(
|
|
12209
|
+
"Pass only one of --capabilities, --capabilities-file, --description, or --description-file."
|
|
12210
|
+
);
|
|
12211
|
+
}
|
|
12212
|
+
if (capabilitiesInputs.length > 0 && clearCapabilities) {
|
|
12213
|
+
throw new Error("Pass either capabilities/description input or a clear flag, not both.");
|
|
12214
|
+
}
|
|
12215
|
+
if (opts.capabilities !== void 0) rawPatch.capabilities = opts.capabilities;
|
|
12216
|
+
if (opts.description !== void 0) rawPatch.capabilities = opts.description;
|
|
12217
|
+
if (opts.capabilitiesFile !== void 0) {
|
|
12218
|
+
rawPatch.capabilities = await fs14.readFile(path18.resolve(opts.capabilitiesFile), "utf8");
|
|
12219
|
+
}
|
|
12220
|
+
if (opts.descriptionFile !== void 0) {
|
|
12221
|
+
rawPatch.capabilities = await fs14.readFile(path18.resolve(opts.descriptionFile), "utf8");
|
|
12222
|
+
}
|
|
12223
|
+
if (clearCapabilities) rawPatch.capabilities = null;
|
|
12224
|
+
return updateAgentSchema.parse(rawPatch);
|
|
12225
|
+
}
|
|
12148
12226
|
function parseCsv3(value) {
|
|
12149
12227
|
if (!value) return [];
|
|
12150
12228
|
return value.split(",").map((entry) => entry.trim()).filter(Boolean);
|