@hyperline/cli 0.1.0-build.1.f2d77c6 → 0.1.0-build.1.f3906be

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.
@@ -34985,10 +34985,10 @@ var require_shared = __commonJS({
34985
34985
  ZodId: () => ZodId,
34986
34986
  ZodTranslationsSchemaFn: () => ZodTranslationsSchemaFn
34987
34987
  });
34988
- var import_zod20 = require_lib();
34988
+ var import_zod21 = require_lib();
34989
34989
  var countryIds2 = ["all", ...countries.map(({ id }) => id)];
34990
- var ZodId = import_zod20.z.enum(countryIds2);
34991
- var ZodTranslationsSchemaFn = (schema) => import_zod20.z.record(import_zod20.z.string(), schema.optional());
34990
+ var ZodId = import_zod21.z.enum(countryIds2);
34991
+ var ZodTranslationsSchemaFn = (schema) => import_zod21.z.record(import_zod21.z.string(), schema.optional());
34992
34992
  var UsStates = [
34993
34993
  { id: "AA", name: "Armed Forces Americas" },
34994
34994
  { id: "AE", name: "Armed Forces Europe" },
@@ -39223,6 +39223,1052 @@ 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>", `Billing mode.
39230
+
39231
+ - wallet: Charges a monetary wallet.
39232
+ - credits: Consumes a credit balance.
39233
+ - windows: Meters weighted units against rolling allowances.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
39234
+ Examples:
39235
+ hyperline agents list-agent-plans
39236
+ hyperline agents list-agent-plans --mode <mode> --take <take>`).action(async (opts) => {
39237
+ const ctx = resource.parent?.opts()._ctx;
39238
+ if (!ctx) {
39239
+ process.stderr.write("Error: Not authenticated\n");
39240
+ process.exit(1);
39241
+ }
39242
+ const args = {};
39243
+ if (opts.mode !== void 0)
39244
+ args.mode = opts.mode;
39245
+ if (opts.take !== void 0)
39246
+ args.take = Number(opts.take);
39247
+ if (opts.skip !== void 0)
39248
+ args.skip = Number(opts.skip);
39249
+ await ctx.execute({
39250
+ method: "GET",
39251
+ path: "/v1/agents/plans",
39252
+ args,
39253
+ queryParamKeys: ["mode", "take", "skip"]
39254
+ });
39255
+ });
39256
+ 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>", `Human-readable resource name.`).option("--rate-card-id <value>", `Rate card reference. On policy writes, omission preserves the current reference and null detaches it; on plan replacement omission clears it.`).option("--overage-mode <value>", `Behavior when credits or an allowance are exhausted. Policy values may inherit the attached plan.
39257
+
39258
+ - refuse: Rejects the call that crosses the boundary without deducting usage.
39259
+ - metered: Prices the whole call as monetary overage, using the overage card or USD provider cost plus markup.`).option("--markup-percent <value>", `Percentage added to resolved cost. Null on writes means no override; an attached plan may supply the value.`).option("--overage-markup-percent <value>", `Percentage added to provider cost for overage. Mutually exclusive with overage_rate_card_id.`).option("--overage-rate-card-id <value>", `Currency rate card used to price overage directly. Null means provider cost plus the resolved overage markup.`).option("--windows <json>", `Rolling allowances. Required for windows plans; each window meters every call. A plan replacement replaces the entire array.`).option("--per-seat-credits <value>", `Credits granted per seat per billing period. Null grants no credits.`).option("--grant-rollover-enabled", `Whether granted credits survive renewal. Purchased credits always roll over.`).option("--settlement-interval-minutes <number>", `Settlement interval in minutes. Null means no interval override. Mutually exclusive with settlement_schedule.`).option("--settlement-schedule <value>", `Calendar settlement schedule. Null clears the override; mutually exclusive with settlement_interval_minutes.
39260
+
39261
+ - calendar_month: Settles at the end of each UTC calendar month.`).requiredOption("--mode <value>", `Billing mode.
39262
+
39263
+ - wallet: Charges a monetary wallet.
39264
+ - credits: Consumes a credit balance.
39265
+ - windows: Meters weighted units against rolling allowances.`).addHelpText("after", `
39266
+ Examples:
39267
+ hyperline agents create-agent-plan --name <name> --mode <mode>
39268
+ hyperline agents create-agent-plan --name <name> --mode <mode> --rate-card-id <rate_card_id> --overage-mode <overage_mode>
39269
+ hyperline agents create-agent-plan --name <name> --mode <mode> --output json`).action(async (opts) => {
39270
+ const ctx = resource.parent?.opts()._ctx;
39271
+ if (!ctx) {
39272
+ process.stderr.write("Error: Not authenticated\n");
39273
+ process.exit(1);
39274
+ }
39275
+ const args = {};
39276
+ if (opts.name !== void 0)
39277
+ args.name = opts.name;
39278
+ if (opts.rateCardId !== void 0)
39279
+ args.rate_card_id = opts.rateCardId;
39280
+ if (opts.overageMode !== void 0)
39281
+ args.overage_mode = opts.overageMode;
39282
+ if (opts.markupPercent !== void 0)
39283
+ args.markup_percent = opts.markupPercent;
39284
+ if (opts.overageMarkupPercent !== void 0)
39285
+ args.overage_markup_percent = opts.overageMarkupPercent;
39286
+ if (opts.overageRateCardId !== void 0)
39287
+ args.overage_rate_card_id = opts.overageRateCardId;
39288
+ if (opts.perSeatCredits !== void 0)
39289
+ args.per_seat_credits = opts.perSeatCredits;
39290
+ if (opts.settlementSchedule !== void 0)
39291
+ args.settlement_schedule = opts.settlementSchedule;
39292
+ if (opts.mode !== void 0)
39293
+ args.mode = opts.mode;
39294
+ if (opts.settlementIntervalMinutes !== void 0)
39295
+ args.settlement_interval_minutes = Number(opts.settlementIntervalMinutes);
39296
+ if (opts.grantRolloverEnabled !== void 0)
39297
+ args.grant_rollover_enabled = true;
39298
+ if (opts.windows !== void 0)
39299
+ args.windows = JSON.parse(opts.windows);
39300
+ await ctx.execute({
39301
+ method: "POST",
39302
+ path: "/v1/agents/plans",
39303
+ args,
39304
+ queryParamKeys: []
39305
+ });
39306
+ });
39307
+ 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", `
39308
+ Examples:
39309
+ hyperline agents get-agent-plan --plan-id <plan_id>`).action(async (opts) => {
39310
+ const ctx = resource.parent?.opts()._ctx;
39311
+ if (!ctx) {
39312
+ process.stderr.write("Error: Not authenticated\n");
39313
+ process.exit(1);
39314
+ }
39315
+ const args = {};
39316
+ if (opts.planId !== void 0)
39317
+ args.plan_id = opts.planId;
39318
+ await ctx.execute({
39319
+ method: "GET",
39320
+ path: "/v1/agents/plans/{plan_id}",
39321
+ args,
39322
+ queryParamKeys: []
39323
+ });
39324
+ });
39325
+ 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>", `Human-readable resource name.`).option("--rate-card-id <value>", `Rate card reference. On policy writes, omission preserves the current reference and null detaches it; on plan replacement omission clears it.`).option("--overage-mode <value>", `Behavior when credits or an allowance are exhausted. Policy values may inherit the attached plan.
39326
+
39327
+ - refuse: Rejects the call that crosses the boundary without deducting usage.
39328
+ - metered: Prices the whole call as monetary overage, using the overage card or USD provider cost plus markup.`).option("--markup-percent <value>", `Percentage added to resolved cost. Null on writes means no override; an attached plan may supply the value.`).option("--overage-markup-percent <value>", `Percentage added to provider cost for overage. Mutually exclusive with overage_rate_card_id.`).option("--overage-rate-card-id <value>", `Currency rate card used to price overage directly. Null means provider cost plus the resolved overage markup.`).option("--windows <json>", `Rolling allowances. Required for windows plans; each window meters every call. A plan replacement replaces the entire array.`).option("--per-seat-credits <value>", `Credits granted per seat per billing period. Null grants no credits.`).option("--grant-rollover-enabled", `Whether granted credits survive renewal. Purchased credits always roll over.`).option("--settlement-interval-minutes <number>", `Settlement interval in minutes. Null means no interval override. Mutually exclusive with settlement_schedule.`).option("--settlement-schedule <value>", `Calendar settlement schedule. Null clears the override; mutually exclusive with settlement_interval_minutes.
39329
+
39330
+ - calendar_month: Settles at the end of each UTC calendar month.`).addHelpText("after", `
39331
+ Examples:
39332
+ hyperline agents replace-agent-plan --plan-id <plan_id> --name <name>
39333
+ hyperline agents replace-agent-plan --plan-id <plan_id> --name <name> --rate-card-id <rate_card_id> --overage-mode <overage_mode>
39334
+ hyperline agents replace-agent-plan --plan-id <plan_id> --name <name> --output json`).action(async (opts) => {
39335
+ const ctx = resource.parent?.opts()._ctx;
39336
+ if (!ctx) {
39337
+ process.stderr.write("Error: Not authenticated\n");
39338
+ process.exit(1);
39339
+ }
39340
+ const args = {};
39341
+ if (opts.planId !== void 0)
39342
+ args.plan_id = opts.planId;
39343
+ if (opts.name !== void 0)
39344
+ args.name = opts.name;
39345
+ if (opts.rateCardId !== void 0)
39346
+ args.rate_card_id = opts.rateCardId;
39347
+ if (opts.overageMode !== void 0)
39348
+ args.overage_mode = opts.overageMode;
39349
+ if (opts.markupPercent !== void 0)
39350
+ args.markup_percent = opts.markupPercent;
39351
+ if (opts.overageMarkupPercent !== void 0)
39352
+ args.overage_markup_percent = opts.overageMarkupPercent;
39353
+ if (opts.overageRateCardId !== void 0)
39354
+ args.overage_rate_card_id = opts.overageRateCardId;
39355
+ if (opts.perSeatCredits !== void 0)
39356
+ args.per_seat_credits = opts.perSeatCredits;
39357
+ if (opts.settlementSchedule !== void 0)
39358
+ args.settlement_schedule = opts.settlementSchedule;
39359
+ if (opts.settlementIntervalMinutes !== void 0)
39360
+ args.settlement_interval_minutes = Number(opts.settlementIntervalMinutes);
39361
+ if (opts.grantRolloverEnabled !== void 0)
39362
+ args.grant_rollover_enabled = true;
39363
+ if (opts.windows !== void 0)
39364
+ args.windows = JSON.parse(opts.windows);
39365
+ await ctx.execute({
39366
+ method: "PUT",
39367
+ path: "/v1/agents/plans/{plan_id}",
39368
+ args,
39369
+ queryParamKeys: []
39370
+ });
39371
+ });
39372
+ 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", `
39373
+ Examples:
39374
+ hyperline agents delete-agent-plan --plan-id <plan_id>
39375
+ hyperline agents delete-agent-plan --plan-id <plan_id> --output json`).action(async (opts) => {
39376
+ const ctx = resource.parent?.opts()._ctx;
39377
+ if (!ctx) {
39378
+ process.stderr.write("Error: Not authenticated\n");
39379
+ process.exit(1);
39380
+ }
39381
+ const args = {};
39382
+ if (opts.planId !== void 0)
39383
+ args.plan_id = opts.planId;
39384
+ if (!opts.yes) {
39385
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
39386
+ if (!confirmed) {
39387
+ process.stdout.write("Aborted.\n");
39388
+ return;
39389
+ }
39390
+ }
39391
+ await ctx.execute({
39392
+ method: "DELETE",
39393
+ path: "/v1/agents/plans/{plan_id}",
39394
+ args,
39395
+ queryParamKeys: []
39396
+ });
39397
+ });
39398
+ 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", `
39399
+ Examples:
39400
+ hyperline agents get-agent-default-plan`).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
+ await ctx.execute({
39408
+ method: "GET",
39409
+ path: "/v1/agents/default-plan",
39410
+ args,
39411
+ queryParamKeys: []
39412
+ });
39413
+ });
39414
+ 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>", `Billing plan reference. On policy writes, omission preserves the current plan and null detaches it.`).option("--auto-apply", `Whether eligible newly ingested customers receive the default plan automatically.`).addHelpText("after", `
39415
+ Examples:
39416
+ hyperline agents set-agent-default-plan --plan-id <plan_id>
39417
+ hyperline agents set-agent-default-plan --plan-id <plan_id> --auto-apply
39418
+ hyperline agents set-agent-default-plan --plan-id <plan_id> --output json`).action(async (opts) => {
39419
+ const ctx = resource.parent?.opts()._ctx;
39420
+ if (!ctx) {
39421
+ process.stderr.write("Error: Not authenticated\n");
39422
+ process.exit(1);
39423
+ }
39424
+ const args = {};
39425
+ if (opts.planId !== void 0)
39426
+ args.plan_id = opts.planId;
39427
+ if (opts.autoApply !== void 0)
39428
+ args.auto_apply = true;
39429
+ await ctx.execute({
39430
+ method: "PUT",
39431
+ path: "/v1/agents/default-plan",
39432
+ args,
39433
+ queryParamKeys: []
39434
+ });
39435
+ });
39436
+ 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", `
39437
+ Examples:
39438
+ hyperline agents clear-agent-default-plan
39439
+ hyperline agents clear-agent-default-plan --output json`).action(async (opts) => {
39440
+ const ctx = resource.parent?.opts()._ctx;
39441
+ if (!ctx) {
39442
+ process.stderr.write("Error: Not authenticated\n");
39443
+ process.exit(1);
39444
+ }
39445
+ const args = {};
39446
+ if (!opts.yes) {
39447
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
39448
+ if (!confirmed) {
39449
+ process.stdout.write("Aborted.\n");
39450
+ return;
39451
+ }
39452
+ }
39453
+ await ctx.execute({
39454
+ method: "DELETE",
39455
+ path: "/v1/agents/default-plan",
39456
+ args,
39457
+ queryParamKeys: []
39458
+ });
39459
+ });
39460
+ 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>", `Unit in which rate-card prices are expressed.
39461
+
39462
+ - credits: Credit counts.
39463
+ - units: Weighted rolling-allowance units.
39464
+ - currency: Major units of the specified currency.`).option("--currency <value>", `Currency code. See [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes).`).option("--search <value>", `search`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
39465
+ Examples:
39466
+ hyperline agents list-agent-rate-cards
39467
+ hyperline agents list-agent-rate-cards --denomination <denomination> --currency <currency>`).action(async (opts) => {
39468
+ const ctx = resource.parent?.opts()._ctx;
39469
+ if (!ctx) {
39470
+ process.stderr.write("Error: Not authenticated\n");
39471
+ process.exit(1);
39472
+ }
39473
+ const args = {};
39474
+ if (opts.denomination !== void 0)
39475
+ args.denomination = opts.denomination;
39476
+ if (opts.currency !== void 0)
39477
+ args.currency = opts.currency;
39478
+ if (opts.search !== void 0)
39479
+ args.search = opts.search;
39480
+ if (opts.take !== void 0)
39481
+ args.take = Number(opts.take);
39482
+ if (opts.skip !== void 0)
39483
+ args.skip = Number(opts.skip);
39484
+ await ctx.execute({
39485
+ method: "GET",
39486
+ path: "/v1/agents/rate-cards",
39487
+ args,
39488
+ queryParamKeys: ["denomination", "currency", "search", "take", "skip"]
39489
+ });
39490
+ });
39491
+ 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>", `Human-readable resource name.`).option("--fallback-per-usd <value>", `Credits, allowance units, or major currency units per USD of provider cost. Null leaves unmatched usage unpriced.`).requiredOption("--rows <json>", `All pricing rows on the card; replacement replaces the complete list.`).requiredOption("--denomination <value>", `Unit in which rate-card prices are expressed.
39492
+
39493
+ - credits: Credit counts.
39494
+ - units: Weighted rolling-allowance units.
39495
+ - currency: Major units of the specified currency.`).option("--currency <value>", `ISO 4217 currency code for monetary values. Null for counts or historical amounts without recorded currency.`).addHelpText("after", `
39496
+ Examples:
39497
+ hyperline agents create-agent-rate-card --name <name> --rows <rows> --denomination <denomination>
39498
+ hyperline agents create-agent-rate-card --name <name> --rows <rows> --denomination <denomination> --fallback-per-usd <fallback_per_usd> --currency <currency>
39499
+ hyperline agents create-agent-rate-card --name <name> --rows <rows> --denomination <denomination> --output json`).action(async (opts) => {
39500
+ const ctx = resource.parent?.opts()._ctx;
39501
+ if (!ctx) {
39502
+ process.stderr.write("Error: Not authenticated\n");
39503
+ process.exit(1);
39504
+ }
39505
+ const args = {};
39506
+ if (opts.name !== void 0)
39507
+ args.name = opts.name;
39508
+ if (opts.fallbackPerUsd !== void 0)
39509
+ args.fallback_per_usd = opts.fallbackPerUsd;
39510
+ if (opts.denomination !== void 0)
39511
+ args.denomination = opts.denomination;
39512
+ if (opts.currency !== void 0)
39513
+ args.currency = opts.currency;
39514
+ if (opts.rows !== void 0)
39515
+ args.rows = JSON.parse(opts.rows);
39516
+ await ctx.execute({
39517
+ method: "POST",
39518
+ path: "/v1/agents/rate-cards",
39519
+ args,
39520
+ queryParamKeys: []
39521
+ });
39522
+ });
39523
+ 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", `
39524
+ Examples:
39525
+ hyperline agents get-agent-rate-card --rate-card-id <rate_card_id>`).action(async (opts) => {
39526
+ const ctx = resource.parent?.opts()._ctx;
39527
+ if (!ctx) {
39528
+ process.stderr.write("Error: Not authenticated\n");
39529
+ process.exit(1);
39530
+ }
39531
+ const args = {};
39532
+ if (opts.rateCardId !== void 0)
39533
+ args.rate_card_id = opts.rateCardId;
39534
+ await ctx.execute({
39535
+ method: "GET",
39536
+ path: "/v1/agents/rate-cards/{rate_card_id}",
39537
+ args,
39538
+ queryParamKeys: []
39539
+ });
39540
+ });
39541
+ 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>", `Human-readable resource name.`).option("--fallback-per-usd <value>", `Credits, allowance units, or major currency units per USD of provider cost. Null leaves unmatched usage unpriced.`).requiredOption("--rows <json>", `All pricing rows on the card; replacement replaces the complete list.`).addHelpText("after", `
39542
+ Examples:
39543
+ hyperline agents replace-agent-rate-card --rate-card-id <rate_card_id> --name <name> --rows <rows>
39544
+ hyperline agents replace-agent-rate-card --rate-card-id <rate_card_id> --name <name> --rows <rows> --fallback-per-usd <fallback_per_usd>
39545
+ hyperline agents replace-agent-rate-card --rate-card-id <rate_card_id> --name <name> --rows <rows> --output json`).action(async (opts) => {
39546
+ const ctx = resource.parent?.opts()._ctx;
39547
+ if (!ctx) {
39548
+ process.stderr.write("Error: Not authenticated\n");
39549
+ process.exit(1);
39550
+ }
39551
+ const args = {};
39552
+ if (opts.rateCardId !== void 0)
39553
+ args.rate_card_id = opts.rateCardId;
39554
+ if (opts.name !== void 0)
39555
+ args.name = opts.name;
39556
+ if (opts.fallbackPerUsd !== void 0)
39557
+ args.fallback_per_usd = opts.fallbackPerUsd;
39558
+ if (opts.rows !== void 0)
39559
+ args.rows = JSON.parse(opts.rows);
39560
+ await ctx.execute({
39561
+ method: "PUT",
39562
+ path: "/v1/agents/rate-cards/{rate_card_id}",
39563
+ args,
39564
+ queryParamKeys: []
39565
+ });
39566
+ });
39567
+ 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", `
39568
+ Examples:
39569
+ hyperline agents delete-agent-rate-card --rate-card-id <rate_card_id>
39570
+ hyperline agents delete-agent-rate-card --rate-card-id <rate_card_id> --output json`).action(async (opts) => {
39571
+ const ctx = resource.parent?.opts()._ctx;
39572
+ if (!ctx) {
39573
+ process.stderr.write("Error: Not authenticated\n");
39574
+ process.exit(1);
39575
+ }
39576
+ const args = {};
39577
+ if (opts.rateCardId !== void 0)
39578
+ args.rate_card_id = opts.rateCardId;
39579
+ if (!opts.yes) {
39580
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
39581
+ if (!confirmed) {
39582
+ process.stdout.write("Aborted.\n");
39583
+ return;
39584
+ }
39585
+ }
39586
+ await ctx.execute({
39587
+ method: "DELETE",
39588
+ path: "/v1/agents/rate-cards/{rate_card_id}",
39589
+ args,
39590
+ queryParamKeys: []
39591
+ });
39592
+ });
39593
+ 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", `
39594
+ Examples:
39595
+ hyperline agents list-agent-credit-products`).action(async (_opts) => {
39596
+ const ctx = resource.parent?.opts()._ctx;
39597
+ if (!ctx) {
39598
+ process.stderr.write("Error: Not authenticated\n");
39599
+ process.exit(1);
39600
+ }
39601
+ const args = {};
39602
+ await ctx.execute({
39603
+ method: "GET",
39604
+ path: "/v1/agents/credit-products",
39605
+ args,
39606
+ queryParamKeys: []
39607
+ });
39608
+ });
39609
+ 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", `
39610
+ Examples:
39611
+ hyperline agents list-agent-cost-catalog
39612
+ hyperline agents list-agent-cost-catalog --enabled-only <enabled_only>`).action(async (opts) => {
39613
+ const ctx = resource.parent?.opts()._ctx;
39614
+ if (!ctx) {
39615
+ process.stderr.write("Error: Not authenticated\n");
39616
+ process.exit(1);
39617
+ }
39618
+ const args = {};
39619
+ if (opts.enabledOnly !== void 0)
39620
+ args.enabled_only = opts.enabledOnly;
39621
+ await ctx.execute({
39622
+ method: "GET",
39623
+ path: "/v1/agents/cost-catalog",
39624
+ args,
39625
+ queryParamKeys: ["enabled_only"]
39626
+ });
39627
+ });
39628
+ 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>", `AI model provider, or the vendor of a custom cost item. This is not an integration connection.`).requiredOption("--item <value>", `Custom item name matching the usage payload.`).requiredOption("--dimensions <json>", `Additional billable dimensions; each key matches a usage_extra key and rates use the owning card's units or USD for cost-catalog dimensions.`).addHelpText("after", `
39629
+ Examples:
39630
+ hyperline agents create-agent-cost-catalog-item --provider <provider> --item <item> --dimensions <dimensions>
39631
+ hyperline agents create-agent-cost-catalog-item --provider <provider> --item <item> --dimensions <dimensions> --output json`).action(async (opts) => {
39632
+ const ctx = resource.parent?.opts()._ctx;
39633
+ if (!ctx) {
39634
+ process.stderr.write("Error: Not authenticated\n");
39635
+ process.exit(1);
39636
+ }
39637
+ const args = {};
39638
+ if (opts.provider !== void 0)
39639
+ args.provider = opts.provider;
39640
+ if (opts.item !== void 0)
39641
+ args.item = opts.item;
39642
+ if (opts.dimensions !== void 0)
39643
+ args.dimensions = JSON.parse(opts.dimensions);
39644
+ await ctx.execute({
39645
+ method: "POST",
39646
+ path: "/v1/agents/cost-catalog/items",
39647
+ args,
39648
+ queryParamKeys: []
39649
+ });
39650
+ });
39651
+ 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", `
39652
+ Examples:
39653
+ hyperline agents delete-agent-cost-catalog-item --item-id <item_id>
39654
+ hyperline agents delete-agent-cost-catalog-item --item-id <item_id> --output json`).action(async (opts) => {
39655
+ const ctx = resource.parent?.opts()._ctx;
39656
+ if (!ctx) {
39657
+ process.stderr.write("Error: Not authenticated\n");
39658
+ process.exit(1);
39659
+ }
39660
+ const args = {};
39661
+ if (opts.itemId !== void 0)
39662
+ args.item_id = opts.itemId;
39663
+ if (!opts.yes) {
39664
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
39665
+ if (!confirmed) {
39666
+ process.stdout.write("Aborted.\n");
39667
+ return;
39668
+ }
39669
+ }
39670
+ await ctx.execute({
39671
+ method: "DELETE",
39672
+ path: "/v1/agents/cost-catalog/items/{item_id}",
39673
+ args,
39674
+ queryParamKeys: []
39675
+ });
39676
+ });
39677
+ 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>", `AI model provider, or the vendor of a custom cost item. This is not an integration connection.`).requiredOption("--model <value>", `Model identifier, or custom item identifier. Null on wildcard pricing rows.`).requiredOption("--input-per-m-tokens <value>", `Provider cost in USD per million input tokens, as an exact decimal string.`).requiredOption("--output-per-m-tokens <value>", `Provider cost in USD per million output tokens, as an exact decimal string.`).option("--cached-input-per-m-tokens <value>", `Provider cost in USD per million cached input tokens, as an exact decimal string.`).option("--cache-write-per-m-tokens <value>", `Provider cost in USD per million cache write tokens, as an exact decimal string.`).option("--dimensions <json>", `Additional billable dimensions; each key matches a usage_extra key and rates use the owning card's units or USD for cost-catalog dimensions.`).addHelpText("after", `
39678
+ Examples:
39679
+ 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>
39680
+ 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>
39681
+ 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) => {
39682
+ const ctx = resource.parent?.opts()._ctx;
39683
+ if (!ctx) {
39684
+ process.stderr.write("Error: Not authenticated\n");
39685
+ process.exit(1);
39686
+ }
39687
+ const args = {};
39688
+ if (opts.provider !== void 0)
39689
+ args.provider = opts.provider;
39690
+ if (opts.model !== void 0)
39691
+ args.model = opts.model;
39692
+ if (opts.inputPerMTokens !== void 0)
39693
+ args.input_per_m_tokens = opts.inputPerMTokens;
39694
+ if (opts.outputPerMTokens !== void 0)
39695
+ args.output_per_m_tokens = opts.outputPerMTokens;
39696
+ if (opts.cachedInputPerMTokens !== void 0)
39697
+ args.cached_input_per_m_tokens = opts.cachedInputPerMTokens;
39698
+ if (opts.cacheWritePerMTokens !== void 0)
39699
+ args.cache_write_per_m_tokens = opts.cacheWritePerMTokens;
39700
+ if (opts.dimensions !== void 0)
39701
+ args.dimensions = JSON.parse(opts.dimensions);
39702
+ await ctx.execute({
39703
+ method: "PUT",
39704
+ path: "/v1/agents/cost-catalog/overrides",
39705
+ args,
39706
+ queryParamKeys: []
39707
+ });
39708
+ });
39709
+ 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", `
39710
+ Examples:
39711
+ hyperline agents delete-agent-cost-catalog-override --override-id <override_id>
39712
+ hyperline agents delete-agent-cost-catalog-override --override-id <override_id> --output json`).action(async (opts) => {
39713
+ const ctx = resource.parent?.opts()._ctx;
39714
+ if (!ctx) {
39715
+ process.stderr.write("Error: Not authenticated\n");
39716
+ process.exit(1);
39717
+ }
39718
+ const args = {};
39719
+ if (opts.overrideId !== void 0)
39720
+ args.override_id = opts.overrideId;
39721
+ if (!opts.yes) {
39722
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
39723
+ if (!confirmed) {
39724
+ process.stdout.write("Aborted.\n");
39725
+ return;
39726
+ }
39727
+ }
39728
+ await ctx.execute({
39729
+ method: "DELETE",
39730
+ path: "/v1/agents/cost-catalog/overrides/{override_id}",
39731
+ args,
39732
+ queryParamKeys: []
39733
+ });
39734
+ });
39735
+ 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", `
39736
+ Examples:
39737
+ hyperline agents list-agent-customer-policies --customer-id <customer_id>`).action(async (opts) => {
39738
+ const ctx = resource.parent?.opts()._ctx;
39739
+ if (!ctx) {
39740
+ process.stderr.write("Error: Not authenticated\n");
39741
+ process.exit(1);
39742
+ }
39743
+ const args = {};
39744
+ if (opts.customerId !== void 0)
39745
+ args.customer_id = opts.customerId;
39746
+ await ctx.execute({
39747
+ method: "GET",
39748
+ path: "/v1/agents/customers/{customer_id}/policies",
39749
+ args,
39750
+ queryParamKeys: []
39751
+ });
39752
+ });
39753
+ 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 scope identifier. Null on scoped results denotes the customer's shared pool.`).addHelpText("after", `
39754
+ Examples:
39755
+ hyperline agents get-agent-customer-policy --customer-id <customer_id>
39756
+ hyperline agents get-agent-customer-policy --customer-id <customer_id> --agent <agent>`).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
+ await ctx.execute({
39768
+ method: "GET",
39769
+ path: "/v1/agents/customers/{customer_id}/policy",
39770
+ args,
39771
+ queryParamKeys: ["agent"]
39772
+ });
39773
+ });
39774
+ 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 scope identifier. Null on scoped results denotes the customer's shared pool.`).requiredOption("--mode <value>", `Billing mode.
39775
+
39776
+ - wallet: Charges a monetary wallet.
39777
+ - credits: Consumes a credit balance.
39778
+ - windows: Meters weighted units against rolling allowances.`).option("--wallet-id <value>", `Customer wallet identifier. Omit on wallet policy writes to provision or reuse the customer's wallet.`).option("--credit-product-id <value>", `Public credit product identifier whose balance this policy consumes.`).option("--markup-percent <value>", `Percentage added to resolved cost. Null on writes means no override; an attached plan may supply the value.`).option("--overage-mode <value>", `Behavior when credits or an allowance are exhausted. Policy values may inherit the attached plan.
39779
+
39780
+ - refuse: Rejects the call that crosses the boundary without deducting usage.
39781
+ - metered: Prices the whole call as monetary overage, using the overage card or USD provider cost plus markup.`).option("--overage-markup-percent <value>", `Percentage added to provider cost for overage. Mutually exclusive with overage_rate_card_id.`).option("--overage-rate-card-id <value>", `Currency rate card used to price overage directly. Null means provider cost plus the resolved overage markup.`).option("--overage-wallet-id <value>", `Wallet charged for overage. Null bills overage in arrears.`).option("--floor <value>", `Minimum available balance a spend check requires, in the policy's denomination.`).option("--settlement-interval-minutes <number>", `Settlement interval in minutes. Null means no interval override. Mutually exclusive with settlement_schedule.`).option("--settlement-schedule <value>", `Calendar settlement schedule. Null clears the override; mutually exclusive with settlement_interval_minutes.
39782
+
39783
+ - calendar_month: Settles at the end of each UTC calendar month.`).option("--credit-rates <json>", `Inline credit pricing. Mutually exclusive with rate_card_id. Omitted rates may be supplied by a plan or product default.`).option("--window-rates <json>", `Window definitions and optional inline unit rates. An attached plan may supply omitted definitions; rate_card_id may supply unit rates.`).option("--rate-card-id <value>", `Rate card reference. On policy writes, omission preserves the current reference and null detaches it; on plan replacement omission clears it.`).option("--plan-id <value>", `Billing plan reference. On policy writes, omission preserves the current plan and null detaches it.`).requiredOption("--blocked", `Whether spending is disabled for this billing scope.`).addHelpText("after", `
39784
+ Examples:
39785
+ hyperline agents upsert-agent-customer-policy --customer-id <customer_id> --mode <mode> --blocked
39786
+ hyperline agents upsert-agent-customer-policy --customer-id <customer_id> --mode <mode> --blocked --agent <agent> --wallet-id <wallet_id>
39787
+ hyperline agents upsert-agent-customer-policy --customer-id <customer_id> --mode <mode> --blocked --output json`).action(async (opts) => {
39788
+ const ctx = resource.parent?.opts()._ctx;
39789
+ if (!ctx) {
39790
+ process.stderr.write("Error: Not authenticated\n");
39791
+ process.exit(1);
39792
+ }
39793
+ const args = {};
39794
+ if (opts.customerId !== void 0)
39795
+ args.customer_id = opts.customerId;
39796
+ if (opts.agent !== void 0)
39797
+ args.agent = opts.agent;
39798
+ if (opts.mode !== void 0)
39799
+ args.mode = opts.mode;
39800
+ if (opts.walletId !== void 0)
39801
+ args.wallet_id = opts.walletId;
39802
+ if (opts.creditProductId !== void 0)
39803
+ args.credit_product_id = opts.creditProductId;
39804
+ if (opts.markupPercent !== void 0)
39805
+ args.markup_percent = opts.markupPercent;
39806
+ if (opts.overageMode !== void 0)
39807
+ args.overage_mode = opts.overageMode;
39808
+ if (opts.overageMarkupPercent !== void 0)
39809
+ args.overage_markup_percent = opts.overageMarkupPercent;
39810
+ if (opts.overageRateCardId !== void 0)
39811
+ args.overage_rate_card_id = opts.overageRateCardId;
39812
+ if (opts.overageWalletId !== void 0)
39813
+ args.overage_wallet_id = opts.overageWalletId;
39814
+ if (opts.floor !== void 0)
39815
+ args.floor = opts.floor;
39816
+ if (opts.settlementSchedule !== void 0)
39817
+ args.settlement_schedule = opts.settlementSchedule;
39818
+ if (opts.rateCardId !== void 0)
39819
+ args.rate_card_id = opts.rateCardId;
39820
+ if (opts.planId !== void 0)
39821
+ args.plan_id = opts.planId;
39822
+ if (opts.settlementIntervalMinutes !== void 0)
39823
+ args.settlement_interval_minutes = Number(opts.settlementIntervalMinutes);
39824
+ if (opts.blocked !== void 0)
39825
+ args.blocked = true;
39826
+ if (opts.creditRates !== void 0)
39827
+ args.credit_rates = JSON.parse(opts.creditRates);
39828
+ if (opts.windowRates !== void 0)
39829
+ args.window_rates = JSON.parse(opts.windowRates);
39830
+ await ctx.execute({
39831
+ method: "PUT",
39832
+ path: "/v1/agents/customers/{customer_id}/policy",
39833
+ args,
39834
+ queryParamKeys: ["agent"]
39835
+ });
39836
+ });
39837
+ 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 scope identifier. Null on scoped results denotes the customer's shared pool.`).option("--yes", "Skip confirmation").addHelpText("after", `
39838
+ Examples:
39839
+ hyperline agents delete-agent-customer-policy --customer-id <customer_id>
39840
+ hyperline agents delete-agent-customer-policy --customer-id <customer_id> --agent <agent>
39841
+ hyperline agents delete-agent-customer-policy --customer-id <customer_id> --output json`).action(async (opts) => {
39842
+ const ctx = resource.parent?.opts()._ctx;
39843
+ if (!ctx) {
39844
+ process.stderr.write("Error: Not authenticated\n");
39845
+ process.exit(1);
39846
+ }
39847
+ const args = {};
39848
+ if (opts.customerId !== void 0)
39849
+ args.customer_id = opts.customerId;
39850
+ if (opts.agent !== void 0)
39851
+ args.agent = opts.agent;
39852
+ if (!opts.yes) {
39853
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
39854
+ if (!confirmed) {
39855
+ process.stdout.write("Aborted.\n");
39856
+ return;
39857
+ }
39858
+ }
39859
+ await ctx.execute({
39860
+ method: "DELETE",
39861
+ path: "/v1/agents/customers/{customer_id}/policy",
39862
+ args,
39863
+ queryParamKeys: ["agent"]
39864
+ });
39865
+ });
39866
+ 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", `
39867
+ Examples:
39868
+ hyperline agents apply-agent-default-plan --customer-id <customer_id>
39869
+ hyperline agents apply-agent-default-plan --customer-id <customer_id> --output json`).action(async (opts) => {
39870
+ const ctx = resource.parent?.opts()._ctx;
39871
+ if (!ctx) {
39872
+ process.stderr.write("Error: Not authenticated\n");
39873
+ process.exit(1);
39874
+ }
39875
+ const args = {};
39876
+ if (opts.customerId !== void 0)
39877
+ args.customer_id = opts.customerId;
39878
+ await ctx.execute({
39879
+ method: "POST",
39880
+ path: "/v1/agents/customers/{customer_id}/apply-default-plan",
39881
+ args,
39882
+ queryParamKeys: []
39883
+ });
39884
+ });
39885
+ 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 scope identifier. Null on scoped results denotes the customer's shared pool.`).addHelpText("after", `
39886
+ Examples:
39887
+ hyperline agents get-agent-customer-balance --customer-id <customer_id>
39888
+ hyperline agents get-agent-customer-balance --customer-id <customer_id> --agent <agent>`).action(async (opts) => {
39889
+ const ctx = resource.parent?.opts()._ctx;
39890
+ if (!ctx) {
39891
+ process.stderr.write("Error: Not authenticated\n");
39892
+ process.exit(1);
39893
+ }
39894
+ const args = {};
39895
+ if (opts.customerId !== void 0)
39896
+ args.customer_id = opts.customerId;
39897
+ if (opts.agent !== void 0)
39898
+ args.agent = opts.agent;
39899
+ await ctx.execute({
39900
+ method: "GET",
39901
+ path: "/v1/agents/customers/{customer_id}/balance",
39902
+ args,
39903
+ queryParamKeys: ["agent"]
39904
+ });
39905
+ });
39906
+ 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 scope identifier. Null on scoped results denotes the customer's shared pool.`).addHelpText("after", `
39907
+ Examples:
39908
+ hyperline agents reset-agent-customer-windows --customer-id <customer_id>
39909
+ hyperline agents reset-agent-customer-windows --customer-id <customer_id> --agent <agent>
39910
+ hyperline agents reset-agent-customer-windows --customer-id <customer_id> --output json`).action(async (opts) => {
39911
+ const ctx = resource.parent?.opts()._ctx;
39912
+ if (!ctx) {
39913
+ process.stderr.write("Error: Not authenticated\n");
39914
+ process.exit(1);
39915
+ }
39916
+ const args = {};
39917
+ if (opts.customerId !== void 0)
39918
+ args.customer_id = opts.customerId;
39919
+ if (opts.agent !== void 0)
39920
+ args.agent = opts.agent;
39921
+ await ctx.execute({
39922
+ method: "POST",
39923
+ path: "/v1/agents/customers/{customer_id}/windows/reset",
39924
+ args,
39925
+ queryParamKeys: ["agent"]
39926
+ });
39927
+ });
39928
+ 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 slug. An empty string selects the shared pool; omission includes all scopes.`).option("--overage <value>", `Filter by overage status. Omit to include both ordinary and overage entries.`).option("--from <value>", `UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--to <value>", `UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--take <number>", `take`).option("--skip <number>", `skip`).addHelpText("after", `
39929
+ Examples:
39930
+ hyperline agents list-agent-customer-consumption --customer-id <customer_id>
39931
+ hyperline agents list-agent-customer-consumption --customer-id <customer_id> --agent <agent> --overage <overage>`).action(async (opts) => {
39932
+ const ctx = resource.parent?.opts()._ctx;
39933
+ if (!ctx) {
39934
+ process.stderr.write("Error: Not authenticated\n");
39935
+ process.exit(1);
39936
+ }
39937
+ const args = {};
39938
+ if (opts.customerId !== void 0)
39939
+ args.customer_id = opts.customerId;
39940
+ if (opts.agent !== void 0)
39941
+ args.agent = opts.agent;
39942
+ if (opts.overage !== void 0)
39943
+ args.overage = opts.overage;
39944
+ if (opts.from !== void 0)
39945
+ args.from = opts.from;
39946
+ if (opts.to !== void 0)
39947
+ args.to = opts.to;
39948
+ if (opts.take !== void 0)
39949
+ args.take = Number(opts.take);
39950
+ if (opts.skip !== void 0)
39951
+ args.skip = Number(opts.skip);
39952
+ await ctx.execute({
39953
+ method: "GET",
39954
+ path: "/v1/agents/customers/{customer_id}/consumption",
39955
+ args,
39956
+ queryParamKeys: ["agent", "overage", "from", "to", "take", "skip"]
39957
+ });
39958
+ });
39959
+ 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", `
39960
+ Examples:
39961
+ hyperline agents get-agent-customer-overview --customer-id <customer_id>`).action(async (opts) => {
39962
+ const ctx = resource.parent?.opts()._ctx;
39963
+ if (!ctx) {
39964
+ process.stderr.write("Error: Not authenticated\n");
39965
+ process.exit(1);
39966
+ }
39967
+ const args = {};
39968
+ if (opts.customerId !== void 0)
39969
+ args.customer_id = opts.customerId;
39970
+ await ctx.execute({
39971
+ method: "GET",
39972
+ path: "/v1/agents/customers/{customer_id}/overview",
39973
+ args,
39974
+ queryParamKeys: []
39975
+ });
39976
+ });
39977
+ }
39978
+
39979
+ // build/commands/generated/aggregators.js
39980
+ function registerAggregatorsCommands(parent) {
39981
+ const resource = parent.command("aggregators").description("Manage aggregators");
39982
+ 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", `
39983
+ Examples:
39984
+ hyperline aggregators list
39985
+ hyperline aggregators list --take <take>`).action(async (opts) => {
39986
+ const ctx = resource.parent?.opts()._ctx;
39987
+ if (!ctx) {
39988
+ process.stderr.write("Error: Not authenticated\n");
39989
+ process.exit(1);
39990
+ }
39991
+ const args = {};
39992
+ if (opts.take !== void 0)
39993
+ args.take = Number(opts.take);
39994
+ if (opts.skip !== void 0)
39995
+ args.skip = Number(opts.skip);
39996
+ await ctx.execute({
39997
+ method: "GET",
39998
+ path: "/v1/aggregators",
39999
+ args,
40000
+ queryParamKeys: ["take", "skip"]
40001
+ });
40002
+ });
40003
+ 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", `
40004
+ Examples:
40005
+ hyperline aggregators create --entity <entity> --operation <operation>
40006
+ hyperline aggregators create --entity <entity> --operation <operation> --type <type> --where <where>
40007
+ hyperline aggregators create --entity <entity> --operation <operation> --output json`).action(async (opts) => {
40008
+ const ctx = resource.parent?.opts()._ctx;
40009
+ if (!ctx) {
40010
+ process.stderr.write("Error: Not authenticated\n");
40011
+ process.exit(1);
40012
+ }
40013
+ const args = {};
40014
+ if (opts.entity !== void 0)
40015
+ args.entity = opts.entity;
40016
+ if (opts.type !== void 0)
40017
+ args.type = opts.type;
40018
+ if (opts.name !== void 0)
40019
+ args.name = opts.name;
40020
+ if (opts.description !== void 0)
40021
+ args.description = opts.description;
40022
+ if (opts.customEventName !== void 0)
40023
+ args.custom_event_name = opts.customEventName;
40024
+ if (opts.unitName !== void 0)
40025
+ args.unit_name = opts.unitName;
40026
+ if (opts.defaultIntervalPeriod !== void 0)
40027
+ args.default_interval_period = opts.defaultIntervalPeriod;
40028
+ if (opts.operation !== void 0)
40029
+ args.operation = opts.operation;
40030
+ if (opts.property !== void 0)
40031
+ args.property = opts.property;
40032
+ if (opts.defaultIntervalCount !== void 0)
40033
+ args.default_interval_count = Number(opts.defaultIntervalCount);
40034
+ if (opts.allowNegativeValues !== void 0)
40035
+ args.allow_negative_values = true;
40036
+ if (opts.aggregateOnCustomersEnabled !== void 0)
40037
+ args.aggregate_on_customers_enabled = true;
40038
+ if (opts.where !== void 0)
40039
+ args.where = JSON.parse(opts.where);
40040
+ if (opts.exposedEventKeys !== void 0)
40041
+ args.exposed_event_keys = JSON.parse(opts.exposedEventKeys);
40042
+ if (opts.thresholds !== void 0)
40043
+ args.thresholds = JSON.parse(opts.thresholds);
40044
+ await ctx.execute({
40045
+ method: "POST",
40046
+ path: "/v1/aggregators",
40047
+ args,
40048
+ queryParamKeys: []
40049
+ });
40050
+ });
40051
+ resource.command("get").description(`Retrieve a specific aggregator by ID.`).requiredOption("--id <value>", `id parameter`).addHelpText("after", `
40052
+ Examples:
40053
+ hyperline aggregators get --id <id>`).action(async (opts) => {
40054
+ const ctx = resource.parent?.opts()._ctx;
40055
+ if (!ctx) {
40056
+ process.stderr.write("Error: Not authenticated\n");
40057
+ process.exit(1);
40058
+ }
40059
+ const args = {};
40060
+ if (opts.id !== void 0)
40061
+ args.id = opts.id;
40062
+ await ctx.execute({
40063
+ method: "GET",
40064
+ path: "/v1/aggregators/{id}",
40065
+ args,
40066
+ queryParamKeys: []
40067
+ });
40068
+ });
40069
+ 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", `
40070
+ Examples:
40071
+ hyperline aggregators update --id <id>
40072
+ hyperline aggregators update --id <id> --entity <entity> --type <type>
40073
+ hyperline aggregators update --id <id> --output json`).action(async (opts) => {
40074
+ const ctx = resource.parent?.opts()._ctx;
40075
+ if (!ctx) {
40076
+ process.stderr.write("Error: Not authenticated\n");
40077
+ process.exit(1);
40078
+ }
40079
+ const args = {};
40080
+ if (opts.id !== void 0)
40081
+ args.id = opts.id;
40082
+ if (opts.entity !== void 0)
40083
+ args.entity = opts.entity;
40084
+ if (opts.type !== void 0)
40085
+ args.type = opts.type;
40086
+ if (opts.name !== void 0)
40087
+ args.name = opts.name;
40088
+ if (opts.description !== void 0)
40089
+ args.description = opts.description;
40090
+ if (opts.customEventName !== void 0)
40091
+ args.custom_event_name = opts.customEventName;
40092
+ if (opts.unitName !== void 0)
40093
+ args.unit_name = opts.unitName;
40094
+ if (opts.defaultIntervalPeriod !== void 0)
40095
+ args.default_interval_period = opts.defaultIntervalPeriod;
40096
+ if (opts.operation !== void 0)
40097
+ args.operation = opts.operation;
40098
+ if (opts.property !== void 0)
40099
+ args.property = opts.property;
40100
+ if (opts.defaultIntervalCount !== void 0)
40101
+ args.default_interval_count = Number(opts.defaultIntervalCount);
40102
+ if (opts.allowNegativeValues !== void 0)
40103
+ args.allow_negative_values = true;
40104
+ if (opts.aggregateOnCustomersEnabled !== void 0)
40105
+ args.aggregate_on_customers_enabled = true;
40106
+ if (opts.where !== void 0)
40107
+ args.where = JSON.parse(opts.where);
40108
+ if (opts.exposedEventKeys !== void 0)
40109
+ args.exposed_event_keys = JSON.parse(opts.exposedEventKeys);
40110
+ if (opts.thresholds !== void 0)
40111
+ args.thresholds = JSON.parse(opts.thresholds);
40112
+ await ctx.execute({
40113
+ method: "PUT",
40114
+ path: "/v1/aggregators/{id}",
40115
+ args,
40116
+ queryParamKeys: []
40117
+ });
40118
+ });
40119
+ 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", `
40120
+ Examples:
40121
+ hyperline aggregators delete --id <id>
40122
+ hyperline aggregators delete --id <id> --output json`).action(async (opts) => {
40123
+ const ctx = resource.parent?.opts()._ctx;
40124
+ if (!ctx) {
40125
+ process.stderr.write("Error: Not authenticated\n");
40126
+ process.exit(1);
40127
+ }
40128
+ const args = {};
40129
+ if (opts.id !== void 0)
40130
+ args.id = opts.id;
40131
+ if (!opts.yes) {
40132
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
40133
+ if (!confirmed) {
40134
+ process.stdout.write("Aborted.\n");
40135
+ return;
40136
+ }
40137
+ }
40138
+ await ctx.execute({
40139
+ method: "DELETE",
40140
+ path: "/v1/aggregators/{id}",
40141
+ args,
40142
+ queryParamKeys: []
40143
+ });
40144
+ });
40145
+ }
40146
+
40147
+ // build/commands/generated/aggregators-usage.js
40148
+ function registerAggregators_UsageCommands(parent) {
40149
+ const resource = parent.command("aggregators-usage").description("Manage aggregators > usage");
40150
+ 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", `
40151
+ Examples:
40152
+ hyperline aggregators-usage get-aggregator-usage --id <id>`).action(async (opts) => {
40153
+ const ctx = resource.parent?.opts()._ctx;
40154
+ if (!ctx) {
40155
+ process.stderr.write("Error: Not authenticated\n");
40156
+ process.exit(1);
40157
+ }
40158
+ const args = {};
40159
+ if (opts.id !== void 0)
40160
+ args.id = opts.id;
40161
+ await ctx.execute({
40162
+ method: "GET",
40163
+ path: "/v1/aggregators/{id}/usage",
40164
+ args,
40165
+ queryParamKeys: []
40166
+ });
40167
+ });
40168
+ 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", `
40169
+ Examples:
40170
+ hyperline aggregators-usage get-aggregator-usage-timeseries --id <id>
40171
+ hyperline aggregators-usage get-aggregator-usage-timeseries --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
40172
+ const ctx = resource.parent?.opts()._ctx;
40173
+ if (!ctx) {
40174
+ process.stderr.write("Error: Not authenticated\n");
40175
+ process.exit(1);
40176
+ }
40177
+ const args = {};
40178
+ if (opts.id !== void 0)
40179
+ args.id = opts.id;
40180
+ if (opts.startDate !== void 0)
40181
+ args.start_date = opts.startDate;
40182
+ if (opts.endDate !== void 0)
40183
+ args.end_date = opts.endDate;
40184
+ if (opts.aggregatorFilterId !== void 0)
40185
+ args.aggregator_filter_id = opts.aggregatorFilterId;
40186
+ if (opts.groupBy !== void 0)
40187
+ args.group_by = opts.groupBy;
40188
+ await ctx.execute({
40189
+ method: "GET",
40190
+ path: "/v1/aggregators/{id}/usage/timeseries",
40191
+ args,
40192
+ queryParamKeys: [
40193
+ "start_date",
40194
+ "end_date",
40195
+ "aggregator_filter_id",
40196
+ "group_by"
40197
+ ]
40198
+ });
40199
+ });
40200
+ 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", `
40201
+ Examples:
40202
+ hyperline aggregators-usage get-aggregator-usage-group-by-customer --id <id>
40203
+ hyperline aggregators-usage get-aggregator-usage-group-by-customer --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
40204
+ const ctx = resource.parent?.opts()._ctx;
40205
+ if (!ctx) {
40206
+ process.stderr.write("Error: Not authenticated\n");
40207
+ process.exit(1);
40208
+ }
40209
+ const args = {};
40210
+ if (opts.id !== void 0)
40211
+ args.id = opts.id;
40212
+ if (opts.startDate !== void 0)
40213
+ args.start_date = opts.startDate;
40214
+ if (opts.endDate !== void 0)
40215
+ args.end_date = opts.endDate;
40216
+ if (opts.aggregatorFilterId !== void 0)
40217
+ args.aggregator_filter_id = opts.aggregatorFilterId;
40218
+ if (opts.take !== void 0)
40219
+ args.take = Number(opts.take);
40220
+ if (opts.skip !== void 0)
40221
+ args.skip = Number(opts.skip);
40222
+ await ctx.execute({
40223
+ method: "GET",
40224
+ path: "/v1/aggregators/{id}/usage/group-by-customer",
40225
+ args,
40226
+ queryParamKeys: [
40227
+ "start_date",
40228
+ "end_date",
40229
+ "aggregator_filter_id",
40230
+ "take",
40231
+ "skip"
40232
+ ]
40233
+ });
40234
+ });
40235
+ 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", `
40236
+ Examples:
40237
+ hyperline aggregators-usage get-aggregator-usage-events --id <id>
40238
+ hyperline aggregators-usage get-aggregator-usage-events --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
40239
+ const ctx = resource.parent?.opts()._ctx;
40240
+ if (!ctx) {
40241
+ process.stderr.write("Error: Not authenticated\n");
40242
+ process.exit(1);
40243
+ }
40244
+ const args = {};
40245
+ if (opts.id !== void 0)
40246
+ args.id = opts.id;
40247
+ if (opts.startDate !== void 0)
40248
+ args.start_date = opts.startDate;
40249
+ if (opts.endDate !== void 0)
40250
+ args.end_date = opts.endDate;
40251
+ if (opts.aggregatorFilterId !== void 0)
40252
+ args.aggregator_filter_id = opts.aggregatorFilterId;
40253
+ if (opts.take !== void 0)
40254
+ args.take = Number(opts.take);
40255
+ if (opts.skip !== void 0)
40256
+ args.skip = Number(opts.skip);
40257
+ await ctx.execute({
40258
+ method: "GET",
40259
+ path: "/v1/aggregators/{id}/usage/events",
40260
+ args,
40261
+ queryParamKeys: [
40262
+ "start_date",
40263
+ "end_date",
40264
+ "aggregator_filter_id",
40265
+ "take",
40266
+ "skip"
40267
+ ]
40268
+ });
40269
+ });
40270
+ }
40271
+
39226
40272
  // build/commands/generated/analytics.js
39227
40273
  function registerAnalyticsCommands(parent) {
39228
40274
  const resource = parent.command("analytics").description("Manage analytics");
@@ -40520,6 +41566,129 @@ Examples:
40520
41566
  });
40521
41567
  }
40522
41568
 
41569
+ // build/commands/generated/customers-address.js
41570
+ function registerCustomers_AddressCommands(parent) {
41571
+ const resource = parent.command("customers-address").description("Manage customers > address");
41572
+ resource.command("list-customer-addresses").description(`List active addresses: at most one billing address and multiple shipping addresses per customer.`).requiredOption("--customer-id <value>", `customerId parameter`).addHelpText("after", `
41573
+ Examples:
41574
+ hyperline customers-address list-customer-addresses --customer-id <customerId>`).action(async (opts) => {
41575
+ const ctx = resource.parent?.opts()._ctx;
41576
+ if (!ctx) {
41577
+ process.stderr.write("Error: Not authenticated\n");
41578
+ process.exit(1);
41579
+ }
41580
+ const args = {};
41581
+ if (opts.customerId !== void 0)
41582
+ args.customerId = opts.customerId;
41583
+ await ctx.execute({
41584
+ method: "GET",
41585
+ path: "/v1/customers/{customerId}/addresses",
41586
+ args,
41587
+ queryParamKeys: []
41588
+ });
41589
+ });
41590
+ resource.command("create-customer-address").description(`Create a shipping address with type shipping; billing creation is rejected because a customer can have at most one billing address, managed through the customer endpoint.`).requiredOption("--customer-id <value>", `customerId parameter`).option("--name <value>", `Address name.`).option("--line1 <value>", `Address first line.`).option("--line2 <value>", `Address second line (optional).`).option("--city <value>", `Address city.`).option("--zip <value>", `Address ZIP code.`).option("--state <value>", `Only for US country. Second part of subdivision code in ISO format. See [ISO 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US).`).option("--country <value>", `Two-letter country code in ISO format. See [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).`).requiredOption("--type <value>", `Only shipping addresses can be created here. A customer has at most one active billing address, managed through the customer or by updating its address ID.`).addHelpText("after", `
41591
+ Examples:
41592
+ hyperline customers-address create-customer-address --customer-id <customerId> --type <type>
41593
+ hyperline customers-address create-customer-address --customer-id <customerId> --type <type> --name <name> --line1 <line1>
41594
+ hyperline customers-address create-customer-address --customer-id <customerId> --type <type> --output json`).action(async (opts) => {
41595
+ const ctx = resource.parent?.opts()._ctx;
41596
+ if (!ctx) {
41597
+ process.stderr.write("Error: Not authenticated\n");
41598
+ process.exit(1);
41599
+ }
41600
+ const args = {};
41601
+ if (opts.customerId !== void 0)
41602
+ args.customerId = opts.customerId;
41603
+ if (opts.name !== void 0)
41604
+ args.name = opts.name;
41605
+ if (opts.line1 !== void 0)
41606
+ args.line1 = opts.line1;
41607
+ if (opts.line2 !== void 0)
41608
+ args.line2 = opts.line2;
41609
+ if (opts.city !== void 0)
41610
+ args.city = opts.city;
41611
+ if (opts.zip !== void 0)
41612
+ args.zip = opts.zip;
41613
+ if (opts.state !== void 0)
41614
+ args.state = opts.state;
41615
+ if (opts.country !== void 0)
41616
+ args.country = opts.country;
41617
+ if (opts.type !== void 0)
41618
+ args.type = opts.type;
41619
+ await ctx.execute({
41620
+ method: "POST",
41621
+ path: "/v1/customers/{customerId}/addresses",
41622
+ args,
41623
+ queryParamKeys: []
41624
+ });
41625
+ });
41626
+ resource.command("update-customer-address").description(`Update a billing or shipping address by ID; billing changes also update the customer billing-address projection.`).requiredOption("--customer-id <value>", `customerId parameter`).requiredOption("--address-id <value>", `addressId parameter`).option("--name <value>", `Address name.`).option("--line1 <value>", `Address first line.`).option("--line2 <value>", `Address second line (optional).`).option("--city <value>", `Address city.`).option("--zip <value>", `Address ZIP code.`).option("--state <value>", `Only for US country. Second part of subdivision code in ISO format. See [ISO 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US).`).option("--country <value>", `Two-letter country code in ISO format. See [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).`).addHelpText("after", `
41627
+ Examples:
41628
+ hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId>
41629
+ hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId> --name <name> --line1 <line1>
41630
+ hyperline customers-address update-customer-address --customer-id <customerId> --address-id <addressId> --output json`).action(async (opts) => {
41631
+ const ctx = resource.parent?.opts()._ctx;
41632
+ if (!ctx) {
41633
+ process.stderr.write("Error: Not authenticated\n");
41634
+ process.exit(1);
41635
+ }
41636
+ const args = {};
41637
+ if (opts.customerId !== void 0)
41638
+ args.customerId = opts.customerId;
41639
+ if (opts.addressId !== void 0)
41640
+ args.addressId = opts.addressId;
41641
+ if (opts.name !== void 0)
41642
+ args.name = opts.name;
41643
+ if (opts.line1 !== void 0)
41644
+ args.line1 = opts.line1;
41645
+ if (opts.line2 !== void 0)
41646
+ args.line2 = opts.line2;
41647
+ if (opts.city !== void 0)
41648
+ args.city = opts.city;
41649
+ if (opts.zip !== void 0)
41650
+ args.zip = opts.zip;
41651
+ if (opts.state !== void 0)
41652
+ args.state = opts.state;
41653
+ if (opts.country !== void 0)
41654
+ args.country = opts.country;
41655
+ await ctx.execute({
41656
+ method: "PATCH",
41657
+ path: "/v1/customers/{customerId}/addresses/{addressId}",
41658
+ args,
41659
+ queryParamKeys: []
41660
+ });
41661
+ });
41662
+ resource.command("delete-customer-address").description(`Delete an address. To delete the default shipping address, first select another shipping address or use the billing address.`).requiredOption("--customer-id <value>", `customerId parameter`).requiredOption("--address-id <value>", `addressId parameter`).option("--yes", "Skip confirmation").addHelpText("after", `
41663
+ Examples:
41664
+ hyperline customers-address delete-customer-address --customer-id <customerId> --address-id <addressId>
41665
+ hyperline customers-address delete-customer-address --customer-id <customerId> --address-id <addressId> --output json`).action(async (opts) => {
41666
+ const ctx = resource.parent?.opts()._ctx;
41667
+ if (!ctx) {
41668
+ process.stderr.write("Error: Not authenticated\n");
41669
+ process.exit(1);
41670
+ }
41671
+ const args = {};
41672
+ if (opts.customerId !== void 0)
41673
+ args.customerId = opts.customerId;
41674
+ if (opts.addressId !== void 0)
41675
+ args.addressId = opts.addressId;
41676
+ if (!opts.yes) {
41677
+ const confirmed = await confirmPrompt("Are you sure? Pass --yes to skip. [y/N] ");
41678
+ if (!confirmed) {
41679
+ process.stdout.write("Aborted.\n");
41680
+ return;
41681
+ }
41682
+ }
41683
+ await ctx.execute({
41684
+ method: "DELETE",
41685
+ path: "/v1/customers/{customerId}/addresses/{addressId}",
41686
+ args,
41687
+ queryParamKeys: []
41688
+ });
41689
+ });
41690
+ }
41691
+
40523
41692
  // build/commands/generated/customers-credits.js
40524
41693
  function registerCustomers_CreditsCommands(parent) {
40525
41694
  const resource = parent.command("customers-credits").description("Manage customers > credits");
@@ -41011,6 +42180,177 @@ Examples:
41011
42180
  });
41012
42181
  }
41013
42182
 
42183
+ // build/commands/generated/customers-shipping.js
42184
+ function registerCustomers_ShippingCommands(parent) {
42185
+ const resource = parent.command("customers-shipping").description("Manage customers > shipping");
42186
+ resource.command("get-customer-shipping-destination").description(`Get the billing or shipping destination and its resolved address object, or null if no address exists.`).requiredOption("--customer-id <value>", `customerId parameter`).addHelpText("after", `
42187
+ Examples:
42188
+ hyperline customers-shipping get-customer-shipping-destination --customer-id <customerId>`).action(async (opts) => {
42189
+ const ctx = resource.parent?.opts()._ctx;
42190
+ if (!ctx) {
42191
+ process.stderr.write("Error: Not authenticated\n");
42192
+ process.exit(1);
42193
+ }
42194
+ const args = {};
42195
+ if (opts.customerId !== void 0)
42196
+ args.customerId = opts.customerId;
42197
+ await ctx.execute({
42198
+ method: "GET",
42199
+ path: "/v1/customers/{customerId}/shipping",
42200
+ args,
42201
+ queryParamKeys: []
42202
+ });
42203
+ });
42204
+ resource.command("set-customer-shipping-destination").description(`Select a saved shipping address or use the billing address.`).requiredOption("--customer-id <value>", `customerId parameter`).requiredOption("--destination <value>", `Whether shipping uses the billing address or a saved shipping address.`).option("--address-id <value>", `Active shipping address ID belonging to this customer. Uses the customer's default shipping address when omitted. A shipping address must exist.`).addHelpText("after", `
42205
+ Examples:
42206
+ hyperline customers-shipping set-customer-shipping-destination --customer-id <customerId> --destination <destination>
42207
+ hyperline customers-shipping set-customer-shipping-destination --customer-id <customerId> --destination <destination> --address-id <address_id>
42208
+ hyperline customers-shipping set-customer-shipping-destination --customer-id <customerId> --destination <destination> --output json`).action(async (opts) => {
42209
+ const ctx = resource.parent?.opts()._ctx;
42210
+ if (!ctx) {
42211
+ process.stderr.write("Error: Not authenticated\n");
42212
+ process.exit(1);
42213
+ }
42214
+ const args = {};
42215
+ if (opts.customerId !== void 0)
42216
+ args.customerId = opts.customerId;
42217
+ if (opts.destination !== void 0)
42218
+ args.destination = opts.destination;
42219
+ if (opts.addressId !== void 0)
42220
+ args.address_id = opts.addressId;
42221
+ await ctx.execute({
42222
+ method: "PUT",
42223
+ path: "/v1/customers/{customerId}/shipping",
42224
+ args,
42225
+ queryParamKeys: []
42226
+ });
42227
+ });
42228
+ }
42229
+
42230
+ // build/commands/generated/customers-usage.js
42231
+ function registerCustomers_UsageCommands(parent) {
42232
+ const resource = parent.command("customers-usage").description("Manage customers > usage");
42233
+ 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", `
42234
+ Examples:
42235
+ hyperline customers-usage list-customer-usage --id <id>
42236
+ hyperline customers-usage list-customer-usage --id <id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
42237
+ const ctx = resource.parent?.opts()._ctx;
42238
+ if (!ctx) {
42239
+ process.stderr.write("Error: Not authenticated\n");
42240
+ process.exit(1);
42241
+ }
42242
+ const args = {};
42243
+ if (opts.id !== void 0)
42244
+ args.id = opts.id;
42245
+ if (opts.startDate !== void 0)
42246
+ args.start_date = opts.startDate;
42247
+ if (opts.endDate !== void 0)
42248
+ args.end_date = opts.endDate;
42249
+ await ctx.execute({
42250
+ method: "GET",
42251
+ path: "/v1/customers/{id}/usage",
42252
+ args,
42253
+ queryParamKeys: ["start_date", "end_date"]
42254
+ });
42255
+ });
42256
+ 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", `
42257
+ Examples:
42258
+ hyperline customers-usage get-customer-usage --id <id> --aggregator-id <aggregator_id>
42259
+ hyperline customers-usage get-customer-usage --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
42260
+ const ctx = resource.parent?.opts()._ctx;
42261
+ if (!ctx) {
42262
+ process.stderr.write("Error: Not authenticated\n");
42263
+ process.exit(1);
42264
+ }
42265
+ const args = {};
42266
+ if (opts.id !== void 0)
42267
+ args.id = opts.id;
42268
+ if (opts.aggregatorId !== void 0)
42269
+ args.aggregator_id = opts.aggregatorId;
42270
+ if (opts.startDate !== void 0)
42271
+ args.start_date = opts.startDate;
42272
+ if (opts.endDate !== void 0)
42273
+ args.end_date = opts.endDate;
42274
+ await ctx.execute({
42275
+ method: "GET",
42276
+ path: "/v1/customers/{id}/usage/{aggregator_id}",
42277
+ args,
42278
+ queryParamKeys: ["start_date", "end_date"]
42279
+ });
42280
+ });
42281
+ 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", `
42282
+ Examples:
42283
+ hyperline customers-usage get-customer-usage-timeseries --id <id> --aggregator-id <aggregator_id>
42284
+ hyperline customers-usage get-customer-usage-timeseries --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
42285
+ const ctx = resource.parent?.opts()._ctx;
42286
+ if (!ctx) {
42287
+ process.stderr.write("Error: Not authenticated\n");
42288
+ process.exit(1);
42289
+ }
42290
+ const args = {};
42291
+ if (opts.id !== void 0)
42292
+ args.id = opts.id;
42293
+ if (opts.aggregatorId !== void 0)
42294
+ args.aggregator_id = opts.aggregatorId;
42295
+ if (opts.startDate !== void 0)
42296
+ args.start_date = opts.startDate;
42297
+ if (opts.endDate !== void 0)
42298
+ args.end_date = opts.endDate;
42299
+ if (opts.aggregatorFilterId !== void 0)
42300
+ args.aggregator_filter_id = opts.aggregatorFilterId;
42301
+ if (opts.groupBy !== void 0)
42302
+ args.group_by = opts.groupBy;
42303
+ await ctx.execute({
42304
+ method: "GET",
42305
+ path: "/v1/customers/{id}/usage/{aggregator_id}/timeseries",
42306
+ args,
42307
+ queryParamKeys: [
42308
+ "start_date",
42309
+ "end_date",
42310
+ "aggregator_filter_id",
42311
+ "group_by"
42312
+ ]
42313
+ });
42314
+ });
42315
+ 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", `
42316
+ Examples:
42317
+ hyperline customers-usage get-customer-usage-events --id <id> --aggregator-id <aggregator_id>
42318
+ hyperline customers-usage get-customer-usage-events --id <id> --aggregator-id <aggregator_id> --start-date <start_date> --end-date <end_date>`).action(async (opts) => {
42319
+ const ctx = resource.parent?.opts()._ctx;
42320
+ if (!ctx) {
42321
+ process.stderr.write("Error: Not authenticated\n");
42322
+ process.exit(1);
42323
+ }
42324
+ const args = {};
42325
+ if (opts.id !== void 0)
42326
+ args.id = opts.id;
42327
+ if (opts.aggregatorId !== void 0)
42328
+ args.aggregator_id = opts.aggregatorId;
42329
+ if (opts.startDate !== void 0)
42330
+ args.start_date = opts.startDate;
42331
+ if (opts.endDate !== void 0)
42332
+ args.end_date = opts.endDate;
42333
+ if (opts.aggregatorFilterId !== void 0)
42334
+ args.aggregator_filter_id = opts.aggregatorFilterId;
42335
+ if (opts.take !== void 0)
42336
+ args.take = Number(opts.take);
42337
+ if (opts.skip !== void 0)
42338
+ args.skip = Number(opts.skip);
42339
+ await ctx.execute({
42340
+ method: "GET",
42341
+ path: "/v1/customers/{id}/usage/{aggregator_id}/events",
42342
+ args,
42343
+ queryParamKeys: [
42344
+ "start_date",
42345
+ "end_date",
42346
+ "aggregator_filter_id",
42347
+ "take",
42348
+ "skip"
42349
+ ]
42350
+ });
42351
+ });
42352
+ }
42353
+
41014
42354
  // build/commands/generated/exports.js
41015
42355
  function registerExportsCommands(parent) {
41016
42356
  const resource = parent.command("exports").description("Manage exports");
@@ -42780,7 +44120,7 @@ How the periodic credit allowance is granted for partial billing periods.
42780
44120
 
42781
44121
  - \`prorated\` (default): the granted credits are prorated to the elapsed period.
42782
44122
  - \`full_allowance\`: the full allowance is always granted (the invoice remains prorated).
42783
- `).option("--display-mode <value>", `How bundle items are displayed on invoices.`).option("--exclusive-items-enabled", `When true, only one item in the bundle can be active at a time.`).option("--bundle-items <json>", `Products included in this bundle. Percentages must sum to 100.`).addHelpText("after", `
44123
+ `).option("--credits-balance-auto-creation-enabled <value>", `Default for the \`credits_balance_auto_creation_enabled\` setting of subscription products using this credit product: whether the customer credit balance is created as soon as the product is added to a subscription. \`true\` when unset. A subscription product can override it.`).option("--display-mode <value>", `How bundle items are displayed on invoices.`).option("--exclusive-items-enabled", `When true, only one item in the bundle can be active at a time.`).option("--bundle-items <json>", `Products included in this bundle. Percentages must sum to 100.`).addHelpText("after", `
42784
44124
  Examples:
42785
44125
  hyperline products create --name <name> --type <type> --price-configurations <price_configurations>
42786
44126
  hyperline products create --name <name> --type <type> --price-configurations <price_configurations> --description <description> --description-display-interval-dates
@@ -42805,6 +44145,8 @@ Examples:
42805
44145
  args.unit_name = opts.unitName;
42806
44146
  if (opts.creditsGrantMode !== void 0)
42807
44147
  args.credits_grant_mode = opts.creditsGrantMode;
44148
+ if (opts.creditsBalanceAutoCreationEnabled !== void 0)
44149
+ args.credits_balance_auto_creation_enabled = opts.creditsBalanceAutoCreationEnabled;
42808
44150
  if (opts.displayMode !== void 0)
42809
44151
  args.display_mode = opts.displayMode;
42810
44152
  if (opts.lowCreditsThreshold !== void 0)
@@ -43871,7 +45213,7 @@ Strategy used to activate the subscription.
43871
45213
  - \`manually\`: The subscription requires activation through a manual action.
43872
45214
  - \`checkout\`: The subscription will be activated once the checkout is completed, but only if the start date is in the past. Otherwise, activation will occur later on the specified start date.
43873
45215
  - \`quote\`: The subscription will be activated depending on the configuration and the signature of the related quote.
43874
- `).option("--products <json>", `Products that make up the subscription.`).option("--coupons <json>", `coupons`).option("--name <value>", `Subscription custom name.`).option("--purchase-order <value>", `Reference to the purchase order.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity attached to the subscription. If not defined, fallback to customer's invoicing entity.`).option("--crm-opportunity-id <value>", `ID of the related opportunity/deal in the connected CRM.`).option("--minimum-invoice-fee <number>", `Minimum fee applied to each invoice outside of one time payments.`).option("--contract-terms <json>", `Contract terms linked to the subscription.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancellation-strategy <value>", `
45216
+ `).option("--products <json>", `Products that make up the subscription.`).option("--coupons <json>", `coupons`).option("--name <value>", `Subscription custom name.`).option("--purchase-order <value>", `Reference to the purchase order.`).option("--invoicing-entity-id <value>", `ID of the invoicing entity attached to the subscription. If not defined, fallback to customer's invoicing entity.`).option("--crm-opportunity-id <value>", `ID of the related opportunity/deal in the connected CRM.`).option("--minimum-invoice-fee <number>", `Minimum fee applied to each invoice outside of one time payments.`).option("--contract-terms <json>", `Contract terms linked to the subscription.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--shipping-address-id <value>", `Active shipping address ID belonging to the subscription customer. Omit to use the customer shipping destination: billing address or default shipping address.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancellation-strategy <value>", `
43875
45217
  Strategy used to cancel the subscription. If not specified \`do_nothing\` is used.
43876
45218
 
43877
45219
  - \`charge_prorata\`: Will charge the customer the unpaid amount for the prorated period up to the end of the current period.
@@ -43923,6 +45265,8 @@ Examples:
43923
45265
  args.starts_at = opts.startsAt;
43924
45266
  if (opts.initialBillingAt !== void 0)
43925
45267
  args.initial_billing_at = opts.initialBillingAt;
45268
+ if (opts.shippingAddressId !== void 0)
45269
+ args.shipping_address_id = opts.shippingAddressId;
43926
45270
  if (opts.displayShippingDetails !== void 0)
43927
45271
  args.display_shipping_details = opts.displayShippingDetails;
43928
45272
  if (opts.cancelAt !== void 0)
@@ -44233,7 +45577,7 @@ Defines when invoices are generated relative to the billing period.
44233
45577
 
44234
45578
  - \`period_start\`: Invoices are generated at the start of the billing period.
44235
45579
  - \`period_end\`: Invoices are generated at the end of the billing period.
44236
- `).option("--estimated-arr <number>", `Estimated Annual Recurring Revenue generated by the subscription.`).option("--contract-value <number>", `Contract value of the subscription. This value is overridable by the user.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--properties <json>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <json>", `A list of key value with the slug of the custom property as the key and the custom property value as value.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--phases <json>", `Array of subscription phases. Existing pending phases will be replaced by the ones in the array.`).option("--contract-terms <json>", `Contract terms to update.`).addHelpText("after", `
45580
+ `).option("--estimated-arr <number>", `Estimated Annual Recurring Revenue generated by the subscription.`).option("--contract-value <number>", `Contract value of the subscription. This value is overridable by the user.`).option("--starts-at <value>", `Applies only if the activation strategy is \`start_date\`. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--initial-billing-at <value>", `Date when the subscription will start being billed. If not specified, it will correspond to the \`starts_at\` date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--cancel-at <value>", `Subscription cancel date. UTC date time string in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.`).option("--properties <json>", `Key/value pairs to store any metadata useful in your context.`).option("--custom-properties <json>", `A list of key value with the slug of the custom property as the key and the custom property value as value.`).option("--shipping-address-id <value>", `Active shipping address ID belonging to the subscription customer. Null uses the customer shipping destination: billing address or default shipping address.`).option("--display-shipping-details <value>", `Indicates if the shipping details should be displayed on the subscription's invoices.`).option("--phases <json>", `Array of subscription phases. Existing pending phases will be replaced by the ones in the array.`).option("--contract-terms <json>", `Contract terms to update.`).addHelpText("after", `
44237
45581
  Examples:
44238
45582
  hyperline subscriptions update --id <id>
44239
45583
  hyperline subscriptions update --id <id> --name <name> --purchase-order <purchase_order>
@@ -44274,6 +45618,8 @@ Examples:
44274
45618
  args.initial_billing_at = opts.initialBillingAt;
44275
45619
  if (opts.cancelAt !== void 0)
44276
45620
  args.cancel_at = opts.cancelAt;
45621
+ if (opts.shippingAddressId !== void 0)
45622
+ args.shipping_address_id = opts.shippingAddressId;
44277
45623
  if (opts.displayShippingDetails !== void 0)
44278
45624
  args.display_shipping_details = opts.displayShippingDetails;
44279
45625
  if (opts.minimumInvoiceFee !== void 0)
@@ -45379,7 +46725,10 @@ function registerAllCommands(program2) {
45379
46725
  registerAccounting_ReportsCommands(program2);
45380
46726
  registerAccounting_Revenue_RecognitionCommands(program2);
45381
46727
  registerAccounting_RulesCommands(program2);
46728
+ registerAgentsCommands(program2);
45382
46729
  registerCustom_PropertiesCommands(program2);
46730
+ registerAggregatorsCommands(program2);
46731
+ registerAggregators_UsageCommands(program2);
45383
46732
  registerAnalyticsCommands(program2);
45384
46733
  registerBank_AccountsCommands(program2);
45385
46734
  registerCompaniesCommands(program2);
@@ -45387,7 +46736,10 @@ function registerAllCommands(program2) {
45387
46736
  registerCoupons_Promotion_CodesCommands(program2);
45388
46737
  registerCustomers_CreditsCommands(program2);
45389
46738
  registerCustomers_Payment_MethodsCommands(program2);
46739
+ registerCustomers_AddressCommands(program2);
46740
+ registerCustomers_ShippingCommands(program2);
45390
46741
  registerCustomersCommands(program2);
46742
+ registerCustomers_UsageCommands(program2);
45391
46743
  registerOrganisationsCommands(program2);
45392
46744
  registerCustomers_SegmentsCommands(program2);
45393
46745
  registerExportsCommands(program2);
@@ -61347,6 +62699,16 @@ var DateTimeSchema = external_exports.iso.datetime({
61347
62699
  example: "2024-12-20T16:04:11Z"
61348
62700
  });
61349
62701
 
62702
+ // ../hyperline-lib/build/http/dto/decimal.js
62703
+ var DecimalStringSchema = external_exports.string().regex(/^-?\d+(\.\d+)?(e[+-]?\d+)?$/i).openapi({
62704
+ description: "Exact decimal string. Interpret the unit using the field description and denomination.",
62705
+ example: "0.0021"
62706
+ });
62707
+ var NonNegativeDecimalStringSchema = external_exports.string().regex(/^\d+(\.\d+)?$/).max(40).openapi({
62708
+ description: "Non-negative exact decimal string, at most 40 characters.",
62709
+ example: "0.0021"
62710
+ });
62711
+
61350
62712
  // ../hyperline-lib/build/http/dto/domain.js
61351
62713
  var DomainSchema = external_exports.string().trim().toLowerCase().regex(/^(?!:\/\/)(?=.{1,253}$)(?!-)([a-z0-9-]{1,63}\.)+[a-z]{2,63}$/, "Invalid domain").openapi({
61352
62714
  description: "Domain name.",