@empiricalrun/playwright-utils 0.60.4 → 0.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1149,7 +1149,7 @@ export interface paths {
1149
1149
  put?: never;
1150
1150
  /**
1151
1151
  * 🤖 Post a Slack message
1152
- * @description Posts Markdown to a Slack channel/thread, or a recipient-addressed DM, as the Empirical bot. Provide exactly one of channel, slack_user_id, or user_id. Recipient sends create a new DM root and require idempotency_key. Channel sends use the channel and root timestamp coordinates the agent was given. Sandbox-delegated principals only; the channel must be one the calling project can reach. Registered-root replies are recorded and de-duplicated by idempotency key for the sending session. New roots are registered and bound to the sending session after posting; if delivery or registration is uncertain, check Slack before retrying.
1152
+ * @description Posts Markdown to a Slack channel/thread, or a recipient-addressed DM, as the Empirical bot. Provide exactly one of channel, slack_user_id, or user_id. Recipient sends create a new DM root and require idempotency_key. Channel-wide mentions (<!channel>, <!here>, <!everyone>) are rejected; tag a subteam or users instead. Channel sends use the channel and root timestamp coordinates the agent was given. Sandbox-delegated principals only; the channel must be one the calling project can reach. Registered-root replies are recorded and de-duplicated by idempotency key for the sending session. New roots are registered and bound to the sending session after posting; if delivery or registration is uncertain, check Slack before retrying.
1153
1153
  */
1154
1154
  post: operations["slackSendMessage"];
1155
1155
  delete?: never;
@@ -1965,6 +1965,66 @@ export interface paths {
1965
1965
  patch: operations["updateApiKey"];
1966
1966
  trace?: never;
1967
1967
  };
1968
+ "/api/billing/month-summary": {
1969
+ parameters: {
1970
+ query?: never;
1971
+ header?: never;
1972
+ path?: never;
1973
+ cookie?: never;
1974
+ };
1975
+ /**
1976
+ * 🛡️ Get the org's usage and cost for a month
1977
+ * @description Org-wide usage across all of the scoped project's org projects, against the plan in effect: per-meter usage, overage so far, a month-end projection, and the usage limit.
1978
+ */
1979
+ get: operations["getBillingMonthSummary"];
1980
+ put?: never;
1981
+ post?: never;
1982
+ delete?: never;
1983
+ options?: never;
1984
+ head?: never;
1985
+ patch?: never;
1986
+ trace?: never;
1987
+ };
1988
+ "/api/billing/usage-limit": {
1989
+ parameters: {
1990
+ query?: never;
1991
+ header?: never;
1992
+ path?: never;
1993
+ cookie?: never;
1994
+ };
1995
+ get?: never;
1996
+ /**
1997
+ * 🛡️ Set or remove the org's usage limit
1998
+ * @description Sets the most overage the org allows per usage month, in whole dollars as cents, or removes the limit with null. Takes effect right away: a limit at or below this month's overage pauses new work.
1999
+ */
2000
+ put: operations["setUsageLimit"];
2001
+ post?: never;
2002
+ delete?: never;
2003
+ options?: never;
2004
+ head?: never;
2005
+ patch?: never;
2006
+ trace?: never;
2007
+ };
2008
+ "/api/billing/usage-limit/events": {
2009
+ parameters: {
2010
+ query?: never;
2011
+ header?: never;
2012
+ path?: never;
2013
+ cookie?: never;
2014
+ };
2015
+ /**
2016
+ * 🛡️ List the usage limit's history
2017
+ * @description Changes to the org's usage limit and the alerts and blocks it caused, newest first.
2018
+ */
2019
+ get: operations["listUsageLimitEvents"];
2020
+ put?: never;
2021
+ post?: never;
2022
+ delete?: never;
2023
+ options?: never;
2024
+ head?: never;
2025
+ patch?: never;
2026
+ trace?: never;
2027
+ };
1968
2028
  "/api/chat-sessions": {
1969
2029
  parameters: {
1970
2030
  query?: never;
@@ -3371,6 +3431,26 @@ export interface paths {
3371
3431
  patch?: never;
3372
3432
  trace?: never;
3373
3433
  };
3434
+ "/api/invoices/{id}/email-preview": {
3435
+ parameters: {
3436
+ query?: never;
3437
+ header?: never;
3438
+ path?: never;
3439
+ cookie?: never;
3440
+ };
3441
+ /**
3442
+ * 🛡️ Preview an invoice email
3443
+ * @description Renders the invoice email exactly as `POST /{id}/send` would send it, without sending anything.
3444
+ */
3445
+ get: operations["previewInvoiceEmail"];
3446
+ put?: never;
3447
+ post?: never;
3448
+ delete?: never;
3449
+ options?: never;
3450
+ head?: never;
3451
+ patch?: never;
3452
+ trace?: never;
3453
+ };
3374
3454
  "/api/invoices/{id}/generate": {
3375
3455
  parameters: {
3376
3456
  query?: never;
@@ -3462,7 +3542,7 @@ export interface paths {
3462
3542
  put?: never;
3463
3543
  /**
3464
3544
  * 🛡️ Send an invoice
3465
- * @description Emails the invoice PDF to the organisation's billing contacts and marks it as sent (unless `is_test_email` is set).
3545
+ * @description Emails the invoice PDF to the organisation's billing contacts and marks it as sent (unless `is_test_email` is set). On a real send, an unpaid INR invoice without a payment link gets a Razorpay-hosted payment link, stored on the invoice and included in the email.
3466
3546
  */
3467
3547
  post: operations["sendInvoice"];
3468
3548
  delete?: never;
@@ -4272,13 +4352,13 @@ export interface paths {
4272
4352
  };
4273
4353
  /**
4274
4354
  * 🛡️ List plan assignments
4275
- * @description Returns a paginated list of plan assignments, optionally filtered by organisation and order-form line.
4355
+ * @description Returns a paginated list of plan assignments, optionally filtered by organisation and plan.
4276
4356
  */
4277
4357
  get: operations["listPlanAssignments"];
4278
4358
  put?: never;
4279
4359
  /**
4280
4360
  * 🛡️ Create a plan assignment
4281
- * @description Creates a plan assignment for an existing organisation.
4361
+ * @description Puts an existing organisation on a plan from `effective_from`.
4282
4362
  */
4283
4363
  post: operations["createPlanAssignment"];
4284
4364
  delete?: never;
@@ -4311,6 +4391,74 @@ export interface paths {
4311
4391
  patch: operations["updatePlanAssignment"];
4312
4392
  trace?: never;
4313
4393
  };
4394
+ "/api/plan-assignments/org": {
4395
+ parameters: {
4396
+ query?: never;
4397
+ header?: never;
4398
+ path?: never;
4399
+ cookie?: never;
4400
+ };
4401
+ /**
4402
+ * 🛡️ Get the org's plan
4403
+ * @description Returns whether the scoped project's org is on a plan (now, or during `month`), and the plan's terms when it is a shared plan.
4404
+ */
4405
+ get: operations["getOrgPlan"];
4406
+ put?: never;
4407
+ post?: never;
4408
+ delete?: never;
4409
+ options?: never;
4410
+ head?: never;
4411
+ patch?: never;
4412
+ trace?: never;
4413
+ };
4414
+ "/api/plans": {
4415
+ parameters: {
4416
+ query?: never;
4417
+ header?: never;
4418
+ path?: never;
4419
+ cookie?: never;
4420
+ };
4421
+ /**
4422
+ * 🛡️ List plans
4423
+ * @description Returns the shared plans with their meters, or one organisation's custom plans.
4424
+ */
4425
+ get: operations["listPlans"];
4426
+ put?: never;
4427
+ /**
4428
+ * 🛡️ Create a shared plan
4429
+ * @description Creates a shared plan and its meters. Plans are immutable once created, apart from `status`: to change a price, create a new plan with a new key and retire the old one. Custom plans are created through order forms.
4430
+ */
4431
+ post: operations["createPlan"];
4432
+ delete?: never;
4433
+ options?: never;
4434
+ head?: never;
4435
+ patch?: never;
4436
+ trace?: never;
4437
+ };
4438
+ "/api/plans/{id}": {
4439
+ parameters: {
4440
+ query?: never;
4441
+ header?: never;
4442
+ path?: never;
4443
+ cookie?: never;
4444
+ };
4445
+ /**
4446
+ * 🛡️ Get a plan
4447
+ * @description Retrieves a single plan with its meters.
4448
+ */
4449
+ get: operations["getPlanById"];
4450
+ put?: never;
4451
+ post?: never;
4452
+ delete?: never;
4453
+ options?: never;
4454
+ head?: never;
4455
+ /**
4456
+ * 🛡️ Update a plan's status
4457
+ * @description Sets a plan's `status`. Plans are immutable apart from status: any other field is rejected. Retiring a plan does not touch existing assignments, which stay on it.
4458
+ */
4459
+ patch: operations["updatePlan"];
4460
+ trace?: never;
4461
+ };
4314
4462
  "/api/project-addons": {
4315
4463
  parameters: {
4316
4464
  query?: never;
@@ -5235,6 +5383,64 @@ export interface paths {
5235
5383
  patch?: never;
5236
5384
  trace?: never;
5237
5385
  };
5386
+ "/api/system-messages": {
5387
+ parameters: {
5388
+ query?: never;
5389
+ header?: never;
5390
+ path?: never;
5391
+ cookie?: never;
5392
+ };
5393
+ /** 🛡️ 🧪 List system messages with delivery and ack counts */
5394
+ get: operations["listSystemMessages"];
5395
+ put?: never;
5396
+ /**
5397
+ * 🛡️ 🧪 Broadcast a system message to manager sessions
5398
+ * @description Persists the message and delivers it to project manager sessions. With `project_ids`, every listed project gets a recipient row, and one without an open manager is recorded as failed. Without it, the message goes to every project with an open manager, and active projects without one are returned in `skipped_project_ids` (not persisted). Delivery is attempted before responding. Managers acknowledge through `POST /api/system-messages/{id}/ack`.
5399
+ */
5400
+ post: operations["createSystemMessage"];
5401
+ delete?: never;
5402
+ options?: never;
5403
+ head?: never;
5404
+ patch?: never;
5405
+ trace?: never;
5406
+ };
5407
+ "/api/system-messages/{id}": {
5408
+ parameters: {
5409
+ query?: never;
5410
+ header?: never;
5411
+ path?: never;
5412
+ cookie?: never;
5413
+ };
5414
+ /** 🛡️ 🧪 Get a system message's per-project delivery and ack status */
5415
+ get: operations["getSystemMessage"];
5416
+ put?: never;
5417
+ post?: never;
5418
+ delete?: never;
5419
+ options?: never;
5420
+ head?: never;
5421
+ patch?: never;
5422
+ trace?: never;
5423
+ };
5424
+ "/api/system-messages/{id}/ack": {
5425
+ parameters: {
5426
+ query?: never;
5427
+ header?: never;
5428
+ path?: never;
5429
+ cookie?: never;
5430
+ };
5431
+ get?: never;
5432
+ put?: never;
5433
+ /**
5434
+ * 🧪 Acknowledge a system message from a manager session
5435
+ * @description Records the calling manager session's acknowledgement for its project. Any manager session of the project may ack, so a successor can answer a message its predecessor received. Re-acking overwrites the previous status and note.
5436
+ */
5437
+ post: operations["ackSystemMessage"];
5438
+ delete?: never;
5439
+ options?: never;
5440
+ head?: never;
5441
+ patch?: never;
5442
+ trace?: never;
5443
+ };
5238
5444
  "/api/test-runs/events": {
5239
5445
  parameters: {
5240
5446
  query?: never;
@@ -5899,8 +6105,8 @@ export interface components {
5899
6105
  fx_rate: number | null;
5900
6106
  /** @description Billing line kind (`tier` or `addon`). */
5901
6107
  kind: string;
5902
- /** @description Originating order-form line ID, if any. */
5903
- order_form_line_id: number | null;
6108
+ /** @description Plan this charge was billed from, if any. */
6109
+ plan_id: number | null;
5904
6110
  /** @description Tier name, if applicable. */
5905
6111
  tier: string | null;
5906
6112
  /** @description Display label. */
@@ -5937,7 +6143,7 @@ export interface components {
5937
6143
  /** @enum {string} */
5938
6144
  kind?: "tier" | "addon";
5939
6145
  project_id?: number | null;
5940
- order_form_line_id?: number | null;
6146
+ plan_id?: number | null;
5941
6147
  tier?: string | null;
5942
6148
  label?: string | null;
5943
6149
  base_price_cents: number;
@@ -6102,7 +6308,8 @@ export interface components {
6102
6308
  label?: string | null;
6103
6309
  base_price_cents: number;
6104
6310
  meters?: {
6105
- meter: string;
6311
+ /** @enum {string} */
6312
+ meter: "test_suite_size" | "ai_credits" | "test_minutes" | "test_run_duration";
6106
6313
  included_qty?: number | null;
6107
6314
  overage_price_cents?: number | null;
6108
6315
  }[];
@@ -6128,7 +6335,8 @@ export interface components {
6128
6335
  label?: string | null;
6129
6336
  base_price_cents: number;
6130
6337
  meters?: {
6131
- meter: string;
6338
+ /** @enum {string} */
6339
+ meter: "test_suite_size" | "ai_credits" | "test_minutes" | "test_run_duration";
6132
6340
  included_qty?: number | null;
6133
6341
  overage_price_cents?: number | null;
6134
6342
  }[];
@@ -6137,6 +6345,31 @@ export interface components {
6137
6345
  OrderFormPdfUploadRequest: {
6138
6346
  pdf_base64: string;
6139
6347
  };
6348
+ OrgPlanResponse: {
6349
+ /** @description Response payload. */
6350
+ data: {
6351
+ /** @description Whether the org has a plan assignment in effect now. */
6352
+ has_plan: boolean;
6353
+ /** @description The shared plan in effect, or null when the org has no plan or is on a custom plan. */
6354
+ plan: {
6355
+ /** @description Plan name, e.g. `Managed`. */
6356
+ name: string;
6357
+ /** @description Currency of the prices below, e.g. `usd`. */
6358
+ currency: string;
6359
+ /** @description Monthly base price in cents of `currency`. */
6360
+ base_price_cents: number;
6361
+ /** @description Metered allowances and overage rates. */
6362
+ meters: {
6363
+ /** @description Meter key, e.g. `ai_credits` or `test_minutes`. */
6364
+ meter: string;
6365
+ /** @description Units included each month. */
6366
+ included_qty: number | null;
6367
+ /** @description Price per unit above the allowance, in cents of `currency`; may be fractional. */
6368
+ overage_price_cents: number | null;
6369
+ }[];
6370
+ } | null;
6371
+ };
6372
+ };
6140
6373
  PlanAssignmentListResponse: {
6141
6374
  /** @description The page of plan assignments. */
6142
6375
  data: {
@@ -6149,18 +6382,14 @@ export interface components {
6149
6382
  id: number;
6150
6383
  /** @description Organisation this assignment belongs to. */
6151
6384
  org_id: number;
6152
- /** @description Order form line that backs this assignment. */
6153
- order_form_line_id: number;
6385
+ /** @description Plan the organisation is on. */
6386
+ plan_id: number;
6154
6387
  /** @description ISO-8601 timestamp the assignment starts. */
6155
6388
  effective_from: string;
6156
6389
  /** @description ISO-8601 timestamp the assignment ends, or null for open-ended. */
6157
6390
  effective_to: string | null;
6158
6391
  /** @description Origin: `order_form`, `derived_from_invoice`, or `manual`. */
6159
6392
  source: string;
6160
- /** @description Whether the assignment is pinned. */
6161
- pinned: boolean;
6162
- /** @description Arbitrary JSON overrides for the plan, or null. */
6163
- custom_overrides?: unknown;
6164
6393
  /** @description ISO-8601 creation timestamp. */
6165
6394
  created_at: string;
6166
6395
  /** @description ISO-8601 last-update timestamp. */
@@ -6179,8 +6408,8 @@ export interface components {
6179
6408
  CreatePlanAssignmentRequest: {
6180
6409
  /** @description Organisation this plan assignment belongs to. */
6181
6410
  org_id: number;
6182
- /** @description Order form line that backs this assignment. */
6183
- order_form_line_id: number;
6411
+ /** @description Plan the organisation is on. */
6412
+ plan_id: number;
6184
6413
  /**
6185
6414
  * Format: date-time
6186
6415
  * @description When the assignment starts being effective (timestamptz).
@@ -6196,16 +6425,12 @@ export interface components {
6196
6425
  * @enum {string}
6197
6426
  */
6198
6427
  source?: "order_form" | "derived_from_invoice" | "manual";
6199
- /** @description Whether the assignment is pinned. Defaults false. */
6200
- pinned?: boolean;
6201
- /** @description Arbitrary JSON overrides for the plan. */
6202
- custom_overrides?: unknown;
6203
6428
  };
6204
6429
  UpdatePlanAssignmentRequest: {
6205
6430
  /** @description Organisation this plan assignment belongs to. */
6206
6431
  org_id?: number;
6207
- /** @description Order form line that backs this assignment. */
6208
- order_form_line_id?: number;
6432
+ /** @description Plan the organisation is on. */
6433
+ plan_id?: number;
6209
6434
  /**
6210
6435
  * Format: date-time
6211
6436
  * @description When the assignment starts being effective (timestamptz).
@@ -6221,93 +6446,284 @@ export interface components {
6221
6446
  * @enum {string}
6222
6447
  */
6223
6448
  source?: "order_form" | "derived_from_invoice" | "manual";
6224
- /** @description Whether the assignment is pinned. */
6225
- pinned?: boolean;
6226
- /** @description Arbitrary JSON overrides for the plan. */
6227
- custom_overrides?: unknown;
6228
6449
  };
6229
- RunnerBackendListResponse: {
6450
+ PlanListResponse: {
6230
6451
  /** @description Response payload. */
6231
6452
  data: {
6232
- runner_backends: components["schemas"]["RunnerBackend"][];
6453
+ plans: components["schemas"]["Plan"][];
6233
6454
  };
6234
6455
  };
6235
- RunnerBackend: {
6236
- /** @description Runner backend ID. */
6456
+ Plan: {
6457
+ /** @description Plan ID. */
6237
6458
  id: number;
6238
- /** @description Organisation that owns the installation. */
6239
- org_id: number;
6240
- /** @description Human-readable name. */
6241
- name: string;
6242
- /** @description AWS account the installation runs in. */
6243
- aws_account_id: string;
6244
- /** @description AWS region of the installation. */
6245
- region: string;
6246
- /** @description Role api-worker assumes to drive the plane. */
6247
- role_arn: string;
6248
- /** @description External ID the role's trust policy must require. Give it only to this installation's owner. */
6249
- external_id: string;
6250
- /** @description ECS cluster name. */
6251
- cluster_name: string;
6252
- /** @description CloudWatch log group of the worker. */
6253
- log_group_name: string;
6254
- /** @description Worker container name. */
6255
- container_name: string;
6256
- /** @description Job queue URLs are `${queue_prefix}-${machineSize}`. */
6257
- queue_prefix: string;
6258
- /**
6259
- * @description `pending` until verified; only `active` backends receive runs.
6260
- * @enum {string}
6261
- */
6262
- status: "pending" | "active" | "disabled";
6263
- /** @description ISO-8601 time of the last successful verify. */
6264
- last_verified_at: string | null;
6265
- /** @description ISO-8601 time of the last verify, manual or scheduled, whatever its outcome. */
6266
- last_checked_at: string | null;
6267
- /** @description Outcome of the last verify; null if never run. */
6268
- last_check_ok: boolean | null;
6269
- /** @description Every check from the last verify. */
6270
- last_check_results: components["schemas"]["RunnerBackendCheck"][] | null;
6271
- /** @description ISO-8601 start of the current run of failed checks; null while passing. A failing check does not change `status`. */
6272
- check_failing_since: string | null;
6273
- /** @description ISO-8601 creation time. */
6459
+ /** @description Organisation a custom plan belongs to; null for a shared plan. */
6460
+ org_id: number | null;
6461
+ /** @description Order form a custom plan comes from, if any. */
6462
+ order_form_id: number | null;
6463
+ /** @description `tier` or `addon`. */
6464
+ kind: string;
6465
+ /** @description Stable unique key of a shared plan, e.g. `managed`. */
6466
+ key: string | null;
6467
+ /** @description Display name, e.g. `Managed`, `Starter`. */
6468
+ name: string | null;
6469
+ /** @description Currency the plan is priced in, e.g. `usd`. */
6470
+ currency: string;
6471
+ /** @description Monthly base price in cents of `currency`. */
6472
+ base_price_cents: number;
6473
+ /** @description `active` or `retired`. Retired plans keep existing assignments. */
6474
+ status: string;
6475
+ /** @description ISO-8601 creation timestamp. */
6274
6476
  created_at: string;
6275
- /** @description ISO-8601 last-update time. */
6276
- updated_at: string;
6477
+ /** @description Metered allowances and overage rates. */
6478
+ meters: components["schemas"]["PlanMeter"][];
6277
6479
  };
6278
- RunnerBackendCheck: {
6279
- /** @description `assume_role`, `job_queue`, `scaler_trigger_queue`, `ecs_cluster`, `ecs_tasks` or `worker_logs`. */
6280
- name: string;
6281
- /** @description Whether the check passed. */
6282
- ok: boolean;
6283
- /** @description The resource checked, or the AWS error. */
6284
- detail: string;
6480
+ PlanMeter: {
6481
+ /** @description Plan meter ID. */
6482
+ id: number;
6483
+ /** @description Plan this meter belongs to. */
6484
+ plan_id: number;
6485
+ /** @description Meter key, e.g. `ai_credits` or `test_minutes`. */
6486
+ meter: string;
6487
+ /** @description Units included in the base price each month. */
6488
+ included_qty: number | null;
6489
+ /** @description Price per unit above the included quantity, in cents of the plan currency. May be fractional (0.5 = $0.005). Null means usage above the allowance is not billed. */
6490
+ overage_price_cents: number | null;
6491
+ /** @description Display order. */
6492
+ sort_order: number;
6285
6493
  };
6286
- RunnerBackendResponse: {
6494
+ PlanResponse: {
6287
6495
  /** @description Response payload. */
6288
6496
  data: {
6289
- runner_backend: components["schemas"]["RunnerBackend"];
6497
+ plan: components["schemas"]["Plan"];
6290
6498
  };
6291
6499
  };
6292
- CreateRunnerBackendBody: {
6293
- /** @description Owning organisation. */
6294
- org_id: number;
6295
- /** @description Human-readable name. */
6500
+ CreatePlanRequest: {
6501
+ /** @description Stable unique key, e.g. `managed`. */
6502
+ key: string;
6503
+ /** @description Display name. */
6296
6504
  name: string;
6297
- /** @description 12-digit AWS account ID. */
6298
- aws_account_id: string;
6299
- /** @description AWS region, e.g. `us-east-1`. */
6300
- region: string;
6301
- /** @description ARN of a role named `empirical-private-runner-*` in `aws_account_id`. */
6302
- role_arn: string;
6303
- /** @description ECS cluster name. */
6304
- cluster_name: string;
6305
- /** @description CloudWatch log group of the worker. */
6306
- log_group_name: string;
6307
- /** @description `https://sqs.<region>.amazonaws.com/<account>/<name>`; queues are `${queue_prefix}-${machineSize}`. */
6308
- queue_prefix: string;
6309
- /** @description Worker container name. Defaults to `test-run-worker`. */
6310
- container_name?: string;
6505
+ /**
6506
+ * @description Currency the plan is priced in. Defaults to `usd`.
6507
+ * @enum {string}
6508
+ */
6509
+ currency?: "usd" | "inr" | "aed";
6510
+ /** @description Monthly base price in cents of `currency`. */
6511
+ base_price_cents: number;
6512
+ /**
6513
+ * @description Metered allowances, in display order.
6514
+ * @default []
6515
+ */
6516
+ meters: {
6517
+ /**
6518
+ * @description Meter key from the meter registry. Its unit applies to both `included_qty` and `overage_price_cents`.
6519
+ * @enum {string}
6520
+ */
6521
+ meter: "test_suite_size" | "ai_credits" | "test_minutes" | "test_run_duration";
6522
+ /** @description Units included each month. */
6523
+ included_qty?: number | null;
6524
+ /** @description Price per unit above the allowance, in cents; may be fractional. */
6525
+ overage_price_cents?: number | null;
6526
+ }[];
6527
+ };
6528
+ UpdatePlanRequest: {
6529
+ /**
6530
+ * @description `retired` hides the plan from new sales; existing assignments keep it.
6531
+ * @enum {string}
6532
+ */
6533
+ status: "active" | "retired";
6534
+ };
6535
+ BillingMonthSummaryResponse: {
6536
+ /** @description Response payload. */
6537
+ data: {
6538
+ /** @description Usage month, YYYY-MM (UTC). */
6539
+ month: string;
6540
+ period_start: string;
6541
+ /** @description Exclusive (ISO 8601). */
6542
+ period_end: string;
6543
+ is_current_month: boolean;
6544
+ /** @description The shared plan in effect; null for no plan or a custom contract. */
6545
+ plan: {
6546
+ name: string;
6547
+ currency: string;
6548
+ base_price_cents: number;
6549
+ } | null;
6550
+ meters: components["schemas"]["BillingMeterSummary"][];
6551
+ projects: {
6552
+ project_id: number;
6553
+ name: string;
6554
+ slug: string;
6555
+ ai_credits: number;
6556
+ test_minutes: number;
6557
+ }[];
6558
+ overage_cents: number;
6559
+ projected_overage_cents: number | null;
6560
+ /** @description Overage of the previous usage month, as a guide when picking a limit. Current month only. */
6561
+ last_month_overage_cents: number | null;
6562
+ usage_limit: components["schemas"]["UsageLimit"];
6563
+ };
6564
+ };
6565
+ BillingMeterSummary: {
6566
+ /** @enum {string} */
6567
+ meter: "ai_credits" | "test_minutes";
6568
+ included_qty: number | null;
6569
+ overage_price_cents: number | null;
6570
+ /** @description Units used so far this month. */
6571
+ used: number;
6572
+ /** @description Projected units at month end (trailing 7-day pace); null when too early to project. */
6573
+ projected: number | null;
6574
+ overage_cents: number;
6575
+ projected_overage_cents: number | null;
6576
+ };
6577
+ UsageLimit: {
6578
+ /** @description Whether the org's plan supports a usage limit (catalog plans with overage pricing). */
6579
+ available: boolean;
6580
+ /** @description Most overage allowed per usage month, in cents of the plan currency. Null means no limit. */
6581
+ cap_cents: number | null;
6582
+ /**
6583
+ * @description `warning` at 80% of the limit (or, for a $0 limit, 80% of any allowance); `reached` when new work is paused.
6584
+ * @enum {string}
6585
+ */
6586
+ status: "none" | "ok" | "warning" | "reached";
6587
+ /** @description When the limit was reached this month (ISO 8601). */
6588
+ reached_at: string | null;
6589
+ updated_at: string | null;
6590
+ /** @description Who made a change. */
6591
+ updated_by: {
6592
+ /** @description user | agent | api_key | system */
6593
+ kind: string;
6594
+ id: string | null;
6595
+ /** @description User name, when a user. */
6596
+ name: string | null;
6597
+ } | null;
6598
+ };
6599
+ UsageLimitResponse: {
6600
+ /** @description Response payload. */
6601
+ data: {
6602
+ /** @description Whether the org's plan supports a usage limit (catalog plans with overage pricing). */
6603
+ available: boolean;
6604
+ /** @description Most overage allowed per usage month, in cents of the plan currency. Null means no limit. */
6605
+ cap_cents: number | null;
6606
+ /**
6607
+ * @description `warning` at 80% of the limit (or, for a $0 limit, 80% of any allowance); `reached` when new work is paused.
6608
+ * @enum {string}
6609
+ */
6610
+ status: "none" | "ok" | "warning" | "reached";
6611
+ /** @description When the limit was reached this month (ISO 8601). */
6612
+ reached_at: string | null;
6613
+ updated_at: string | null;
6614
+ /** @description Who made a change. */
6615
+ updated_by: {
6616
+ /** @description user | agent | api_key | system */
6617
+ kind: string;
6618
+ id: string | null;
6619
+ /** @description User name, when a user. */
6620
+ name: string | null;
6621
+ } | null;
6622
+ };
6623
+ };
6624
+ UsageLimitEventsResponse: {
6625
+ /** @description Response payload. */
6626
+ data: components["schemas"]["UsageLimitEvent"][];
6627
+ };
6628
+ UsageLimitEvent: {
6629
+ id: number;
6630
+ /** @description spend_cap.set | spend_cap.removed | spend_cap.alert_sent | spend_cap.reached | spend_cap.cleared */
6631
+ action: string;
6632
+ /** @description Who made a change. */
6633
+ actor: {
6634
+ /** @description user | agent | api_key | system */
6635
+ kind: string;
6636
+ id: string | null;
6637
+ /** @description User name, when a user. */
6638
+ name: string | null;
6639
+ };
6640
+ before?: unknown;
6641
+ after?: unknown;
6642
+ metadata?: unknown;
6643
+ created_at: string;
6644
+ };
6645
+ RunnerBackendListResponse: {
6646
+ /** @description Response payload. */
6647
+ data: {
6648
+ runner_backends: components["schemas"]["RunnerBackend"][];
6649
+ };
6650
+ };
6651
+ RunnerBackend: {
6652
+ /** @description Runner backend ID. */
6653
+ id: number;
6654
+ /** @description Organisation that owns the installation. */
6655
+ org_id: number;
6656
+ /** @description Human-readable name. */
6657
+ name: string;
6658
+ /** @description AWS account the installation runs in. */
6659
+ aws_account_id: string;
6660
+ /** @description AWS region of the installation. */
6661
+ region: string;
6662
+ /** @description Role api-worker assumes to drive the plane. */
6663
+ role_arn: string;
6664
+ /** @description External ID the role's trust policy must require. Give it only to this installation's owner. */
6665
+ external_id: string;
6666
+ /** @description ECS cluster name. */
6667
+ cluster_name: string;
6668
+ /** @description CloudWatch log group of the worker. */
6669
+ log_group_name: string;
6670
+ /** @description Worker container name. */
6671
+ container_name: string;
6672
+ /** @description Job queue URLs are `${queue_prefix}-${machineSize}`. */
6673
+ queue_prefix: string;
6674
+ /**
6675
+ * @description `pending` until verified; only `active` backends receive runs.
6676
+ * @enum {string}
6677
+ */
6678
+ status: "pending" | "active" | "disabled";
6679
+ /** @description ISO-8601 time of the last successful verify. */
6680
+ last_verified_at: string | null;
6681
+ /** @description ISO-8601 time of the last verify, manual or scheduled, whatever its outcome. */
6682
+ last_checked_at: string | null;
6683
+ /** @description Outcome of the last verify; null if never run. */
6684
+ last_check_ok: boolean | null;
6685
+ /** @description Every check from the last verify. */
6686
+ last_check_results: components["schemas"]["RunnerBackendCheck"][] | null;
6687
+ /** @description ISO-8601 start of the current run of failed checks; null while passing. A failing check does not change `status`. */
6688
+ check_failing_since: string | null;
6689
+ /** @description ISO-8601 creation time. */
6690
+ created_at: string;
6691
+ /** @description ISO-8601 last-update time. */
6692
+ updated_at: string;
6693
+ };
6694
+ RunnerBackendCheck: {
6695
+ /** @description `assume_role`, `job_queue`, `scaler_trigger_queue`, `ecs_cluster`, `ecs_tasks` or `worker_logs`. */
6696
+ name: string;
6697
+ /** @description Whether the check passed. */
6698
+ ok: boolean;
6699
+ /** @description The resource checked, or the AWS error. */
6700
+ detail: string;
6701
+ };
6702
+ RunnerBackendResponse: {
6703
+ /** @description Response payload. */
6704
+ data: {
6705
+ runner_backend: components["schemas"]["RunnerBackend"];
6706
+ };
6707
+ };
6708
+ CreateRunnerBackendBody: {
6709
+ /** @description Owning organisation. */
6710
+ org_id: number;
6711
+ /** @description Human-readable name. */
6712
+ name: string;
6713
+ /** @description 12-digit AWS account ID. */
6714
+ aws_account_id: string;
6715
+ /** @description AWS region, e.g. `us-east-1`. */
6716
+ region: string;
6717
+ /** @description ARN of a role named `empirical-private-runner-*` in `aws_account_id`. */
6718
+ role_arn: string;
6719
+ /** @description ECS cluster name. */
6720
+ cluster_name: string;
6721
+ /** @description CloudWatch log group of the worker. */
6722
+ log_group_name: string;
6723
+ /** @description `https://sqs.<region>.amazonaws.com/<account>/<name>`; queues are `${queue_prefix}-${machineSize}`. */
6724
+ queue_prefix: string;
6725
+ /** @description Worker container name. Defaults to `test-run-worker`. */
6726
+ container_name?: string;
6311
6727
  /** @description Only for installations whose role already requires a fixed ID (Empirical's own dogfood). Generated otherwise. */
6312
6728
  external_id?: string;
6313
6729
  };
@@ -6380,6 +6796,73 @@ export interface components {
6380
6796
  runner_backend: components["schemas"]["RunnerBackend"];
6381
6797
  };
6382
6798
  };
6799
+ CreateSystemMessageResponse: {
6800
+ data: {
6801
+ system_message: components["schemas"]["SystemMessage"];
6802
+ recipients: components["schemas"]["SystemMessageRecipient"][];
6803
+ skipped_project_ids: number[];
6804
+ };
6805
+ };
6806
+ SystemMessage: {
6807
+ id: number;
6808
+ body: string;
6809
+ created_by: string | null;
6810
+ created_at: string;
6811
+ };
6812
+ SystemMessageRecipient: {
6813
+ project_id: number;
6814
+ chat_session_id: number | null;
6815
+ /** @enum {string} */
6816
+ delivery_status: "pending" | "delivered" | "failed";
6817
+ delivery_error: string | null;
6818
+ delivered_at: string | null;
6819
+ /** @enum {string|null} */
6820
+ ack_status: "accepted" | "declined" | null;
6821
+ ack_note: string | null;
6822
+ acked_at: string | null;
6823
+ acked_by_chat_session_id: number | null;
6824
+ session_error: string | null;
6825
+ session_is_closed: boolean | null;
6826
+ };
6827
+ CreateSystemMessageRequest: {
6828
+ body: string;
6829
+ project_ids?: number[];
6830
+ };
6831
+ SystemMessageListResponse: {
6832
+ data: {
6833
+ system_messages: components["schemas"]["SystemMessageSummary"][];
6834
+ };
6835
+ };
6836
+ SystemMessageSummary: {
6837
+ id: number;
6838
+ body: string;
6839
+ created_by: string | null;
6840
+ created_at: string;
6841
+ recipients: number;
6842
+ delivered: number;
6843
+ failed: number;
6844
+ acked: number;
6845
+ };
6846
+ SystemMessageDetailResponse: {
6847
+ data: {
6848
+ system_message: components["schemas"]["SystemMessage"];
6849
+ recipients: components["schemas"]["SystemMessageRecipient"][];
6850
+ };
6851
+ };
6852
+ AckSystemMessageResponse: {
6853
+ data: {
6854
+ system_message_id: number;
6855
+ project_id: number;
6856
+ /** @enum {string} */
6857
+ ack_status: "accepted" | "declined";
6858
+ acked_at: string;
6859
+ };
6860
+ };
6861
+ AckSystemMessageRequest: {
6862
+ /** @enum {string} */
6863
+ status: "accepted" | "declined";
6864
+ note?: string;
6865
+ };
6383
6866
  ApiKeyListResponse: {
6384
6867
  /** @description Response payload. */
6385
6868
  data: {
@@ -7976,8 +8459,8 @@ export interface components {
7976
8459
  effective_from: string;
7977
8460
  /** @description ISO timestamp it was turned off; null while active. */
7978
8461
  effective_to: string | null;
7979
- /** @description Order-form line this period bills against, when a priced line exists. Null for add-ons that are free today. */
7980
- order_form_line_id: number | null;
8462
+ /** @description Add-on plan this period bills against, when a priced one exists. Null for add-ons that are free today. */
8463
+ plan_id: number | null;
7981
8464
  created_by: string | null;
7982
8465
  ended_by: string | null;
7983
8466
  };
@@ -7993,8 +8476,8 @@ export interface components {
7993
8476
  * @description Backdate the period to this ISO timestamp. Super admin only; defaults to now.
7994
8477
  */
7995
8478
  effective_from?: string;
7996
- /** @description Order-form line (kind='addon') this period bills against. Super admin only. */
7997
- order_form_line_id?: number;
8479
+ /** @description Add-on plan (kind='addon') this period bills against. Super admin only. */
8480
+ plan_id?: number;
7998
8481
  };
7999
8482
  StaticIpsResponse: {
8000
8483
  /** @description Response payload. */
@@ -9053,8 +9536,14 @@ export interface components {
9053
9536
  /** @description Response payload. */
9054
9537
  data: {
9055
9538
  chat_session: components["schemas"]["ChatSession"];
9539
+ subscription: components["schemas"]["ChatSessionCallerSubscription"];
9056
9540
  };
9057
9541
  };
9542
+ /** @description One-shot subscription that wakes the calling agent session when this session next waits for input; null when none was created. */
9543
+ ChatSessionCallerSubscription: {
9544
+ /** @description Subscription ID. */
9545
+ id: number;
9546
+ } | null;
9058
9547
  ChatSessionDetailResponse: {
9059
9548
  /** @description Response payload. */
9060
9549
  data: {
@@ -9123,6 +9612,7 @@ export interface components {
9123
9612
  /** @description Response payload. */
9124
9613
  data: {
9125
9614
  chat_session: components["schemas"]["ChatSession"];
9615
+ subscription: components["schemas"]["ChatSessionCallerSubscription"];
9126
9616
  };
9127
9617
  };
9128
9618
  ChatSessionTimelineResponse: {
@@ -11489,8 +11979,6 @@ export interface components {
11489
11979
  number: number;
11490
11980
  url: string;
11491
11981
  } | null;
11492
- /** @description Whether the project posts the linked test changes check on GitHub. */
11493
- check_enabled: boolean;
11494
11982
  /** @description Latest GitHub check written for the app PR, from any of its runs. */
11495
11983
  check: {
11496
11984
  check_run_url: string | null;
@@ -17747,9 +18235,14 @@ export interface operations {
17747
18235
  entity_type: string;
17748
18236
  /** @description Exact entity id, or null when this trigger matches every entity. */
17749
18237
  entity_id: string | null;
17750
- /** @description Optional payload equality filters. Keys must be allowed for the selected event in the canonical event catalog, and enum-like fields only accept the values the event emits. */
18238
+ /** @description Optional payload filters. Keys must be allowed for the selected event in the canonical event catalog. A primitive value is an equality match, and enum-like fields only accept the values the event emits. Numeric fields also accept a comparison object such as {"gt": 2} or {"gte": 1, "lte": 5}; operators combine with AND and never match null. */
17751
18239
  payload_filter: {
17752
- [key: string]: string | number | boolean | unknown;
18240
+ [key: string]: string | number | boolean | {
18241
+ gt?: number;
18242
+ gte?: number;
18243
+ lt?: number;
18244
+ lte?: number;
18245
+ } | unknown;
17753
18246
  };
17754
18247
  message: string;
17755
18248
  /**
@@ -17794,9 +18287,14 @@ export interface operations {
17794
18287
  event_type: string;
17795
18288
  /** @description Exact canonical entity id to match. Omit on create, or set null on update, to match every entity. */
17796
18289
  entity_id?: string;
17797
- /** @description Optional payload equality filters. Keys must be allowed for the selected event in the canonical event catalog, and enum-like fields only accept the values the event emits. */
18290
+ /** @description Optional payload filters. Keys must be allowed for the selected event in the canonical event catalog. A primitive value is an equality match, and enum-like fields only accept the values the event emits. Numeric fields also accept a comparison object such as {"gt": 2} or {"gte": 1, "lte": 5}; operators combine with AND and never match null. */
17798
18291
  payload_filter?: {
17799
- [key: string]: string | number | boolean | unknown;
18292
+ [key: string]: string | number | boolean | {
18293
+ gt?: number;
18294
+ gte?: number;
18295
+ lt?: number;
18296
+ lte?: number;
18297
+ } | unknown;
17800
18298
  };
17801
18299
  /** @description Continuation instruction delivered to the session after the event matches. */
17802
18300
  message: string;
@@ -17825,9 +18323,14 @@ export interface operations {
17825
18323
  entity_type: string;
17826
18324
  /** @description Exact entity id, or null when this trigger matches every entity. */
17827
18325
  entity_id: string | null;
17828
- /** @description Optional payload equality filters. Keys must be allowed for the selected event in the canonical event catalog, and enum-like fields only accept the values the event emits. */
18326
+ /** @description Optional payload filters. Keys must be allowed for the selected event in the canonical event catalog. A primitive value is an equality match, and enum-like fields only accept the values the event emits. Numeric fields also accept a comparison object such as {"gt": 2} or {"gte": 1, "lte": 5}; operators combine with AND and never match null. */
17829
18327
  payload_filter: {
17830
- [key: string]: string | number | boolean | unknown;
18328
+ [key: string]: string | number | boolean | {
18329
+ gt?: number;
18330
+ gte?: number;
18331
+ lt?: number;
18332
+ lte?: number;
18333
+ } | unknown;
17831
18334
  };
17832
18335
  message: string;
17833
18336
  /**
@@ -17899,9 +18402,14 @@ export interface operations {
17899
18402
  entity_type: string;
17900
18403
  /** @description Exact entity id, or null when this trigger matches every entity. */
17901
18404
  entity_id: string | null;
17902
- /** @description Optional payload equality filters. Keys must be allowed for the selected event in the canonical event catalog, and enum-like fields only accept the values the event emits. */
18405
+ /** @description Optional payload filters. Keys must be allowed for the selected event in the canonical event catalog. A primitive value is an equality match, and enum-like fields only accept the values the event emits. Numeric fields also accept a comparison object such as {"gt": 2} or {"gte": 1, "lte": 5}; operators combine with AND and never match null. */
17903
18406
  payload_filter: {
17904
- [key: string]: string | number | boolean | unknown;
18407
+ [key: string]: string | number | boolean | {
18408
+ gt?: number;
18409
+ gte?: number;
18410
+ lt?: number;
18411
+ lte?: number;
18412
+ } | unknown;
17905
18413
  };
17906
18414
  message: string;
17907
18415
  /**
@@ -17974,9 +18482,14 @@ export interface operations {
17974
18482
  event_type?: string;
17975
18483
  /** @description Exact canonical entity id to match. Omit on create, or set null on update, to match every entity. */
17976
18484
  entity_id?: string | null;
17977
- /** @description Optional payload equality filters. Keys must be allowed for the selected event in the canonical event catalog, and enum-like fields only accept the values the event emits. */
18485
+ /** @description Optional payload filters. Keys must be allowed for the selected event in the canonical event catalog. A primitive value is an equality match, and enum-like fields only accept the values the event emits. Numeric fields also accept a comparison object such as {"gt": 2} or {"gte": 1, "lte": 5}; operators combine with AND and never match null. */
17978
18486
  payload_filter?: {
17979
- [key: string]: string | number | boolean | unknown;
18487
+ [key: string]: string | number | boolean | {
18488
+ gt?: number;
18489
+ gte?: number;
18490
+ lt?: number;
18491
+ lte?: number;
18492
+ } | unknown;
17980
18493
  };
17981
18494
  /** @description Continuation instruction delivered to the session after the event matches. */
17982
18495
  message?: string;
@@ -18005,9 +18518,14 @@ export interface operations {
18005
18518
  entity_type: string;
18006
18519
  /** @description Exact entity id, or null when this trigger matches every entity. */
18007
18520
  entity_id: string | null;
18008
- /** @description Optional payload equality filters. Keys must be allowed for the selected event in the canonical event catalog, and enum-like fields only accept the values the event emits. */
18521
+ /** @description Optional payload filters. Keys must be allowed for the selected event in the canonical event catalog. A primitive value is an equality match, and enum-like fields only accept the values the event emits. Numeric fields also accept a comparison object such as {"gt": 2} or {"gte": 1, "lte": 5}; operators combine with AND and never match null. */
18009
18522
  payload_filter: {
18010
- [key: string]: string | number | boolean | unknown;
18523
+ [key: string]: string | number | boolean | {
18524
+ gt?: number;
18525
+ gte?: number;
18526
+ lt?: number;
18527
+ lte?: number;
18528
+ } | unknown;
18011
18529
  };
18012
18530
  message: string;
18013
18531
  /**
@@ -18652,31 +19170,11 @@ export interface operations {
18652
19170
  };
18653
19171
  };
18654
19172
  };
18655
- listChatSessions: {
19173
+ getBillingMonthSummary: {
18656
19174
  parameters: {
18657
19175
  query?: {
18658
- /** @description Restrict to a single project (ignored for bound principals). */
18659
- project_id?: number;
18660
- /** @description Include closed sessions when `true`. */
18661
- show_closed?: boolean | null;
18662
- /** @description Filter sessions by preset (all, active, merged). */
18663
- preset?: "all" | "active" | "merged";
18664
- /** @description Page number (1-indexed). Default 1. */
18665
- page?: number;
18666
- /** @description Items per page. Default 10. */
18667
- per_page?: number;
18668
- /** @description Optional Manager sidebar category: executor sessions, or all non-manager/non-executor user-facing sessions. */
18669
- category?: "executor" | "user";
18670
- /** @description Comma-separated project IDs to include. */
18671
- project_ids?: string;
18672
- /** @description Comma-separated project IDs to exclude. */
18673
- exclude_project_ids?: string;
18674
- /** @description Comma-separated creator user IDs to filter by. */
18675
- user_ids?: string;
18676
- /** @description Only sessions updated within this many days. */
18677
- updated_within_days?: number;
18678
- /** @description URL-encoded JSON array of generic filter conditions. */
18679
- filters?: string;
19176
+ /** @description Usage month (YYYY-MM, UTC). Defaults to the current month. */
19177
+ month?: string;
18680
19178
  };
18681
19179
  header?: never;
18682
19180
  path?: never;
@@ -18684,16 +19182,16 @@ export interface operations {
18684
19182
  };
18685
19183
  requestBody?: never;
18686
19184
  responses: {
18687
- /** @description Page of chat sessions. */
19185
+ /** @description The month summary. */
18688
19186
  200: {
18689
19187
  headers: {
18690
19188
  [name: string]: unknown;
18691
19189
  };
18692
19190
  content: {
18693
- "application/json": components["schemas"]["ChatSessionListResponse"];
19191
+ "application/json": components["schemas"]["BillingMonthSummaryResponse"];
18694
19192
  };
18695
19193
  };
18696
- /** @description Invalid request. */
19194
+ /** @description Invalid month, or missing project scope. */
18697
19195
  400: {
18698
19196
  headers: {
18699
19197
  [name: string]: unknown;
@@ -18702,7 +19200,7 @@ export interface operations {
18702
19200
  "application/json": components["schemas"]["ErrorResponse"];
18703
19201
  };
18704
19202
  };
18705
- /** @description Project not found or not accessible. */
19203
+ /** @description The project has no org. */
18706
19204
  404: {
18707
19205
  headers: {
18708
19206
  [name: string]: unknown;
@@ -18713,7 +19211,7 @@ export interface operations {
18713
19211
  };
18714
19212
  };
18715
19213
  };
18716
- createChatSession: {
19214
+ setUsageLimit: {
18717
19215
  parameters: {
18718
19216
  query?: never;
18719
19217
  header?: never;
@@ -18723,28 +19221,22 @@ export interface operations {
18723
19221
  requestBody?: {
18724
19222
  content: {
18725
19223
  "application/json": {
18726
- message?: string | null;
18727
- mode?: string | null;
18728
- source?: string | null;
18729
- source_identifier?: string | null;
18730
- model?: string | null;
18731
- /** @description Deprecated. Sessions start on the project default branch; a different branch is added to `message` as an instruction to work from it. */
18732
- base_branch?: string | null;
18733
- created_by?: string | null;
19224
+ /** @description Whole dollars, in cents; null removes it. */
19225
+ cap_cents: number | null;
18734
19226
  };
18735
19227
  };
18736
19228
  };
18737
19229
  responses: {
18738
- /** @description The created chat session. */
18739
- 201: {
19230
+ /** @description The updated usage limit. */
19231
+ 200: {
18740
19232
  headers: {
18741
19233
  [name: string]: unknown;
18742
19234
  };
18743
19235
  content: {
18744
- "application/json": components["schemas"]["ChatSessionCreateResponse"];
19236
+ "application/json": components["schemas"]["UsageLimitResponse"];
18745
19237
  };
18746
19238
  };
18747
- /** @description Invalid request. */
19239
+ /** @description Invalid body, or the plan doesn't support a limit. */
18748
19240
  400: {
18749
19241
  headers: {
18750
19242
  [name: string]: unknown;
@@ -18753,30 +19245,49 @@ export interface operations {
18753
19245
  "application/json": components["schemas"]["ErrorResponse"];
18754
19246
  };
18755
19247
  };
19248
+ /** @description The project has no org. */
19249
+ 404: {
19250
+ headers: {
19251
+ [name: string]: unknown;
19252
+ };
19253
+ content: {
19254
+ "application/json": components["schemas"]["ErrorResponse"];
19255
+ };
19256
+ };
18756
19257
  };
18757
19258
  };
18758
- getChatSession: {
19259
+ listUsageLimitEvents: {
18759
19260
  parameters: {
18760
- query?: never;
18761
- header?: never;
18762
- path: {
18763
- /** @description Chat session ID. */
18764
- id: number;
19261
+ query?: {
19262
+ per_page?: number;
19263
+ /** @description Return events older than this id (pagination cursor). */
19264
+ before_id?: number;
18765
19265
  };
19266
+ header?: never;
19267
+ path?: never;
18766
19268
  cookie?: never;
18767
19269
  };
18768
19270
  requestBody?: never;
18769
19271
  responses: {
18770
- /** @description The chat session. */
19272
+ /** @description Usage limit events. */
18771
19273
  200: {
18772
19274
  headers: {
18773
19275
  [name: string]: unknown;
18774
19276
  };
18775
19277
  content: {
18776
- "application/json": components["schemas"]["ChatSessionDetailResponse"];
19278
+ "application/json": components["schemas"]["UsageLimitEventsResponse"];
18777
19279
  };
18778
19280
  };
18779
- /** @description Chat session not found. */
19281
+ /** @description Invalid query, or missing project scope. */
19282
+ 400: {
19283
+ headers: {
19284
+ [name: string]: unknown;
19285
+ };
19286
+ content: {
19287
+ "application/json": components["schemas"]["ErrorResponse"];
19288
+ };
19289
+ };
19290
+ /** @description The project has no org. */
18780
19291
  404: {
18781
19292
  headers: {
18782
19293
  [name: string]: unknown;
@@ -18787,17 +19298,154 @@ export interface operations {
18787
19298
  };
18788
19299
  };
18789
19300
  };
18790
- patchChatSession: {
19301
+ listChatSessions: {
18791
19302
  parameters: {
18792
- query?: never;
18793
- header?: never;
18794
- path: {
18795
- /** @description Chat session ID. */
18796
- id: number;
18797
- };
18798
- cookie?: never;
18799
- };
18800
- requestBody?: {
19303
+ query?: {
19304
+ /** @description Restrict to a single project (ignored for bound principals). */
19305
+ project_id?: number;
19306
+ /** @description Include closed sessions when `true`. */
19307
+ show_closed?: boolean | null;
19308
+ /** @description Filter sessions by preset (all, active, merged). */
19309
+ preset?: "all" | "active" | "merged";
19310
+ /** @description Page number (1-indexed). Default 1. */
19311
+ page?: number;
19312
+ /** @description Items per page. Default 10. */
19313
+ per_page?: number;
19314
+ /** @description Optional Manager sidebar category: executor sessions, or all non-manager/non-executor user-facing sessions. */
19315
+ category?: "executor" | "user";
19316
+ /** @description Comma-separated project IDs to include. */
19317
+ project_ids?: string;
19318
+ /** @description Comma-separated project IDs to exclude. */
19319
+ exclude_project_ids?: string;
19320
+ /** @description Comma-separated creator user IDs to filter by. */
19321
+ user_ids?: string;
19322
+ /** @description Only sessions updated within this many days. */
19323
+ updated_within_days?: number;
19324
+ /** @description URL-encoded JSON array of generic filter conditions. */
19325
+ filters?: string;
19326
+ };
19327
+ header?: never;
19328
+ path?: never;
19329
+ cookie?: never;
19330
+ };
19331
+ requestBody?: never;
19332
+ responses: {
19333
+ /** @description Page of chat sessions. */
19334
+ 200: {
19335
+ headers: {
19336
+ [name: string]: unknown;
19337
+ };
19338
+ content: {
19339
+ "application/json": components["schemas"]["ChatSessionListResponse"];
19340
+ };
19341
+ };
19342
+ /** @description Invalid request. */
19343
+ 400: {
19344
+ headers: {
19345
+ [name: string]: unknown;
19346
+ };
19347
+ content: {
19348
+ "application/json": components["schemas"]["ErrorResponse"];
19349
+ };
19350
+ };
19351
+ /** @description Project not found or not accessible. */
19352
+ 404: {
19353
+ headers: {
19354
+ [name: string]: unknown;
19355
+ };
19356
+ content: {
19357
+ "application/json": components["schemas"]["ErrorResponse"];
19358
+ };
19359
+ };
19360
+ };
19361
+ };
19362
+ createChatSession: {
19363
+ parameters: {
19364
+ query?: never;
19365
+ header?: never;
19366
+ path?: never;
19367
+ cookie?: never;
19368
+ };
19369
+ requestBody?: {
19370
+ content: {
19371
+ "application/json": {
19372
+ message?: string | null;
19373
+ mode?: string | null;
19374
+ source?: string | null;
19375
+ source_identifier?: string | null;
19376
+ model?: string | null;
19377
+ /** @description Deprecated. Sessions start on the project default branch; a different branch is added to `message` as an instruction to work from it. */
19378
+ base_branch?: string | null;
19379
+ created_by?: string | null;
19380
+ /** @description When the caller is an agent session, wake it the next time this session waits for input (one-shot). Defaults to true; pass false for a fire-and-forget message. Ignored for other callers. */
19381
+ subscribe?: boolean | null;
19382
+ };
19383
+ };
19384
+ };
19385
+ responses: {
19386
+ /** @description The created chat session. */
19387
+ 201: {
19388
+ headers: {
19389
+ [name: string]: unknown;
19390
+ };
19391
+ content: {
19392
+ "application/json": components["schemas"]["ChatSessionCreateResponse"];
19393
+ };
19394
+ };
19395
+ /** @description Invalid request. */
19396
+ 400: {
19397
+ headers: {
19398
+ [name: string]: unknown;
19399
+ };
19400
+ content: {
19401
+ "application/json": components["schemas"]["ErrorResponse"];
19402
+ };
19403
+ };
19404
+ };
19405
+ };
19406
+ getChatSession: {
19407
+ parameters: {
19408
+ query?: never;
19409
+ header?: never;
19410
+ path: {
19411
+ /** @description Chat session ID. */
19412
+ id: number;
19413
+ };
19414
+ cookie?: never;
19415
+ };
19416
+ requestBody?: never;
19417
+ responses: {
19418
+ /** @description The chat session. */
19419
+ 200: {
19420
+ headers: {
19421
+ [name: string]: unknown;
19422
+ };
19423
+ content: {
19424
+ "application/json": components["schemas"]["ChatSessionDetailResponse"];
19425
+ };
19426
+ };
19427
+ /** @description Chat session not found. */
19428
+ 404: {
19429
+ headers: {
19430
+ [name: string]: unknown;
19431
+ };
19432
+ content: {
19433
+ "application/json": components["schemas"]["ErrorResponse"];
19434
+ };
19435
+ };
19436
+ };
19437
+ };
19438
+ patchChatSession: {
19439
+ parameters: {
19440
+ query?: never;
19441
+ header?: never;
19442
+ path: {
19443
+ /** @description Chat session ID. */
19444
+ id: number;
19445
+ };
19446
+ cookie?: never;
19447
+ };
19448
+ requestBody?: {
18801
19449
  content: {
18802
19450
  "application/json": {
18803
19451
  title?: string;
@@ -19294,7 +19942,9 @@ export interface operations {
19294
19942
  entity_type: string;
19295
19943
  entity_id: string | null;
19296
19944
  payload_filter: {
19297
- [key: string]: string | number | boolean | unknown;
19945
+ [key: string]: string | number | boolean | {
19946
+ [key: string]: number;
19947
+ } | unknown;
19298
19948
  };
19299
19949
  message: string;
19300
19950
  /** @enum {string} */
@@ -19390,6 +20040,8 @@ export interface operations {
19390
20040
  send_action: "steer" | "follow_up" | "stop";
19391
20041
  created_by?: string | null;
19392
20042
  rpc_command_id?: string;
20043
+ /** @description When the caller is an agent session, wake it the next time this session waits for input (one-shot). Defaults to true; pass false for a fire-and-forget message. Ignored for other callers. */
20044
+ subscribe?: boolean | null;
19393
20045
  };
19394
20046
  };
19395
20047
  };
@@ -22260,6 +22912,70 @@ export interface operations {
22260
22912
  };
22261
22913
  };
22262
22914
  };
22915
+ previewInvoiceEmail: {
22916
+ parameters: {
22917
+ query?: {
22918
+ /** @description When `true`, preview the test email (sent to the internal test recipient). Defaults to `false`. */
22919
+ is_test_email?: "true" | "false";
22920
+ };
22921
+ header?: never;
22922
+ path: {
22923
+ /** @description Invoice ID. */
22924
+ id: string;
22925
+ };
22926
+ cookie?: never;
22927
+ };
22928
+ requestBody?: never;
22929
+ responses: {
22930
+ /** @description The rendered email. */
22931
+ 200: {
22932
+ headers: {
22933
+ [name: string]: unknown;
22934
+ };
22935
+ content: {
22936
+ "application/json": {
22937
+ /** @description Response payload. */
22938
+ data: {
22939
+ /** @description Sender address. */
22940
+ from: string;
22941
+ /** @description To recipients. */
22942
+ to: string[];
22943
+ /** @description CC recipients. */
22944
+ cc: string[];
22945
+ /** @description BCC recipients. */
22946
+ bcc: string[];
22947
+ /** @description Reply-To addresses. */
22948
+ reply_to: string[];
22949
+ /** @description Email subject. */
22950
+ subject: string;
22951
+ /** @description Rendered email body HTML. */
22952
+ html: string;
22953
+ /** @description Attached PDF filename, or null when the invoice has no PDF. */
22954
+ attachment_filename: string | null;
22955
+ };
22956
+ };
22957
+ };
22958
+ };
22959
+ /** @description Invalid invoice ID or organisation not found. */
22960
+ 400: {
22961
+ headers: {
22962
+ [name: string]: unknown;
22963
+ };
22964
+ content: {
22965
+ "application/json": components["schemas"]["ErrorResponse"];
22966
+ };
22967
+ };
22968
+ /** @description Invoice not found. */
22969
+ 404: {
22970
+ headers: {
22971
+ [name: string]: unknown;
22972
+ };
22973
+ content: {
22974
+ "application/json": components["schemas"]["ErrorResponse"];
22975
+ };
22976
+ };
22977
+ };
22978
+ };
22263
22979
  generateInvoicePdf: {
22264
22980
  parameters: {
22265
22981
  query?: never;
@@ -24454,8 +25170,8 @@ export interface operations {
24454
25170
  per_page?: number;
24455
25171
  /** @description Filter to assignments for this organisation. */
24456
25172
  org_id?: number | null;
24457
- /** @description Filter to assignments for this order-form line. */
24458
- order_form_line_id?: number | null;
25173
+ /** @description Filter to assignments for this plan. */
25174
+ plan_id?: number | null;
24459
25175
  };
24460
25176
  header?: never;
24461
25177
  path?: never;
@@ -24505,7 +25221,7 @@ export interface operations {
24505
25221
  "application/json": components["schemas"]["PlanAssignmentResponse"];
24506
25222
  };
24507
25223
  };
24508
- /** @description Validation failed or the organisation does not exist. */
25224
+ /** @description Validation failed, or the organisation or plan does not exist. */
24509
25225
  400: {
24510
25226
  headers: {
24511
25227
  [name: string]: unknown;
@@ -24602,6 +25318,189 @@ export interface operations {
24602
25318
  };
24603
25319
  };
24604
25320
  };
25321
+ getOrgPlan: {
25322
+ parameters: {
25323
+ query?: {
25324
+ /** @description Usage month (YYYY-MM, UTC). Returns the plan in effect at the end of that month, or now for the current month. Defaults to now. */
25325
+ month?: string;
25326
+ };
25327
+ header?: never;
25328
+ path?: never;
25329
+ cookie?: never;
25330
+ };
25331
+ requestBody?: never;
25332
+ responses: {
25333
+ /** @description The org's plan status. */
25334
+ 200: {
25335
+ headers: {
25336
+ [name: string]: unknown;
25337
+ };
25338
+ content: {
25339
+ "application/json": components["schemas"]["OrgPlanResponse"];
25340
+ };
25341
+ };
25342
+ /** @description Invalid month, or missing project scope. */
25343
+ 400: {
25344
+ headers: {
25345
+ [name: string]: unknown;
25346
+ };
25347
+ content: {
25348
+ "application/json": components["schemas"]["ErrorResponse"];
25349
+ };
25350
+ };
25351
+ };
25352
+ };
25353
+ listPlans: {
25354
+ parameters: {
25355
+ query?: {
25356
+ /** @description List this organisation's custom plans instead of the shared plans. */
25357
+ org_id?: number | null;
25358
+ };
25359
+ header?: never;
25360
+ path?: never;
25361
+ cookie?: never;
25362
+ };
25363
+ requestBody?: never;
25364
+ responses: {
25365
+ /** @description The plans. */
25366
+ 200: {
25367
+ headers: {
25368
+ [name: string]: unknown;
25369
+ };
25370
+ content: {
25371
+ "application/json": components["schemas"]["PlanListResponse"];
25372
+ };
25373
+ };
25374
+ };
25375
+ };
25376
+ createPlan: {
25377
+ parameters: {
25378
+ query?: never;
25379
+ header?: never;
25380
+ path?: never;
25381
+ cookie?: never;
25382
+ };
25383
+ requestBody?: {
25384
+ content: {
25385
+ "application/json": components["schemas"]["CreatePlanRequest"];
25386
+ };
25387
+ };
25388
+ responses: {
25389
+ /** @description The created plan. */
25390
+ 200: {
25391
+ headers: {
25392
+ [name: string]: unknown;
25393
+ };
25394
+ content: {
25395
+ "application/json": components["schemas"]["PlanResponse"];
25396
+ };
25397
+ };
25398
+ /** @description Validation failed. */
25399
+ 400: {
25400
+ headers: {
25401
+ [name: string]: unknown;
25402
+ };
25403
+ content: {
25404
+ "application/json": components["schemas"]["ErrorResponse"];
25405
+ };
25406
+ };
25407
+ /** @description A plan with this key already exists. */
25408
+ 409: {
25409
+ headers: {
25410
+ [name: string]: unknown;
25411
+ };
25412
+ content: {
25413
+ "application/json": components["schemas"]["ErrorResponse"];
25414
+ };
25415
+ };
25416
+ };
25417
+ };
25418
+ getPlanById: {
25419
+ parameters: {
25420
+ query?: never;
25421
+ header?: never;
25422
+ path: {
25423
+ /** @description Plan ID. */
25424
+ id: number;
25425
+ };
25426
+ cookie?: never;
25427
+ };
25428
+ requestBody?: never;
25429
+ responses: {
25430
+ /** @description The plan. */
25431
+ 200: {
25432
+ headers: {
25433
+ [name: string]: unknown;
25434
+ };
25435
+ content: {
25436
+ "application/json": components["schemas"]["PlanResponse"];
25437
+ };
25438
+ };
25439
+ /** @description Invalid plan id. */
25440
+ 400: {
25441
+ headers: {
25442
+ [name: string]: unknown;
25443
+ };
25444
+ content: {
25445
+ "application/json": components["schemas"]["ErrorResponse"];
25446
+ };
25447
+ };
25448
+ /** @description Plan not found. */
25449
+ 404: {
25450
+ headers: {
25451
+ [name: string]: unknown;
25452
+ };
25453
+ content: {
25454
+ "application/json": components["schemas"]["ErrorResponse"];
25455
+ };
25456
+ };
25457
+ };
25458
+ };
25459
+ updatePlan: {
25460
+ parameters: {
25461
+ query?: never;
25462
+ header?: never;
25463
+ path: {
25464
+ /** @description Plan ID. */
25465
+ id: number;
25466
+ };
25467
+ cookie?: never;
25468
+ };
25469
+ requestBody?: {
25470
+ content: {
25471
+ "application/json": components["schemas"]["UpdatePlanRequest"];
25472
+ };
25473
+ };
25474
+ responses: {
25475
+ /** @description The updated plan. */
25476
+ 200: {
25477
+ headers: {
25478
+ [name: string]: unknown;
25479
+ };
25480
+ content: {
25481
+ "application/json": components["schemas"]["PlanResponse"];
25482
+ };
25483
+ };
25484
+ /** @description Validation failed. */
25485
+ 400: {
25486
+ headers: {
25487
+ [name: string]: unknown;
25488
+ };
25489
+ content: {
25490
+ "application/json": components["schemas"]["ErrorResponse"];
25491
+ };
25492
+ };
25493
+ /** @description Plan not found. */
25494
+ 404: {
25495
+ headers: {
25496
+ [name: string]: unknown;
25497
+ };
25498
+ content: {
25499
+ "application/json": components["schemas"]["ErrorResponse"];
25500
+ };
25501
+ };
25502
+ };
25503
+ };
24605
25504
  listProjectAddons: {
24606
25505
  parameters: {
24607
25506
  query?: never;
@@ -24724,7 +25623,7 @@ export interface operations {
24724
25623
  "application/json": components["schemas"]["ErrorResponse"];
24725
25624
  };
24726
25625
  };
24727
- /** @description effective_from / order_form_line_id require super admin. */
25626
+ /** @description effective_from / plan_id require super admin. */
24728
25627
  403: {
24729
25628
  headers: {
24730
25629
  [name: string]: unknown;
@@ -26990,6 +27889,145 @@ export interface operations {
26990
27889
  };
26991
27890
  };
26992
27891
  };
27892
+ listSystemMessages: {
27893
+ parameters: {
27894
+ query?: {
27895
+ limit?: number;
27896
+ };
27897
+ header?: never;
27898
+ path?: never;
27899
+ cookie?: never;
27900
+ };
27901
+ requestBody?: never;
27902
+ responses: {
27903
+ /** @description Recent system messages, newest first. */
27904
+ 200: {
27905
+ headers: {
27906
+ [name: string]: unknown;
27907
+ };
27908
+ content: {
27909
+ "application/json": components["schemas"]["SystemMessageListResponse"];
27910
+ };
27911
+ };
27912
+ };
27913
+ };
27914
+ createSystemMessage: {
27915
+ parameters: {
27916
+ query?: never;
27917
+ header?: never;
27918
+ path?: never;
27919
+ cookie?: never;
27920
+ };
27921
+ requestBody?: {
27922
+ content: {
27923
+ "application/json": components["schemas"]["CreateSystemMessageRequest"];
27924
+ };
27925
+ };
27926
+ responses: {
27927
+ /** @description The message and its per-project delivery. */
27928
+ 200: {
27929
+ headers: {
27930
+ [name: string]: unknown;
27931
+ };
27932
+ content: {
27933
+ "application/json": components["schemas"]["CreateSystemMessageResponse"];
27934
+ };
27935
+ };
27936
+ /** @description A listed project does not exist. */
27937
+ 400: {
27938
+ headers: {
27939
+ [name: string]: unknown;
27940
+ };
27941
+ content: {
27942
+ "application/json": components["schemas"]["ErrorResponse"];
27943
+ };
27944
+ };
27945
+ /** @description Broadcast requested but no project has an open manager session. */
27946
+ 422: {
27947
+ headers: {
27948
+ [name: string]: unknown;
27949
+ };
27950
+ content: {
27951
+ "application/json": components["schemas"]["ErrorResponse"];
27952
+ };
27953
+ };
27954
+ };
27955
+ };
27956
+ getSystemMessage: {
27957
+ parameters: {
27958
+ query?: never;
27959
+ header?: never;
27960
+ path: {
27961
+ id: number;
27962
+ };
27963
+ cookie?: never;
27964
+ };
27965
+ requestBody?: never;
27966
+ responses: {
27967
+ /** @description The message and its per-project status. */
27968
+ 200: {
27969
+ headers: {
27970
+ [name: string]: unknown;
27971
+ };
27972
+ content: {
27973
+ "application/json": components["schemas"]["SystemMessageDetailResponse"];
27974
+ };
27975
+ };
27976
+ /** @description System message not found. */
27977
+ 404: {
27978
+ headers: {
27979
+ [name: string]: unknown;
27980
+ };
27981
+ content: {
27982
+ "application/json": components["schemas"]["ErrorResponse"];
27983
+ };
27984
+ };
27985
+ };
27986
+ };
27987
+ ackSystemMessage: {
27988
+ parameters: {
27989
+ query?: never;
27990
+ header?: never;
27991
+ path: {
27992
+ id: number;
27993
+ };
27994
+ cookie?: never;
27995
+ };
27996
+ requestBody?: {
27997
+ content: {
27998
+ "application/json": components["schemas"]["AckSystemMessageRequest"];
27999
+ };
28000
+ };
28001
+ responses: {
28002
+ /** @description The recorded acknowledgement. */
28003
+ 200: {
28004
+ headers: {
28005
+ [name: string]: unknown;
28006
+ };
28007
+ content: {
28008
+ "application/json": components["schemas"]["AckSystemMessageResponse"];
28009
+ };
28010
+ };
28011
+ /** @description Caller is not a manager chat session. */
28012
+ 403: {
28013
+ headers: {
28014
+ [name: string]: unknown;
28015
+ };
28016
+ content: {
28017
+ "application/json": components["schemas"]["ErrorResponse"];
28018
+ };
28019
+ };
28020
+ /** @description System message was not sent to this project. */
28021
+ 404: {
28022
+ headers: {
28023
+ [name: string]: unknown;
28024
+ };
28025
+ content: {
28026
+ "application/json": components["schemas"]["ErrorResponse"];
28027
+ };
28028
+ };
28029
+ };
28030
+ };
26993
28031
  ingestTestCaseRunEndEvent: {
26994
28032
  parameters: {
26995
28033
  query?: never;