@rudderhq/cli 0.3.5-canary.20 → 0.3.5-canary.21
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 +68 -1
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1126,7 +1126,7 @@ var init_organization_intelligence_profile = __esm({
|
|
|
1126
1126
|
upsertOrganizationIntelligenceProfileSchema = z7.object({
|
|
1127
1127
|
agentRuntimeType: z7.enum(AGENT_RUNTIME_TYPES),
|
|
1128
1128
|
agentRuntimeConfig: organizationIntelligenceProfileConfigSchema.default({}),
|
|
1129
|
-
status: organizationIntelligenceProfileStatusSchema.optional().default("
|
|
1129
|
+
status: organizationIntelligenceProfileStatusSchema.optional().default("disabled")
|
|
1130
1130
|
});
|
|
1131
1131
|
}
|
|
1132
1132
|
});
|
|
@@ -7557,6 +7557,18 @@ var AGENT_CLI_CAPABILITIES = [
|
|
|
7557
7557
|
requiresRunId: false,
|
|
7558
7558
|
attachesRunIdWhenAvailable: true
|
|
7559
7559
|
},
|
|
7560
|
+
{
|
|
7561
|
+
id: "user.activity",
|
|
7562
|
+
command: "rudder user activity --user me --since today --json",
|
|
7563
|
+
category: "user",
|
|
7564
|
+
description: "Read a user-centered activity ledger with safe excerpts and provenance across chats, issue comments, approval comments, and user actor activity.",
|
|
7565
|
+
mutating: false,
|
|
7566
|
+
contract: "agent-v1",
|
|
7567
|
+
requiresOrgId: true,
|
|
7568
|
+
requiresAgentId: false,
|
|
7569
|
+
requiresRunId: false,
|
|
7570
|
+
attachesRunIdWhenAvailable: false
|
|
7571
|
+
},
|
|
7560
7572
|
{
|
|
7561
7573
|
id: "library.file.list",
|
|
7562
7574
|
command: "rudder library file list [directory]",
|
|
@@ -8155,6 +8167,7 @@ var CATEGORY_TITLES = {
|
|
|
8155
8167
|
runs: "Runs",
|
|
8156
8168
|
approval: "Approval",
|
|
8157
8169
|
skill: "Skill",
|
|
8170
|
+
user: "User",
|
|
8158
8171
|
library: "Library"
|
|
8159
8172
|
};
|
|
8160
8173
|
function getAgentCliCapabilities() {
|
|
@@ -12261,6 +12274,59 @@ function parseCsv5(value) {
|
|
|
12261
12274
|
return rows.length > 0 ? rows : void 0;
|
|
12262
12275
|
}
|
|
12263
12276
|
|
|
12277
|
+
// src/commands/client/user.ts
|
|
12278
|
+
function appendParam(params, key, value) {
|
|
12279
|
+
if (value && value.trim()) params.set(key, value.trim());
|
|
12280
|
+
}
|
|
12281
|
+
function formatUserActivityItem(item) {
|
|
12282
|
+
const time = new Date(item.occurredAt);
|
|
12283
|
+
const hhmm = Number.isNaN(time.getTime()) ? item.occurredAt : time.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
12284
|
+
const related = item.related.find((entry) => entry.type === "issue" || entry.type === "chat" || entry.type === "approval");
|
|
12285
|
+
const label = related?.label || related?.id || item.source.id;
|
|
12286
|
+
const excerpt = item.excerpt ? ` - ${item.excerpt}` : "";
|
|
12287
|
+
return `${hhmm} ${item.kind} ${label}: ${item.summary}${excerpt}`;
|
|
12288
|
+
}
|
|
12289
|
+
function registerUserCommands(program) {
|
|
12290
|
+
const user = program.command("user").description("User-oriented Rudder context commands");
|
|
12291
|
+
addCommonClientOptions(
|
|
12292
|
+
user.command("activity").description("List a user's recent Rudder activity ledger").option("-O, --org-id <id>", "Organization ID").option("--user <id>", "User ID or 'me'", "me").option("--since <value>", "Start time: today, 24h, 7d, or ISO timestamp", "today").option("--until <value>", "End time: ISO timestamp").option("--include <items>", "Comma-separated sources: chat,comments,issues,approvals,activity").option("--agent-id <id>", "Filter by related agent ID").option("--project-id <id>", "Filter by related project ID").option("--issue-id <id>", "Filter by related issue ID").option("--limit <n>", "Maximum items to return").option("--cursor <cursor>", "Pagination cursor from a prior response").action(async (opts) => {
|
|
12293
|
+
try {
|
|
12294
|
+
const ctx = resolveCommandContext(opts, { requireCompany: true });
|
|
12295
|
+
const userId = opts.user?.trim() || "me";
|
|
12296
|
+
const params = new URLSearchParams();
|
|
12297
|
+
appendParam(params, "since", opts.since);
|
|
12298
|
+
appendParam(params, "until", opts.until);
|
|
12299
|
+
appendParam(params, "include", opts.include);
|
|
12300
|
+
appendParam(params, "agentId", opts.agentId);
|
|
12301
|
+
appendParam(params, "projectId", opts.projectId);
|
|
12302
|
+
appendParam(params, "issueId", opts.issueId);
|
|
12303
|
+
appendParam(params, "limit", opts.limit);
|
|
12304
|
+
appendParam(params, "cursor", opts.cursor);
|
|
12305
|
+
const query = params.toString();
|
|
12306
|
+
const path23 = `/api/orgs/${ctx.orgId}/users/${encodeURIComponent(userId)}/activity-ledger${query ? `?${query}` : ""}`;
|
|
12307
|
+
const result = await ctx.api.get(path23);
|
|
12308
|
+
if (ctx.json) {
|
|
12309
|
+
printOutput(result, { json: true });
|
|
12310
|
+
return;
|
|
12311
|
+
}
|
|
12312
|
+
if (!result?.items?.length) {
|
|
12313
|
+
printOutput([], { json: false });
|
|
12314
|
+
return;
|
|
12315
|
+
}
|
|
12316
|
+
for (const item of result.items) {
|
|
12317
|
+
console.log(formatUserActivityItem(item));
|
|
12318
|
+
}
|
|
12319
|
+
if (result.nextCursor) {
|
|
12320
|
+
console.log(`nextCursor=${result.nextCursor}`);
|
|
12321
|
+
}
|
|
12322
|
+
} catch (err) {
|
|
12323
|
+
handleCommandError(err);
|
|
12324
|
+
}
|
|
12325
|
+
}),
|
|
12326
|
+
{ includeCompany: false }
|
|
12327
|
+
);
|
|
12328
|
+
}
|
|
12329
|
+
|
|
12264
12330
|
// src/commands/configure.ts
|
|
12265
12331
|
init_home();
|
|
12266
12332
|
init_schema();
|
|
@@ -14599,6 +14665,7 @@ function createProgram() {
|
|
|
14599
14665
|
registerAgentCommands(program);
|
|
14600
14666
|
registerApprovalCommands(program);
|
|
14601
14667
|
registerActivityCommands(program);
|
|
14668
|
+
registerUserCommands(program);
|
|
14602
14669
|
registerDashboardCommands(program);
|
|
14603
14670
|
registerSkillCommands(program);
|
|
14604
14671
|
registerLibraryCommands(program);
|