@civitai/app-sdk 0.95.1 → 0.96.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.
@@ -88,7 +88,7 @@ export { isModelSlotContext, isPageSlotContext } from './types.js';
88
88
  * in `types.ts` for which of the two it uses and why.
89
89
  */
90
90
  export { isSignedIn } from './types.js';
91
- export type { BlockContext, KnownSlotId, ModelSlotId, PageSlotContext, PageSlotId, UnknownSlotContext, BlockAnalyticsDeclaration, BlockAnalyticsEventDeclaration, BlockAnalyticsPropertyDeclaration, BlockManifest, BlockManifestGood, BlockManifestV1, BlockSettings, BlockStorageCollectionDeclaration, BlockStorageCollectionHook, BlockStorageCollectionSchema, BlockStorageDeclaration, BlockStorageImport, BlockStorageIndexes, BlockStorageIndexType, BlockStorageMigrationKeyword, BlockStorageMigrationOp, BlockStoragePrivateCollectionDeclaration, BlockStorageSchemaType, BlockStorageSharedCollectionDeclaration, BlockToken, ContentRating, ManifestBooleanField, ManifestIframe, ManifestNumberField, ManifestPage, ManifestPreview, ManifestSettingField, ManifestSettings, ManifestStringField, ManifestTarget, ModelSlotContext, SettingScope, SettingWidget, Theme, ViewerInfo, BlockCheckpointInfo, BlockResourceInfo, BlockResourcePickerType, BlockSourceImage, BlockUploadedImageInfo, BlockGenerationSourceImageInfo, BlockUploadedGenerationSource, BlockPersistGenerationSourceRequest, BlockPersistedGenerationSource, BlockImagePickerSource, BlockPickedImageInfo, BlockMediaKind, BlockMediaUploadInfo, BlockMediaUploadBatchItemResult, BlockPendingImageInfo, BlockSharedUploadImageInfo, BlockSharedPendingImageInfo, BlockImageScanResult, BlockUploadPurpose, BlockNavigateScope, BlockShareLinkMethod, BlockShareLinkRequest, BlockShareLinkResult, BlockTextToImageParams, BlockWorkflowSnapshot, BlockEstimateBatchAggregate, BlockModelSubstitution, ModelSubstitutionReason, KnownBlockWorkflowErrorCode, BlockStepToolCall, BlockTrainedEpoch, BlockPublishedModel, BuzzAccountType, ShowcaseImage, WorkflowBody, WorkflowBodyTextToImage, WorkflowBodyCustomComfy, WorkflowBodyCustomComfyRecipe, WorkflowBodyCustomComfyInline, InlineComfyNode, WorkflowBodyStep, WorkflowBodyPassThroughStep, WorkflowBodyWorkflow, WorkflowBodyWorkflowStep, WorkflowStepRef, WithWorkflowStepRefs, BlockWorkflowStepSnapshot, BlockWorkflowStepQueue, BlockWorkflowEta, KnownBlockWorkflowQueueSupport, BlockWorkflowOutput, BlockWorkflowAvailableOutput, BlockWorkflowRestrictedOutput, BlockWorkflowPendingOutput, BlockWorkflowBlockedOutput, KnownBlockWorkflowOutputRating, KnownBlockWorkflowRestrictionReason, KnownBlockOutputUnlockOutcome, BlockOutputUnlockResult, WorkflowStatus, BlockBuzzTransaction, BlockBuzzAccount, BlockDailyCompensationResource, BlockViewer, BlockWildcardPack, BlockWildcardPackErrorCode, BlockResourceFile, BlockResourceFileEntry, BlockResourceFileEntryFormat, BlockResourceFileErrorCode, BlockResourceFileMeta, AppWorkflow, AppWorkflowImage, BlockGatedImage, BlockCollectionFollowErrorCode, BlockCollectionFollowResult, BlockPostSource, BlockCreatePostRequest, BlockCreatePostResult, BlockCreatePostHostError, WorkflowBodyTraining, AiToolkitTrainingParams, AiToolkitTrainingParamsBase, AiToolkitPlainEcosystem, AiToolkitLrScheduler, AiToolkitOptimizerType, BlockTrainingQuote, BlockTrainingDatasetItem, BlockTrainingDataImage, BlockTrainingDataUploadResult, BlockRunTrainingHostError, BlockStepQuote, BlockModel3dOutput, BlockRunConfirmedStepHostError, } from './types.js';
91
+ export type { BlockContext, KnownSlotId, ModelSlotId, PageSlotContext, PageSlotId, UnknownSlotContext, BlockAnalyticsDeclaration, BlockAnalyticsEventDeclaration, BlockAnalyticsPropertyDeclaration, BlockManifest, BlockManifestGood, BlockManifestV1, BlockSettings, BlockStorageCollectionDeclaration, BlockStorageCollectionHook, BlockStorageCollectionSchema, BlockStorageDeclaration, BlockStorageImport, BlockStorageIndexes, BlockStorageIndexType, BlockStorageMigrationKeyword, BlockStorageMigrationOp, BlockStoragePrivateCollectionDeclaration, BlockStorageSchemaType, BlockStorageSharedCollectionDeclaration, BlockToken, ContentRating, ManifestBooleanField, ManifestIframe, ManifestNumberField, ManifestPage, ManifestPreview, ManifestSettingField, ManifestSettings, ManifestStringField, ManifestTarget, ModelSlotContext, SettingScope, SettingWidget, Theme, ViewerInfo, BlockCheckpointInfo, BlockResourceInfo, BlockResourcePickerType, BlockSourceImage, BlockUploadedImageInfo, BlockGenerationSourceImageInfo, BlockUploadedGenerationSource, BlockPersistGenerationSourceRequest, BlockPersistedGenerationSource, BlockImagePickerSource, BlockPickedImageInfo, BlockMediaKind, BlockMediaUploadInfo, BlockMediaUploadBatchItemResult, BlockPendingImageInfo, BlockSharedUploadImageInfo, BlockSharedPendingImageInfo, BlockImageScanResult, BlockUploadPurpose, BlockNavigateScope, BlockShareLinkMethod, BlockShareLinkRequest, BlockShareLinkResult, BlockTextToImageParams, BlockWorkflowSnapshot, RateLimitMeta, BlockEstimateBatchAggregate, BlockModelSubstitution, ModelSubstitutionReason, KnownBlockWorkflowErrorCode, BlockStepToolCall, BlockTrainedEpoch, BlockPublishedModel, BuzzAccountType, ShowcaseImage, WorkflowBody, WorkflowBodyTextToImage, WorkflowBodyCustomComfy, WorkflowBodyCustomComfyRecipe, WorkflowBodyCustomComfyInline, InlineComfyNode, WorkflowBodyStep, WorkflowBodyPassThroughStep, WorkflowBodyWorkflow, WorkflowBodyWorkflowStep, WorkflowStepRef, WithWorkflowStepRefs, BlockWorkflowStepSnapshot, BlockWorkflowStepQueue, BlockWorkflowEta, KnownBlockWorkflowQueueSupport, BlockWorkflowOutput, BlockWorkflowAvailableOutput, BlockWorkflowRestrictedOutput, BlockWorkflowPendingOutput, BlockWorkflowBlockedOutput, KnownBlockWorkflowOutputRating, KnownBlockWorkflowRestrictionReason, KnownBlockOutputUnlockOutcome, BlockOutputUnlockResult, WorkflowStatus, BlockBuzzTransaction, BlockBuzzAccount, BlockDailyCompensationResource, BlockViewer, BlockWildcardPack, BlockWildcardPackErrorCode, BlockResourceFile, BlockResourceFileEntry, BlockResourceFileEntryFormat, BlockResourceFileErrorCode, BlockResourceFileMeta, AppWorkflow, AppWorkflowImage, BlockGatedImage, BlockCollectionFollowErrorCode, BlockCollectionFollowResult, BlockPostSource, BlockCreatePostRequest, BlockCreatePostResult, BlockCreatePostHostError, WorkflowBodyTraining, AiToolkitTrainingParams, AiToolkitTrainingParamsBase, AiToolkitPlainEcosystem, AiToolkitLrScheduler, AiToolkitOptimizerType, BlockTrainingQuote, BlockTrainingDatasetItem, BlockTrainingDataImage, BlockTrainingDataUploadResult, BlockRunTrainingHostError, BlockStepQuote, BlockModel3dOutput, BlockRunConfirmedStepHostError, } from './types.js';
92
92
  /**
93
93
  * Host bounds for an inline `customComfy` graph, mirrored from civitai/civitai —
94
94
  * see `WorkflowBodyCustomComfyInline.workflow`.
@@ -2702,6 +2702,48 @@ export interface BlockWorkflowSnapshot {
2702
2702
  * whose throttled reply is `{ workflowId, status: 'processing' }`.
2703
2703
  */
2704
2704
  throttled?: true;
2705
+ /**
2706
+ * The retry metadata of the rate limit that refused this request: which limit,
2707
+ * when to try again and, for a limit that publishes them, its counts. The same
2708
+ * `rateLimit` the host attaches to every other bridge error reply.
2709
+ *
2710
+ * Set on a `failed` snapshot the host built from a rate-limited refusal (an
2711
+ * estimate, submit or cancel the limit turned away), and on a
2712
+ * {@link BlockWorkflowSnapshot.throttled} reply when a rate limit shed the poll
2713
+ * or cancel. Absent on every other snapshot, and on a host that predates the
2714
+ * field — so its absence never means "not rate-limited" on an older host.
2715
+ *
2716
+ * `@civitai/blocks-react` drops a malformed value and copies it onto the error
2717
+ * the workflow hook rejects with (`err.rateLimit`).
2718
+ */
2719
+ rateLimit?: RateLimitMeta;
2720
+ }
2721
+ /**
2722
+ * Retry metadata the host attaches to a rate-limit refusal (Civitai's standard
2723
+ * `rateLimit`), so an app renders the wait instead of parsing it out of a
2724
+ * message. The same shape as `BridgeError.rateLimit` in `@civitai/sdk`.
2725
+ */
2726
+ export interface RateLimitMeta {
2727
+ /** Whole seconds until the call may be tried again; at least 1. */
2728
+ retryAfterSeconds: number;
2729
+ /** ISO-8601 instant at which the call may be tried again. */
2730
+ retryAt: string;
2731
+ /** Stable id of the refusing limit, e.g. `apps.submit`. */
2732
+ id?: string;
2733
+ /**
2734
+ * `product`: an allowance the viewer may see and buy more of. `abuse`: an
2735
+ * anti-flood or money/safety bound. Informational: an abuse limit can carry
2736
+ * counts too.
2737
+ */
2738
+ kind?: 'product' | 'abuse';
2739
+ /** The counts below are sent only for a limit that publishes them. */
2740
+ limit?: number;
2741
+ /** Attempts in the window; can exceed `limit`. */
2742
+ used?: number;
2743
+ remaining?: number;
2744
+ windowSeconds?: number;
2745
+ /** ISO-8601 instant at which the whole window is clear. */
2746
+ resetAt?: string;
2705
2747
  }
2706
2748
  /** One entry of {@link BlockWorkflowSnapshot.steps}. */
2707
2749
  export interface BlockWorkflowStepSnapshot {
package/dist/index.d.ts CHANGED
@@ -25,11 +25,11 @@
25
25
  *
26
26
  * - **`./blocks`** — importing it RUNS `./safe-storage` for its side effect
27
27
  * (repairing `localStorage`/`sessionStorage` at an opaque origin). Folding
28
- * 244 symbols and that side effect into the root would make every OAuth app
28
+ * 245 symbols and that side effect into the root would make every OAuth app
29
29
  * that writes `import { exchangeCode } from '@civitai/app-sdk'` pay for the
30
30
  * Civitai-Apps contract it does not use. Blocks and OAuth apps are disjoint
31
31
  * audiences; see this package's README.
32
- * 🔴 That 244 is ASSERTED, not merely quoted — by
32
+ * 🔴 That 245 is ASSERTED, not merely quoted — by
33
33
  * `packages/civitai-app-sdk/test/export-surface.test.ts`, which pins
34
34
  * `surface.get('./blocks').size`. It said 119 here against a real 125 until
35
35
  * 2026-10-04, because the existing checks pin the root as an exact union and
package/dist/index.js CHANGED
@@ -25,11 +25,11 @@
25
25
  *
26
26
  * - **`./blocks`** — importing it RUNS `./safe-storage` for its side effect
27
27
  * (repairing `localStorage`/`sessionStorage` at an opaque origin). Folding
28
- * 244 symbols and that side effect into the root would make every OAuth app
28
+ * 245 symbols and that side effect into the root would make every OAuth app
29
29
  * that writes `import { exchangeCode } from '@civitai/app-sdk'` pay for the
30
30
  * Civitai-Apps contract it does not use. Blocks and OAuth apps are disjoint
31
31
  * audiences; see this package's README.
32
- * 🔴 That 244 is ASSERTED, not merely quoted — by
32
+ * 🔴 That 245 is ASSERTED, not merely quoted — by
33
33
  * `packages/civitai-app-sdk/test/export-surface.test.ts`, which pins
34
34
  * `surface.get('./blocks').size`. It said 119 here against a real 125 until
35
35
  * 2026-10-04, because the existing checks pin the root as an exact union and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@civitai/app-sdk",
3
- "version": "0.95.1",
3
+ "version": "0.96.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",