weft-sdk 0.3.0 → 0.6.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.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/docs/ApiKeyListResponse.md +3 -1
  3. data/docs/BalanceApi.md +74 -0
  4. data/docs/BalanceResponse.md +26 -0
  5. data/docs/DefaultApi.md +12 -12
  6. data/docs/Error.md +7 -7
  7. data/docs/FetchApi.md +77 -0
  8. data/docs/FetchBalanceSnapshot.md +22 -0
  9. data/docs/FetchErrorResponse.md +26 -0
  10. data/docs/FetchRequest.md +26 -0
  11. data/docs/FetchRequestBody.md +49 -0
  12. data/docs/FetchResponse.md +30 -0
  13. data/docs/Merchant.md +24 -0
  14. data/docs/PromoBalance.md +22 -0
  15. data/docs/SearchAgentCard.md +34 -0
  16. data/docs/SearchApi.md +77 -0
  17. data/docs/SearchEndpoints.md +24 -0
  18. data/docs/SearchErrorResponse.md +20 -0
  19. data/docs/SearchFilters.md +26 -0
  20. data/docs/SearchPricing.md +24 -0
  21. data/docs/SearchRanking.md +26 -0
  22. data/docs/SearchRequest.md +22 -0
  23. data/docs/SearchResponse.md +26 -0
  24. data/docs/SearchResult.md +36 -0
  25. data/docs/SearchSkill.md +36 -0
  26. data/docs/SearchSkillEndpoint.md +20 -0
  27. data/docs/SpendingPolicy.md +22 -0
  28. data/docs/Wallet.md +22 -0
  29. data/lib/weft/generated/api/account_api.rb +2 -2
  30. data/lib/weft/generated/api/api_keys_api.rb +2 -2
  31. data/lib/weft/generated/api/auth_api.rb +2 -2
  32. data/lib/weft/generated/api/balance_api.rb +79 -0
  33. data/lib/weft/generated/api/default_api.rb +11 -11
  34. data/lib/weft/generated/api/fetch_api.rb +90 -0
  35. data/lib/weft/generated/api/payments_api.rb +2 -2
  36. data/lib/weft/generated/api/search_api.rb +90 -0
  37. data/lib/weft/generated/api_client.rb +2 -2
  38. data/lib/weft/generated/api_error.rb +2 -2
  39. data/lib/weft/generated/api_model_base.rb +2 -2
  40. data/lib/weft/generated/configuration.rb +2 -2
  41. data/lib/weft/generated/models/account_details.rb +2 -2
  42. data/lib/weft/generated/models/api_key.rb +2 -2
  43. data/lib/weft/generated/models/api_key_created.rb +2 -2
  44. data/lib/weft/generated/models/api_key_created_response.rb +2 -2
  45. data/lib/weft/generated/models/api_key_list_response.rb +32 -6
  46. data/lib/weft/generated/models/auth_response.rb +2 -2
  47. data/lib/weft/generated/models/auth_response_data.rb +2 -2
  48. data/lib/weft/generated/models/balance_response.rb +271 -0
  49. data/lib/weft/generated/models/confirm_request.rb +2 -2
  50. data/lib/weft/generated/models/create_api_key_request.rb +2 -2
  51. data/lib/weft/generated/models/error.rb +7 -2
  52. data/lib/weft/generated/models/error_response.rb +3 -2
  53. data/lib/weft/generated/models/fetch_balance_snapshot.rb +217 -0
  54. data/lib/weft/generated/models/fetch_error_response.rb +298 -0
  55. data/lib/weft/generated/models/fetch_request.rb +266 -0
  56. data/lib/weft/generated/models/fetch_request_body.rb +105 -0
  57. data/lib/weft/generated/models/fetch_response.rb +330 -0
  58. data/lib/weft/generated/models/me_response.rb +2 -2
  59. data/lib/weft/generated/models/merchant.rb +264 -0
  60. data/lib/weft/generated/models/message_response.rb +2 -2
  61. data/lib/weft/generated/models/message_response_data.rb +2 -2
  62. data/lib/weft/generated/models/pagination.rb +2 -2
  63. data/lib/weft/generated/models/password_reset_request.rb +2 -2
  64. data/lib/weft/generated/models/password_update_request.rb +2 -2
  65. data/lib/weft/generated/models/payment.rb +2 -2
  66. data/lib/weft/generated/models/payment_list_response.rb +2 -2
  67. data/lib/weft/generated/models/payment_response.rb +2 -2
  68. data/lib/weft/generated/models/promo_balance.rb +218 -0
  69. data/lib/weft/generated/models/resend_confirmation_request.rb +2 -2
  70. data/lib/weft/generated/models/search_agent_card.rb +228 -0
  71. data/lib/weft/generated/models/{agent_stats.rb → search_endpoints.rb} +33 -57
  72. data/lib/weft/generated/models/search_error_response.rb +202 -0
  73. data/lib/weft/generated/models/search_filters.rb +277 -0
  74. data/lib/weft/generated/models/search_pricing.rb +232 -0
  75. data/lib/weft/generated/models/search_ranking.rb +277 -0
  76. data/lib/weft/generated/models/search_request.rb +223 -0
  77. data/lib/weft/generated/models/{agent_response.rb → search_response.rb} +64 -21
  78. data/lib/weft/generated/models/search_result.rb +414 -0
  79. data/lib/weft/generated/models/search_skill.rb +259 -0
  80. data/lib/weft/generated/models/{agent_list_response.rb → search_skill_endpoint.rb} +19 -54
  81. data/lib/weft/generated/models/sign_in_request.rb +2 -2
  82. data/lib/weft/generated/models/sign_up_request.rb +2 -2
  83. data/lib/weft/generated/models/spending_policy.rb +219 -0
  84. data/lib/weft/generated/models/user.rb +2 -2
  85. data/lib/weft/generated/models/wallet.rb +219 -0
  86. data/lib/weft/generated/version.rb +3 -3
  87. data/lib/weft/sdk.rb +1 -1
  88. metadata +50 -12
  89. data/docs/Agent.md +0 -38
  90. data/docs/AgentListResponse.md +0 -20
  91. data/docs/AgentResponse.md +0 -18
  92. data/docs/AgentStats.md +0 -30
  93. data/docs/AgentsApi.md +0 -147
  94. data/lib/weft/generated/api/agents_api.rb +0 -148
  95. data/lib/weft/generated/models/agent.rb +0 -417
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e775cf997288fdba0aa7f683151c65e424094c00372d8c9e5d2ea208b3bc612c
4
- data.tar.gz: 1d3037ce451839110db577f5868e46da4752f3747e2f3127efc0a1c9056077a6
3
+ metadata.gz: 2e058e7cf838e956dce96d330b50c6b1cf78bdcd0d1a2448343e3211141a8a1c
4
+ data.tar.gz: 0ebc49eccbf10a9253303c7db8a17f824a75e8ca5fdc33d2dc9f78b5772447cf
5
5
  SHA512:
6
- metadata.gz: 5c3280da4ac8d59787603f338d18d467f63c232a8d4822f403932e7358fc5037c398ece7d680eb629a6e34f4a67699c235786700d38a681393cb9844fd6d9942
7
- data.tar.gz: 63acc6a32fede26c10ef7ba55b759d8a90924857b225baf40ead7eed36105e25a81b7ad39d7a2d64911b26c6dc90bd9d9df4ee5ea4ab2b3df359a093d5e60735
6
+ metadata.gz: 15dad9aa192c0489e4c49102504ef2b49ce113de6f27e5e901f97c75cb24fd4cd34b9260ddb0818e931da7c71fb91b439e74fcc181bb770caf71aa6becb21056
7
+ data.tar.gz: dee0eef998b860af12b5aea5e0e950266e0549bb68b0509e76ece7d66f0d1ed90e177a427ee3a62db024ae2ec1e441a3300fd9f5e8edc7bba574db3e46236d32
@@ -5,6 +5,7 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **data** | [**Array<ApiKey>**](ApiKey.md) | | |
8
+ | **pagination** | [**Pagination**](Pagination.md) | | |
8
9
 
9
10
  ## Example
10
11
 
@@ -12,7 +13,8 @@
12
13
  require 'weft-sdk'
13
14
 
14
15
  instance = Weft::ApiKeyListResponse.new(
15
- data: null
16
+ data: null,
17
+ pagination: null
16
18
  )
17
19
  ```
18
20
 
@@ -0,0 +1,74 @@
1
+ # Weft::BalanceApi
2
+
3
+ All URIs are relative to *https://api.weftlabs.com*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**get_balance**](BalanceApi.md#get_balance) | **GET** /api/v1/balance | Get wallet, spending policy, and current-window spend |
8
+
9
+
10
+ ## get_balance
11
+
12
+ > <BalanceResponse> get_balance
13
+
14
+ Get wallet, spending policy, and current-window spend
15
+
16
+ Read-only snapshot for the buyer behind the bearer token. The response always includes a `promo` block — values are zero in v1 and fill in once the freemium promo ledger ships, without a shape change. `wallet.balance_usdc` is fetched live from Privy; if Privy is unreachable the field returns `\"0.00\"` rather than erroring the whole call. Account-scoped: the bearer must be a buyer-scoped API key.
17
+
18
+ ### Examples
19
+
20
+ ```ruby
21
+ require 'time'
22
+ require 'weft-sdk'
23
+ # setup authorization
24
+ Weft.configure do |config|
25
+ # Configure Bearer authorization (APIKey): bearerAuth
26
+ config.access_token = 'YOUR_BEARER_TOKEN'
27
+ end
28
+
29
+ api_instance = Weft::BalanceApi.new
30
+
31
+ begin
32
+ # Get wallet, spending policy, and current-window spend
33
+ result = api_instance.get_balance
34
+ p result
35
+ rescue Weft::ApiError => e
36
+ puts "Error when calling BalanceApi->get_balance: #{e}"
37
+ end
38
+ ```
39
+
40
+ #### Using the get_balance_with_http_info variant
41
+
42
+ This returns an Array which contains the response data, status code and headers.
43
+
44
+ > <Array(<BalanceResponse>, Integer, Hash)> get_balance_with_http_info
45
+
46
+ ```ruby
47
+ begin
48
+ # Get wallet, spending policy, and current-window spend
49
+ data, status_code, headers = api_instance.get_balance_with_http_info
50
+ p status_code # => 2xx
51
+ p headers # => { ... }
52
+ p data # => <BalanceResponse>
53
+ rescue Weft::ApiError => e
54
+ puts "Error when calling BalanceApi->get_balance_with_http_info: #{e}"
55
+ end
56
+ ```
57
+
58
+ ### Parameters
59
+
60
+ This endpoint does not need any parameter.
61
+
62
+ ### Return type
63
+
64
+ [**BalanceResponse**](BalanceResponse.md)
65
+
66
+ ### Authorization
67
+
68
+ [bearerAuth](../README.md#bearerAuth)
69
+
70
+ ### HTTP request headers
71
+
72
+ - **Content-Type**: Not defined
73
+ - **Accept**: application/json
74
+
@@ -0,0 +1,26 @@
1
+ # Weft::BalanceResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **promo** | [**PromoBalance**](PromoBalance.md) | | |
8
+ | **wallet** | [**Wallet**](Wallet.md) | | |
9
+ | **spent_today_usd** | **String** | USD spent in the current calendar day (UTC), 2dp. | |
10
+ | **spent_week_usd** | **String** | USD spent in the current calendar week (UTC, Monday start), 2dp. | |
11
+ | **policy** | [**SpendingPolicy**](SpendingPolicy.md) | | |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'weft-sdk'
17
+
18
+ instance = Weft::BalanceResponse.new(
19
+ promo: null,
20
+ wallet: null,
21
+ spent_today_usd: 0.42,
22
+ spent_week_usd: 3.10,
23
+ policy: null
24
+ )
25
+ ```
26
+
data/docs/DefaultApi.md CHANGED
@@ -4,14 +4,14 @@ All URIs are relative to *https://api.weftlabs.com*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
- | [**get_api_docs**](DefaultApi.md#get_api_docs) | **GET** /api/v1/docs | Fetch OpenAPI spec |
7
+ | [**get_open_api_document**](DefaultApi.md#get_open_api_document) | **GET** /docs/openapi.yaml | Fetch this OpenAPI document |
8
8
 
9
9
 
10
- ## get_api_docs
10
+ ## get_open_api_document
11
11
 
12
- > String get_api_docs
12
+ > String get_open_api_document
13
13
 
14
- Fetch OpenAPI spec
14
+ Fetch this OpenAPI document
15
15
 
16
16
  ### Examples
17
17
 
@@ -22,29 +22,29 @@ require 'weft-sdk'
22
22
  api_instance = Weft::DefaultApi.new
23
23
 
24
24
  begin
25
- # Fetch OpenAPI spec
26
- result = api_instance.get_api_docs
25
+ # Fetch this OpenAPI document
26
+ result = api_instance.get_open_api_document
27
27
  p result
28
28
  rescue Weft::ApiError => e
29
- puts "Error when calling DefaultApi->get_api_docs: #{e}"
29
+ puts "Error when calling DefaultApi->get_open_api_document: #{e}"
30
30
  end
31
31
  ```
32
32
 
33
- #### Using the get_api_docs_with_http_info variant
33
+ #### Using the get_open_api_document_with_http_info variant
34
34
 
35
35
  This returns an Array which contains the response data, status code and headers.
36
36
 
37
- > <Array(String, Integer, Hash)> get_api_docs_with_http_info
37
+ > <Array(String, Integer, Hash)> get_open_api_document_with_http_info
38
38
 
39
39
  ```ruby
40
40
  begin
41
- # Fetch OpenAPI spec
42
- data, status_code, headers = api_instance.get_api_docs_with_http_info
41
+ # Fetch this OpenAPI document
42
+ data, status_code, headers = api_instance.get_open_api_document_with_http_info
43
43
  p status_code # => 2xx
44
44
  p headers # => { ... }
45
45
  p data # => String
46
46
  rescue Weft::ApiError => e
47
- puts "Error when calling DefaultApi->get_api_docs_with_http_info: #{e}"
47
+ puts "Error when calling DefaultApi->get_open_api_document_with_http_info: #{e}"
48
48
  end
49
49
  ```
50
50
 
data/docs/Error.md CHANGED
@@ -4,10 +4,10 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **code** | **String** | | |
8
- | **message** | **String** | | |
9
- | **details** | **Object** | | [optional] |
10
- | **request_id** | **String** | | [optional] |
7
+ | **code** | **String** | Stable machine-readable error code (snake_case). | |
8
+ | **message** | **String** | Human-readable error description. | |
9
+ | **details** | **Object** | Optional structured context about the failure. | [optional] |
10
+ | **request_id** | **String** | Correlates with server logs; include when reporting bugs. | [optional] |
11
11
 
12
12
  ## Example
13
13
 
@@ -15,10 +15,10 @@
15
15
  require 'weft-sdk'
16
16
 
17
17
  instance = Weft::Error.new(
18
- code: null,
19
- message: null,
18
+ code: validation_failed,
19
+ message: Email has already been taken,
20
20
  details: null,
21
- request_id: null
21
+ request_id: req_01HX9F3K7B2N4P8Q1R6T8Y2Z5
22
22
  )
23
23
  ```
24
24
 
data/docs/FetchApi.md ADDED
@@ -0,0 +1,77 @@
1
+ # Weft::FetchApi
2
+
3
+ All URIs are relative to *https://api.weftlabs.com*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**fetch**](FetchApi.md#fetch) | **POST** /api/v1/fetch | Pay-and-fetch any URL (x402 proxy) |
8
+
9
+
10
+ ## fetch
11
+
12
+ > <FetchResponse> fetch(fetch_request)
13
+
14
+ Pay-and-fetch any URL (x402 proxy)
15
+
16
+ Universal x402 fetch proxy. The caller provides a target `url`, a hard `max_cost_usd` ceiling, and optional `method` / `body` / `headers`. Weft: 1. Issues the request. 2. On `402 Payment Required`, parses the merchant's challenge. 3. Compares the asking price to `max_cost_usd` and the buyer's policy (`max_tx_usd`, daily/weekly limits). 4. Signs an EIP-3009 transfer from the buyer's wallet. 5. Replays the request with the `X-Payment` header. 6. Streams the upstream artifact back, base64-encoded under `body_base64`, with `paid_usd`, `tx_hash`, and the merchant's reputation snapshot. Errors are structured with a stable `error` code, and each error response carries the buyer's `policy`, `balance`, and a `dashboard_url` so a CLI can render an actionable message without a second round-trip. Account-scoped: the bearer must be a buyer-scoped API key. **Forwarded headers:** the caller's `headers` are passed through to the upstream, except a denylist of hop-by-hop and Weft-internal headers (`host`, `authorization`, `cookie`, `proxy-authorization`, `x-forwarded-*`, `x-real-ip`, `x-payment`, `connection`, `upgrade`). Up to 32 headers, 4 KB of combined value bytes.
17
+
18
+ ### Examples
19
+
20
+ ```ruby
21
+ require 'time'
22
+ require 'weft-sdk'
23
+ # setup authorization
24
+ Weft.configure do |config|
25
+ # Configure Bearer authorization (APIKey): bearerAuth
26
+ config.access_token = 'YOUR_BEARER_TOKEN'
27
+ end
28
+
29
+ api_instance = Weft::FetchApi.new
30
+ fetch_request = Weft::FetchRequest.new({url: 'https://x402.api.agentmail.to/v0/inboxes'}) # FetchRequest |
31
+
32
+ begin
33
+ # Pay-and-fetch any URL (x402 proxy)
34
+ result = api_instance.fetch(fetch_request)
35
+ p result
36
+ rescue Weft::ApiError => e
37
+ puts "Error when calling FetchApi->fetch: #{e}"
38
+ end
39
+ ```
40
+
41
+ #### Using the fetch_with_http_info variant
42
+
43
+ This returns an Array which contains the response data, status code and headers.
44
+
45
+ > <Array(<FetchResponse>, Integer, Hash)> fetch_with_http_info(fetch_request)
46
+
47
+ ```ruby
48
+ begin
49
+ # Pay-and-fetch any URL (x402 proxy)
50
+ data, status_code, headers = api_instance.fetch_with_http_info(fetch_request)
51
+ p status_code # => 2xx
52
+ p headers # => { ... }
53
+ p data # => <FetchResponse>
54
+ rescue Weft::ApiError => e
55
+ puts "Error when calling FetchApi->fetch_with_http_info: #{e}"
56
+ end
57
+ ```
58
+
59
+ ### Parameters
60
+
61
+ | Name | Type | Description | Notes |
62
+ | ---- | ---- | ----------- | ----- |
63
+ | **fetch_request** | [**FetchRequest**](FetchRequest.md) | | |
64
+
65
+ ### Return type
66
+
67
+ [**FetchResponse**](FetchResponse.md)
68
+
69
+ ### Authorization
70
+
71
+ [bearerAuth](../README.md#bearerAuth)
72
+
73
+ ### HTTP request headers
74
+
75
+ - **Content-Type**: application/json
76
+ - **Accept**: application/json
77
+
@@ -0,0 +1,22 @@
1
+ # Weft::FetchBalanceSnapshot
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **promo_usd** | **String** | | |
8
+ | **wallet_usdc** | **String** | | |
9
+ | **spent_today_usd** | **String** | | |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'weft-sdk'
15
+
16
+ instance = Weft::FetchBalanceSnapshot.new(
17
+ promo_usd: 0.00,
18
+ wallet_usdc: 12.34,
19
+ spent_today_usd: 0.42
20
+ )
21
+ ```
22
+
@@ -0,0 +1,26 @@
1
+ # Weft::FetchErrorResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **error** | **String** | Stable error code. | |
8
+ | **details** | **Hash&lt;String, Object&gt;** | Optional context. Shape varies by error code. | |
9
+ | **policy** | [**SpendingPolicy**](SpendingPolicy.md) | | |
10
+ | **balance** | [**FetchBalanceSnapshot**](FetchBalanceSnapshot.md) | | |
11
+ | **dashboard_url** | **String** | Deep-link to the dashboard&#39;s policy page. | |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'weft-sdk'
17
+
18
+ instance = Weft::FetchErrorResponse.new(
19
+ error: EXCEEDED_MAX_COST,
20
+ details: null,
21
+ policy: null,
22
+ balance: null,
23
+ dashboard_url: null
24
+ )
25
+ ```
26
+
@@ -0,0 +1,26 @@
1
+ # Weft::FetchRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **url** | **String** | Target URL. Must pass Weft&#39;s URL safety check (no SSRF / private IP ranges). | |
8
+ | **max_cost_usd** | **String** | Hard ceiling on what the buyer is willing to pay. Defaults to &#x60;0.10&#x60; USD. | [optional][default to &#39;0.10&#39;] |
9
+ | **method** | **String** | HTTP method to use against the upstream. | [optional][default to &#39;GET&#39;] |
10
+ | **body** | [**FetchRequestBody**](FetchRequestBody.md) | | [optional] |
11
+ | **headers** | **Hash&lt;String, String&gt;** | Headers forwarded to the upstream. Up to 32 headers, 4 KB total. The following are silently stripped: &#x60;host&#x60;, &#x60;authorization&#x60;, &#x60;cookie&#x60;, &#x60;proxy-authorization&#x60;, &#x60;x-forwarded-*&#x60;, &#x60;x-real-ip&#x60;, &#x60;x-payment&#x60;, &#x60;connection&#x60;, &#x60;upgrade&#x60;. | [optional] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'weft-sdk'
17
+
18
+ instance = Weft::FetchRequest.new(
19
+ url: https://x402.api.agentmail.to/v0/inboxes,
20
+ max_cost_usd: 0.05,
21
+ method: null,
22
+ body: null,
23
+ headers: {Accept&#x3D;application/json, User-Agent&#x3D;my-agent/1.0}
24
+ )
25
+ ```
26
+
@@ -0,0 +1,49 @@
1
+ # Weft::FetchRequestBody
2
+
3
+ ## Class instance methods
4
+
5
+ ### `openapi_one_of`
6
+
7
+ Returns the list of classes defined in oneOf.
8
+
9
+ #### Example
10
+
11
+ ```ruby
12
+ require 'weft-sdk'
13
+
14
+ Weft::FetchRequestBody.openapi_one_of
15
+ # =>
16
+ # [
17
+ # :'Object',
18
+ # :'String'
19
+ # ]
20
+ ```
21
+
22
+ ### build
23
+
24
+ Find the appropriate object from the `openapi_one_of` list and casts the data into it.
25
+
26
+ #### Example
27
+
28
+ ```ruby
29
+ require 'weft-sdk'
30
+
31
+ Weft::FetchRequestBody.build(data)
32
+ # => #<Object:0x00007fdd4aab02a0>
33
+
34
+ Weft::FetchRequestBody.build(data_that_doesnt_match)
35
+ # => nil
36
+ ```
37
+
38
+ #### Parameters
39
+
40
+ | Name | Type | Description |
41
+ | ---- | ---- | ----------- |
42
+ | **data** | **Mixed** | data to be matched against the list of oneOf items |
43
+
44
+ #### Return type
45
+
46
+ - `Object`
47
+ - `String`
48
+ - `nil` (if no type matches)
49
+
@@ -0,0 +1,30 @@
1
+ # Weft::FetchResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **status** | **Integer** | HTTP status returned by the upstream after the paid replay. | |
8
+ | **headers** | **Hash&lt;String, String&gt;** | Response headers from the upstream. | |
9
+ | **body_base64** | **String** | Base64-encoded response body. Empty string for empty bodies. | |
10
+ | **paid_usd** | **String** | USD amount actually settled. Null for free upstreams. | |
11
+ | **tx_hash** | **String** | Settlement transaction hash. Null for free upstreams. | |
12
+ | **artifact_id** | **String** | Internal artifact identifier if the response was persisted. | |
13
+ | **merchant** | [**Merchant**](Merchant.md) | Merchant reputation snapshot. Null for free upstreams. | |
14
+
15
+ ## Example
16
+
17
+ ```ruby
18
+ require 'weft-sdk'
19
+
20
+ instance = Weft::FetchResponse.new(
21
+ status: 200,
22
+ headers: null,
23
+ body_base64: null,
24
+ paid_usd: 0.002,
25
+ tx_hash: null,
26
+ artifact_id: null,
27
+ merchant: null
28
+ )
29
+ ```
30
+
data/docs/Merchant.md ADDED
@@ -0,0 +1,24 @@
1
+ # Weft::Merchant
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **address** | **String** | EVM address that received the payment. | |
8
+ | **settlement_count** | **Integer** | All-time settlement count for this merchant address. | |
9
+ | **first_seen_at** | **Time** | First time Weft observed a payment to this address. | |
10
+ | **dispute_count** | **Integer** | All-time dispute count for this merchant address. | |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'weft-sdk'
16
+
17
+ instance = Weft::Merchant.new(
18
+ address: null,
19
+ settlement_count: null,
20
+ first_seen_at: null,
21
+ dispute_count: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,22 @@
1
+ # Weft::PromoBalance
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **balance_usd** | **String** | | |
8
+ | **scope** | **String** | Where the promo can be spent. | |
9
+ | **expires_at** | **Time** | | |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'weft-sdk'
15
+
16
+ instance = Weft::PromoBalance.new(
17
+ balance_usd: 0.00,
18
+ scope: weft-search,
19
+ expires_at: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,34 @@
1
+ # Weft::SearchAgentCard
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **name** | **String** | | [optional] |
8
+ | **description** | **String** | | [optional] |
9
+ | **url** | **String** | | [optional] |
10
+ | **version** | **String** | | [optional] |
11
+ | **protocol_version** | **String** | | [optional] |
12
+ | **capabilities** | **Hash&lt;String, Object&gt;** | | [optional] |
13
+ | **default_input_modes** | **Array&lt;String&gt;** | | [optional] |
14
+ | **default_output_modes** | **Array&lt;String&gt;** | | [optional] |
15
+ | **skills** | [**Array&lt;SearchSkill&gt;**](SearchSkill.md) | | [optional] |
16
+
17
+ ## Example
18
+
19
+ ```ruby
20
+ require 'weft-sdk'
21
+
22
+ instance = Weft::SearchAgentCard.new(
23
+ name: null,
24
+ description: null,
25
+ url: null,
26
+ version: null,
27
+ protocol_version: null,
28
+ capabilities: null,
29
+ default_input_modes: null,
30
+ default_output_modes: null,
31
+ skills: null
32
+ )
33
+ ```
34
+
data/docs/SearchApi.md ADDED
@@ -0,0 +1,77 @@
1
+ # Weft::SearchApi
2
+
3
+ All URIs are relative to *https://api.weftlabs.com*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**search**](SearchApi.md#search) | **POST** /api/v1/search | Search the Weft index |
8
+
9
+
10
+ ## search
11
+
12
+ > <SearchResponse> search(search_request)
13
+
14
+ Search the Weft index
15
+
16
+ Semantic search over the Weft index of paid agent resources. The request body carries a free-text `query`, an optional `limit`, and an optional `filters` object that narrows by price band, payment protocol, agent protocol, or domain tag. Filters are applied as a post-filter after the embedding score is computed. Backend selection is server-side via the `SEARCH_BACKEND` env var: `mock` (default, reads YAML fixtures and sets `_mock: true` in the response) or `platform` (proxies to the upstream search service). Both backends return the same envelope. Account-scoped: the bearer token must be a buyer-scoped API key. Free for authenticated buyers in v1; billing is planned for a later release. Response negotiation: `Accept: application/json` (default) returns the structured envelope; `Accept: text/markdown` returns a rendered Markdown digest of the same results — useful for piping into a chat UI or LLM prompt.
17
+
18
+ ### Examples
19
+
20
+ ```ruby
21
+ require 'time'
22
+ require 'weft-sdk'
23
+ # setup authorization
24
+ Weft.configure do |config|
25
+ # Configure Bearer authorization (APIKey): bearerAuth
26
+ config.access_token = 'YOUR_BEARER_TOKEN'
27
+ end
28
+
29
+ api_instance = Weft::SearchApi.new
30
+ search_request = Weft::SearchRequest.new({query: 'send email from an agent'}) # SearchRequest |
31
+
32
+ begin
33
+ # Search the Weft index
34
+ result = api_instance.search(search_request)
35
+ p result
36
+ rescue Weft::ApiError => e
37
+ puts "Error when calling SearchApi->search: #{e}"
38
+ end
39
+ ```
40
+
41
+ #### Using the search_with_http_info variant
42
+
43
+ This returns an Array which contains the response data, status code and headers.
44
+
45
+ > <Array(<SearchResponse>, Integer, Hash)> search_with_http_info(search_request)
46
+
47
+ ```ruby
48
+ begin
49
+ # Search the Weft index
50
+ data, status_code, headers = api_instance.search_with_http_info(search_request)
51
+ p status_code # => 2xx
52
+ p headers # => { ... }
53
+ p data # => <SearchResponse>
54
+ rescue Weft::ApiError => e
55
+ puts "Error when calling SearchApi->search_with_http_info: #{e}"
56
+ end
57
+ ```
58
+
59
+ ### Parameters
60
+
61
+ | Name | Type | Description | Notes |
62
+ | ---- | ---- | ----------- | ----- |
63
+ | **search_request** | [**SearchRequest**](SearchRequest.md) | | |
64
+
65
+ ### Return type
66
+
67
+ [**SearchResponse**](SearchResponse.md)
68
+
69
+ ### Authorization
70
+
71
+ [bearerAuth](../README.md#bearerAuth)
72
+
73
+ ### HTTP request headers
74
+
75
+ - **Content-Type**: application/json
76
+ - **Accept**: application/json, text/markdown
77
+
@@ -0,0 +1,24 @@
1
+ # Weft::SearchEndpoints
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **a2a** | **String** | | [optional] |
8
+ | **mcp** | **String** | | [optional] |
9
+ | **openapi** | **String** | URL to the agent&#39;s OpenAPI document. | [optional] |
10
+ | **weft_fetch_target** | **String** | Base URL the &#x60;weft_fetch&#x60; MCP tool should target for this agent. | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'weft-sdk'
16
+
17
+ instance = Weft::SearchEndpoints.new(
18
+ a2a: null,
19
+ mcp: null,
20
+ openapi: null,
21
+ weft_fetch_target: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,20 @@
1
+ # Weft::SearchErrorResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **error** | **String** | Stable error code. | |
8
+ | **details** | **Hash&lt;String, Object&gt;** | Optional context. Shape varies by error code. | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'weft-sdk'
14
+
15
+ instance = Weft::SearchErrorResponse.new(
16
+ error: null,
17
+ details: null
18
+ )
19
+ ```
20
+