@chainpatrol/cli 0.11.0 → 0.12.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/{breakdown-MM5GSZKV.js → breakdown-KCTKQNDY.js} +1 -1
  3. package/dist/{check-GDKUHVQI.js → check-P5JJJNEX.js} +1 -1
  4. package/dist/{chunk-37KYJWB3.js → chunk-DJVB73FL.js} +1 -1
  5. package/dist/{chunk-YXRFUYA6.js → chunk-NQT77IB7.js} +50 -8
  6. package/dist/{chunk-SX3L6NKR.js → chunk-OSRFCVBT.js} +129 -2
  7. package/dist/{chunk-EPKNZRX6.js → chunk-W42ITB5J.js} +1 -1
  8. package/dist/cli.js +395 -76
  9. package/dist/{completions-62OW3B3Y.js → completions-6C6KG5DH.js} +1 -1
  10. package/dist/{configs-update-7X7657PB.js → configs-update-3ZVXGADV.js} +1 -1
  11. package/dist/{create-FL4QQTPN.js → create-DFH2G7RH.js} +1 -1
  12. package/dist/{drift-JKBHWWFU.js → drift-T74V2C3J.js} +1 -1
  13. package/dist/{found-3WI4XQG4.js → found-EVXJZGYX.js} +1 -1
  14. package/dist/{healthcheck-EVQVPGWW.js → healthcheck-HZYEIIOR.js} +1 -1
  15. package/dist/{list-BLNIE4GL.js → list-23QQYAV5.js} +1 -1
  16. package/dist/list-EIVPGMWJ.js +82 -0
  17. package/dist/list-I7SBGA52.js +50 -0
  18. package/dist/{list-5DN6X3DP.js → list-IYJBKE2F.js} +1 -1
  19. package/dist/list-PBAXQSL5.js +85 -0
  20. package/dist/list-QUFY4IP7.js +146 -0
  21. package/dist/{list-JPG2ZSR4.js → list-WJQT2XLE.js} +7 -1
  22. package/dist/{list-ULHPOUJV.js → list-WX5G3IOF.js} +2 -2
  23. package/dist/list-YCT6DYDI.js +89 -0
  24. package/dist/{list-XDGU6SJQ.js → list-YRJPN4PI.js} +1 -1
  25. package/dist/{list-E5XNR2YG.js → list-ZFPML3ZR.js} +47 -3
  26. package/dist/{list-json-R2MIXADX.js → list-json-T2Z7NV7G.js} +1 -1
  27. package/dist/{organization-MJRKWC4Z.js → organization-IIIOSTHF.js} +1 -1
  28. package/dist/{run-EUVRC72M.js → run-BHEXWBAS.js} +2 -2
  29. package/dist/{run-2YZZGZYN.js → run-CJGN6TX4.js} +1 -1
  30. package/dist/{run-5E5EC3MP.js → run-MSO6IXEV.js} +1 -1
  31. package/dist/search-WPSKQGUS.js +71 -0
  32. package/dist/{setup-skill-HAENFIFQ.js → setup-skill-FA4STSGA.js} +2 -2
  33. package/dist/{snapshot-3FUJICJJ.js → snapshot-ZWAHEG64.js} +1 -1
  34. package/dist/{summary-RVYQUKWV.js → summary-Y2LG6UJM.js} +1 -1
  35. package/dist/{validate-UOVKEAJM.js → validate-SM5DD7I2.js} +1 -1
  36. package/dist/whoami-DH5HVLFN.js +69 -0
  37. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -13,8 +13,8 @@ import {
13
13
  getCliVersion,
14
14
  isSkillInstalled,
15
15
  readInstalledSkillVersion
16
- } from "./chunk-EPKNZRX6.js";
17
- import "./chunk-YXRFUYA6.js";
16
+ } from "./chunk-W42ITB5J.js";
17
+ import "./chunk-NQT77IB7.js";
18
18
  import {
19
19
  DateTime
20
20
  } from "./chunk-TFCNKBRC.js";
@@ -92,14 +92,31 @@ var HELP = {
92
92
  usage: "chainpatrol logout"
93
93
  },
94
94
  asset: {
95
- description: "Check whether one or more assets are BLOCKED, ALLOWED, or UNKNOWN.",
96
- usage: "chainpatrol asset check <content> [<content> ...]",
95
+ description: "Check asset status or list blocked/allowed assets across the global ChainPatrol blocklist.",
96
+ usage: "chainpatrol asset <check|list>",
97
97
  examples: [
98
98
  "chainpatrol asset check https://phish.example",
99
- "chainpatrol asset check a.example b.example c.example",
99
+ "chainpatrol asset list --asset-type URL --from 2026-05-01",
100
100
  "chainpatrol --json asset check 0xabc123\u2026"
101
101
  ]
102
102
  },
103
+ "asset list": {
104
+ description: "List assets in the global ChainPatrol blocklist for a given asset type. Defaults to BLOCKED assets updated in the last day. Use --from and --to to widen the window.",
105
+ usage: "chainpatrol asset list --asset-type <type> [--from ISO --to ISO] [filters]",
106
+ options: [
107
+ "--asset-type <type> Asset type: URL|ADDRESS|TWITTER|TELEGRAM|DISCORD|...",
108
+ "--type <type> Alias for --asset-type",
109
+ "--asset-status <s> Status filter: BLOCKED|ALLOWED|UNKNOWN (default BLOCKED)",
110
+ "--from <iso> Start date (YYYY-MM-DD)",
111
+ "--to <iso> End date (YYYY-MM-DD)",
112
+ "--per-page <n> Page size 1-10000 (default 100; --limit also accepted)",
113
+ "--next-page <cursor> Cursor returned from a previous response"
114
+ ],
115
+ examples: [
116
+ "chainpatrol asset list --asset-type URL --from 2026-05-01 --to 2026-05-17",
117
+ "chainpatrol asset list --asset-type ADDRESS --per-page 500 --output csv"
118
+ ]
119
+ },
103
120
  "asset check": {
104
121
  description: "Look up one or more assets (URL, domain, or crypto address) against the ChainPatrol blocklist and external feeds. Returns the aggregated status plus a per-source breakdown. Multiple assets can be passed as positional arguments or via repeated --asset; they are checked in parallel (concurrency 10).",
105
122
  usage: "chainpatrol asset check <content> [<content> ...]",
@@ -127,17 +144,46 @@ var HELP = {
127
144
  examples: ["chainpatrol configs list --org acme"]
128
145
  },
129
146
  detections: {
130
- description: "Validate, run, and update detection configs.",
131
- usage: "chainpatrol detections <healthcheck|validate|drift|run|configs>",
147
+ description: "Validate, run, list, and update detection configs and results.",
148
+ usage: "chainpatrol detections <healthcheck|validate|drift|run|list|configs>",
132
149
  options: ["--org <slug> Organization slug"],
133
150
  examples: [
134
151
  "chainpatrol detections healthcheck --org acme --run",
135
152
  "chainpatrol detections validate --org acme --min-results 5",
136
153
  "chainpatrol detections drift --org acme --lookback-hours 168",
137
154
  "chainpatrol detections run --org acme --source twitter",
155
+ "chainpatrol detections list --org acme --confidence medium,high",
138
156
  "chainpatrol detections configs update --org acme --config-id 1 --enable"
139
157
  ]
140
158
  },
159
+ "detections list": {
160
+ description: "List recent threat detection results for an organization. Returns human-readable confidence levels (none/low/medium/high) and report status. Filter parity with the app's detections view: source, confidence, asset status/type, brand, liveness, watchlist, reported, country, and deleted items.",
161
+ usage: "chainpatrol detections list --org <slug> [filters]",
162
+ options: [
163
+ "--org <slug> Organization slug",
164
+ "--limit <n> Page size 1-100 (default 50)",
165
+ "--cursor <n> Pagination cursor",
166
+ "--search <q> Search by threat content",
167
+ "--source <list> Comma list of detection source keys",
168
+ "--confidence <list> Comma list: none|low|medium|high",
169
+ "--asset-status <list> Comma list: BLOCKED|ALLOWED|UNKNOWN",
170
+ "--asset-type <list> Comma list of asset types",
171
+ "--brand <ids> Comma list of brand IDs",
172
+ "--liveness <list> Comma list: ALIVE|DEAD|UNKNOWN",
173
+ "--watchlist <list> Comma list: ENABLED|DISABLED",
174
+ "--reported <list> Comma list: reported|not_reported",
175
+ "--country-code <list> Comma list of 2-letter ISO country codes (e.g. US,GB)",
176
+ "--only-deleted Return only soft-deleted detections. Without this flag the endpoint returns both deleted and non-deleted (existing public-API behavior).",
177
+ "--from <iso> Start date (ISO 8601)",
178
+ "--to <iso> End date (ISO 8601)"
179
+ ],
180
+ examples: [
181
+ "chainpatrol detections list --org acme --confidence medium,high",
182
+ "chainpatrol detections list --org acme --source twitter --liveness ALIVE",
183
+ "chainpatrol detections list --org acme --reported not_reported --watchlist ENABLED",
184
+ "chainpatrol detections list --org acme --brand 12,34 --country-code US,GB"
185
+ ]
186
+ },
141
187
  "detections healthcheck": {
142
188
  description: "Run a health check across all detection configs for an org.",
143
189
  usage: "chainpatrol detections healthcheck --org <slug> [options]",
@@ -264,11 +310,25 @@ var HELP = {
264
310
  ]
265
311
  },
266
312
  reports: {
267
- description: "Create and list reports from the terminal.",
268
- usage: "chainpatrol reports <create|list>",
313
+ description: "Create, list, and search reports from the terminal.",
314
+ usage: "chainpatrol reports <create|list|search>",
269
315
  examples: [
270
316
  'chainpatrol reports create --org acme --title "Phish" --asset "https://bad.site:BLOCKED"',
271
- "chainpatrol reports list --org acme --limit 5"
317
+ "chainpatrol reports list --org acme --limit 5",
318
+ "chainpatrol reports search https://bad.site"
319
+ ]
320
+ },
321
+ "reports search": {
322
+ description: "Search existing reports in your organization by asset contents. Useful to check for an existing report before creating a duplicate.",
323
+ usage: "chainpatrol reports search <content> [<content> ...]",
324
+ options: [
325
+ "--asset <content> Asset content (repeatable; alternative to positional args)",
326
+ "--reported-by-customer Match only customer-submitted reports",
327
+ "--no-reported-by-customer Match only non-customer reports"
328
+ ],
329
+ examples: [
330
+ "chainpatrol reports search https://bad.site",
331
+ "chainpatrol reports search https://a.site https://b.site --reported-by-customer"
272
332
  ]
273
333
  },
274
334
  "reports create": {
@@ -291,16 +351,34 @@ var HELP = {
291
351
  ]
292
352
  },
293
353
  "reports list": {
294
- description: "List recent reports for an organization.",
295
- usage: "chainpatrol reports list --org <slug> [options]",
354
+ description: "List recent reports for an organization with the same level of filtering as the app's Reports view.",
355
+ usage: "chainpatrol reports list --org <slug> [filters]",
296
356
  options: [
297
- "--org <slug> Organization slug",
298
- "--limit <n> Page size (1-20)",
299
- "--cursor <id> Pagination cursor",
300
- "--status <s> Filter by report status",
301
- "--search <q> Search query",
302
- "--reported-by-customer Show only customer-submitted reports",
303
- "--no-reported-by-customer Show only non-customer reports"
357
+ "--org <slug> Organization slug",
358
+ "--limit <n> Page size (1-20)",
359
+ "--cursor <id> Pagination cursor",
360
+ "--status <s> Filter by report status: TODO|IN_PROGRESS|CLOSED",
361
+ "--search <q> Search reports by title/description",
362
+ "--reporter-query <q> Search reports by reporter name (legacy)",
363
+ "--reported-by-customer Show only customer-submitted reports",
364
+ "--no-reported-by-customer Show only non-customer reports",
365
+ "--exclude-automation Exclude reports submitted by automation",
366
+ "--only-rejected Only reports whose latest review decision was REJECT",
367
+ "--review-status <list> Comma list: APPROVE|REJECT|SKIP|ESCALATE",
368
+ "--asset-type <list> Comma list of asset types (URL,TWITTER,...)",
369
+ "--brand <ids> Comma list of brand IDs",
370
+ "--country-code <list> Comma list of 2-letter ISO country codes",
371
+ "--reviewed-by-user-id <n> Only reports reviewed by a specific user ID",
372
+ "--from <iso> Filter by Report.createdAt >= ISO date",
373
+ "--to <iso> Filter by Report.createdAt <= ISO date",
374
+ "--updated-from <iso> Filter by Report.updatedAt >= ISO date",
375
+ "--updated-to <iso> Filter by Report.updatedAt <= ISO date"
376
+ ],
377
+ examples: [
378
+ "chainpatrol reports list --org acme --status TODO --review-status REJECT",
379
+ "chainpatrol reports list --org acme --exclude-automation --reported-by-customer",
380
+ "chainpatrol reports list --org acme --from 2026-05-01 --updated-from 2026-05-10",
381
+ "chainpatrol reports list --org acme --brand 12,34 --country-code US,GB"
304
382
  ]
305
383
  },
306
384
  queues: {
@@ -311,6 +389,32 @@ var HELP = {
311
389
  "chainpatrol queues snapshot --all"
312
390
  ]
313
391
  },
392
+ threats: {
393
+ description: "List confirmed threats blocked by ChainPatrol.",
394
+ usage: "chainpatrol threats list [filters]",
395
+ examples: [
396
+ "chainpatrol threats list",
397
+ "chainpatrol threats list --from 2026-05-01 --asset-type URL"
398
+ ]
399
+ },
400
+ "threats list": {
401
+ description: "List threats blocked by ChainPatrol. Org is derived from your API key. Defaults to the last 1 day. Use --from and --to to widen the window.",
402
+ usage: "chainpatrol threats list [filters]",
403
+ options: [
404
+ "--query <text> Search threat content (substring)",
405
+ "--from <iso> Start date (YYYY-MM-DD)",
406
+ "--to <iso> End date (YYYY-MM-DD)",
407
+ "--asset-type <list> Comma list (URL,TWITTER,TELEGRAM,...)",
408
+ "--sort-by <key> Sort key (e.g. blockedAt)",
409
+ "--sort-direction <dir> asc|desc",
410
+ "--per-page <n> Page size 1-100 (default 10)",
411
+ "--next-page <cursor> Cursor returned from a previous response"
412
+ ],
413
+ examples: [
414
+ "chainpatrol threats list --from 2026-05-01 --asset-type URL",
415
+ "CHAINPATROL_API_KEY=... chainpatrol threats list --json"
416
+ ]
417
+ },
314
418
  takedowns: {
315
419
  description: "List individual takedown records for an organization.",
316
420
  usage: "chainpatrol takedowns list [--org <slug>] [filters]",
@@ -321,25 +425,32 @@ var HELP = {
321
425
  ]
322
426
  },
323
427
  "takedowns list": {
324
- description: "List takedowns for an organization. Defaults to takedowns updated in the last 30 days. Works with both API key auth (org derived from key) and session auth (pass --org).",
428
+ description: "List takedowns for an organization with the same level of filtering as the app's Takedowns view. Defaults to takedowns updated in the last 30 days. Works with both API key auth (org derived from key) and session auth (pass --org).",
325
429
  usage: "chainpatrol takedowns list [--org <slug>] [filters]",
326
430
  options: [
327
- "--org <slug> Organization slug (omit when using an API key)",
328
- "--query <text> Search asset content (substring match)",
329
- "--from <iso> Filter by updatedAt >= ISO date",
330
- "--to <iso> Filter by updatedAt <= ISO date",
331
- "--asset-type <list> Comma list (URL,TWITTER,TELEGRAM,...)",
332
- "--takedown-status <list> Comma list (TODO,IN_PROGRESS,COMPLETED,CANCELLED,PENDING_INPUT,...)",
333
- "--liveness-status <list> Comma list (ALIVE,DEAD,UNKNOWN)",
334
- "--sort-by <key> Sort key: updatedAt|createdAt|takedownStatus|takedownUpdatedAt",
335
- "--sort-direction <dir> asc|desc (default desc)",
336
- "--per-page <n> Page size 1-100 (default 10; --limit also accepted)",
337
- "--next-page <cursor> Cursor returned from a previous response"
431
+ "--org <slug> Organization slug (omit when using an API key)",
432
+ "--query <text> Search asset content (substring match)",
433
+ "--from <iso> Filter by Takedown.updatedAt >= ISO date",
434
+ "--to <iso> Filter by Takedown.updatedAt <= ISO date",
435
+ "--started-from <iso> Filter by `started at` >= ISO date (earliest IN_PROGRESS event)",
436
+ "--started-to <iso> Filter by `started at` <= ISO date",
437
+ "--asset-type <list> Comma list (URL,TWITTER,TELEGRAM,...)",
438
+ "--takedown-status <list> Comma list (TODO,IN_PROGRESS,COMPLETED,CANCELLED,PENDING_INPUT,...)",
439
+ "--liveness-status <list> Comma list (ALIVE,DEAD,UNKNOWN)",
440
+ "--brand <ids> Comma list of brand IDs",
441
+ "--assignee <ids> Comma list of assignee user IDs",
442
+ "--hide-automated-takedowns Hide takedowns handled by the platform-takedown automation",
443
+ "--hide-automated-liveness-checks Hide takedowns whose asset is checked for liveness automatically",
444
+ "--sort-by <key> Sort key: updatedAt|createdAt|takedownStatus|takedownUpdatedAt|assigneeId|brandId",
445
+ "--sort-direction <dir> asc|desc (default desc)",
446
+ "--per-page <n> Page size 1-100 (default 10; --limit also accepted)",
447
+ "--next-page <cursor> Cursor returned from a previous response"
338
448
  ],
339
449
  examples: [
340
450
  "chainpatrol takedowns list --org acme --takedown-status TODO,IN_PROGRESS",
341
451
  "chainpatrol takedowns list --org acme --asset-type URL --liveness-status ALIVE",
342
- "chainpatrol takedowns list --org acme --per-page 100 --output csv",
452
+ "chainpatrol takedowns list --org acme --brand 12,34 --assignee 7",
453
+ "chainpatrol takedowns list --org acme --started-from 2026-04-01 --hide-automated-takedowns",
343
454
  "CHAINPATROL_API_KEY=... chainpatrol takedowns list --json"
344
455
  ]
345
456
  },
@@ -353,13 +464,43 @@ var HELP = {
353
464
  ]
354
465
  },
355
466
  orgs: {
356
- description: "List organizations accessible to you with subscription status and service toggles.",
357
- usage: "chainpatrol orgs list [filters]",
467
+ description: "List organizations, their assets, and asset groups. Top-level `orgs list` lists organizations accessible to you; the nested subcommands operate on the org tied to your API key.",
468
+ usage: "chainpatrol orgs <list|assets list|asset-groups list>",
358
469
  examples: [
359
470
  "chainpatrol orgs list",
360
- "chainpatrol orgs list --subscription-status ACTIVE --service-active takedowns --service-manual takedowns"
471
+ "chainpatrol orgs assets list --asset-type URL",
472
+ "chainpatrol orgs asset-groups list"
473
+ ]
474
+ },
475
+ "orgs assets": {
476
+ description: "List assets in your organization's allowlist.",
477
+ usage: "chainpatrol orgs assets list [filters]"
478
+ },
479
+ "orgs assets list": {
480
+ description: "List assets belonging to your organization's allowlist. Org is derived from your API key. Supports filtering by type, group, and search query.",
481
+ usage: "chainpatrol orgs assets list [filters]",
482
+ options: [
483
+ "--asset-type <type> Filter by asset type (URL, ADDRESS, ...)",
484
+ "--type <type> Alias for --asset-type",
485
+ "--group-id <n> Filter by group ID. Use -1 for ungrouped assets only",
486
+ "--query <text> Search asset content (substring)",
487
+ "--per-page <n> Page size 1-1000 (default 100; --limit also accepted)",
488
+ "--next-page <cursor> Cursor returned from a previous response"
489
+ ],
490
+ examples: [
491
+ "chainpatrol orgs assets list --asset-type URL",
492
+ "chainpatrol orgs assets list --group-id 12 --per-page 250 --output csv"
361
493
  ]
362
494
  },
495
+ "orgs asset-groups": {
496
+ description: "List asset groups in your organization.",
497
+ usage: "chainpatrol orgs asset-groups list"
498
+ },
499
+ "orgs asset-groups list": {
500
+ description: "List asset groups belonging to your organization with per-group asset counts. Org is derived from your API key.",
501
+ usage: "chainpatrol orgs asset-groups list",
502
+ examples: ["chainpatrol orgs asset-groups list --output csv"]
503
+ },
363
504
  "orgs list": {
364
505
  description: "List organizations with their subscription status and per-service active/automated flags. All filters compose with AND.",
365
506
  usage: "chainpatrol orgs list [filters]",
@@ -438,6 +579,15 @@ var HELP = {
438
579
  description: "Output a shell completion script.",
439
580
  usage: "chainpatrol completions <zsh|bash>",
440
581
  examples: ["chainpatrol completions zsh > _chainpatrol"]
582
+ },
583
+ whoami: {
584
+ description: "Show the current authenticated identity. With an API key, validates the key and reports the bound organization. With a session token, returns the logged-in user.",
585
+ usage: "chainpatrol whoami",
586
+ examples: [
587
+ "chainpatrol whoami",
588
+ "chainpatrol whoami --json",
589
+ "CHAINPATROL_API_KEY=... chainpatrol whoami"
590
+ ]
441
591
  }
442
592
  };
443
593
  function getCommandHelp(command2, subcommand2) {
@@ -462,15 +612,17 @@ function getTopLevelHelp() {
462
612
  " Commands",
463
613
  " login Authenticate with ChainPatrol",
464
614
  " logout Clear stored credentials",
465
- " asset Check asset status against ChainPatrol",
615
+ " whoami Show the current authenticated identity",
616
+ " asset Check or list assets in the global ChainPatrol blocklist",
466
617
  " configs Manage detection configs",
467
- " detections Validate, run, update detection configs",
618
+ " detections Validate, run, list, update detection configs and results",
468
619
  " healthchecks List and run organization healthchecks",
469
620
  " metrics Query organization metrics and breakdowns",
470
- " reports Create and list reports from terminal",
621
+ " reports Create, list, and search reports from terminal",
471
622
  " queues Snapshot operations review/takedown queues",
472
623
  " takedowns List individual takedown records",
473
- " orgs List organizations and filter by status/services",
624
+ " threats List confirmed threats blocked by ChainPatrol",
625
+ " orgs List organizations, org assets, and asset groups",
474
626
  " presets Run saved workflows for common jobs",
475
627
  " setup Install Claude Code skill and shell completions",
476
628
  " uninstall Remove Claude Code skill and shell completions",
@@ -642,11 +794,13 @@ var COMMANDS = [
642
794
  "reports",
643
795
  "queues",
644
796
  "takedowns",
797
+ "threats",
645
798
  "orgs",
646
799
  "presets",
647
800
  "setup",
648
801
  "uninstall",
649
802
  "completions",
803
+ "whoami",
650
804
  "help"
651
805
  ];
652
806
  function levenshtein(a, b) {
@@ -733,6 +887,27 @@ ${getTopLevelHelp()}
733
887
  sortDirection: { type: "string" },
734
888
  perPage: { type: "number" },
735
889
  brandSlug: { type: "string" },
890
+ type: { type: "string" },
891
+ groupId: { type: "number" },
892
+ confidence: { type: "string" },
893
+ assetStatus: { type: "string" },
894
+ liveness: { type: "string" },
895
+ watchlist: { type: "string" },
896
+ reported: { type: "string" },
897
+ countryCode: { type: "string" },
898
+ onlyDeleted: { type: "boolean", default: false },
899
+ assignee: { type: "string" },
900
+ startedFrom: { type: "string" },
901
+ startedTo: { type: "string" },
902
+ hideAutomatedTakedowns: { type: "boolean" },
903
+ hideAutomatedLivenessChecks: { type: "boolean" },
904
+ reporterQuery: { type: "string" },
905
+ excludeAutomation: { type: "boolean" },
906
+ onlyRejected: { type: "boolean" },
907
+ reviewStatus: { type: "string" },
908
+ reviewedByUserId: { type: "number" },
909
+ updatedFrom: { type: "string" },
910
+ updatedTo: { type: "string" },
736
911
  help: { type: "boolean", shortFlag: "h" },
737
912
  version: { type: "boolean", shortFlag: "V" },
738
913
  quiet: { type: "boolean", default: false, shortFlag: "q" },
@@ -823,10 +998,7 @@ function getConfigPatchFromSetFlags() {
823
998
  return patch;
824
999
  }
825
1000
  function parseBrandIds() {
826
- if (!cli.flags.brand) return void 0;
827
- const values = cli.flags.brand.split(",").map((item) => item.trim()).filter(Boolean);
828
- const ids = values.map((value) => Number(value)).filter((value) => !Number.isNaN(value));
829
- return ids.length > 0 ? ids : void 0;
1001
+ return parseIntList(cli.flags.brand, "brand");
830
1002
  }
831
1003
  function parseAssetInputs() {
832
1004
  return getRepeatedFlag("asset");
@@ -836,18 +1008,32 @@ function parseCsvList(value) {
836
1008
  const items = value.split(",").map((item) => item.trim()).filter(Boolean);
837
1009
  return items.length > 0 ? items : void 0;
838
1010
  }
1011
+ function parseIntList(value, flagName) {
1012
+ const items = parseCsvList(value);
1013
+ if (!items) return void 0;
1014
+ const parsed = items.map((item) => {
1015
+ const n = Number(item);
1016
+ if (!Number.isInteger(n) || n <= 0) {
1017
+ throw new Error(
1018
+ `--${flagName} expects positive integers; got '${item}'. Use comma-separated IDs (e.g. --${flagName} 12,34).`
1019
+ );
1020
+ }
1021
+ return n;
1022
+ });
1023
+ return parsed;
1024
+ }
839
1025
  function parseAttachmentUrls() {
840
1026
  const values = getRepeatedFlag("attachment-url").filter(Boolean);
841
1027
  return values.length > 0 ? values : void 0;
842
1028
  }
843
1029
  async function handleConfigsList(org) {
844
1030
  if (jsonMode) {
845
- const { listConfigsJson } = await import("./list-json-R2MIXADX.js");
1031
+ const { listConfigsJson } = await import("./list-json-T2Z7NV7G.js");
846
1032
  await listConfigsJson({ org });
847
1033
  return;
848
1034
  }
849
1035
  const { render } = await import("ink");
850
- const { default: ConfigsList } = await import("./list-5DN6X3DP.js");
1036
+ const { default: ConfigsList } = await import("./list-IYJBKE2F.js");
851
1037
  const { default: React } = await import("react");
852
1038
  render(React.createElement(ConfigsList, { org }));
853
1039
  }
@@ -947,7 +1133,7 @@ async function main() {
947
1133
  const positionals = cli.input.slice(2);
948
1134
  const flagAssets = parseAssetInputs();
949
1135
  const contents = [...positionals, ...flagAssets];
950
- const { runAssetCheck } = await import("./check-GDKUHVQI.js");
1136
+ const { runAssetCheck } = await import("./check-P5JJJNEX.js");
951
1137
  await runAssetCheck({
952
1138
  contents,
953
1139
  json: jsonMode,
@@ -956,15 +1142,29 @@ async function main() {
956
1142
  });
957
1143
  break;
958
1144
  }
959
- const hint = subcommand ? suggest(subcommand, ["check"]) : null;
1145
+ if (subcommand === "list") {
1146
+ const { runAssetList } = await import("./list-PBAXQSL5.js");
1147
+ await runAssetList({
1148
+ type: cli.flags.type ?? cli.flags.assetType,
1149
+ status: cli.flags.assetStatus ?? cli.flags.status,
1150
+ from: cli.flags.from,
1151
+ to: cli.flags.to,
1152
+ perPage: cli.flags.perPage ?? cli.flags.limit,
1153
+ nextPage: cli.flags.nextPage,
1154
+ json: jsonMode,
1155
+ outputFormat: cliContext.outputFormat
1156
+ });
1157
+ break;
1158
+ }
1159
+ const hint = subcommand ? suggest(subcommand, ["check", "list"]) : null;
960
1160
  throw new Error(
961
- subcommand ? `Unknown subcommand: asset ${subcommand}${hint ? `. Did you mean "asset ${hint}"?` : ""}` : "Usage: chainpatrol asset check <content> [<content> ...]"
1161
+ subcommand ? `Unknown subcommand: asset ${subcommand}${hint ? `. Did you mean "asset ${hint}"?` : ""}` : "Usage: chainpatrol asset <check|list>"
962
1162
  );
963
1163
  }
964
1164
  case "detections": {
965
1165
  const org = await resolveOrg();
966
1166
  if (subcommand === "healthcheck") {
967
- const { runDetectionsHealthcheck } = await import("./healthcheck-EVQVPGWW.js");
1167
+ const { runDetectionsHealthcheck } = await import("./healthcheck-HZYEIIOR.js");
968
1168
  await runDetectionsHealthcheck({
969
1169
  org,
970
1170
  source: cli.flags.source,
@@ -979,7 +1179,7 @@ async function main() {
979
1179
  break;
980
1180
  }
981
1181
  if (subcommand === "validate") {
982
- const { runDetectionsValidate } = await import("./validate-UOVKEAJM.js");
1182
+ const { runDetectionsValidate } = await import("./validate-SM5DD7I2.js");
983
1183
  await runDetectionsValidate({
984
1184
  org,
985
1185
  source: cli.flags.source,
@@ -994,7 +1194,7 @@ async function main() {
994
1194
  break;
995
1195
  }
996
1196
  if (subcommand === "drift") {
997
- const { runDetectionsDrift } = await import("./drift-JKBHWWFU.js");
1197
+ const { runDetectionsDrift } = await import("./drift-T74V2C3J.js");
998
1198
  await runDetectionsDrift({
999
1199
  org,
1000
1200
  source: cli.flags.source,
@@ -1008,7 +1208,7 @@ async function main() {
1008
1208
  break;
1009
1209
  }
1010
1210
  if (subcommand === "run") {
1011
- const { runDetectionsRun } = await import("./run-5E5EC3MP.js");
1211
+ const { runDetectionsRun } = await import("./run-MSO6IXEV.js");
1012
1212
  await runDetectionsRun({
1013
1213
  org,
1014
1214
  configId: cli.flags.configId,
@@ -1021,13 +1221,37 @@ async function main() {
1021
1221
  });
1022
1222
  break;
1023
1223
  }
1224
+ if (subcommand === "list") {
1225
+ const { runDetectionsList } = await import("./list-QUFY4IP7.js");
1226
+ await runDetectionsList({
1227
+ org,
1228
+ cursor: cli.flags.cursor,
1229
+ limit: cli.flags.limit,
1230
+ query: cli.flags.search ?? cli.flags.query,
1231
+ from: cli.flags.from,
1232
+ to: cli.flags.to,
1233
+ sources: parseCsvList(cli.flags.source),
1234
+ confidence: parseCsvList(cli.flags.confidence),
1235
+ assetStatus: parseCsvList(cli.flags.assetStatus),
1236
+ assetType: parseCsvList(cli.flags.assetType),
1237
+ brandIds: parseBrandIds(),
1238
+ liveness: parseCsvList(cli.flags.liveness),
1239
+ watchlist: parseCsvList(cli.flags.watchlist),
1240
+ reported: parseCsvList(cli.flags.reported),
1241
+ countryCodes: parseCsvList(cli.flags.countryCode),
1242
+ onlyDeleted: cli.flags.onlyDeleted,
1243
+ json: jsonMode,
1244
+ outputFormat: cliContext.outputFormat
1245
+ });
1246
+ break;
1247
+ }
1024
1248
  if (subcommand === "configs") {
1025
1249
  if (action === "list") {
1026
1250
  await handleConfigsList(org);
1027
1251
  break;
1028
1252
  }
1029
1253
  if (action === "run") {
1030
- const { runDetectionsRun } = await import("./run-5E5EC3MP.js");
1254
+ const { runDetectionsRun } = await import("./run-MSO6IXEV.js");
1031
1255
  await runDetectionsRun({
1032
1256
  org,
1033
1257
  configId: cli.flags.configId,
@@ -1045,7 +1269,7 @@ async function main() {
1045
1269
  throw new Error("detections configs update requires --config-id");
1046
1270
  }
1047
1271
  const configPatch = getConfigPatchFromSetFlags();
1048
- const { runDetectionsConfigsUpdate } = await import("./configs-update-7X7657PB.js");
1272
+ const { runDetectionsConfigsUpdate } = await import("./configs-update-3ZVXGADV.js");
1049
1273
  await runDetectionsConfigsUpdate({
1050
1274
  org,
1051
1275
  configId: cli.flags.configId,
@@ -1064,15 +1288,22 @@ async function main() {
1064
1288
  break;
1065
1289
  }
1066
1290
  }
1067
- const hint = subcommand ? suggest(subcommand, ["healthcheck", "validate", "drift", "run", "configs"]) : null;
1291
+ const hint = subcommand ? suggest(subcommand, [
1292
+ "healthcheck",
1293
+ "validate",
1294
+ "drift",
1295
+ "run",
1296
+ "list",
1297
+ "configs"
1298
+ ]) : null;
1068
1299
  throw new Error(
1069
- subcommand ? `Unknown subcommand: detections ${subcommand}${hint ? `. Did you mean "detections ${hint}"?` : ""}` : "Usage: chainpatrol detections <healthcheck|validate|drift|run|configs>"
1300
+ subcommand ? `Unknown subcommand: detections ${subcommand}${hint ? `. Did you mean "detections ${hint}"?` : ""}` : "Usage: chainpatrol detections <healthcheck|validate|drift|run|list|configs>"
1070
1301
  );
1071
1302
  }
1072
1303
  case "metrics": {
1073
1304
  if (subcommand === "organization" || subcommand === "org") {
1074
1305
  const org2 = await tryResolveOrg();
1075
- const { runMetricsOrganization } = await import("./organization-MJRKWC4Z.js");
1306
+ const { runMetricsOrganization } = await import("./organization-IIIOSTHF.js");
1076
1307
  await runMetricsOrganization({
1077
1308
  org: org2,
1078
1309
  brandSlug: cli.flags.brandSlug,
@@ -1085,7 +1316,7 @@ async function main() {
1085
1316
  }
1086
1317
  const org = await resolveOrg();
1087
1318
  if (subcommand === "summary") {
1088
- const { runMetricsSummary } = await import("./summary-RVYQUKWV.js");
1319
+ const { runMetricsSummary } = await import("./summary-Y2LG6UJM.js");
1089
1320
  await runMetricsSummary({
1090
1321
  org,
1091
1322
  from: cli.flags.from,
@@ -1097,7 +1328,7 @@ async function main() {
1097
1328
  break;
1098
1329
  }
1099
1330
  if (subcommand === "found") {
1100
- const { runMetricsFound } = await import("./found-3WI4XQG4.js");
1331
+ const { runMetricsFound } = await import("./found-EVXJZGYX.js");
1101
1332
  await runMetricsFound({
1102
1333
  org,
1103
1334
  from: cli.flags.from,
@@ -1114,7 +1345,7 @@ async function main() {
1114
1345
  if (!by || !["day", "type", "brand"].includes(by)) {
1115
1346
  throw new Error("metrics breakdown requires --by <day|type|brand>");
1116
1347
  }
1117
- const { runMetricsBreakdown } = await import("./breakdown-MM5GSZKV.js");
1348
+ const { runMetricsBreakdown } = await import("./breakdown-KCTKQNDY.js");
1118
1349
  await runMetricsBreakdown({
1119
1350
  org,
1120
1351
  by,
@@ -1134,14 +1365,26 @@ async function main() {
1134
1365
  case "reports": {
1135
1366
  if (subcommand === "list") {
1136
1367
  const org = await resolveOrg();
1137
- const { runReportsList } = await import("./list-E5XNR2YG.js");
1368
+ const { runReportsList } = await import("./list-ZFPML3ZR.js");
1138
1369
  await runReportsList({
1139
1370
  org,
1140
1371
  limit: cli.flags.limit,
1141
1372
  cursor: cli.flags.cursor,
1142
1373
  status: cli.flags.status,
1143
1374
  searchQuery: cli.flags.search,
1375
+ reporterQuery: cli.flags.reporterQuery,
1144
1376
  reportedByCustomer: cli.flags.reportedByCustomer,
1377
+ excludeAutomation: cli.flags.excludeAutomation,
1378
+ onlyRejected: cli.flags.onlyRejected,
1379
+ reviewStatuses: parseCsvList(cli.flags.reviewStatus),
1380
+ assetTypes: parseCsvList(cli.flags.assetType),
1381
+ brandIds: parseBrandIds(),
1382
+ countryCodes: parseCsvList(cli.flags.countryCode),
1383
+ reviewedByUserId: cli.flags.reviewedByUserId,
1384
+ from: cli.flags.from,
1385
+ to: cli.flags.to,
1386
+ updatedFrom: cli.flags.updatedFrom,
1387
+ updatedTo: cli.flags.updatedTo,
1145
1388
  json: jsonMode,
1146
1389
  outputFormat: cliContext.outputFormat,
1147
1390
  explain: cliContext.explain
@@ -1150,7 +1393,7 @@ async function main() {
1150
1393
  }
1151
1394
  if (subcommand === "create") {
1152
1395
  const org = await tryResolveOrg();
1153
- const { runReportsCreate } = await import("./create-FL4QQTPN.js");
1396
+ const { runReportsCreate } = await import("./create-DFH2G7RH.js");
1154
1397
  await runReportsCreate({
1155
1398
  org,
1156
1399
  title: cli.flags.title,
@@ -1167,15 +1410,50 @@ async function main() {
1167
1410
  });
1168
1411
  break;
1169
1412
  }
1170
- const hint = subcommand ? suggest(subcommand, ["create", "list"]) : null;
1413
+ if (subcommand === "search") {
1414
+ const positionals = cli.input.slice(2);
1415
+ const flagAssets = parseAssetInputs();
1416
+ const assetContents = [...positionals, ...flagAssets];
1417
+ const { runReportsSearch } = await import("./search-WPSKQGUS.js");
1418
+ await runReportsSearch({
1419
+ assetContents,
1420
+ reportedByCustomer: cli.flags.reportedByCustomer,
1421
+ json: jsonMode,
1422
+ outputFormat: cliContext.outputFormat
1423
+ });
1424
+ break;
1425
+ }
1426
+ const hint = subcommand ? suggest(subcommand, ["create", "list", "search"]) : null;
1171
1427
  throw new Error(
1172
- subcommand ? `Unknown subcommand: reports ${subcommand}${hint ? `. Did you mean "reports ${hint}"?` : ""}` : "Usage: chainpatrol reports <create|list>"
1428
+ subcommand ? `Unknown subcommand: reports ${subcommand}${hint ? `. Did you mean "reports ${hint}"?` : ""}` : "Usage: chainpatrol reports <create|list|search>"
1429
+ );
1430
+ }
1431
+ case "threats": {
1432
+ if (subcommand === "list") {
1433
+ const { runThreatsList } = await import("./list-YCT6DYDI.js");
1434
+ await runThreatsList({
1435
+ query: cli.flags.query,
1436
+ from: cli.flags.from,
1437
+ to: cli.flags.to,
1438
+ assetType: parseCsvList(cli.flags.assetType),
1439
+ sortBy: cli.flags.sortBy,
1440
+ sortDirection: cli.flags.sortDirection,
1441
+ perPage: cli.flags.perPage ?? cli.flags.limit,
1442
+ nextPage: cli.flags.nextPage,
1443
+ json: jsonMode,
1444
+ outputFormat: cliContext.outputFormat
1445
+ });
1446
+ break;
1447
+ }
1448
+ const hint = subcommand ? suggest(subcommand, ["list"]) : null;
1449
+ throw new Error(
1450
+ subcommand ? `Unknown subcommand: threats ${subcommand}${hint ? `. Did you mean "threats ${hint}"?` : ""}` : "Usage: chainpatrol threats list [filters]"
1173
1451
  );
1174
1452
  }
1175
1453
  case "takedowns": {
1176
1454
  if (subcommand === "list") {
1177
1455
  const org = await tryResolveOrg();
1178
- const { runTakedownsList } = await import("./list-JPG2ZSR4.js");
1456
+ const { runTakedownsList } = await import("./list-WJQT2XLE.js");
1179
1457
  await runTakedownsList({
1180
1458
  org,
1181
1459
  query: cli.flags.query,
@@ -1184,6 +1462,12 @@ async function main() {
1184
1462
  assetType: parseCsvList(cli.flags.assetType),
1185
1463
  takedownStatus: parseCsvList(cli.flags.takedownStatus),
1186
1464
  livenessStatus: parseCsvList(cli.flags.livenessStatus),
1465
+ brandIds: parseBrandIds(),
1466
+ assigneeIds: parseIntList(cli.flags.assignee, "assignee"),
1467
+ startedFrom: cli.flags.startedFrom,
1468
+ startedTo: cli.flags.startedTo,
1469
+ hideAutomatedTakedowns: cli.flags.hideAutomatedTakedowns,
1470
+ hideAutomatedLivenessChecks: cli.flags.hideAutomatedLivenessChecks,
1187
1471
  sortBy: cli.flags.sortBy,
1188
1472
  sortDirection: cli.flags.sortDirection,
1189
1473
  perPage: cli.flags.perPage ?? cli.flags.limit,
@@ -1200,7 +1484,7 @@ async function main() {
1200
1484
  }
1201
1485
  case "queues": {
1202
1486
  if (subcommand === "snapshot") {
1203
- const { runQueuesSnapshot } = await import("./snapshot-3FUJICJJ.js");
1487
+ const { runQueuesSnapshot } = await import("./snapshot-ZWAHEG64.js");
1204
1488
  await runQueuesSnapshot({
1205
1489
  org: cli.flags.org,
1206
1490
  all: cli.flags.all,
@@ -1218,7 +1502,7 @@ async function main() {
1218
1502
  }
1219
1503
  case "orgs": {
1220
1504
  if (subcommand === "list") {
1221
- const { runOrgsList } = await import("./list-XDGU6SJQ.js");
1505
+ const { runOrgsList } = await import("./list-YRJPN4PI.js");
1222
1506
  await runOrgsList({
1223
1507
  query: cli.flags.query,
1224
1508
  subscriptionStatus: cli.flags.subscriptionStatus,
@@ -1231,14 +1515,49 @@ async function main() {
1231
1515
  });
1232
1516
  break;
1233
1517
  }
1234
- const hint = subcommand ? suggest(subcommand, ["list"]) : null;
1518
+ if (subcommand === "assets") {
1519
+ if (action === "list") {
1520
+ const { runOrgsAssetsList } = await import("./list-EIVPGMWJ.js");
1521
+ await runOrgsAssetsList({
1522
+ type: cli.flags.type ?? cli.flags.assetType,
1523
+ groupId: cli.flags.groupId,
1524
+ query: cli.flags.query ?? cli.flags.search,
1525
+ perPage: cli.flags.perPage ?? cli.flags.limit,
1526
+ nextPage: cli.flags.nextPage,
1527
+ json: jsonMode,
1528
+ outputFormat: cliContext.outputFormat
1529
+ });
1530
+ break;
1531
+ }
1532
+ throw new Error("Usage: chainpatrol orgs assets list [filters]");
1533
+ }
1534
+ if (subcommand === "asset-groups") {
1535
+ if (action === "list") {
1536
+ const { runOrgsAssetGroupsList } = await import("./list-I7SBGA52.js");
1537
+ await runOrgsAssetGroupsList({
1538
+ json: jsonMode,
1539
+ outputFormat: cliContext.outputFormat
1540
+ });
1541
+ break;
1542
+ }
1543
+ throw new Error("Usage: chainpatrol orgs asset-groups list");
1544
+ }
1545
+ const hint = subcommand ? suggest(subcommand, ["list", "assets", "asset-groups"]) : null;
1235
1546
  throw new Error(
1236
- subcommand ? `Unknown subcommand: orgs ${subcommand}${hint ? `. Did you mean "orgs ${hint}"?` : ""}` : "Usage: chainpatrol orgs list [--subscription-status <list>] [--service-active <list>] [--service-automated <list>] ..."
1547
+ subcommand ? `Unknown subcommand: orgs ${subcommand}${hint ? `. Did you mean "orgs ${hint}"?` : ""}` : "Usage: chainpatrol orgs <list|assets list|asset-groups list> [filters]"
1237
1548
  );
1238
1549
  }
1550
+ case "whoami": {
1551
+ const { runWhoami } = await import("./whoami-DH5HVLFN.js");
1552
+ await runWhoami({
1553
+ json: jsonMode,
1554
+ outputFormat: cliContext.outputFormat
1555
+ });
1556
+ break;
1557
+ }
1239
1558
  case "healthchecks": {
1240
1559
  if (subcommand === "list") {
1241
- const { runHealthchecksList } = await import("./list-BLNIE4GL.js");
1560
+ const { runHealthchecksList } = await import("./list-23QQYAV5.js");
1242
1561
  await runHealthchecksList({
1243
1562
  json: jsonMode,
1244
1563
  outputFormat: cliContext.outputFormat
@@ -1252,7 +1571,7 @@ async function main() {
1252
1571
  thresholds.minResults = cli.flags.minResults;
1253
1572
  if (cli.flags.lookbackHours !== void 0)
1254
1573
  thresholds.lookbackHours = cli.flags.lookbackHours;
1255
- const { runHealthchecksRun } = await import("./run-2YZZGZYN.js");
1574
+ const { runHealthchecksRun } = await import("./run-CJGN6TX4.js");
1256
1575
  await runHealthchecksRun({
1257
1576
  org,
1258
1577
  id: action,
@@ -1270,7 +1589,7 @@ async function main() {
1270
1589
  }
1271
1590
  case "presets": {
1272
1591
  if (subcommand === "list") {
1273
- const { runPresetsList } = await import("./list-ULHPOUJV.js");
1592
+ const { runPresetsList } = await import("./list-WX5G3IOF.js");
1274
1593
  await runPresetsList({ outputFormat: cliContext.outputFormat });
1275
1594
  break;
1276
1595
  }
@@ -1281,7 +1600,7 @@ async function main() {
1281
1600
  );
1282
1601
  }
1283
1602
  const org = await resolveOrg();
1284
- const { runPresetsRun } = await import("./run-EUVRC72M.js");
1603
+ const { runPresetsRun } = await import("./run-BHEXWBAS.js");
1285
1604
  await runPresetsRun({
1286
1605
  presetId: action,
1287
1606
  org,
@@ -1298,17 +1617,17 @@ async function main() {
1298
1617
  case "setup":
1299
1618
  case "install":
1300
1619
  case "i": {
1301
- const { setupSkill } = await import("./setup-skill-HAENFIFQ.js");
1620
+ const { setupSkill } = await import("./setup-skill-FA4STSGA.js");
1302
1621
  setupSkill({ json: jsonMode, cloud: cli.flags.cloud });
1303
1622
  break;
1304
1623
  }
1305
1624
  case "uninstall": {
1306
- const { uninstallSkill } = await import("./setup-skill-HAENFIFQ.js");
1625
+ const { uninstallSkill } = await import("./setup-skill-FA4STSGA.js");
1307
1626
  uninstallSkill({ json: jsonMode });
1308
1627
  break;
1309
1628
  }
1310
1629
  case "completions": {
1311
- const { printCompletions } = await import("./completions-62OW3B3Y.js");
1630
+ const { printCompletions } = await import("./completions-6C6KG5DH.js");
1312
1631
  printCompletions(subcommand);
1313
1632
  break;
1314
1633
  }