@tinkerlandai/indiana-sdk 0.8.1 → 0.8.4
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 +15 -0
- package/README.md +44 -3
- package/README.zh-CN.md +8 -0
- package/dist/{ai-usage-JoM7ZWk-.d.ts → ai-usage-DUlre7JC.d.ts} +1 -1
- package/dist/{api-JVC7x2FV.d.ts → api-XDc4pRlN.d.ts} +444 -17
- package/dist/chunk-3F2NQOR2.js +1 -0
- package/dist/chunk-663UOBHL.js +1 -0
- package/dist/chunk-BUDTHBFF.js +173 -0
- package/dist/chunk-EJTBSGLV.js +10 -0
- package/dist/{chunk-USLZX2ZA.js → chunk-F2GOIBDQ.js} +1 -1
- package/dist/{chunk-YWFNWK7C.js → chunk-GRLMT5PR.js} +1 -1
- package/dist/chunk-LMR2TM3X.js +1 -0
- package/dist/chunk-OBYJWIRB.js +1 -0
- package/dist/chunk-RZBZ6LCT.js +4 -0
- package/dist/{chunk-6HG7U6AU.js → chunk-SOQO2RDZ.js} +1 -1
- package/dist/chunk-SSHUBTT3.js +1 -0
- package/dist/chunk-SSLZKIIU.js +1 -0
- package/dist/{chunk-KSNOXNTC.js → chunk-VVV3JNS3.js} +1 -1
- package/dist/{configuration-sync-BexM2qbg.d.ts → configuration-sync-Ce3dShy7.d.ts} +8 -3
- package/dist/content-2FCUY6XX.js +1 -0
- package/dist/{customer-page-WUQVK_tp.d.ts → customer-page-9B97Qdt_.d.ts} +21 -1
- package/dist/{errors-DrdTlPwf.d.ts → errors-C8lRYZ0n.d.ts} +48 -1
- package/dist/{funnel-local-client-D1Fe7CZ6.d.ts → funnel-local-client-CUGavICI.d.ts} +69 -40
- package/dist/{funnel-runtime-host-CAMI6BJS.js → funnel-runtime-host-ENRTSXPJ.js} +1 -1
- package/dist/index.d.ts +175 -35
- package/dist/index.js +1 -1
- package/dist/native-shell.js +1 -1
- package/dist/openrouter.d.ts +3 -3
- package/dist/openrouter.js +1 -1
- package/dist/page.d.ts +2 -2
- package/dist/page.js +1 -1
- package/dist/paywall-734GWAS4.js +1 -0
- package/dist/popup.d.ts +15 -5
- package/dist/popup.js +1 -1
- package/dist/react-native.d.ts +97 -4
- package/dist/react-native.js +1 -1
- package/dist/screen-renderer-DLXDQQKK.js +1 -0
- package/dist/server.d.ts +18 -15
- package/dist/server.js +1 -1
- package/dist/src-CLEFCTAU.js +1 -0
- package/dist/visual.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-3BQFJANQ.js +0 -1
- package/dist/chunk-56AYS7RS.js +0 -1
- package/dist/chunk-AE4CUTUE.js +0 -1
- package/dist/chunk-AEUFCOFG.js +0 -1
- package/dist/chunk-F767CM3T.js +0 -7
- package/dist/chunk-X747SY26.js +0 -4
- package/dist/chunk-X7JJAEQQ.js +0 -350
- package/dist/content-YNL2CRJZ.js +0 -1
- package/dist/paywall-MXRMMF3R.js +0 -1
- package/dist/screen-renderer-P7MLBHY5.js +0 -1
- package/dist/src-G7UQB3QE.js +0 -1
- package/dist/{screen-i6eHL11m.d.ts → screen-BpAejkn0.d.ts} +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Release facts and artifact evidence: [SDK release ledger](../../docs/sdk-releases.md).
|
|
4
4
|
|
|
5
|
+
## 0.8.4 — 2026-10-26
|
|
6
|
+
|
|
7
|
+
- Add `prepareContent` and `preparePopup` to render authorized content before the opening click and reveal the same iframe on demand.
|
|
8
|
+
- Prepare bounded HTML DOM templates for supplied pages and Product variants; update variable text in place while preserving styles, images and unrelated content. Reuse inactive variants with empty variable slots.
|
|
9
|
+
- Prepare Local Funnel rule definitions once per pure segment and send advance signals without waiting for advisory prediction downloads. Late predictions remain fenced by Run position and identity.
|
|
10
|
+
- Synchronize the packaged Web, iOS and Android renderers. Retain HTTP protocol 0.8 and server authority over Funnel acceptance and commercial operations.
|
|
11
|
+
- Refresh generated native Paywall Coupon applicability schemas from the current Merchandise contract.
|
|
12
|
+
|
|
13
|
+
## 0.8.3 — 2026-10-26
|
|
14
|
+
|
|
15
|
+
- Refresh sanitized custom HTML fallback content when Product availability changes.
|
|
16
|
+
- Preserve the selected Product across empty availability refreshes, keeping purchase disabled while that Product is unavailable.
|
|
17
|
+
- Synchronize the shared Web and native renderers with the current Product selection rules.
|
|
18
|
+
- Align Server SDK request helpers with the committed messaging contract.
|
|
19
|
+
|
|
5
20
|
## 0.8.1 — 2026-10-25
|
|
6
21
|
|
|
7
22
|
- Organize SDK implementations by capability while preserving public entry points and interfaces.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @tinkerlandai/indiana-sdk
|
|
2
2
|
|
|
3
|
-
These examples use SDK 0.8.
|
|
3
|
+
These examples use SDK 0.8.3 with `https://api.dev.tinker.cash` and test App credentials (protocol 0.8). Check [environment state](../../docs/development-status.md) before switching. The SDK default remains the production API, so set `baseUrl` explicitly for these examples.
|
|
4
4
|
|
|
5
5
|
[简体中文](./README.zh-CN.md)
|
|
6
6
|
|
|
@@ -9,10 +9,10 @@ The Indiana business SDK groups its capabilities as **Identity, Commerce, Growth
|
|
|
9
9
|
**IAM source scanning, generation, validation and upload belong to the independent build package `@tinkerlandai/indiana-iam`.** This business SDK retains only the runtime release binding used by GB visual changes. See [SDK boundaries](../../docs/sdk-architecture.md) and the [IAM package](../iam/README.md).
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npm install --save-exact @tinkerlandai/indiana-sdk@0.8.
|
|
12
|
+
npm install --save-exact @tinkerlandai/indiana-sdk@0.8.3
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
SDK 0.8.
|
|
15
|
+
SDK 0.8.3 requires HTTP protocol 0.8. Install a version that matches your runtime; publishing a package does not deploy the server. Publication and accepted environment scope are recorded in the [release ledger](../../docs/sdk-releases.md) and [development status](../../docs/development-status.md).
|
|
16
16
|
|
|
17
17
|
The data/session layer handles public JSON, integrity checks and authenticated operations. The presentation host composes that layer with the packaged screen renderer; the renderer receives supplied data and emits action intents. Client display entry points load presentation lazily. The `/server` entry has no screen presentation dependency and uses a scoped Server Key only on your backend. A local SDK guard never replaces runtime authorization or verified payment completion. Console preview supplies simulated data/session results to the same presentation host.
|
|
18
18
|
|
|
@@ -217,6 +217,26 @@ The selected environment's integration settings control behavior events, experim
|
|
|
217
217
|
|
|
218
218
|
Flags default to local evaluation; Owner/Admin can switch each flag to server evaluation. Server-evaluated flags deliver only keys and results, using the caller's fallback until the first result arrives. Attribute changes immediately discard old results. List hashes are not a secrecy boundary. Local Funnels cannot depend on server-evaluated flags; mode switches also check active historical Runs. `identify` / `reset` release the previous identity's Feature instances and event queue.
|
|
219
219
|
|
|
220
|
+
Merchandise targeting resolves a trusted item in the selected App/environment. Register its attributes and maintain the
|
|
221
|
+
item in Console, then pass a reference rather than item metadata. The SDK resolves the initial SKU before returning;
|
|
222
|
+
after switching items, await context refresh before reading the next decision. Item experiments use `merchandiseId`
|
|
223
|
+
(the internal UUID) without a Customer fallback; Customer experiments keep their own bucketing identity.
|
|
224
|
+
|
|
225
|
+
```ts
|
|
226
|
+
const merchandiseFlags = await indiana.features({
|
|
227
|
+
attributes: { ...bucketingIdentity, merchandise: { id: "sku-outdoor" } },
|
|
228
|
+
});
|
|
229
|
+
merchandiseFlags.setAttributes({
|
|
230
|
+
...bucketingIdentity,
|
|
231
|
+
merchandise: { id: "sku-indoor" },
|
|
232
|
+
});
|
|
233
|
+
await merchandiseFlags.refreshRemote();
|
|
234
|
+
const eligible = merchandiseFlags.isOn("item-promotion");
|
|
235
|
+
indiana.track("Item Viewed", {}, { merchandise: { id: "sku-indoor" } });
|
|
236
|
+
await indiana.flush();
|
|
237
|
+
merchandiseFlags.destroy();
|
|
238
|
+
```
|
|
239
|
+
|
|
220
240
|
Offering pins the Product Version scope and hierarchy. Paywall pins a published Offering Version and independently chooses its displayed Product subset, groups, ordering, and default selection. `createPaywallStartClient`, `createPaywallSession`, and `showPaywall` use a standalone Paywall Session. After payment, read Entitlements again. Your backend still authorizes requests and consumes usage idempotently.
|
|
221
241
|
|
|
222
242
|
## Commercial capabilities and current service boundaries
|
|
@@ -378,3 +398,24 @@ export async function showBanner(
|
|
|
378
398
|
```
|
|
379
399
|
|
|
380
400
|
Provide every declared action handler. `onContinue` uses `intent.requestId` as its backend idempotency key; `retryAction()` reuses that intent after a failure. Call `destroy()` on unmount, sign-out or account change. The host renders content and emits intents; your backend still authorizes and executes business actions.
|
|
401
|
+
|
|
402
|
+
To remove module loading, document preparation and iframe startup from the opening click, resolve the current Customer's content earlier and prepare it explicitly:
|
|
403
|
+
|
|
404
|
+
```ts
|
|
405
|
+
import { prepareContent } from "@tinkerlandai/indiana-sdk";
|
|
406
|
+
|
|
407
|
+
const lifetime = new AbortController();
|
|
408
|
+
const popup = await prepareContent(container, {
|
|
409
|
+
content, // Already resolved with kind: "popup" for this Customer.
|
|
410
|
+
actions: { continue: onContinue },
|
|
411
|
+
onError: console.error,
|
|
412
|
+
signal: lifetime.signal,
|
|
413
|
+
});
|
|
414
|
+
openButton.addEventListener("click", () => popup.show(), {
|
|
415
|
+
signal: lifetime.signal,
|
|
416
|
+
});
|
|
417
|
+
// On unmount, sign-out or account/scope change:
|
|
418
|
+
// lifetime.abort();
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
Preparation waits for the first render without opening the dialog or running actions. `show()` reveals the same iframe and is idempotent; destroy and prepare a fresh handle for another presentation. Abort also cancels preparation while it is pending. This does not pre-authorize business operations or guarantee that images have decoded. For low-level ScreenDocument rendering, `/popup` provides `preparePopup(document, options)` with `ready`, `show()` and `destroy()`.
|
package/README.zh-CN.md
CHANGED
|
@@ -206,6 +206,10 @@ flags.destroy();
|
|
|
206
206
|
|
|
207
207
|
每个 flag 默认本地计算,Owner/Admin 可切换为服务器计算。服务器 flag 只下发键与结果,首次结果到达前使用调用方默认值;属性变化立即丢弃旧结果。名单哈希不等于保密,敏感规则应使用服务器计算。本地 Funnel 不得依赖服务器 flag,切换时也会校验仍在运行的历史版本。`identify` / `reset` 会释放旧身份的功能实例和事件队列。
|
|
208
208
|
|
|
209
|
+
商品定向使用当前 App/环境的可信商品主档。在 Console 登记属性并维护商品后,传入 `merchandise: { id: "sku-outdoor" }` 引用;SDK 在返回 Feature 客户端之前解析商品。切换商品后,先调用 `setAttributes({ ...bucketingIdentity, merchandise: { id: "sku-indoor" } })`,再等待 `refreshRemote()` 后读取决策。商品实验使用服务端解析的 `merchandiseId`(内部 UUID),不能回退到人的分桶标识。请求中的商品属性不能覆盖主档。
|
|
210
|
+
|
|
211
|
+
自定义商品事件可调用 `indiana.track("Item Viewed", {}, { merchandise: { id: "sku-indoor" } })`,再 `flush()`。Customer 身份、商品引用和实验分桶单位分别记录;事件不构成订单或收入回执。
|
|
212
|
+
|
|
209
213
|
Offering 固定 Product Version 的范围与层级。Paywall 固定已发布 Offering Version,并独立选择显示的 Product 子集、分组、顺序和默认项。`createPaywallStartClient`、`createPaywallSession`、`showPaywall` 使用独立 Paywall Session,不创建占位 Funnel。付款完成后重新查询权益,业务后端仍须重新鉴权并幂等扣减用量。
|
|
210
214
|
|
|
211
215
|
## Web 商业能力与当前服务边界
|
|
@@ -299,3 +303,7 @@ export async function showBanner(
|
|
|
299
303
|
```
|
|
300
304
|
|
|
301
305
|
每个声明动作都需要同名 handler。`onContinue` 用 `intent.requestId` 作为业务后端的幂等键;失败后 `retryAction()` 重用原意图。卸载、退出或换号时调用 `destroy()`。宿主只渲染和发出意图,业务后端仍负责鉴权与执行。
|
|
306
|
+
|
|
307
|
+
需要加快点击打开时,可提前为当前 Customer 读取内容,再调用根入口的 `prepareContent(container, options)`,参数与 `mountContent` 相同。它提前加载展示模块、校验文档并启动 iframe,等首次渲染后返回句柄;点击时同步调用 `handle.show()`,直接显示同一个 iframe。准备期间不打开弹窗、不抢焦点、不执行动作。句柄用于一次展示,重复 `show()` 不重复挂载;下一次展示需重新准备。
|
|
308
|
+
|
|
309
|
+
可传入 `signal: abortController.signal`,在卸载、退出或切换 Customer/App/环境时 `abortController.abort()`,连同仍在等待的准备一起取消并释放资源。预渲染不代替业务鉴权,也不保证图片已完成解码。直接持有已授权 ScreenDocument 的低层接入可使用 `/popup` 的 `preparePopup(document, options)`;句柄立即返回,提供 `ready`、`show()` 和 `destroy()`。
|
|
@@ -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-XDc4pRlN.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const tokenCounts: z.ZodObject<{
|