@tinkerlandai/longplay-sdk 0.10.18 → 0.10.19

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 (55) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +9 -3
  3. package/README.zh-CN.md +1 -1
  4. package/dist/{ai-usage-D7BUuP1H.d.ts → ai-usage-DPGx5otD.d.ts} +3 -3
  5. package/dist/{api-CIbhe8RY.d.ts → api-G8EA_ueL.d.ts} +3596 -200
  6. package/dist/chunk-2JBNOE2D.js +1 -0
  7. package/dist/chunk-4SWGHICJ.js +17 -0
  8. package/dist/chunk-5OD42XQS.js +1 -0
  9. package/dist/{chunk-OMHZBCS3.js → chunk-A7U4Z6EH.js} +1 -1
  10. package/dist/{chunk-LHBBSD77.js → chunk-CCRBXW4M.js} +1 -1
  11. package/dist/chunk-DVKZLOS7.js +1 -0
  12. package/dist/{chunk-ML6EHT43.js → chunk-EDVR7FPD.js} +1 -1
  13. package/dist/chunk-FISFN5IY.js +1 -0
  14. package/dist/chunk-GSFNAB3W.js +6 -0
  15. package/dist/{chunk-26HU2HXU.js → chunk-KHIQQNTR.js} +1 -1
  16. package/dist/{chunk-6HWNW6FJ.js → chunk-LNSFRQ6G.js} +1 -1
  17. package/dist/chunk-W2Z3UVW3.js +1 -0
  18. package/dist/{chunk-T5COWMDA.js → chunk-XIYNQHN7.js} +1 -1
  19. package/dist/{chunk-P6HCD5OQ.js → chunk-XXBN76NP.js} +1 -1
  20. package/dist/{chunk-E4LUW6KP.js → chunk-YNMSSQQY.js} +1 -1
  21. package/dist/{content-DLYNJIEB.js → content-E2OWWKDG.js} +1 -1
  22. package/dist/{customer-page-km5f1PJZ.d.ts → customer-page-BV5EvCUY.d.ts} +20 -0
  23. package/dist/{funnel-local-client-CAuNpJ-e.d.ts → funnel-local-client-DjvVzCfH.d.ts} +14039 -312
  24. package/dist/{funnel-node-evaluation-BLnJp8vj.d.ts → funnel-node-evaluation-D9FwkMa3.d.ts} +425 -1
  25. package/dist/funnel-process-client-bO9Wfumi.d.ts +62372 -0
  26. package/dist/funnel-runtime-host-FOM4Z7ZK.js +1 -0
  27. package/dist/index.d.ts +322 -23334
  28. package/dist/index.js +1 -1
  29. package/dist/native-shell.js +1 -1
  30. package/dist/openrouter.d.ts +2 -2
  31. package/dist/openrouter.js +1 -1
  32. package/dist/page.js +1 -1
  33. package/dist/paywall-OUIB7SVI.js +1 -0
  34. package/dist/popup.d.ts +2 -2
  35. package/dist/popup.js +1 -1
  36. package/dist/react-native.d.ts +41 -38098
  37. package/dist/react-native.js +1 -1
  38. package/dist/screen-renderer-ZNELQB64.js +1 -0
  39. package/dist/server.d.ts +6860 -298
  40. package/dist/server.js +1 -1
  41. package/dist/visual.js +1 -1
  42. package/package.json +1 -1
  43. package/dist/chunk-4ZUMMPHV.js +0 -1
  44. package/dist/chunk-EEZLS2YP.js +0 -1
  45. package/dist/chunk-JVQVQHV2.js +0 -6
  46. package/dist/chunk-KYXX676W.js +0 -1
  47. package/dist/chunk-LC2VUKYM.js +0 -1
  48. package/dist/chunk-N4HZ55YU.js +0 -1
  49. package/dist/chunk-PFHS7HK3.js +0 -17
  50. package/dist/chunk-VVW2J2GL.js +0 -1
  51. package/dist/funnel-process-client-C9EIwNTr.d.ts +0 -20575
  52. package/dist/funnel-runtime-host-FVOUCR35.js +0 -1
  53. package/dist/paywall-6Q3VLXXL.js +0 -1
  54. package/dist/screen-renderer-IZ3VJGU6.js +0 -1
  55. package/dist/{coupon-fA1QujHt.d.ts → coupon-Btz_KFKp.d.ts} +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.19 — 2026-11-06
4
+
5
+ - Restore explicit confirmation for the original unconfirmed Paywall quote after interruption or reload, retaining request identity and the existing recovery path for confirmed purchases.
6
+ - Queue Paywall actions behind the settled Funnel display receipt. Repeated Subscribe clicks return to the existing confirmation, and busy transitions preserve disabled controls, including expired quotes.
7
+
8
+ - Add `grantModelBenefit` and `readModelBenefit` for Server clients, merchant-prepared confirmation terms for Paywalls and the Merchant Bridge v4 protocol. **Not on production yet:** these calls need a Longplay runtime and database release that follows this SDK, so they fail until it ships. Existing calls are unaffected.
9
+ - The Go SDK no longer carries unused streaming, polling and tracking code, and drops its `go-sse` dependency.
10
+
3
11
  ## 0.10.18 — 2026-11-06
4
12
 
5
13
  - Report a Funnel view that cannot start. On Android and iOS, `FunnelView` now calls `onError` when a Local Funnel cannot read its public configuration, instead of showing a blank screen. A brief service fault is retried up to three times before it is reported, and permanent refusals are not retried.
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  # @tinkerlandai/longplay-sdk
8
8
 
9
- This source checkout is SDK 0.10.14, protocol 0.10. These examples use `https://api.longplayai.com` with a Sandbox App and credentials issued by the production deployment. Sandbox still contains production data; do not reuse credentials from the separate test deployment. Confirm runtime readiness in [environment state](../../docs/development-status.md) before running them.
9
+ The SDK release version is the `version` field in [`package.json`](package.json); the wire protocol is 0.10. These examples use `https://api.longplayai.com` with a Sandbox App and credentials issued by the production deployment. Sandbox still contains production data; do not reuse credentials from the separate test deployment. Confirm runtime readiness in [environment state](../../docs/development-status.md) before running them.
10
10
 
11
11
  [简体中文](./README.zh-CN.md)
12
12
 
@@ -161,9 +161,9 @@ On Web, an independent first-party installation cookie can retain the signal. Cl
161
161
 
162
162
  ## Funnel, Feature, and standalone Paywall
163
163
 
164
- A trusted backend calls `createFunnelStartClient().start()` with `funnelId`, a retained `requestId`, `customer`, `locale`, and `parameters`. The Customer reference is `{ type: "id", value: customerId }` or `{ type: "externalUserId", value: verifiedUser.id }`. The latter supports creation-only `customerData` and requires `customers:write`; an existing Customer is not updated. The response includes `customerId`, which your backend can use to issue a Customer Session. Historical start-body `customerToken` and decision-body `customerId` inputs are rejected.
164
+ A trusted backend calls `createFunnelStartClient().start()` with `funnelId`, a retained `requestId`, `customer`, `locale`, and `parameters`. The Customer reference is `{ type: "id", value: customerId }` or `{ type: "externalUserId", value: verifiedUser.id }`. The latter supports creation-only `customerData` and requires `customers:write`; an existing Customer is not updated. The response includes `customerId`, which your backend can use to issue a Customer Session. A Funnel that shows a Paywall requires `parameters.commerce` with `provider` and `currency`, for example `{ provider: "stripe", currency: "USD" }`; without it the start returns `INVALID_REQUEST` and creates no Run. Historical start-body `customerToken` and decision-body `customerId` inputs are rejected.
165
165
 
166
- `createFunnelClient({ customerToken, ...options })` is for clients that already hold a Customer credential. Its `start()` omits `customer` and `customerData` and runs as the credential's Customer. After response loss, retry with the same request ID and input. Put commercial parameters in `parameters.commerce`. Each Run has its own Run Token, which cannot switch Customer identity.
166
+ `createFunnelClient({ customerToken, ...options })` is for clients that already hold a Customer credential. Its `start()` omits `customer` and `customerData` and runs as the credential's Customer. After response loss, retry with the same request ID and input. Each Run has its own Run Token, which cannot switch Customer identity.
167
167
 
168
168
  `createFunnelDecisionClient.submit/decide` and the server entry's `createFunnelCampaignClient` use the same explicit Customer reference. Campaign `decide()` waits for a `FunnelDecision`; a lookup can return the original accepted decision and its original request ID. Campaign `start()` returns either Run credentials or `{ suppressed: true, reason, retryAt }` when frequency or an active Run blocks a new start, without fabricating Run credentials. Report `shown` only after the Run is actually displayed; page closure or local storage cannot replace a durable presentation fact.
169
169
 
@@ -530,3 +530,9 @@ In `record_only` mode your backend owns payment execution, verifies its results
530
530
  The Server entry exports `createMerchantBridgeHandler`, `createMerchantBridgeAuthorityResolver`, `signMerchantBridgeMessage` and `verifyMerchantBridgeMessage`. Supply backend signing keys, native authorization/CSRF, implemented capabilities/profiles and typed handlers. Set `resolveOperationAuthority: createMerchantBridgeAuthorityResolver(server)` so every financial/read command obtains fresh Longplay authority from the original operation API. A signed service request still requires confirmation and exact scope/Customer ownership; it cannot issue user sessions.
531
531
 
532
532
  Handlers must durably reserve the original operation before external effects and retain the same provider idempotency key. The SDK's preceding lookup is not a concurrency lock. `operation.read` returns `found` or `not_received` without creating effects. Recover `RESULT_UNKNOWN` through that original operation; never infer permission from a browser quote or `pending`. Console discovery is configuration validation, not commercial completion. See the [merchant specification](https://www.longplayai.com/docs/guides/merchant-execution) for exact fields and recovery.
533
+
534
+ ### Merchant protocol v4 source
535
+
536
+ The Server entry adds `createMerchantBridgeProtocol` for the explicit v4 T0 wire slice: signed discovery, `requirement.check` and `operation.prepare`. It encodes/validates bounded messages and correlates replies; it performs no HTTP, confirmation or native execution. Supply the scoped v4 Manifest and backend HMAC credentials. The Server entry also exports `merchantPreparationRequestDigest`, `merchantQuoteTermsDigest` and `entitlementRequirementDigest` so adapters use the same normalized digest rules. The signed, read-only preparation request carries the saved preparation authority and complete intent so the merchant can quote its original selection. Responses bind to that request, quote digest and validity; preparation never supplies user confirmation or execution authority. Prepared `subscriptionTerms` carries the merchant's recurring amounts, intervals and shared trial terms independently of the operation's money lines. Zero-charge subscription changes may have no money lines; full refunds ask the merchant for the remaining amount, while partial refunds preserve the explicitly chosen amount. These terms are covered by the same confirmation digest. The existing `createMerchantBridge` and receiver remain v3; there is no automatic protocol fallback.
537
+
538
+ `checkEntitlement` remains the shared Customer/Server API for every payment provider. Its optional `observation` contains the authoritative subject, source, revision, observation time and complete requirement digest; v4 merchant checks require that group. Standalone and embedded Offering/Paywall/Funnel checks share the original-requirement validation; a requested embedded check must be present. Enriched responses are checked against the original requirement, and Paywall rechecks reject changed subject/authority/requirements or missing previously supplied observation metadata. Current runtime responses without observations remain readable. Business ownership selects authority; `commerce.provider` only selects purchase presentment. Shared quote responses and operation authority expose full `merchantTerms`; the Paywall confirmation presents the merchant charge, recurring/trial terms, expected effects and required consents. The [GOP runtime source](../../../Indianapolis/docs/sdk-runtime.md#merchant-execution-and-billing) owns quote preparation, confirmation and execution. SDK generation does not install SQL, update GOP’s pinned artifact or deploy a merchant adapter. See the [generic contract](../../docs/growth-integration.md#merchant-executed-orchestration).
package/README.zh-CN.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  [English](./README.md)
8
8
 
9
- 当前源码为 SDK 0.10.14、协议 0.10。本页示例使用 `https://api.longplayai.com` 以及生产部署内签发的 Sandbox App/凭据。Sandbox 仍属于生产数据,不能复用独立测试部署的凭据。运行前核对[环境状态](../../docs/development-status.md),确认服务已就绪。
9
+ SDK 版本以 [`package.json`](package.json) 的 `version` 字段为准,HTTP 协议为 0.10。本页示例使用 `https://api.longplayai.com` 以及生产部署内签发的 Sandbox App/凭据。Sandbox 仍属于生产数据,不能复用独立测试部署的凭据。运行前核对[环境状态](../../docs/development-status.md),确认服务已就绪。
10
10
 
11
11
  # @tinkerlandai/longplay-sdk
12
12
 
@@ -1,5 +1,5 @@
1
1
  import { LanguageModelV4Usage, LanguageModelV4Middleware } from '@ai-sdk/provider';
2
- import { F as FoundationApi, A as ApiInput } from './api-CIbhe8RY.js';
2
+ import { F as FoundationApi, A as ApiInput } from './api-G8EA_ueL.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const tokenCounts: z.ZodObject<{
@@ -102,7 +102,7 @@ declare function createAiPricing(options?: AiPricingOptions): {
102
102
  originalId: string | null;
103
103
  quantity: string;
104
104
  accepted: boolean;
105
- reason: "expired" | "unavailable" | "insufficient_balance" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | null;
105
+ reason: "expired" | "insufficient_balance" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "unavailable" | null;
106
106
  createdAt: string;
107
107
  reservationStatus: "pending" | "expired" | "confirmed" | "released" | null;
108
108
  expiresAt: string | null;
@@ -173,7 +173,7 @@ declare function createConfiguredAiPricing(client: Pick<FoundationApi, "readAiPr
173
173
  originalId: string | null;
174
174
  quantity: string;
175
175
  accepted: boolean;
176
- reason: "expired" | "unavailable" | "insufficient_balance" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | null;
176
+ reason: "expired" | "insufficient_balance" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "unavailable" | null;
177
177
  createdAt: string;
178
178
  reservationStatus: "pending" | "expired" | "confirmed" | "released" | null;
179
179
  expiresAt: string | null;