@tinkerlandai/longplay-sdk 0.10.18 → 0.10.19-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +9 -3
- package/README.zh-CN.md +1 -1
- package/dist/{ai-usage-D7BUuP1H.d.ts → ai-usage-DPGx5otD.d.ts} +3 -3
- package/dist/{api-CIbhe8RY.d.ts → api-G8EA_ueL.d.ts} +3596 -200
- package/dist/chunk-4SWGHICJ.js +17 -0
- package/dist/chunk-5PRFQQ6G.js +1 -0
- package/dist/chunk-C5WDTSOQ.js +1 -0
- package/dist/chunk-CJMHP3S7.js +1 -0
- package/dist/chunk-DBBUN53B.js +6 -0
- package/dist/{chunk-E4LUW6KP.js → chunk-DTJKESGC.js} +1 -1
- package/dist/{chunk-ML6EHT43.js → chunk-EDVR7FPD.js} +1 -1
- package/dist/chunk-FISFN5IY.js +1 -0
- package/dist/{chunk-LHBBSD77.js → chunk-FSUP7HMS.js} +1 -1
- package/dist/{chunk-OMHZBCS3.js → chunk-JUY6II6H.js} +1 -1
- package/dist/{chunk-26HU2HXU.js → chunk-KHIQQNTR.js} +1 -1
- package/dist/chunk-PZPTJ4Q5.js +1 -0
- package/dist/{chunk-6HWNW6FJ.js → chunk-SR6CERFC.js} +1 -1
- package/dist/{chunk-T5COWMDA.js → chunk-XIYNQHN7.js} +1 -1
- package/dist/{chunk-P6HCD5OQ.js → chunk-YSW3DGSR.js} +1 -1
- package/dist/{content-DLYNJIEB.js → content-UR3NHWAB.js} +1 -1
- package/dist/{customer-page-km5f1PJZ.d.ts → customer-page-BV5EvCUY.d.ts} +20 -0
- package/dist/{funnel-local-client-CAuNpJ-e.d.ts → funnel-local-client-DjvVzCfH.d.ts} +14039 -312
- package/dist/{funnel-node-evaluation-BLnJp8vj.d.ts → funnel-node-evaluation-D9FwkMa3.d.ts} +425 -1
- package/dist/funnel-process-client-bO9Wfumi.d.ts +62372 -0
- package/dist/funnel-runtime-host-CM3O4CZK.js +1 -0
- package/dist/index.d.ts +322 -23334
- package/dist/index.js +1 -1
- package/dist/native-shell.js +1 -1
- package/dist/openrouter.d.ts +2 -2
- package/dist/openrouter.js +1 -1
- package/dist/page.js +1 -1
- package/dist/paywall-5RZ3NFHB.js +1 -0
- package/dist/popup.d.ts +2 -2
- package/dist/popup.js +1 -1
- package/dist/react-native.d.ts +41 -38098
- package/dist/react-native.js +1 -1
- package/dist/screen-renderer-ZNELQB64.js +1 -0
- package/dist/server.d.ts +6860 -298
- package/dist/server.js +1 -1
- package/dist/visual.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-4ZUMMPHV.js +0 -1
- package/dist/chunk-EEZLS2YP.js +0 -1
- package/dist/chunk-JVQVQHV2.js +0 -6
- package/dist/chunk-KYXX676W.js +0 -1
- package/dist/chunk-LC2VUKYM.js +0 -1
- package/dist/chunk-N4HZ55YU.js +0 -1
- package/dist/chunk-PFHS7HK3.js +0 -17
- package/dist/chunk-VVW2J2GL.js +0 -1
- package/dist/funnel-process-client-C9EIwNTr.d.ts +0 -20575
- package/dist/funnel-runtime-host-FVOUCR35.js +0 -1
- package/dist/paywall-6Q3VLXXL.js +0 -1
- package/dist/screen-renderer-IZ3VJGU6.js +0 -1
- 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
|
-
|
|
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.
|
|
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
|
-
|
|
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-
|
|
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" | "
|
|
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" | "
|
|
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;
|