@hyperline/cli 0.1.0-build.1.ed7561b → 0.1.0-build.1.ed8c065

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.
@@ -39223,6 +39223,1023 @@ Examples:
39223
39223
  });
39224
39224
  }
39225
39225
 
39226
+ // build/commands/generated/agents.js
39227
+ function registerAgentsCommands(parent) {
39228
+ const resource = parent.command("agents").description("Manage agents");
39229
+ resource.command("list-agent-plans").description(`List AI agent billing plans: workspace-level offers carrying a billing mode (wallet/credits/windows), rate card, allowance windows, markups and per-seat credit grants. Filter by mode; paginated with take/skip.`).option("--mode <value>", `mode`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
39230
+ Examples:
39231
+ hyperline agents list-agent-plans
39232
+ hyperline agents list-agent-plans --mode <mode> --take <take>`).action(async (opts) => {
39233
+ const ctx = resource.parent?.opts()._ctx;
39234
+ if (!ctx) {
39235
+ process.stderr.write("Error: Not authenticated\n");
39236
+ process.exit(1);
39237
+ }
39238
+ const args = {};
39239
+ if (opts.mode !== void 0)
39240
+ args.mode = opts.mode;
39241
+ if (opts.take !== void 0)
39242
+ args.take = Number(opts.take);
39243
+ if (opts.skip !== void 0)
39244
+ args.skip = Number(opts.skip);
39245
+ await ctx.execute({
39246
+ method: "GET",
39247
+ path: "/v1/agents/plans",
39248
+ args,
39249
+ queryParamKeys: ["mode", "take", "skip"]
39250
+ });
39251
+ });
39252
+ resource.command("create-agent-plan").description(`Create an AI agent billing plan: name, billing mode (wallet/credits/windows), rate card reference, allowance windows, markups, per-seat credit grants and overage stance. Past-limit usage is priced EITHER by overage_markup_percent over the base rates OR by overage_rate_card_id, a currency rate card whose own rates are the overage price \u2014 never both. Metered overage mints the plan's invoice container.`).requiredOption("--name <value>", `name`).option("--rate-card-id <value>", `rate_card_id`).option("--overage-mode <value>", `overage_mode`).option("--markup-percent <value>", `markup_percent`).option("--overage-markup-percent <value>", `overage_markup_percent`).option("--overage-rate-card-id <value>", `overage_rate_card_id`).option("--windows <json>", `windows`).option("--per-seat-credits <value>", `per_seat_credits`).option("--grant-rollover-enabled", `grant_rollover_enabled`).option("--settlement-interval-minutes <number>", `settlement_interval_minutes`).option("--settlement-schedule <value>", `settlement_schedule`).requiredOption("--mode <value>", `mode`).addHelpText("after", `
39253
+ Examples:
39254
+ hyperline agents create-agent-plan --name <name> --mode <mode>
39255
+ hyperline agents create-agent-plan --name <name> --mode <mode> --rate-card-id <rate_card_id> --overage-mode <overage_mode>
39256
+ hyperline agents create-agent-plan --name <name> --mode <mode> --output json`).action(async (opts) => {
39257
+ const ctx = resource.parent?.opts()._ctx;
39258
+ if (!ctx) {
39259
+ process.stderr.write("Error: Not authenticated\n");
39260
+ process.exit(1);
39261
+ }
39262
+ const args = {};
39263
+ if (opts.name !== void 0)
39264
+ args.name = opts.name;
39265
+ if (opts.rateCardId !== void 0)
39266
+ args.rate_card_id = opts.rateCardId;
39267
+ if (opts.overageMode !== void 0)
39268
+ args.overage_mode = opts.overageMode;
39269
+ if (opts.markupPercent !== void 0)
39270
+ args.markup_percent = opts.markupPercent;
39271
+ if (opts.overageMarkupPercent !== void 0)
39272
+ args.overage_markup_percent = opts.overageMarkupPercent;
39273
+ if (opts.overageRateCardId !== void 0)
39274
+ args.overage_rate_card_id = opts.overageRateCardId;
39275
+ if (opts.perSeatCredits !== void 0)
39276
+ args.per_seat_credits = opts.perSeatCredits;
39277
+ if (opts.settlementSchedule !== void 0)
39278
+ args.settlement_schedule = opts.settlementSchedule;
39279
+ if (opts.mode !== void 0)
39280
+ args.mode = opts.mode;
39281
+ if (opts.settlementIntervalMinutes !== void 0)
39282
+ args.settlement_interval_minutes = Number(opts.settlementIntervalMinutes);
39283
+ if (opts.grantRolloverEnabled !== void 0)
39284
+ args.grant_rollover_enabled = true;
39285
+ if (opts.windows !== void 0)
39286
+ args.windows = JSON.parse(opts.windows);
39287
+ await ctx.execute({
39288
+ method: "POST",
39289
+ path: "/v1/agents/plans",
39290
+ args,
39291
+ queryParamKeys: []
39292
+ });
39293
+ });
39294
+ resource.command("get-agent-plan").description(`Get one AI agent billing plan by id, with its embedded rate card, window definitions, markups, per-seat grants and minted catalog object ids.`).requiredOption("--plan-id <value>", `plan_id parameter`).addHelpText("after", `
39295
+ Examples:
39296
+ hyperline agents get-agent-plan --plan-id <plan_id>`).action(async (opts) => {
39297
+ const ctx = resource.parent?.opts()._ctx;
39298
+ if (!ctx) {
39299
+ process.stderr.write("Error: Not authenticated\n");
39300
+ process.exit(1);
39301
+ }
39302
+ const args = {};
39303
+ if (opts.planId !== void 0)
39304
+ args.plan_id = opts.planId;
39305
+ await ctx.execute({
39306
+ method: "GET",
39307
+ path: "/v1/agents/plans/{plan_id}",
39308
+ args,
39309
+ queryParamKeys: []
39310
+ });
39311
+ });
39312
+ resource.command("replace-agent-plan").description(`Replace an AI agent billing plan (whole-row semantics). Changes take effect on the next call for every customer on the plan; mode is immutable. Overage is priced by overage_markup_percent or by overage_rate_card_id, never both.`).requiredOption("--plan-id <value>", `plan_id parameter`).requiredOption("--name <value>", `name`).option("--rate-card-id <value>", `rate_card_id`).option("--overage-mode <value>", `overage_mode`).option("--markup-percent <value>", `markup_percent`).option("--overage-markup-percent <value>", `overage_markup_percent`).option("--overage-rate-card-id <value>", `overage_rate_card_id`).option("--windows <json>", `windows`).option("--per-seat-credits <value>", `per_seat_credits`).option("--grant-rollover-enabled", `grant_rollover_enabled`).option("--settlement-interval-minutes <number>", `settlement_interval_minutes`).option("--settlement-schedule <value>", `settlement_schedule`).addHelpText("after", `
39313
+ Examples:
39314
+ hyperline agents replace-agent-plan --plan-id <plan_id> --name <name>
39315
+ hyperline agents replace-agent-plan --plan-id <plan_id> --name <name> --rate-card-id <rate_card_id> --overage-mode <overage_mode>
39316
+ hyperline agents replace-agent-plan --plan-id <plan_id> --name <name> --output json`).action(async (opts) => {
39317
+ const ctx = resource.parent?.opts()._ctx;
39318
+ if (!ctx) {
39319
+ process.stderr.write("Error: Not authenticated\n");
39320
+ process.exit(1);
39321
+ }
39322
+ const args = {};
39323
+ if (opts.planId !== void 0)
39324
+ args.plan_id = opts.planId;
39325
+ if (opts.name !== void 0)
39326
+ args.name = opts.name;
39327
+ if (opts.rateCardId !== void 0)
39328
+ args.rate_card_id = opts.rateCardId;
39329
+ if (opts.overageMode !== void 0)
39330
+ args.overage_mode = opts.overageMode;
39331
+ if (opts.markupPercent !== void 0)
39332
+ args.markup_percent = opts.markupPercent;
39333
+ if (opts.overageMarkupPercent !== void 0)
39334
+ args.overage_markup_percent = opts.overageMarkupPercent;
39335
+ if (opts.overageRateCardId !== void 0)
39336
+ args.overage_rate_card_id = opts.overageRateCardId;
39337
+ if (opts.perSeatCredits !== void 0)
39338
+ args.per_seat_credits = opts.perSeatCredits;
39339
+ if (opts.settlementSchedule !== void 0)
39340
+ args.settlement_schedule = opts.settlementSchedule;
39341
+ if (opts.settlementIntervalMinutes !== void 0)
39342
+ args.settlement_interval_minutes = Number(opts.settlementIntervalMinutes);
39343
+ if (opts.grantRolloverEnabled !== void 0)
39344
+ args.grant_rollover_enabled = true;
39345
+ if (opts.windows !== void 0)
39346
+ args.windows = JSON.parse(opts.windows);
39347
+ await ctx.execute({
39348
+ method: "PUT",
39349
+ path: "/v1/agents/plans/{plan_id}",
39350
+ args,
39351
+ queryParamKeys: []
39352
+ });
39353
+ });
39354
+ resource.command("delete-agent-plan").description(`Delete an AI agent billing plan. Refused (409, plan_in_use) while any customer is still attached to it.`).requiredOption("--plan-id <value>", `plan_id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
39355
+ Examples:
39356
+ hyperline agents delete-agent-plan --plan-id <plan_id>
39357
+ hyperline agents delete-agent-plan --plan-id <plan_id> --output json`).action(async (opts) => {
39358
+ const ctx = resource.parent?.opts()._ctx;
39359
+ if (!ctx) {
39360
+ process.stderr.write("Error: Not authenticated\n");
39361
+ process.exit(1);
39362
+ }
39363
+ const args = {};
39364
+ if (opts.planId !== void 0)
39365
+ args.plan_id = opts.planId;
39366
+ if (!opts.yes) {
39367
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
39368
+ if (!confirmed) {
39369
+ process.stdout.write("Aborted.\n");
39370
+ return;
39371
+ }
39372
+ }
39373
+ await ctx.execute({
39374
+ method: "DELETE",
39375
+ path: "/v1/agents/plans/{plan_id}",
39376
+ args,
39377
+ queryParamKeys: []
39378
+ });
39379
+ });
39380
+ resource.command("get-agent-default-plan").description(`Get the workspace's default AI agent billing plan marker (plan id and auto_apply flag). 404 when none is set.`).addHelpText("after", `
39381
+ Examples:
39382
+ hyperline agents get-agent-default-plan`).action(async (_opts) => {
39383
+ const ctx = resource.parent?.opts()._ctx;
39384
+ if (!ctx) {
39385
+ process.stderr.write("Error: Not authenticated\n");
39386
+ process.exit(1);
39387
+ }
39388
+ const args = {};
39389
+ await ctx.execute({
39390
+ method: "GET",
39391
+ path: "/v1/agents/default-plan",
39392
+ args,
39393
+ queryParamKeys: []
39394
+ });
39395
+ });
39396
+ resource.command("set-agent-default-plan").description(`Mark one plan as the workspace's default AI agent billing plan (body: plan_id, optional auto_apply). Replaces the previous marker; 404 when the plan is not this workspace's.`).requiredOption("--plan-id <value>", `plan_id`).option("--auto-apply", `auto_apply`).addHelpText("after", `
39397
+ Examples:
39398
+ hyperline agents set-agent-default-plan --plan-id <plan_id>
39399
+ hyperline agents set-agent-default-plan --plan-id <plan_id> --auto-apply
39400
+ hyperline agents set-agent-default-plan --plan-id <plan_id> --output json`).action(async (opts) => {
39401
+ const ctx = resource.parent?.opts()._ctx;
39402
+ if (!ctx) {
39403
+ process.stderr.write("Error: Not authenticated\n");
39404
+ process.exit(1);
39405
+ }
39406
+ const args = {};
39407
+ if (opts.planId !== void 0)
39408
+ args.plan_id = opts.planId;
39409
+ if (opts.autoApply !== void 0)
39410
+ args.auto_apply = true;
39411
+ await ctx.execute({
39412
+ method: "PUT",
39413
+ path: "/v1/agents/default-plan",
39414
+ args,
39415
+ queryParamKeys: []
39416
+ });
39417
+ });
39418
+ resource.command("clear-agent-default-plan").description(`Clear the workspace's default AI agent billing plan marker. The plan itself is untouched. 404 when none is set.`).option("--yes", "Skip confirmation").addHelpText("after", `
39419
+ Examples:
39420
+ hyperline agents clear-agent-default-plan
39421
+ hyperline agents clear-agent-default-plan --output json`).action(async (opts) => {
39422
+ const ctx = resource.parent?.opts()._ctx;
39423
+ if (!ctx) {
39424
+ process.stderr.write("Error: Not authenticated\n");
39425
+ process.exit(1);
39426
+ }
39427
+ const args = {};
39428
+ if (!opts.yes) {
39429
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
39430
+ if (!confirmed) {
39431
+ process.stdout.write("Aborted.\n");
39432
+ return;
39433
+ }
39434
+ }
39435
+ await ctx.execute({
39436
+ method: "DELETE",
39437
+ path: "/v1/agents/default-plan",
39438
+ args,
39439
+ queryParamKeys: []
39440
+ });
39441
+ });
39442
+ resource.command("list-agent-rate-cards").description(`List AI rate cards: named pricing row sets in credits, window units or currency. Shows what plans/policies/products depend on each. Filter by denomination, currency or name search; paginated with take/skip.`).option("--denomination <value>", `denomination`).option("--currency <value>", `currency`).option("--search <value>", `search`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
39443
+ Examples:
39444
+ hyperline agents list-agent-rate-cards
39445
+ hyperline agents list-agent-rate-cards --denomination <denomination> --currency <currency>`).action(async (opts) => {
39446
+ const ctx = resource.parent?.opts()._ctx;
39447
+ if (!ctx) {
39448
+ process.stderr.write("Error: Not authenticated\n");
39449
+ process.exit(1);
39450
+ }
39451
+ const args = {};
39452
+ if (opts.denomination !== void 0)
39453
+ args.denomination = opts.denomination;
39454
+ if (opts.currency !== void 0)
39455
+ args.currency = opts.currency;
39456
+ if (opts.search !== void 0)
39457
+ args.search = opts.search;
39458
+ if (opts.take !== void 0)
39459
+ args.take = Number(opts.take);
39460
+ if (opts.skip !== void 0)
39461
+ args.skip = Number(opts.skip);
39462
+ await ctx.execute({
39463
+ method: "GET",
39464
+ path: "/v1/agents/rate-cards",
39465
+ args,
39466
+ queryParamKeys: ["denomination", "currency", "search", "take", "skip"]
39467
+ });
39468
+ });
39469
+ resource.command("create-agent-rate-card").description(`Create an AI rate card with llm rows (per-1M input/output token rates) and item rows (per-unit rates), a denomination (credits/units/currency) and an optional USD fallback conversion.`).requiredOption("--name <value>", `name`).option("--description <value>", `description`).option("--fallback-per-usd <value>", `fallback_per_usd`).requiredOption("--rows <json>", `rows`).requiredOption("--denomination <value>", `denomination`).option("--currency <value>", `currency`).addHelpText("after", `
39470
+ Examples:
39471
+ hyperline agents create-agent-rate-card --name <name> --rows <rows> --denomination <denomination>
39472
+ hyperline agents create-agent-rate-card --name <name> --rows <rows> --denomination <denomination> --description <description> --fallback-per-usd <fallback_per_usd>
39473
+ hyperline agents create-agent-rate-card --name <name> --rows <rows> --denomination <denomination> --output json`).action(async (opts) => {
39474
+ const ctx = resource.parent?.opts()._ctx;
39475
+ if (!ctx) {
39476
+ process.stderr.write("Error: Not authenticated\n");
39477
+ process.exit(1);
39478
+ }
39479
+ const args = {};
39480
+ if (opts.name !== void 0)
39481
+ args.name = opts.name;
39482
+ if (opts.description !== void 0)
39483
+ args.description = opts.description;
39484
+ if (opts.fallbackPerUsd !== void 0)
39485
+ args.fallback_per_usd = opts.fallbackPerUsd;
39486
+ if (opts.denomination !== void 0)
39487
+ args.denomination = opts.denomination;
39488
+ if (opts.currency !== void 0)
39489
+ args.currency = opts.currency;
39490
+ if (opts.rows !== void 0)
39491
+ args.rows = JSON.parse(opts.rows);
39492
+ await ctx.execute({
39493
+ method: "POST",
39494
+ path: "/v1/agents/rate-cards",
39495
+ args,
39496
+ queryParamKeys: []
39497
+ });
39498
+ });
39499
+ resource.command("get-agent-rate-card").description(`Get one AI rate card by id with all its pricing rows and usage counts (plans, policies, credit product).`).requiredOption("--rate-card-id <value>", `rate_card_id parameter`).addHelpText("after", `
39500
+ Examples:
39501
+ hyperline agents get-agent-rate-card --rate-card-id <rate_card_id>`).action(async (opts) => {
39502
+ const ctx = resource.parent?.opts()._ctx;
39503
+ if (!ctx) {
39504
+ process.stderr.write("Error: Not authenticated\n");
39505
+ process.exit(1);
39506
+ }
39507
+ const args = {};
39508
+ if (opts.rateCardId !== void 0)
39509
+ args.rate_card_id = opts.rateCardId;
39510
+ await ctx.execute({
39511
+ method: "GET",
39512
+ path: "/v1/agents/rate-cards/{rate_card_id}",
39513
+ args,
39514
+ queryParamKeys: []
39515
+ });
39516
+ });
39517
+ resource.command("replace-agent-rate-card").description(`Replace an AI rate card's rows, name, description and USD fallback (whole-card semantics). Denomination and currency are immutable.`).requiredOption("--rate-card-id <value>", `rate_card_id parameter`).requiredOption("--name <value>", `name`).option("--description <value>", `description`).option("--fallback-per-usd <value>", `fallback_per_usd`).requiredOption("--rows <json>", `rows`).addHelpText("after", `
39518
+ Examples:
39519
+ hyperline agents replace-agent-rate-card --rate-card-id <rate_card_id> --name <name> --rows <rows>
39520
+ hyperline agents replace-agent-rate-card --rate-card-id <rate_card_id> --name <name> --rows <rows> --description <description> --fallback-per-usd <fallback_per_usd>
39521
+ hyperline agents replace-agent-rate-card --rate-card-id <rate_card_id> --name <name> --rows <rows> --output json`).action(async (opts) => {
39522
+ const ctx = resource.parent?.opts()._ctx;
39523
+ if (!ctx) {
39524
+ process.stderr.write("Error: Not authenticated\n");
39525
+ process.exit(1);
39526
+ }
39527
+ const args = {};
39528
+ if (opts.rateCardId !== void 0)
39529
+ args.rate_card_id = opts.rateCardId;
39530
+ if (opts.name !== void 0)
39531
+ args.name = opts.name;
39532
+ if (opts.description !== void 0)
39533
+ args.description = opts.description;
39534
+ if (opts.fallbackPerUsd !== void 0)
39535
+ args.fallback_per_usd = opts.fallbackPerUsd;
39536
+ if (opts.rows !== void 0)
39537
+ args.rows = JSON.parse(opts.rows);
39538
+ await ctx.execute({
39539
+ method: "PUT",
39540
+ path: "/v1/agents/rate-cards/{rate_card_id}",
39541
+ args,
39542
+ queryParamKeys: []
39543
+ });
39544
+ });
39545
+ resource.command("delete-agent-rate-card").description(`Delete an AI rate card. Refused (409, rate_card_in_use) while any plan, credit product or customer policy still uses it.`).requiredOption("--rate-card-id <value>", `rate_card_id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
39546
+ Examples:
39547
+ hyperline agents delete-agent-rate-card --rate-card-id <rate_card_id>
39548
+ hyperline agents delete-agent-rate-card --rate-card-id <rate_card_id> --output json`).action(async (opts) => {
39549
+ const ctx = resource.parent?.opts()._ctx;
39550
+ if (!ctx) {
39551
+ process.stderr.write("Error: Not authenticated\n");
39552
+ process.exit(1);
39553
+ }
39554
+ const args = {};
39555
+ if (opts.rateCardId !== void 0)
39556
+ args.rate_card_id = opts.rateCardId;
39557
+ if (!opts.yes) {
39558
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
39559
+ if (!confirmed) {
39560
+ process.stdout.write("Aborted.\n");
39561
+ return;
39562
+ }
39563
+ }
39564
+ await ctx.execute({
39565
+ method: "DELETE",
39566
+ path: "/v1/agents/rate-cards/{rate_card_id}",
39567
+ args,
39568
+ queryParamKeys: []
39569
+ });
39570
+ });
39571
+ resource.command("list-agent-credit-products").description(`List the credit products AI agent usage can draw down, with their purchasable packs and default rate cards. Customer pot balances live on the customer credits endpoints.`).addHelpText("after", `
39572
+ Examples:
39573
+ hyperline agents list-agent-credit-products`).action(async (_opts) => {
39574
+ const ctx = resource.parent?.opts()._ctx;
39575
+ if (!ctx) {
39576
+ process.stderr.write("Error: Not authenticated\n");
39577
+ process.exit(1);
39578
+ }
39579
+ const args = {};
39580
+ await ctx.execute({
39581
+ method: "GET",
39582
+ path: "/v1/agents/credit-products",
39583
+ args,
39584
+ queryParamKeys: []
39585
+ });
39586
+ });
39587
+ resource.command("list-agent-cost-catalog").description(`List the AI cost catalog: registry model prices merged with this workspace's negotiated overrides, its own custom cost items (source custom), and the unpriced pairs its telemetry has carried (source unlisted). Rates are USD decimal strings. Pass enabled_only=true for just the enabled catalog.`).option("--enabled-only <value>", `enabled_only`).addHelpText("after", `
39588
+ Examples:
39589
+ hyperline agents list-agent-cost-catalog
39590
+ hyperline agents list-agent-cost-catalog --enabled-only <enabled_only>`).action(async (opts) => {
39591
+ const ctx = resource.parent?.opts()._ctx;
39592
+ if (!ctx) {
39593
+ process.stderr.write("Error: Not authenticated\n");
39594
+ process.exit(1);
39595
+ }
39596
+ const args = {};
39597
+ if (opts.enabledOnly !== void 0)
39598
+ args.enabled_only = opts.enabledOnly;
39599
+ await ctx.execute({
39600
+ method: "GET",
39601
+ path: "/v1/agents/cost-catalog",
39602
+ args,
39603
+ queryParamKeys: ["enabled_only"]
39604
+ });
39605
+ });
39606
+ resource.command("create-agent-cost-catalog-item").description(`Create a custom AI cost item so a non-LLM vendor call is priced instead of landing unpriced at $0. provider/item must match hyperline.cost({ vendor, item }) verbatim and each dimensions[].key must match the unit the SDK sends. Re-creating an existing open item returns it unchanged (200); a pair the global registry already prices is refused \u2014 use the overrides endpoint for that.`).requiredOption("--provider <value>", `provider`).requiredOption("--item <value>", `item`).requiredOption("--dimensions <json>", `dimensions`).addHelpText("after", `
39607
+ Examples:
39608
+ hyperline agents create-agent-cost-catalog-item --provider <provider> --item <item> --dimensions <dimensions>
39609
+ hyperline agents create-agent-cost-catalog-item --provider <provider> --item <item> --dimensions <dimensions> --output json`).action(async (opts) => {
39610
+ const ctx = resource.parent?.opts()._ctx;
39611
+ if (!ctx) {
39612
+ process.stderr.write("Error: Not authenticated\n");
39613
+ process.exit(1);
39614
+ }
39615
+ const args = {};
39616
+ if (opts.provider !== void 0)
39617
+ args.provider = opts.provider;
39618
+ if (opts.item !== void 0)
39619
+ args.item = opts.item;
39620
+ if (opts.dimensions !== void 0)
39621
+ args.dimensions = JSON.parse(opts.dimensions);
39622
+ await ctx.execute({
39623
+ method: "POST",
39624
+ path: "/v1/agents/cost-catalog/items",
39625
+ args,
39626
+ queryParamKeys: []
39627
+ });
39628
+ });
39629
+ resource.command("delete-agent-cost-catalog-item").description(`Close a custom AI cost item by its custom_item_id. History is kept; new calls on that pair go back to unpriced. An override id passed here is a 404.`).requiredOption("--item-id <value>", `item_id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
39630
+ Examples:
39631
+ hyperline agents delete-agent-cost-catalog-item --item-id <item_id>
39632
+ hyperline agents delete-agent-cost-catalog-item --item-id <item_id> --output json`).action(async (opts) => {
39633
+ const ctx = resource.parent?.opts()._ctx;
39634
+ if (!ctx) {
39635
+ process.stderr.write("Error: Not authenticated\n");
39636
+ process.exit(1);
39637
+ }
39638
+ const args = {};
39639
+ if (opts.itemId !== void 0)
39640
+ args.item_id = opts.itemId;
39641
+ if (!opts.yes) {
39642
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
39643
+ if (!confirmed) {
39644
+ process.stdout.write("Aborted.\n");
39645
+ return;
39646
+ }
39647
+ }
39648
+ await ctx.execute({
39649
+ method: "DELETE",
39650
+ path: "/v1/agents/cost-catalog/items/{item_id}",
39651
+ args,
39652
+ queryParamKeys: []
39653
+ });
39654
+ });
39655
+ resource.command("upsert-agent-cost-catalog-override").description(`Set this workspace's negotiated price for a registry AI model (input/output/cached/cache-write USD per 1M tokens, plus optional dimensions). Replaces any open override immediately; historical calls keep their original rate. A pair the registry does not know is refused \u2014 create a custom cost item instead.`).requiredOption("--provider <value>", `provider`).requiredOption("--model <value>", `model`).requiredOption("--input-per-m-tokens <value>", `input_per_m_tokens`).requiredOption("--output-per-m-tokens <value>", `output_per_m_tokens`).option("--cached-input-per-m-tokens <value>", `cached_input_per_m_tokens`).option("--cache-write-per-m-tokens <value>", `cache_write_per_m_tokens`).option("--dimensions <json>", `dimensions`).addHelpText("after", `
39656
+ Examples:
39657
+ hyperline agents upsert-agent-cost-catalog-override --provider <provider> --model <model> --input-per-m-tokens <input_per_m_tokens> --output-per-m-tokens <output_per_m_tokens>
39658
+ hyperline agents upsert-agent-cost-catalog-override --provider <provider> --model <model> --input-per-m-tokens <input_per_m_tokens> --output-per-m-tokens <output_per_m_tokens> --cached-input-per-m-tokens <cached_input_per_m_tokens> --cache-write-per-m-tokens <cache_write_per_m_tokens>
39659
+ hyperline agents upsert-agent-cost-catalog-override --provider <provider> --model <model> --input-per-m-tokens <input_per_m_tokens> --output-per-m-tokens <output_per_m_tokens> --output json`).action(async (opts) => {
39660
+ const ctx = resource.parent?.opts()._ctx;
39661
+ if (!ctx) {
39662
+ process.stderr.write("Error: Not authenticated\n");
39663
+ process.exit(1);
39664
+ }
39665
+ const args = {};
39666
+ if (opts.provider !== void 0)
39667
+ args.provider = opts.provider;
39668
+ if (opts.model !== void 0)
39669
+ args.model = opts.model;
39670
+ if (opts.inputPerMTokens !== void 0)
39671
+ args.input_per_m_tokens = opts.inputPerMTokens;
39672
+ if (opts.outputPerMTokens !== void 0)
39673
+ args.output_per_m_tokens = opts.outputPerMTokens;
39674
+ if (opts.cachedInputPerMTokens !== void 0)
39675
+ args.cached_input_per_m_tokens = opts.cachedInputPerMTokens;
39676
+ if (opts.cacheWritePerMTokens !== void 0)
39677
+ args.cache_write_per_m_tokens = opts.cacheWritePerMTokens;
39678
+ if (opts.dimensions !== void 0)
39679
+ args.dimensions = JSON.parse(opts.dimensions);
39680
+ await ctx.execute({
39681
+ method: "PUT",
39682
+ path: "/v1/agents/cost-catalog/overrides",
39683
+ args,
39684
+ queryParamKeys: []
39685
+ });
39686
+ });
39687
+ resource.command("delete-agent-cost-catalog-override").description(`Close this workspace's negotiated price override by its override.id; pricing falls back to the global registry rate. A custom cost item id passed here is a 404.`).requiredOption("--override-id <value>", `override_id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
39688
+ Examples:
39689
+ hyperline agents delete-agent-cost-catalog-override --override-id <override_id>
39690
+ hyperline agents delete-agent-cost-catalog-override --override-id <override_id> --output json`).action(async (opts) => {
39691
+ const ctx = resource.parent?.opts()._ctx;
39692
+ if (!ctx) {
39693
+ process.stderr.write("Error: Not authenticated\n");
39694
+ process.exit(1);
39695
+ }
39696
+ const args = {};
39697
+ if (opts.overrideId !== void 0)
39698
+ args.override_id = opts.overrideId;
39699
+ if (!opts.yes) {
39700
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
39701
+ if (!confirmed) {
39702
+ process.stdout.write("Aborted.\n");
39703
+ return;
39704
+ }
39705
+ }
39706
+ await ctx.execute({
39707
+ method: "DELETE",
39708
+ path: "/v1/agents/cost-catalog/overrides/{override_id}",
39709
+ args,
39710
+ queryParamKeys: []
39711
+ });
39712
+ });
39713
+ resource.command("list-agent-customer-policies").description(`List all AI billing policies (scopes) for one customer: the default shared pool plus per-agent overrides. Accepts Hyperline or external customer ids.`).requiredOption("--customer-id <value>", `customer_id parameter`).addHelpText("after", `
39714
+ Examples:
39715
+ hyperline agents list-agent-customer-policies --customer-id <customer_id>`).action(async (opts) => {
39716
+ const ctx = resource.parent?.opts()._ctx;
39717
+ if (!ctx) {
39718
+ process.stderr.write("Error: Not authenticated\n");
39719
+ process.exit(1);
39720
+ }
39721
+ const args = {};
39722
+ if (opts.customerId !== void 0)
39723
+ args.customer_id = opts.customerId;
39724
+ await ctx.execute({
39725
+ method: "GET",
39726
+ path: "/v1/agents/customers/{customer_id}/policies",
39727
+ args,
39728
+ queryParamKeys: []
39729
+ });
39730
+ });
39731
+ resource.command("get-agent-customer-policy").description(`Get one customer's AI billing policy \u2014 the default shared pool, or one agent's own scope via the agent query param.`).requiredOption("--customer-id <value>", `customer_id parameter`).option("--agent <value>", `agent`).addHelpText("after", `
39732
+ Examples:
39733
+ hyperline agents get-agent-customer-policy --customer-id <customer_id>
39734
+ hyperline agents get-agent-customer-policy --customer-id <customer_id> --agent <agent>`).action(async (opts) => {
39735
+ const ctx = resource.parent?.opts()._ctx;
39736
+ if (!ctx) {
39737
+ process.stderr.write("Error: Not authenticated\n");
39738
+ process.exit(1);
39739
+ }
39740
+ const args = {};
39741
+ if (opts.customerId !== void 0)
39742
+ args.customer_id = opts.customerId;
39743
+ if (opts.agent !== void 0)
39744
+ args.agent = opts.agent;
39745
+ await ctx.execute({
39746
+ method: "GET",
39747
+ path: "/v1/agents/customers/{customer_id}/policy",
39748
+ args,
39749
+ queryParamKeys: ["agent"]
39750
+ });
39751
+ });
39752
+ resource.command("upsert-agent-customer-policy").description(`Create or replace one customer's AI billing policy (whole-row). Pass plan_id to attach the customer to a billing plan \u2014 this also attaches the plan's overage invoice container to their subscription. Past-limit usage is priced by overage_markup_percent over the base rates, or by overage_rate_card_id (a currency rate card whose rates ARE the overage price) \u2014 never both. Wallet/credit pots are auto-opened empty.`).requiredOption("--customer-id <value>", `customer_id parameter`).option("--agent <value>", `agent`).option("--internal-description <value>", `internal_description`).requiredOption("--mode <value>", `mode`).option("--wallet-id <value>", `wallet_id`).option("--credit-product-id <value>", `credit_product_id`).option("--markup-percent <value>", `markup_percent`).option("--overage-mode <value>", `overage_mode`).option("--overage-markup-percent <value>", `overage_markup_percent`).option("--overage-rate-card-id <value>", `overage_rate_card_id`).option("--overage-wallet-id <value>", `overage_wallet_id`).option("--floor <value>", `floor`).option("--settlement-interval-minutes <number>", `settlement_interval_minutes`).option("--settlement-schedule <value>", `settlement_schedule`).option("--credit-rates <json>", `credit_rates`).option("--window-rates <json>", `window_rates`).option("--rate-card-id <value>", `rate_card_id`).option("--plan-id <value>", `plan_id`).requiredOption("--blocked", `blocked`).addHelpText("after", `
39753
+ Examples:
39754
+ hyperline agents upsert-agent-customer-policy --customer-id <customer_id> --mode <mode> --blocked
39755
+ hyperline agents upsert-agent-customer-policy --customer-id <customer_id> --mode <mode> --blocked --agent <agent> --internal-description <internal_description>
39756
+ hyperline agents upsert-agent-customer-policy --customer-id <customer_id> --mode <mode> --blocked --output json`).action(async (opts) => {
39757
+ const ctx = resource.parent?.opts()._ctx;
39758
+ if (!ctx) {
39759
+ process.stderr.write("Error: Not authenticated\n");
39760
+ process.exit(1);
39761
+ }
39762
+ const args = {};
39763
+ if (opts.customerId !== void 0)
39764
+ args.customer_id = opts.customerId;
39765
+ if (opts.agent !== void 0)
39766
+ args.agent = opts.agent;
39767
+ if (opts.internalDescription !== void 0)
39768
+ args.internal_description = opts.internalDescription;
39769
+ if (opts.mode !== void 0)
39770
+ args.mode = opts.mode;
39771
+ if (opts.walletId !== void 0)
39772
+ args.wallet_id = opts.walletId;
39773
+ if (opts.creditProductId !== void 0)
39774
+ args.credit_product_id = opts.creditProductId;
39775
+ if (opts.markupPercent !== void 0)
39776
+ args.markup_percent = opts.markupPercent;
39777
+ if (opts.overageMode !== void 0)
39778
+ args.overage_mode = opts.overageMode;
39779
+ if (opts.overageMarkupPercent !== void 0)
39780
+ args.overage_markup_percent = opts.overageMarkupPercent;
39781
+ if (opts.overageRateCardId !== void 0)
39782
+ args.overage_rate_card_id = opts.overageRateCardId;
39783
+ if (opts.overageWalletId !== void 0)
39784
+ args.overage_wallet_id = opts.overageWalletId;
39785
+ if (opts.floor !== void 0)
39786
+ args.floor = opts.floor;
39787
+ if (opts.settlementSchedule !== void 0)
39788
+ args.settlement_schedule = opts.settlementSchedule;
39789
+ if (opts.rateCardId !== void 0)
39790
+ args.rate_card_id = opts.rateCardId;
39791
+ if (opts.planId !== void 0)
39792
+ args.plan_id = opts.planId;
39793
+ if (opts.settlementIntervalMinutes !== void 0)
39794
+ args.settlement_interval_minutes = Number(opts.settlementIntervalMinutes);
39795
+ if (opts.blocked !== void 0)
39796
+ args.blocked = true;
39797
+ if (opts.creditRates !== void 0)
39798
+ args.credit_rates = JSON.parse(opts.creditRates);
39799
+ if (opts.windowRates !== void 0)
39800
+ args.window_rates = JSON.parse(opts.windowRates);
39801
+ await ctx.execute({
39802
+ method: "PUT",
39803
+ path: "/v1/agents/customers/{customer_id}/policy",
39804
+ args,
39805
+ queryParamKeys: ["agent"]
39806
+ });
39807
+ });
39808
+ resource.command("delete-agent-customer-policy").description(`Delete one customer's AI billing policy scope. Refused (409) while it owes unsettled consumption or while agent overrides still depend on it.`).requiredOption("--customer-id <value>", `customer_id parameter`).option("--agent <value>", `agent`).option("--yes", "Skip confirmation").addHelpText("after", `
39809
+ Examples:
39810
+ hyperline agents delete-agent-customer-policy --customer-id <customer_id>
39811
+ hyperline agents delete-agent-customer-policy --customer-id <customer_id> --agent <agent>
39812
+ hyperline agents delete-agent-customer-policy --customer-id <customer_id> --output json`).action(async (opts) => {
39813
+ const ctx = resource.parent?.opts()._ctx;
39814
+ if (!ctx) {
39815
+ process.stderr.write("Error: Not authenticated\n");
39816
+ process.exit(1);
39817
+ }
39818
+ const args = {};
39819
+ if (opts.customerId !== void 0)
39820
+ args.customer_id = opts.customerId;
39821
+ if (opts.agent !== void 0)
39822
+ args.agent = opts.agent;
39823
+ if (!opts.yes) {
39824
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
39825
+ if (!confirmed) {
39826
+ process.stdout.write("Aborted.\n");
39827
+ return;
39828
+ }
39829
+ }
39830
+ await ctx.execute({
39831
+ method: "DELETE",
39832
+ path: "/v1/agents/customers/{customer_id}/policy",
39833
+ args,
39834
+ queryParamKeys: ["agent"]
39835
+ });
39836
+ });
39837
+ resource.command("apply-agent-default-plan").description(`Apply the workspace's default AI agent billing plan to one customer (by id or external id). Idempotent; refuses (409) if the customer already has a different billing policy, 404 when no default plan is set.`).requiredOption("--customer-id <value>", `customer_id parameter`).addHelpText("after", `
39838
+ Examples:
39839
+ hyperline agents apply-agent-default-plan --customer-id <customer_id>
39840
+ hyperline agents apply-agent-default-plan --customer-id <customer_id> --output json`).action(async (opts) => {
39841
+ const ctx = resource.parent?.opts()._ctx;
39842
+ if (!ctx) {
39843
+ process.stderr.write("Error: Not authenticated\n");
39844
+ process.exit(1);
39845
+ }
39846
+ const args = {};
39847
+ if (opts.customerId !== void 0)
39848
+ args.customer_id = opts.customerId;
39849
+ await ctx.execute({
39850
+ method: "POST",
39851
+ path: "/v1/agents/customers/{customer_id}/apply-default-plan",
39852
+ args,
39853
+ queryParamKeys: []
39854
+ });
39855
+ });
39856
+ resource.command("get-agent-customer-balance").description(`Get one customer's live AI balance, shaped by their billing mode: wallet shadow balance, credit pot, or rolling window meters with reset times. Includes per-agent scopes and overage state.`).requiredOption("--customer-id <value>", `customer_id parameter`).option("--agent <value>", `agent`).addHelpText("after", `
39857
+ Examples:
39858
+ hyperline agents get-agent-customer-balance --customer-id <customer_id>
39859
+ hyperline agents get-agent-customer-balance --customer-id <customer_id> --agent <agent>`).action(async (opts) => {
39860
+ const ctx = resource.parent?.opts()._ctx;
39861
+ if (!ctx) {
39862
+ process.stderr.write("Error: Not authenticated\n");
39863
+ process.exit(1);
39864
+ }
39865
+ const args = {};
39866
+ if (opts.customerId !== void 0)
39867
+ args.customer_id = opts.customerId;
39868
+ if (opts.agent !== void 0)
39869
+ args.agent = opts.agent;
39870
+ await ctx.execute({
39871
+ method: "GET",
39872
+ path: "/v1/agents/customers/{customer_id}/balance",
39873
+ args,
39874
+ queryParamKeys: ["agent"]
39875
+ });
39876
+ });
39877
+ resource.command("reset-agent-customer-windows").description(`Reset one customer's open AI allowance windows so their next call starts a fresh full allowance. Windows-mode scopes only.`).requiredOption("--customer-id <value>", `customer_id parameter`).option("--agent <value>", `agent`).addHelpText("after", `
39878
+ Examples:
39879
+ hyperline agents reset-agent-customer-windows --customer-id <customer_id>
39880
+ hyperline agents reset-agent-customer-windows --customer-id <customer_id> --agent <agent>
39881
+ hyperline agents reset-agent-customer-windows --customer-id <customer_id> --output json`).action(async (opts) => {
39882
+ const ctx = resource.parent?.opts()._ctx;
39883
+ if (!ctx) {
39884
+ process.stderr.write("Error: Not authenticated\n");
39885
+ process.exit(1);
39886
+ }
39887
+ const args = {};
39888
+ if (opts.customerId !== void 0)
39889
+ args.customer_id = opts.customerId;
39890
+ if (opts.agent !== void 0)
39891
+ args.agent = opts.agent;
39892
+ await ctx.execute({
39893
+ method: "POST",
39894
+ path: "/v1/agents/customers/{customer_id}/windows/reset",
39895
+ args,
39896
+ queryParamKeys: ["agent"]
39897
+ });
39898
+ });
39899
+ resource.command("list-agent-customer-consumption").description(`List one customer's AI consumption ledger entries, newest first, with amounts, denominations and overage flags. Filter by agent scope, overage, and from/to time range; paginated with take/skip.`).requiredOption("--customer-id <value>", `customer_id parameter`).option("--agent <value>", `agent`).option("--overage", `overage`).option("--from <value>", `from`).option("--to <value>", `to`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
39900
+ Examples:
39901
+ hyperline agents list-agent-customer-consumption --customer-id <customer_id>
39902
+ hyperline agents list-agent-customer-consumption --customer-id <customer_id> --agent <agent> --overage`).action(async (opts) => {
39903
+ const ctx = resource.parent?.opts()._ctx;
39904
+ if (!ctx) {
39905
+ process.stderr.write("Error: Not authenticated\n");
39906
+ process.exit(1);
39907
+ }
39908
+ const args = {};
39909
+ if (opts.customerId !== void 0)
39910
+ args.customer_id = opts.customerId;
39911
+ if (opts.agent !== void 0)
39912
+ args.agent = opts.agent;
39913
+ if (opts.from !== void 0)
39914
+ args.from = opts.from;
39915
+ if (opts.to !== void 0)
39916
+ args.to = opts.to;
39917
+ if (opts.take !== void 0)
39918
+ args.take = Number(opts.take);
39919
+ if (opts.skip !== void 0)
39920
+ args.skip = Number(opts.skip);
39921
+ if (opts.overage !== void 0)
39922
+ args.overage = true;
39923
+ await ctx.execute({
39924
+ method: "GET",
39925
+ path: "/v1/agents/customers/{customer_id}/consumption",
39926
+ args,
39927
+ queryParamKeys: ["agent", "overage", "from", "to", "take", "skip"]
39928
+ });
39929
+ });
39930
+ resource.command("get-agent-customer-overview").description(`Get one customer's full AI billing overview: default policy, per-agent scopes, balances and billed consumption totals in one read.`).requiredOption("--customer-id <value>", `customer_id parameter`).addHelpText("after", `
39931
+ Examples:
39932
+ hyperline agents get-agent-customer-overview --customer-id <customer_id>`).action(async (opts) => {
39933
+ const ctx = resource.parent?.opts()._ctx;
39934
+ if (!ctx) {
39935
+ process.stderr.write("Error: Not authenticated\n");
39936
+ process.exit(1);
39937
+ }
39938
+ const args = {};
39939
+ if (opts.customerId !== void 0)
39940
+ args.customer_id = opts.customerId;
39941
+ await ctx.execute({
39942
+ method: "GET",
39943
+ path: "/v1/agents/customers/{customer_id}/overview",
39944
+ args,
39945
+ queryParamKeys: []
39946
+ });
39947
+ });
39948
+ }
39949
+
39950
+ // build/commands/generated/aggregators.js
39951
+ function registerAggregatorsCommands(parent) {
39952
+ const resource = parent.command("aggregators").description("Manage aggregators");
39953
+ resource.command("list").description(`List all aggregators with pagination. Aggregators define how billable events are counted or summed to compute usage.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
39954
+ Examples:
39955
+ hyperline aggregators list
39956
+ hyperline aggregators list --take <take>`).action(async (opts) => {
39957
+ const ctx = resource.parent?.opts()._ctx;
39958
+ if (!ctx) {
39959
+ process.stderr.write("Error: Not authenticated\n");
39960
+ process.exit(1);
39961
+ }
39962
+ const args = {};
39963
+ if (opts.take !== void 0)
39964
+ args.take = Number(opts.take);
39965
+ if (opts.skip !== void 0)
39966
+ args.skip = Number(opts.skip);
39967
+ await ctx.execute({
39968
+ method: "GET",
39969
+ path: "/v1/aggregators",
39970
+ args,
39971
+ queryParamKeys: ["take", "skip"]
39972
+ });
39973
+ });
39974
+ resource.command("create").description(`Create a new aggregator that counts or sums billable events. Aggregators can then be linked to products via aggregator_id.`).requiredOption("--entity <value>", `The billable event entity to aggregate.`).option("--type <value>", `The type of aggregator.`).option("--where <json>", `Filter conditions for the aggregation.`).option("--name <value>", `Name of the aggregator.`).option("--description <value>", `Description of the aggregator.`).option("--allow-negative-values", `Whether the aggregator can produce negative values.`).option("--aggregate-on-customers-enabled", `Whether the aggregator should aggregate on customers.`).option("--custom-event-name <value>", `Custom event name for the aggregator.`).option("--exposed-event-keys <json>", `Event keys exposed by the aggregator.`).option("--unit-name <value>", `Display name of the unit being measured (e.g. 'user', 'request'). Used as fallback for products attached to this aggregator.`).option("--default-interval-count <number>", `Default interval count for usage periods.`).option("--default-interval-period <value>", `Default interval period for usage periods.`).option("--thresholds <json>", `Thresholds for the aggregator.`).requiredOption("--operation <value>", `The aggregation operation to perform.`).option("--property <value>", `The property to sum.`).addHelpText("after", `
39975
+ Examples:
39976
+ hyperline aggregators create --entity <entity> --operation <operation>
39977
+ hyperline aggregators create --entity <entity> --operation <operation> --type <type> --where <where>
39978
+ hyperline aggregators create --entity <entity> --operation <operation> --output json`).action(async (opts) => {
39979
+ const ctx = resource.parent?.opts()._ctx;
39980
+ if (!ctx) {
39981
+ process.stderr.write("Error: Not authenticated\n");
39982
+ process.exit(1);
39983
+ }
39984
+ const args = {};
39985
+ if (opts.entity !== void 0)
39986
+ args.entity = opts.entity;
39987
+ if (opts.type !== void 0)
39988
+ args.type = opts.type;
39989
+ if (opts.name !== void 0)
39990
+ args.name = opts.name;
39991
+ if (opts.description !== void 0)
39992
+ args.description = opts.description;
39993
+ if (opts.customEventName !== void 0)
39994
+ args.custom_event_name = opts.customEventName;
39995
+ if (opts.unitName !== void 0)
39996
+ args.unit_name = opts.unitName;
39997
+ if (opts.defaultIntervalPeriod !== void 0)
39998
+ args.default_interval_period = opts.defaultIntervalPeriod;
39999
+ if (opts.operation !== void 0)
40000
+ args.operation = opts.operation;
40001
+ if (opts.property !== void 0)
40002
+ args.property = opts.property;
40003
+ if (opts.defaultIntervalCount !== void 0)
40004
+ args.default_interval_count = Number(opts.defaultIntervalCount);
40005
+ if (opts.allowNegativeValues !== void 0)
40006
+ args.allow_negative_values = true;
40007
+ if (opts.aggregateOnCustomersEnabled !== void 0)
40008
+ args.aggregate_on_customers_enabled = true;
40009
+ if (opts.where !== void 0)
40010
+ args.where = JSON.parse(opts.where);
40011
+ if (opts.exposedEventKeys !== void 0)
40012
+ args.exposed_event_keys = JSON.parse(opts.exposedEventKeys);
40013
+ if (opts.thresholds !== void 0)
40014
+ args.thresholds = JSON.parse(opts.thresholds);
40015
+ await ctx.execute({
40016
+ method: "POST",
40017
+ path: "/v1/aggregators",
40018
+ args,
40019
+ queryParamKeys: []
40020
+ });
40021
+ });
40022
+ resource.command("get").description(`Retrieve a specific aggregator by ID.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
40023
+ Examples:
40024
+ hyperline aggregators get --id <id>`).action(async (opts) => {
40025
+ const ctx = resource.parent?.opts()._ctx;
40026
+ if (!ctx) {
40027
+ process.stderr.write("Error: Not authenticated\n");
40028
+ process.exit(1);
40029
+ }
40030
+ const args = {};
40031
+ if (opts.id !== void 0)
40032
+ args.id = opts.id;
40033
+ await ctx.execute({
40034
+ method: "GET",
40035
+ path: "/v1/aggregators/{id}",
40036
+ args,
40037
+ queryParamKeys: []
40038
+ });
40039
+ });
40040
+ resource.command("update").description(`Update an existing aggregator's configuration.`).requiredOption("--id <value>", `id parameter`).option("--entity <value>", `The billable event entity to aggregate.`).option("--type <value>", `The type of aggregator.`).option("--where <json>", `Filter conditions for the aggregation.`).option("--name <value>", `Name of the aggregator.`).option("--description <value>", `Description of the aggregator.`).option("--allow-negative-values", `Whether the aggregator can produce negative values.`).option("--aggregate-on-customers-enabled", `Whether the aggregator should aggregate on customers.`).option("--custom-event-name <value>", `Custom event name for the aggregator.`).option("--exposed-event-keys <json>", `Event keys exposed by the aggregator.`).option("--unit-name <value>", `Display name of the unit being measured (e.g. 'user', 'request'). Used as fallback for products attached to this aggregator.`).option("--default-interval-count <number>", `Default interval count for usage periods.`).option("--default-interval-period <value>", `Default interval period for usage periods.`).option("--thresholds <json>", `Thresholds for the aggregator. Replaces existing thresholds.`).option("--operation <value>", `The aggregation operation to perform.`).option("--property <value>", `The property to sum. Required when operation is 'sum'.`).addHelpText("after", `
40041
+ Examples:
40042
+ hyperline aggregators update --id <id>
40043
+ hyperline aggregators update --id <id> --entity <entity> --type <type>
40044
+ hyperline aggregators update --id <id> --output json`).action(async (opts) => {
40045
+ const ctx = resource.parent?.opts()._ctx;
40046
+ if (!ctx) {
40047
+ process.stderr.write("Error: Not authenticated\n");
40048
+ process.exit(1);
40049
+ }
40050
+ const args = {};
40051
+ if (opts.id !== void 0)
40052
+ args.id = opts.id;
40053
+ if (opts.entity !== void 0)
40054
+ args.entity = opts.entity;
40055
+ if (opts.type !== void 0)
40056
+ args.type = opts.type;
40057
+ if (opts.name !== void 0)
40058
+ args.name = opts.name;
40059
+ if (opts.description !== void 0)
40060
+ args.description = opts.description;
40061
+ if (opts.customEventName !== void 0)
40062
+ args.custom_event_name = opts.customEventName;
40063
+ if (opts.unitName !== void 0)
40064
+ args.unit_name = opts.unitName;
40065
+ if (opts.defaultIntervalPeriod !== void 0)
40066
+ args.default_interval_period = opts.defaultIntervalPeriod;
40067
+ if (opts.operation !== void 0)
40068
+ args.operation = opts.operation;
40069
+ if (opts.property !== void 0)
40070
+ args.property = opts.property;
40071
+ if (opts.defaultIntervalCount !== void 0)
40072
+ args.default_interval_count = Number(opts.defaultIntervalCount);
40073
+ if (opts.allowNegativeValues !== void 0)
40074
+ args.allow_negative_values = true;
40075
+ if (opts.aggregateOnCustomersEnabled !== void 0)
40076
+ args.aggregate_on_customers_enabled = true;
40077
+ if (opts.where !== void 0)
40078
+ args.where = JSON.parse(opts.where);
40079
+ if (opts.exposedEventKeys !== void 0)
40080
+ args.exposed_event_keys = JSON.parse(opts.exposedEventKeys);
40081
+ if (opts.thresholds !== void 0)
40082
+ args.thresholds = JSON.parse(opts.thresholds);
40083
+ await ctx.execute({
40084
+ method: "PUT",
40085
+ path: "/v1/aggregators/{id}",
40086
+ args,
40087
+ queryParamKeys: []
40088
+ });
40089
+ });
40090
+ resource.command("delete").description(`Delete an aggregator by ID. Will fail if the aggregator is linked to a product.`).requiredOption("--id <value>", `id parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
40091
+ Examples:
40092
+ hyperline aggregators delete --id <id>
40093
+ hyperline aggregators delete --id <id> --output json`).action(async (opts) => {
40094
+ const ctx = resource.parent?.opts()._ctx;
40095
+ if (!ctx) {
40096
+ process.stderr.write("Error: Not authenticated\n");
40097
+ process.exit(1);
40098
+ }
40099
+ const args = {};
40100
+ if (opts.id !== void 0)
40101
+ args.id = opts.id;
40102
+ if (!opts.yes) {
40103
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
40104
+ if (!confirmed) {
40105
+ process.stdout.write("Aborted.\n");
40106
+ return;
40107
+ }
40108
+ }
40109
+ await ctx.execute({
40110
+ method: "DELETE",
40111
+ path: "/v1/aggregators/{id}",
40112
+ args,
40113
+ queryParamKeys: []
40114
+ });
40115
+ });
40116
+ }
40117
+
40118
+ // build/commands/generated/aggregators-usage.js
40119
+ function registerAggregators_UsageCommands(parent) {
40120
+ const resource = parent.command("aggregators-usage").description("Manage aggregators > usage");
40121
+ resource.command("get-aggregator-usage").description(`Retrieve a usage row for an aggregator. Use the timeseries, group-by-customer or events endpoints to query metering data.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
40122
+ Examples:
40123
+ hyperline aggregators-usage get-aggregator-usage --id <id>`).action(async (opts) => {
40124
+ const ctx = resource.parent?.opts()._ctx;
40125
+ if (!ctx) {
40126
+ process.stderr.write("Error: Not authenticated\n");
40127
+ process.exit(1);
40128
+ }
40129
+ const args = {};
40130
+ if (opts.id !== void 0)
40131
+ args.id = opts.id;
40132
+ await ctx.execute({
40133
+ method: "GET",
40134
+ path: "/v1/aggregators/{id}/usage",
40135
+ args,
40136
+ queryParamKeys: []
40137
+ });
40138
+ });
40139
+ resource.command("get-aggregator-usage-timeseries").description(`Get client-wide usage for an aggregator bucketed by month/day/hour over a period.`).requiredOption("--id <value>", `id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).option("--aggregator-filter-id <value>", `Optional aggregator filter ID. When set, restricts the result to events matching that filter's config. Must belong to the aggregator in the path.`).option("--group-by <value>", `Bucket size for the timeseries.`).addHelpText("after", `
40140
+ Examples:
40141
+ hyperline aggregators-usage get-aggregator-usage-timeseries --id <id>
40142
+ hyperline aggregators-usage get-aggregator-usage-timeseries --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
40143
+ const ctx = resource.parent?.opts()._ctx;
40144
+ if (!ctx) {
40145
+ process.stderr.write("Error: Not authenticated\n");
40146
+ process.exit(1);
40147
+ }
40148
+ const args = {};
40149
+ if (opts.id !== void 0)
40150
+ args.id = opts.id;
40151
+ if (opts.startDate !== void 0)
40152
+ args.start_date = opts.startDate;
40153
+ if (opts.endDate !== void 0)
40154
+ args.end_date = opts.endDate;
40155
+ if (opts.aggregatorFilterId !== void 0)
40156
+ args.aggregator_filter_id = opts.aggregatorFilterId;
40157
+ if (opts.groupBy !== void 0)
40158
+ args.group_by = opts.groupBy;
40159
+ await ctx.execute({
40160
+ method: "GET",
40161
+ path: "/v1/aggregators/{id}/usage/timeseries",
40162
+ args,
40163
+ queryParamKeys: [
40164
+ "start_date",
40165
+ "end_date",
40166
+ "aggregator_filter_id",
40167
+ "group_by"
40168
+ ]
40169
+ });
40170
+ });
40171
+ resource.command("get-aggregator-usage-group-by-customer").description(`Per-customer total usage for an aggregator over a period, ranked by total. Paginated with take/skip.`).requiredOption("--id <value>", `id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).option("--aggregator-filter-id <value>", `Optional aggregator filter ID. When set, restricts the result to events matching that filter's config. Must belong to the aggregator in the path.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
40172
+ Examples:
40173
+ hyperline aggregators-usage get-aggregator-usage-group-by-customer --id <id>
40174
+ hyperline aggregators-usage get-aggregator-usage-group-by-customer --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
40175
+ const ctx = resource.parent?.opts()._ctx;
40176
+ if (!ctx) {
40177
+ process.stderr.write("Error: Not authenticated\n");
40178
+ process.exit(1);
40179
+ }
40180
+ const args = {};
40181
+ if (opts.id !== void 0)
40182
+ args.id = opts.id;
40183
+ if (opts.startDate !== void 0)
40184
+ args.start_date = opts.startDate;
40185
+ if (opts.endDate !== void 0)
40186
+ args.end_date = opts.endDate;
40187
+ if (opts.aggregatorFilterId !== void 0)
40188
+ args.aggregator_filter_id = opts.aggregatorFilterId;
40189
+ if (opts.take !== void 0)
40190
+ args.take = Number(opts.take);
40191
+ if (opts.skip !== void 0)
40192
+ args.skip = Number(opts.skip);
40193
+ await ctx.execute({
40194
+ method: "GET",
40195
+ path: "/v1/aggregators/{id}/usage/group-by-customer",
40196
+ args,
40197
+ queryParamKeys: [
40198
+ "start_date",
40199
+ "end_date",
40200
+ "aggregator_filter_id",
40201
+ "take",
40202
+ "skip"
40203
+ ]
40204
+ });
40205
+ });
40206
+ resource.command("get-aggregator-usage-events").description(`List raw billable events for an aggregator across every customer of the client. Paginated with take/skip.`).requiredOption("--id <value>", `id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).option("--aggregator-filter-id <value>", `Optional aggregator filter ID. When set, restricts the result to events matching that filter's config. Must belong to the aggregator in the path.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
40207
+ Examples:
40208
+ hyperline aggregators-usage get-aggregator-usage-events --id <id>
40209
+ hyperline aggregators-usage get-aggregator-usage-events --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
40210
+ const ctx = resource.parent?.opts()._ctx;
40211
+ if (!ctx) {
40212
+ process.stderr.write("Error: Not authenticated\n");
40213
+ process.exit(1);
40214
+ }
40215
+ const args = {};
40216
+ if (opts.id !== void 0)
40217
+ args.id = opts.id;
40218
+ if (opts.startDate !== void 0)
40219
+ args.start_date = opts.startDate;
40220
+ if (opts.endDate !== void 0)
40221
+ args.end_date = opts.endDate;
40222
+ if (opts.aggregatorFilterId !== void 0)
40223
+ args.aggregator_filter_id = opts.aggregatorFilterId;
40224
+ if (opts.take !== void 0)
40225
+ args.take = Number(opts.take);
40226
+ if (opts.skip !== void 0)
40227
+ args.skip = Number(opts.skip);
40228
+ await ctx.execute({
40229
+ method: "GET",
40230
+ path: "/v1/aggregators/{id}/usage/events",
40231
+ args,
40232
+ queryParamKeys: [
40233
+ "start_date",
40234
+ "end_date",
40235
+ "aggregator_filter_id",
40236
+ "take",
40237
+ "skip"
40238
+ ]
40239
+ });
40240
+ });
40241
+ }
40242
+
39226
40243
  // build/commands/generated/analytics.js
39227
40244
  function registerAnalyticsCommands(parent) {
39228
40245
  const resource = parent.command("analytics").description("Manage analytics");
@@ -41181,6 +42198,130 @@ Examples:
41181
42198
  });
41182
42199
  }
41183
42200
 
42201
+ // build/commands/generated/customers-usage.js
42202
+ function registerCustomers_UsageCommands(parent) {
42203
+ const resource = parent.command("customers-usage").description("Manage customers > usage");
42204
+ resource.command("list-customer-usage").description(`List one usage row per aggregator for a single customer over a period (total + event count per aggregator).`).requiredOption("--id <value>", `id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).addHelpText("after", `
42205
+ Examples:
42206
+ hyperline customers-usage list-customer-usage --id <id>
42207
+ hyperline customers-usage list-customer-usage --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
42208
+ const ctx = resource.parent?.opts()._ctx;
42209
+ if (!ctx) {
42210
+ process.stderr.write("Error: Not authenticated\n");
42211
+ process.exit(1);
42212
+ }
42213
+ const args = {};
42214
+ if (opts.id !== void 0)
42215
+ args.id = opts.id;
42216
+ if (opts.startDate !== void 0)
42217
+ args.start_date = opts.startDate;
42218
+ if (opts.endDate !== void 0)
42219
+ args.end_date = opts.endDate;
42220
+ await ctx.execute({
42221
+ method: "GET",
42222
+ path: "/v1/customers/{id}/usage",
42223
+ args,
42224
+ queryParamKeys: ["start_date", "end_date"]
42225
+ });
42226
+ });
42227
+ resource.command("get-customer-usage").description(`Get the usage of a customer for a specific aggregator over a period.`).requiredOption("--id <value>", `id parameter`).requiredOption("--aggregator-id <value>", `aggregator_id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).addHelpText("after", `
42228
+ Examples:
42229
+ hyperline customers-usage get-customer-usage --id <id> --aggregator-id <aggregator_id>
42230
+ hyperline customers-usage get-customer-usage --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
42231
+ const ctx = resource.parent?.opts()._ctx;
42232
+ if (!ctx) {
42233
+ process.stderr.write("Error: Not authenticated\n");
42234
+ process.exit(1);
42235
+ }
42236
+ const args = {};
42237
+ if (opts.id !== void 0)
42238
+ args.id = opts.id;
42239
+ if (opts.aggregatorId !== void 0)
42240
+ args.aggregator_id = opts.aggregatorId;
42241
+ if (opts.startDate !== void 0)
42242
+ args.start_date = opts.startDate;
42243
+ if (opts.endDate !== void 0)
42244
+ args.end_date = opts.endDate;
42245
+ await ctx.execute({
42246
+ method: "GET",
42247
+ path: "/v1/customers/{id}/usage/{aggregator_id}",
42248
+ args,
42249
+ queryParamKeys: ["start_date", "end_date"]
42250
+ });
42251
+ });
42252
+ resource.command("get-customer-usage-timeseries").description(`Get per-bucket usage for a customer + aggregator (month/day/hour).`).requiredOption("--id <value>", `id parameter`).requiredOption("--aggregator-id <value>", `aggregator_id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).option("--aggregator-filter-id <value>", `Optional aggregator filter ID. When set, restricts the result to events matching that filter's config. Must belong to the aggregator in the path.`).option("--group-by <value>", `Bucket size for the timeseries.`).addHelpText("after", `
42253
+ Examples:
42254
+ hyperline customers-usage get-customer-usage-timeseries --id <id> --aggregator-id <aggregator_id>
42255
+ hyperline customers-usage get-customer-usage-timeseries --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
42256
+ const ctx = resource.parent?.opts()._ctx;
42257
+ if (!ctx) {
42258
+ process.stderr.write("Error: Not authenticated\n");
42259
+ process.exit(1);
42260
+ }
42261
+ const args = {};
42262
+ if (opts.id !== void 0)
42263
+ args.id = opts.id;
42264
+ if (opts.aggregatorId !== void 0)
42265
+ args.aggregator_id = opts.aggregatorId;
42266
+ if (opts.startDate !== void 0)
42267
+ args.start_date = opts.startDate;
42268
+ if (opts.endDate !== void 0)
42269
+ args.end_date = opts.endDate;
42270
+ if (opts.aggregatorFilterId !== void 0)
42271
+ args.aggregator_filter_id = opts.aggregatorFilterId;
42272
+ if (opts.groupBy !== void 0)
42273
+ args.group_by = opts.groupBy;
42274
+ await ctx.execute({
42275
+ method: "GET",
42276
+ path: "/v1/customers/{id}/usage/{aggregator_id}/timeseries",
42277
+ args,
42278
+ queryParamKeys: [
42279
+ "start_date",
42280
+ "end_date",
42281
+ "aggregator_filter_id",
42282
+ "group_by"
42283
+ ]
42284
+ });
42285
+ });
42286
+ resource.command("get-customer-usage-events").description(`List raw billable events for a customer + aggregator over a period. Paginated with take/skip.`).requiredOption("--id <value>", `id parameter`).requiredOption("--aggregator-id <value>", `aggregator_id parameter`).option("--start-date <value>", `ISO-8601 date string.`).option("--end-date <value>", `ISO-8601 date string.`).option("--aggregator-filter-id <value>", `Optional aggregator filter ID. When set, restricts the result to events matching that filter's config. Must belong to the aggregator in the path.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
42287
+ Examples:
42288
+ hyperline customers-usage get-customer-usage-events --id <id> --aggregator-id <aggregator_id>
42289
+ hyperline customers-usage get-customer-usage-events --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
42290
+ const ctx = resource.parent?.opts()._ctx;
42291
+ if (!ctx) {
42292
+ process.stderr.write("Error: Not authenticated\n");
42293
+ process.exit(1);
42294
+ }
42295
+ const args = {};
42296
+ if (opts.id !== void 0)
42297
+ args.id = opts.id;
42298
+ if (opts.aggregatorId !== void 0)
42299
+ args.aggregator_id = opts.aggregatorId;
42300
+ if (opts.startDate !== void 0)
42301
+ args.start_date = opts.startDate;
42302
+ if (opts.endDate !== void 0)
42303
+ args.end_date = opts.endDate;
42304
+ if (opts.aggregatorFilterId !== void 0)
42305
+ args.aggregator_filter_id = opts.aggregatorFilterId;
42306
+ if (opts.take !== void 0)
42307
+ args.take = Number(opts.take);
42308
+ if (opts.skip !== void 0)
42309
+ args.skip = Number(opts.skip);
42310
+ await ctx.execute({
42311
+ method: "GET",
42312
+ path: "/v1/customers/{id}/usage/{aggregator_id}/events",
42313
+ args,
42314
+ queryParamKeys: [
42315
+ "start_date",
42316
+ "end_date",
42317
+ "aggregator_filter_id",
42318
+ "take",
42319
+ "skip"
42320
+ ]
42321
+ });
42322
+ });
42323
+ }
42324
+
41184
42325
  // build/commands/generated/exports.js
41185
42326
  function registerExportsCommands(parent) {
41186
42327
  const resource = parent.command("exports").description("Manage exports");
@@ -45555,7 +46696,10 @@ function registerAllCommands(program2) {
45555
46696
  registerAccounting_ReportsCommands(program2);
45556
46697
  registerAccounting_Revenue_RecognitionCommands(program2);
45557
46698
  registerAccounting_RulesCommands(program2);
46699
+ registerAgentsCommands(program2);
45558
46700
  registerCustom_PropertiesCommands(program2);
46701
+ registerAggregatorsCommands(program2);
46702
+ registerAggregators_UsageCommands(program2);
45559
46703
  registerAnalyticsCommands(program2);
45560
46704
  registerBank_AccountsCommands(program2);
45561
46705
  registerCompaniesCommands(program2);
@@ -45566,6 +46710,7 @@ function registerAllCommands(program2) {
45566
46710
  registerCustomers_AddressCommands(program2);
45567
46711
  registerCustomers_ShippingCommands(program2);
45568
46712
  registerCustomersCommands(program2);
46713
+ registerCustomers_UsageCommands(program2);
45569
46714
  registerOrganisationsCommands(program2);
45570
46715
  registerCustomers_SegmentsCommands(program2);
45571
46716
  registerExportsCommands(program2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperline/cli",
3
- "version": "0.1.0-build.1.ed7561b",
3
+ "version": "0.1.0-build.1.ed8c065",
4
4
  "description": "Agent-first CLI for Hyperline API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -54,8 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public",
56
56
  "registry": "https://registry.npmjs.org"
57
- },
58
- "volta": {
59
- "extends": "../../package.json"
60
57
  }
61
58
  }