@civitai/sdk 0.20.0 → 0.20.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.
package/BREAKING.md CHANGED
@@ -25,7 +25,7 @@ messages have no destination yet.
25
25
  | `CREATE_POST_FROM_APP` | — | No v1 route, **and deliberately staying on the bridge** — see below |
26
26
  | `PUBLISH_GENERATION_OUTPUTS` | `app.host.publishGenerationOutputs` | Same reasoning: it raises host UI, so it stays on the bridge — **carried** rather than replaced |
27
27
  | `SET_COLLECTION_FOLLOW` | `POST /api/v1/blocks/collections/{id}/follow` | **Route exists** (scope `collections:write:self`). This row previously said "No v1 route"; that was wrong |
28
- | `GET_DAILY_COMPENSATION`, `GET_WILDCARD_PACK` | — | Not carried |
28
+ | `GET_DAILY_COMPENSATION`, `GET_WILDCARD_PACK`, `GET_RESOURCE_FILE` | — | Not carried as a typed wrapper. `BlockTransport.request()` knows all three (the host reply ledger lists them): `request('GET_RESOURCE_FILE', { modelVersionId, fileId? })` resolves with `{ file }` on a full-page app host |
29
29
  | `TRACK_EVENT` | `app.host.track(eventName, properties)` | **Carried**, same wire as `useBlockAnalytics().track`. 🔴 Only events and properties DECLARED under the manifest's `analytics.events` are recorded — see below |
30
30
 
31
31
  ⚠ **`TRACK_EVENT` used to be listed here as *not carried*, because no host handled it — every
package/README.md CHANGED
@@ -1046,9 +1046,15 @@ Where it differs from the server on purpose:
1046
1046
 
1047
1047
  `fake.calls` records every request and answer. Options also cover smaller `limits`,
1048
1048
  `consent` (revoked scopes, or `'unavailable'`), `appStatus`, `disabled` and a custom
1049
- `moderate`; by default the scanner refuses the words in `FAKE_STORAGE_MODERATION`. It
1050
- does not model moderator hides or the review-preview namespace, and at the `Http`
1051
- seam there is no URL resolution — the client refuses the segments a URL would
1049
+ `moderate`; by default the scanner refuses the words in `FAKE_STORAGE_MODERATION`.
1050
+ That default is the server's enforced moderation. The host picks each app's
1051
+ moderation mode for shared data, and enforce is not the default there: expect
1052
+ shadow (scanned after the write) or off, where neither a hit nor a scanner outage
1053
+ refuses a write. So never rely on a refusal to keep content out of shared data:
1054
+ a write the fake refuses may land on the server, and other viewers read it. Pass
1055
+ `moderate: () => null` to test what such an app sees. The fake does not model
1056
+ moderator hides or the review-preview namespace, and at the `Http` seam there is no
1057
+ URL resolution — the client refuses the segments a URL would
1052
1058
  rewrite (`''`, `.`, `..`) before sending.
1053
1059
 
1054
1060
  ### The legacy key/value stores
@@ -7,7 +7,7 @@ export interface HostReply {
7
7
  readonly keys: readonly string[] | null;
8
8
  }
9
9
  /** The civitai commit this ledger was read from. A request the host added after it is refused too. */
10
- export declare const HOST_SNAPSHOT = "05f1d1fa8f";
10
+ export declare const HOST_SNAPSHOT = "4c13f8c629";
11
11
  /**
12
12
  * Every request the host answered at {@link HOST_SNAPSHOT}. A type absent here is refused.
13
13
  * Reply names and framing are fixed at publish time: if the host renames a reply or moves a
@@ -1,7 +1,7 @@
1
1
  // Generated by scripts/gen-host-replies.mjs from snapshots/host-messages.json
2
- // (civitai/civitai 05f1d1fa8f, 2026-10-20). Do not edit.
2
+ // (civitai/civitai 4c13f8c629, 2026-10-25). Do not edit.
3
3
  /** The civitai commit this ledger was read from. A request the host added after it is refused too. */
4
- export const HOST_SNAPSHOT = "05f1d1fa8f";
4
+ export const HOST_SNAPSHOT = "4c13f8c629";
5
5
  /**
6
6
  * Every request the host answered at {@link HOST_SNAPSHOT}. A type absent here is refused.
7
7
  * Reply names and framing are fixed at publish time: if the host renames a reply or moves a
@@ -24,6 +24,7 @@ export const HOST_REPLIES = {
24
24
  "GET_DAILY_COMPENSATION": { "reply": "DAILY_COMPENSATION_RESULT", "framing": "legacy", "keys": ["result"] },
25
25
  "GET_ENTITY_REACTIONS": { "reply": "ENTITY_REACTIONS_RESULT", "framing": "legacy", "keys": ["result"] },
26
26
  "GET_IMAGES_BY_IDS": { "reply": "IMAGES_RESULT", "framing": "legacy", "keys": ["result"] },
27
+ "GET_RESOURCE_FILE": { "reply": "RESOURCE_FILE_RESULT", "framing": "legacy", "keys": ["file"] },
27
28
  "GET_VIEWER": { "reply": "VIEWER_RESULT", "framing": "legacy", "keys": ["viewer"] },
28
29
  "GET_WILDCARD_PACK": { "reply": "WILDCARD_PACK_RESULT", "framing": "legacy", "keys": ["pack"] },
29
30
  "OPEN_BUZZ_PURCHASE": { "reply": "BUZZ_PURCHASE_RESULT", "framing": "legacy", "keys": ["purchased"] },
@@ -22,6 +22,13 @@ import { createDocumentStorage } from './index.js';
22
22
  * versions of its own, so which ones a viewer owns is `FakeStorageViewer.modelVersions`
23
23
  * (default none).
24
24
  *
25
+ * Moderation is the server's ENFORCE mode, which the contract's moderation cases
26
+ * describe: a hit refuses `content_rejected` and a scanner outage
27
+ * `moderation_unavailable`. The host picks each app's shared-data moderation mode,
28
+ * and enforce is not its default: in `shadow` (the scan runs after the write) or `off`
29
+ * (no scan) neither a hit nor an outage refuses the write. The fake has no mode of its
30
+ * own: `moderate: () => null` is what a shadow or off app sees.
31
+ *
25
32
  * NOT MODELLED: moderator hides (a hidden document reads as not found on the server;
26
33
  * nothing here hides one), moderator exemption from the scanner, the review-preview
27
34
  * namespace, the token middleware's other refusals (revoked instance, context
@@ -1,2 +1,2 @@
1
1
  /** This package's version, reported to the host as `sdkVersion` in `BLOCK_READY`. */
2
- export declare const VERSION = "0.20.0";
2
+ export declare const VERSION = "0.20.2";
@@ -1,3 +1,3 @@
1
1
  /* AUTOGENERATED from package.json by scripts/gen-version.mjs. DO NOT EDIT. */
2
2
  /** This package's version, reported to the host as `sdkVersion` in `BLOCK_READY`. */
3
- export const VERSION = "0.20.0";
3
+ export const VERSION = "0.20.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@civitai/sdk",
3
- "version": "0.20.0",
3
+ "version": "0.20.2",
4
4
  "description": "The Civitai SDK: an app holds a token and calls the Civitai API and the orchestrator; a block asks its host only to show host UI.",
5
5
  "license": "MIT",
6
6
  "type": "module",