weft-sdk 0.25.0 → 0.32.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.
- checksums.yaml +4 -4
- data/docs/FetchApi.md +3 -3
- data/docs/FetchErrorResponse.md +1 -1
- data/docs/FetchRequest.md +6 -2
- data/docs/FetchResponse.md +5 -3
- data/docs/GetPurchaseIdParameter.md +48 -0
- data/docs/PaymentsApi.md +2 -0
- data/docs/Purchase.md +6 -0
- data/docs/PurchasesApi.md +2 -2
- data/docs/SearchApi.md +1 -1
- data/docs/SearchCompactAccess.md +23 -0
- data/docs/SearchCompactAccessPrice.md +23 -0
- data/docs/SearchCompactNextCall.md +23 -0
- data/docs/SearchCompactResult.md +47 -0
- data/docs/SearchCompactResultAttribution.md +21 -0
- data/docs/SearchCompactResultBlockedScopesInner.md +19 -0
- data/docs/SearchCompactResultOperation.md +21 -0
- data/docs/SearchCompactResultProvider.md +19 -0
- data/docs/SearchEndpointCall.md +1 -1
- data/docs/SearchEndpointCallInputSchema.md +14 -0
- data/docs/SearchEndpointHit.md +5 -1
- data/docs/SearchHelperDocs.md +23 -0
- data/docs/SearchRequest.md +3 -1
- data/docs/SearchResponse.md +9 -3
- data/docs/SearchWeftFetchCompatibility.md +3 -1
- data/docs/WebhooksApi.md +414 -0
- data/lib/weft/client.rb +271 -0
- data/lib/weft/error.rb +41 -0
- data/lib/weft/facilitator/client.rb +179 -42
- data/lib/weft/facilitator/echo.rb +99 -0
- data/lib/weft/facilitator/extensions.rb +183 -0
- data/lib/weft/facilitator/fee.rb +26 -11
- data/lib/weft/facilitator/handshake.rb +92 -0
- data/lib/weft/facilitator/json_wire.rb +74 -0
- data/lib/weft/facilitator/middleware.rb +562 -137
- data/lib/weft/facilitator/path_match.rb +179 -0
- data/lib/weft/facilitator/product.rb +380 -0
- data/lib/weft/facilitator/replay.rb +46 -0
- data/lib/weft/facilitator/settlement.rb +117 -0
- data/lib/weft/facilitator/x402.rb +355 -0
- data/lib/weft/generated/api/account_api.rb +2 -2
- data/lib/weft/generated/api/agent_bootstrap_api.rb +2 -2
- data/lib/weft/generated/api/api_keys_api.rb +2 -2
- data/lib/weft/generated/api/auth_api.rb +2 -2
- data/lib/weft/generated/api/balance_api.rb +2 -2
- data/lib/weft/generated/api/documentation_api.rb +2 -2
- data/lib/weft/generated/api/fetch_api.rb +6 -6
- data/lib/weft/generated/api/payments_api.rb +4 -2
- data/lib/weft/generated/api/purchases_api.rb +4 -4
- data/lib/weft/generated/api/resources_api.rb +2 -2
- data/lib/weft/generated/api/search_api.rb +4 -4
- data/lib/weft/generated/api/webhooks_api.rb +388 -0
- 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_bootstrap_approval.rb +2 -2
- data/lib/weft/generated/models/account_bootstrap_created.rb +2 -2
- data/lib/weft/generated/models/account_bootstrap_created_approval.rb +2 -2
- data/lib/weft/generated/models/account_bootstrap_created_response.rb +2 -2
- data/lib/weft/generated/models/account_bootstrap_request.rb +2 -2
- data/lib/weft/generated/models/account_bootstrap_status.rb +2 -2
- data/lib/weft/generated/models/account_bootstrap_status_response.rb +2 -2
- data/lib/weft/generated/models/account_details.rb +2 -2
- 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 +2 -2
- 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 +2 -2
- data/lib/weft/generated/models/error.rb +2 -2
- data/lib/weft/generated/models/error_response.rb +2 -2
- data/lib/weft/generated/models/fetch403_response.rb +2 -2
- data/lib/weft/generated/models/fetch_balance_snapshot.rb +2 -2
- data/lib/weft/generated/models/fetch_error_response.rb +5 -5
- data/lib/weft/generated/models/fetch_request.rb +46 -5
- data/lib/weft/generated/models/fetch_request_body.rb +2 -2
- data/lib/weft/generated/models/fetch_response.rb +36 -64
- data/lib/weft/generated/models/get_purchase_id_parameter.rb +104 -0
- data/lib/weft/generated/models/insufficient_scope_response.rb +2 -2
- data/lib/weft/generated/models/me_api_key.rb +2 -2
- data/lib/weft/generated/models/me_api_key_creator.rb +2 -2
- data/lib/weft/generated/models/me_response.rb +2 -2
- data/lib/weft/generated/models/me_response_data.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 +2 -2
- 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 +2 -2
- data/lib/weft/generated/models/promo_balance.rb +2 -2
- data/lib/weft/generated/models/purchase.rb +75 -3
- data/lib/weft/generated/models/purchase_artifact.rb +2 -2
- data/lib/weft/generated/models/purchase_list_response.rb +2 -2
- data/lib/weft/generated/models/purchase_response.rb +2 -2
- data/lib/weft/generated/models/rate_limit_response.rb +2 -2
- data/lib/weft/generated/models/resend_confirmation_request.rb +2 -2
- data/lib/weft/generated/models/resource_enrollment_request.rb +2 -2
- 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_access_method.rb +2 -2
- data/lib/weft/generated/models/search_capability_ref.rb +2 -2
- data/lib/weft/generated/models/search_compact_access.rb +179 -0
- data/lib/weft/generated/models/search_compact_access_price.rb +176 -0
- data/lib/weft/generated/models/search_compact_next_call.rb +275 -0
- data/lib/weft/generated/models/search_compact_result.rb +389 -0
- data/lib/weft/generated/models/search_compact_result_attribution.rb +166 -0
- data/lib/weft/generated/models/search_compact_result_blocked_scopes_inner.rb +156 -0
- data/lib/weft/generated/models/search_compact_result_operation.rb +183 -0
- data/lib/weft/generated/models/search_compact_result_provider.rb +156 -0
- data/lib/weft/generated/models/search_curated_callability.rb +2 -2
- data/lib/weft/generated/models/search_curated_execution.rb +2 -2
- data/lib/weft/generated/models/search_curated_operation.rb +2 -2
- data/lib/weft/generated/models/search_curated_service.rb +2 -2
- data/lib/weft/generated/models/search_curated_source.rb +2 -2
- data/lib/weft/generated/models/search_endpoint_call.rb +4 -4
- data/lib/weft/generated/models/search_endpoint_call_input_schema.rb +103 -0
- data/lib/weft/generated/models/search_endpoint_hit.rb +25 -6
- data/lib/weft/generated/models/search_endpoint_price.rb +2 -2
- data/lib/weft/generated/models/search_error_response.rb +4 -4
- data/lib/weft/generated/models/search_execution_mode_filter.rb +2 -2
- data/lib/weft/generated/models/search_filter_spec.rb +2 -2
- data/lib/weft/generated/models/search_helper_docs.rb +175 -0
- data/lib/weft/generated/models/search_method_filter.rb +2 -2
- data/lib/weft/generated/models/search_payment_offer.rb +2 -2
- data/lib/weft/generated/models/search_price_atomic_filter.rb +2 -2
- data/lib/weft/generated/models/search_price_usd_filter.rb +2 -2
- data/lib/weft/generated/models/search_protocol_filter.rb +2 -2
- data/lib/weft/generated/models/search_provider_ref.rb +2 -2
- data/lib/weft/generated/models/search_request.rb +50 -6
- data/lib/weft/generated/models/search_resource_type_filter.rb +2 -2
- data/lib/weft/generated/models/search_response.rb +71 -8
- data/lib/weft/generated/models/search_response_warnings_inner.rb +2 -2
- data/lib/weft/generated/models/search_result.rb +2 -2
- data/lib/weft/generated/models/search_string_set_filter.rb +2 -2
- data/lib/weft/generated/models/search_weft_fetch_compatibility.rb +28 -6
- 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 +2 -2
- data/lib/weft/generated/models/wallet.rb +2 -2
- data/lib/weft/generated/version.rb +3 -3
- data/lib/weft/sdk.rb +3 -1
- metadata +39 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 49f6e59bc59298066b25022afb6f38b5e80292f6a313ad2ec35d62206500a824
|
|
4
|
+
data.tar.gz: 37b8b509144e36d1750482d42802255eb8da53d5fd5fac901e788b096c9a5b55
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 32b028a2b10064f0992c818d162eb47433bfe7ee6ac6635c8ce36b355683ff1e70d8982cfec6637db38757b9dc4cf758ca9321c2f26ed70341aa5a752f0fa2df
|
|
7
|
+
data.tar.gz: 5de9290d8982fe2e1586fd35081cdb2dcc43c57f1c0a89a870e163b859ebb11fc9274c1e8ccce974895d0e61a7f6381d367b3803ee1397b50cbb9e979307e21e
|
data/docs/FetchApi.md
CHANGED
|
@@ -13,7 +13,7 @@ All URIs are relative to *https://weft.network*
|
|
|
13
13
|
|
|
14
14
|
Pay-and-fetch any URL (x402/MPP proxy)
|
|
15
15
|
|
|
16
|
-
Universal x402/MPP fetch proxy. The caller provides a target `url`, a
|
|
16
|
+
Universal x402/MPP fetch proxy. The caller provides a target `url`, a merchant-principal `max_cost_usd` ceiling, and optional `method` / `body` / `headers`. Weft: 1. Issues the request. 2. On `402 Payment Required`, selects a supported x402 or MPP challenge. 3. Compares the asking price to `max_cost_usd` and the buyer's policy (`max_tx_usd`, daily/weekly limits). 4. If refill is allowed and an eligible mainnet MPP challenge finds its Tempo token short, creates or adopts a buyer-owned Base-to-Tempo refill and returns `409 FUNDING_PENDING` with `details.reason=funding_active`. If an overlapping payment invalidates the balance observation before a bridge is created, the same retryable response carries `details.reason=balance_changed`. The caller retries the identical fetch after `details.retry_after_seconds`; that later request obtains a fresh challenge and reruns rail selection and all payment controls. 5. Authorizes payment from the buyer's wallet on the selected rail. 6. Replays the request with the protocol-specific payment credential. 7. Streams the upstream artifact back, base64-encoded under `body_base64`, with `paid_usd`, `held_usd`, `payment_status`, `tx_hash`, `protocol`, and `purchase_id`. `paid_usd` is \"0.00\" until the charge is CONFIRMED settled — a signed-but- unsettled hold (the common case for x402, which settles asynchronously) reports its amount in `held_usd` instead, never in `paid_usd`. `purchase_id` is the id that `GET /api/v1/purchases/{id}` accepts, so a caller can read how a pending charge ends. **Opt-in safety controls:** `allow_tempo_refill: false` prevents this request from creating, adopting, or enqueueing a Base-to-Tempo bridge. A Tempo shortfall returns `402 INSUFFICIENT_BALANCE`; unrelated bridges and their jobs remain unchanged. `access_method_id` is advisory and does not enforce a payment rail. `max_total_cost_usd` is an all-in ceiling covering merchant principal, network gas, provider fees, and prerequisite buyer-paid operations. It disables refill; explicitly combining it with `allow_tempo_refill: true` returns `422 INCOMPATIBLE_FETCH_CONTROLS`. Current wallet integrations provide no supported binding all-in fee guarantee. Therefore all-in requests return `402 TOTAL_COST_UNVERIFIABLE` before payment preparation, approval, reservation, or refill. This also refuses recovery of older payments and SIWX wallet signing; it admits no positive paid route. Increasing the ceiling does not resolve missing fee authority. Omitted controls preserve existing behavior. Ordinary non-402 merchant responses retain `MERCHANT_RETURNED_NON_402`. Stored-result replay is historical payment information, not a new bounded authorization. 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, an OAuth access token carrying `fetch`, or a claimed `wbt_*` bearer. **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
17
|
|
|
18
18
|
### Examples
|
|
19
19
|
|
|
@@ -29,7 +29,7 @@ end
|
|
|
29
29
|
api_instance = Weft::FetchApi.new
|
|
30
30
|
fetch_request = Weft::FetchRequest.new({url: 'https://x402.api.agentmail.to/v0/inboxes'}) # FetchRequest |
|
|
31
31
|
opts = {
|
|
32
|
-
idempotency_key: 'idempotency_key_example' # String | Opaque caller-generated retry key. Reusing the same key for the same buyer converges on one paid fetch; keys are hashed and namespaced by buyer before storage. Send this header for every unattended or retryable paid request.
|
|
32
|
+
idempotency_key: 'idempotency_key_example' # String | Opaque caller-generated retry key. Reusing the same key for the same buyer converges on one paid fetch; keys are hashed and namespaced by buyer before storage. Send this header for every unattended or retryable paid request. Effective safety controls participate in retry identity. Changing them under a reserved key returns `IDEMPOTENCY_CONFLICT`; an older unconstrained payment cannot become a bounded success on retry.
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
begin
|
|
@@ -64,7 +64,7 @@ end
|
|
|
64
64
|
| Name | Type | Description | Notes |
|
|
65
65
|
| ---- | ---- | ----------- | ----- |
|
|
66
66
|
| **fetch_request** | [**FetchRequest**](FetchRequest.md) | | |
|
|
67
|
-
| **idempotency_key** | **String** | Opaque caller-generated retry key. Reusing the same key for the same buyer converges on one paid fetch; keys are hashed and namespaced by buyer before storage. Send this header for every unattended or retryable paid request. | [optional] |
|
|
67
|
+
| **idempotency_key** | **String** | Opaque caller-generated retry key. Reusing the same key for the same buyer converges on one paid fetch; keys are hashed and namespaced by buyer before storage. Send this header for every unattended or retryable paid request. Effective safety controls participate in retry identity. Changing them under a reserved key returns `IDEMPOTENCY_CONFLICT`; an older unconstrained payment cannot become a bounded success on retry. | [optional] |
|
|
68
68
|
|
|
69
69
|
### Return type
|
|
70
70
|
|
data/docs/FetchErrorResponse.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **error** | **String** | Stable error code. | |
|
|
8
|
-
| **details** | **Hash<String, Object>** | Optional context. Shape varies by error code. | |
|
|
8
|
+
| **details** | **Hash<String, Object>** | Optional context. Shape varies by error code. `purchase_id` (opaque string) is present when the failure follows a payment row for this request — a new, resumed, or replayed payment. It is the id that `GET /api/v1/purchases/{id}` accepts: read that purchase to learn whether the charge settled, instead of assuming either outcome. It is absent when the request was refused before any payment row existed. | |
|
|
9
9
|
| **policy** | [**SpendingPolicy**](SpendingPolicy.md) | | |
|
|
10
10
|
| **balance** | [**FetchBalanceSnapshot**](FetchBalanceSnapshot.md) | | |
|
|
11
11
|
| **dashboard_url** | **String** | Deep-link to the dashboard's policy page. | |
|
data/docs/FetchRequest.md
CHANGED
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **url** | **String** | Target URL. Must pass Weft's URL safety check (no SSRF / private IP ranges). | |
|
|
8
|
-
| **max_cost_usd** | **String** |
|
|
8
|
+
| **max_cost_usd** | **String** | Merchant-principal ceiling, excluding gas, provider fees and prerequisites. Defaults to `0.10` USD; use `max_total_cost_usd` for an all-in bound. | [optional][default to '0.10'] |
|
|
9
|
+
| **allow_tempo_refill** | **Boolean** | Whether this request may create, adopt, or enqueue a Base-to-Tempo refill. Only JSON booleans are accepted. Omission allows legacy refill behavior unless `max_total_cost_usd` is supplied, in which case refill is disabled. False leaves unrelated bridges and jobs unchanged and reports an unfunded Tempo pocket as `INSUFFICIENT_BALANCE`. This does not select a rail or bound fees. | [optional] |
|
|
10
|
+
| **max_total_cost_usd** | **String** | Optional all-in buyer-debit ceiling in USD, including principal, gas, provider fees and prerequisite operations. Requires a binding upstream upper bound before any payment effect. Current integrations have no such guarantee, so requests requiring wallet signing or payment fail closed with `TOTAL_COST_UNVERIFIABLE`, including recovery and replay of previous payments. No positive paid route is currently admitted in this mode. Estimates, expected sponsorship and receipts are not authority. Implies no refill; explicit `allow_tempo_refill: true` is invalid. Omission preserves legacy behavior. | [optional] |
|
|
9
11
|
| **method** | **String** | HTTP method to use against the upstream. | [optional][default to 'GET'] |
|
|
10
12
|
| **body** | [**FetchRequestBody**](FetchRequestBody.md) | | [optional] |
|
|
11
13
|
| **headers** | **Hash<String, String>** | Headers forwarded to the upstream. Up to 32 headers, 4 KB total. The following are silently stripped: `host`, `authorization`, `cookie`, `proxy-authorization`, `x-forwarded-*`, `x-real-ip`, `x-payment`, `connection`, `upgrade`. | [optional] |
|
|
12
14
|
| **search_id** | **String** | The `query_trace_id` from the `POST /api/v1/search` response that surfaced this URL. Optional and advisory: it attributes the purchase to the search that found it, and is used only for measurement. It never affects payment, authorization, idempotency, or the response body — the buyer is always resolved from the credential, never from this field. A value that is not a well-formed handle is ignored rather than rejected, so an analytics mistake can never cost a fetch. | [optional] |
|
|
13
15
|
| **operation_id** | **String** | Advisory operation id returned by search. | [optional] |
|
|
14
|
-
| **access_method_id** | **String** | Advisory access-method id returned by search. | [optional] |
|
|
16
|
+
| **access_method_id** | **String** | Advisory access-method id returned by search; does not enforce a payment rail. | [optional] |
|
|
15
17
|
|
|
16
18
|
## Example
|
|
17
19
|
|
|
@@ -21,6 +23,8 @@ require 'weft-sdk'
|
|
|
21
23
|
instance = Weft::FetchRequest.new(
|
|
22
24
|
url: https://x402.api.agentmail.to/v0/inboxes,
|
|
23
25
|
max_cost_usd: 0.05,
|
|
26
|
+
allow_tempo_refill: false,
|
|
27
|
+
max_total_cost_usd: 0.05,
|
|
24
28
|
method: null,
|
|
25
29
|
body: null,
|
|
26
30
|
headers: {Accept=application/json, User-Agent=my-agent/1.0},
|
data/docs/FetchResponse.md
CHANGED
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **status** | **Integer** | HTTP status returned by the upstream after the
|
|
7
|
+
| **status** | **Integer** | HTTP status returned by the upstream after the payment or SIWX authentication retry. | |
|
|
8
8
|
| **headers** | **Hash<String, String>** | Response headers from the upstream. | |
|
|
9
9
|
| **body_base64** | **String** | Base64-encoded response body. Empty string for empty bodies. | |
|
|
10
10
|
| **paid_usd** | **String** | USD amount actually settled on-chain. \"0.00\" for any charge that hasn't (yet, or ever) settled — a signed hold is not yet spend. See `held_usd` for the nominal amount in that case. Exact to the micro-dollar, minimum two decimals; parse as a decimal rather than string-comparing against a bare zero literal. | |
|
|
11
11
|
| **held_usd** | **String** | The nominal charge amount when `paid_usd` is \"0.00\" — a hold awaiting settlement, or a charge that failed/expired without ever settling. `null` once `paid_usd` reflects the real settlement. Same format as `paid_usd`: exact to the micro-dollar, minimum two decimals. | |
|
|
12
|
-
| **payment_status** | **String** | Agent-facing settlement status. `pending` = signed, no refusal signal yet (settlement may still land, e.g. x402's async facilitator webhook). `declined-pending` = the merchant refused but the authorization isn't provably dead yet. `declined` / `expired` / `reverted` are terminal — the money never moved (or, for `reverted`, moved and then reversed on-chain) and never will for this charge. | |
|
|
12
|
+
| **payment_status** | **String** | Agent-facing settlement status. `not_required` means SIWX wallet authentication returned the response without payment. `pending` = signed, no refusal signal yet (settlement may still land, e.g. x402's async facilitator webhook). `declined-pending` = the merchant refused but the authorization isn't provably dead yet. `declined` / `expired` / `reverted` are terminal — the money never moved (or, for `reverted`, moved and then reversed on-chain) and never will for this charge. | |
|
|
13
13
|
| **tx_hash** | **String** | Settlement transaction hash. Null until a settlement hash has been reported. | |
|
|
14
14
|
| **protocol** | **String** | Payment protocol selected for this fetch. | |
|
|
15
15
|
| **artifact_id** | **Integer** | Internal artifact identifier if the response was persisted; `null` otherwise. | |
|
|
16
|
+
| **purchase_id** | **String** | The buyer purchase that paid for this fetch: an opaque id that `GET /api/v1/purchases/{id}` accepts and that purchase rows carry as `purchase_id`. It is not the sequential `Purchase.id`; do not parse or order by it. That purchase reports its own `status`, not `payment_status`: `signed` while the payment is pending, then `settled` (charged its `amount_usd`, which can be less than `held_usd`) or `declined`, `locked`, `expired`, or `reverted` (not charged). A `settled` purchase with `failure_reason: merchant_delivery_failed` was charged, but no successful paid response was delivered. An idempotent replay returns the same id, so bill at most once for each id. `null` when no payment was made (`payment_status: not_required`). The lookup needs purchase-history access: a `wk_*` key, a claimed `wbt_*` bearer, or a REST OAuth token with the `balance` scope. An OAuth token issued for the MCP server cannot call this endpoint. Current servers always send this field. It is optional in this schema so that a client also accepts a response from an older server. | [optional] |
|
|
16
17
|
|
|
17
18
|
## Example
|
|
18
19
|
|
|
@@ -28,6 +29,7 @@ instance = Weft::FetchResponse.new(
|
|
|
28
29
|
payment_status: pending,
|
|
29
30
|
tx_hash: null,
|
|
30
31
|
protocol: null,
|
|
31
|
-
artifact_id: null
|
|
32
|
+
artifact_id: null,
|
|
33
|
+
purchase_id: pur_4V3n9mQ0b7XyK2sLpR8tWc1d
|
|
32
34
|
)
|
|
33
35
|
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Weft::GetPurchaseIdParameter
|
|
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::GetPurchaseIdParameter.openapi_one_of
|
|
15
|
+
# =>
|
|
16
|
+
# [
|
|
17
|
+
# :'Integer',
|
|
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::GetPurchaseIdParameter.build(data)
|
|
32
|
+
# => #<Integer:0x00007fdd4aab02a0>
|
|
33
|
+
|
|
34
|
+
Weft::GetPurchaseIdParameter.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
|
+
- `Integer`
|
|
47
|
+
- `String`
|
|
48
|
+
- `nil` (if no type matches)
|
data/docs/PaymentsApi.md
CHANGED
|
@@ -81,6 +81,8 @@ end
|
|
|
81
81
|
|
|
82
82
|
List payments
|
|
83
83
|
|
|
84
|
+
Seller payment receipts for the authenticated organization. A resource key with `product_id` set returns only payments whose `product_id` is that product. A resource key with `product_id` nil returns the organization. A payment outside that scope is not found.
|
|
85
|
+
|
|
84
86
|
### Examples
|
|
85
87
|
|
|
86
88
|
```ruby
|
data/docs/Purchase.md
CHANGED
|
@@ -5,12 +5,15 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **id** | **Integer** | | |
|
|
8
|
+
| **purchase_id** | **String** | Opaque purchase id: the value fetch returns as `purchase_id` and that `GET /api/v1/purchases/{id}` accepts. Prefer it over the sequential `id`. Current servers always send this field; it is optional in this schema so that a client also accepts a response from an older server. | [optional] |
|
|
8
9
|
| **status** | **String** | | |
|
|
9
10
|
| **amount_usd** | **String** | Exact decimal USD amount with up to six fractional digits. Settled rows report the amount that moved; pending and failed rows report their authorization amount. | |
|
|
10
11
|
| **recipient_address** | **String** | | |
|
|
11
12
|
| **network** | **String** | | |
|
|
12
13
|
| **protocol** | **String** | | |
|
|
13
14
|
| **context** | **String** | | |
|
|
15
|
+
| **search_id** | **String** | Search trace ID used to attribute this purchase, when available. | |
|
|
16
|
+
| **attribution_status** | **String** | | |
|
|
14
17
|
| **tx_hash** | **String** | | |
|
|
15
18
|
| **reject_reason** | **String** | | |
|
|
16
19
|
| **failure_reason** | **String** | | |
|
|
@@ -26,12 +29,15 @@ require 'weft-sdk'
|
|
|
26
29
|
|
|
27
30
|
instance = Weft::Purchase.new(
|
|
28
31
|
id: null,
|
|
32
|
+
purchase_id: pur_4V3n9mQ0b7XyK2sLpR8tWc1d,
|
|
29
33
|
status: null,
|
|
30
34
|
amount_usd: null,
|
|
31
35
|
recipient_address: null,
|
|
32
36
|
network: null,
|
|
33
37
|
protocol: null,
|
|
34
38
|
context: null,
|
|
39
|
+
search_id: null,
|
|
40
|
+
attribution_status: null,
|
|
35
41
|
tx_hash: null,
|
|
36
42
|
reject_reason: null,
|
|
37
43
|
failure_reason: null,
|
data/docs/PurchasesApi.md
CHANGED
|
@@ -26,7 +26,7 @@ Weft.configure do |config|
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
api_instance = Weft::PurchasesApi.new
|
|
29
|
-
id =
|
|
29
|
+
id = nil # GetPurchaseIdParameter | The opaque `purchase_id` (`pur_…`) that fetch returns, or the legacy integer `id`. Both resolve only within the caller's own purchases. New callers should store and send `purchase_id`.
|
|
30
30
|
|
|
31
31
|
begin
|
|
32
32
|
# Get a buyer purchase
|
|
@@ -59,7 +59,7 @@ end
|
|
|
59
59
|
|
|
60
60
|
| Name | Type | Description | Notes |
|
|
61
61
|
| ---- | ---- | ----------- | ----- |
|
|
62
|
-
| **id** | **
|
|
62
|
+
| **id** | [**GetPurchaseIdParameter**](.md) | The opaque `purchase_id` (`pur_…`) that fetch returns, or the legacy integer `id`. Both resolve only within the caller's own purchases. New callers should store and send `purchase_id`. | |
|
|
63
63
|
|
|
64
64
|
### Return type
|
|
65
65
|
|
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 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. Account-scoped: the bearer token must be a buyer-scoped API key, an OAuth token carrying `search`, or a pending or claimed `wbt_*` bootstrap bearer. Pending bootstrap access uses an anonymous bootstrap identity; after claim, the promoted bearer uses its bound User. Rejection, cancellation, expiry, and revocation end bootstrap search. Bootstrap search is limited to 60 requests per credential and 120 per IP each hour before native credential promotion. 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.
|
|
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. Account-scoped: the bearer token must be a buyer-scoped API key, an OAuth token carrying `search`, or a pending or claimed `wbt_*` bootstrap bearer. Pending bootstrap access uses an anonymous bootstrap identity; after claim, the promoted bearer uses its bound User. Rejection, cancellation, expiry, and revocation end bootstrap search. Bootstrap search is limited to 60 requests per credential and 120 per IP each hour before native credential promotion. 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. Compact view: send `view: \"compact\"` to get the agent view of the hosted MCP `weft_search` tool. Each result is a small contract for the next paid call (below 2,000 JSON bytes): typed inputs, the request recipe, one access method with price, attribution, a ready `next_call` to `POST /api/v1/fetch` when the request is determined, and the authenticated `contract_url` for the full contract. Use it when you give search results to a model. The compact rows are in `compact_results`; `results` is empty. The compact view is JSON only and needs the curated search backend.
|
|
17
17
|
|
|
18
18
|
### Examples
|
|
19
19
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Weft::SearchCompactAccess
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | The `access_method_id` to send to `POST /api/v1/fetch`. | [optional] |
|
|
8
|
+
| **protocol** | **String** | | [optional] |
|
|
9
|
+
| **weft_fetch** | **Hash<String, Object>** | Whether the Weft fetch runtime can pay this access method (`state`, and `reason` and `coverage` when they fit). | [optional] |
|
|
10
|
+
| **price** | [**SearchCompactAccessPrice**](SearchCompactAccessPrice.md) | | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'weft-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Weft::SearchCompactAccess.new(
|
|
18
|
+
id: null,
|
|
19
|
+
protocol: null,
|
|
20
|
+
weft_fetch: null,
|
|
21
|
+
price: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Weft::SearchCompactAccessPrice
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **kind** | **String** | Price kind, such as `fixed`, `dynamic`, `free` or `unknown`. | [optional] |
|
|
8
|
+
| **indexed_usd** | **String** | Indexed USD price. A `dynamic` price is not a cap. | [optional] |
|
|
9
|
+
| **unit** | **String** | | [optional] |
|
|
10
|
+
| **hint** | **String** | | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'weft-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Weft::SearchCompactAccessPrice.new(
|
|
18
|
+
kind: null,
|
|
19
|
+
indexed_usd: null,
|
|
20
|
+
unit: null,
|
|
21
|
+
hint: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Weft::SearchCompactNextCall
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **method** | **String** | | |
|
|
8
|
+
| **path** | **String** | | |
|
|
9
|
+
| **body** | **Hash<String, Object>** | A `FetchRequest` with documented example values and `{name}` placeholders. | |
|
|
10
|
+
| **fill** | **Array<String>** | Names to replace before you send the request. | |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'weft-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Weft::SearchCompactNextCall.new(
|
|
18
|
+
method: null,
|
|
19
|
+
path: null,
|
|
20
|
+
body: null,
|
|
21
|
+
fill: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Weft::SearchCompactResult
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **provider** | [**SearchCompactResultProvider**](SearchCompactResultProvider.md) | | [optional] |
|
|
8
|
+
| **operation** | [**SearchCompactResultOperation**](SearchCompactResultOperation.md) | | |
|
|
9
|
+
| **inputs** | **Hash<String, Object>** | Typed business inputs (a bounded JSON schema), or the names and locations of the required inputs when the full schema does not fit. Read the full contract before you send an input not listed. | [optional] |
|
|
10
|
+
| **request** | **Hash<String, Object>** | The request recipe: `method`, canonical `url`, and, when known, the path, query, header and JSON body bindings of each input. | [optional] |
|
|
11
|
+
| **example** | **Object** | | [optional] |
|
|
12
|
+
| **access** | [**SearchCompactAccess**](SearchCompactAccess.md) | | |
|
|
13
|
+
| **attribution** | [**SearchCompactResultAttribution**](SearchCompactResultAttribution.md) | | [optional] |
|
|
14
|
+
| **output** | **Hash<String, Object>** | Media type, execution mode, a bounded output summary and, for async work, the poll workflow. | [optional] |
|
|
15
|
+
| **docs** | [**SearchHelperDocs**](SearchHelperDocs.md) | | [optional] |
|
|
16
|
+
| **contract_url** | **String** | Content-addressed full Weft contract. GET it with your Weft credential (a buyer account key, an OAuth token with the `search` scope, or a claimed `wbt_*` bootstrap bearer) before you build a request the summary does not fully describe. A pending bootstrap bearer gets `401` until a human approves the account. | |
|
|
17
|
+
| **contract_detail** | **String** | What this summary leaves out of the full contract. | |
|
|
18
|
+
| **completion** | **String** | Completion guidance when the completion rules did not fit inline. | [optional] |
|
|
19
|
+
| **blocked_scopes** | [**Array<SearchCompactResultBlockedScopesInner>**](SearchCompactResultBlockedScopesInner.md) | | [optional] |
|
|
20
|
+
| **contract_gaps** | **Array<String>** | Contract fields that the review did not complete. | [optional] |
|
|
21
|
+
| **readiness** | [**Hash<String, SearchCompactResultBlockedScopesInner>**](SearchCompactResultBlockedScopesInner.md) | Independent readiness claims (`research`, `contract`, `runtime`, `paid_terminal`), each with a `state` and, when it fits, a `scope`. | |
|
|
22
|
+
| **next_call** | [**SearchCompactNextCall**](SearchCompactNextCall.md) | | [optional] |
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```ruby
|
|
27
|
+
require 'weft-sdk'
|
|
28
|
+
|
|
29
|
+
instance = Weft::SearchCompactResult.new(
|
|
30
|
+
provider: null,
|
|
31
|
+
operation: null,
|
|
32
|
+
inputs: null,
|
|
33
|
+
request: null,
|
|
34
|
+
example: null,
|
|
35
|
+
access: null,
|
|
36
|
+
attribution: null,
|
|
37
|
+
output: null,
|
|
38
|
+
docs: null,
|
|
39
|
+
contract_url: null,
|
|
40
|
+
contract_detail: null,
|
|
41
|
+
completion: null,
|
|
42
|
+
blocked_scopes: null,
|
|
43
|
+
contract_gaps: null,
|
|
44
|
+
readiness: null,
|
|
45
|
+
next_call: null
|
|
46
|
+
)
|
|
47
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Weft::SearchCompactResultAttribution
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **search_id** | **String** | | [optional] |
|
|
8
|
+
| **operation_id** | **String** | | [optional] |
|
|
9
|
+
| **access_method_id** | **String** | | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'weft-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Weft::SearchCompactResultAttribution.new(
|
|
17
|
+
search_id: null,
|
|
18
|
+
operation_id: null,
|
|
19
|
+
access_method_id: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Weft::SearchCompactResultBlockedScopesInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **scope** | **String** | | [optional] |
|
|
8
|
+
| **state** | **String** | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'weft-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Weft::SearchCompactResultBlockedScopesInner.new(
|
|
16
|
+
scope: null,
|
|
17
|
+
state: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Weft::SearchCompactResultOperation
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | Catalog operation id. Send it as `operation_id` to `POST /api/v1/fetch`. | |
|
|
8
|
+
| **name** | **String** | | [optional] |
|
|
9
|
+
| **description** | **String** | | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'weft-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Weft::SearchCompactResultOperation.new(
|
|
17
|
+
id: null,
|
|
18
|
+
name: null,
|
|
19
|
+
description: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Weft::SearchCompactResultProvider
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | | [optional] |
|
|
8
|
+
| **name** | **String** | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'weft-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Weft::SearchCompactResultProvider.new(
|
|
16
|
+
id: null,
|
|
17
|
+
name: null
|
|
18
|
+
)
|
|
19
|
+
```
|
data/docs/SearchEndpointCall.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
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** | **
|
|
8
|
+
| **input_schema** | [**SearchEndpointCallInputSchema**](SearchEndpointCallInputSchema.md) | | [optional] |
|
|
9
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
10
|
| **example_response** | **Object** | | [optional] |
|
|
11
11
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Weft::SearchEndpointCallInputSchema
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
|
|
8
|
+
## Example
|
|
9
|
+
|
|
10
|
+
```ruby
|
|
11
|
+
require 'weft-sdk'
|
|
12
|
+
|
|
13
|
+
instance = Weft::SearchEndpointCallInputSchema.new()
|
|
14
|
+
```
|
data/docs/SearchEndpointHit.md
CHANGED
|
@@ -14,13 +14,15 @@
|
|
|
14
14
|
| **access_methods** | [**Array<SearchAccessMethod>**](SearchAccessMethod.md) | | [optional] |
|
|
15
15
|
| **service** | [**SearchCuratedService**](SearchCuratedService.md) | | [optional] |
|
|
16
16
|
| **operation** | [**SearchCuratedOperation**](SearchCuratedOperation.md) | | [optional] |
|
|
17
|
+
| **docs** | [**SearchHelperDocs**](SearchHelperDocs.md) | | [optional] |
|
|
18
|
+
| **contract_url** | **String** | Content-addressed Weft contract for the complete operation, alternatives, evidence, and known gaps. Authenticated GET. | [optional] |
|
|
17
19
|
| **output_schema** | **Object** | | [optional] |
|
|
18
20
|
| **output** | **Object** | | [optional] |
|
|
19
21
|
| **execution** | [**SearchCuratedExecution**](SearchCuratedExecution.md) | | [optional] |
|
|
20
22
|
| **callability** | [**SearchCuratedCallability**](SearchCuratedCallability.md) | | [optional] |
|
|
21
23
|
| **compatibility** | **Object** | | [optional] |
|
|
22
24
|
| **source** | [**SearchCuratedSource**](SearchCuratedSource.md) | | [optional] |
|
|
23
|
-
| **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] |
|
|
25
|
+
| **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; `gateway` = an intermediary routing the provider's capability. Null until the platform resolves the operator. | [optional] |
|
|
24
26
|
| **operated_by_id** | **String** | | [optional] |
|
|
25
27
|
| **settled_via_facilitator_id** | **String** | | [optional] |
|
|
26
28
|
| **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] |
|
|
@@ -43,6 +45,8 @@ instance = Weft::SearchEndpointHit.new(
|
|
|
43
45
|
access_methods: null,
|
|
44
46
|
service: null,
|
|
45
47
|
operation: null,
|
|
48
|
+
docs: null,
|
|
49
|
+
contract_url: null,
|
|
46
50
|
output_schema: null,
|
|
47
51
|
output: null,
|
|
48
52
|
execution: null,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Weft::SearchHelperDocs
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **website** | **String** | | [optional] |
|
|
8
|
+
| **homepage** | **String** | | [optional] |
|
|
9
|
+
| **api** | **String** | | [optional] |
|
|
10
|
+
| **llms_txt** | **String** | | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'weft-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Weft::SearchHelperDocs.new(
|
|
18
|
+
website: null,
|
|
19
|
+
homepage: null,
|
|
20
|
+
api: null,
|
|
21
|
+
llms_txt: null
|
|
22
|
+
)
|
|
23
|
+
```
|
data/docs/SearchRequest.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
| **query** | **String** | Free-text query. Required and non-empty. | |
|
|
8
8
|
| **max_results** | **Integer** | Max number of hits to return. Invalid values are rejected, not clamped. | [optional][default to 10] |
|
|
9
9
|
| **filters** | [**SearchFilterSpec**](SearchFilterSpec.md) | | [optional] |
|
|
10
|
+
| **view** | **String** | Response view. Absent means `full`: the complete `SearchResult` rows in `results`. `compact` returns the hosted MCP agent view in `compact_results` (see `SearchCompactResult`). The compact view applies the same selection as hosted MCP search: it leaves out incomplete PayWithLocus gateway contracts. It does not add filters; send `weft_fetch_compatible: true` to get only results that `POST /api/v1/fetch` can pay. | [optional] |
|
|
10
11
|
|
|
11
12
|
## Example
|
|
12
13
|
|
|
@@ -16,6 +17,7 @@ require 'weft-sdk'
|
|
|
16
17
|
instance = Weft::SearchRequest.new(
|
|
17
18
|
query: send email from an agent,
|
|
18
19
|
max_results: null,
|
|
19
|
-
filters: null
|
|
20
|
+
filters: null,
|
|
21
|
+
view: null
|
|
20
22
|
)
|
|
21
23
|
```
|
data/docs/SearchResponse.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
| **query** | **String** | | |
|
|
9
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
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] |
|
|
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. On a `compact` view response it counts `compact_results`; there, `result_count == 0` with `omitted_results` means every ranked result was too large to show. | [optional] |
|
|
12
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
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
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] |
|
|
@@ -21,7 +21,10 @@
|
|
|
21
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
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
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. | |
|
|
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. Empty on a `compact` view response; read `compact_results`. | |
|
|
25
|
+
| **view** | **String** | The view this response carries. Present as `compact` when the request asked for `view: \"compact\"`; absent means `full`. | [optional] |
|
|
26
|
+
| **compact_results** | [**Array<SearchCompactResult>**](SearchCompactResult.md) | Ranked compact results, present only on a `compact` view response. `result_count` is their count. They are a separate field so that typed clients keep the full `SearchResult` shape for `results`. | [optional] |
|
|
27
|
+
| **omitted_results** | **Integer** | Compact view only: how many ranked results were left out because even their minimum summary does not fit the per-result budget. Absent when none were left out. | [optional] |
|
|
25
28
|
|
|
26
29
|
## Example
|
|
27
30
|
|
|
@@ -46,6 +49,9 @@ instance = Weft::SearchResponse.new(
|
|
|
46
49
|
match_quality: null,
|
|
47
50
|
reason: null,
|
|
48
51
|
suggestion: null,
|
|
49
|
-
results: null
|
|
52
|
+
results: null,
|
|
53
|
+
view: null,
|
|
54
|
+
compact_results: null,
|
|
55
|
+
omitted_results: null
|
|
50
56
|
)
|
|
51
57
|
```
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
| **state** | **String** | | |
|
|
8
8
|
| **reason** | **String** | | |
|
|
9
9
|
| **contract_version** | **Integer** | | |
|
|
10
|
+
| **coverage** | **String** | Extent of the operation covered by weft_fetch. `terminal_response` covers the terminal result; `submission_only` covers submission but not completion or retrieval of the result; `none` means no coverage. When absent, coverage is unknown, not terminal. Do not infer terminal coverage from synchronous execution mode alone. | [optional] |
|
|
10
11
|
|
|
11
12
|
## Example
|
|
12
13
|
|
|
@@ -16,6 +17,7 @@ require 'weft-sdk'
|
|
|
16
17
|
instance = Weft::SearchWeftFetchCompatibility.new(
|
|
17
18
|
state: null,
|
|
18
19
|
reason: null,
|
|
19
|
-
contract_version: null
|
|
20
|
+
contract_version: null,
|
|
21
|
+
coverage: null
|
|
20
22
|
)
|
|
21
23
|
```
|