@oiioii/cli 0.1.6 → 0.1.7

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.
Files changed (3) hide show
  1. package/README.md +47 -14
  2. package/dist/cli.js +32 -31
  3. package/package.json +11 -2
package/README.md CHANGED
@@ -17,6 +17,7 @@ human-readable output and a stable JSON envelope for AI agents and automation.
17
17
  | `auth logout` | Remove locally persisted authentication without exposing the API Key | Implemented |
18
18
  | `workspace create/set/current/rename` | Create, configure, inspect, and rename workspaces | Implemented |
19
19
  | `workspace assets list/download` | List workspace assets and download ready resources | Implemented |
20
+ | `library list/search` | Query and search reusable role, scene, and item assets | Implemented |
20
21
  | `image text` | Text-to-image generation | Implemented |
21
22
  | `image edit` | Image-to-image editing | Implemented |
22
23
  | `video text` | Text-to-video generation | Implemented |
@@ -34,14 +35,14 @@ human-readable output and a stable JSON envelope for AI agents and automation.
34
35
  Important current limitations:
35
36
 
36
37
  - API keys are stored in `~/.oiioii/config.json` after `oiioii auth login`; the file is owner-readable only (`0600`).
37
- - Generation submits `submit_async_media_generation` and returns immediately with the authoritative backend `task_id` plus a `local_task_id`.
38
+ - Generation submits `POST /v1/media/generations` by default and returns immediately with the authoritative backend `task_id` plus a `local_task_id`.
38
39
  - The backend task ID, workspace, media type, asset ID, progress, and terminal outputs are cached in the owner-only local task store.
39
- - `task status/wait` query `query_async_media_generation` for non-terminal cached tasks and accept either the backend or local task ID.
40
+ - `task status/wait` query the stored task transport for non-terminal cached tasks and accept either the backend or local task ID.
40
41
  - If submission times out or disconnects before the backend task ID is received, the task remains `submitting`; `task retry <local_task_id>` resends the saved request with the original idempotency key.
41
42
  - REST metadata requests time out after 30 seconds; raw resource uploads/downloads use a 5-minute transfer timeout, and VOD transcode polling has a 10-minute overall deadline.
42
43
  - Image, video, and audio generation create local preview bundles after a queried task reaches a terminal state.
43
44
  - `inspect capabilities` is local metadata; `inspect models` requires authentication and queries the active backend.
44
- - Asset search/update/delete and style-library commands are not available. Workspace-scoped asset listing and download are available.
45
+ - Asset-library update/delete and style-library commands are not available. Reusable asset query/search and workspace-scoped asset listing/download are available.
45
46
 
46
47
  ## Requirements
47
48
 
@@ -275,6 +276,18 @@ oiioii workspace assets download <asset_id> --output ./downloads --json
275
276
  identity to the asset's downloadable `uri`; loading, uploading, empty, failed,
276
277
  or URI-less assets fail before the download request.
277
278
 
279
+ Query or search reusable library assets before generation:
280
+
281
+ ```bash
282
+ oiioii library list role --limit 20 --json
283
+ oiioii library search role "球球" --limit 20 --json
284
+ oiioii library search scene "森林" --cursor '<next_cursor>' --json
285
+ ```
286
+
287
+ Use the returned `asset_uri` with `--asset`, or bind a prompt mention explicitly
288
+ with `--bind <name=asset-uri>`. Explicit bindings avoid silently selecting the
289
+ wrong asset when the library contains duplicate display names.
290
+
278
291
  Workspace resolution order is:
279
292
 
280
293
  1. Root `--workspace <id>` option.
@@ -291,6 +304,11 @@ oiioii image text \
291
304
  --model seedream45 \
292
305
  --resolution 2K \
293
306
  --json
307
+
308
+ oiioii image text \
309
+ --prompt "让@球球坐在窗边" \
310
+ --bind 球球=hogi://role_asset/<role_id> \
311
+ --json
294
312
  ```
295
313
 
296
314
  Image editing:
@@ -308,11 +326,11 @@ Current behavior:
308
326
 
309
327
  - Accepts `--model-id <id>` from `inspect models` for exact backend model
310
328
  selection, or `--model <key> --variant <variant>` as an alternative.
311
- - Calls `POST /mcp/genai/sse` with JSON-RPC `tools/call` and `submit_async_media_generation`.
329
+ - Calls `POST /v1/media/generations` with Bearer authentication and an idempotency header.
312
330
  - Authenticates with `x-hogi-api-key`.
313
331
  - Requires an active workspace.
314
332
  - Returns after submission; use `task status` or `task wait` to query progress and terminal `hogi://image/...` output.
315
- - Image editing adapts the source URI to the async service's `referenceImages` contract.
333
+ - Image editing sends the source URI through the structured `references` contract.
316
334
  - When image shape options are omitted, the CLI uses the exact selected model
317
335
  catalog row's first aspect ratio and resolution (falling back only when the
318
336
  catalog leaves those fields empty).
@@ -359,6 +377,13 @@ oiioii video generate \
359
377
  --duration 8 \
360
378
  --resolution 720p \
361
379
  --json
380
+
381
+ oiioii video generate \
382
+ --prompt "小猫跳舞@球球" \
383
+ --bind 球球=hogi://role_asset/<role_id> \
384
+ --asset hogi://scene_asset/<scene_id> \
385
+ --model seedance25 \
386
+ --json
362
387
  ```
363
388
 
364
389
  When video duration, aspect ratio, or resolution is omitted, the CLI resolves
@@ -370,15 +395,20 @@ Current behavior:
370
395
 
371
396
  - Accepts `--model-id <id>` from `inspect models` for exact backend model
372
397
  selection, or `--model <key> --variant <variant>` as an alternative.
373
- - Calls `submit_async_media_generation` through `/mcp/genai/sse` with `x-hogi-api-key` authentication.
398
+ - Calls `POST /v1/media/generations` with Bearer authentication.
374
399
  - Returns after submission; terminal video URI validation happens during `task status/wait`.
375
400
  - Text-to-video sends `prompt`, `duration`, `aspectRatio`, `resolution`, and
376
401
  `workspace_id`.
377
- - Model-specific `imageUrl`/`images` fields are validated locally, then adapted
378
- to the async service's `referenceImages` field with `generateMode` preserved.
402
+ - Model-specific reference fields are validated locally, then sent through the
403
+ structured OpenAPI `references` list with `generateMode` preserved.
379
404
  - `video generate` accepts zero or more `--image`, `--video`, and `--audio`
380
405
  references in the same request. `--mode auto` derives `text2Video` or
381
406
  `omni2Video`; frame semantics can be selected explicitly with `--mode`.
407
+ - Seedance 2.5 omni requests accept `--task-type reference|edit|extend`.
408
+ - `--asset` adds role/scene/item assets as visual references. `--bind` also
409
+ rewrites an exact `@name` occurrence to `[Role:<id>]`, `[Scene:<id>]`, or
410
+ `[Item:<id>]`. Workspace-asset references use OpenAPI so the backend can apply
411
+ visibility checks, main-image resolution, and Seedance role head-combo selection.
382
412
  - Reference fields, combinations, and limits are validated against an exact
383
413
  backend-tool contract before MCP submission. The current mixed-input matrix is:
384
414
  Seedance 2.0/2.5 (image + video + audio), MiniMax H3
@@ -433,17 +463,16 @@ unbounded automated loops, and do not retry failures blindly.
433
463
 
434
464
  ## Async Generation and Workspace Assets
435
465
 
436
- Image, video, and audio commands submit through:
466
+ Image, video, and audio commands submit through OpenAPI by default:
437
467
 
438
468
  ```text
439
- POST /mcp/genai/sse
440
- method: tools/call
441
- name: submit_async_media_generation
469
+ POST /v1/media/generations
470
+ GET /v1/media/generations/:task_id
442
471
  ```
443
472
 
444
473
  The backend creates the loading workspace asset and returns its `assetId` and
445
- authoritative `taskId`. The CLI caches both IDs. `task status/wait` calls
446
- `query_async_media_generation`, reconciles progress/error/output into the local
474
+ authoritative `taskId`. The CLI caches both IDs and the selected transport.
475
+ `task status/wait` queries the same transport, reconciles progress/error/output into the local
447
476
  record, and creates the terminal preview bundle. The CLI does not issue a second
448
477
  `create_asset` call, which avoids duplicate workspace assets.
449
478
 
@@ -916,6 +945,10 @@ Environment variables:
916
945
  |---|---|
917
946
  | `OIIOII_CONFIG_DIR` | Override the local configuration directory |
918
947
  | `OIIOII_BASE_URL` | Override the backend URL at runtime |
948
+ | `OIIOII_GENERATION_TRANSPORT` | Select `openapi` (default) or the `mcp` rollback transport |
949
+
950
+ The MCP rollback transport preserves the legacy media-reference payload. Prompt
951
+ references to role, scene, or item workspace assets require the default OpenAPI transport.
919
952
  | `OIIOII_WORKSPACE_ID` | Override the active workspace |
920
953
  | `OIIOII_BUILD_ENV` | Select `production`, `test`, or `local` while building |
921
954
  | `OIIOII_PRODUCTION_BASE_URL` | Optional override for the production build's canonical backend URL |