@1claw/openapi-spec 0.58.0 → 0.58.2

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @1claw/openapi-spec
1
+ # @1claw/openapi-spec (v0.58.0)
2
2
 
3
3
  OpenAPI 3.1.0 specification for the [1Claw Vault API](https://1claw.xyz). Use this package to generate API clients in any language.
4
4
 
@@ -40,7 +40,27 @@ openapi-generator generate \
40
40
  import spec from "@1claw/openapi-spec/openapi.json";
41
41
  ```
42
42
 
43
- ## What's in the spec (v0.55.0)
43
+ ## What's in the spec (v0.58.0)
44
+
45
+ ### Platform control plane (v0.58)
46
+ - **App-scoped reads (`plt_`)** — `GET /v1/platform/connections/{id}/approvals`, pending-approvals (includes `payload_hash`), spend-policy
47
+ - **Spend policy** — `GET /v1/platform/apps/{id}/spend-policies/{policy_id}`; `PUT .../connections/{id}/spend-policy` supports optional **`Idempotency-Key`** (24h body-hash replay)
48
+ - **App lifecycle** — soft-delete returns `{ id, slug, deleted_at }`; slug unique per org; inactive apps return 404
49
+ - **Ownership transfer** — `POST /v1/platform/apps/{id}/transfer-ownership` with step-up auth
50
+
51
+ ### Platform API expansion (v0.57)
52
+ - **SIWE provisioning** — `POST /v1/platform/siwe/challenge`; upsert with wallet subject token
53
+ - **Parameterized templates** — bootstrap `parameters` JSON; `POST .../templates/{tid}/preview` dry-runs `{{params.*}}` / `{{subject.*}}`
54
+ - **Connection polling** — `GET /v1/platform/connections/{id}` (status, claim, entitlements, wallet address)
55
+ - **Per-connection usage** — `GET .../connections/{id}/usage` (inference spend, UTC period)
56
+ - **On-chain entitlements** — template `entitlements[]`; refresh + monitor endpoints
57
+ - **Inference budgets** — spend policy inference allowance fields; `GET /v1/treasury/wallets/inference-budget`
58
+
59
+ ### Safe accounts & guardrail governance (v0.56)
60
+ - **Agent accounts** — `GET/POST /v1/agents/{id}/accounts`, migrate/deprecate EOA, module registry
61
+ - **Guardrail governance** — shadow report, revisions, replay; widening guardrails return **202** + approval
62
+ - **Human Factor Auth** — treasury send/swap/export step-up policies
63
+ - **Org unfreeze** — T3 step-up; cumulative gas budget ledger
44
64
 
45
65
  ### Graduated HITL & extended guardrails (v0.54–0.55)
46
66
  - **Agent fields** — `tx_approval_policy`, `typed_data_policy`, `simulation_failure_policy`, `raw_signing_policy`, `personal_sign_policy`, `tx_block_unlimited_approvals`, per-recipient limits, USD caps, `allow_erc4337`, `allow_eip7702`, `auto_suspended`, `clear_auto_suspended` (update)
package/openapi.json CHANGED
@@ -9985,6 +9985,54 @@
9985
9985
  }
9986
9986
  },
9987
9987
  "/v1/platform/apps/{appId}/templates/{template_id}": {
9988
+ "get": {
9989
+ "tags": [
9990
+ "Platform"
9991
+ ],
9992
+ "summary": "Get a bootstrap template",
9993
+ "description": "Returns the full template spec for a platform app. plt_ or user JWT.",
9994
+ "operationId": "getPlatformTemplate",
9995
+ "security": [
9996
+ {
9997
+ "BearerAuth": []
9998
+ }
9999
+ ],
10000
+ "parameters": [
10001
+ {
10002
+ "in": "path",
10003
+ "name": "appId",
10004
+ "required": true,
10005
+ "schema": {
10006
+ "type": "string",
10007
+ "format": "uuid"
10008
+ }
10009
+ },
10010
+ {
10011
+ "in": "path",
10012
+ "name": "template_id",
10013
+ "required": true,
10014
+ "schema": {
10015
+ "type": "string",
10016
+ "format": "uuid"
10017
+ }
10018
+ }
10019
+ ],
10020
+ "responses": {
10021
+ "200": {
10022
+ "description": "Template details",
10023
+ "content": {
10024
+ "application/json": {
10025
+ "schema": {
10026
+ "$ref": "#/components/schemas/PlatformTemplateResponse"
10027
+ }
10028
+ }
10029
+ }
10030
+ },
10031
+ "404": {
10032
+ "$ref": "#/components/responses/NotFound"
10033
+ }
10034
+ }
10035
+ },
9988
10036
  "patch": {
9989
10037
  "tags": [
9990
10038
  "Platform"
@@ -11302,7 +11350,7 @@
11302
11350
  "Platform"
11303
11351
  ],
11304
11352
  "summary": "Set per-user spend policy override",
11305
- "description": "Override the app-wide spend policy for a specific connected user. This\npolicy takes precedence over the app default. Remove by deleting the\nconnection-level policy.\n",
11353
+ "description": "Replace the per-user spend policy for a connected user (deactivates the\nprevious active row, then inserts). Requires plt_ platform auth.\nOptional `Idempotency-Key` header must cover the full request body — reusing\nthe same key with different parameters returns 409.\n",
11306
11354
  "operationId": "setUserSpendPolicy",
11307
11355
  "security": [
11308
11356
  {
@@ -11415,34 +11463,403 @@
11415
11463
  }
11416
11464
  },
11417
11465
  {
11418
- "name": "limit",
11419
- "in": "query",
11420
- "required": false,
11466
+ "name": "limit",
11467
+ "in": "query",
11468
+ "required": false,
11469
+ "schema": {
11470
+ "type": "integer",
11471
+ "default": 50
11472
+ }
11473
+ },
11474
+ {
11475
+ "name": "offset",
11476
+ "in": "query",
11477
+ "required": false,
11478
+ "schema": {
11479
+ "type": "integer",
11480
+ "default": 0
11481
+ }
11482
+ }
11483
+ ],
11484
+ "responses": {
11485
+ "200": {
11486
+ "description": "Connection-scoped approvals",
11487
+ "content": {
11488
+ "application/json": {
11489
+ "schema": {
11490
+ "$ref": "#/components/schemas/ApprovalListResponse"
11491
+ }
11492
+ }
11493
+ }
11494
+ },
11495
+ "404": {
11496
+ "$ref": "#/components/responses/NotFound"
11497
+ }
11498
+ }
11499
+ }
11500
+ },
11501
+ "/v1/platform/connections/{connectionId}/approvals/{approvalId}": {
11502
+ "get": {
11503
+ "tags": [
11504
+ "Platform"
11505
+ ],
11506
+ "summary": "Get a connection-scoped approval",
11507
+ "operationId": "getConnectionApproval",
11508
+ "security": [
11509
+ {
11510
+ "BearerAuth": []
11511
+ }
11512
+ ],
11513
+ "parameters": [
11514
+ {
11515
+ "in": "path",
11516
+ "name": "connectionId",
11517
+ "required": true,
11518
+ "schema": {
11519
+ "type": "string",
11520
+ "format": "uuid"
11521
+ }
11522
+ },
11523
+ {
11524
+ "in": "path",
11525
+ "name": "approvalId",
11526
+ "required": true,
11527
+ "schema": {
11528
+ "type": "string",
11529
+ "format": "uuid"
11530
+ }
11531
+ }
11532
+ ],
11533
+ "responses": {
11534
+ "200": {
11535
+ "description": "Approval detail",
11536
+ "content": {
11537
+ "application/json": {
11538
+ "schema": {
11539
+ "$ref": "#/components/schemas/ApprovalResponse"
11540
+ }
11541
+ }
11542
+ }
11543
+ },
11544
+ "404": {
11545
+ "$ref": "#/components/responses/NotFound"
11546
+ }
11547
+ }
11548
+ }
11549
+ },
11550
+ "/v1/platform/connections/{connectionId}/pending-approvals": {
11551
+ "get": {
11552
+ "tags": [
11553
+ "Platform"
11554
+ ],
11555
+ "summary": "List pending consensus approvals for a connection",
11556
+ "description": "Returns pending approvals for agents provisioned on the connection,\nincluding `action_payload` and `payload_hash` for consensus UX.\nRequires plt_ platform auth.\n",
11557
+ "operationId": "listConnectionPendingApprovals",
11558
+ "security": [
11559
+ {
11560
+ "BearerAuth": []
11561
+ }
11562
+ ],
11563
+ "parameters": [
11564
+ {
11565
+ "in": "path",
11566
+ "name": "connectionId",
11567
+ "required": true,
11568
+ "schema": {
11569
+ "type": "string",
11570
+ "format": "uuid"
11571
+ }
11572
+ },
11573
+ {
11574
+ "name": "status",
11575
+ "in": "query",
11576
+ "schema": {
11577
+ "type": "string",
11578
+ "default": "pending"
11579
+ }
11580
+ },
11581
+ {
11582
+ "name": "limit",
11583
+ "in": "query",
11584
+ "schema": {
11585
+ "type": "integer",
11586
+ "default": 50
11587
+ }
11588
+ },
11589
+ {
11590
+ "name": "offset",
11591
+ "in": "query",
11592
+ "schema": {
11593
+ "type": "integer",
11594
+ "default": 0
11595
+ }
11596
+ }
11597
+ ],
11598
+ "responses": {
11599
+ "200": {
11600
+ "description": "Pending approvals list",
11601
+ "content": {
11602
+ "application/json": {
11603
+ "schema": {
11604
+ "$ref": "#/components/schemas/PendingApprovalListResponse"
11605
+ }
11606
+ }
11607
+ }
11608
+ },
11609
+ "404": {
11610
+ "$ref": "#/components/responses/NotFound"
11611
+ }
11612
+ }
11613
+ }
11614
+ },
11615
+ "/v1/platform/connections/{connectionId}/pending-approvals/{approvalId}": {
11616
+ "get": {
11617
+ "tags": [
11618
+ "Platform"
11619
+ ],
11620
+ "summary": "Get a connection-scoped pending approval (with payload_hash)",
11621
+ "operationId": "getConnectionPendingApproval",
11622
+ "security": [
11623
+ {
11624
+ "BearerAuth": []
11625
+ }
11626
+ ],
11627
+ "parameters": [
11628
+ {
11629
+ "in": "path",
11630
+ "name": "connectionId",
11631
+ "required": true,
11632
+ "schema": {
11633
+ "type": "string",
11634
+ "format": "uuid"
11635
+ }
11636
+ },
11637
+ {
11638
+ "in": "path",
11639
+ "name": "approvalId",
11640
+ "required": true,
11641
+ "schema": {
11642
+ "type": "string",
11643
+ "format": "uuid"
11644
+ }
11645
+ }
11646
+ ],
11647
+ "responses": {
11648
+ "200": {
11649
+ "description": "Pending approval detail including action_payload and payload_hash",
11650
+ "content": {
11651
+ "application/json": {
11652
+ "schema": {
11653
+ "$ref": "#/components/schemas/PendingApprovalResponse"
11654
+ }
11655
+ }
11656
+ }
11657
+ },
11658
+ "404": {
11659
+ "$ref": "#/components/responses/NotFound"
11660
+ }
11661
+ }
11662
+ }
11663
+ },
11664
+ "/v1/platform/connections/{connectionId}/pending-approvals/{approvalId}/decide": {
11665
+ "post": {
11666
+ "tags": [
11667
+ "Platform"
11668
+ ],
11669
+ "summary": "Decide a pending approval for a connection user",
11670
+ "description": "Platform apps vote on behalf of the connected user after verifying intent\nout-of-band (e.g. wallet mandate). Requires `payload_hash` matching the\npending row. Accepts `decision`: `approve` or `reject` (aliases `approved` /\n`rejected`). plt_ auth only; scoped to agents on the connection.\n",
11671
+ "operationId": "decideConnectionPendingApproval",
11672
+ "security": [
11673
+ {
11674
+ "BearerAuth": []
11675
+ }
11676
+ ],
11677
+ "parameters": [
11678
+ {
11679
+ "in": "path",
11680
+ "name": "connectionId",
11681
+ "required": true,
11682
+ "schema": {
11683
+ "type": "string",
11684
+ "format": "uuid"
11685
+ }
11686
+ },
11687
+ {
11688
+ "in": "path",
11689
+ "name": "approvalId",
11690
+ "required": true,
11691
+ "schema": {
11692
+ "type": "string",
11693
+ "format": "uuid"
11694
+ }
11695
+ }
11696
+ ],
11697
+ "requestBody": {
11698
+ "required": true,
11699
+ "content": {
11700
+ "application/json": {
11701
+ "schema": {
11702
+ "$ref": "#/components/schemas/ApprovePendingApprovalRequest"
11703
+ }
11704
+ }
11705
+ }
11706
+ },
11707
+ "responses": {
11708
+ "200": {
11709
+ "description": "Updated pending approval",
11710
+ "content": {
11711
+ "application/json": {
11712
+ "schema": {
11713
+ "$ref": "#/components/schemas/PendingApprovalResponse"
11714
+ }
11715
+ }
11716
+ }
11717
+ },
11718
+ "400": {
11719
+ "$ref": "#/components/responses/BadRequest"
11720
+ },
11721
+ "403": {
11722
+ "$ref": "#/components/responses/Forbidden"
11723
+ },
11724
+ "404": {
11725
+ "$ref": "#/components/responses/NotFound"
11726
+ },
11727
+ "409": {
11728
+ "description": "Already voted"
11729
+ }
11730
+ }
11731
+ }
11732
+ },
11733
+ "/v1/platform/connections/{connectionId}/approvals/{approvalId}/decide": {
11734
+ "post": {
11735
+ "tags": [
11736
+ "Platform"
11737
+ ],
11738
+ "summary": "Decide a mobile/agent approval for a connection user",
11739
+ "description": "Platform apps decide agent approval requests on behalf of the connected user.\nAccepts `decision`: `approved` or `rejected` (aliases `approve` / `reject`).\nplt_ auth only.\n",
11740
+ "operationId": "decideConnectionApproval",
11741
+ "security": [
11742
+ {
11743
+ "BearerAuth": []
11744
+ }
11745
+ ],
11746
+ "parameters": [
11747
+ {
11748
+ "in": "path",
11749
+ "name": "connectionId",
11750
+ "required": true,
11751
+ "schema": {
11752
+ "type": "string",
11753
+ "format": "uuid"
11754
+ }
11755
+ },
11756
+ {
11757
+ "in": "path",
11758
+ "name": "approvalId",
11759
+ "required": true,
11760
+ "schema": {
11761
+ "type": "string",
11762
+ "format": "uuid"
11763
+ }
11764
+ }
11765
+ ],
11766
+ "requestBody": {
11767
+ "required": true,
11768
+ "content": {
11769
+ "application/json": {
11770
+ "schema": {
11771
+ "type": "object",
11772
+ "required": [
11773
+ "decision"
11774
+ ],
11775
+ "properties": {
11776
+ "decision": {
11777
+ "type": "string",
11778
+ "enum": [
11779
+ "approved",
11780
+ "rejected",
11781
+ "approve",
11782
+ "reject"
11783
+ ]
11784
+ },
11785
+ "reason": {
11786
+ "type": "string"
11787
+ }
11788
+ }
11789
+ }
11790
+ }
11791
+ }
11792
+ },
11793
+ "responses": {
11794
+ "200": {
11795
+ "description": "Decided approval",
11796
+ "content": {
11797
+ "application/json": {
11798
+ "schema": {
11799
+ "$ref": "#/components/schemas/ApprovalResponse"
11800
+ }
11801
+ }
11802
+ }
11803
+ },
11804
+ "403": {
11805
+ "$ref": "#/components/responses/Forbidden"
11806
+ },
11807
+ "404": {
11808
+ "$ref": "#/components/responses/NotFound"
11809
+ },
11810
+ "409": {
11811
+ "description": "Already decided"
11812
+ }
11813
+ }
11814
+ }
11815
+ },
11816
+ "/v1/platform/connections/{connectionId}/signing-keys/{chain}": {
11817
+ "delete": {
11818
+ "tags": [
11819
+ "Platform"
11820
+ ],
11821
+ "summary": "Deactivate a signing key for a connection agent",
11822
+ "description": "Deactivates the signing key for an agent provisioned on the connection.\nWhen multiple agents exist, pass `agent_id` query param. plt_ auth only.\n",
11823
+ "operationId": "deactivateConnectionSigningKey",
11824
+ "security": [
11825
+ {
11826
+ "BearerAuth": []
11827
+ }
11828
+ ],
11829
+ "parameters": [
11830
+ {
11831
+ "in": "path",
11832
+ "name": "connectionId",
11833
+ "required": true,
11834
+ "schema": {
11835
+ "type": "string",
11836
+ "format": "uuid"
11837
+ }
11838
+ },
11839
+ {
11840
+ "in": "path",
11841
+ "name": "chain",
11842
+ "required": true,
11421
11843
  "schema": {
11422
- "type": "integer",
11423
- "default": 50
11844
+ "type": "string"
11424
11845
  }
11425
11846
  },
11426
11847
  {
11427
- "name": "offset",
11428
11848
  "in": "query",
11849
+ "name": "agent_id",
11429
11850
  "required": false,
11430
11851
  "schema": {
11431
- "type": "integer",
11432
- "default": 0
11852
+ "type": "string",
11853
+ "format": "uuid"
11433
11854
  }
11434
11855
  }
11435
11856
  ],
11436
11857
  "responses": {
11437
- "200": {
11438
- "description": "Connection-scoped approvals",
11439
- "content": {
11440
- "application/json": {
11441
- "schema": {
11442
- "$ref": "#/components/schemas/ApprovalListResponse"
11443
- }
11444
- }
11445
- }
11858
+ "204": {
11859
+ "description": "Key deactivated"
11860
+ },
11861
+ "400": {
11862
+ "description": "Multiple agents — agent_id required"
11446
11863
  },
11447
11864
  "404": {
11448
11865
  "$ref": "#/components/responses/NotFound"
@@ -11450,13 +11867,14 @@
11450
11867
  }
11451
11868
  }
11452
11869
  },
11453
- "/v1/platform/connections/{connectionId}/approvals/{approvalId}": {
11454
- "get": {
11870
+ "/v1/platform/connections/{connectionId}/runtimes": {
11871
+ "post": {
11455
11872
  "tags": [
11456
11873
  "Platform"
11457
11874
  ],
11458
- "summary": "Get a connection-scoped approval",
11459
- "operationId": "getConnectionApproval",
11875
+ "summary": "Create a runtime for a connection agent",
11876
+ "description": "Creates a Cloud Runtime in the end-user's org for an agent on this connection.\nUse instead of `POST /v1/runtimes` with a plt_ key (which resolves to the platform org).\nApp must verify user intent out-of-band (e.g. wallet mandate) before calling.\n",
11877
+ "operationId": "createConnectionRuntime",
11460
11878
  "security": [
11461
11879
  {
11462
11880
  "BearerAuth": []
@@ -11471,42 +11889,46 @@
11471
11889
  "type": "string",
11472
11890
  "format": "uuid"
11473
11891
  }
11474
- },
11475
- {
11476
- "in": "path",
11477
- "name": "approvalId",
11478
- "required": true,
11479
- "schema": {
11480
- "type": "string",
11481
- "format": "uuid"
11482
- }
11483
11892
  }
11484
11893
  ],
11894
+ "requestBody": {
11895
+ "required": true,
11896
+ "content": {
11897
+ "application/json": {
11898
+ "schema": {
11899
+ "$ref": "#/components/schemas/CreateConnectionRuntimeRequest"
11900
+ }
11901
+ }
11902
+ }
11903
+ },
11485
11904
  "responses": {
11486
- "200": {
11487
- "description": "Approval detail",
11905
+ "201": {
11906
+ "description": "Runtime created",
11488
11907
  "content": {
11489
11908
  "application/json": {
11490
11909
  "schema": {
11491
- "$ref": "#/components/schemas/ApprovalResponse"
11910
+ "$ref": "#/components/schemas/RuntimeResponse"
11492
11911
  }
11493
11912
  }
11494
11913
  }
11495
11914
  },
11915
+ "403": {
11916
+ "$ref": "#/components/responses/Forbidden"
11917
+ },
11496
11918
  "404": {
11497
11919
  "$ref": "#/components/responses/NotFound"
11498
11920
  }
11499
11921
  }
11500
11922
  }
11501
11923
  },
11502
- "/v1/platform/connections/{connectionId}/pending-approvals": {
11503
- "get": {
11924
+ "/v1/platform/connections/{connectionId}/agents/{agentId}/chat": {
11925
+ "post": {
11504
11926
  "tags": [
11505
11927
  "Platform"
11506
11928
  ],
11507
- "summary": "List pending consensus approvals for a connection",
11508
- "description": "Returns pending approvals for agents provisioned on the connection,\nincluding `action_payload` and `payload_hash` for consensus UX.\nRequires plt_ platform auth.\n",
11509
- "operationId": "listConnectionPendingApprovals",
11929
+ "summary": "Chat with a connection agent (plt_ scoped)",
11930
+ "description": "Send a chat message to an agent provisioned on this connection, acting as the\nconnected end-user. Use instead of `POST /v1/agents/{id}/chat` with a plt_ key.\n",
11931
+ "operationId": "connectionAgentChat",
11510
11932
  "security": [
11511
11933
  {
11512
11934
  "BearerAuth": []
@@ -11523,40 +11945,31 @@
11523
11945
  }
11524
11946
  },
11525
11947
  {
11526
- "name": "status",
11527
- "in": "query",
11948
+ "in": "path",
11949
+ "name": "agentId",
11950
+ "required": true,
11528
11951
  "schema": {
11529
11952
  "type": "string",
11530
- "default": "pending"
11531
- }
11532
- },
11533
- {
11534
- "name": "limit",
11535
- "in": "query",
11536
- "schema": {
11537
- "type": "integer",
11538
- "default": 50
11539
- }
11540
- },
11541
- {
11542
- "name": "offset",
11543
- "in": "query",
11544
- "schema": {
11545
- "type": "integer",
11546
- "default": 0
11953
+ "format": "uuid"
11547
11954
  }
11548
11955
  }
11549
11956
  ],
11550
- "responses": {
11551
- "200": {
11552
- "description": "Pending approvals list",
11553
- "content": {
11554
- "application/json": {
11555
- "schema": {
11556
- "$ref": "#/components/schemas/PendingApprovalListResponse"
11557
- }
11957
+ "requestBody": {
11958
+ "required": true,
11959
+ "content": {
11960
+ "application/json": {
11961
+ "schema": {
11962
+ "$ref": "#/components/schemas/SendChatMessageRequest"
11558
11963
  }
11559
11964
  }
11965
+ }
11966
+ },
11967
+ "responses": {
11968
+ "200": {
11969
+ "description": "Message sent (JSON or SSE stream)"
11970
+ },
11971
+ "403": {
11972
+ "$ref": "#/components/responses/Forbidden"
11560
11973
  },
11561
11974
  "404": {
11562
11975
  "$ref": "#/components/responses/NotFound"
@@ -14121,6 +14534,61 @@
14121
14534
  }
14122
14535
  }
14123
14536
  },
14537
+ "/v1/agents/{agent_id}/automations": {
14538
+ "post": {
14539
+ "tags": [
14540
+ "Automations"
14541
+ ],
14542
+ "summary": "Create agent automation (agent-only)",
14543
+ "operationId": "createAgentAutomation",
14544
+ "description": "Agent-scoped create for simple manual or webhook automations from chat/runtime tools.\nAllowed step types: log, notify, memory_get, memory_put, wait (max 10).\nCron, swap, http, and transaction steps require human dashboard setup.\nRequires agent JWT; agent_id in path must match the caller.\n",
14545
+ "parameters": [
14546
+ {
14547
+ "name": "agent_id",
14548
+ "in": "path",
14549
+ "required": true,
14550
+ "schema": {
14551
+ "type": "string",
14552
+ "format": "uuid"
14553
+ }
14554
+ }
14555
+ ],
14556
+ "requestBody": {
14557
+ "required": true,
14558
+ "content": {
14559
+ "application/json": {
14560
+ "schema": {
14561
+ "$ref": "#/components/schemas/AgentCreateAutomationRequest"
14562
+ }
14563
+ }
14564
+ }
14565
+ },
14566
+ "responses": {
14567
+ "201": {
14568
+ "description": "Automation created (includes one-time webhook credentials when trigger_type is webhook)",
14569
+ "content": {
14570
+ "application/json": {
14571
+ "schema": {
14572
+ "$ref": "#/components/schemas/AutomationCreatedResponse"
14573
+ }
14574
+ }
14575
+ }
14576
+ },
14577
+ "400": {
14578
+ "$ref": "#/components/responses/BadRequest"
14579
+ },
14580
+ "401": {
14581
+ "$ref": "#/components/responses/Unauthorized"
14582
+ },
14583
+ "403": {
14584
+ "$ref": "#/components/responses/Forbidden"
14585
+ },
14586
+ "404": {
14587
+ "$ref": "#/components/responses/NotFound"
14588
+ }
14589
+ }
14590
+ }
14591
+ },
14124
14592
  "/v1/runtimes": {
14125
14593
  "post": {
14126
14594
  "tags": [
@@ -26806,6 +27274,20 @@
26806
27274
  "format": "uuid"
26807
27275
  }
26808
27276
  },
27277
+ "runtime_ids": {
27278
+ "type": "array",
27279
+ "items": {
27280
+ "type": "string",
27281
+ "format": "uuid"
27282
+ }
27283
+ },
27284
+ "automation_ids": {
27285
+ "type": "array",
27286
+ "items": {
27287
+ "type": "string",
27288
+ "format": "uuid"
27289
+ }
27290
+ },
26809
27291
  "claimed_at": {
26810
27292
  "type": "string",
26811
27293
  "format": "date-time",
@@ -28137,6 +28619,48 @@
28137
28619
  }
28138
28620
  }
28139
28621
  },
28622
+ "AgentCreateAutomationRequest": {
28623
+ "type": "object",
28624
+ "required": [
28625
+ "name",
28626
+ "workflow_spec"
28627
+ ],
28628
+ "description": "Agent-scoped automation create. Defaults to manual trigger.\nworkflow_spec must use only agent-allowed step types (log, notify, memory_get, memory_put, wait).\n",
28629
+ "properties": {
28630
+ "name": {
28631
+ "type": "string",
28632
+ "maxLength": 128
28633
+ },
28634
+ "trigger_type": {
28635
+ "type": "string",
28636
+ "enum": [
28637
+ "manual",
28638
+ "webhook"
28639
+ ],
28640
+ "default": "manual"
28641
+ },
28642
+ "workflow_spec": {
28643
+ "oneOf": [
28644
+ {
28645
+ "type": "array",
28646
+ "items": {
28647
+ "type": "object",
28648
+ "additionalProperties": true
28649
+ }
28650
+ },
28651
+ {
28652
+ "type": "object",
28653
+ "additionalProperties": true
28654
+ }
28655
+ ]
28656
+ },
28657
+ "auto_trigger": {
28658
+ "type": "boolean",
28659
+ "default": false,
28660
+ "description": "When true (manual trigger only), start a run immediately after creation"
28661
+ }
28662
+ }
28663
+ },
28140
28664
  "UpdateAutomationRequest": {
28141
28665
  "type": "object",
28142
28666
  "properties": {
@@ -28269,6 +28793,14 @@
28269
28793
  "nullable": true,
28270
28794
  "description": "Resolved agent display name (enriched list field)"
28271
28795
  },
28796
+ "created_by_type": {
28797
+ "type": "string",
28798
+ "enum": [
28799
+ "user",
28800
+ "agent"
28801
+ ],
28802
+ "description": "Whether the automation was created by a human or agent (chat-native create)"
28803
+ },
28272
28804
  "created_at": {
28273
28805
  "type": "string",
28274
28806
  "format": "date-time"
@@ -28498,6 +29030,48 @@
28498
29030
  }
28499
29031
  }
28500
29032
  },
29033
+ "CreateConnectionRuntimeRequest": {
29034
+ "type": "object",
29035
+ "required": [
29036
+ "name"
29037
+ ],
29038
+ "properties": {
29039
+ "name": {
29040
+ "type": "string"
29041
+ },
29042
+ "agent_id": {
29043
+ "type": "string",
29044
+ "format": "uuid",
29045
+ "description": "Required when multiple agents on the connection; defaults to sole agent"
29046
+ },
29047
+ "template": {
29048
+ "type": "string"
29049
+ },
29050
+ "preset": {
29051
+ "type": "string",
29052
+ "default": "medium"
29053
+ },
29054
+ "env_public": {
29055
+ "type": "object",
29056
+ "additionalProperties": true
29057
+ },
29058
+ "idle_timeout_secs": {
29059
+ "type": "integer"
29060
+ },
29061
+ "expose_http": {
29062
+ "type": "boolean"
29063
+ },
29064
+ "slug": {
29065
+ "type": "string"
29066
+ },
29067
+ "inbound_auth": {
29068
+ "type": "string"
29069
+ },
29070
+ "startup_command": {
29071
+ "type": "string"
29072
+ }
29073
+ }
29074
+ },
28501
29075
  "CreateRuntimeRequest": {
28502
29076
  "type": "object",
28503
29077
  "required": [
@@ -31272,7 +31846,9 @@
31272
31846
  "type": "string",
31273
31847
  "enum": [
31274
31848
  "approve",
31275
- "reject"
31849
+ "reject",
31850
+ "approved",
31851
+ "rejected"
31276
31852
  ]
31277
31853
  },
31278
31854
  "payload_hash": {
package/openapi.yaml CHANGED
@@ -6425,6 +6425,35 @@ paths:
6425
6425
  $ref: "#/components/schemas/PlatformTemplateResponse"
6426
6426
 
6427
6427
  /v1/platform/apps/{appId}/templates/{template_id}:
6428
+ get:
6429
+ tags: [Platform]
6430
+ summary: Get a bootstrap template
6431
+ description: Returns the full template spec for a platform app. plt_ or user JWT.
6432
+ operationId: getPlatformTemplate
6433
+ security:
6434
+ - BearerAuth: []
6435
+ parameters:
6436
+ - in: path
6437
+ name: appId
6438
+ required: true
6439
+ schema:
6440
+ type: string
6441
+ format: uuid
6442
+ - in: path
6443
+ name: template_id
6444
+ required: true
6445
+ schema:
6446
+ type: string
6447
+ format: uuid
6448
+ responses:
6449
+ "200":
6450
+ description: Template details
6451
+ content:
6452
+ application/json:
6453
+ schema:
6454
+ $ref: "#/components/schemas/PlatformTemplateResponse"
6455
+ "404":
6456
+ $ref: "#/components/responses/NotFound"
6428
6457
  patch:
6429
6458
  tags: [Platform]
6430
6459
  summary: Update a bootstrap template
@@ -7246,9 +7275,10 @@ paths:
7246
7275
  tags: [Platform]
7247
7276
  summary: Set per-user spend policy override
7248
7277
  description: |
7249
- Override the app-wide spend policy for a specific connected user. This
7250
- policy takes precedence over the app default. Remove by deleting the
7251
- connection-level policy.
7278
+ Replace the per-user spend policy for a connected user (deactivates the
7279
+ previous active row, then inserts). Requires plt_ platform auth.
7280
+ Optional `Idempotency-Key` header must cover the full request body — reusing
7281
+ the same key with different parameters returns 409.
7252
7282
  operationId: setUserSpendPolicy
7253
7283
  security:
7254
7284
  - BearerAuth: []
@@ -7416,6 +7446,243 @@ paths:
7416
7446
  "404":
7417
7447
  $ref: "#/components/responses/NotFound"
7418
7448
 
7449
+ /v1/platform/connections/{connectionId}/pending-approvals/{approvalId}:
7450
+ get:
7451
+ tags: [Platform]
7452
+ summary: Get a connection-scoped pending approval (with payload_hash)
7453
+ operationId: getConnectionPendingApproval
7454
+ security:
7455
+ - BearerAuth: []
7456
+ parameters:
7457
+ - in: path
7458
+ name: connectionId
7459
+ required: true
7460
+ schema:
7461
+ type: string
7462
+ format: uuid
7463
+ - in: path
7464
+ name: approvalId
7465
+ required: true
7466
+ schema:
7467
+ type: string
7468
+ format: uuid
7469
+ responses:
7470
+ "200":
7471
+ description: Pending approval detail including action_payload and payload_hash
7472
+ content:
7473
+ application/json:
7474
+ schema:
7475
+ $ref: "#/components/schemas/PendingApprovalResponse"
7476
+ "404":
7477
+ $ref: "#/components/responses/NotFound"
7478
+
7479
+ /v1/platform/connections/{connectionId}/pending-approvals/{approvalId}/decide:
7480
+ post:
7481
+ tags: [Platform]
7482
+ summary: Decide a pending approval for a connection user
7483
+ description: |
7484
+ Platform apps vote on behalf of the connected user after verifying intent
7485
+ out-of-band (e.g. wallet mandate). Requires `payload_hash` matching the
7486
+ pending row. Accepts `decision`: `approve` or `reject` (aliases `approved` /
7487
+ `rejected`). plt_ auth only; scoped to agents on the connection.
7488
+ operationId: decideConnectionPendingApproval
7489
+ security:
7490
+ - BearerAuth: []
7491
+ parameters:
7492
+ - in: path
7493
+ name: connectionId
7494
+ required: true
7495
+ schema:
7496
+ type: string
7497
+ format: uuid
7498
+ - in: path
7499
+ name: approvalId
7500
+ required: true
7501
+ schema:
7502
+ type: string
7503
+ format: uuid
7504
+ requestBody:
7505
+ required: true
7506
+ content:
7507
+ application/json:
7508
+ schema:
7509
+ $ref: "#/components/schemas/ApprovePendingApprovalRequest"
7510
+ responses:
7511
+ "200":
7512
+ description: Updated pending approval
7513
+ content:
7514
+ application/json:
7515
+ schema:
7516
+ $ref: "#/components/schemas/PendingApprovalResponse"
7517
+ "400":
7518
+ $ref: "#/components/responses/BadRequest"
7519
+ "403":
7520
+ $ref: "#/components/responses/Forbidden"
7521
+ "404":
7522
+ $ref: "#/components/responses/NotFound"
7523
+ "409":
7524
+ description: Already voted
7525
+
7526
+ /v1/platform/connections/{connectionId}/approvals/{approvalId}/decide:
7527
+ post:
7528
+ tags: [Platform]
7529
+ summary: Decide a mobile/agent approval for a connection user
7530
+ description: |
7531
+ Platform apps decide agent approval requests on behalf of the connected user.
7532
+ Accepts `decision`: `approved` or `rejected` (aliases `approve` / `reject`).
7533
+ plt_ auth only.
7534
+ operationId: decideConnectionApproval
7535
+ security:
7536
+ - BearerAuth: []
7537
+ parameters:
7538
+ - in: path
7539
+ name: connectionId
7540
+ required: true
7541
+ schema:
7542
+ type: string
7543
+ format: uuid
7544
+ - in: path
7545
+ name: approvalId
7546
+ required: true
7547
+ schema:
7548
+ type: string
7549
+ format: uuid
7550
+ requestBody:
7551
+ required: true
7552
+ content:
7553
+ application/json:
7554
+ schema:
7555
+ type: object
7556
+ required: [decision]
7557
+ properties:
7558
+ decision:
7559
+ type: string
7560
+ enum: [approved, rejected, approve, reject]
7561
+ reason:
7562
+ type: string
7563
+ responses:
7564
+ "200":
7565
+ description: Decided approval
7566
+ content:
7567
+ application/json:
7568
+ schema:
7569
+ $ref: "#/components/schemas/ApprovalResponse"
7570
+ "403":
7571
+ $ref: "#/components/responses/Forbidden"
7572
+ "404":
7573
+ $ref: "#/components/responses/NotFound"
7574
+ "409":
7575
+ description: Already decided
7576
+
7577
+ /v1/platform/connections/{connectionId}/signing-keys/{chain}:
7578
+ delete:
7579
+ tags: [Platform]
7580
+ summary: Deactivate a signing key for a connection agent
7581
+ description: |
7582
+ Deactivates the signing key for an agent provisioned on the connection.
7583
+ When multiple agents exist, pass `agent_id` query param. plt_ auth only.
7584
+ operationId: deactivateConnectionSigningKey
7585
+ security:
7586
+ - BearerAuth: []
7587
+ parameters:
7588
+ - in: path
7589
+ name: connectionId
7590
+ required: true
7591
+ schema:
7592
+ type: string
7593
+ format: uuid
7594
+ - in: path
7595
+ name: chain
7596
+ required: true
7597
+ schema:
7598
+ type: string
7599
+ - in: query
7600
+ name: agent_id
7601
+ required: false
7602
+ schema:
7603
+ type: string
7604
+ format: uuid
7605
+ responses:
7606
+ "204":
7607
+ description: Key deactivated
7608
+ "400":
7609
+ description: Multiple agents — agent_id required
7610
+ "404":
7611
+ $ref: "#/components/responses/NotFound"
7612
+
7613
+ /v1/platform/connections/{connectionId}/runtimes:
7614
+ post:
7615
+ tags: [Platform]
7616
+ summary: Create a runtime for a connection agent
7617
+ description: |
7618
+ Creates a Cloud Runtime in the end-user's org for an agent on this connection.
7619
+ Use instead of `POST /v1/runtimes` with a plt_ key (which resolves to the platform org).
7620
+ App must verify user intent out-of-band (e.g. wallet mandate) before calling.
7621
+ operationId: createConnectionRuntime
7622
+ security:
7623
+ - BearerAuth: []
7624
+ parameters:
7625
+ - in: path
7626
+ name: connectionId
7627
+ required: true
7628
+ schema:
7629
+ type: string
7630
+ format: uuid
7631
+ requestBody:
7632
+ required: true
7633
+ content:
7634
+ application/json:
7635
+ schema:
7636
+ $ref: "#/components/schemas/CreateConnectionRuntimeRequest"
7637
+ responses:
7638
+ "201":
7639
+ description: Runtime created
7640
+ content:
7641
+ application/json:
7642
+ schema:
7643
+ $ref: "#/components/schemas/RuntimeResponse"
7644
+ "403":
7645
+ $ref: "#/components/responses/Forbidden"
7646
+ "404":
7647
+ $ref: "#/components/responses/NotFound"
7648
+
7649
+ /v1/platform/connections/{connectionId}/agents/{agentId}/chat:
7650
+ post:
7651
+ tags: [Platform]
7652
+ summary: Chat with a connection agent (plt_ scoped)
7653
+ description: |
7654
+ Send a chat message to an agent provisioned on this connection, acting as the
7655
+ connected end-user. Use instead of `POST /v1/agents/{id}/chat` with a plt_ key.
7656
+ operationId: connectionAgentChat
7657
+ security:
7658
+ - BearerAuth: []
7659
+ parameters:
7660
+ - in: path
7661
+ name: connectionId
7662
+ required: true
7663
+ schema:
7664
+ type: string
7665
+ format: uuid
7666
+ - in: path
7667
+ name: agentId
7668
+ required: true
7669
+ schema:
7670
+ type: string
7671
+ format: uuid
7672
+ requestBody:
7673
+ required: true
7674
+ content:
7675
+ application/json:
7676
+ schema:
7677
+ $ref: "#/components/schemas/SendChatMessageRequest"
7678
+ responses:
7679
+ "200":
7680
+ description: Message sent (JSON or SSE stream)
7681
+ "403":
7682
+ $ref: "#/components/responses/Forbidden"
7683
+ "404":
7684
+ $ref: "#/components/responses/NotFound"
7685
+
7419
7686
  # --- Approvals ---
7420
7687
 
7421
7688
  /v1/approvals:
@@ -8994,6 +9261,45 @@ paths:
8994
9261
  schema:
8995
9262
  $ref: "#/components/schemas/AutomationPresetsResponse"
8996
9263
 
9264
+ /v1/agents/{agent_id}/automations:
9265
+ post:
9266
+ tags: [Automations]
9267
+ summary: Create agent automation (agent-only)
9268
+ operationId: createAgentAutomation
9269
+ description: |
9270
+ Agent-scoped create for simple manual or webhook automations from chat/runtime tools.
9271
+ Allowed step types: log, notify, memory_get, memory_put, wait (max 10).
9272
+ Cron, swap, http, and transaction steps require human dashboard setup.
9273
+ Requires agent JWT; agent_id in path must match the caller.
9274
+ parameters:
9275
+ - name: agent_id
9276
+ in: path
9277
+ required: true
9278
+ schema:
9279
+ type: string
9280
+ format: uuid
9281
+ requestBody:
9282
+ required: true
9283
+ content:
9284
+ application/json:
9285
+ schema:
9286
+ $ref: "#/components/schemas/AgentCreateAutomationRequest"
9287
+ responses:
9288
+ "201":
9289
+ description: Automation created (includes one-time webhook credentials when trigger_type is webhook)
9290
+ content:
9291
+ application/json:
9292
+ schema:
9293
+ $ref: "#/components/schemas/AutomationCreatedResponse"
9294
+ "400":
9295
+ $ref: "#/components/responses/BadRequest"
9296
+ "401":
9297
+ $ref: "#/components/responses/Unauthorized"
9298
+ "403":
9299
+ $ref: "#/components/responses/Forbidden"
9300
+ "404":
9301
+ $ref: "#/components/responses/NotFound"
9302
+
8997
9303
  # ---------------------------------------------------------------------------
8998
9304
  # Runtimes
8999
9305
  # ---------------------------------------------------------------------------
@@ -17654,6 +17960,16 @@ components:
17654
17960
  items:
17655
17961
  type: string
17656
17962
  format: uuid
17963
+ runtime_ids:
17964
+ type: array
17965
+ items:
17966
+ type: string
17967
+ format: uuid
17968
+ automation_ids:
17969
+ type: array
17970
+ items:
17971
+ type: string
17972
+ format: uuid
17657
17973
  claimed_at:
17658
17974
  type: string
17659
17975
  format: date-time
@@ -18502,6 +18818,33 @@ components:
18502
18818
  - type: object
18503
18819
  additionalProperties: true
18504
18820
 
18821
+ AgentCreateAutomationRequest:
18822
+ type: object
18823
+ required: [name, workflow_spec]
18824
+ description: |
18825
+ Agent-scoped automation create. Defaults to manual trigger.
18826
+ workflow_spec must use only agent-allowed step types (log, notify, memory_get, memory_put, wait).
18827
+ properties:
18828
+ name:
18829
+ type: string
18830
+ maxLength: 128
18831
+ trigger_type:
18832
+ type: string
18833
+ enum: [manual, webhook]
18834
+ default: manual
18835
+ workflow_spec:
18836
+ oneOf:
18837
+ - type: array
18838
+ items:
18839
+ type: object
18840
+ additionalProperties: true
18841
+ - type: object
18842
+ additionalProperties: true
18843
+ auto_trigger:
18844
+ type: boolean
18845
+ default: false
18846
+ description: When true (manual trigger only), start a run immediately after creation
18847
+
18505
18848
  UpdateAutomationRequest:
18506
18849
  type: object
18507
18850
  properties:
@@ -18585,6 +18928,10 @@ components:
18585
18928
  type: string
18586
18929
  nullable: true
18587
18930
  description: Resolved agent display name (enriched list field)
18931
+ created_by_type:
18932
+ type: string
18933
+ enum: [user, agent]
18934
+ description: Whether the automation was created by a human or agent (chat-native create)
18588
18935
  created_at:
18589
18936
  type: string
18590
18937
  format: date-time
@@ -18730,6 +19077,35 @@ components:
18730
19077
 
18731
19078
  # --- Runtimes ---
18732
19079
 
19080
+ CreateConnectionRuntimeRequest:
19081
+ type: object
19082
+ required: [name]
19083
+ properties:
19084
+ name:
19085
+ type: string
19086
+ agent_id:
19087
+ type: string
19088
+ format: uuid
19089
+ description: Required when multiple agents on the connection; defaults to sole agent
19090
+ template:
19091
+ type: string
19092
+ preset:
19093
+ type: string
19094
+ default: medium
19095
+ env_public:
19096
+ type: object
19097
+ additionalProperties: true
19098
+ idle_timeout_secs:
19099
+ type: integer
19100
+ expose_http:
19101
+ type: boolean
19102
+ slug:
19103
+ type: string
19104
+ inbound_auth:
19105
+ type: string
19106
+ startup_command:
19107
+ type: string
19108
+
18733
19109
  CreateRuntimeRequest:
18734
19110
  type: object
18735
19111
  required: [name, agent_id]
@@ -20628,7 +21004,7 @@ components:
20628
21004
  properties:
20629
21005
  decision:
20630
21006
  type: string
20631
- enum: [approve, reject]
21007
+ enum: [approve, reject, approved, rejected]
20632
21008
  payload_hash:
20633
21009
  type: string
20634
21010
  reason:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1claw/openapi-spec",
3
- "version": "0.58.0",
3
+ "version": "0.58.2",
4
4
  "description": "OpenAPI 3.1.0 specification for the 1Claw Vault API — generate clients in any language",
5
5
  "license": "MIT",
6
6
  "repository": {