@civitai/app-sdk 0.40.0 → 0.42.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 +87 -1
- package/dist/blocks/types.d.ts +39 -12
- package/dist/blocks/types.d.ts.map +1 -1
- package/dist/orchestrator/steps.d.ts +391 -0
- package/dist/orchestrator/steps.d.ts.map +1 -0
- package/dist/orchestrator/steps.js +176 -0
- package/dist/orchestrator/steps.js.map +1 -0
- package/package.json +34 -1
package/README.md
CHANGED
|
@@ -18,12 +18,16 @@ pnpm add @civitai/app-sdk
|
|
|
18
18
|
| `scopes/*` — `TokenScope`, `TokenScopePresets`, `bitmaskFromScopes`, `scopesFromBitmask`, `hasScope`, `getScopeLabel` | Civitai scopes are stored as bitmasks. These helpers let you compose scope sets from named flags rather than magic numbers. |
|
|
19
19
|
| `cookies/*` — `sealCookie`, `unsealCookie`, `buildSetCookieHeader`, `readCookie` | AES-256-CTR encrypted cookie crypto. Use to seal a session blob (refresh token, expiry, scope) into an `httpOnly` cookie with zero external session store. |
|
|
20
20
|
| `orchestrator/*` — `createOrchestratorClient`, `estimateWorkflow`, `submitWorkflow`, `getWorkflow`, `pollWorkflow`, `buildTextToImageBody`, `buildImageGenBody`, `buildWorkflowBody`, `WORKFLOW_STEP_TYPES`, `IMAGE_GEN_ENGINES`, `isTerminal`, `extractImageUrls`, `OrchestratorError`, `WorkflowSnapshot`, `GenerateInput`, `ImageGenInput`, `WorkflowStepType`, `ImageGenEngine`, `DEFAULT_MODEL_AIR` | Orchestrator workflow glue — types, body builders, raw HTTP, and long-poll helper. Client + server safe (fetch-only). `estimateWorkflow` calls `?whatif=true` to preview Buzz cost without spending. `pollWorkflow` long-polls to terminal status. `WORKFLOW_STEP_TYPES` is the catalog of every step `$type` the orchestrator accepts. |
|
|
21
|
+
| `orchestrator/steps` — `WorkflowStepTemplates`, `WorkflowStepTemplateFor`, `WorkflowStepInputFor`, `AnyWorkflowStepTemplate`, `TypedWorkflowTemplate` | **Type-only** subpath (0 runtime bytes) keying the orchestrator's generated workflow-step shapes from `@civitai/client` by wire `$type`, so apps compose real step bodies against types that track the spec instead of hand-maintained copies. Requires the optional peer `@civitai/client@beta`. Type surface only — it grants no submit permission; see "Typed step shapes" below. |
|
|
21
22
|
| `blocks/*` — `defineBlock`, `BlockManifestError`, `BLOCK_SCOPES`, `BLOCK_SCOPE_PATTERN`, `isMessage`, types (`BlockManifestV1`, `BlockContext`, `BlockToken`, `BlockSettings`, `ViewerInfo`, `ThemeInfo`, `BlockWorkflowSnapshot`, `BlockInitPayload`, `ParentToBlockMessage`, `BlockToParentMessage`, …) | Framework-agnostic contract for [Civitai Apps](https://github.com/civitai/civitai-app-starters/blob/main/docs/build-your-first-app-block.md). `defineBlock(config)` validates a `BlockManifestV1` at startup so authoring mistakes surface in `pnpm dev` instead of at `civitai app validate`/submit. Ships a byte-identical copy of the server-published canonical JSON Schema (draft 2020-12, https://civitai.com/schemas/app-block/v1.json) at the `./schemas/app-block/v1.json` subpath for offline validation; a CI drift-check keeps it in sync. Runtime-agnostic — no React or DOM types. Hooks and the iframe transport live in a separate package. |
|
|
22
23
|
|
|
23
24
|
## Subpath imports
|
|
24
25
|
|
|
25
26
|
```ts
|
|
26
27
|
import { defineBlock, BLOCK_SCOPES } from '@civitai/app-sdk/blocks';
|
|
28
|
+
// Type-only: the orchestrator's generated per-step shapes. Needs the optional
|
|
29
|
+
// peer `@civitai/client@beta` — see "Typed step shapes" below:
|
|
30
|
+
import type { TypedWorkflowTemplate } from '@civitai/app-sdk/orchestrator/steps';
|
|
27
31
|
// Opaque-origin storage shim — see "Web storage in a block" below:
|
|
28
32
|
import '@civitai/app-sdk/safe-storage';
|
|
29
33
|
// JSON Schema for the manifest, e.g. for IDE validation:
|
|
@@ -302,7 +306,7 @@ The starters in `civitai/civitai-app-starters` wire this into framework-specific
|
|
|
302
306
|
|
|
303
307
|
## Choosing a workflow step type
|
|
304
308
|
|
|
305
|
-
The orchestrator is a workflow API: each request submits a list of typed steps. `WORKFLOW_STEP_TYPES` is the in-code catalog of every step `$type` it accepts, with a one-line description for each — `textToImage`, `imageGen`, `videoGen`, `comfy`, `customComfy`, `textToSpeech`, `aceStepAudio`, `transcription`, `imageUpscaler`, and
|
|
309
|
+
The orchestrator is a workflow API: each request submits a list of typed steps. `WORKFLOW_STEP_TYPES` is the in-code catalog of every step `$type` it accepts, with a one-line description for each — `textToImage`, `imageGen`, `videoGen`, `comfy`, `customComfy`, `textToSpeech`, `aceStepAudio`, `transcription`, `imageUpscaler`, and 38 more (47 in total).
|
|
306
310
|
|
|
307
311
|
The catalog is pinned to the orchestrator's published OpenAPI spec two ways — an offline unit test against a transcribed copy of the spec's `WorkflowStepTemplate` discriminator mapping, and a CI job (`pnpm check:catalogs`) that re-fetches the live spec and diffs it. If a `$type` is listed here, the orchestrator accepts it.
|
|
308
312
|
|
|
@@ -338,6 +342,88 @@ const submitted = await submitWorkflow(client, body);
|
|
|
338
342
|
|
|
339
343
|
Per-engine input shapes (`aspectRatio`, `resolution`, `numImages`, etc.) come from the OpenAPI spec at <https://orchestration.civitai.com/openapi/v2-consumers.json> — `ImageGenInput` is intentionally pass-through so new engine fields work without an SDK release.
|
|
340
344
|
|
|
345
|
+
## Typed step shapes (`@civitai/app-sdk/orchestrator/steps`)
|
|
346
|
+
|
|
347
|
+
`WORKFLOW_STEP_TYPES` tells you which `$type`s exist; the body builders above take `input: unknown`. This subpath is the other half: the real per-step input shapes, keyed by wire `$type` over the orchestrator's own generated client (`@civitai/client`) so they track the spec by codegen rather than by hand.
|
|
348
|
+
|
|
349
|
+
It is **type-only** — every export is a `type`, the built `dist/orchestrator/steps.js` is an empty module, and bundling it yields 0 bytes. Nothing is added to your runtime.
|
|
350
|
+
|
|
351
|
+
```ts
|
|
352
|
+
import { createOrchestratorClient, estimateWorkflow, submitWorkflow } from '@civitai/app-sdk/orchestrator';
|
|
353
|
+
import type { TypedWorkflowTemplate, WorkflowStepTemplateFor } from '@civitai/app-sdk/orchestrator/steps';
|
|
354
|
+
|
|
355
|
+
declare const accessToken: string;
|
|
356
|
+
const client = createOrchestratorClient({ accessToken });
|
|
357
|
+
|
|
358
|
+
// Fully typed — `$type` is a literal, and `input` is checked field by field.
|
|
359
|
+
// `cfgScale` and `seed` are REQUIRED on `textToImage`, which is easy to miss
|
|
360
|
+
// when hand-writing the body.
|
|
361
|
+
const step: WorkflowStepTemplateFor<'textToImage'> = {
|
|
362
|
+
$type: 'textToImage',
|
|
363
|
+
name: 'step_0',
|
|
364
|
+
timeout: '00:10:00',
|
|
365
|
+
input: {
|
|
366
|
+
prompt: 'a fox in the snow',
|
|
367
|
+
model: 'urn:air:sdxl:checkpoint:civitai:101055@128078',
|
|
368
|
+
cfgScale: 5,
|
|
369
|
+
seed: 1234,
|
|
370
|
+
width: 1024,
|
|
371
|
+
height: 1024,
|
|
372
|
+
},
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
const body: TypedWorkflowTemplate = { steps: [step], tags: ['my-app'] };
|
|
376
|
+
const estimate = await estimateWorkflow(client, body);
|
|
377
|
+
const submitted = await submitWorkflow(client, body);
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
What it exports:
|
|
381
|
+
|
|
382
|
+
| Export | What |
|
|
383
|
+
|---|---|
|
|
384
|
+
| `WorkflowStepTemplates` | `$type` → template type, for all 47 step types. Keyed by the WIRE name, which the generated type names don't always match (`model3DPreview` → `Model3dPreviewStepTemplate`). |
|
|
385
|
+
| `WorkflowStepTemplateFor<'videoGen'>` | One step's template. |
|
|
386
|
+
| `WorkflowStepInputFor<'videoGen'>` | One step's `input` shape, without needing the generated `*Input` name. |
|
|
387
|
+
| `AnyWorkflowStepTemplate` | Discriminated union of all 47 — `Extract<…, { $type: 'comfy' }>` and exhaustive `switch` work. `@civitai/client`'s base `WorkflowStepTemplate` has `$type` as a bare `string`, so it narrows nothing. |
|
|
388
|
+
| `TypedWorkflowTemplate` | The submit envelope with `steps` narrowed to that union. Pass it straight to `submitWorkflow` / `estimateWorkflow`. |
|
|
389
|
+
|
|
390
|
+
The generated `*StepTemplate` and `*Input` types are **not** re-exported individually. Using this subpath already requires `@civitai/client` installed, so if you want one by name, import it straight from there — `import type { TextToImageStepTemplate } from '@civitai/client'`.
|
|
391
|
+
|
|
392
|
+
In practice `WorkflowStepTemplateFor<T>` and `WorkflowStepInputFor<T>` are the better route: they take the wire `$type` you already have, rather than the generated name you would otherwise have to go look up (`model3DPreview` → `Model3dPreviewStepTemplate`).
|
|
393
|
+
|
|
394
|
+
### Installing the peer
|
|
395
|
+
|
|
396
|
+
`@civitai/client` is an **optional peer dependency**, not a dependency: `@civitai/app-sdk` has an empty `dependencies` and this keeps it that way for every app that doesn't want the step types. Install it only if you import this subpath:
|
|
397
|
+
|
|
398
|
+
```sh
|
|
399
|
+
pnpm add -D @civitai/client@beta
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
> 🔴 **Use the `beta` tag, not `latest`.** `@civitai/client`'s npm `latest` dist-tag points at `0.1.1-beta.0`, roughly 97 betas behind the `beta` tag the orchestrator is actually generated against — and missing most of the step types above. A plain `pnpm add @civitai/client` installs the stale one with no error; the first symptom is `TextToImageStepTemplate` not existing.
|
|
403
|
+
|
|
404
|
+
> 🔴 **If the peer's types don't resolve, these types tell you — they used to just stop checking.** The unresolved `@civitai/client` import is in the SDK's shipped `steps.d.ts`, so `skipLibCheck: true` — the default for a TypeScript app, and set by every starter in this repo — suppresses the `TS2307` along with every other declaration-file diagnostic, and the types above degrade to an error type that behaves like `any`. Measured on a consumer with the peer uninstalled, against the subpath as it stood before the guard existed: **1 diagnostic** — a planted `const x: number = 's'` — on a project that also had a deliberately wrong `$type`. The wrong `$type` reported nothing.
|
|
405
|
+
>
|
|
406
|
+
> The subpath now carries a compile-time guard for exactly this. `keyof` over TypeScript's unresolved-import error type is `string | number | symbol`, not `any`, so `string extends keyof <template>` separates "resolved" from "not resolved" — it is `false` for all 47 generated templates (none has a string index signature; enumerated, not sampled) and `true` for the error type. When it fires, **all five exports above** collapse to a message type, so you get a `TS2322` **in your own file** naming the install command instead of silence. Same consumer with the guard: every annotation reports when the peer is missing, and when it is installed the output is the same, character for character, as the pre-guard build's. `test/orchestrator/steps-peer-guard.test.ts` pins both arms — and pins the export list itself, by reading the module's exported symbols through the TypeScript API and failing if any of them has no consumer file asserted to report, so a sixth export cannot arrive unguarded.
|
|
407
|
+
|
|
408
|
+
> 🔴 **Use `"moduleResolution": "Bundler"` for this subpath.** `@civitai/client@0.2.0-beta.98` is published with `"type": "module"`, no `exports` map, and extensionless relative re-exports (`export * from './generated'`), which Node's ESM resolution does not resolve. Under `NodeNext`/`Node16` the peer therefore degrades to the same error type *even when it is correctly installed* — measured: 1 diagnostic (the planted control alone) before the guard, and every annotation reporting afterwards. That arm is a test too, with the same directory compiled under `Bundler` as its control. Every starter in this repo, and this package itself, use `Bundler`.
|
|
409
|
+
|
|
410
|
+
### `currencies` is optional here, and required in the spec
|
|
411
|
+
|
|
412
|
+
`TypedWorkflowTemplate` makes `currencies` optional where the generated `WorkflowTemplate` has it required. The helpers in `@civitai/app-sdk/orchestrator` have never emitted it and every starter submits through them, so requiring it would break every existing caller for a field none of them sends.
|
|
413
|
+
|
|
414
|
+
The spec describes `currencies` as *"Limit the currencies that can be used to pay for this workflow."* — that is what the field does when it is **present**. What the orchestrator does when it is **omitted** is not verified, and the spec licenses no inference about it. Pass it explicitly if you want a workflow's payment scoped to particular currencies. This divergence is reasoned from the spec, this package's helpers and civitai's call sites — not from a live submit, which costs real Buzz.
|
|
415
|
+
|
|
416
|
+
### These are types, not permissions
|
|
417
|
+
|
|
418
|
+
A `$type` having a type here says nothing about whether you may submit it.
|
|
419
|
+
|
|
420
|
+
- **App Blocks** don't reach the orchestrator at all. A block posts a `WorkflowBody` to the host, which validates it server-side against its own schema. That contract is `@civitai/app-sdk/blocks` and is completely unaffected by this subpath.
|
|
421
|
+
- **Standalone apps / BFFs** submit directly with the user's OAuth token, and the orchestrator applies its own authorization. A body that compiles can still come back 400 or 403.
|
|
422
|
+
|
|
423
|
+
Several of the 47 exist to serve Civitai's own pipelines rather than third-party apps — `modelPickleScan`, `xGuardModeration`, `training`, `comfyNodepackSnapshot`, `qwenImageBench`, the `model*`/`media*` hashing and classification steps. They're in the consumer spec, so they're typed here. They are not an invitation.
|
|
424
|
+
|
|
425
|
+
Note that `WORKFLOW_STEP_TYPES` does **not** mark most of them: of its 47 entries exactly two — `comfyNodepackSnapshot` and `qwenImageBench` — sit under its "Platform internals" heading, and the rest are ordinary documented entries (`webScrape` even carries usage notes). The reason all 47 are typed is not that the catalog flags the internals; it's that the catalog *documents* all 47 and a `$type`-keyed lookup is only sound as a lookup if it's total — a partial map would make `WorkflowStepTemplateFor<'training'>` a compile error for a step type the SDK documents, and would make the key-parity assertion impossible.
|
|
426
|
+
|
|
341
427
|
## Public vs. confidential clients
|
|
342
428
|
|
|
343
429
|
Civitai's OAuth server supports both:
|
package/dist/blocks/types.d.ts
CHANGED
|
@@ -1433,32 +1433,59 @@ export interface AppWorkflow {
|
|
|
1433
1433
|
* (`IMAGES_RESULT`). The host applies the REQUESTING VIEWER's browsing-level
|
|
1434
1434
|
* clamp server-side, so the shape a viewer receives depends on THEIR ceiling:
|
|
1435
1435
|
*
|
|
1436
|
-
* - `status: 'visible'` — the
|
|
1437
|
-
*
|
|
1438
|
-
*
|
|
1436
|
+
* - `status: 'visible'` — the viewer may see the pixels. TWO shapes live under
|
|
1437
|
+
* this one status:
|
|
1438
|
+
* · a RATED image — the full moderated projection
|
|
1439
|
+
* (`nsfwLevel`/`contentRating`/`url`, plus `width`/`height` for layout);
|
|
1440
|
+
* · an image NOTHING HAS RATED YET, returned ONLY to its own author, with
|
|
1441
|
+
* `ratingPending: true` and NEITHER `nsfwLevel` NOR `contentRating`.
|
|
1439
1442
|
* - `status: 'hidden'` — the image EXISTS but is withheld from THIS viewer
|
|
1440
|
-
* (above their browsing ceiling,
|
|
1441
|
-
*
|
|
1442
|
-
*
|
|
1443
|
-
* crosses to a viewer who
|
|
1443
|
+
* (above their browsing ceiling, flagged, scan-refused, or — for everyone who
|
|
1444
|
+
* is not its author — not yet rated). NO `url` is ever returned; the block
|
|
1445
|
+
* renders a blurred/placeholder cell. This is the load-bearing cross-user
|
|
1446
|
+
* moderation boundary: an unclamped edge URL never crosses to a viewer who
|
|
1447
|
+
* can't see the image.
|
|
1448
|
+
*
|
|
1449
|
+
* 🔴 `nsfwLevel` AND `contentRating` ARE OPTIONAL, AND A MISSING ONE IS NOT "G".
|
|
1450
|
+
* They were required until 0.42.0, and a block that dereferenced them on a
|
|
1451
|
+
* `visible` entry now reads `undefined` for an author's own pending image. That
|
|
1452
|
+
* absence IS the fix. `hidden` used to mean both "a rating exists and it is not
|
|
1453
|
+
* for you" AND "nothing has rated this yet", so a block had ONE token to render
|
|
1454
|
+
* and guessed maturity: an image published seconds earlier came back `hidden`
|
|
1455
|
+
* and was displayed as *"Hidden — rated mature"* — a rating claim about an
|
|
1456
|
+
* unrated image, which a page reload contradicted the moment the scan landed.
|
|
1457
|
+
* Branch on `ratingPending` (or on `nsfwLevel === undefined`) and render a
|
|
1458
|
+
* "still processing" affordance; NEVER substitute a default rating.
|
|
1459
|
+
*
|
|
1460
|
+
* 🔴 THE HOST DELIBERATELY DOES NOT DISTINGUISH "UNRATED" FROM "ABOVE YOUR
|
|
1461
|
+
* CEILING" FOR SOMEONE ELSE'S IMAGE. Both are `hidden`. Reporting them apart
|
|
1462
|
+
* would let a SFW viewer of a shared grid enumerate which cells are
|
|
1463
|
+
* mature-or-flagged rather than merely unscanned, so there is no third status
|
|
1464
|
+
* and no way to ask.
|
|
1444
1465
|
*
|
|
1445
1466
|
* Image ids the host cannot resolve to a benchmark-eligible bare Image row are
|
|
1446
1467
|
* OMITTED from the result entirely (neither visible nor hidden).
|
|
1447
1468
|
*
|
|
1448
1469
|
* Mirrors civitai/civitai's gated-read projection in
|
|
1449
|
-
* `src/server/services/blocks
|
|
1470
|
+
* `src/server/services/blocks/block-gated-images.service.ts` — keep in lockstep.
|
|
1471
|
+
* That lockstep is now ENFORCED from the other side: civitai vendors this exact
|
|
1472
|
+
* declaration in `src/server/services/blocks/blockGatedImageSdkParity.ts` and
|
|
1473
|
+
* fails its typecheck when the two disagree. Change this type and that file has
|
|
1474
|
+
* to move in the same landing.
|
|
1450
1475
|
*/
|
|
1451
1476
|
export type BlockGatedImage = {
|
|
1452
1477
|
imageId: number;
|
|
1453
1478
|
status: 'visible';
|
|
1454
|
-
/** Scanner-resolved NSFW-level bitmask value. */
|
|
1455
|
-
nsfwLevel
|
|
1456
|
-
/** Off-site content rating (`'g'|'pg'|'pg13'|'r'|'x'`). */
|
|
1457
|
-
contentRating
|
|
1479
|
+
/** Scanner-resolved NSFW-level bitmask value. ABSENT on a `ratingPending` entry. */
|
|
1480
|
+
nsfwLevel?: number;
|
|
1481
|
+
/** Off-site content rating (`'g'|'pg'|'pg13'|'r'|'x'`). ABSENT on a `ratingPending` entry. */
|
|
1482
|
+
contentRating?: ContentRating;
|
|
1458
1483
|
/** Civitai-hosted image URL (only present for a viewer allowed to see it). */
|
|
1459
1484
|
url: string;
|
|
1460
1485
|
width: number | null;
|
|
1461
1486
|
height: number | null;
|
|
1487
|
+
/** Present ONLY on the viewer's OWN image that nothing has rated yet. */
|
|
1488
|
+
ratingPending?: true;
|
|
1462
1489
|
} | {
|
|
1463
1490
|
imageId: number;
|
|
1464
1491
|
status: 'hidden';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/blocks/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GACnB,mBAAmB,GACnB,oBAAoB,GACpB,qBAAqB,CAAC;AAE1B,qEAAqE;AACrE,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC;AAEpC,gEAAgE;A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AAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,GACD;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEN;;;;;;;;;;GAUG;AACH,MAAM,WAAW,sBAAsB;IACrC,kDAAkD;IAClD,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,MAAM,wBAAwB,GAChC,aAAa,GACb,oBAAoB,GACpB,iBAAiB,GACjB,mBAAmB,GACnB,gBAAgB,GAChB,UAAU,CAAC"}
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orchestrator workflow-step TYPES, keyed by wire `$type` over the orchestrator's
|
|
3
|
+
* own generated client (`@civitai/client`).
|
|
4
|
+
*
|
|
5
|
+
* The sibling `@civitai/app-sdk/orchestrator` module gives you the *catalog*
|
|
6
|
+
* (`WORKFLOW_STEP_TYPES` — 47 `$type` names and what each one does) and the
|
|
7
|
+
* fetch helpers (`submitWorkflow`, `estimateWorkflow`, …), but its body
|
|
8
|
+
* builders take `input: unknown`. This module is the missing half: the actual
|
|
9
|
+
* per-step input shapes, tracked against the orchestrator's OpenAPI spec by
|
|
10
|
+
* codegen instead of by hand.
|
|
11
|
+
*
|
|
12
|
+
* What this module adds on top of `@civitai/client` is the `$type` → template
|
|
13
|
+
* MAP (`WorkflowStepTemplates`) and the lookups derived from it. The generated
|
|
14
|
+
* template types themselves are `@civitai/client`'s, and since that package is
|
|
15
|
+
* a required install for this subpath anyway (its names appear in this module's
|
|
16
|
+
* emitted declarations), import them straight from it when you need one by
|
|
17
|
+
* name:
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* import type { TextToImageStepTemplate } from '@civitai/client';
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Reaching for `WorkflowStepTemplateFor<'textToImage'>` is usually better: the
|
|
24
|
+
* generated name is not always the one you would guess from the wire name
|
|
25
|
+
* (`model3DPreview` → `Model3dPreviewStepTemplate`), and looking it up is the
|
|
26
|
+
* discoverability tax the map exists to remove.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* import { createOrchestratorClient, submitWorkflow } from '@civitai/app-sdk/orchestrator';
|
|
30
|
+
* import type {
|
|
31
|
+
* TypedWorkflowTemplate,
|
|
32
|
+
* WorkflowStepTemplateFor,
|
|
33
|
+
* } from '@civitai/app-sdk/orchestrator/steps';
|
|
34
|
+
*
|
|
35
|
+
* const step: WorkflowStepTemplateFor<'textToImage'> = {
|
|
36
|
+
* $type: 'textToImage',
|
|
37
|
+
* name: 'step_0',
|
|
38
|
+
* input: {
|
|
39
|
+
* prompt: 'a fox',
|
|
40
|
+
* model: 'urn:air:sdxl:checkpoint:civitai:101055@128078',
|
|
41
|
+
* // REQUIRED on textToImage — easy to miss when hand-writing the body,
|
|
42
|
+
* // and the kind of thing these types exist to catch.
|
|
43
|
+
* cfgScale: 5,
|
|
44
|
+
* seed: 1234,
|
|
45
|
+
* },
|
|
46
|
+
* };
|
|
47
|
+
* const body: TypedWorkflowTemplate = { steps: [step], tags: ['my-app'] };
|
|
48
|
+
* await submitWorkflow(createOrchestratorClient({ accessToken }), body);
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* ## 🔴 THIS IS TYPE SURFACE. IT IS NOT PERMISSION SURFACE.
|
|
52
|
+
*
|
|
53
|
+
* A `$type` having a type here says **nothing** about whether you are allowed
|
|
54
|
+
* to submit it. Two separate things decide that, and neither is affected by
|
|
55
|
+
* this module:
|
|
56
|
+
*
|
|
57
|
+
* - **App Blocks** (iframe blocks embedded in civitai.com) do not talk to the
|
|
58
|
+
* orchestrator at all. They post a `WorkflowBody` to the host, which
|
|
59
|
+
* validates it against its own server-side `blockWorkflowBodySchema`. That
|
|
60
|
+
* contract lives in this package's `blocks/types.ts` and is untouched here —
|
|
61
|
+
* importing a step type does not widen it by one field.
|
|
62
|
+
* - **Standalone apps / BFFs** submit to the orchestrator directly with the
|
|
63
|
+
* user's OAuth token, and the orchestrator applies its own authorization.
|
|
64
|
+
* A body that compiles can still come back 400 or 403.
|
|
65
|
+
*
|
|
66
|
+
* The practical consequence: a number of the 47 step types below exist to serve
|
|
67
|
+
* Civitai's own pipelines rather than third-party apps — `modelPickleScan`,
|
|
68
|
+
* `xGuardModeration`, `training`, `comfyNodepackSnapshot`, `qwenImageBench`,
|
|
69
|
+
* the `model*` / `media*` hashing and classification steps. They are in the
|
|
70
|
+
* consumer spec, so they are typed here. They are not an invitation.
|
|
71
|
+
*
|
|
72
|
+
* ⚠️ `WORKFLOW_STEP_TYPES` does NOT mark most of them. Counted at this commit:
|
|
73
|
+
* of its 47 entries, exactly TWO sit under its "Platform internals" heading —
|
|
74
|
+
* `comfyNodepackSnapshot` and `qwenImageBench`. `training`, `webScrape`,
|
|
75
|
+
* `xGuardModeration`, `modelPickleScan` and the `model*` / `media*` steps are
|
|
76
|
+
* ordinary documented entries under ordinary headings, and `webScrape` carries
|
|
77
|
+
* consumer-facing usage notes. So "the catalog already flags these as internal"
|
|
78
|
+
* is not a reason this map covers all 47, and an earlier version of this
|
|
79
|
+
* docblock claiming it was is wrong. What IS true, and is the reason: the
|
|
80
|
+
* catalog DOCUMENTS all 47, and a lookup keyed by `$type` is only sound as a
|
|
81
|
+
* lookup if it is total over `WorkflowStepType` — a partial map makes
|
|
82
|
+
* `WorkflowStepTemplateFor<'training'>` a compile error for a step type the
|
|
83
|
+
* SDK documents, and makes the key-parity assertion below impossible.
|
|
84
|
+
*
|
|
85
|
+
* ## Why this is a separate deep entry point
|
|
86
|
+
*
|
|
87
|
+
* `@civitai/client` is an **optional peer**, not a dependency (see the
|
|
88
|
+
* `comment-peerDependencies` block in this package's package.json). Keeping
|
|
89
|
+
* this module out of `./orchestrator` and `.` means an app that never imports
|
|
90
|
+
* `@civitai/app-sdk/orchestrator/steps` never needs the peer installed. If you
|
|
91
|
+
* DO import this module, install it:
|
|
92
|
+
*
|
|
93
|
+
* ```sh
|
|
94
|
+
* pnpm add -D @civitai/client@beta
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* 🔴 **WITHOUT A GUARD, FORGETTING THE PEER IS SILENT UNDER
|
|
98
|
+
* `skipLibCheck: true`, WHICH IS THE DEFAULT.** The unresolved
|
|
99
|
+
* `@civitai/client` import lands in the emitted `steps.d.ts`, so `skipLibCheck`
|
|
100
|
+
* — which every starter in this repo sets, as does `tsc --init` — suppresses
|
|
101
|
+
* its `TS2307` along with every other declaration-file diagnostic. The exports
|
|
102
|
+
* here then degrade to an error type that behaves like `any`, and the code
|
|
103
|
+
* below still compiles while checking NOTHING.
|
|
104
|
+
*
|
|
105
|
+
* **`GuardPeer` (below) closes that hole on every export of this module.** All
|
|
106
|
+
* five — `WorkflowStepTemplates`, `WorkflowStepTemplateFor`,
|
|
107
|
+
* `WorkflowStepInputFor`, `AnyWorkflowStepTemplate`, `TypedWorkflowTemplate` —
|
|
108
|
+
* are guarded, and a sixth cannot join them unnoticed: the test enumerates this
|
|
109
|
+
* module's exported symbols through the TypeScript API and fails if any of them
|
|
110
|
+
* lacks a consumer file in its ledger, each of which is asserted to report.
|
|
111
|
+
*
|
|
112
|
+
* **The measurement.** Declarations emitted from this file at each revision
|
|
113
|
+
* below, then SEVEN consumer files compiled against them IN ONE PROGRAM with
|
|
114
|
+
* `skipLibCheck: true` and TypeScript 5.9.3: one correct annotation per export
|
|
115
|
+
* (five), one whose `$type` is deliberately wrong, and a planted
|
|
116
|
+
* `const x: number = 's'` so a zero is distinguishable from a compiler wired to
|
|
117
|
+
* nothing. "Peer installed" was measured twice, once through `paths` and once
|
|
118
|
+
* against a real copy of the published package in the consumer's own
|
|
119
|
+
* `node_modules`; both give the numbers below.
|
|
120
|
+
*
|
|
121
|
+
* ⚠️ RUNNING `test/orchestrator/steps-peer-guard.test.ts` DOES NOT REPRODUCE
|
|
122
|
+
* THIS TABLE, and none of its arms corresponds to a row here. It uses the same
|
|
123
|
+
* consumer sources and the same compiler settings, but groups them
|
|
124
|
+
* differently: the five correct annotations compile with the planted control
|
|
125
|
+
* and WITHOUT the wrong-`$type` file, which gets a program of its own. It also
|
|
126
|
+
* only ever compiles the module as it stands here, so the `be503a9d` and
|
|
127
|
+
* `851d8846` rows are out of its reach entirely. To reproduce a row: emit
|
|
128
|
+
* `steps.d.ts` from the revision that row names, then compile all seven
|
|
129
|
+
* consumer files together under the peer resolution it names.
|
|
130
|
+
*
|
|
131
|
+
* | this file at | peer / resolution | diagnostics |
|
|
132
|
+
* |---|---|---|
|
|
133
|
+
* | `be503a9d`, before any guard | installed, Bundler | 2 — the wrong `$type`, plus the planted control |
|
|
134
|
+
* | `be503a9d`, before any guard | **missing**, Bundler | **1 — the planted control alone.** The wrong `$type` reports nothing |
|
|
135
|
+
* | `be503a9d`, before any guard | installed, **NodeNext** | **1 — the planted control alone**, with the peer correctly installed |
|
|
136
|
+
* | `851d8846`, guard on four exports | missing, Bundler | 6 — the four then-guarded exports report (one of them twice, since the wrong-`$type` file annotates with `WorkflowStepTemplateFor`), plus the planted control. **The `WorkflowStepTemplates` annotation is silent** |
|
|
137
|
+
* | here | installed, Bundler | 2 — the same two diagnostics, character for character, as the `be503a9d` / installed / Bundler row |
|
|
138
|
+
* | here | **missing**, Bundler | 7 — a `TS2322` **in the consumer's own file** for each of the five exports and for the wrong-`$type` file, naming the install command, plus the planted control |
|
|
139
|
+
* | here | installed, **NodeNext** | 7 — the same set |
|
|
140
|
+
*
|
|
141
|
+
* With `skipLibCheck: false` and no guard you get one error,
|
|
142
|
+
* `TS2307: Cannot find module '@civitai/client'`, reported against
|
|
143
|
+
* `node_modules/@civitai/app-sdk/dist/orchestrator/steps.d.ts` rather than
|
|
144
|
+
* against your own file.
|
|
145
|
+
*
|
|
146
|
+
* 🔴 **THE SAME DEGRADATION HAPPENS WITH THE PEER INSTALLED, UNDER
|
|
147
|
+
* `NodeNext`/`Node16`.** `@civitai/client@0.2.0-beta.98` is published with
|
|
148
|
+
* `"type": "module"`, no `exports` map, and extensionless relative re-exports
|
|
149
|
+
* (`export * from './generated'`), which Node's ESM resolution does not
|
|
150
|
+
* resolve — see the third and last rows above. That is why the guard's message
|
|
151
|
+
* names this case as well as the missing-peer one. Use
|
|
152
|
+
* `"moduleResolution": "Bundler"` (what every starter here and this package
|
|
153
|
+
* itself set).
|
|
154
|
+
*
|
|
155
|
+
* All three arms — peer absent, peer present, and peer present under NodeNext —
|
|
156
|
+
* are pinned by `test/orchestrator/steps-peer-guard.test.ts`, which compiles
|
|
157
|
+
* that consumer against this module's own emitted declarations. The NodeNext
|
|
158
|
+
* arm carries the same directory compiled under Bundler as its control, so a
|
|
159
|
+
* broken copy of the peer cannot be mistaken for the resolution failure.
|
|
160
|
+
*
|
|
161
|
+
* 🔴 **Install from the `beta` tag, not `latest`.** `@civitai/client`'s npm
|
|
162
|
+
* `latest` dist-tag points at `0.1.1-beta.0`, ~97 betas behind the `beta` tag
|
|
163
|
+
* the orchestrator is actually generated against, and missing most of the step
|
|
164
|
+
* types below. A plain `pnpm add @civitai/client` installs the stale one with
|
|
165
|
+
* no error; the first symptom is `TextToImageStepTemplate` not existing.
|
|
166
|
+
*
|
|
167
|
+
* ## Runtime cost: zero
|
|
168
|
+
*
|
|
169
|
+
* Every import and export here is type-only, so the emitted
|
|
170
|
+
* `dist/orchestrator/steps.js` is an empty module and no bundler ever follows
|
|
171
|
+
* an edge into `@civitai/client`. That is not a promise, it is a test:
|
|
172
|
+
* `test/orchestrator/steps-type-only.test.ts` compiles this file and asserts
|
|
173
|
+
* the emitted JavaScript contains no import of `@civitai/client`.
|
|
174
|
+
*/
|
|
175
|
+
import type { WorkflowTemplate, TextToImageStepTemplate, ImageGenStepTemplate, ComfyStepTemplate, CustomComfyStepTemplate, ImageUpscalerStepTemplate, ImageBackgroundRemovalStepTemplate, ImageToSvgStepTemplate, ImageResourceTrainingStepTemplate, PreprocessImageStepTemplate, ConvertImageStepTemplate, ImageUploadStepTemplate, VideoGenStepTemplate, VideoUpscalerStepTemplate, VideoInterpolationStepTemplate, VideoEnhancementStepTemplate, VideoFrameExtractionStepTemplate, VideoBackgroundRemovalStepTemplate, VideoMetadataStepTemplate, TranscodeStepTemplate, TextToSpeechStepTemplate, AceStepAudioStepTemplate, MiniMaxMusic3StepTemplate, TranscriptionStepTemplate, AudioCaptioningStepTemplate, ComposeMediaStepTemplate, PolyGenStepTemplate, Model3dPreviewStepTemplate, TrainingStepTemplate, MediaHashStepTemplate, ModelHashStepTemplate, MediaRatingStepTemplate, MediaCaptioningStepTemplate, WdTaggingStepTemplate, AgeClassificationStepTemplate, XGuardModerationStepTemplate, ShieldstralModerationStepTemplate, ModelClamScanStepTemplate, ModelPickleScanStepTemplate, ModelParseMetadataStepTemplate, ChatCompletionStepTemplate, PromptEnhancementStepTemplate, WebScrapeStepTemplate, WebSearchStepTemplate, EchoStepTemplate, BlobArchiveStepTemplate, ComfyNodepackSnapshotStepTemplate, QwenImageBenchStepTemplate } from '@civitai/client';
|
|
176
|
+
/**
|
|
177
|
+
* `true` when `@civitai/client`'s types did not resolve for the compiler that
|
|
178
|
+
* is reading this module.
|
|
179
|
+
*
|
|
180
|
+
* TypeScript gives an unresolved import an ERROR type. That type behaves like
|
|
181
|
+
* `any` in most positions — which is why the exports below would otherwise
|
|
182
|
+
* check nothing under `skipLibCheck: true` — but `keyof` over it is
|
|
183
|
+
* `string | number | symbol`, not `any`. So `string extends keyof T` separates
|
|
184
|
+
* the two cases: FALSE for every generated template (whose keys are a finite
|
|
185
|
+
* union of literals), TRUE for the error type.
|
|
186
|
+
*
|
|
187
|
+
* `string extends keyof T` is only sound as a detector if no real template
|
|
188
|
+
* carries a string index signature. Enumerated over all 47 mapped templates
|
|
189
|
+
* plus the base `WorkflowStepTemplate` at `@civitai/client@0.2.0-beta.98`:
|
|
190
|
+
* none does, and the probe was checked in both directions (a synthetic
|
|
191
|
+
* `{ [k: string]: unknown }` reports TRUE, each real template reports FALSE).
|
|
192
|
+
*/
|
|
193
|
+
type PeerTypesUnresolved = string extends keyof TextToImageStepTemplate ? true : false;
|
|
194
|
+
/**
|
|
195
|
+
* What a consumer sees instead of a step type when the peer did not resolve.
|
|
196
|
+
*
|
|
197
|
+
* A string literal type rather than `never`: assigning an object literal to it
|
|
198
|
+
* produces a `TS2322` **in the consumer's own file** whose text is this
|
|
199
|
+
* sentence, where the unguarded version produced no diagnostic at all.
|
|
200
|
+
*/
|
|
201
|
+
type PeerTypesUnresolvedError = "@civitai/app-sdk/orchestrator/steps is not type-checking: @civitai/client's types did not resolve. Install the peer with `pnpm add -D @civitai/client@beta`. If it IS installed, this subpath needs `\"moduleResolution\": \"Bundler\"` — the published package does not resolve under NodeNext/Node16.";
|
|
202
|
+
/** Collapses a lookup to the message above when the peer did not resolve. */
|
|
203
|
+
type GuardPeer<T> = [PeerTypesUnresolved] extends [true] ? PeerTypesUnresolvedError : T;
|
|
204
|
+
/**
|
|
205
|
+
* The 47 wire-name → generated-template rows, UNGUARDED and NOT exported.
|
|
206
|
+
*
|
|
207
|
+
* Every public export below is exactly one `GuardPeer<…>` over this map or a
|
|
208
|
+
* lookup into it, and keeping the raw rows here is what makes "exactly one"
|
|
209
|
+
* true. If the rows themselves were guarded, the guard on a public export would
|
|
210
|
+
* be a second guard on the same path: deleting it would leave the export still
|
|
211
|
+
* reporting, and `test/orchestrator/steps-peer-guard.test.ts` — which detects an
|
|
212
|
+
* unwrapped export by the consumer file that stops reporting — could not see the
|
|
213
|
+
* deletion. The same trap catches an export that reaches the map THROUGH
|
|
214
|
+
* ANOTHER EXPORT, since every export is guarded: that is why
|
|
215
|
+
* `TypedWorkflowTemplate` spells its `steps` element as a lookup into this map
|
|
216
|
+
* rather than as `AnyWorkflowStepTemplate`.
|
|
217
|
+
*
|
|
218
|
+
* 🔴 PINNED, because prose did not hold it. `TypedWorkflowTemplate` violated
|
|
219
|
+
* this paragraph from the moment the guard was introduced, with every check in
|
|
220
|
+
* the repo green. `test/orchestrator/steps-peer-guard.test.ts` now walks this AST
|
|
221
|
+
* and requires exactly one `GuardPeer` reference reachable from each exported
|
|
222
|
+
* alias, counting through this file's own type declarations.
|
|
223
|
+
*/
|
|
224
|
+
interface StepTemplateMap {
|
|
225
|
+
aceStepAudio: AceStepAudioStepTemplate;
|
|
226
|
+
ageClassification: AgeClassificationStepTemplate;
|
|
227
|
+
audioCaptioning: AudioCaptioningStepTemplate;
|
|
228
|
+
blobArchive: BlobArchiveStepTemplate;
|
|
229
|
+
chatCompletion: ChatCompletionStepTemplate;
|
|
230
|
+
comfy: ComfyStepTemplate;
|
|
231
|
+
comfyNodepackSnapshot: ComfyNodepackSnapshotStepTemplate;
|
|
232
|
+
composeMedia: ComposeMediaStepTemplate;
|
|
233
|
+
convertImage: ConvertImageStepTemplate;
|
|
234
|
+
customComfy: CustomComfyStepTemplate;
|
|
235
|
+
echo: EchoStepTemplate;
|
|
236
|
+
imageBackgroundRemoval: ImageBackgroundRemovalStepTemplate;
|
|
237
|
+
imageGen: ImageGenStepTemplate;
|
|
238
|
+
imageResourceTraining: ImageResourceTrainingStepTemplate;
|
|
239
|
+
imageToSvg: ImageToSvgStepTemplate;
|
|
240
|
+
imageUpload: ImageUploadStepTemplate;
|
|
241
|
+
imageUpscaler: ImageUpscalerStepTemplate;
|
|
242
|
+
mediaCaptioning: MediaCaptioningStepTemplate;
|
|
243
|
+
mediaHash: MediaHashStepTemplate;
|
|
244
|
+
mediaRating: MediaRatingStepTemplate;
|
|
245
|
+
miniMaxMusic3: MiniMaxMusic3StepTemplate;
|
|
246
|
+
model3DPreview: Model3dPreviewStepTemplate;
|
|
247
|
+
modelClamScan: ModelClamScanStepTemplate;
|
|
248
|
+
modelHash: ModelHashStepTemplate;
|
|
249
|
+
modelParseMetadata: ModelParseMetadataStepTemplate;
|
|
250
|
+
modelPickleScan: ModelPickleScanStepTemplate;
|
|
251
|
+
polyGen: PolyGenStepTemplate;
|
|
252
|
+
preprocessImage: PreprocessImageStepTemplate;
|
|
253
|
+
promptEnhancement: PromptEnhancementStepTemplate;
|
|
254
|
+
qwenImageBench: QwenImageBenchStepTemplate;
|
|
255
|
+
shieldstralModeration: ShieldstralModerationStepTemplate;
|
|
256
|
+
textToImage: TextToImageStepTemplate;
|
|
257
|
+
textToSpeech: TextToSpeechStepTemplate;
|
|
258
|
+
training: TrainingStepTemplate;
|
|
259
|
+
transcode: TranscodeStepTemplate;
|
|
260
|
+
transcription: TranscriptionStepTemplate;
|
|
261
|
+
videoBackgroundRemoval: VideoBackgroundRemovalStepTemplate;
|
|
262
|
+
videoEnhancement: VideoEnhancementStepTemplate;
|
|
263
|
+
videoFrameExtraction: VideoFrameExtractionStepTemplate;
|
|
264
|
+
videoGen: VideoGenStepTemplate;
|
|
265
|
+
videoInterpolation: VideoInterpolationStepTemplate;
|
|
266
|
+
videoMetadata: VideoMetadataStepTemplate;
|
|
267
|
+
videoUpscaler: VideoUpscalerStepTemplate;
|
|
268
|
+
wdTagging: WdTaggingStepTemplate;
|
|
269
|
+
webScrape: WebScrapeStepTemplate;
|
|
270
|
+
webSearch: WebSearchStepTemplate;
|
|
271
|
+
xGuardModeration: XGuardModerationStepTemplate;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* `$type` → its step-template type, for all 47 step types.
|
|
275
|
+
*
|
|
276
|
+
* Keyed by the WIRE name rather than the generated type name, because the wire
|
|
277
|
+
* name is what you actually have in hand and the generator does not always
|
|
278
|
+
* spell it the way you would guess (`model3DPreview` →
|
|
279
|
+
* `Model3dPreviewStepTemplate`).
|
|
280
|
+
*
|
|
281
|
+
* Each value is wrapped in `GuardPeer`, so `WorkflowStepTemplates['textToImage']`
|
|
282
|
+
* is as loud about a missing peer as `WorkflowStepTemplateFor<'textToImage'>` is.
|
|
283
|
+
* `keyof` and the lookups are unaffected: when the peer resolves, `GuardPeer<X>`
|
|
284
|
+
* IS `X`.
|
|
285
|
+
*
|
|
286
|
+
* `test/orchestrator/step-templates.test-d.ts` asserts this key set equals
|
|
287
|
+
* `WORKFLOW_STEP_TYPES` (the catalog in `@civitai/app-sdk/orchestrator`, itself
|
|
288
|
+
* pinned to the orchestrator spec's discriminator mapping) at COMPILE TIME,
|
|
289
|
+
* BOTH directions, via an explicit `never` ledger for the gap. What that does
|
|
290
|
+
* and does not buy:
|
|
291
|
+
*
|
|
292
|
+
* - a key here that the catalog does not list (a typo, or a phantom `$type`
|
|
293
|
+
* like the `audioMix` the catalog itself once carried) fails the typecheck;
|
|
294
|
+
* - a catalog entry with no key here fails the typecheck, so this map cannot
|
|
295
|
+
* quietly fall behind the catalog;
|
|
296
|
+
* - it does NOT see the orchestrator gaining a step type that neither the
|
|
297
|
+
* catalog nor the pinned client knows about. That is the catalog's own
|
|
298
|
+
* drift check's job (`pnpm check:catalogs`, which re-fetches the LIVE spec).
|
|
299
|
+
*
|
|
300
|
+
* The two can legitimately disagree for a while: the catalog tracks the live
|
|
301
|
+
* spec, while these types track whatever `@civitai/client` was last published
|
|
302
|
+
* from. When the catalog syncs ahead, name the not-yet-typed step types in the
|
|
303
|
+
* test's ledger in the same PR, and clear them when the client republishes.
|
|
304
|
+
*/
|
|
305
|
+
export type WorkflowStepTemplates = {
|
|
306
|
+
[K in keyof StepTemplateMap]: GuardPeer<StepTemplateMap[K]>;
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* The step template for one `$type`.
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* type Tti = WorkflowStepTemplateFor<'textToImage'>;
|
|
313
|
+
*/
|
|
314
|
+
export type WorkflowStepTemplateFor<T extends keyof StepTemplateMap> = GuardPeer<StepTemplateMap[T]>;
|
|
315
|
+
/**
|
|
316
|
+
* The `input` shape for one `$type` — the per-step payload, without having to
|
|
317
|
+
* know or import the generated `*Input` name. This is why neither the 47
|
|
318
|
+
* `*Input` types nor the 47 `*StepTemplate` types are re-exported one by one:
|
|
319
|
+
* the lookup is keyed by the wire `$type` you already have, and the generated
|
|
320
|
+
* names remain importable from `@civitai/client` for anyone who wants them.
|
|
321
|
+
*
|
|
322
|
+
* @example
|
|
323
|
+
* function buildVideo(input: WorkflowStepInputFor<'videoGen'>) { … }
|
|
324
|
+
*/
|
|
325
|
+
export type WorkflowStepInputFor<T extends keyof StepTemplateMap> = GuardPeer<StepTemplateMap[T]['input']>;
|
|
326
|
+
/**
|
|
327
|
+
* Discriminated union of every step template — discriminate on `$type`.
|
|
328
|
+
*
|
|
329
|
+
* `@civitai/client`'s base `WorkflowStepTemplate` has `$type` as a bare
|
|
330
|
+
* `string`, so it narrows nothing. This union is what makes
|
|
331
|
+
* `Extract<…, { $type: 'comfy' }>` and an exhaustive `switch` work.
|
|
332
|
+
*/
|
|
333
|
+
export type AnyWorkflowStepTemplate = GuardPeer<StepTemplateMap[keyof StepTemplateMap]>;
|
|
334
|
+
/**
|
|
335
|
+
* A submit body whose `steps` are the narrowed union rather than
|
|
336
|
+
* `@civitai/client`'s base `WorkflowStepTemplate[]`.
|
|
337
|
+
*
|
|
338
|
+
* Assignable straight into `submitWorkflow` / `estimateWorkflow` from
|
|
339
|
+
* `@civitai/app-sdk/orchestrator`, whose `body` parameter is `unknown`. Those
|
|
340
|
+
* signatures are deliberately NOT narrowed to this type: that would drag
|
|
341
|
+
* `@civitai/client` into the main `./orchestrator` entry point and make the
|
|
342
|
+
* optional peer mandatory for everyone.
|
|
343
|
+
*
|
|
344
|
+
* 🔴 ONE DELIBERATE DIVERGENCE FROM THE GENERATED TYPE: `currencies` is
|
|
345
|
+
* OPTIONAL here, where `WorkflowTemplate` has it REQUIRED.
|
|
346
|
+
*
|
|
347
|
+
* The orchestrator's OpenAPI spec really does list `currencies` under
|
|
348
|
+
* `WorkflowTemplate.required` (`["currencies","steps"]`), so the generated type
|
|
349
|
+
* is faithful — but nothing else behaves as if it were required:
|
|
350
|
+
* `buildTextToImageBody` / `buildImageGenBody` / `buildWorkflowBody` in
|
|
351
|
+
* `@civitai/app-sdk/orchestrator` have never emitted it, every starter submits
|
|
352
|
+
* through them, and civitai's own orchestrator services pass
|
|
353
|
+
* `currencies: undefined` on several paths and read it back with `?.`.
|
|
354
|
+
*
|
|
355
|
+
* Taking the generated type literally would therefore produce a type that
|
|
356
|
+
* contradicts this package's own working helpers, and would make every existing
|
|
357
|
+
* caller stop compiling.
|
|
358
|
+
*
|
|
359
|
+
* ⚠️ WHAT IS ESTABLISHED, AND WHAT IS NOT. The spec marks `currencies`
|
|
360
|
+
* required, and describes it — `WorkflowTemplate.properties.currencies
|
|
361
|
+
* .description` in the live spec — as "Limit the currencies that can be used to
|
|
362
|
+
* pay for this workflow." That description says what the field does WHEN
|
|
363
|
+
* PRESENT. **What the orchestrator does when it is omitted is unverified**: the
|
|
364
|
+
* spec licenses no inference either way, and the candidates (rejected as
|
|
365
|
+
* invalid, unlimited, or scoped to some server-side default) are not
|
|
366
|
+
* distinguishable from the document. This relaxation is about THIS package's
|
|
367
|
+
* API — it forbids nothing that compiled before, requires nothing new of
|
|
368
|
+
* callers, and matches what the helpers have always sent. If you want a
|
|
369
|
+
* workflow's payment scoped to particular currencies, pass `currencies`
|
|
370
|
+
* explicitly — the field is still here and still the generated element type.
|
|
371
|
+
*
|
|
372
|
+
* Pinned by `test/orchestrator/step-templates.test-d.ts` so the divergence
|
|
373
|
+
* cannot widen unnoticed.
|
|
374
|
+
*
|
|
375
|
+
* NOT VERIFIED against a live submit — doing so costs real Buzz. The evidence
|
|
376
|
+
* above is the spec, this package's helpers, and civitai's call sites.
|
|
377
|
+
*
|
|
378
|
+
* `steps` is spelled `StepTemplateMap[keyof StepTemplateMap][]` rather than
|
|
379
|
+
* `AnyWorkflowStepTemplate[]`, which is the same type — when the peer resolves,
|
|
380
|
+
* `GuardPeer<X>` IS `X` — but reaches it without going through another guarded
|
|
381
|
+
* export. Writing `AnyWorkflowStepTemplate[]` here would put a SECOND guard on
|
|
382
|
+
* the `steps` path, and a second guard is what makes the first one deletable
|
|
383
|
+
* without anything noticing: the export would keep reporting from the inherited
|
|
384
|
+
* one. See the invariant on `StepTemplateMap` above, and the test that pins it.
|
|
385
|
+
*/
|
|
386
|
+
export type TypedWorkflowTemplate = GuardPeer<Omit<WorkflowTemplate, 'steps' | 'currencies'> & {
|
|
387
|
+
steps: StepTemplateMap[keyof StepTemplateMap][];
|
|
388
|
+
currencies?: WorkflowTemplate['currencies'];
|
|
389
|
+
}>;
|
|
390
|
+
export {};
|
|
391
|
+
//# sourceMappingURL=steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../src/orchestrator/steps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6KG;AAEH,OAAO,KAAK,EAEV,gBAAgB,EAGhB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,kCAAkC,EAClC,sBAAsB,EACtB,iCAAiC,EACjC,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EAGvB,oBAAoB,EACpB,yBAAyB,E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CAAC;CAChD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,qBAAqB,GAAG;KACjC,CAAC,IAAI,MAAM,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;CAC5D,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,MAAM,eAAe,IAAI,SAAS,CAC9E,eAAe,CAAC,CAAC,CAAC,CACnB,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,MAAM,eAAe,IAAI,SAAS,CAC3E,eAAe,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAC5B,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,SAAS,CAAC,eAAe,CAAC,MAAM,eAAe,CAAC,CAAC,CAAC;AAExF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,MAAM,qBAAqB,GAAG,SAAS,CAC3C,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,YAAY,CAAC,GAAG;IAC/C,KAAK,EAAE,eAAe,CAAC,MAAM,eAAe,CAAC,EAAE,CAAC;IAChD,UAAU,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;CAC7C,CACF,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orchestrator workflow-step TYPES, keyed by wire `$type` over the orchestrator's
|
|
3
|
+
* own generated client (`@civitai/client`).
|
|
4
|
+
*
|
|
5
|
+
* The sibling `@civitai/app-sdk/orchestrator` module gives you the *catalog*
|
|
6
|
+
* (`WORKFLOW_STEP_TYPES` — 47 `$type` names and what each one does) and the
|
|
7
|
+
* fetch helpers (`submitWorkflow`, `estimateWorkflow`, …), but its body
|
|
8
|
+
* builders take `input: unknown`. This module is the missing half: the actual
|
|
9
|
+
* per-step input shapes, tracked against the orchestrator's OpenAPI spec by
|
|
10
|
+
* codegen instead of by hand.
|
|
11
|
+
*
|
|
12
|
+
* What this module adds on top of `@civitai/client` is the `$type` → template
|
|
13
|
+
* MAP (`WorkflowStepTemplates`) and the lookups derived from it. The generated
|
|
14
|
+
* template types themselves are `@civitai/client`'s, and since that package is
|
|
15
|
+
* a required install for this subpath anyway (its names appear in this module's
|
|
16
|
+
* emitted declarations), import them straight from it when you need one by
|
|
17
|
+
* name:
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* import type { TextToImageStepTemplate } from '@civitai/client';
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Reaching for `WorkflowStepTemplateFor<'textToImage'>` is usually better: the
|
|
24
|
+
* generated name is not always the one you would guess from the wire name
|
|
25
|
+
* (`model3DPreview` → `Model3dPreviewStepTemplate`), and looking it up is the
|
|
26
|
+
* discoverability tax the map exists to remove.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* import { createOrchestratorClient, submitWorkflow } from '@civitai/app-sdk/orchestrator';
|
|
30
|
+
* import type {
|
|
31
|
+
* TypedWorkflowTemplate,
|
|
32
|
+
* WorkflowStepTemplateFor,
|
|
33
|
+
* } from '@civitai/app-sdk/orchestrator/steps';
|
|
34
|
+
*
|
|
35
|
+
* const step: WorkflowStepTemplateFor<'textToImage'> = {
|
|
36
|
+
* $type: 'textToImage',
|
|
37
|
+
* name: 'step_0',
|
|
38
|
+
* input: {
|
|
39
|
+
* prompt: 'a fox',
|
|
40
|
+
* model: 'urn:air:sdxl:checkpoint:civitai:101055@128078',
|
|
41
|
+
* // REQUIRED on textToImage — easy to miss when hand-writing the body,
|
|
42
|
+
* // and the kind of thing these types exist to catch.
|
|
43
|
+
* cfgScale: 5,
|
|
44
|
+
* seed: 1234,
|
|
45
|
+
* },
|
|
46
|
+
* };
|
|
47
|
+
* const body: TypedWorkflowTemplate = { steps: [step], tags: ['my-app'] };
|
|
48
|
+
* await submitWorkflow(createOrchestratorClient({ accessToken }), body);
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* ## 🔴 THIS IS TYPE SURFACE. IT IS NOT PERMISSION SURFACE.
|
|
52
|
+
*
|
|
53
|
+
* A `$type` having a type here says **nothing** about whether you are allowed
|
|
54
|
+
* to submit it. Two separate things decide that, and neither is affected by
|
|
55
|
+
* this module:
|
|
56
|
+
*
|
|
57
|
+
* - **App Blocks** (iframe blocks embedded in civitai.com) do not talk to the
|
|
58
|
+
* orchestrator at all. They post a `WorkflowBody` to the host, which
|
|
59
|
+
* validates it against its own server-side `blockWorkflowBodySchema`. That
|
|
60
|
+
* contract lives in this package's `blocks/types.ts` and is untouched here —
|
|
61
|
+
* importing a step type does not widen it by one field.
|
|
62
|
+
* - **Standalone apps / BFFs** submit to the orchestrator directly with the
|
|
63
|
+
* user's OAuth token, and the orchestrator applies its own authorization.
|
|
64
|
+
* A body that compiles can still come back 400 or 403.
|
|
65
|
+
*
|
|
66
|
+
* The practical consequence: a number of the 47 step types below exist to serve
|
|
67
|
+
* Civitai's own pipelines rather than third-party apps — `modelPickleScan`,
|
|
68
|
+
* `xGuardModeration`, `training`, `comfyNodepackSnapshot`, `qwenImageBench`,
|
|
69
|
+
* the `model*` / `media*` hashing and classification steps. They are in the
|
|
70
|
+
* consumer spec, so they are typed here. They are not an invitation.
|
|
71
|
+
*
|
|
72
|
+
* ⚠️ `WORKFLOW_STEP_TYPES` does NOT mark most of them. Counted at this commit:
|
|
73
|
+
* of its 47 entries, exactly TWO sit under its "Platform internals" heading —
|
|
74
|
+
* `comfyNodepackSnapshot` and `qwenImageBench`. `training`, `webScrape`,
|
|
75
|
+
* `xGuardModeration`, `modelPickleScan` and the `model*` / `media*` steps are
|
|
76
|
+
* ordinary documented entries under ordinary headings, and `webScrape` carries
|
|
77
|
+
* consumer-facing usage notes. So "the catalog already flags these as internal"
|
|
78
|
+
* is not a reason this map covers all 47, and an earlier version of this
|
|
79
|
+
* docblock claiming it was is wrong. What IS true, and is the reason: the
|
|
80
|
+
* catalog DOCUMENTS all 47, and a lookup keyed by `$type` is only sound as a
|
|
81
|
+
* lookup if it is total over `WorkflowStepType` — a partial map makes
|
|
82
|
+
* `WorkflowStepTemplateFor<'training'>` a compile error for a step type the
|
|
83
|
+
* SDK documents, and makes the key-parity assertion below impossible.
|
|
84
|
+
*
|
|
85
|
+
* ## Why this is a separate deep entry point
|
|
86
|
+
*
|
|
87
|
+
* `@civitai/client` is an **optional peer**, not a dependency (see the
|
|
88
|
+
* `comment-peerDependencies` block in this package's package.json). Keeping
|
|
89
|
+
* this module out of `./orchestrator` and `.` means an app that never imports
|
|
90
|
+
* `@civitai/app-sdk/orchestrator/steps` never needs the peer installed. If you
|
|
91
|
+
* DO import this module, install it:
|
|
92
|
+
*
|
|
93
|
+
* ```sh
|
|
94
|
+
* pnpm add -D @civitai/client@beta
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* 🔴 **WITHOUT A GUARD, FORGETTING THE PEER IS SILENT UNDER
|
|
98
|
+
* `skipLibCheck: true`, WHICH IS THE DEFAULT.** The unresolved
|
|
99
|
+
* `@civitai/client` import lands in the emitted `steps.d.ts`, so `skipLibCheck`
|
|
100
|
+
* — which every starter in this repo sets, as does `tsc --init` — suppresses
|
|
101
|
+
* its `TS2307` along with every other declaration-file diagnostic. The exports
|
|
102
|
+
* here then degrade to an error type that behaves like `any`, and the code
|
|
103
|
+
* below still compiles while checking NOTHING.
|
|
104
|
+
*
|
|
105
|
+
* **`GuardPeer` (below) closes that hole on every export of this module.** All
|
|
106
|
+
* five — `WorkflowStepTemplates`, `WorkflowStepTemplateFor`,
|
|
107
|
+
* `WorkflowStepInputFor`, `AnyWorkflowStepTemplate`, `TypedWorkflowTemplate` —
|
|
108
|
+
* are guarded, and a sixth cannot join them unnoticed: the test enumerates this
|
|
109
|
+
* module's exported symbols through the TypeScript API and fails if any of them
|
|
110
|
+
* lacks a consumer file in its ledger, each of which is asserted to report.
|
|
111
|
+
*
|
|
112
|
+
* **The measurement.** Declarations emitted from this file at each revision
|
|
113
|
+
* below, then SEVEN consumer files compiled against them IN ONE PROGRAM with
|
|
114
|
+
* `skipLibCheck: true` and TypeScript 5.9.3: one correct annotation per export
|
|
115
|
+
* (five), one whose `$type` is deliberately wrong, and a planted
|
|
116
|
+
* `const x: number = 's'` so a zero is distinguishable from a compiler wired to
|
|
117
|
+
* nothing. "Peer installed" was measured twice, once through `paths` and once
|
|
118
|
+
* against a real copy of the published package in the consumer's own
|
|
119
|
+
* `node_modules`; both give the numbers below.
|
|
120
|
+
*
|
|
121
|
+
* ⚠️ RUNNING `test/orchestrator/steps-peer-guard.test.ts` DOES NOT REPRODUCE
|
|
122
|
+
* THIS TABLE, and none of its arms corresponds to a row here. It uses the same
|
|
123
|
+
* consumer sources and the same compiler settings, but groups them
|
|
124
|
+
* differently: the five correct annotations compile with the planted control
|
|
125
|
+
* and WITHOUT the wrong-`$type` file, which gets a program of its own. It also
|
|
126
|
+
* only ever compiles the module as it stands here, so the `be503a9d` and
|
|
127
|
+
* `851d8846` rows are out of its reach entirely. To reproduce a row: emit
|
|
128
|
+
* `steps.d.ts` from the revision that row names, then compile all seven
|
|
129
|
+
* consumer files together under the peer resolution it names.
|
|
130
|
+
*
|
|
131
|
+
* | this file at | peer / resolution | diagnostics |
|
|
132
|
+
* |---|---|---|
|
|
133
|
+
* | `be503a9d`, before any guard | installed, Bundler | 2 — the wrong `$type`, plus the planted control |
|
|
134
|
+
* | `be503a9d`, before any guard | **missing**, Bundler | **1 — the planted control alone.** The wrong `$type` reports nothing |
|
|
135
|
+
* | `be503a9d`, before any guard | installed, **NodeNext** | **1 — the planted control alone**, with the peer correctly installed |
|
|
136
|
+
* | `851d8846`, guard on four exports | missing, Bundler | 6 — the four then-guarded exports report (one of them twice, since the wrong-`$type` file annotates with `WorkflowStepTemplateFor`), plus the planted control. **The `WorkflowStepTemplates` annotation is silent** |
|
|
137
|
+
* | here | installed, Bundler | 2 — the same two diagnostics, character for character, as the `be503a9d` / installed / Bundler row |
|
|
138
|
+
* | here | **missing**, Bundler | 7 — a `TS2322` **in the consumer's own file** for each of the five exports and for the wrong-`$type` file, naming the install command, plus the planted control |
|
|
139
|
+
* | here | installed, **NodeNext** | 7 — the same set |
|
|
140
|
+
*
|
|
141
|
+
* With `skipLibCheck: false` and no guard you get one error,
|
|
142
|
+
* `TS2307: Cannot find module '@civitai/client'`, reported against
|
|
143
|
+
* `node_modules/@civitai/app-sdk/dist/orchestrator/steps.d.ts` rather than
|
|
144
|
+
* against your own file.
|
|
145
|
+
*
|
|
146
|
+
* 🔴 **THE SAME DEGRADATION HAPPENS WITH THE PEER INSTALLED, UNDER
|
|
147
|
+
* `NodeNext`/`Node16`.** `@civitai/client@0.2.0-beta.98` is published with
|
|
148
|
+
* `"type": "module"`, no `exports` map, and extensionless relative re-exports
|
|
149
|
+
* (`export * from './generated'`), which Node's ESM resolution does not
|
|
150
|
+
* resolve — see the third and last rows above. That is why the guard's message
|
|
151
|
+
* names this case as well as the missing-peer one. Use
|
|
152
|
+
* `"moduleResolution": "Bundler"` (what every starter here and this package
|
|
153
|
+
* itself set).
|
|
154
|
+
*
|
|
155
|
+
* All three arms — peer absent, peer present, and peer present under NodeNext —
|
|
156
|
+
* are pinned by `test/orchestrator/steps-peer-guard.test.ts`, which compiles
|
|
157
|
+
* that consumer against this module's own emitted declarations. The NodeNext
|
|
158
|
+
* arm carries the same directory compiled under Bundler as its control, so a
|
|
159
|
+
* broken copy of the peer cannot be mistaken for the resolution failure.
|
|
160
|
+
*
|
|
161
|
+
* 🔴 **Install from the `beta` tag, not `latest`.** `@civitai/client`'s npm
|
|
162
|
+
* `latest` dist-tag points at `0.1.1-beta.0`, ~97 betas behind the `beta` tag
|
|
163
|
+
* the orchestrator is actually generated against, and missing most of the step
|
|
164
|
+
* types below. A plain `pnpm add @civitai/client` installs the stale one with
|
|
165
|
+
* no error; the first symptom is `TextToImageStepTemplate` not existing.
|
|
166
|
+
*
|
|
167
|
+
* ## Runtime cost: zero
|
|
168
|
+
*
|
|
169
|
+
* Every import and export here is type-only, so the emitted
|
|
170
|
+
* `dist/orchestrator/steps.js` is an empty module and no bundler ever follows
|
|
171
|
+
* an edge into `@civitai/client`. That is not a promise, it is a test:
|
|
172
|
+
* `test/orchestrator/steps-type-only.test.ts` compiles this file and asserts
|
|
173
|
+
* the emitted JavaScript contains no import of `@civitai/client`.
|
|
174
|
+
*/
|
|
175
|
+
export {};
|
|
176
|
+
//# sourceMappingURL=steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steps.js","sourceRoot":"","sources":["../../src/orchestrator/steps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6KG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@civitai/app-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.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",
|
|
@@ -31,6 +31,10 @@
|
|
|
31
31
|
"types": "./dist/orchestrator/index.d.ts",
|
|
32
32
|
"import": "./dist/orchestrator/index.js"
|
|
33
33
|
},
|
|
34
|
+
"./orchestrator/steps": {
|
|
35
|
+
"types": "./dist/orchestrator/steps.d.ts",
|
|
36
|
+
"import": "./dist/orchestrator/steps.js"
|
|
37
|
+
},
|
|
34
38
|
"./blocks": {
|
|
35
39
|
"types": "./dist/blocks/index.d.ts",
|
|
36
40
|
"import": "./dist/blocks/index.js"
|
|
@@ -50,7 +54,36 @@
|
|
|
50
54
|
"node": ">=20"
|
|
51
55
|
},
|
|
52
56
|
"dependencies": {},
|
|
57
|
+
"comment-peerDependencies": [
|
|
58
|
+
"@civitai/client is consumed for TYPES ONLY, by `./orchestrator/steps`.",
|
|
59
|
+
"It is an OPTIONAL peer, never a dependency: `dependencies` is empty on",
|
|
60
|
+
"purpose (this package ships into sandboxed browser iframes and every app",
|
|
61
|
+
"inherits its install graph), and @civitai/client has no types-only entry",
|
|
62
|
+
"point -- it ships .d.ts beside .js in one package with a real runtime",
|
|
63
|
+
"(@hey-api/client-fetch, rfc6902, tslib). Optional-peer keeps that graph",
|
|
64
|
+
"out of every app that does not ask for the step types, and keeps the",
|
|
65
|
+
"version the APP's choice.",
|
|
66
|
+
"",
|
|
67
|
+
"🔴 THE PIN IS NOT `latest` AND MUST NOT BECOME IT. @civitai/client's npm",
|
|
68
|
+
"`latest` dist-tag is 0.1.1-beta.0; the version the orchestrator is",
|
|
69
|
+
"actually generated against ships under the `beta` tag (0.2.0-beta.98 as of",
|
|
70
|
+
"this writing -- cross-checked against what civitai/civitai resolves).",
|
|
71
|
+
"`pnpm add @civitai/client` therefore installs something ~97 betas behind",
|
|
72
|
+
"and MISSING MOST STEP TYPES, with no error. The range below deliberately",
|
|
73
|
+
"excludes 0.1.x: verify with",
|
|
74
|
+
"`semver.satisfies('0.1.1-beta.0', '^0.2.0-beta.98')` === false.",
|
|
75
|
+
"Install with the tag: `pnpm add -D @civitai/client@beta`."
|
|
76
|
+
],
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"@civitai/client": "^0.2.0-beta.98"
|
|
79
|
+
},
|
|
80
|
+
"peerDependenciesMeta": {
|
|
81
|
+
"@civitai/client": {
|
|
82
|
+
"optional": true
|
|
83
|
+
}
|
|
84
|
+
},
|
|
53
85
|
"devDependencies": {
|
|
86
|
+
"@civitai/client": "0.2.0-beta.98",
|
|
54
87
|
"@types/node": "^25.9.1",
|
|
55
88
|
"typescript": "^5.9.2",
|
|
56
89
|
"vitest": "^4.1.11"
|