weft-sdk 0.7.0 → 0.9.1
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.
- checksums.yaml +4 -4
- data/docs/APIKeysApi.md +1 -2
- data/docs/AccountApi.md +6 -5
- data/docs/AccountDetails.md +2 -1
- data/docs/ApiKey.md +0 -1
- data/docs/ApiKeyCreated.md +0 -1
- data/docs/ApiKeyCreatedResponse.md +0 -1
- data/docs/ApiKeyListResponse.md +0 -1
- data/docs/AuthApi.md +6 -7
- data/docs/AuthResponse.md +0 -1
- data/docs/AuthResponseData.md +0 -1
- data/docs/BalanceApi.md +1 -2
- data/docs/BalanceResponse.md +3 -4
- data/docs/ConfirmRequest.md +0 -1
- data/docs/CreateApiKeyRequest.md +0 -1
- data/docs/DefaultApi.md +0 -1
- data/docs/EnrolledResource.md +0 -1
- data/docs/Error.md +0 -1
- data/docs/ErrorResponse.md +0 -1
- data/docs/Fetch403Response.md +0 -1
- data/docs/FetchApi.md +10 -7
- data/docs/FetchBalanceSnapshot.md +2 -3
- data/docs/FetchErrorResponse.md +0 -1
- data/docs/FetchRequest.md +0 -1
- data/docs/FetchRequestBody.md +0 -1
- data/docs/FetchResponse.md +5 -2
- data/docs/InsufficientScopeResponse.md +0 -1
- data/docs/MeApiKey.md +0 -1
- data/docs/MeApiKeyCreator.md +0 -1
- data/docs/MeResponse.md +1 -2
- data/docs/MeResponseData.md +78 -0
- data/docs/Merchant.md +0 -1
- data/docs/MessageResponse.md +0 -1
- data/docs/MessageResponseData.md +0 -1
- data/docs/Pagination.md +0 -1
- data/docs/PasswordResetRequest.md +0 -1
- data/docs/PasswordUpdateRequest.md +0 -1
- data/docs/Payment.md +0 -3
- data/docs/PaymentListResponse.md +0 -1
- data/docs/PaymentResponse.md +0 -1
- data/docs/PaymentsApi.md +0 -1
- data/docs/PrincipalWallet.md +19 -0
- data/docs/PromoBalance.md +0 -1
- data/docs/Purchase.md +43 -0
- data/docs/PurchaseArtifact.md +23 -0
- data/docs/PurchaseListResponse.md +19 -0
- data/docs/PurchaseResponse.md +17 -0
- data/docs/PurchasesApi.md +148 -0
- data/docs/ResendConfirmationRequest.md +0 -1
- data/docs/ResourceEnrollmentRequest.md +0 -1
- data/docs/ResourceEnrollmentResponse.md +0 -1
- data/docs/ResourceStats.md +0 -1
- data/docs/ResourcesApi.md +2 -3
- data/docs/SearchApi.md +2 -3
- data/docs/SearchCapabilityRef.md +19 -0
- data/docs/SearchEndpointCall.md +23 -0
- data/docs/SearchEndpointHit.md +41 -0
- data/docs/SearchEndpointPrice.md +25 -0
- data/docs/SearchErrorResponse.md +0 -1
- data/docs/SearchFilterSpec.md +23 -0
- data/docs/SearchPaymentOffer.md +31 -0
- data/docs/SearchPriceAtomicFilter.md +25 -0
- data/docs/SearchPriceUsdFilter.md +25 -0
- data/docs/SearchProtocolFilter.md +19 -0
- data/docs/SearchProviderRef.md +21 -0
- data/docs/SearchRequest.md +3 -4
- data/docs/SearchResourceTypeFilter.md +19 -0
- data/docs/SearchResponse.md +35 -8
- data/docs/SearchResponseWarningsInner.md +23 -0
- data/docs/SearchResult.md +8 -21
- data/docs/SignInRequest.md +0 -1
- data/docs/SignUpRequest.md +0 -1
- data/docs/SpendingPolicy.md +0 -1
- data/docs/User.md +0 -1
- data/docs/UserPrincipal.md +33 -0
- data/docs/Wallet.md +3 -4
- data/lib/weft/generated/api/account_api.rb +6 -4
- data/lib/weft/generated/api/api_keys_api.rb +4 -4
- data/lib/weft/generated/api/auth_api.rb +14 -14
- data/lib/weft/generated/api/balance_api.rb +4 -4
- data/lib/weft/generated/api/default_api.rb +2 -2
- data/lib/weft/generated/api/fetch_api.rb +22 -6
- data/lib/weft/generated/api/payments_api.rb +2 -2
- data/lib/weft/generated/api/purchases_api.rb +150 -0
- data/lib/weft/generated/api/resources_api.rb +6 -6
- data/lib/weft/generated/api/search_api.rb +6 -6
- data/lib/weft/generated/api_client.rb +2 -2
- data/lib/weft/generated/api_error.rb +2 -2
- data/lib/weft/generated/api_model_base.rb +2 -2
- data/lib/weft/generated/configuration.rb +2 -2
- data/lib/weft/generated/models/account_details.rb +54 -4
- data/lib/weft/generated/models/api_key.rb +2 -2
- data/lib/weft/generated/models/api_key_created.rb +2 -2
- data/lib/weft/generated/models/api_key_created_response.rb +2 -2
- data/lib/weft/generated/models/api_key_list_response.rb +2 -2
- data/lib/weft/generated/models/auth_response.rb +2 -2
- data/lib/weft/generated/models/auth_response_data.rb +2 -2
- data/lib/weft/generated/models/balance_response.rb +5 -5
- data/lib/weft/generated/models/confirm_request.rb +2 -2
- data/lib/weft/generated/models/create_api_key_request.rb +2 -2
- data/lib/weft/generated/models/enrolled_resource.rb +4 -4
- data/lib/weft/generated/models/error.rb +3 -3
- data/lib/weft/generated/models/error_response.rb +3 -3
- data/lib/weft/generated/models/fetch403_response.rb +2 -2
- data/lib/weft/generated/models/fetch_balance_snapshot.rb +5 -5
- data/lib/weft/generated/models/fetch_error_response.rb +5 -5
- data/lib/weft/generated/models/fetch_request.rb +5 -5
- data/lib/weft/generated/models/fetch_request_body.rb +2 -2
- data/lib/weft/generated/models/fetch_response.rb +83 -5
- data/lib/weft/generated/models/insufficient_scope_response.rb +3 -3
- data/lib/weft/generated/models/me_api_key.rb +2 -2
- data/lib/weft/generated/models/me_api_key_creator.rb +3 -3
- data/lib/weft/generated/models/me_response.rb +3 -3
- data/lib/weft/generated/models/me_response_data.rb +55 -0
- data/lib/weft/generated/models/merchant.rb +2 -2
- data/lib/weft/generated/models/message_response.rb +2 -2
- data/lib/weft/generated/models/message_response_data.rb +2 -2
- data/lib/weft/generated/models/pagination.rb +2 -2
- data/lib/weft/generated/models/password_reset_request.rb +2 -2
- data/lib/weft/generated/models/password_update_request.rb +2 -2
- data/lib/weft/generated/models/payment.rb +3 -12
- data/lib/weft/generated/models/payment_list_response.rb +2 -2
- data/lib/weft/generated/models/payment_response.rb +2 -2
- data/lib/weft/generated/models/principal_wallet.rb +190 -0
- data/lib/weft/generated/models/promo_balance.rb +3 -3
- data/lib/weft/generated/models/purchase.rb +427 -0
- data/lib/weft/generated/models/{search_agent_card.rb → purchase_artifact.rb} +91 -82
- data/lib/weft/generated/models/purchase_list_response.rb +192 -0
- data/lib/weft/generated/models/purchase_response.rb +164 -0
- data/lib/weft/generated/models/resend_confirmation_request.rb +2 -2
- data/lib/weft/generated/models/resource_enrollment_request.rb +5 -5
- data/lib/weft/generated/models/resource_enrollment_response.rb +2 -2
- data/lib/weft/generated/models/resource_stats.rb +2 -2
- data/lib/weft/generated/models/{search_skill_endpoint.rb → search_capability_ref.rb} +18 -19
- data/lib/weft/generated/models/search_endpoint_call.rb +179 -0
- data/lib/weft/generated/models/search_endpoint_hit.rb +296 -0
- data/lib/weft/generated/models/{search_skill.rb → search_endpoint_price.rb} +76 -112
- data/lib/weft/generated/models/search_error_response.rb +5 -5
- data/lib/weft/generated/models/search_filter_spec.rb +175 -0
- data/lib/weft/generated/models/{search_pricing.rb → search_payment_offer.rb} +64 -67
- data/lib/weft/generated/models/search_price_atomic_filter.rb +284 -0
- data/lib/weft/generated/models/search_price_usd_filter.rb +294 -0
- data/lib/weft/generated/models/search_protocol_filter.rb +200 -0
- data/lib/weft/generated/models/{search_endpoints.rb → search_provider_ref.rb} +26 -36
- data/lib/weft/generated/models/search_request.rb +36 -27
- data/lib/weft/generated/models/search_resource_type_filter.rb +200 -0
- data/lib/weft/generated/models/search_response.rb +367 -31
- data/lib/weft/generated/models/search_response_warnings_inner.rb +210 -0
- data/lib/weft/generated/models/search_result.rb +68 -220
- data/lib/weft/generated/models/sign_in_request.rb +2 -2
- data/lib/weft/generated/models/sign_up_request.rb +2 -2
- data/lib/weft/generated/models/spending_policy.rb +2 -2
- data/lib/weft/generated/models/user.rb +2 -2
- data/lib/weft/generated/models/user_principal.rb +370 -0
- data/lib/weft/generated/models/wallet.rb +5 -5
- data/lib/weft/generated/version.rb +3 -3
- data/lib/weft/generated.rb +10 -4
- data/lib/weft/sdk.rb +1 -1
- metadata +57 -19
- data/docs/SearchAgentCard.md +0 -34
- data/docs/SearchEndpoints.md +0 -24
- data/docs/SearchFilters.md +0 -26
- data/docs/SearchPricing.md +0 -24
- data/docs/SearchRanking.md +0 -26
- data/docs/SearchResponseResultsInner.md +0 -36
- data/docs/SearchSkill.md +0 -36
- data/docs/SearchSkillEndpoint.md +0 -20
- data/lib/weft/generated/models/search_filters.rb +0 -277
- data/lib/weft/generated/models/search_ranking.rb +0 -277
- data/lib/weft/generated/models/search_response_results_inner.rb +0 -103
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Weft::PurchaseArtifact
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **Integer** | | |
|
|
8
|
+
| **merchant_url** | **String** | | |
|
|
9
|
+
| **bytes** | **Integer** | | |
|
|
10
|
+
| **mime** | **String** | | |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'weft-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Weft::PurchaseArtifact.new(
|
|
18
|
+
id: null,
|
|
19
|
+
merchant_url: null,
|
|
20
|
+
bytes: null,
|
|
21
|
+
mime: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Weft::PurchaseListResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **data** | [**Array<Purchase>**](Purchase.md) | | |
|
|
8
|
+
| **pagination** | [**Pagination**](Pagination.md) | | |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'weft-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Weft::PurchaseListResponse.new(
|
|
16
|
+
data: null,
|
|
17
|
+
pagination: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Weft::PurchaseResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **data** | [**Purchase**](Purchase.md) | | |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'weft-sdk'
|
|
13
|
+
|
|
14
|
+
instance = Weft::PurchaseResponse.new(
|
|
15
|
+
data: null
|
|
16
|
+
)
|
|
17
|
+
```
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Weft::PurchasesApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://weft.network*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**get_purchase**](PurchasesApi.md#get_purchase) | **GET** /api/v1/purchases/{id} | Get a buyer purchase |
|
|
8
|
+
| [**list_purchases**](PurchasesApi.md#list_purchases) | **GET** /api/v1/purchases | List buyer purchases |
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## get_purchase
|
|
12
|
+
|
|
13
|
+
> <PurchaseResponse> get_purchase(id)
|
|
14
|
+
|
|
15
|
+
Get a buyer purchase
|
|
16
|
+
|
|
17
|
+
### Examples
|
|
18
|
+
|
|
19
|
+
```ruby
|
|
20
|
+
require 'time'
|
|
21
|
+
require 'weft-sdk'
|
|
22
|
+
# setup authorization
|
|
23
|
+
Weft.configure do |config|
|
|
24
|
+
# Configure Bearer authorization (APIKey): bearerAuth
|
|
25
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
api_instance = Weft::PurchasesApi.new
|
|
29
|
+
id = 56 # Integer | Purchase ID
|
|
30
|
+
|
|
31
|
+
begin
|
|
32
|
+
# Get a buyer purchase
|
|
33
|
+
result = api_instance.get_purchase(id)
|
|
34
|
+
p result
|
|
35
|
+
rescue Weft::ApiError => e
|
|
36
|
+
puts "Error when calling PurchasesApi->get_purchase: #{e}"
|
|
37
|
+
end
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
#### Using the get_purchase_with_http_info variant
|
|
41
|
+
|
|
42
|
+
This returns an Array which contains the response data, status code and headers.
|
|
43
|
+
|
|
44
|
+
> <Array(<PurchaseResponse>, Integer, Hash)> get_purchase_with_http_info(id)
|
|
45
|
+
|
|
46
|
+
```ruby
|
|
47
|
+
begin
|
|
48
|
+
# Get a buyer purchase
|
|
49
|
+
data, status_code, headers = api_instance.get_purchase_with_http_info(id)
|
|
50
|
+
p status_code # => 2xx
|
|
51
|
+
p headers # => { ... }
|
|
52
|
+
p data # => <PurchaseResponse>
|
|
53
|
+
rescue Weft::ApiError => e
|
|
54
|
+
puts "Error when calling PurchasesApi->get_purchase_with_http_info: #{e}"
|
|
55
|
+
end
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Parameters
|
|
59
|
+
|
|
60
|
+
| Name | Type | Description | Notes |
|
|
61
|
+
| ---- | ---- | ----------- | ----- |
|
|
62
|
+
| **id** | **Integer** | Purchase ID | |
|
|
63
|
+
|
|
64
|
+
### Return type
|
|
65
|
+
|
|
66
|
+
[**PurchaseResponse**](PurchaseResponse.md)
|
|
67
|
+
|
|
68
|
+
### Authorization
|
|
69
|
+
|
|
70
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
71
|
+
|
|
72
|
+
### HTTP request headers
|
|
73
|
+
|
|
74
|
+
- **Content-Type**: Not defined
|
|
75
|
+
- **Accept**: application/json
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## list_purchases
|
|
79
|
+
|
|
80
|
+
> <PurchaseListResponse> list_purchases(opts)
|
|
81
|
+
|
|
82
|
+
List buyer purchases
|
|
83
|
+
|
|
84
|
+
Returns the authenticated buyer's signing and settlement ledger. Unlike `/api/v1/payments`, this endpoint is User-scoped and backed by `signed_events`, so rejected and pending attempts are included. Scoped to the buyer's own merchant spend, matching the dashboard's Purchases page. Internal signings are excluded: the Tempo refill self-transfer (`rebalance`) and operator signings (`manual`) are not payments the buyer made and never appear here.
|
|
85
|
+
|
|
86
|
+
### Examples
|
|
87
|
+
|
|
88
|
+
```ruby
|
|
89
|
+
require 'time'
|
|
90
|
+
require 'weft-sdk'
|
|
91
|
+
# setup authorization
|
|
92
|
+
Weft.configure do |config|
|
|
93
|
+
# Configure Bearer authorization (APIKey): bearerAuth
|
|
94
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
api_instance = Weft::PurchasesApi.new
|
|
98
|
+
opts = {
|
|
99
|
+
page: 56, # Integer | Page number
|
|
100
|
+
per_page: 56 # Integer | Items per page
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
begin
|
|
104
|
+
# List buyer purchases
|
|
105
|
+
result = api_instance.list_purchases(opts)
|
|
106
|
+
p result
|
|
107
|
+
rescue Weft::ApiError => e
|
|
108
|
+
puts "Error when calling PurchasesApi->list_purchases: #{e}"
|
|
109
|
+
end
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
#### Using the list_purchases_with_http_info variant
|
|
113
|
+
|
|
114
|
+
This returns an Array which contains the response data, status code and headers.
|
|
115
|
+
|
|
116
|
+
> <Array(<PurchaseListResponse>, Integer, Hash)> list_purchases_with_http_info(opts)
|
|
117
|
+
|
|
118
|
+
```ruby
|
|
119
|
+
begin
|
|
120
|
+
# List buyer purchases
|
|
121
|
+
data, status_code, headers = api_instance.list_purchases_with_http_info(opts)
|
|
122
|
+
p status_code # => 2xx
|
|
123
|
+
p headers # => { ... }
|
|
124
|
+
p data # => <PurchaseListResponse>
|
|
125
|
+
rescue Weft::ApiError => e
|
|
126
|
+
puts "Error when calling PurchasesApi->list_purchases_with_http_info: #{e}"
|
|
127
|
+
end
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Parameters
|
|
131
|
+
|
|
132
|
+
| Name | Type | Description | Notes |
|
|
133
|
+
| ---- | ---- | ----------- | ----- |
|
|
134
|
+
| **page** | **Integer** | Page number | [optional][default to 1] |
|
|
135
|
+
| **per_page** | **Integer** | Items per page | [optional][default to 25] |
|
|
136
|
+
|
|
137
|
+
### Return type
|
|
138
|
+
|
|
139
|
+
[**PurchaseListResponse**](PurchaseListResponse.md)
|
|
140
|
+
|
|
141
|
+
### Authorization
|
|
142
|
+
|
|
143
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
144
|
+
|
|
145
|
+
### HTTP request headers
|
|
146
|
+
|
|
147
|
+
- **Content-Type**: Not defined
|
|
148
|
+
- **Accept**: application/json
|
data/docs/ResourceStats.md
CHANGED
data/docs/ResourcesApi.md
CHANGED
|
@@ -13,7 +13,7 @@ All URIs are relative to *https://weft.network*
|
|
|
13
13
|
|
|
14
14
|
Self-enroll a ghost resource (public, no auth)
|
|
15
15
|
|
|
16
|
-
Lets an unauthenticated agent (or its operator) self-enroll a Resource as a \"ghost\" (no owning provider). The server generates the `slug` and a single-use `claim_token`; the response also carries a `claim_url` the agent hands to its human controller to claim the resource from the dashboard. Client-supplied `slug` and `category` are silently ignored: slugs are server-generated from `name` (so callers cannot squat on reserved names), and `category` is a post-claim concern set by a real human. Rate-limited to 10 enrollments/hour/IP.
|
|
16
|
+
Lets an unauthenticated agent (or its operator) self-enroll a Resource as a \"ghost\" (no owning provider). The server generates the `slug` and a single-use `claim_token`; the response also carries a `claim_url` the agent hands to its human controller to claim the resource from the dashboard. Client-supplied `slug` and `category` are silently ignored: slugs are server-generated from `name` (so callers cannot squat on reserved names), and `category` is a post-claim concern set by a real human. Rate-limited to 10 enrollments/hour/IP.
|
|
17
17
|
|
|
18
18
|
### Examples
|
|
19
19
|
|
|
@@ -22,7 +22,7 @@ require 'time'
|
|
|
22
22
|
require 'weft-sdk'
|
|
23
23
|
|
|
24
24
|
api_instance = Weft::ResourcesApi.new
|
|
25
|
-
resource_enrollment_request = Weft::ResourceEnrollmentRequest.new({kind: 'agent', name: 'Self-Enrolled Bot'}) # ResourceEnrollmentRequest |
|
|
25
|
+
resource_enrollment_request = Weft::ResourceEnrollmentRequest.new({kind: 'agent', name: 'Self-Enrolled Bot'}) # ResourceEnrollmentRequest |
|
|
26
26
|
|
|
27
27
|
begin
|
|
28
28
|
# Self-enroll a ghost resource (public, no auth)
|
|
@@ -69,4 +69,3 @@ No authorization required
|
|
|
69
69
|
|
|
70
70
|
- **Content-Type**: application/json
|
|
71
71
|
- **Accept**: application/json
|
|
72
|
-
|
data/docs/SearchApi.md
CHANGED
|
@@ -13,7 +13,7 @@ All URIs are relative to *https://weft.network*
|
|
|
13
13
|
|
|
14
14
|
Search the Weft index
|
|
15
15
|
|
|
16
|
-
Semantic search over the Weft index of paid agent resources. The request body
|
|
16
|
+
Semantic search over the Weft index of paid agent resources. The request body is the weft-search-platform `/v1/search` contract: a free-text `query`, optional `max_results`, and optional structured `filters` (price / price_atomic / type / protocol — the canonical FilterSpec v1 vocabulary, vendored verbatim from the platform). Price is a dual representation of one constraint: `price` in USD decimal strings (the reasoning form) XOR `price_atomic` in integer micro-USD (the settlement form) — mutually exclusive, set at most one. 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 platform `SearchResponse` 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
17
|
|
|
18
18
|
### Examples
|
|
19
19
|
|
|
@@ -27,7 +27,7 @@ Weft.configure do |config|
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
api_instance = Weft::SearchApi.new
|
|
30
|
-
search_request = Weft::SearchRequest.new({query: 'send email from an agent'}) # SearchRequest |
|
|
30
|
+
search_request = Weft::SearchRequest.new({query: 'send email from an agent'}) # SearchRequest |
|
|
31
31
|
|
|
32
32
|
begin
|
|
33
33
|
# Search the Weft index
|
|
@@ -74,4 +74,3 @@ end
|
|
|
74
74
|
|
|
75
75
|
- **Content-Type**: application/json
|
|
76
76
|
- **Accept**: application/json, text/markdown
|
|
77
|
-
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Weft::SearchCapabilityRef
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **capability_id** | **String** | | [optional] |
|
|
8
|
+
| **capability_type** | **String** | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'weft-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Weft::SearchCapabilityRef.new(
|
|
16
|
+
capability_id: null,
|
|
17
|
+
capability_type: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Weft::SearchEndpointCall
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **method** | **String** | The HTTP verb to send. Empty string when neither the index nor the provider's own 402 challenge / OpenAPI spec declares one. | [optional] |
|
|
8
|
+
| **input_schema** | **Object** | The provider's OWN structured declaration of the arguments this endpoint takes — the machine-usable form of what `usage_instructions` states in prose. Null when the provider declares nothing. | [optional] |
|
|
9
|
+
| **example_request** | **Object** | A worked set of arguments grouped by slot (`query` / `body` / `path`). Every value is one the PROVIDER published; never synthesized. | [optional] |
|
|
10
|
+
| **example_response** | **Object** | | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'weft-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Weft::SearchEndpointCall.new(
|
|
18
|
+
method: null,
|
|
19
|
+
input_schema: null,
|
|
20
|
+
example_request: null,
|
|
21
|
+
example_response: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Weft::SearchEndpointHit
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **endpoint_id** | **String** | | [optional] |
|
|
8
|
+
| **url** | **String** | | [optional] |
|
|
9
|
+
| **resource_type** | **String** | | [optional] |
|
|
10
|
+
| **primary_protocol** | **String** | | [optional] |
|
|
11
|
+
| **call** | [**SearchEndpointCall**](SearchEndpointCall.md) | | [optional] |
|
|
12
|
+
| **price** | [**SearchEndpointPrice**](SearchEndpointPrice.md) | | [optional] |
|
|
13
|
+
| **payment** | [**Array<SearchPaymentOffer>**](SearchPaymentOffer.md) | The settlement routes this endpoint's own 402 challenge published — one entry per rail × network × asset × payee it accepts. Sibling of `call`: that block says how to shape the request, this says how to pay for it, so a caller can settle with its OWN x402/mpp SDK instead of guessing. A list because rails are irreducibly plural. Order is the provider's own preference order. Honest-empty when the pipeline observed no challenge. | [optional] |
|
|
14
|
+
| **operator_type** | **String** | Who you are actually paying. `first_party` = operated by the provider that makes the capability; `reseller` = resold, so the price carries someone else's margin. Null until the platform resolves the operator. | [optional] |
|
|
15
|
+
| **operated_by_id** | **String** | | [optional] |
|
|
16
|
+
| **settled_via_facilitator_id** | **String** | | [optional] |
|
|
17
|
+
| **settlements** | **Integer** | Count of payments observed settling against this endpoint by ANYONE (chain-indexed), not just by Weft — the reliability signal a caller can act on. Null when unknown. | [optional] |
|
|
18
|
+
| **last_verified_at** | **Time** | When Weft last CONFIRMED this endpoint answers — the most recent conclusive probe. Null when never probed, or when the latest probe errored: an endpoint we last failed to reach has no current verification. | [optional] |
|
|
19
|
+
| **latency_p50_ms** | **Integer** | Median time-to-first-byte in ms across the endpoint's probe call set. First-byte latency, not full-response time. Null when unmeasured (never 0). | [optional] |
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
|
|
23
|
+
```ruby
|
|
24
|
+
require 'weft-sdk'
|
|
25
|
+
|
|
26
|
+
instance = Weft::SearchEndpointHit.new(
|
|
27
|
+
endpoint_id: null,
|
|
28
|
+
url: null,
|
|
29
|
+
resource_type: null,
|
|
30
|
+
primary_protocol: null,
|
|
31
|
+
call: null,
|
|
32
|
+
price: null,
|
|
33
|
+
payment: null,
|
|
34
|
+
operator_type: null,
|
|
35
|
+
operated_by_id: null,
|
|
36
|
+
settled_via_facilitator_id: null,
|
|
37
|
+
settlements: null,
|
|
38
|
+
last_verified_at: null,
|
|
39
|
+
latency_p50_ms: null
|
|
40
|
+
)
|
|
41
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Weft::SearchEndpointPrice
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **indexed_usd** | **String** | The indexed price in USD as a decimal string (e.g. \"0.008\") — the dollar value people and agents reason in. A decimal string, never a float; trailing zeros trimmed. Null when unpriced. | [optional] |
|
|
8
|
+
| **atomic** | **Integer** | The same price in integer micro-USD — the settlement grain, exact. Null exactly when `indexed_usd` is. Use this for settlement. | [optional] |
|
|
9
|
+
| **source** | **String** | Where the amount came from. `probe` = observed live in the endpoint's own 402 payment-required challenge — an observation, the strongest evidence we hold. `inferred` = derived from a spec (OpenAPI) or a resale edge by the extraction pipeline, so it can lag a provider's re-pricing. Null when the endpoint carries no price. | [optional] |
|
|
10
|
+
| **last_observed_at** | **Time** | When the amount was observed. Null when unrecorded. | [optional] |
|
|
11
|
+
| **live_verified** | **Boolean** | Whether this amount was confirmed against a live 402 challenge for THIS response. Search does not issue a payment-required probe at query time, so this is `false` today — treat an unflagged price as indexed, not verified. | [optional] |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'weft-sdk'
|
|
17
|
+
|
|
18
|
+
instance = Weft::SearchEndpointPrice.new(
|
|
19
|
+
indexed_usd: null,
|
|
20
|
+
atomic: null,
|
|
21
|
+
source: null,
|
|
22
|
+
last_observed_at: null,
|
|
23
|
+
live_verified: null
|
|
24
|
+
)
|
|
25
|
+
```
|
data/docs/SearchErrorResponse.md
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Weft::SearchFilterSpec
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **price** | [**SearchPriceUsdFilter**](SearchPriceUsdFilter.md) | | [optional] |
|
|
8
|
+
| **price_atomic** | [**SearchPriceAtomicFilter**](SearchPriceAtomicFilter.md) | | [optional] |
|
|
9
|
+
| **type** | [**SearchResourceTypeFilter**](SearchResourceTypeFilter.md) | | [optional] |
|
|
10
|
+
| **protocol** | [**SearchProtocolFilter**](SearchProtocolFilter.md) | | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'weft-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Weft::SearchFilterSpec.new(
|
|
18
|
+
price: null,
|
|
19
|
+
price_atomic: null,
|
|
20
|
+
type: null,
|
|
21
|
+
protocol: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Weft::SearchPaymentOffer
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **protocol** | **String** | The payment rail (e.g. `x402`, `mpp`). | |
|
|
8
|
+
| **scheme** | **String** | | [optional] |
|
|
9
|
+
| **network** | **String** | | [optional] |
|
|
10
|
+
| **asset** | **String** | | [optional] |
|
|
11
|
+
| **amount** | **String** | | [optional] |
|
|
12
|
+
| **pay_to** | **String** | | [optional] |
|
|
13
|
+
| **max_timeout_seconds** | **Integer** | | [optional] |
|
|
14
|
+
| **facilitator** | **String** | | [optional] |
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
require 'weft-sdk'
|
|
20
|
+
|
|
21
|
+
instance = Weft::SearchPaymentOffer.new(
|
|
22
|
+
protocol: null,
|
|
23
|
+
scheme: null,
|
|
24
|
+
network: null,
|
|
25
|
+
asset: null,
|
|
26
|
+
amount: null,
|
|
27
|
+
pay_to: null,
|
|
28
|
+
max_timeout_seconds: null,
|
|
29
|
+
facilitator: null
|
|
30
|
+
)
|
|
31
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Weft::SearchPriceAtomicFilter
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **lte** | **Integer** | Price ≤ this many micro-USD (inclusive ceiling). | [optional] |
|
|
8
|
+
| **gte** | **Integer** | Price ≥ this many micro-USD (inclusive floor). | [optional] |
|
|
9
|
+
| **eq** | **Integer** | Price exactly this many micro-USD. | [optional] |
|
|
10
|
+
| **range_gte** | **Integer** | Range lower bound (inclusive), micro-USD. Set with range_lte. | [optional] |
|
|
11
|
+
| **range_lte** | **Integer** | Range upper bound (inclusive), micro-USD. Set with range_gte. | [optional] |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'weft-sdk'
|
|
17
|
+
|
|
18
|
+
instance = Weft::SearchPriceAtomicFilter.new(
|
|
19
|
+
lte: null,
|
|
20
|
+
gte: null,
|
|
21
|
+
eq: null,
|
|
22
|
+
range_gte: null,
|
|
23
|
+
range_lte: null
|
|
24
|
+
)
|
|
25
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Weft::SearchPriceUsdFilter
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **lte** | **String** | Price ≤ this many USD (inclusive ceiling), e.g. \"0.009\". | [optional] |
|
|
8
|
+
| **gte** | **String** | Price ≥ this many USD (inclusive floor), e.g. \"0.001\". | [optional] |
|
|
9
|
+
| **eq** | **String** | Price exactly this many USD, e.g. \"1.5\". | [optional] |
|
|
10
|
+
| **range_gte** | **String** | Range lower bound (inclusive), USD. Set with range_lte. | [optional] |
|
|
11
|
+
| **range_lte** | **String** | Range upper bound (inclusive), USD. Set with range_gte. | [optional] |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'weft-sdk'
|
|
17
|
+
|
|
18
|
+
instance = Weft::SearchPriceUsdFilter.new(
|
|
19
|
+
lte: null,
|
|
20
|
+
gte: null,
|
|
21
|
+
eq: null,
|
|
22
|
+
range_gte: null,
|
|
23
|
+
range_lte: null
|
|
24
|
+
)
|
|
25
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Weft::SearchProtocolFilter
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **eq** | **String** | Primary protocol is exactly this value. | [optional] |
|
|
8
|
+
| **_in** | **Array<String>** | Primary protocol is one of these values. | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'weft-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Weft::SearchProtocolFilter.new(
|
|
16
|
+
eq: null,
|
|
17
|
+
_in: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Weft::SearchProviderRef
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **provider_id** | **String** | | [optional] |
|
|
8
|
+
| **display_name** | **String** | | [optional] |
|
|
9
|
+
| **origin_domains** | **Array<String>** | | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'weft-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Weft::SearchProviderRef.new(
|
|
17
|
+
provider_id: null,
|
|
18
|
+
display_name: null,
|
|
19
|
+
origin_domains: null
|
|
20
|
+
)
|
|
21
|
+
```
|
data/docs/SearchRequest.md
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **query** | **String** | Free-text query. Required and non-empty. | |
|
|
8
|
-
| **
|
|
9
|
-
| **filters** | [**
|
|
8
|
+
| **max_results** | **Integer** | Max number of hits to return. Invalid values are rejected, not clamped. | [optional][default to 10] |
|
|
9
|
+
| **filters** | [**SearchFilterSpec**](SearchFilterSpec.md) | | [optional] |
|
|
10
10
|
|
|
11
11
|
## Example
|
|
12
12
|
|
|
@@ -15,8 +15,7 @@ require 'weft-sdk'
|
|
|
15
15
|
|
|
16
16
|
instance = Weft::SearchRequest.new(
|
|
17
17
|
query: send email from an agent,
|
|
18
|
-
|
|
18
|
+
max_results: null,
|
|
19
19
|
filters: null
|
|
20
20
|
)
|
|
21
21
|
```
|
|
22
|
-
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Weft::SearchResourceTypeFilter
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **eq** | **String** | Resource type is exactly this value. | [optional] |
|
|
8
|
+
| **_in** | **Array<String>** | Resource type is one of these values. | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'weft-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Weft::SearchResourceTypeFilter.new(
|
|
16
|
+
eq: null,
|
|
17
|
+
_in: null
|
|
18
|
+
)
|
|
19
|
+
```
|
data/docs/SearchResponse.md
CHANGED
|
@@ -4,10 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **
|
|
8
|
-
| **
|
|
9
|
-
| **
|
|
10
|
-
| **
|
|
7
|
+
| **query_trace_id** | **String** | Opaque trace id for the served query, matching the platform `query_trace_id` — and the `search_id` that re-reads it. Deliberately the same id rather than a second handle: one serve, one name. | |
|
|
8
|
+
| **query** | **String** | | |
|
|
9
|
+
| **format** | **String** | Which view this response carries, echoing the requested format. `json` populates `results` and leaves `markdown` null; `markdown` populates `markdown` and leaves `results` empty. Exactly one is populated per response, never both — returning both eagerly would double the payload. | [optional] |
|
|
10
|
+
| **markdown** | **String** | The flat comparison table, when `format` is `markdown`; null otherwise. Rendered deterministically from the same stored result the `json` view returns, so the two views of one search can never disagree. | [optional] |
|
|
11
|
+
| **result_count** | **Integer** | How many `(Provider + Capability)` results the search produced. Read THIS, not `results.length`, for the count: on a `markdown` response `results` is empty by design, so `result_count > 0` with an empty `results` is a rendered table while `result_count == 0` is a genuine zero-result. | [optional] |
|
|
12
|
+
| **served_from** | **String** | `live` for a fresh serve; `snapshot` for an immutable replay of a completed search. A re-read is a snapshot and says so — read it with `as_of` and `stale`. | [optional] |
|
|
13
|
+
| **as_of** | **Time** | When the results were produced. Now on a `live` serve; on a `snapshot` the ORIGINAL serve time, because a replay returns exactly what was paid for, not current truth. | [optional] |
|
|
14
|
+
| **stale** | **Boolean** | Whether the active search index has changed since these results were produced. `true` does not mean the results are wrong — it means they are a snapshot of an index that has since moved. Always `false` on a `live` serve. | [optional] |
|
|
15
|
+
| **payment_note** | **String** | How payment works across the catalog, stated once for the whole response rather than repeated in every endpoint's usage instructions. | [optional] |
|
|
16
|
+
| **applied_filters** | [**SearchFilterSpec**](SearchFilterSpec.md) | The `FilterSpec` actually applied to recall, echoed back so the caller sees exactly what constrained the results. In the current contract this is the caller's `filters` verbatim (empty object when none were sent). | [optional] |
|
|
17
|
+
| **decomposition_source** | **String** | Origin of `applied_filters`; always `CALLER`. | [optional] |
|
|
18
|
+
| **embedder_model** | **String** | | |
|
|
19
|
+
| **candidates_considered** | **Integer** | | |
|
|
20
|
+
| **warnings** | [**Array<SearchResponseWarningsInner>**](SearchResponseWarningsInner.md) | | |
|
|
21
|
+
| **match_quality** | **String** | Calibrated confidence in this result set — read this instead of thresholding a raw similarity score. `strong`: the top match is confidently on-intent, proceed. `weak`: above the relevance floor but inside the band where plausible-but-wrong matches live, verify the result before paying. `none`: nothing cleared the floor — `results` is empty and `reason` / `suggestion` say why. Results below the floor are never returned as near-misses. | [optional][default to 'none'] |
|
|
22
|
+
| **reason** | **String** | Machine-readable cause of an empty result set, non-null exactly when `match_quality` is `none`. `below_relevance_floor`: candidates ranked but the best scored under the floor. `filter_collapsed_pool`: a caller filter cut the pool before ranking and nothing relevant survived — relax the filter. `no_catalog_coverage`: recall returned no candidates at all on an unfiltered query. `unsupported_filter_value`: a CATEGORICAL filter value (`type` / `protocol`) matches zero stored values, so it could never have matched — categorical only, since a continuous bound like `price` that matches nothing is reported as `filter_collapsed_pool` instead (the bound needs raising, the dimension is not unsupported). `index_unavailable`: no active index — an operational fault, paired with the `EMPTY_INDEX` warning. | [optional] |
|
|
23
|
+
| **suggestion** | **String** | Human/agent-readable explanation of `reason`, carrying the concrete numbers behind it (pool sizes, the best discarded score against the floor, the values actually stored for a filter). Non-null exactly when `reason` is. | [optional] |
|
|
24
|
+
| **results** | [**Array<SearchResult>**](SearchResult.md) | Ranked `(Provider + Capability)` results; empty when the index is empty or nothing cleared the relevance floor. Results BELOW the floor are never returned — an empty list plus a `reason` is the honest answer, not a list of near-misses in the same shape as a genuine match. | |
|
|
11
25
|
| **_mock** | **Boolean** | Present and `true` only when served by the mock backend. | [optional] |
|
|
12
26
|
|
|
13
27
|
## Example
|
|
@@ -16,11 +30,24 @@
|
|
|
16
30
|
require 'weft-sdk'
|
|
17
31
|
|
|
18
32
|
instance = Weft::SearchResponse.new(
|
|
33
|
+
query_trace_id: null,
|
|
34
|
+
query: null,
|
|
35
|
+
format: null,
|
|
36
|
+
markdown: null,
|
|
37
|
+
result_count: null,
|
|
38
|
+
served_from: null,
|
|
39
|
+
as_of: null,
|
|
40
|
+
stale: null,
|
|
41
|
+
payment_note: null,
|
|
42
|
+
applied_filters: null,
|
|
43
|
+
decomposition_source: null,
|
|
44
|
+
embedder_model: null,
|
|
45
|
+
candidates_considered: null,
|
|
46
|
+
warnings: null,
|
|
47
|
+
match_quality: null,
|
|
48
|
+
reason: null,
|
|
49
|
+
suggestion: null,
|
|
19
50
|
results: null,
|
|
20
|
-
paid_usd: null,
|
|
21
|
-
tx_hash: null,
|
|
22
|
-
artifact_id: null,
|
|
23
51
|
_mock: null
|
|
24
52
|
)
|
|
25
53
|
```
|
|
26
|
-
|