@civitai/app-sdk 0.67.0 → 0.69.0

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/README.md CHANGED
@@ -169,6 +169,10 @@ own key:
169
169
  `'chat-completion'`, …). The wire enum is derived from the host's step registry, so an
170
170
  unregistered id is rejected fail-closed at the schema, and `params` are validated by that
171
171
  step's own `.strict()` schema.
172
+ An estimate the host has no price quote for fails with no `cost` and `snapshot.errorCode`
173
+ `step_quote_rejected` (refused; the same body will fail again), `step_quote_unavailable` (no
174
+ usable answer; the one a retry can clear) or `step_quote_unpriced` (an answer without a price).
175
+ The submit is unchanged. An older host prices that estimate at the step's declared estimate.
172
176
  - **`WorkflowBodyPassThroughStep`** (`step` ABSENT) — names an **orchestrator `$type`** directly
173
177
  and the host forwards `input` unmodified. There is no registry lookup, no param schema, no
174
178
  prompt audit and no AIR scan; what bounds it is a denylist of platform-internal `$type`s
@@ -720,6 +720,8 @@ export type BlockToParentMessage = {
720
720
  type: 'BLOCK_READY';
721
721
  payload: {
722
722
  height: number;
723
+ sdkVersion?: string;
724
+ sdkName?: 'blocks-react' | 'sdk';
723
725
  };
724
726
  } | {
725
727
  type: 'BLOCK_ERROR';
@@ -1756,6 +1756,10 @@ export interface BlockWorkflowSnapshot {
1756
1756
  * `workflow_quote_*` codes, which are ESTIMATE-ONLY (`estimate()` and a
1757
1757
  * batch-estimate cell): `submit()` of the same body defines no such refusal
1758
1758
  * and proceeds, reserved at the ceiling.
1759
+ * A REGISTERED `step` body ({@link WorkflowBodyStep}) the host has no price
1760
+ * quote for gets one of the three `step_quote_*` codes, also ESTIMATE-ONLY
1761
+ * (`estimate()` and a batch-estimate cell); its `submit()` is unchanged. The
1762
+ * pass-through `step` arm does not set them.
1759
1763
  *
1760
1764
  * The values the host sends today ({@link KnownBlockWorkflowErrorCode}):
1761
1765
  * - `'training-quote-rejected'` — the orchestrator refused the request
@@ -1808,6 +1812,24 @@ export interface BlockWorkflowSnapshot {
1808
1812
  * Each `workflow_quote_*` reply is `{ workflowId: 'failed', status: 'failed',
1809
1813
  * error, errorCode }` with NO `cost`. A host that predates these codes
1810
1814
  * resolves the estimate instead, with the spend ceiling as `cost.total`.
1815
+ * - `'step_quote_rejected'` — ESTIMATE only, registered `step` body. The
1816
+ * orchestrator refused the request; resending the same body will not help.
1817
+ * `error` reads `No price quote for this step: the orchestrator rejected
1818
+ * the request: <reason>` when the reason is safe to show, else `No price
1819
+ * quote for this step: the orchestrator rejected the request; check the
1820
+ * step inputs and references (retrying the same body will not help)`.
1821
+ * - `'step_quote_unavailable'` — ESTIMATE only, registered `step` body. No
1822
+ * usable answer (an outage, a timeout, a rate limit, …). The one
1823
+ * `step_quote_*` code a retry of the same body can clear. `error` reads
1824
+ * `No price quote for this step: none could be obtained; try again`.
1825
+ * - `'step_quote_unpriced'` — ESTIMATE only, registered `step` body. The
1826
+ * orchestrator answered without a price. `error` reads `No price quote for
1827
+ * this step: the orchestrator answered without one`.
1828
+ *
1829
+ * Each `step_quote_*` reply is `{ workflowId: 'failed', status: 'failed',
1830
+ * error, errorCode }` with NO `cost`. A host that predates these codes
1831
+ * resolves the estimate instead, priced at the step's declared estimate, so
1832
+ * there a registered-step estimate may not be a quote.
1811
1833
  *
1812
1834
  * 🔴 AN UNKNOWN VALUE IS POSSIBLE: the host may add codes, and the SDK's
1813
1835
  * inbound validator accepts any string here. Handle an unrecognised code as a
@@ -2230,7 +2252,7 @@ export type ModelSubstitutionReason = 'wrong-workflow' | 'unrecognized' | 'gated
2230
2252
  * and the SDK's inbound validator accepts any string. Handle an unrecognised
2231
2253
  * code as a generic failure.
2232
2254
  */
2233
- export type KnownBlockWorkflowErrorCode = 'training-quote-rejected' | 'training-quote-unavailable' | 'training-quote-unpriced' | 'daily-limit-exceeded' | 'workflow_step_denied' | 'workflow_ref_invalid' | 'workflow_too_many_steps' | 'workflow_repeat_unbounded' | 'workflow_quote_rejected' | 'workflow_quote_unavailable' | 'workflow_quote_unpriced';
2255
+ export type KnownBlockWorkflowErrorCode = 'training-quote-rejected' | 'training-quote-unavailable' | 'training-quote-unpriced' | 'daily-limit-exceeded' | 'workflow_step_denied' | 'workflow_ref_invalid' | 'workflow_too_many_steps' | 'workflow_repeat_unbounded' | 'workflow_quote_rejected' | 'workflow_quote_unavailable' | 'workflow_quote_unpriced' | 'step_quote_rejected' | 'step_quote_unavailable' | 'step_quote_unpriced';
2234
2256
  /** One entry of {@link BlockWorkflowSnapshot.modelSubstitutions}. */
2235
2257
  export interface BlockModelSubstitution {
2236
2258
  /** The checkpoint version id the block asked for. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@civitai/app-sdk",
3
- "version": "0.67.0",
3
+ "version": "0.69.0",
4
4
  "description": "OAuth + PKCE, encrypted-cookie sessions, scopes, and orchestrator helpers for building third-party Civitai apps.",
5
5
  "license": "MIT",
6
6
  "type": "module",