@netlify/open-api 2.59.0 → 2.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.
package/dist/swagger.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "swagger": "2.0",
3
3
  "info": {
4
- "version": "2.59.0",
4
+ "version": "2.61.0",
5
5
  "title": "Netlify's API documentation",
6
6
  "description": "Netlify is a hosting service for the programmable web. It understands your documents and provides an API to handle atomic deploys of websites, manage form submissions, inject JavaScript snippets, and much more. This is a REST-style API that uses JSON for serialization and OAuth 2 for authentication.\n\nThis document is an OpenAPI reference for the Netlify API that you can explore. For more detailed instructions for common uses, please visit the [online documentation](https://www.netlify.com/docs/api/). Visit our Community forum to join the conversation about [understanding and using Netlify's API](https://community.netlify.com/t/common-issue-understanding-and-using-netlifys-api/160).\n\nAdditionally, we have two API clients for your convenience:\n- [Go Client](https://github.com/netlify/open-api#go-client)\n- [JS Client](https://github.com/netlify/build/tree/main/packages/js-client)",
7
7
  "termsOfService": "https://www.netlify.com/legal/terms-of-use/",
@@ -5889,6 +5889,74 @@
5889
5889
  "region": {
5890
5890
  "type": "string",
5891
5891
  "description": "Where the server runs. Defaults to the region configured at the site level\nwhen absent.\n"
5892
+ },
5893
+ "instance_size": {
5894
+ "type": "string",
5895
+ "enum": [
5896
+ "small",
5897
+ "medium",
5898
+ "large"
5899
+ ],
5900
+ "description": "The size of the instances the server runs on. A default size is used when\nabsent.\n"
5901
+ },
5902
+ "routes": {
5903
+ "type": "array",
5904
+ "description": "The paths the server handles.",
5905
+ "x-omitempty": true,
5906
+ "items": {
5907
+ "type": "object",
5908
+ "properties": {
5909
+ "pattern": {
5910
+ "type": "string"
5911
+ },
5912
+ "literal": {
5913
+ "type": "string"
5914
+ },
5915
+ "expression": {
5916
+ "type": "string"
5917
+ },
5918
+ "methods": {
5919
+ "type": "array",
5920
+ "items": {
5921
+ "type": "string",
5922
+ "enum": [
5923
+ "GET",
5924
+ "POST",
5925
+ "PUT",
5926
+ "PATCH",
5927
+ "DELETE",
5928
+ "OPTIONS"
5929
+ ]
5930
+ }
5931
+ },
5932
+ "prefer_static": {
5933
+ "type": "boolean"
5934
+ }
5935
+ }
5936
+ }
5937
+ },
5938
+ "excluded_routes": {
5939
+ "type": "array",
5940
+ "description": "Paths within `routes` that the server does not handle.",
5941
+ "x-omitempty": true,
5942
+ "items": {
5943
+ "type": "object",
5944
+ "properties": {
5945
+ "pattern": {
5946
+ "type": "string"
5947
+ },
5948
+ "literal": {
5949
+ "type": "string"
5950
+ },
5951
+ "expression": {
5952
+ "type": "string"
5953
+ }
5954
+ }
5955
+ }
5956
+ },
5957
+ "runtime_version": {
5958
+ "type": "string",
5959
+ "description": "The runtime version the server was built for, such as `nodejs24.x`. A\ndefault version is used when absent.\n"
5892
5960
  }
5893
5961
  }
5894
5962
  },
@@ -6542,6 +6610,74 @@
6542
6610
  "region": {
6543
6611
  "type": "string",
6544
6612
  "description": "Where the server runs. Defaults to the region configured at the site level\nwhen absent.\n"
6613
+ },
6614
+ "instance_size": {
6615
+ "type": "string",
6616
+ "enum": [
6617
+ "small",
6618
+ "medium",
6619
+ "large"
6620
+ ],
6621
+ "description": "The size of the instances the server runs on. A default size is used when\nabsent.\n"
6622
+ },
6623
+ "routes": {
6624
+ "type": "array",
6625
+ "description": "The paths the server handles.",
6626
+ "x-omitempty": true,
6627
+ "items": {
6628
+ "type": "object",
6629
+ "properties": {
6630
+ "pattern": {
6631
+ "type": "string"
6632
+ },
6633
+ "literal": {
6634
+ "type": "string"
6635
+ },
6636
+ "expression": {
6637
+ "type": "string"
6638
+ },
6639
+ "methods": {
6640
+ "type": "array",
6641
+ "items": {
6642
+ "type": "string",
6643
+ "enum": [
6644
+ "GET",
6645
+ "POST",
6646
+ "PUT",
6647
+ "PATCH",
6648
+ "DELETE",
6649
+ "OPTIONS"
6650
+ ]
6651
+ }
6652
+ },
6653
+ "prefer_static": {
6654
+ "type": "boolean"
6655
+ }
6656
+ }
6657
+ }
6658
+ },
6659
+ "excluded_routes": {
6660
+ "type": "array",
6661
+ "description": "Paths within `routes` that the server does not handle.",
6662
+ "x-omitempty": true,
6663
+ "items": {
6664
+ "type": "object",
6665
+ "properties": {
6666
+ "pattern": {
6667
+ "type": "string"
6668
+ },
6669
+ "literal": {
6670
+ "type": "string"
6671
+ },
6672
+ "expression": {
6673
+ "type": "string"
6674
+ }
6675
+ }
6676
+ }
6677
+ },
6678
+ "runtime_version": {
6679
+ "type": "string",
6680
+ "description": "The runtime version the server was built for, such as `nodejs24.x`. A\ndefault version is used when absent.\n"
6545
6681
  }
6546
6682
  }
6547
6683
  },
@@ -13351,15 +13487,16 @@
13351
13487
  "tags": [
13352
13488
  "agentRunner"
13353
13489
  ],
13490
+ "description": "Lists a site's agent runs, most recently active first. Archived runs are left out unless `state` is `archived`.",
13354
13491
  "parameters": [
13355
13492
  {
13356
- "name": "account_id",
13493
+ "name": "site_id",
13357
13494
  "type": "string",
13358
13495
  "in": "query",
13359
13496
  "required": true
13360
13497
  },
13361
13498
  {
13362
- "name": "site_id",
13499
+ "name": "account_id",
13363
13500
  "type": "string",
13364
13501
  "in": "query",
13365
13502
  "required": true
@@ -13382,10 +13519,7 @@
13382
13519
  "name": "state",
13383
13520
  "type": "string",
13384
13521
  "in": "query",
13385
- "enum": [
13386
- "live",
13387
- "error"
13388
- ]
13522
+ "description": "Only runs in this state: `new`, `running`, `await_input`, `interrupted`, `error`, `done`, `cancelled` or `archived`."
13389
13523
  },
13390
13524
  {
13391
13525
  "name": "title",
@@ -13402,15 +13536,23 @@
13402
13536
  "type": "string",
13403
13537
  "in": "query"
13404
13538
  },
13539
+ {
13540
+ "name": "user_id",
13541
+ "type": "string",
13542
+ "in": "query",
13543
+ "description": "Only runs started by this user."
13544
+ },
13405
13545
  {
13406
13546
  "name": "from",
13407
13547
  "type": "integer",
13408
- "in": "query"
13548
+ "in": "query",
13549
+ "description": "Unix timestamp. Only runs created at or after this time."
13409
13550
  },
13410
13551
  {
13411
13552
  "name": "to",
13412
13553
  "type": "integer",
13413
- "in": "query"
13554
+ "in": "query",
13555
+ "description": "Unix timestamp. Only runs created before this time."
13414
13556
  }
13415
13557
  ],
13416
13558
  "responses": {
@@ -13431,7 +13573,8 @@
13431
13573
  "type": "string"
13432
13574
  },
13433
13575
  "state": {
13434
- "type": "string"
13576
+ "type": "string",
13577
+ "description": "One of `new`, `running`, `await_input`, `interrupted`, `error`, `done`, `cancelled` or `archived`."
13435
13578
  },
13436
13579
  "created_at": {
13437
13580
  "type": "string",
@@ -13461,7 +13604,8 @@
13461
13604
  "type": "string"
13462
13605
  },
13463
13606
  "pr_state": {
13464
- "type": "string"
13607
+ "type": "string",
13608
+ "description": "One of `open`, `draft`, `merged` or `closed`."
13465
13609
  },
13466
13610
  "pr_number": {
13467
13611
  "type": "integer"
@@ -13473,7 +13617,8 @@
13473
13617
  "type": "string"
13474
13618
  },
13475
13619
  "current_task": {
13476
- "type": "string"
13620
+ "type": "string",
13621
+ "description": "What the agent is working on in the active session."
13477
13622
  },
13478
13623
  "result_diff": {
13479
13624
  "type": "string"
@@ -13503,12 +13648,20 @@
13503
13648
  "type": "string",
13504
13649
  "format": "dateTime"
13505
13650
  },
13651
+ "has_result_diff": {
13652
+ "type": "boolean",
13653
+ "description": "Whether the run has changes, available from `GET /agent_runners/{agent_runner_id}/diff`."
13654
+ },
13506
13655
  "latest_session_deploy_id": {
13507
13656
  "type": "string"
13508
13657
  },
13509
13658
  "latest_session_deploy_url": {
13510
13659
  "type": "string"
13511
13660
  },
13661
+ "preview_state": {
13662
+ "type": "string",
13663
+ "description": "State of the deploy building the latest preview. Null until that deploy exists; `ready` once the preview is live."
13664
+ },
13512
13665
  "user": {
13513
13666
  "type": "object",
13514
13667
  "properties": {
@@ -13623,7 +13776,8 @@
13623
13776
  "type": "string"
13624
13777
  },
13625
13778
  "state": {
13626
- "type": "string"
13779
+ "type": "string",
13780
+ "description": "One of `new`, `running`, `await_input`, `interrupted`, `error`, `done`, `cancelled` or `archived`."
13627
13781
  },
13628
13782
  "created_at": {
13629
13783
  "type": "string",
@@ -13653,7 +13807,8 @@
13653
13807
  "type": "string"
13654
13808
  },
13655
13809
  "pr_state": {
13656
- "type": "string"
13810
+ "type": "string",
13811
+ "description": "One of `open`, `draft`, `merged` or `closed`."
13657
13812
  },
13658
13813
  "pr_number": {
13659
13814
  "type": "integer"
@@ -13665,7 +13820,8 @@
13665
13820
  "type": "string"
13666
13821
  },
13667
13822
  "current_task": {
13668
- "type": "string"
13823
+ "type": "string",
13824
+ "description": "What the agent is working on in the active session."
13669
13825
  },
13670
13826
  "result_diff": {
13671
13827
  "type": "string"
@@ -13695,12 +13851,20 @@
13695
13851
  "type": "string",
13696
13852
  "format": "dateTime"
13697
13853
  },
13854
+ "has_result_diff": {
13855
+ "type": "boolean",
13856
+ "description": "Whether the run has changes, available from `GET /agent_runners/{agent_runner_id}/diff`."
13857
+ },
13698
13858
  "latest_session_deploy_id": {
13699
13859
  "type": "string"
13700
13860
  },
13701
13861
  "latest_session_deploy_url": {
13702
13862
  "type": "string"
13703
13863
  },
13864
+ "preview_state": {
13865
+ "type": "string",
13866
+ "description": "State of the deploy building the latest preview. Null until that deploy exists; `ready` once the preview is live."
13867
+ },
13704
13868
  "user": {
13705
13869
  "type": "object",
13706
13870
  "properties": {
@@ -13749,78 +13913,72 @@
13749
13913
  }
13750
13914
  }
13751
13915
  },
13752
- "/agent_runners/upload_url": {
13916
+ "/sites/{site_id}/agent_runners": {
13917
+ "parameters": [
13918
+ {
13919
+ "name": "site_id",
13920
+ "type": "string",
13921
+ "in": "path",
13922
+ "required": true,
13923
+ "description": "The site's ID or one of its hostnames."
13924
+ }
13925
+ ],
13753
13926
  "post": {
13754
- "x-internal": true,
13755
- "operationId": "createAgentRunnerUploadUrl",
13927
+ "operationId": "createSiteAgentRunner",
13756
13928
  "tags": [
13757
13929
  "agentRunner"
13758
13930
  ],
13931
+ "description": "Starts an agent run on the site.",
13759
13932
  "parameters": [
13760
13933
  {
13761
- "name": "account_id",
13762
- "type": "string",
13763
- "in": "query",
13764
- "required": true
13765
- },
13766
- {
13767
- "name": "filename",
13768
- "type": "string",
13769
- "in": "query",
13770
- "required": true
13771
- },
13772
- {
13773
- "name": "content_type",
13774
- "type": "string",
13775
- "in": "query",
13776
- "required": true
13777
- }
13778
- ],
13779
- "responses": {
13780
- "200": {
13781
- "description": "OK"
13782
- },
13783
- "400": {
13784
- "description": "Bad Request"
13785
- },
13786
- "422": {
13787
- "description": "Unprocessable Entity"
13788
- },
13789
- "default": {
13790
- "description": "error",
13934
+ "name": "agent_runner",
13935
+ "in": "body",
13936
+ "required": true,
13791
13937
  "schema": {
13792
13938
  "type": "object",
13793
13939
  "required": [
13794
- "message"
13940
+ "prompt"
13795
13941
  ],
13796
13942
  "properties": {
13797
- "code": {
13798
- "type": "integer",
13799
- "format": "int64"
13943
+ "prompt": {
13944
+ "type": "string"
13800
13945
  },
13801
- "message": {
13946
+ "branch": {
13802
13947
  "type": "string",
13803
- "x-nullable": false
13948
+ "description": "Branch to start from. Defaults to the site's production branch."
13949
+ },
13950
+ "deploy_id": {
13951
+ "type": "string",
13952
+ "description": "Deploy to start from. Takes precedence over `branch`."
13953
+ },
13954
+ "agent": {
13955
+ "type": "string",
13956
+ "description": "Agent to run, for example `claude` or `codex`."
13957
+ },
13958
+ "model": {
13959
+ "type": "string",
13960
+ "description": "Model for the agent to use. Omit to let Netlify choose."
13961
+ },
13962
+ "effort": {
13963
+ "type": "string",
13964
+ "enum": [
13965
+ "low",
13966
+ "medium",
13967
+ "high"
13968
+ ],
13969
+ "description": "Reasoning effort. Omit to let the agent decide."
13970
+ },
13971
+ "mode": {
13972
+ "type": "string",
13973
+ "enum": [
13974
+ "normal",
13975
+ "ask"
13976
+ ],
13977
+ "description": "`normal` (the default) changes code; `ask` answers questions without changing code."
13804
13978
  }
13805
13979
  }
13806
13980
  }
13807
13981
  }
13808
- }
13809
- }
13810
- },
13811
- "/agent_runners/{agent_runner_id}": {
13812
- "parameters": [
13813
- {
13814
- "name": "agent_runner_id",
13815
- "type": "string",
13816
- "in": "path",
13817
- "required": true
13818
- }
13819
- ],
13820
- "get": {
13821
- "operationId": "getAgentRunner",
13822
- "tags": [
13823
- "agentRunner"
13824
13982
  ],
13825
13983
  "responses": {
13826
13984
  "200": {
@@ -13838,7 +13996,8 @@
13838
13996
  "type": "string"
13839
13997
  },
13840
13998
  "state": {
13841
- "type": "string"
13999
+ "type": "string",
14000
+ "description": "One of `new`, `running`, `await_input`, `interrupted`, `error`, `done`, `cancelled` or `archived`."
13842
14001
  },
13843
14002
  "created_at": {
13844
14003
  "type": "string",
@@ -13868,7 +14027,8 @@
13868
14027
  "type": "string"
13869
14028
  },
13870
14029
  "pr_state": {
13871
- "type": "string"
14030
+ "type": "string",
14031
+ "description": "One of `open`, `draft`, `merged` or `closed`."
13872
14032
  },
13873
14033
  "pr_number": {
13874
14034
  "type": "integer"
@@ -13880,7 +14040,8 @@
13880
14040
  "type": "string"
13881
14041
  },
13882
14042
  "current_task": {
13883
- "type": "string"
14043
+ "type": "string",
14044
+ "description": "What the agent is working on in the active session."
13884
14045
  },
13885
14046
  "result_diff": {
13886
14047
  "type": "string"
@@ -13910,12 +14071,20 @@
13910
14071
  "type": "string",
13911
14072
  "format": "dateTime"
13912
14073
  },
14074
+ "has_result_diff": {
14075
+ "type": "boolean",
14076
+ "description": "Whether the run has changes, available from `GET /agent_runners/{agent_runner_id}/diff`."
14077
+ },
13913
14078
  "latest_session_deploy_id": {
13914
14079
  "type": "string"
13915
14080
  },
13916
14081
  "latest_session_deploy_url": {
13917
14082
  "type": "string"
13918
14083
  },
14084
+ "preview_state": {
14085
+ "type": "string",
14086
+ "description": "State of the deploy building the latest preview. Null until that deploy exists; `ready` once the preview is live."
14087
+ },
13919
14088
  "user": {
13920
14089
  "type": "object",
13921
14090
  "properties": {
@@ -13936,50 +14105,275 @@
13936
14105
  }
13937
14106
  }
13938
14107
  },
13939
- "default": {
13940
- "description": "error",
14108
+ "400": {
14109
+ "description": "`prompt_required` or `invalid_request`.",
13941
14110
  "schema": {
13942
- "type": "object",
13943
- "required": [
13944
- "message"
13945
- ],
13946
- "properties": {
13947
- "code": {
13948
- "type": "integer",
13949
- "format": "int64"
14111
+ "allOf": [
14112
+ {
14113
+ "type": "object",
14114
+ "required": [
14115
+ "message"
14116
+ ],
14117
+ "properties": {
14118
+ "code": {
14119
+ "type": "integer",
14120
+ "format": "int64"
14121
+ },
14122
+ "message": {
14123
+ "type": "string",
14124
+ "x-nullable": false
14125
+ }
14126
+ }
13950
14127
  },
13951
- "message": {
13952
- "type": "string",
13953
- "x-nullable": false
14128
+ {
14129
+ "properties": {
14130
+ "error_code": {
14131
+ "type": "string",
14132
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
14133
+ }
14134
+ }
13954
14135
  }
13955
- }
14136
+ ]
13956
14137
  }
13957
- }
13958
- }
13959
- },
13960
- "patch": {
13961
- "operationId": "updateAgentRunner",
13962
- "tags": [
13963
- "agentRunner"
13964
- ],
13965
- "responses": {
13966
- "200": {
13967
- "description": "OK",
14138
+ },
14139
+ "403": {
14140
+ "description": "`plan_not_eligible` or `ai_credit_limit_disabled`.",
13968
14141
  "schema": {
13969
- "type": "object",
13970
- "properties": {
13971
- "id": {
13972
- "type": "string"
13973
- },
13974
- "site_id": {
13975
- "type": "string"
13976
- },
13977
- "parent_agent_runner_id": {
13978
- "type": "string"
13979
- },
13980
- "state": {
14142
+ "allOf": [
14143
+ {
14144
+ "type": "object",
14145
+ "required": [
14146
+ "message"
14147
+ ],
14148
+ "properties": {
14149
+ "code": {
14150
+ "type": "integer",
14151
+ "format": "int64"
14152
+ },
14153
+ "message": {
14154
+ "type": "string",
14155
+ "x-nullable": false
14156
+ }
14157
+ }
14158
+ },
14159
+ {
14160
+ "properties": {
14161
+ "error_code": {
14162
+ "type": "string",
14163
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
14164
+ }
14165
+ }
14166
+ }
14167
+ ]
14168
+ }
14169
+ },
14170
+ "404": {
14171
+ "description": "The site or deploy wasn't found (`deploy_not_found`), the deploy's files are no longer available (`deploy_zip_unavailable`), or agent runners aren't enabled for the site.",
14172
+ "schema": {
14173
+ "allOf": [
14174
+ {
14175
+ "type": "object",
14176
+ "required": [
14177
+ "message"
14178
+ ],
14179
+ "properties": {
14180
+ "code": {
14181
+ "type": "integer",
14182
+ "format": "int64"
14183
+ },
14184
+ "message": {
14185
+ "type": "string",
14186
+ "x-nullable": false
14187
+ }
14188
+ }
14189
+ },
14190
+ {
14191
+ "properties": {
14192
+ "error_code": {
14193
+ "type": "string",
14194
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
14195
+ }
14196
+ }
14197
+ }
14198
+ ]
14199
+ }
14200
+ },
14201
+ "422": {
14202
+ "description": "`deploy_zip_unavailable`.",
14203
+ "schema": {
14204
+ "allOf": [
14205
+ {
14206
+ "type": "object",
14207
+ "required": [
14208
+ "message"
14209
+ ],
14210
+ "properties": {
14211
+ "code": {
14212
+ "type": "integer",
14213
+ "format": "int64"
14214
+ },
14215
+ "message": {
14216
+ "type": "string",
14217
+ "x-nullable": false
14218
+ }
14219
+ }
14220
+ },
14221
+ {
14222
+ "properties": {
14223
+ "error_code": {
14224
+ "type": "string",
14225
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
14226
+ }
14227
+ }
14228
+ }
14229
+ ]
14230
+ }
14231
+ },
14232
+ "429": {
14233
+ "description": "`concurrency_limit_reached`, `ai_credit_limit_exceeded` or `ai_credit_limit_reached`.",
14234
+ "schema": {
14235
+ "allOf": [
14236
+ {
14237
+ "type": "object",
14238
+ "required": [
14239
+ "message"
14240
+ ],
14241
+ "properties": {
14242
+ "code": {
14243
+ "type": "integer",
14244
+ "format": "int64"
14245
+ },
14246
+ "message": {
14247
+ "type": "string",
14248
+ "x-nullable": false
14249
+ }
14250
+ }
14251
+ },
14252
+ {
14253
+ "properties": {
14254
+ "error_code": {
14255
+ "type": "string",
14256
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
14257
+ }
14258
+ }
14259
+ }
14260
+ ]
14261
+ }
14262
+ },
14263
+ "default": {
14264
+ "description": "error",
14265
+ "schema": {
14266
+ "type": "object",
14267
+ "required": [
14268
+ "message"
14269
+ ],
14270
+ "properties": {
14271
+ "code": {
14272
+ "type": "integer",
14273
+ "format": "int64"
14274
+ },
14275
+ "message": {
14276
+ "type": "string",
14277
+ "x-nullable": false
14278
+ }
14279
+ }
14280
+ }
14281
+ }
14282
+ }
14283
+ }
14284
+ },
14285
+ "/agent_runners/upload_url": {
14286
+ "post": {
14287
+ "x-internal": true,
14288
+ "operationId": "createAgentRunnerUploadUrl",
14289
+ "tags": [
14290
+ "agentRunner"
14291
+ ],
14292
+ "parameters": [
14293
+ {
14294
+ "name": "account_id",
14295
+ "type": "string",
14296
+ "in": "query",
14297
+ "required": true
14298
+ },
14299
+ {
14300
+ "name": "filename",
14301
+ "type": "string",
14302
+ "in": "query",
14303
+ "required": true
14304
+ },
14305
+ {
14306
+ "name": "content_type",
14307
+ "type": "string",
14308
+ "in": "query",
14309
+ "required": true
14310
+ }
14311
+ ],
14312
+ "responses": {
14313
+ "200": {
14314
+ "description": "OK"
14315
+ },
14316
+ "400": {
14317
+ "description": "Bad Request"
14318
+ },
14319
+ "422": {
14320
+ "description": "Unprocessable Entity"
14321
+ },
14322
+ "default": {
14323
+ "description": "error",
14324
+ "schema": {
14325
+ "type": "object",
14326
+ "required": [
14327
+ "message"
14328
+ ],
14329
+ "properties": {
14330
+ "code": {
14331
+ "type": "integer",
14332
+ "format": "int64"
14333
+ },
14334
+ "message": {
14335
+ "type": "string",
14336
+ "x-nullable": false
14337
+ }
14338
+ }
14339
+ }
14340
+ }
14341
+ }
14342
+ }
14343
+ },
14344
+ "/agent_runners/{agent_runner_id}": {
14345
+ "parameters": [
14346
+ {
14347
+ "name": "agent_runner_id",
14348
+ "type": "string",
14349
+ "in": "path",
14350
+ "required": true
14351
+ }
14352
+ ],
14353
+ "get": {
14354
+ "operationId": "getAgentRunner",
14355
+ "tags": [
14356
+ "agentRunner"
14357
+ ],
14358
+ "responses": {
14359
+ "200": {
14360
+ "description": "OK",
14361
+ "schema": {
14362
+ "type": "object",
14363
+ "properties": {
14364
+ "id": {
14365
+ "type": "string"
14366
+ },
14367
+ "site_id": {
14368
+ "type": "string"
14369
+ },
14370
+ "parent_agent_runner_id": {
13981
14371
  "type": "string"
13982
14372
  },
14373
+ "state": {
14374
+ "type": "string",
14375
+ "description": "One of `new`, `running`, `await_input`, `interrupted`, `error`, `done`, `cancelled` or `archived`."
14376
+ },
13983
14377
  "created_at": {
13984
14378
  "type": "string",
13985
14379
  "format": "dateTime"
@@ -14008,7 +14402,8 @@
14008
14402
  "type": "string"
14009
14403
  },
14010
14404
  "pr_state": {
14011
- "type": "string"
14405
+ "type": "string",
14406
+ "description": "One of `open`, `draft`, `merged` or `closed`."
14012
14407
  },
14013
14408
  "pr_number": {
14014
14409
  "type": "integer"
@@ -14020,7 +14415,8 @@
14020
14415
  "type": "string"
14021
14416
  },
14022
14417
  "current_task": {
14023
- "type": "string"
14418
+ "type": "string",
14419
+ "description": "What the agent is working on in the active session."
14024
14420
  },
14025
14421
  "result_diff": {
14026
14422
  "type": "string"
@@ -14050,12 +14446,20 @@
14050
14446
  "type": "string",
14051
14447
  "format": "dateTime"
14052
14448
  },
14449
+ "has_result_diff": {
14450
+ "type": "boolean",
14451
+ "description": "Whether the run has changes, available from `GET /agent_runners/{agent_runner_id}/diff`."
14452
+ },
14053
14453
  "latest_session_deploy_id": {
14054
14454
  "type": "string"
14055
14455
  },
14056
14456
  "latest_session_deploy_url": {
14057
14457
  "type": "string"
14058
14458
  },
14459
+ "preview_state": {
14460
+ "type": "string",
14461
+ "description": "State of the deploy building the latest preview. Null until that deploy exists; `ready` once the preview is live."
14462
+ },
14059
14463
  "user": {
14060
14464
  "type": "object",
14061
14465
  "properties": {
@@ -14097,61 +14501,167 @@
14097
14501
  }
14098
14502
  }
14099
14503
  },
14100
- "delete": {
14101
- "operationId": "deleteAgentRunner",
14504
+ "patch": {
14505
+ "operationId": "updateAgentRunner",
14102
14506
  "tags": [
14103
14507
  "agentRunner"
14104
14508
  ],
14105
14509
  "responses": {
14106
- "202": {
14107
- "description": "Accepted"
14108
- },
14109
- "default": {
14110
- "description": "error",
14510
+ "200": {
14511
+ "description": "OK",
14111
14512
  "schema": {
14112
14513
  "type": "object",
14113
- "required": [
14114
- "message"
14115
- ],
14116
14514
  "properties": {
14117
- "code": {
14118
- "type": "integer",
14119
- "format": "int64"
14515
+ "id": {
14516
+ "type": "string"
14120
14517
  },
14121
- "message": {
14518
+ "site_id": {
14519
+ "type": "string"
14520
+ },
14521
+ "parent_agent_runner_id": {
14522
+ "type": "string"
14523
+ },
14524
+ "state": {
14122
14525
  "type": "string",
14123
- "x-nullable": false
14124
- }
14125
- }
14126
- }
14127
- }
14128
- }
14129
- }
14130
- },
14131
- "/agent_runners/{agent_runner_id}/archive": {
14132
- "parameters": [
14133
- {
14134
- "name": "agent_runner_id",
14135
- "type": "string",
14136
- "in": "path",
14137
- "required": true
14138
- }
14139
- ],
14140
- "post": {
14141
- "operationId": "archiveAgentRunner",
14526
+ "description": "One of `new`, `running`, `await_input`, `interrupted`, `error`, `done`, `cancelled` or `archived`."
14527
+ },
14528
+ "created_at": {
14529
+ "type": "string",
14530
+ "format": "dateTime"
14531
+ },
14532
+ "updated_at": {
14533
+ "type": "string",
14534
+ "format": "dateTime"
14535
+ },
14536
+ "done_at": {
14537
+ "type": "string",
14538
+ "format": "dateTime"
14539
+ },
14540
+ "title": {
14541
+ "type": "string"
14542
+ },
14543
+ "branch": {
14544
+ "type": "string"
14545
+ },
14546
+ "result_branch": {
14547
+ "type": "string"
14548
+ },
14549
+ "pr_url": {
14550
+ "type": "string"
14551
+ },
14552
+ "pr_branch": {
14553
+ "type": "string"
14554
+ },
14555
+ "pr_state": {
14556
+ "type": "string",
14557
+ "description": "One of `open`, `draft`, `merged` or `closed`."
14558
+ },
14559
+ "pr_number": {
14560
+ "type": "integer"
14561
+ },
14562
+ "pr_is_being_created": {
14563
+ "type": "boolean"
14564
+ },
14565
+ "pr_error": {
14566
+ "type": "string"
14567
+ },
14568
+ "current_task": {
14569
+ "type": "string",
14570
+ "description": "What the agent is working on in the active session."
14571
+ },
14572
+ "result_diff": {
14573
+ "type": "string"
14574
+ },
14575
+ "sha": {
14576
+ "type": "string"
14577
+ },
14578
+ "merge_commit_sha": {
14579
+ "type": "string"
14580
+ },
14581
+ "merge_commit_error": {
14582
+ "type": "string"
14583
+ },
14584
+ "merge_commit_is_being_created": {
14585
+ "type": "boolean"
14586
+ },
14587
+ "base_deploy_id": {
14588
+ "type": "string"
14589
+ },
14590
+ "attached_file_keys": {
14591
+ "type": "array",
14592
+ "items": {
14593
+ "type": "string"
14594
+ }
14595
+ },
14596
+ "active_session_created_at": {
14597
+ "type": "string",
14598
+ "format": "dateTime"
14599
+ },
14600
+ "has_result_diff": {
14601
+ "type": "boolean",
14602
+ "description": "Whether the run has changes, available from `GET /agent_runners/{agent_runner_id}/diff`."
14603
+ },
14604
+ "latest_session_deploy_id": {
14605
+ "type": "string"
14606
+ },
14607
+ "latest_session_deploy_url": {
14608
+ "type": "string"
14609
+ },
14610
+ "preview_state": {
14611
+ "type": "string",
14612
+ "description": "State of the deploy building the latest preview. Null until that deploy exists; `ready` once the preview is live."
14613
+ },
14614
+ "user": {
14615
+ "type": "object",
14616
+ "properties": {
14617
+ "id": {
14618
+ "type": "string"
14619
+ },
14620
+ "full_name": {
14621
+ "type": "string"
14622
+ },
14623
+ "email": {
14624
+ "type": "string"
14625
+ },
14626
+ "avatar_url": {
14627
+ "type": "string"
14628
+ }
14629
+ }
14630
+ }
14631
+ }
14632
+ }
14633
+ },
14634
+ "default": {
14635
+ "description": "error",
14636
+ "schema": {
14637
+ "type": "object",
14638
+ "required": [
14639
+ "message"
14640
+ ],
14641
+ "properties": {
14642
+ "code": {
14643
+ "type": "integer",
14644
+ "format": "int64"
14645
+ },
14646
+ "message": {
14647
+ "type": "string",
14648
+ "x-nullable": false
14649
+ }
14650
+ }
14651
+ }
14652
+ }
14653
+ }
14654
+ },
14655
+ "delete": {
14656
+ "operationId": "deleteAgentRunner",
14142
14657
  "tags": [
14143
- "agentRunner"
14658
+ "hiddenAgentRunner"
14144
14659
  ],
14660
+ "description": "Same as `POST /agent_runners/{agent_runner_id}/stop`. Doesn't delete the run.",
14145
14661
  "responses": {
14146
14662
  "202": {
14147
14663
  "description": "Accepted"
14148
14664
  },
14149
- "404": {
14150
- "description": "Not Found"
14151
- },
14152
- "422": {
14153
- "description": "Unprocessable Entity"
14154
- },
14155
14665
  "default": {
14156
14666
  "description": "error",
14157
14667
  "schema": {
@@ -14174,7 +14684,7 @@
14174
14684
  }
14175
14685
  }
14176
14686
  },
14177
- "/agent_runners/{agent_runner_id}/pull_request": {
14687
+ "/agent_runners/{agent_runner_id}/stop": {
14178
14688
  "parameters": [
14179
14689
  {
14180
14690
  "name": "agent_runner_id",
@@ -14184,23 +14694,14 @@
14184
14694
  }
14185
14695
  ],
14186
14696
  "post": {
14187
- "x-internal": true,
14188
- "operationId": "agentRunnerPullRequest",
14697
+ "operationId": "stopAgentRunner",
14189
14698
  "tags": [
14190
14699
  "agentRunner"
14191
14700
  ],
14701
+ "description": "Stops the run's active session. Stopping happens in the background.",
14192
14702
  "responses": {
14193
- "200": {
14194
- "description": "OK"
14195
- },
14196
- "400": {
14197
- "description": "Bad Request"
14198
- },
14199
- "409": {
14200
- "description": "Conflict"
14201
- },
14202
- "422": {
14203
- "description": "Unprocessable Entity"
14703
+ "202": {
14704
+ "description": "Accepted"
14204
14705
  },
14205
14706
  "default": {
14206
14707
  "description": "error",
@@ -14224,7 +14725,7 @@
14224
14725
  }
14225
14726
  }
14226
14727
  },
14227
- "/agent_runners/{agent_runner_id}/commit": {
14728
+ "/agent_runners/{agent_runner_id}/diff": {
14228
14729
  "parameters": [
14229
14730
  {
14230
14731
  "name": "agent_runner_id",
@@ -14233,29 +14734,89 @@
14233
14734
  "required": true
14234
14735
  }
14235
14736
  ],
14236
- "post": {
14237
- "x-internal": true,
14238
- "operationId": "agentRunnerCommitToBranch",
14737
+ "get": {
14738
+ "operationId": "getAgentRunnerDiff",
14239
14739
  "tags": [
14240
14740
  "agentRunner"
14241
14741
  ],
14742
+ "description": "Returns the run's changes as a unified diff. With `page`, returns that page of changed files and sets pagination headers.",
14743
+ "produces": [
14744
+ "text/plain"
14745
+ ],
14242
14746
  "parameters": [
14243
14747
  {
14244
- "name": "target_branch",
14245
- "type": "string",
14748
+ "type": "integer",
14749
+ "format": "int32",
14750
+ "name": "page",
14751
+ "required": false,
14752
+ "in": "query"
14753
+ },
14754
+ {
14755
+ "type": "integer",
14756
+ "format": "int32",
14757
+ "name": "per_page",
14758
+ "required": false,
14759
+ "in": "query"
14760
+ },
14761
+ {
14762
+ "name": "strip_binary",
14763
+ "type": "boolean",
14246
14764
  "in": "query",
14247
- "required": true
14765
+ "description": "Replace binary file contents with a placeholder, keeping the file headers."
14248
14766
  }
14249
14767
  ],
14250
14768
  "responses": {
14251
14769
  "200": {
14252
- "description": "OK"
14770
+ "description": "OK",
14771
+ "schema": {
14772
+ "type": "string"
14773
+ }
14253
14774
  },
14254
- "400": {
14255
- "description": "Bad Request"
14775
+ "404": {
14776
+ "description": "The run has no changes."
14256
14777
  },
14257
- "409": {
14258
- "description": "Conflict"
14778
+ "default": {
14779
+ "description": "error",
14780
+ "schema": {
14781
+ "type": "object",
14782
+ "required": [
14783
+ "message"
14784
+ ],
14785
+ "properties": {
14786
+ "code": {
14787
+ "type": "integer",
14788
+ "format": "int64"
14789
+ },
14790
+ "message": {
14791
+ "type": "string",
14792
+ "x-nullable": false
14793
+ }
14794
+ }
14795
+ }
14796
+ }
14797
+ }
14798
+ }
14799
+ },
14800
+ "/agent_runners/{agent_runner_id}/archive": {
14801
+ "parameters": [
14802
+ {
14803
+ "name": "agent_runner_id",
14804
+ "type": "string",
14805
+ "in": "path",
14806
+ "required": true
14807
+ }
14808
+ ],
14809
+ "post": {
14810
+ "operationId": "archiveAgentRunner",
14811
+ "tags": [
14812
+ "agentRunner"
14813
+ ],
14814
+ "responses": {
14815
+ "202": {
14816
+ "description": "Accepted"
14817
+ },
14818
+ "404": {
14819
+ "description": "Not Found"
14259
14820
  },
14260
14821
  "422": {
14261
14822
  "description": "Unprocessable Entity"
@@ -14282,7 +14843,7 @@
14282
14843
  }
14283
14844
  }
14284
14845
  },
14285
- "/agent_runners/{agent_runner_id}/sessions": {
14846
+ "/agent_runners/{agent_runner_id}/pull_request": {
14286
14847
  "parameters": [
14287
14848
  {
14288
14849
  "name": "agent_runner_id",
@@ -14291,45 +14852,152 @@
14291
14852
  "required": true
14292
14853
  }
14293
14854
  ],
14294
- "get": {
14295
- "operationId": "listAgentRunnerSessions",
14855
+ "post": {
14856
+ "x-internal": true,
14857
+ "operationId": "agentRunnerPullRequest",
14296
14858
  "tags": [
14297
- "agentRunnerSession"
14859
+ "agentRunner"
14298
14860
  ],
14299
- "parameters": [
14300
- {
14301
- "type": "integer",
14302
- "format": "int32",
14303
- "name": "page",
14304
- "required": false,
14305
- "in": "query"
14861
+ "responses": {
14862
+ "200": {
14863
+ "description": "OK"
14306
14864
  },
14307
- {
14308
- "type": "integer",
14309
- "format": "int32",
14310
- "name": "per_page",
14311
- "required": false,
14312
- "in": "query"
14865
+ "400": {
14866
+ "description": "Bad Request"
14313
14867
  },
14314
- {
14315
- "name": "state",
14316
- "type": "string",
14317
- "in": "query",
14318
- "enum": [
14319
- "live",
14320
- "error"
14321
- ]
14868
+ "409": {
14869
+ "description": "Conflict"
14322
14870
  },
14871
+ "422": {
14872
+ "description": "Unprocessable Entity"
14873
+ },
14874
+ "default": {
14875
+ "description": "error",
14876
+ "schema": {
14877
+ "type": "object",
14878
+ "required": [
14879
+ "message"
14880
+ ],
14881
+ "properties": {
14882
+ "code": {
14883
+ "type": "integer",
14884
+ "format": "int64"
14885
+ },
14886
+ "message": {
14887
+ "type": "string",
14888
+ "x-nullable": false
14889
+ }
14890
+ }
14891
+ }
14892
+ }
14893
+ }
14894
+ }
14895
+ },
14896
+ "/agent_runners/{agent_runner_id}/commit": {
14897
+ "parameters": [
14898
+ {
14899
+ "name": "agent_runner_id",
14900
+ "type": "string",
14901
+ "in": "path",
14902
+ "required": true
14903
+ }
14904
+ ],
14905
+ "post": {
14906
+ "x-internal": true,
14907
+ "operationId": "agentRunnerCommitToBranch",
14908
+ "tags": [
14909
+ "agentRunner"
14910
+ ],
14911
+ "parameters": [
14912
+ {
14913
+ "name": "target_branch",
14914
+ "type": "string",
14915
+ "in": "query",
14916
+ "required": true
14917
+ }
14918
+ ],
14919
+ "responses": {
14920
+ "200": {
14921
+ "description": "OK"
14922
+ },
14923
+ "400": {
14924
+ "description": "Bad Request"
14925
+ },
14926
+ "409": {
14927
+ "description": "Conflict"
14928
+ },
14929
+ "422": {
14930
+ "description": "Unprocessable Entity"
14931
+ },
14932
+ "default": {
14933
+ "description": "error",
14934
+ "schema": {
14935
+ "type": "object",
14936
+ "required": [
14937
+ "message"
14938
+ ],
14939
+ "properties": {
14940
+ "code": {
14941
+ "type": "integer",
14942
+ "format": "int64"
14943
+ },
14944
+ "message": {
14945
+ "type": "string",
14946
+ "x-nullable": false
14947
+ }
14948
+ }
14949
+ }
14950
+ }
14951
+ }
14952
+ }
14953
+ },
14954
+ "/agent_runners/{agent_runner_id}/sessions": {
14955
+ "parameters": [
14956
+ {
14957
+ "name": "agent_runner_id",
14958
+ "type": "string",
14959
+ "in": "path",
14960
+ "required": true
14961
+ }
14962
+ ],
14963
+ "get": {
14964
+ "operationId": "listAgentRunnerSessions",
14965
+ "tags": [
14966
+ "agentRunnerSession"
14967
+ ],
14968
+ "parameters": [
14323
14969
  {
14324
- "name": "from",
14325
14970
  "type": "integer",
14971
+ "format": "int32",
14972
+ "name": "page",
14973
+ "required": false,
14326
14974
  "in": "query"
14327
14975
  },
14328
14976
  {
14329
- "name": "to",
14330
14977
  "type": "integer",
14978
+ "format": "int32",
14979
+ "name": "per_page",
14980
+ "required": false,
14331
14981
  "in": "query"
14332
14982
  },
14983
+ {
14984
+ "name": "state",
14985
+ "type": "string",
14986
+ "in": "query",
14987
+ "description": "Only sessions in this state: `new`, `running`, `await_input`, `interrupted`, `error`, `done` or `cancelled`."
14988
+ },
14989
+ {
14990
+ "name": "from",
14991
+ "type": "integer",
14992
+ "in": "query",
14993
+ "description": "Unix timestamp. Only sessions created at or after this time."
14994
+ },
14995
+ {
14996
+ "name": "to",
14997
+ "type": "integer",
14998
+ "in": "query",
14999
+ "description": "Unix timestamp. Only sessions created before this time."
15000
+ },
14333
15001
  {
14334
15002
  "name": "order_by",
14335
15003
  "type": "string",
@@ -14344,114 +15012,609 @@
14344
15012
  "200": {
14345
15013
  "description": "OK",
14346
15014
  "schema": {
14347
- "type": "array",
14348
- "items": {
14349
- "type": "object",
14350
- "properties": {
14351
- "id": {
14352
- "type": "string"
14353
- },
14354
- "agent_runner_id": {
14355
- "type": "string"
14356
- },
14357
- "dev_server_id": {
14358
- "type": "string"
14359
- },
14360
- "state": {
14361
- "type": "string"
14362
- },
14363
- "created_at": {
14364
- "type": "string",
14365
- "format": "dateTime"
14366
- },
14367
- "updated_at": {
14368
- "type": "string",
14369
- "format": "dateTime"
14370
- },
14371
- "done_at": {
14372
- "type": "string",
14373
- "format": "dateTime"
14374
- },
14375
- "title": {
14376
- "type": "string"
14377
- },
14378
- "prompt": {
14379
- "type": "string"
14380
- },
14381
- "agent_config": {
14382
- "type": "object",
14383
- "properties": {
14384
- "agent": {
14385
- "type": "string"
14386
- },
14387
- "model": {
14388
- "type": "string"
14389
- }
15015
+ "type": "array",
15016
+ "items": {
15017
+ "type": "object",
15018
+ "properties": {
15019
+ "id": {
15020
+ "type": "string"
15021
+ },
15022
+ "agent_runner_id": {
15023
+ "type": "string"
15024
+ },
15025
+ "dev_server_id": {
15026
+ "type": "string"
15027
+ },
15028
+ "state": {
15029
+ "type": "string",
15030
+ "description": "One of `new`, `running`, `await_input`, `interrupted`, `error`, `done` or `cancelled`."
15031
+ },
15032
+ "created_at": {
15033
+ "type": "string",
15034
+ "format": "dateTime"
15035
+ },
15036
+ "updated_at": {
15037
+ "type": "string",
15038
+ "format": "dateTime"
15039
+ },
15040
+ "done_at": {
15041
+ "type": "string",
15042
+ "format": "dateTime"
15043
+ },
15044
+ "paused_at": {
15045
+ "type": "string",
15046
+ "format": "dateTime",
15047
+ "description": "When the session paused waiting on an interaction. Null once it resumes."
15048
+ },
15049
+ "title": {
15050
+ "type": "string"
15051
+ },
15052
+ "prompt": {
15053
+ "type": "string"
15054
+ },
15055
+ "agent_config": {
15056
+ "type": "object",
15057
+ "properties": {
15058
+ "agent": {
15059
+ "type": "string"
15060
+ },
15061
+ "model": {
15062
+ "type": "string"
15063
+ }
15064
+ }
15065
+ },
15066
+ "result": {
15067
+ "type": "string",
15068
+ "description": "The agent's summary of what it did."
15069
+ },
15070
+ "result_diff": {
15071
+ "type": "string"
15072
+ },
15073
+ "commit_sha": {
15074
+ "type": "string"
15075
+ },
15076
+ "deploy_id": {
15077
+ "type": "string"
15078
+ },
15079
+ "deploy_url": {
15080
+ "type": "string",
15081
+ "description": "URL of the session's deploy preview."
15082
+ },
15083
+ "duration": {
15084
+ "type": "integer"
15085
+ },
15086
+ "usage": {
15087
+ "type": "object",
15088
+ "properties": {
15089
+ "total_input_tokens": {
15090
+ "type": "integer"
15091
+ },
15092
+ "total_output_tokens": {
15093
+ "type": "integer"
15094
+ },
15095
+ "total_cached_input_tokens": {
15096
+ "type": "integer"
15097
+ },
15098
+ "total_cached_output_tokens": {
15099
+ "type": "integer"
15100
+ },
15101
+ "total_tokens": {
15102
+ "type": "integer"
15103
+ },
15104
+ "total_credits_cost": {
15105
+ "type": "number",
15106
+ "description": "Credits the session used."
15107
+ }
15108
+ }
15109
+ },
15110
+ "interactions": {
15111
+ "type": "object",
15112
+ "description": "Questions and requests from the agent, keyed by reference ID. A pending one pauses the session in `await_input` until it's answered or skipped.",
15113
+ "additionalProperties": {
15114
+ "type": "object",
15115
+ "properties": {
15116
+ "type": {
15117
+ "type": "string",
15118
+ "description": "One of `question`, `authorization` or `setup_request`. Only questions can be answered; the others can only be skipped."
15119
+ },
15120
+ "status": {
15121
+ "type": "string",
15122
+ "description": "One of `pending`, `answered` or `skipped`."
15123
+ },
15124
+ "payload": {
15125
+ "description": "For a question, an array of questions, each with `question`, an optional `header`, `multiSelect` and `options` (each with `label` and an optional `description`). For `authorization` and `setup_request`, an object describing the request."
15126
+ },
15127
+ "response": {
15128
+ "type": "array",
15129
+ "description": "Answers aligned to `payload`; null entries were skipped.",
15130
+ "items": {}
15131
+ }
15132
+ }
15133
+ }
15134
+ },
15135
+ "steps": {
15136
+ "type": "array",
15137
+ "items": {
15138
+ "type": "object",
15139
+ "properties": {
15140
+ "title": {
15141
+ "type": "string"
15142
+ },
15143
+ "message": {
15144
+ "type": "string"
15145
+ }
15146
+ }
15147
+ }
15148
+ },
15149
+ "user": {
15150
+ "type": "object",
15151
+ "properties": {
15152
+ "id": {
15153
+ "type": "string"
15154
+ },
15155
+ "full_name": {
15156
+ "type": "string"
15157
+ },
15158
+ "email": {
15159
+ "type": "string"
15160
+ },
15161
+ "avatar_url": {
15162
+ "type": "string"
15163
+ }
15164
+ }
15165
+ },
15166
+ "attached_file_keys": {
15167
+ "type": "array",
15168
+ "items": {
15169
+ "type": "string"
15170
+ }
15171
+ },
15172
+ "result_zip_file_name": {
15173
+ "type": "string"
15174
+ },
15175
+ "is_published": {
15176
+ "type": "boolean"
15177
+ }
15178
+ }
15179
+ }
15180
+ }
15181
+ },
15182
+ "default": {
15183
+ "description": "error",
15184
+ "schema": {
15185
+ "type": "object",
15186
+ "required": [
15187
+ "message"
15188
+ ],
15189
+ "properties": {
15190
+ "code": {
15191
+ "type": "integer",
15192
+ "format": "int64"
15193
+ },
15194
+ "message": {
15195
+ "type": "string",
15196
+ "x-nullable": false
15197
+ }
15198
+ }
15199
+ }
15200
+ }
15201
+ }
15202
+ },
15203
+ "post": {
15204
+ "operationId": "createAgentRunnerSession",
15205
+ "tags": [
15206
+ "agentRunnerSession"
15207
+ ],
15208
+ "description": "Starts a follow-up session on the run.",
15209
+ "parameters": [
15210
+ {
15211
+ "name": "agent_runner_session",
15212
+ "in": "body",
15213
+ "schema": {
15214
+ "type": "object",
15215
+ "properties": {
15216
+ "prompt": {
15217
+ "type": "string",
15218
+ "description": "What the agent should do. Required."
15219
+ },
15220
+ "agent": {
15221
+ "type": "string"
15222
+ },
15223
+ "model": {
15224
+ "type": "string",
15225
+ "description": "Model for the agent to use. Omit to let Netlify choose."
15226
+ },
15227
+ "mode": {
15228
+ "type": "string",
15229
+ "enum": [
15230
+ "normal",
15231
+ "ask"
15232
+ ],
15233
+ "description": "`normal` (the default) changes code; `ask` answers questions without changing code."
15234
+ }
15235
+ }
15236
+ }
15237
+ },
15238
+ {
15239
+ "name": "prompt",
15240
+ "type": "string",
15241
+ "in": "query",
15242
+ "description": "Use the request body instead."
15243
+ },
15244
+ {
15245
+ "name": "agent",
15246
+ "type": "string",
15247
+ "in": "query",
15248
+ "description": "Use the request body instead."
15249
+ },
15250
+ {
15251
+ "name": "model",
15252
+ "type": "string",
15253
+ "in": "query",
15254
+ "description": "Use the request body instead."
15255
+ },
15256
+ {
15257
+ "name": "file_keys",
15258
+ "type": "array",
15259
+ "in": "query",
15260
+ "items": {
15261
+ "type": "string"
15262
+ },
15263
+ "description": "Use the request body instead."
15264
+ }
15265
+ ],
15266
+ "responses": {
15267
+ "200": {
15268
+ "description": "OK",
15269
+ "schema": {
15270
+ "type": "object",
15271
+ "properties": {
15272
+ "id": {
15273
+ "type": "string"
15274
+ },
15275
+ "agent_runner_id": {
15276
+ "type": "string"
15277
+ },
15278
+ "dev_server_id": {
15279
+ "type": "string"
15280
+ },
15281
+ "state": {
15282
+ "type": "string",
15283
+ "description": "One of `new`, `running`, `await_input`, `interrupted`, `error`, `done` or `cancelled`."
15284
+ },
15285
+ "created_at": {
15286
+ "type": "string",
15287
+ "format": "dateTime"
15288
+ },
15289
+ "updated_at": {
15290
+ "type": "string",
15291
+ "format": "dateTime"
15292
+ },
15293
+ "done_at": {
15294
+ "type": "string",
15295
+ "format": "dateTime"
15296
+ },
15297
+ "paused_at": {
15298
+ "type": "string",
15299
+ "format": "dateTime",
15300
+ "description": "When the session paused waiting on an interaction. Null once it resumes."
15301
+ },
15302
+ "title": {
15303
+ "type": "string"
15304
+ },
15305
+ "prompt": {
15306
+ "type": "string"
15307
+ },
15308
+ "agent_config": {
15309
+ "type": "object",
15310
+ "properties": {
15311
+ "agent": {
15312
+ "type": "string"
15313
+ },
15314
+ "model": {
15315
+ "type": "string"
15316
+ }
15317
+ }
15318
+ },
15319
+ "result": {
15320
+ "type": "string",
15321
+ "description": "The agent's summary of what it did."
15322
+ },
15323
+ "result_diff": {
15324
+ "type": "string"
15325
+ },
15326
+ "commit_sha": {
15327
+ "type": "string"
15328
+ },
15329
+ "deploy_id": {
15330
+ "type": "string"
15331
+ },
15332
+ "deploy_url": {
15333
+ "type": "string",
15334
+ "description": "URL of the session's deploy preview."
15335
+ },
15336
+ "duration": {
15337
+ "type": "integer"
15338
+ },
15339
+ "usage": {
15340
+ "type": "object",
15341
+ "properties": {
15342
+ "total_input_tokens": {
15343
+ "type": "integer"
15344
+ },
15345
+ "total_output_tokens": {
15346
+ "type": "integer"
15347
+ },
15348
+ "total_cached_input_tokens": {
15349
+ "type": "integer"
15350
+ },
15351
+ "total_cached_output_tokens": {
15352
+ "type": "integer"
15353
+ },
15354
+ "total_tokens": {
15355
+ "type": "integer"
15356
+ },
15357
+ "total_credits_cost": {
15358
+ "type": "number",
15359
+ "description": "Credits the session used."
15360
+ }
15361
+ }
15362
+ },
15363
+ "interactions": {
15364
+ "type": "object",
15365
+ "description": "Questions and requests from the agent, keyed by reference ID. A pending one pauses the session in `await_input` until it's answered or skipped.",
15366
+ "additionalProperties": {
15367
+ "type": "object",
15368
+ "properties": {
15369
+ "type": {
15370
+ "type": "string",
15371
+ "description": "One of `question`, `authorization` or `setup_request`. Only questions can be answered; the others can only be skipped."
15372
+ },
15373
+ "status": {
15374
+ "type": "string",
15375
+ "description": "One of `pending`, `answered` or `skipped`."
15376
+ },
15377
+ "payload": {
15378
+ "description": "For a question, an array of questions, each with `question`, an optional `header`, `multiSelect` and `options` (each with `label` and an optional `description`). For `authorization` and `setup_request`, an object describing the request."
15379
+ },
15380
+ "response": {
15381
+ "type": "array",
15382
+ "description": "Answers aligned to `payload`; null entries were skipped.",
15383
+ "items": {}
15384
+ }
15385
+ }
15386
+ }
15387
+ },
15388
+ "steps": {
15389
+ "type": "array",
15390
+ "items": {
15391
+ "type": "object",
15392
+ "properties": {
15393
+ "title": {
15394
+ "type": "string"
15395
+ },
15396
+ "message": {
15397
+ "type": "string"
15398
+ }
15399
+ }
15400
+ }
15401
+ },
15402
+ "user": {
15403
+ "type": "object",
15404
+ "properties": {
15405
+ "id": {
15406
+ "type": "string"
15407
+ },
15408
+ "full_name": {
15409
+ "type": "string"
15410
+ },
15411
+ "email": {
15412
+ "type": "string"
15413
+ },
15414
+ "avatar_url": {
15415
+ "type": "string"
15416
+ }
15417
+ }
15418
+ },
15419
+ "attached_file_keys": {
15420
+ "type": "array",
15421
+ "items": {
15422
+ "type": "string"
15423
+ }
15424
+ },
15425
+ "result_zip_file_name": {
15426
+ "type": "string"
15427
+ },
15428
+ "is_published": {
15429
+ "type": "boolean"
15430
+ }
15431
+ }
15432
+ }
15433
+ },
15434
+ "400": {
15435
+ "description": "`prompt_required` or `invalid_request`.",
15436
+ "schema": {
15437
+ "allOf": [
15438
+ {
15439
+ "type": "object",
15440
+ "required": [
15441
+ "message"
15442
+ ],
15443
+ "properties": {
15444
+ "code": {
15445
+ "type": "integer",
15446
+ "format": "int64"
15447
+ },
15448
+ "message": {
15449
+ "type": "string",
15450
+ "x-nullable": false
15451
+ }
15452
+ }
15453
+ },
15454
+ {
15455
+ "properties": {
15456
+ "error_code": {
15457
+ "type": "string",
15458
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
15459
+ }
15460
+ }
15461
+ }
15462
+ ]
15463
+ }
15464
+ },
15465
+ "403": {
15466
+ "description": "`plan_not_eligible` or `ai_credit_limit_disabled`.",
15467
+ "schema": {
15468
+ "allOf": [
15469
+ {
15470
+ "type": "object",
15471
+ "required": [
15472
+ "message"
15473
+ ],
15474
+ "properties": {
15475
+ "code": {
15476
+ "type": "integer",
15477
+ "format": "int64"
15478
+ },
15479
+ "message": {
15480
+ "type": "string",
15481
+ "x-nullable": false
15482
+ }
15483
+ }
15484
+ },
15485
+ {
15486
+ "properties": {
15487
+ "error_code": {
15488
+ "type": "string",
15489
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
15490
+ }
15491
+ }
15492
+ }
15493
+ ]
15494
+ }
15495
+ },
15496
+ "404": {
15497
+ "description": "Not Found",
15498
+ "schema": {
15499
+ "allOf": [
15500
+ {
15501
+ "type": "object",
15502
+ "required": [
15503
+ "message"
15504
+ ],
15505
+ "properties": {
15506
+ "code": {
15507
+ "type": "integer",
15508
+ "format": "int64"
15509
+ },
15510
+ "message": {
15511
+ "type": "string",
15512
+ "x-nullable": false
15513
+ }
15514
+ }
15515
+ },
15516
+ {
15517
+ "properties": {
15518
+ "error_code": {
15519
+ "type": "string",
15520
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
15521
+ }
15522
+ }
15523
+ }
15524
+ ]
15525
+ }
15526
+ },
15527
+ "409": {
15528
+ "description": "`active_session_exists` while a session is still running, or `follow_up_unavailable` once the run is publishing or published.",
15529
+ "schema": {
15530
+ "allOf": [
15531
+ {
15532
+ "type": "object",
15533
+ "required": [
15534
+ "message"
15535
+ ],
15536
+ "properties": {
15537
+ "code": {
15538
+ "type": "integer",
15539
+ "format": "int64"
15540
+ },
15541
+ "message": {
15542
+ "type": "string",
15543
+ "x-nullable": false
15544
+ }
15545
+ }
15546
+ },
15547
+ {
15548
+ "properties": {
15549
+ "error_code": {
15550
+ "type": "string",
15551
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
15552
+ }
15553
+ }
15554
+ }
15555
+ ]
15556
+ }
15557
+ },
15558
+ "422": {
15559
+ "description": "`deploy_zip_unavailable`.",
15560
+ "schema": {
15561
+ "allOf": [
15562
+ {
15563
+ "type": "object",
15564
+ "required": [
15565
+ "message"
15566
+ ],
15567
+ "properties": {
15568
+ "code": {
15569
+ "type": "integer",
15570
+ "format": "int64"
15571
+ },
15572
+ "message": {
15573
+ "type": "string",
15574
+ "x-nullable": false
14390
15575
  }
14391
- },
14392
- "result": {
14393
- "type": "string"
14394
- },
14395
- "result_diff": {
14396
- "type": "string"
14397
- },
14398
- "commit_sha": {
14399
- "type": "string"
14400
- },
14401
- "deploy_id": {
14402
- "type": "string"
14403
- },
14404
- "deploy_url": {
14405
- "type": "string"
14406
- },
14407
- "duration": {
14408
- "type": "integer"
14409
- },
14410
- "steps": {
14411
- "type": "array",
14412
- "items": {
14413
- "type": "object",
14414
- "properties": {
14415
- "title": {
14416
- "type": "string"
14417
- },
14418
- "message": {
14419
- "type": "string"
14420
- }
14421
- }
15576
+ }
15577
+ },
15578
+ {
15579
+ "properties": {
15580
+ "error_code": {
15581
+ "type": "string",
15582
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
14422
15583
  }
14423
- },
14424
- "user": {
14425
- "type": "object",
14426
- "properties": {
14427
- "id": {
14428
- "type": "string"
14429
- },
14430
- "full_name": {
14431
- "type": "string"
14432
- },
14433
- "email": {
14434
- "type": "string"
14435
- },
14436
- "avatar_url": {
14437
- "type": "string"
14438
- }
15584
+ }
15585
+ }
15586
+ ]
15587
+ }
15588
+ },
15589
+ "429": {
15590
+ "description": "`concurrency_limit_reached`, `ai_credit_limit_exceeded` or `ai_credit_limit_reached`.",
15591
+ "schema": {
15592
+ "allOf": [
15593
+ {
15594
+ "type": "object",
15595
+ "required": [
15596
+ "message"
15597
+ ],
15598
+ "properties": {
15599
+ "code": {
15600
+ "type": "integer",
15601
+ "format": "int64"
15602
+ },
15603
+ "message": {
15604
+ "type": "string",
15605
+ "x-nullable": false
14439
15606
  }
14440
- },
14441
- "attached_file_keys": {
14442
- "type": "array",
14443
- "items": {
14444
- "type": "string"
15607
+ }
15608
+ },
15609
+ {
15610
+ "properties": {
15611
+ "error_code": {
15612
+ "type": "string",
15613
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
14445
15614
  }
14446
- },
14447
- "result_zip_file_name": {
14448
- "type": "string"
14449
- },
14450
- "is_published": {
14451
- "type": "boolean"
14452
15615
  }
14453
15616
  }
14454
- }
15617
+ ]
14455
15618
  }
14456
15619
  },
14457
15620
  "default": {
@@ -14474,37 +15637,28 @@
14474
15637
  }
14475
15638
  }
14476
15639
  }
14477
- },
14478
- "post": {
14479
- "operationId": "createAgentRunnerSession",
15640
+ }
15641
+ },
15642
+ "/agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}": {
15643
+ "parameters": [
15644
+ {
15645
+ "name": "agent_runner_id",
15646
+ "type": "string",
15647
+ "in": "path",
15648
+ "required": true
15649
+ },
15650
+ {
15651
+ "name": "agent_runner_session_id",
15652
+ "type": "string",
15653
+ "in": "path",
15654
+ "required": true
15655
+ }
15656
+ ],
15657
+ "get": {
15658
+ "operationId": "getAgentRunnerSession",
14480
15659
  "tags": [
14481
15660
  "agentRunnerSession"
14482
15661
  ],
14483
- "parameters": [
14484
- {
14485
- "name": "prompt",
14486
- "type": "string",
14487
- "in": "query"
14488
- },
14489
- {
14490
- "name": "agent",
14491
- "type": "string",
14492
- "in": "query"
14493
- },
14494
- {
14495
- "name": "model",
14496
- "type": "string",
14497
- "in": "query"
14498
- },
14499
- {
14500
- "name": "file_keys",
14501
- "type": "array",
14502
- "in": "query",
14503
- "items": {
14504
- "type": "string"
14505
- }
14506
- }
14507
- ],
14508
15662
  "responses": {
14509
15663
  "200": {
14510
15664
  "description": "OK",
@@ -14521,7 +15675,8 @@
14521
15675
  "type": "string"
14522
15676
  },
14523
15677
  "state": {
14524
- "type": "string"
15678
+ "type": "string",
15679
+ "description": "One of `new`, `running`, `await_input`, `interrupted`, `error`, `done` or `cancelled`."
14525
15680
  },
14526
15681
  "created_at": {
14527
15682
  "type": "string",
@@ -14535,6 +15690,11 @@
14535
15690
  "type": "string",
14536
15691
  "format": "dateTime"
14537
15692
  },
15693
+ "paused_at": {
15694
+ "type": "string",
15695
+ "format": "dateTime",
15696
+ "description": "When the session paused waiting on an interaction. Null once it resumes."
15697
+ },
14538
15698
  "title": {
14539
15699
  "type": "string"
14540
15700
  },
@@ -14553,7 +15713,8 @@
14553
15713
  }
14554
15714
  },
14555
15715
  "result": {
14556
- "type": "string"
15716
+ "type": "string",
15717
+ "description": "The agent's summary of what it did."
14557
15718
  },
14558
15719
  "result_diff": {
14559
15720
  "type": "string"
@@ -14565,11 +15726,61 @@
14565
15726
  "type": "string"
14566
15727
  },
14567
15728
  "deploy_url": {
14568
- "type": "string"
15729
+ "type": "string",
15730
+ "description": "URL of the session's deploy preview."
14569
15731
  },
14570
15732
  "duration": {
14571
15733
  "type": "integer"
14572
15734
  },
15735
+ "usage": {
15736
+ "type": "object",
15737
+ "properties": {
15738
+ "total_input_tokens": {
15739
+ "type": "integer"
15740
+ },
15741
+ "total_output_tokens": {
15742
+ "type": "integer"
15743
+ },
15744
+ "total_cached_input_tokens": {
15745
+ "type": "integer"
15746
+ },
15747
+ "total_cached_output_tokens": {
15748
+ "type": "integer"
15749
+ },
15750
+ "total_tokens": {
15751
+ "type": "integer"
15752
+ },
15753
+ "total_credits_cost": {
15754
+ "type": "number",
15755
+ "description": "Credits the session used."
15756
+ }
15757
+ }
15758
+ },
15759
+ "interactions": {
15760
+ "type": "object",
15761
+ "description": "Questions and requests from the agent, keyed by reference ID. A pending one pauses the session in `await_input` until it's answered or skipped.",
15762
+ "additionalProperties": {
15763
+ "type": "object",
15764
+ "properties": {
15765
+ "type": {
15766
+ "type": "string",
15767
+ "description": "One of `question`, `authorization` or `setup_request`. Only questions can be answered; the others can only be skipped."
15768
+ },
15769
+ "status": {
15770
+ "type": "string",
15771
+ "description": "One of `pending`, `answered` or `skipped`."
15772
+ },
15773
+ "payload": {
15774
+ "description": "For a question, an array of questions, each with `question`, an optional `header`, `multiSelect` and `options` (each with `label` and an optional `description`). For `authorization` and `setup_request`, an object describing the request."
15775
+ },
15776
+ "response": {
15777
+ "type": "array",
15778
+ "description": "Answers aligned to `payload`; null entries were skipped.",
15779
+ "items": {}
15780
+ }
15781
+ }
15782
+ }
15783
+ },
14573
15784
  "steps": {
14574
15785
  "type": "array",
14575
15786
  "items": {
@@ -14616,12 +15827,6 @@
14616
15827
  }
14617
15828
  }
14618
15829
  },
14619
- "404": {
14620
- "description": "Not Found"
14621
- },
14622
- "422": {
14623
- "description": "Unprocessable Entity"
14624
- },
14625
15830
  "default": {
14626
15831
  "description": "error",
14627
15832
  "schema": {
@@ -14635,35 +15840,26 @@
14635
15840
  "format": "int64"
14636
15841
  },
14637
15842
  "message": {
14638
- "type": "string",
14639
- "x-nullable": false
14640
- }
14641
- }
14642
- }
14643
- }
14644
- }
14645
- }
14646
- },
14647
- "/agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}": {
14648
- "parameters": [
14649
- {
14650
- "name": "agent_runner_id",
14651
- "type": "string",
14652
- "in": "path",
14653
- "required": true
14654
- },
14655
- {
14656
- "name": "agent_runner_session_id",
14657
- "type": "string",
14658
- "in": "path",
14659
- "required": true
15843
+ "type": "string",
15844
+ "x-nullable": false
15845
+ }
15846
+ }
15847
+ }
15848
+ }
14660
15849
  }
14661
- ],
14662
- "get": {
14663
- "operationId": "getAgentRunnerSession",
15850
+ },
15851
+ "patch": {
15852
+ "operationId": "updateAgentRunnerSession",
14664
15853
  "tags": [
14665
15854
  "agentRunnerSession"
14666
15855
  ],
15856
+ "parameters": [
15857
+ {
15858
+ "name": "is_published",
15859
+ "type": "boolean",
15860
+ "in": "query"
15861
+ }
15862
+ ],
14667
15863
  "responses": {
14668
15864
  "200": {
14669
15865
  "description": "OK",
@@ -14680,7 +15876,8 @@
14680
15876
  "type": "string"
14681
15877
  },
14682
15878
  "state": {
14683
- "type": "string"
15879
+ "type": "string",
15880
+ "description": "One of `new`, `running`, `await_input`, `interrupted`, `error`, `done` or `cancelled`."
14684
15881
  },
14685
15882
  "created_at": {
14686
15883
  "type": "string",
@@ -14694,6 +15891,11 @@
14694
15891
  "type": "string",
14695
15892
  "format": "dateTime"
14696
15893
  },
15894
+ "paused_at": {
15895
+ "type": "string",
15896
+ "format": "dateTime",
15897
+ "description": "When the session paused waiting on an interaction. Null once it resumes."
15898
+ },
14697
15899
  "title": {
14698
15900
  "type": "string"
14699
15901
  },
@@ -14712,7 +15914,8 @@
14712
15914
  }
14713
15915
  },
14714
15916
  "result": {
14715
- "type": "string"
15917
+ "type": "string",
15918
+ "description": "The agent's summary of what it did."
14716
15919
  },
14717
15920
  "result_diff": {
14718
15921
  "type": "string"
@@ -14724,11 +15927,61 @@
14724
15927
  "type": "string"
14725
15928
  },
14726
15929
  "deploy_url": {
14727
- "type": "string"
15930
+ "type": "string",
15931
+ "description": "URL of the session's deploy preview."
14728
15932
  },
14729
15933
  "duration": {
14730
15934
  "type": "integer"
14731
15935
  },
15936
+ "usage": {
15937
+ "type": "object",
15938
+ "properties": {
15939
+ "total_input_tokens": {
15940
+ "type": "integer"
15941
+ },
15942
+ "total_output_tokens": {
15943
+ "type": "integer"
15944
+ },
15945
+ "total_cached_input_tokens": {
15946
+ "type": "integer"
15947
+ },
15948
+ "total_cached_output_tokens": {
15949
+ "type": "integer"
15950
+ },
15951
+ "total_tokens": {
15952
+ "type": "integer"
15953
+ },
15954
+ "total_credits_cost": {
15955
+ "type": "number",
15956
+ "description": "Credits the session used."
15957
+ }
15958
+ }
15959
+ },
15960
+ "interactions": {
15961
+ "type": "object",
15962
+ "description": "Questions and requests from the agent, keyed by reference ID. A pending one pauses the session in `await_input` until it's answered or skipped.",
15963
+ "additionalProperties": {
15964
+ "type": "object",
15965
+ "properties": {
15966
+ "type": {
15967
+ "type": "string",
15968
+ "description": "One of `question`, `authorization` or `setup_request`. Only questions can be answered; the others can only be skipped."
15969
+ },
15970
+ "status": {
15971
+ "type": "string",
15972
+ "description": "One of `pending`, `answered` or `skipped`."
15973
+ },
15974
+ "payload": {
15975
+ "description": "For a question, an array of questions, each with `question`, an optional `header`, `multiSelect` and `options` (each with `label` and an optional `description`). For `authorization` and `setup_request`, an object describing the request."
15976
+ },
15977
+ "response": {
15978
+ "type": "array",
15979
+ "description": "Answers aligned to `payload`; null entries were skipped.",
15980
+ "items": {}
15981
+ }
15982
+ }
15983
+ }
15984
+ },
14732
15985
  "steps": {
14733
15986
  "type": "array",
14734
15987
  "items": {
@@ -14796,16 +16049,136 @@
14796
16049
  }
14797
16050
  }
14798
16051
  },
14799
- "patch": {
14800
- "operationId": "updateAgentRunnerSession",
16052
+ "delete": {
16053
+ "operationId": "deleteAgentRunnerSession",
16054
+ "tags": [
16055
+ "hiddenAgentRunner"
16056
+ ],
16057
+ "description": "Same as `POST /agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}/stop`. Doesn't delete the session.",
16058
+ "responses": {
16059
+ "202": {
16060
+ "description": "Accepted"
16061
+ },
16062
+ "default": {
16063
+ "description": "error",
16064
+ "schema": {
16065
+ "type": "object",
16066
+ "required": [
16067
+ "message"
16068
+ ],
16069
+ "properties": {
16070
+ "code": {
16071
+ "type": "integer",
16072
+ "format": "int64"
16073
+ },
16074
+ "message": {
16075
+ "type": "string",
16076
+ "x-nullable": false
16077
+ }
16078
+ }
16079
+ }
16080
+ }
16081
+ }
16082
+ }
16083
+ },
16084
+ "/agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}/stop": {
16085
+ "parameters": [
16086
+ {
16087
+ "name": "agent_runner_id",
16088
+ "type": "string",
16089
+ "in": "path",
16090
+ "required": true
16091
+ },
16092
+ {
16093
+ "name": "agent_runner_session_id",
16094
+ "type": "string",
16095
+ "in": "path",
16096
+ "required": true
16097
+ }
16098
+ ],
16099
+ "post": {
16100
+ "operationId": "stopAgentRunnerSession",
16101
+ "tags": [
16102
+ "agentRunnerSession"
16103
+ ],
16104
+ "description": "Stops the session. Stopping happens in the background.",
16105
+ "responses": {
16106
+ "202": {
16107
+ "description": "Accepted"
16108
+ },
16109
+ "default": {
16110
+ "description": "error",
16111
+ "schema": {
16112
+ "type": "object",
16113
+ "required": [
16114
+ "message"
16115
+ ],
16116
+ "properties": {
16117
+ "code": {
16118
+ "type": "integer",
16119
+ "format": "int64"
16120
+ },
16121
+ "message": {
16122
+ "type": "string",
16123
+ "x-nullable": false
16124
+ }
16125
+ }
16126
+ }
16127
+ }
16128
+ }
16129
+ }
16130
+ },
16131
+ "/agent_runners/{agent_runner_id}/sessions/{agent_runner_session_id}/answers": {
16132
+ "parameters": [
16133
+ {
16134
+ "name": "agent_runner_id",
16135
+ "type": "string",
16136
+ "in": "path",
16137
+ "required": true
16138
+ },
16139
+ {
16140
+ "name": "agent_runner_session_id",
16141
+ "type": "string",
16142
+ "in": "path",
16143
+ "required": true
16144
+ }
16145
+ ],
16146
+ "post": {
16147
+ "operationId": "answerAgentRunnerSession",
14801
16148
  "tags": [
14802
16149
  "agentRunnerSession"
14803
16150
  ],
16151
+ "description": "Answers or skips a pending interaction and resumes the session. A session waiting on an interaction is in the `await_input` state.",
14804
16152
  "parameters": [
14805
16153
  {
14806
- "name": "is_published",
14807
- "type": "boolean",
14808
- "in": "query"
16154
+ "name": "answer",
16155
+ "in": "body",
16156
+ "required": true,
16157
+ "schema": {
16158
+ "type": "object",
16159
+ "required": [
16160
+ "refId"
16161
+ ],
16162
+ "properties": {
16163
+ "refId": {
16164
+ "type": "string",
16165
+ "description": "Key of the pending interaction in the session's `interactions`."
16166
+ },
16167
+ "response": {
16168
+ "type": "array",
16169
+ "description": "One entry per question in the interaction's `payload`: a string, an array of strings for a multi-select question, or null to skip that question.",
16170
+ "items": {}
16171
+ },
16172
+ "skipped": {
16173
+ "type": "boolean",
16174
+ "description": "Skip the whole interaction instead of answering it."
16175
+ },
16176
+ "instruction": {
16177
+ "type": "string",
16178
+ "description": "Instruction for the agent when skipping."
16179
+ }
16180
+ }
16181
+ }
14809
16182
  }
14810
16183
  ],
14811
16184
  "responses": {
@@ -14824,7 +16197,8 @@
14824
16197
  "type": "string"
14825
16198
  },
14826
16199
  "state": {
14827
- "type": "string"
16200
+ "type": "string",
16201
+ "description": "One of `new`, `running`, `await_input`, `interrupted`, `error`, `done` or `cancelled`."
14828
16202
  },
14829
16203
  "created_at": {
14830
16204
  "type": "string",
@@ -14838,6 +16212,11 @@
14838
16212
  "type": "string",
14839
16213
  "format": "dateTime"
14840
16214
  },
16215
+ "paused_at": {
16216
+ "type": "string",
16217
+ "format": "dateTime",
16218
+ "description": "When the session paused waiting on an interaction. Null once it resumes."
16219
+ },
14841
16220
  "title": {
14842
16221
  "type": "string"
14843
16222
  },
@@ -14856,7 +16235,8 @@
14856
16235
  }
14857
16236
  },
14858
16237
  "result": {
14859
- "type": "string"
16238
+ "type": "string",
16239
+ "description": "The agent's summary of what it did."
14860
16240
  },
14861
16241
  "result_diff": {
14862
16242
  "type": "string"
@@ -14868,11 +16248,61 @@
14868
16248
  "type": "string"
14869
16249
  },
14870
16250
  "deploy_url": {
14871
- "type": "string"
16251
+ "type": "string",
16252
+ "description": "URL of the session's deploy preview."
14872
16253
  },
14873
16254
  "duration": {
14874
16255
  "type": "integer"
14875
16256
  },
16257
+ "usage": {
16258
+ "type": "object",
16259
+ "properties": {
16260
+ "total_input_tokens": {
16261
+ "type": "integer"
16262
+ },
16263
+ "total_output_tokens": {
16264
+ "type": "integer"
16265
+ },
16266
+ "total_cached_input_tokens": {
16267
+ "type": "integer"
16268
+ },
16269
+ "total_cached_output_tokens": {
16270
+ "type": "integer"
16271
+ },
16272
+ "total_tokens": {
16273
+ "type": "integer"
16274
+ },
16275
+ "total_credits_cost": {
16276
+ "type": "number",
16277
+ "description": "Credits the session used."
16278
+ }
16279
+ }
16280
+ },
16281
+ "interactions": {
16282
+ "type": "object",
16283
+ "description": "Questions and requests from the agent, keyed by reference ID. A pending one pauses the session in `await_input` until it's answered or skipped.",
16284
+ "additionalProperties": {
16285
+ "type": "object",
16286
+ "properties": {
16287
+ "type": {
16288
+ "type": "string",
16289
+ "description": "One of `question`, `authorization` or `setup_request`. Only questions can be answered; the others can only be skipped."
16290
+ },
16291
+ "status": {
16292
+ "type": "string",
16293
+ "description": "One of `pending`, `answered` or `skipped`."
16294
+ },
16295
+ "payload": {
16296
+ "description": "For a question, an array of questions, each with `question`, an optional `header`, `multiSelect` and `options` (each with `label` and an optional `description`). For `authorization` and `setup_request`, an object describing the request."
16297
+ },
16298
+ "response": {
16299
+ "type": "array",
16300
+ "description": "Answers aligned to `payload`; null entries were skipped.",
16301
+ "items": {}
16302
+ }
16303
+ }
16304
+ }
16305
+ },
14876
16306
  "steps": {
14877
16307
  "type": "array",
14878
16308
  "items": {
@@ -14916,38 +16346,101 @@
14916
16346
  "is_published": {
14917
16347
  "type": "boolean"
14918
16348
  }
14919
- }
16349
+ }
16350
+ }
16351
+ },
16352
+ "400": {
16353
+ "description": "`ref_id_required`, `invalid_response`, or `interaction_can_only_be_skipped` when answering an `authorization` or `setup_request` interaction.",
16354
+ "schema": {
16355
+ "allOf": [
16356
+ {
16357
+ "type": "object",
16358
+ "required": [
16359
+ "message"
16360
+ ],
16361
+ "properties": {
16362
+ "code": {
16363
+ "type": "integer",
16364
+ "format": "int64"
16365
+ },
16366
+ "message": {
16367
+ "type": "string",
16368
+ "x-nullable": false
16369
+ }
16370
+ }
16371
+ },
16372
+ {
16373
+ "properties": {
16374
+ "error_code": {
16375
+ "type": "string",
16376
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
16377
+ }
16378
+ }
16379
+ }
16380
+ ]
16381
+ }
16382
+ },
16383
+ "422": {
16384
+ "description": "`interaction_not_found` or `interaction_not_pending`.",
16385
+ "schema": {
16386
+ "allOf": [
16387
+ {
16388
+ "type": "object",
16389
+ "required": [
16390
+ "message"
16391
+ ],
16392
+ "properties": {
16393
+ "code": {
16394
+ "type": "integer",
16395
+ "format": "int64"
16396
+ },
16397
+ "message": {
16398
+ "type": "string",
16399
+ "x-nullable": false
16400
+ }
16401
+ }
16402
+ },
16403
+ {
16404
+ "properties": {
16405
+ "error_code": {
16406
+ "type": "string",
16407
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
16408
+ }
16409
+ }
16410
+ }
16411
+ ]
14920
16412
  }
14921
16413
  },
14922
- "default": {
14923
- "description": "error",
16414
+ "429": {
16415
+ "description": "`concurrency_limit_reached`.",
14924
16416
  "schema": {
14925
- "type": "object",
14926
- "required": [
14927
- "message"
14928
- ],
14929
- "properties": {
14930
- "code": {
14931
- "type": "integer",
14932
- "format": "int64"
16417
+ "allOf": [
16418
+ {
16419
+ "type": "object",
16420
+ "required": [
16421
+ "message"
16422
+ ],
16423
+ "properties": {
16424
+ "code": {
16425
+ "type": "integer",
16426
+ "format": "int64"
16427
+ },
16428
+ "message": {
16429
+ "type": "string",
16430
+ "x-nullable": false
16431
+ }
16432
+ }
14933
16433
  },
14934
- "message": {
14935
- "type": "string",
14936
- "x-nullable": false
16434
+ {
16435
+ "properties": {
16436
+ "error_code": {
16437
+ "type": "string",
16438
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
16439
+ }
16440
+ }
14937
16441
  }
14938
- }
16442
+ ]
14939
16443
  }
14940
- }
14941
- }
14942
- },
14943
- "delete": {
14944
- "operationId": "deleteAgentRunnerSession",
14945
- "tags": [
14946
- "agentRunnerSession"
14947
- ],
14948
- "responses": {
14949
- "202": {
14950
- "description": "Accepted"
14951
16444
  },
14952
16445
  "default": {
14953
16446
  "description": "error",
@@ -22238,6 +23731,74 @@
22238
23731
  "region": {
22239
23732
  "type": "string",
22240
23733
  "description": "Where the server runs. Defaults to the region configured at the site level\nwhen absent.\n"
23734
+ },
23735
+ "instance_size": {
23736
+ "type": "string",
23737
+ "enum": [
23738
+ "small",
23739
+ "medium",
23740
+ "large"
23741
+ ],
23742
+ "description": "The size of the instances the server runs on. A default size is used when\nabsent.\n"
23743
+ },
23744
+ "routes": {
23745
+ "type": "array",
23746
+ "description": "The paths the server handles.",
23747
+ "x-omitempty": true,
23748
+ "items": {
23749
+ "type": "object",
23750
+ "properties": {
23751
+ "pattern": {
23752
+ "type": "string"
23753
+ },
23754
+ "literal": {
23755
+ "type": "string"
23756
+ },
23757
+ "expression": {
23758
+ "type": "string"
23759
+ },
23760
+ "methods": {
23761
+ "type": "array",
23762
+ "items": {
23763
+ "type": "string",
23764
+ "enum": [
23765
+ "GET",
23766
+ "POST",
23767
+ "PUT",
23768
+ "PATCH",
23769
+ "DELETE",
23770
+ "OPTIONS"
23771
+ ]
23772
+ }
23773
+ },
23774
+ "prefer_static": {
23775
+ "type": "boolean"
23776
+ }
23777
+ }
23778
+ }
23779
+ },
23780
+ "excluded_routes": {
23781
+ "type": "array",
23782
+ "description": "Paths within `routes` that the server does not handle.",
23783
+ "x-omitempty": true,
23784
+ "items": {
23785
+ "type": "object",
23786
+ "properties": {
23787
+ "pattern": {
23788
+ "type": "string"
23789
+ },
23790
+ "literal": {
23791
+ "type": "string"
23792
+ },
23793
+ "expression": {
23794
+ "type": "string"
23795
+ }
23796
+ }
23797
+ }
23798
+ },
23799
+ "runtime_version": {
23800
+ "type": "string",
23801
+ "description": "The runtime version the server was built for, such as `nodejs24.x`. A\ndefault version is used when absent.\n"
22241
23802
  }
22242
23803
  }
22243
23804
  },
@@ -23506,7 +25067,8 @@
23506
25067
  "type": "string"
23507
25068
  },
23508
25069
  "state": {
23509
- "type": "string"
25070
+ "type": "string",
25071
+ "description": "One of `new`, `running`, `await_input`, `interrupted`, `error`, `done`, `cancelled` or `archived`."
23510
25072
  },
23511
25073
  "created_at": {
23512
25074
  "type": "string",
@@ -23536,7 +25098,8 @@
23536
25098
  "type": "string"
23537
25099
  },
23538
25100
  "pr_state": {
23539
- "type": "string"
25101
+ "type": "string",
25102
+ "description": "One of `open`, `draft`, `merged` or `closed`."
23540
25103
  },
23541
25104
  "pr_number": {
23542
25105
  "type": "integer"
@@ -23548,7 +25111,8 @@
23548
25111
  "type": "string"
23549
25112
  },
23550
25113
  "current_task": {
23551
- "type": "string"
25114
+ "type": "string",
25115
+ "description": "What the agent is working on in the active session."
23552
25116
  },
23553
25117
  "result_diff": {
23554
25118
  "type": "string"
@@ -23578,12 +25142,20 @@
23578
25142
  "type": "string",
23579
25143
  "format": "dateTime"
23580
25144
  },
25145
+ "has_result_diff": {
25146
+ "type": "boolean",
25147
+ "description": "Whether the run has changes, available from `GET /agent_runners/{agent_runner_id}/diff`."
25148
+ },
23581
25149
  "latest_session_deploy_id": {
23582
25150
  "type": "string"
23583
25151
  },
23584
25152
  "latest_session_deploy_url": {
23585
25153
  "type": "string"
23586
25154
  },
25155
+ "preview_state": {
25156
+ "type": "string",
25157
+ "description": "State of the deploy building the latest preview. Null until that deploy exists; `ready` once the preview is live."
25158
+ },
23587
25159
  "user": {
23588
25160
  "type": "object",
23589
25161
  "properties": {
@@ -23603,6 +25175,50 @@
23603
25175
  }
23604
25176
  }
23605
25177
  },
25178
+ "agentRunnerSetup": {
25179
+ "type": "object",
25180
+ "required": [
25181
+ "prompt"
25182
+ ],
25183
+ "properties": {
25184
+ "prompt": {
25185
+ "type": "string"
25186
+ },
25187
+ "branch": {
25188
+ "type": "string",
25189
+ "description": "Branch to start from. Defaults to the site's production branch."
25190
+ },
25191
+ "deploy_id": {
25192
+ "type": "string",
25193
+ "description": "Deploy to start from. Takes precedence over `branch`."
25194
+ },
25195
+ "agent": {
25196
+ "type": "string",
25197
+ "description": "Agent to run, for example `claude` or `codex`."
25198
+ },
25199
+ "model": {
25200
+ "type": "string",
25201
+ "description": "Model for the agent to use. Omit to let Netlify choose."
25202
+ },
25203
+ "effort": {
25204
+ "type": "string",
25205
+ "enum": [
25206
+ "low",
25207
+ "medium",
25208
+ "high"
25209
+ ],
25210
+ "description": "Reasoning effort. Omit to let the agent decide."
25211
+ },
25212
+ "mode": {
25213
+ "type": "string",
25214
+ "enum": [
25215
+ "normal",
25216
+ "ask"
25217
+ ],
25218
+ "description": "`normal` (the default) changes code; `ask` answers questions without changing code."
25219
+ }
25220
+ }
25221
+ },
23606
25222
  "agentRunnerSession": {
23607
25223
  "type": "object",
23608
25224
  "properties": {
@@ -23616,7 +25232,8 @@
23616
25232
  "type": "string"
23617
25233
  },
23618
25234
  "state": {
23619
- "type": "string"
25235
+ "type": "string",
25236
+ "description": "One of `new`, `running`, `await_input`, `interrupted`, `error`, `done` or `cancelled`."
23620
25237
  },
23621
25238
  "created_at": {
23622
25239
  "type": "string",
@@ -23630,6 +25247,11 @@
23630
25247
  "type": "string",
23631
25248
  "format": "dateTime"
23632
25249
  },
25250
+ "paused_at": {
25251
+ "type": "string",
25252
+ "format": "dateTime",
25253
+ "description": "When the session paused waiting on an interaction. Null once it resumes."
25254
+ },
23633
25255
  "title": {
23634
25256
  "type": "string"
23635
25257
  },
@@ -23648,7 +25270,8 @@
23648
25270
  }
23649
25271
  },
23650
25272
  "result": {
23651
- "type": "string"
25273
+ "type": "string",
25274
+ "description": "The agent's summary of what it did."
23652
25275
  },
23653
25276
  "result_diff": {
23654
25277
  "type": "string"
@@ -23660,11 +25283,61 @@
23660
25283
  "type": "string"
23661
25284
  },
23662
25285
  "deploy_url": {
23663
- "type": "string"
25286
+ "type": "string",
25287
+ "description": "URL of the session's deploy preview."
23664
25288
  },
23665
25289
  "duration": {
23666
25290
  "type": "integer"
23667
25291
  },
25292
+ "usage": {
25293
+ "type": "object",
25294
+ "properties": {
25295
+ "total_input_tokens": {
25296
+ "type": "integer"
25297
+ },
25298
+ "total_output_tokens": {
25299
+ "type": "integer"
25300
+ },
25301
+ "total_cached_input_tokens": {
25302
+ "type": "integer"
25303
+ },
25304
+ "total_cached_output_tokens": {
25305
+ "type": "integer"
25306
+ },
25307
+ "total_tokens": {
25308
+ "type": "integer"
25309
+ },
25310
+ "total_credits_cost": {
25311
+ "type": "number",
25312
+ "description": "Credits the session used."
25313
+ }
25314
+ }
25315
+ },
25316
+ "interactions": {
25317
+ "type": "object",
25318
+ "description": "Questions and requests from the agent, keyed by reference ID. A pending one pauses the session in `await_input` until it's answered or skipped.",
25319
+ "additionalProperties": {
25320
+ "type": "object",
25321
+ "properties": {
25322
+ "type": {
25323
+ "type": "string",
25324
+ "description": "One of `question`, `authorization` or `setup_request`. Only questions can be answered; the others can only be skipped."
25325
+ },
25326
+ "status": {
25327
+ "type": "string",
25328
+ "description": "One of `pending`, `answered` or `skipped`."
25329
+ },
25330
+ "payload": {
25331
+ "description": "For a question, an array of questions, each with `question`, an optional `header`, `multiSelect` and `options` (each with `label` and an optional `description`). For `authorization` and `setup_request`, an object describing the request."
25332
+ },
25333
+ "response": {
25334
+ "type": "array",
25335
+ "description": "Answers aligned to `payload`; null entries were skipped.",
25336
+ "items": {}
25337
+ }
25338
+ }
25339
+ }
25340
+ },
23668
25341
  "steps": {
23669
25342
  "type": "array",
23670
25343
  "items": {
@@ -23710,6 +25383,128 @@
23710
25383
  }
23711
25384
  }
23712
25385
  },
25386
+ "agentRunnerSessionSetup": {
25387
+ "type": "object",
25388
+ "properties": {
25389
+ "prompt": {
25390
+ "type": "string",
25391
+ "description": "What the agent should do. Required."
25392
+ },
25393
+ "agent": {
25394
+ "type": "string"
25395
+ },
25396
+ "model": {
25397
+ "type": "string",
25398
+ "description": "Model for the agent to use. Omit to let Netlify choose."
25399
+ },
25400
+ "mode": {
25401
+ "type": "string",
25402
+ "enum": [
25403
+ "normal",
25404
+ "ask"
25405
+ ],
25406
+ "description": "`normal` (the default) changes code; `ask` answers questions without changing code."
25407
+ }
25408
+ }
25409
+ },
25410
+ "agentRunnerSessionUsage": {
25411
+ "type": "object",
25412
+ "properties": {
25413
+ "total_input_tokens": {
25414
+ "type": "integer"
25415
+ },
25416
+ "total_output_tokens": {
25417
+ "type": "integer"
25418
+ },
25419
+ "total_cached_input_tokens": {
25420
+ "type": "integer"
25421
+ },
25422
+ "total_cached_output_tokens": {
25423
+ "type": "integer"
25424
+ },
25425
+ "total_tokens": {
25426
+ "type": "integer"
25427
+ },
25428
+ "total_credits_cost": {
25429
+ "type": "number",
25430
+ "description": "Credits the session used."
25431
+ }
25432
+ }
25433
+ },
25434
+ "agentRunnerSessionInteraction": {
25435
+ "type": "object",
25436
+ "properties": {
25437
+ "type": {
25438
+ "type": "string",
25439
+ "description": "One of `question`, `authorization` or `setup_request`. Only questions can be answered; the others can only be skipped."
25440
+ },
25441
+ "status": {
25442
+ "type": "string",
25443
+ "description": "One of `pending`, `answered` or `skipped`."
25444
+ },
25445
+ "payload": {
25446
+ "description": "For a question, an array of questions, each with `question`, an optional `header`, `multiSelect` and `options` (each with `label` and an optional `description`). For `authorization` and `setup_request`, an object describing the request."
25447
+ },
25448
+ "response": {
25449
+ "type": "array",
25450
+ "description": "Answers aligned to `payload`; null entries were skipped.",
25451
+ "items": {}
25452
+ }
25453
+ }
25454
+ },
25455
+ "agentRunnerSessionAnswer": {
25456
+ "type": "object",
25457
+ "required": [
25458
+ "refId"
25459
+ ],
25460
+ "properties": {
25461
+ "refId": {
25462
+ "type": "string",
25463
+ "description": "Key of the pending interaction in the session's `interactions`."
25464
+ },
25465
+ "response": {
25466
+ "type": "array",
25467
+ "description": "One entry per question in the interaction's `payload`: a string, an array of strings for a multi-select question, or null to skip that question.",
25468
+ "items": {}
25469
+ },
25470
+ "skipped": {
25471
+ "type": "boolean",
25472
+ "description": "Skip the whole interaction instead of answering it."
25473
+ },
25474
+ "instruction": {
25475
+ "type": "string",
25476
+ "description": "Instruction for the agent when skipping."
25477
+ }
25478
+ }
25479
+ },
25480
+ "agentRunnerError": {
25481
+ "allOf": [
25482
+ {
25483
+ "type": "object",
25484
+ "required": [
25485
+ "message"
25486
+ ],
25487
+ "properties": {
25488
+ "code": {
25489
+ "type": "integer",
25490
+ "format": "int64"
25491
+ },
25492
+ "message": {
25493
+ "type": "string",
25494
+ "x-nullable": false
25495
+ }
25496
+ }
25497
+ },
25498
+ {
25499
+ "properties": {
25500
+ "error_code": {
25501
+ "type": "string",
25502
+ "description": "Machine-readable reason. Each operation lists the codes it can return."
25503
+ }
25504
+ }
25505
+ }
25506
+ ]
25507
+ },
23713
25508
  "agentRunnerSessionStep": {
23714
25509
  "type": "object",
23715
25510
  "properties": {
@@ -24521,6 +26316,13 @@
24521
26316
  "devServer"
24522
26317
  ]
24523
26318
  },
26319
+ {
26320
+ "name": "Agent runners",
26321
+ "tags": [
26322
+ "agentRunner",
26323
+ "agentRunnerSession"
26324
+ ]
26325
+ },
24524
26326
  {
24525
26327
  "name": "Webhooks and notifications",
24526
26328
  "tags": [
@@ -24707,6 +26509,14 @@
24707
26509
  "name": "devServerHook",
24708
26510
  "x-displayName": "Dev server hook"
24709
26511
  },
26512
+ {
26513
+ "name": "agentRunner",
26514
+ "x-displayName": "Agent runner"
26515
+ },
26516
+ {
26517
+ "name": "agentRunnerSession",
26518
+ "x-displayName": "Agent runner session"
26519
+ },
24710
26520
  {
24711
26521
  "name": "database",
24712
26522
  "x-displayName": "Database"