@rudderhq/cli 0.7.24-canary.20 → 0.7.24-canary.22
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 +113 -20
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8602,9 +8602,9 @@ var init_rudder_agent_contract_generated = __esm({
|
|
|
8602
8602
|
"cli": {
|
|
8603
8603
|
"attachesRunIdWhenAvailable": true,
|
|
8604
8604
|
"category": "organization",
|
|
8605
|
-
"command": "rudder org brand-color update --org-id <id> --brand-color <hex> --idempotency-key <key>",
|
|
8605
|
+
"command": "rudder org brand-color update --org-id <id> [--brand-color <hex> | --clear-brand-color] [--logo-asset-id <uuid> | --clear-logo] --idempotency-key <key>",
|
|
8606
8606
|
"contract": "agent-v1",
|
|
8607
|
-
"description": "
|
|
8607
|
+
"description": "Set or clear the authenticated organization's brand color and link or clear an existing same-organization logo asset.",
|
|
8608
8608
|
"id": "organization.brand_color.update",
|
|
8609
8609
|
"mutating": true,
|
|
8610
8610
|
"requiresAgentId": false,
|
|
@@ -8617,28 +8617,52 @@ var init_rudder_agent_contract_generated = __esm({
|
|
|
8617
8617
|
"destructiveHint": false,
|
|
8618
8618
|
"idempotentHint": true,
|
|
8619
8619
|
"readOnlyHint": false,
|
|
8620
|
-
"title": "Update
|
|
8620
|
+
"title": "Update organization branding"
|
|
8621
8621
|
},
|
|
8622
8622
|
"capabilityId": "organization.brand_color.update",
|
|
8623
|
-
"description": "
|
|
8623
|
+
"description": "Set or clear the authenticated organization's brand color and link or clear an existing same-organization logo asset. Mutating: yes. Runtime identity and authorization are injected by the Rudder-managed MCP server and are not accepted as tool input. Org context: required from runtime env. Agent context: runtime env when available. Run attribution: attached from runtime env when available.",
|
|
8624
8624
|
"inputSchema": {
|
|
8625
8625
|
"additionalProperties": false,
|
|
8626
|
+
"anyOf": [
|
|
8627
|
+
{
|
|
8628
|
+
"required": [
|
|
8629
|
+
"brandColor"
|
|
8630
|
+
]
|
|
8631
|
+
},
|
|
8632
|
+
{
|
|
8633
|
+
"required": [
|
|
8634
|
+
"logoAssetId"
|
|
8635
|
+
]
|
|
8636
|
+
}
|
|
8637
|
+
],
|
|
8626
8638
|
"properties": {
|
|
8627
8639
|
"brandColor": {
|
|
8628
|
-
"description": "Hex brand color, for example #123456.",
|
|
8640
|
+
"description": "Hex brand color, for example #123456; null clears it. Omit to preserve it.",
|
|
8629
8641
|
"maxLength": 7,
|
|
8630
8642
|
"minLength": 7,
|
|
8631
|
-
"
|
|
8643
|
+
"pattern": "^#[0-9a-fA-F]{6}$",
|
|
8644
|
+
"type": [
|
|
8645
|
+
"string",
|
|
8646
|
+
"null"
|
|
8647
|
+
]
|
|
8632
8648
|
},
|
|
8633
8649
|
"idempotencyKey": {
|
|
8634
8650
|
"description": "Required stable key for safe replay.",
|
|
8635
8651
|
"maxLength": 255,
|
|
8636
8652
|
"minLength": 1,
|
|
8637
8653
|
"type": "string"
|
|
8654
|
+
},
|
|
8655
|
+
"logoAssetId": {
|
|
8656
|
+
"description": "Existing asset UUID from this organization; null clears the logo. Omit to preserve it.",
|
|
8657
|
+
"format": "uuid",
|
|
8658
|
+
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
|
|
8659
|
+
"type": [
|
|
8660
|
+
"string",
|
|
8661
|
+
"null"
|
|
8662
|
+
]
|
|
8638
8663
|
}
|
|
8639
8664
|
},
|
|
8640
8665
|
"required": [
|
|
8641
|
-
"brandColor",
|
|
8642
8666
|
"idempotencyKey"
|
|
8643
8667
|
],
|
|
8644
8668
|
"type": "object"
|
|
@@ -15611,13 +15635,13 @@ var init_rudder_mcp_tool_descriptors_generated = __esm({
|
|
|
15611
15635
|
{
|
|
15612
15636
|
"capabilityId": "organization.brand_color.update",
|
|
15613
15637
|
"name": "rudder_organization_brand_color_update",
|
|
15614
|
-
"description": "
|
|
15615
|
-
"semanticDescription": "
|
|
15638
|
+
"description": "Set or clear the authenticated organization's brand color and link or clear an existing same-organization logo asset.",
|
|
15639
|
+
"semanticDescription": "Set or clear the authenticated organization's brand color and link or clear an existing same-organization logo asset. Mutating: yes. Runtime identity and authorization are injected by the Rudder-managed MCP server and are not accepted as tool input. Org context: required from runtime env. Agent context: runtime env when available. Run attribution: attached from runtime env when available.",
|
|
15616
15640
|
"annotations": {
|
|
15617
15641
|
"destructiveHint": false,
|
|
15618
15642
|
"idempotentHint": true,
|
|
15619
15643
|
"readOnlyHint": false,
|
|
15620
|
-
"title": "Update
|
|
15644
|
+
"title": "Update organization branding"
|
|
15621
15645
|
},
|
|
15622
15646
|
"mutating": true,
|
|
15623
15647
|
"requiresOrgId": true,
|
|
@@ -15625,22 +15649,46 @@ var init_rudder_mcp_tool_descriptors_generated = __esm({
|
|
|
15625
15649
|
"attachesRunIdWhenAvailable": true,
|
|
15626
15650
|
"inputSchema": {
|
|
15627
15651
|
"additionalProperties": false,
|
|
15652
|
+
"anyOf": [
|
|
15653
|
+
{
|
|
15654
|
+
"required": [
|
|
15655
|
+
"brandColor"
|
|
15656
|
+
]
|
|
15657
|
+
},
|
|
15658
|
+
{
|
|
15659
|
+
"required": [
|
|
15660
|
+
"logoAssetId"
|
|
15661
|
+
]
|
|
15662
|
+
}
|
|
15663
|
+
],
|
|
15628
15664
|
"properties": {
|
|
15629
15665
|
"brandColor": {
|
|
15630
|
-
"description": "Hex brand color, for example #123456.",
|
|
15666
|
+
"description": "Hex brand color, for example #123456; null clears it. Omit to preserve it.",
|
|
15631
15667
|
"maxLength": 7,
|
|
15632
15668
|
"minLength": 7,
|
|
15633
|
-
"
|
|
15669
|
+
"pattern": "^#[0-9a-fA-F]{6}$",
|
|
15670
|
+
"type": [
|
|
15671
|
+
"string",
|
|
15672
|
+
"null"
|
|
15673
|
+
]
|
|
15634
15674
|
},
|
|
15635
15675
|
"idempotencyKey": {
|
|
15636
15676
|
"description": "Required stable key for safe replay.",
|
|
15637
15677
|
"maxLength": 255,
|
|
15638
15678
|
"minLength": 1,
|
|
15639
15679
|
"type": "string"
|
|
15680
|
+
},
|
|
15681
|
+
"logoAssetId": {
|
|
15682
|
+
"description": "Existing asset UUID from this organization; null clears the logo. Omit to preserve it.",
|
|
15683
|
+
"format": "uuid",
|
|
15684
|
+
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
|
|
15685
|
+
"type": [
|
|
15686
|
+
"string",
|
|
15687
|
+
"null"
|
|
15688
|
+
]
|
|
15640
15689
|
}
|
|
15641
15690
|
},
|
|
15642
15691
|
"required": [
|
|
15643
|
-
"brandColor",
|
|
15644
15692
|
"idempotencyKey"
|
|
15645
15693
|
],
|
|
15646
15694
|
"type": "object"
|
|
@@ -26962,14 +27010,34 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
|
26962
27010
|
|
|
26963
27011
|
// src/agent-v1-mcp-d1-capabilities.ts
|
|
26964
27012
|
import { randomUUID } from "node:crypto";
|
|
27013
|
+
function normalizedBrandingValue(field, value) {
|
|
27014
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
27015
|
+
throw new Error(`Invalid branding argument: ${field}`);
|
|
27016
|
+
}
|
|
27017
|
+
const trimmed = value.trim();
|
|
27018
|
+
return field === "logoAssetId" ? trimmed.toLowerCase() : trimmed;
|
|
27019
|
+
}
|
|
26965
27020
|
async function dispatchD1CapabilityDirectly(capabilityId, input, env, api, helpers) {
|
|
26966
27021
|
const { optionalString: optionalString2, requiredRuntimeString: requiredRuntimeString2, requiredString: requiredString2 } = helpers;
|
|
26967
27022
|
switch (capabilityId) {
|
|
26968
27023
|
case "organization.brand_color.update": {
|
|
26969
27024
|
const orgId = requiredRuntimeString2(env, "RUDDER_ORG_ID");
|
|
27025
|
+
const patch = {};
|
|
27026
|
+
for (const field of ["brandColor", "logoAssetId"]) {
|
|
27027
|
+
if (!Object.prototype.hasOwnProperty.call(input, field) || input[field] === void 0) continue;
|
|
27028
|
+
const value = input[field];
|
|
27029
|
+
if (value === null) {
|
|
27030
|
+
patch[field] = null;
|
|
27031
|
+
continue;
|
|
27032
|
+
}
|
|
27033
|
+
patch[field] = normalizedBrandingValue(field, value);
|
|
27034
|
+
}
|
|
27035
|
+
if (Object.keys(patch).length === 0) {
|
|
27036
|
+
throw new Error("Provide brandColor or logoAssetId to update");
|
|
27037
|
+
}
|
|
26970
27038
|
return { data: await api.patch(
|
|
26971
27039
|
`/api/orgs/${encodeURIComponent(orgId)}/branding`,
|
|
26972
|
-
|
|
27040
|
+
patch,
|
|
26973
27041
|
{ headers: {
|
|
26974
27042
|
"x-rudder-idempotency-key": requiredString2(input, "idempotencyKey"),
|
|
26975
27043
|
"x-rudder-required-authority": "rust"
|
|
@@ -27012,7 +27080,18 @@ async function dispatchD1CapabilityDirectly(capabilityId, input, env, api, helpe
|
|
|
27012
27080
|
function organizationBrandColorCliArgs(input, env, requiredString2, pushOptional2) {
|
|
27013
27081
|
const args = ["org", "brand-color", "update"];
|
|
27014
27082
|
pushOptional2(args, "--org-id", env.RUDDER_ORG_ID);
|
|
27015
|
-
|
|
27083
|
+
let hasPatch = false;
|
|
27084
|
+
if (Object.prototype.hasOwnProperty.call(input, "brandColor") && input.brandColor !== void 0) {
|
|
27085
|
+
hasPatch = true;
|
|
27086
|
+
if (input.brandColor === null) args.push("--clear-brand-color");
|
|
27087
|
+
else pushOptional2(args, "--brand-color", normalizedBrandingValue("brandColor", input.brandColor));
|
|
27088
|
+
}
|
|
27089
|
+
if (Object.prototype.hasOwnProperty.call(input, "logoAssetId") && input.logoAssetId !== void 0) {
|
|
27090
|
+
hasPatch = true;
|
|
27091
|
+
if (input.logoAssetId === null) args.push("--clear-logo");
|
|
27092
|
+
else pushOptional2(args, "--logo-asset-id", normalizedBrandingValue("logoAssetId", input.logoAssetId));
|
|
27093
|
+
}
|
|
27094
|
+
if (!hasPatch) throw new Error("Provide brandColor or logoAssetId to update");
|
|
27016
27095
|
args.push("--idempotency-key", requiredString2(input, "idempotencyKey"));
|
|
27017
27096
|
return args;
|
|
27018
27097
|
}
|
|
@@ -27082,9 +27161,9 @@ var AGENT_CLI_CAPABILITIES = [
|
|
|
27082
27161
|
{
|
|
27083
27162
|
"attachesRunIdWhenAvailable": true,
|
|
27084
27163
|
"category": "organization",
|
|
27085
|
-
"command": "rudder org brand-color update --org-id <id> --brand-color <hex> --idempotency-key <key>",
|
|
27164
|
+
"command": "rudder org brand-color update --org-id <id> [--brand-color <hex> | --clear-brand-color] [--logo-asset-id <uuid> | --clear-logo] --idempotency-key <key>",
|
|
27086
27165
|
"contract": "agent-v1",
|
|
27087
|
-
"description": "
|
|
27166
|
+
"description": "Set or clear the authenticated organization's brand color and link or clear an existing same-organization logo asset.",
|
|
27088
27167
|
"id": "organization.brand_color.update",
|
|
27089
27168
|
"mutating": true,
|
|
27090
27169
|
"requiresAgentId": false,
|
|
@@ -34912,14 +34991,28 @@ import pc5 from "picocolors";
|
|
|
34912
34991
|
|
|
34913
34992
|
// src/commands/client/company-brand-color.ts
|
|
34914
34993
|
function registerOrganizationBrandColorCommand(company) {
|
|
34915
|
-
const brandColor = company.command("brand-color").description("Organization
|
|
34994
|
+
const brandColor = company.command("brand-color").description("Organization branding operations");
|
|
34916
34995
|
addCommonClientOptions(
|
|
34917
|
-
brandColor.command("update").description(getAgentCliCapabilityById("organization.brand_color.update").description).
|
|
34996
|
+
brandColor.command("update").description(getAgentCliCapabilityById("organization.brand_color.update").description).option("--brand-color <hex>", "Hex brand color (for example #123456)").option("--clear-brand-color", "Clear the current brand color").option("--logo-asset-id <uuid>", "Link an existing asset from this organization as its logo").option("--clear-logo", "Clear the current logo link").requiredOption("--idempotency-key <key>", "Stable key for safe replay").action(async (opts) => {
|
|
34918
34997
|
try {
|
|
34998
|
+
if (opts.brandColor !== void 0 && opts.clearBrandColor) {
|
|
34999
|
+
throw new Error("Choose either --brand-color or --clear-brand-color");
|
|
35000
|
+
}
|
|
35001
|
+
if (opts.logoAssetId !== void 0 && opts.clearLogo) {
|
|
35002
|
+
throw new Error("Choose either --logo-asset-id or --clear-logo");
|
|
35003
|
+
}
|
|
35004
|
+
const patch = {};
|
|
35005
|
+
if (opts.brandColor !== void 0) patch.brandColor = opts.brandColor.trim();
|
|
35006
|
+
else if (opts.clearBrandColor) patch.brandColor = null;
|
|
35007
|
+
if (opts.logoAssetId !== void 0) patch.logoAssetId = opts.logoAssetId.trim();
|
|
35008
|
+
else if (opts.clearLogo) patch.logoAssetId = null;
|
|
35009
|
+
if (Object.keys(patch).length === 0) {
|
|
35010
|
+
throw new Error("Provide a branding field to update");
|
|
35011
|
+
}
|
|
34919
35012
|
const ctx = resolveCommandContext(opts, { requireCompany: true });
|
|
34920
35013
|
const updated = await ctx.api.patch(
|
|
34921
35014
|
`/api/orgs/${encodeURIComponent(ctx.orgId)}/branding`,
|
|
34922
|
-
|
|
35015
|
+
patch,
|
|
34923
35016
|
{
|
|
34924
35017
|
headers: {
|
|
34925
35018
|
"x-rudder-idempotency-key": opts.idempotencyKey.trim(),
|