@thirdfy/agent-cli 0.1.21 → 0.1.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/CHANGELOG.md CHANGED
@@ -4,10 +4,20 @@ All notable changes to `@thirdfy/agent-cli` are documented here. The format is b
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.1.22] - 2026-04-28
8
+
9
+ **npm:** [`@thirdfy/agent-cli@0.1.22`](https://www.npmjs.com/package/@thirdfy/agent-cli/v/0.1.22)
10
+ **Git tag:** `v0.1.22`
11
+
12
+ ### Added
13
+
14
+ - **Agent tracking/data commands:** Added `data summary`, `track actions`, `track events`, and `track action` so operators and agents can read Thirdfy-owned analytics and report actions without raw telemetry HTTP calls.
15
+ - **Permissive custom tracking:** `track action` now supports unknown/custom action names with optional `--source`, `--provider`, `--protocol`, `--namespace`, and `--action-type` metadata.
16
+
7
17
  ## [0.1.21] - 2026-04-26
8
18
 
9
- **npm:** [`@thirdfy/agent-cli@0.1.21`](https://www.npmjs.com/package/@thirdfy/agent-cli/v/0.1.21) (after publish)
10
- **Git tag:** `v0.1.21`
19
+ **npm:** [`@thirdfy/agent-cli@0.1.21`](https://www.npmjs.com/package/@thirdfy/agent-cli/v/0.1.21)
20
+ **Git tag:** [`v0.1.21`](https://github.com/thirdfy/agent-cli/releases/tag/v0.1.21)
11
21
 
12
22
  ### Fixed
13
23
 
@@ -176,6 +176,18 @@ async function main() {
176
176
  case 'credits balance':
177
177
  await commandCreditsBalance(context, subFlags, capabilities);
178
178
  return;
179
+ case 'data summary':
180
+ await commandDataSummary(context, subFlags, capabilities);
181
+ return;
182
+ case 'track actions':
183
+ await commandTrackList(context, subFlags, capabilities, 'actions');
184
+ return;
185
+ case 'track events':
186
+ await commandTrackList(context, subFlags, capabilities, 'events');
187
+ return;
188
+ case 'track action':
189
+ await commandTrackAction(context, subFlags, capabilities);
190
+ return;
179
191
  case 'delegation create':
180
192
  await commandDelegationCreate(context, subFlags, capabilities);
181
193
  return;
@@ -539,6 +551,82 @@ async function commandCatalogsList(ctx, flags, capabilities) {
539
551
  });
540
552
  }
541
553
 
554
+ async function commandDataSummary(ctx, flags, capabilities) {
555
+ const agentKey = requireFlag(flags, 'agentKey', 'Missing --agent-key');
556
+ const query = new URLSearchParams({ agentKey });
557
+ if (flags.chainId) query.set('chainId', String(flags.chainId));
558
+ if (flags.limit) query.set('limit', String(flags.limit));
559
+ const response = await apiGet(ctx, `/api/v1/agent/telemetry/summary?${query.toString()}`);
560
+ printEnvelope({
561
+ success: true,
562
+ code: 'DATA_SUMMARY_OK',
563
+ message: 'Agent data summary loaded',
564
+ data: response,
565
+ meta: {
566
+ apiBase: ctx.apiBase,
567
+ agentKey,
568
+ chainId: flags.chainId ? Number(flags.chainId) : null,
569
+ },
570
+ });
571
+ }
572
+
573
+ async function commandTrackList(ctx, flags, capabilities, kind) {
574
+ const agentKey = requireFlag(flags, 'agentKey', 'Missing --agent-key');
575
+ const query = new URLSearchParams({ agentKey });
576
+ if (flags.limit) query.set('limit', String(flags.limit));
577
+ const response = await apiGet(ctx, `/api/v1/agent/telemetry/${kind}?${query.toString()}`);
578
+ printEnvelope({
579
+ success: true,
580
+ code: kind === 'events' ? 'TRACK_EVENTS_OK' : 'TRACK_ACTIONS_OK',
581
+ message: kind === 'events' ? 'Tracked agent events loaded' : 'Tracked agent actions loaded',
582
+ data: response,
583
+ meta: {
584
+ apiBase: ctx.apiBase,
585
+ agentKey,
586
+ kind,
587
+ },
588
+ });
589
+ }
590
+
591
+ async function commandTrackAction(ctx, flags, capabilities) {
592
+ const agentApiKey = resolveAgentApiKey(flags, 'thirdfy');
593
+ const action = requireFlag(flags, 'action', 'Missing --action');
594
+ const payload = {
595
+ agentApiKey,
596
+ action,
597
+ status: String(flags.status || 'observed'),
598
+ };
599
+ if (flags.agentKey) payload.agentKey = String(flags.agentKey);
600
+ if (flags.eventId) payload.eventId = String(flags.eventId);
601
+ if (flags.idempotencyKey) payload.idempotencyKey = String(flags.idempotencyKey);
602
+ if (flags.category) payload.category = String(flags.category);
603
+ if (flags.source) payload.source = String(flags.source);
604
+ if (flags.provider) payload.provider = String(flags.provider);
605
+ if (flags.protocol) payload.protocol = String(flags.protocol);
606
+ if (flags.namespace) payload.namespace = String(flags.namespace);
607
+ if (flags.actionType) payload.actionType = String(flags.actionType);
608
+ if (flags.chainId) payload.chainId = Number(flags.chainId);
609
+ if (flags.amountUsd) payload.amountUsd = Number(flags.amountUsd);
610
+ if (flags.txHash) payload.txHash = String(flags.txHash);
611
+ if (flags.userDid) payload.userDid = String(flags.userDid);
612
+ if (flags.params) payload.params = parseJsonFlag(flags, 'params');
613
+ if (flags.decision) payload.decision = parseJsonFlag(flags, 'decision');
614
+ if (flags.proof) payload.proof = parseJsonFlag(flags, 'proof');
615
+
616
+ const response = await apiPost(ctx, '/api/v1/agent/telemetry/actions', payload);
617
+ printEnvelope({
618
+ success: Boolean(response?.success !== false),
619
+ code: response?.success === false ? 'TRACK_ACTION_FAILED' : 'TRACK_ACTION_OK',
620
+ message: response?.success === false ? 'Agent action tracking failed' : 'Agent action tracked',
621
+ data: response,
622
+ meta: {
623
+ apiBase: ctx.apiBase,
624
+ action,
625
+ chainId: payload.chainId || null,
626
+ },
627
+ });
628
+ }
629
+
542
630
  async function commandActions(ctx, flags, capabilities) {
543
631
  const policyAware = Boolean(flags.agentApiKey);
544
632
  const actions = applyActionFilters(await getCachedActionsCatalog(ctx, flags), flags);
@@ -3479,6 +3567,10 @@ Core commands:
3479
3567
  thirdfy-agent whoami [--json]
3480
3568
  thirdfy-agent catalogs list [--json]
3481
3569
  thirdfy-agent actions [--catalog <id>] [--provider <id>] [--agent-api-key <key>] [--chain-id <id>] [--run-mode <mode>] [--json]
3570
+ thirdfy-agent data summary --agent-key <key> [--chain-id <id>] [--limit <n>] [--json]
3571
+ thirdfy-agent track actions --agent-key <key> [--limit <n>] [--json]
3572
+ thirdfy-agent track events --agent-key <key> [--limit <n>] [--json]
3573
+ thirdfy-agent track action --agent-api-key <key> --action <name> [--category <name>] [--source agent|external_mcp|operator|thirdfy|custom] [--provider <id>] [--protocol <id>] [--namespace <name>] [--action-type supported|custom] [--status observed|planned|skipped|submitted|confirmed|failed|blocked] [--chain-id <id>] [--params <json>] [--json]
3482
3574
  thirdfy-agent delegation create [--auth-token <token> | --owner-session-token <token>] --agent-key <key> --owner-address <addr> --token-address <addr> --max-usd-per-day <usd> [--session-account-address <addr>] [--json]
3483
3575
  thirdfy-agent delegation init-custodial [--auth-token <token> | --owner-session-token <token>] [--chain-id <id>] [--json]
3484
3576
  thirdfy-agent delegation custodial-grant [--auth-token <token> | --owner-session-token <token>] --agent-key <key> --token-address <addr> --max-usd-per-day <usd> [--chain-id <id>] [--period-duration <sec>] [--expiry-seconds <sec>] [--json]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thirdfy/agent-cli",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Thirdfy Agent CLI for onboarding, governance preflight, execute-intent, and status polling.",
5
5
  "type": "module",
6
6
  "bin": {