@wji.ai/cli 0.6.1 → 0.7.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.
Files changed (35) hide show
  1. package/README.md +19 -2
  2. package/dist/commands/backreel-enquiry.js +171 -0
  3. package/dist/commands/backreel-episode.js +243 -0
  4. package/dist/commands/backreel-fund.js +299 -0
  5. package/dist/commands/backreel.js +141 -18
  6. package/dist/commands/gen.js +5 -1
  7. package/dist/commands/npc-album.js +201 -0
  8. package/dist/commands/npc-live.js +316 -0
  9. package/dist/commands/npc.js +26 -2
  10. package/dist/core/backreel.js +23 -0
  11. package/dist/core/client.js +18 -1
  12. package/dist/core/image.js +106 -0
  13. package/dist/core/npc.js +1 -1
  14. package/dist/core/vod.js +149 -0
  15. package/package.json +1 -1
  16. package/skill/backreel/SKILL.md +171 -0
  17. package/skill/backreel/reference/crowdfunding.md +82 -0
  18. package/skill/backreel/reference/enquiries.md +80 -0
  19. package/skill/backreel/reference/episodes.md +104 -0
  20. package/skill/backreel/reference/images.md +76 -0
  21. package/skill/npc-character/SKILL.md +111 -0
  22. package/skill/npc-character/examples/nagi.character.md +117 -0
  23. package/skill/npc-character/examples/nagi.stage.md +34 -0
  24. package/skill/npc-character/examples/yuzu.character.md +110 -0
  25. package/skill/npc-character/examples/yuzu.stage.md +30 -0
  26. package/skill/npc-character/reference/character-craft.md +153 -0
  27. package/skill/npc-character/reference/document-format.md +151 -0
  28. package/skill/npc-character/reference/interview.md +44 -0
  29. package/skill/npc-character/reference/life.md +92 -0
  30. package/skill/npc-character/reference/runtime.md +95 -0
  31. package/skill/npc-character/reference/stage-craft.md +109 -0
  32. package/skill/npc-character/reference/visual-kit.md +81 -0
  33. package/skill/npc-character/reference/voice.md +101 -0
  34. package/skill/wji/SKILL.md +1 -1
  35. package/skill/wji/reference/commands.md +25 -5
@@ -0,0 +1,81 @@
1
+ # The visual kit — formats per slot
2
+
3
+ The NPC City configure page has one AI-image slot per asset, each with a fixed
4
+ format and layout. Generate to **these** formats (they mirror the web app's
5
+ `build-image-prompts.ts`), or the assets look wrong next to the ones the
6
+ creator makes on the web and the live keyframes get worse references.
7
+
8
+ | Slot (web label) | Soul field | Ratio | Layout |
9
+ | --- | --- | --- | --- |
10
+ | Headshot | `assets.headshotAssetId` / `headshot` (+ profile `image`) | **1:1** | shoulders up, face clearly visible, clean background |
11
+ | **Character Sheet** | `assets.fullBodyAssetId` / `fullBody` | **16:9** | left third: large headshot · right two-thirds: **front, back, side** full-body views in one outfit · neutral studio background |
12
+ | Outfit | `assets.outfits[]` | **3:4** | **OOTD flat lay**: top-down, garments only (not worn), whole ensemble with shoes and accessories |
13
+ | Prop | `assets.props[]` | 1:1 | product-style, materials and scale readable |
14
+ | Scene | `assets.scenes[]` | **16:9** | environment / backdrop, no people |
15
+ | Profile / hero | profile `heroImage` | 16:9 (9:16 mobile) | character in her world, explicit camera (shot, lens, angle, depth of field) |
16
+
17
+ Every prompt carries the style line for the NPC's `visualStyle`; for
18
+ photoreal it is: *photorealistic real person (真人), live-action photography —
19
+ not anime, not illustration, not 3D render*.
20
+
21
+ ## Order and references
22
+
23
+ 1. **Headshot first** — every other image of her references it. If a good
24
+ portrait comes out in the wrong ratio, crop it to 1:1 rather than
25
+ regenerating (same face, no credits): `sips --cropToHeightWidth 1440 1440
26
+ --cropOffset 120 0 in.jpg --out out.jpg`.
27
+ 2. **Character Sheet** with the headshot as image 1. The live model treats it
28
+ as "full-body / outfit sheet — match the proportions", so the outfit on the
29
+ sheet is her default look.
30
+ 3. **Outfits**: generate (or photograph) the outfit, then make the flat lay
31
+ from it ("Transform the clothing from the reference image into an OOTD
32
+ flat lay…"). A stage can attach up to 6 outfits / props.
33
+ 4. **Scenes** at 16:9 even for 9:16 stages — the scene is a reference image,
34
+ the stage's frame preset decides the shot. A stage copies its scene when it
35
+ is created: after replacing a scene image, re-import (or recreate) a draft
36
+ stage so it uses the new one.
37
+ 5. Props and hero last.
38
+
39
+ ## Prompt templates (photoreal)
40
+
41
+ ```text
42
+ Character reference sheet, 16:9 horizontal com card / model sheet layout, <style line>.
43
+ Left third: one large portrait headshot — face, hair, and expression clearly visible, matching the reference headshot (image 1).
44
+ Right two-thirds: three full-body standing views in a row — front view, back view, side profile — same outfit, proportions, and appearance across all panels.
45
+ Clean neutral studio background, evenly spaced figures, professional reference sheet layout.
46
+ Character: <who, age-feel, build, hair>. Signature look: <outfit, shoes, accessories>. No text labels, no logos.
47
+ ```
48
+
49
+ ```text
50
+ Transform the clothing from the reference image (image 1) into an OOTD flat lay outfit photo, <style line>.
51
+ Top-down bird's-eye view of the complete ensemble neatly arranged on a clean neutral surface — shirt/top, pants/skirt, outerwear, shoes, and accessories laid out as a coordinated outfit-of-the-day flat lay.
52
+ Garments only, not worn by a model; clear fabric texture, silhouette, and styling visible from above.
53
+ The outfit: <pieces>. No text, no logos.
54
+ ```
55
+
56
+ ```text
57
+ Environment / scene background, <style line>. Atmospheric composition suitable as a character backdrop. <place, time, light, 3–5 concrete objects that the stage will mention>. No people, no readable signs, no logos.
58
+ ```
59
+
60
+ ```bash
61
+ wji gen image -m gpt-image-2.5-flare-fal -r 16:9 --ref <headshotAssetId> \
62
+ --set resolution=1080p quality=high --wait --json -p @sheet-prompt.txt
63
+ ```
64
+
65
+ About 14 credits per image at 1080p / high — **confirm with the creator
66
+ before generating**, and look at every result before attaching it (faces
67
+ drift; reject and regenerate rather than attach a different face).
68
+
69
+ ## Attaching
70
+
71
+ ```bash
72
+ wji npc soul get <npc> > soul.json # edit assets, keep album/albums out
73
+ wji npc soul set <npc> @assets.json # {"assets": {...}} — replaces the whole assets object
74
+ wji npc set <npc> --image <headshotAssetId> --hero-image <heroAssetId> --set 'gallery=["url1","url2"]'
75
+ ```
76
+
77
+ `assets` is replaced as a whole by `soul set`, so always start from the
78
+ current one. Outfit / prop / scene entries are
79
+ `{id, assetId, name, url, description, referenceRole: outfit|prop|location}`;
80
+ names and descriptions are shown to the creator and scene descriptions go into
81
+ keyframe prompts.
@@ -0,0 +1,101 @@
1
+ # Voice: speaking tone and on-camera action
2
+
3
+ ## Speaking tone (`live.speakingTone`, 500 chars, her language)
4
+
5
+ The reply model is told to "match this closely", and it copies what you
6
+ **show** far better than what you describe. A good speaking tone has:
7
+
8
+ 1. **Register in one line** — "Cantonese with English slips, short sentences,
9
+ like talking across a shop counter."
10
+ 2. **One catchphrase** she really uses, in quotes.
11
+ 3. **One thing she never says**, and why ("never says 加油 — too lazy").
12
+ 4. **How she takes a compliment / a tease** — with the line she'd say.
13
+ 5. **Two or three sample lines**, each short enough to be one live reply:
14
+ ≤40 words in English / Indonesian, **≤60 characters** in Japanese, Korean,
15
+ Chinese, Cantonese, Thai, Vietnamese.
16
+
17
+ Before: "She is witty and warm, speaks casually and likes to tease people."
18
+ After: "Cantonese with a few English words, short lines, like at the shop
19
+ counter. Catchphrase「糖水都要趁熱食啦」. Takes compliments by deflecting:
20
+ 「得啦得啦,你想我送多碗咩」. Never says「加油」. e.g.「你今晚食咗咩?唔好話我知係杯麵。」"
21
+
22
+ `speechPattern` (formal / casual / poetic / robotic / archaic) is the coarse
23
+ register **and** her body language on video (formal "composed and poised",
24
+ casual "relaxed", poetic "dreamy and soft", robotic "precise and minimal",
25
+ archaic "graceful and ceremonious"). When the two pull apart — a polite
26
+ speaker who slouches — choose for the body, and let the speaking tone carry
27
+ the politeness.
28
+
29
+ ## Code-switching
30
+
31
+ If she mixes languages, write the rule *and* show it:
32
+
33
+ - **Hong Kong**: Cantonese grammar and particles (啦、喎、咩、囉) with English
34
+ nouns and fillers ("OK", "chill", "send 我"). Write in written Cantonese
35
+ (嘅、咗、唔、佢), not standard written Chinese, or she will sound like a
36
+ newsreader. Set `languages=HK`.
37
+ - **Taiwan**: Mandarin with Taiwanese particles (欸、啦、齁) and occasional
38
+ Taiwanese Hokkien / Japanese loanwords; traditional characters. `languages=TW`.
39
+ - **Japanese**: decide politeness (です/ます vs plain), first-person pronoun
40
+ (私、あたし、僕、俺, or her own name), and any sentence-final habit.
41
+ `languages=JP`.
42
+ - **English**: dialect and rhythm matter more than slang — "British, dry,
43
+ understated" vs "SoCal, fast, lots of 'like'". Avoid dated slang lists.
44
+
45
+ The first `languages` entry is what she speaks live; add a second only if
46
+ she really answers in it.
47
+
48
+ ## Lines that work live
49
+
50
+ A live reply is one or two sentences, spoken in under 12 seconds, reacting
51
+ to one viewer. So sample lines should:
52
+
53
+ - react to the person (use what they said; address them the way she
54
+ would — "you", a nickname habit, "ラジオネーム…さん"), then
55
+ - add one beat of her (an opinion, a callback, a question back).
56
+
57
+ Bad: long monologues, lists, lines that need context the viewer doesn't
58
+ have, emoji and stage directions inside the line. Don't invent viewer names
59
+ inside sample lines — the model will greet strangers by them; the runtime
60
+ supplies the real viewer's name when it wants her to use it.
61
+
62
+ ## Human protocol vs speaking tone
63
+
64
+ - Speaking tone = **how** she sounds.
65
+ - Human protocol = **what she does** with people: regulars vs newcomers,
66
+ compliments, trolls, sadness, silence, personal questions, a boundary.
67
+
68
+ Don't repeat one in the other.
69
+
70
+ ## On-camera action (`live.action`, 300 chars, ENGLISH)
71
+
72
+ 2–3 physical habits tied to emotion, performed by a video model on a locked
73
+ camera:
74
+
75
+ - visible, upper body only: hands, face, head, shoulders, objects already in
76
+ frame
77
+ - repeatable — they will recur in many clips
78
+ - tied to a feeling: "laughs with her eyes shut", "rests her chin on the
79
+ guitar when listening", "taps the table twice when excited"
80
+
81
+ Never: walking, standing up, turning away, leaving frame, camera moves, new
82
+ props, other people. Never write it in the character's language — it is a
83
+ video prompt.
84
+
85
+ ## Making the voice sample
86
+
87
+ The voice sample is uploaded or set on the soul (`voiceSample`). The cheap way
88
+ to make one is **Seed Audio 1.0** with the headshot as the voice reference —
89
+ about 45 credits a minute, so a 3-second sample costs a few credits (MiniMax
90
+ speech is a flat ~300 per line). Write a bracketed direction in her language,
91
+ then one new 8–12-character line; the bracket is followed, not spoken.
92
+ **Confirm with the creator before generating.**
93
+
94
+ ```bash
95
+ wji gen audio -m "Seed Audio 1.0" --ref <headshotAssetId> -n 2 --wait --json \
96
+ -p "(27세 여성; 전직 연습생; 맑지만 살짝 허스키한 음색; 중간 음높이; 약간 빠르고 숨이 찬 말투; 표준 서울말; 지쳤지만 단단한 감정; 건조한 목소리, 배경음악과 효과음 없음)오늘은 한 번만 더 해 볼게요"
97
+ wji npc soul set <npc> '{"voiceSample":{"assetId":"<audioAssetId>","url":"<url>","label":"…","durationSec":3.2}}'
98
+ ```
99
+
100
+ Listen to both takes and keep the one that sounds like her speaking tone.
101
+
@@ -473,7 +473,7 @@ wji npc set @mika --tagline "…" --tag tier=Rising --social ig=https://…
473
473
  wji npc publish @mika # visibility public (unpublish = private)
474
474
  wji npc job add @mika -t concert --title "Neon Night" --date 2026-10-01 --location Taipei
475
475
  wji npc job set @mika 2 --detail "sold out" ; wji npc job rm @mika 3 -y
476
- wji npc soul get @mika > soul.json ; wji npc soul set @mika '{"voice":{…}}'
476
+ wji npc soul get @mika > soul.json ; wji npc soul set @mika '{"liveSpeakingTone":"…"}' # keys must be soul keys — unknown ones are stored silently
477
477
  wji npc doc export @mika -o mika.md # whole character in one file
478
478
  wji npc doc apply @mika @mika.md --dry-run # see the diff, then without --dry-run
479
479
  ```
@@ -256,17 +256,29 @@ unknown `@handle` falls back to `GET /npc-city/residents/by-handle/:h` (public).
256
256
  | `npc rm <npc> [-y]` | `DELETE /npc-city/residents/:id` (soft delete) |
257
257
  | `npc handle <handle> [--exclude <npc>]` | `GET /npc-city/residents/handle-available` |
258
258
  | `npc job list <npc>` | the resident's `jobs[]`, numbered 1…n |
259
- | `npc job add <npc> -t <type> --title --date YYYY-MM-DD [--detail] [--location] [--url]` | read, append, `PATCH {jobs}` |
259
+ | `npc job add <npc> -t <type> --title --date YYYY-MM-DD [--about] [--location] [--url]` | read, append, `PATCH {jobs}` |
260
260
  | `npc job set <npc> <n> [same flags]` | read, merge into #n, `PATCH {jobs}` |
261
261
  | `npc job rm <npc> <n...> [-y]` | read, drop, `PATCH {jobs}`; refuses if the list changed meanwhile |
262
262
  | `npc soul get <npc>` | `GET /npc-city/residents/:id/soul` |
263
263
  | `npc soul set <npc> <json\|@file\|->` | `PATCH /npc-city/residents/:id/soul {soulConfig}` (shallow merge) |
264
264
  | `npc doc export <npc> [--format md\|json] [-o file]` | `GET /npc-city/residents/:id/document?format=` |
265
- | `npc doc apply <npc> <@file\|-> [--dry-run] [-y]` | `POST …/document/preview`, confirm, `POST …/document` |
265
+ | `npc doc apply <npc> <@file\|-> [--dry-run] [--sync-memories] [-y]` | `POST …/document/preview`, confirm, `POST …/document`. The document route reports memory changes but never saves them; `--sync-memories` replaces the memory table with the document's `## Memories` |
266
+ | `npc memory list\|add\|set\|rm <npc>` | `GET/POST /npc-city/residents/:id/memories`, `PATCH/DELETE /npc-city/memories/:id` (title ≤200, date ≤40, weight 1–5, type formative\|trauma\|joy\|connection\|revelation). `list` marks the top 3 by weight (then newest) — the only ones the live reply prompt reads, content clipped to 140 |
267
+ | `npc album list <npc> [album]` · `create <npc> --name [-d] [--photo …]` · `add <npc> <album> <photo…>` · `set <npc> <album> [--name] [-d] [--cover n] [--label n=text…]` · `rm-photo <npc> <album> <n…>` · `rm <npc> <album>` | `GET/POST /npc-city/residents/:id/albums`, `PATCH/DELETE …/albums/:albumId` (label ≤120, description ≤500; photos `{id, assetId, url, label}`, the CLI mints ids and resolves asset ids / uploads files to URLs; `<album>` = number or id) |
268
+ | `npc readiness <npc>` | `GET /npc-city/live/residents/:id/readiness` — soul integrity, gate reasons (selfDescription / humanProtocol >10 chars, a trait, headshot, a scene), scenes, voice sample, stages |
269
+ | `npc stage list <npc>` | `GET /npc-city/live/residents/:id/stages` |
270
+ | `npc stage export <stageId> [--format md\|json] [-o]` | `GET /npc-city/live/stages/:id/document` |
271
+ | `npc stage apply <stageId> <@file\|-> [--dry-run] [-y]` | `POST …/document/preview`, confirm, `POST …/document` (text only; baked fields warn) |
272
+ | `npc stage import <npc> <@file\|-> [-y]` | `POST /npc-city/live/residents/:id/stages/import` — a Draft stage, nothing rendered, no credits |
273
+ | `npc stage set <stageId> [--debug on\|off] [--on on\|off] [--label]` | `PATCH /npc-city/live/stages/:id {debugMode, enabled, label}` — `--on` needs a Ready stage; debug on an on-air stage asks first |
274
+ | `npc stage rm <stageId> [-y]` | `DELETE /npc-city/live/stages/:id` |
266
275
  | `npc transfer send <npc> --to <email\|userId> [-y]` | `POST /npc-city/residents/:id/transfer` |
267
276
  | `npc transfer list` | `GET /npc-city/transfers/incoming` + `/outgoing` |
268
277
  | `npc transfer accept\|reject\|cancel <transferId>` | `POST /npc-city/transfers/:id/<action>` |
269
278
 
279
+ Writing the character and stages well — what each field does at runtime —
280
+ is the `npc-character` skill.
281
+
270
282
  Job types: concert, release, collaboration, brand, event, ad, appearance. The
271
283
  server drops jobs without a title or date and turns unknown types into `event`;
272
284
  the CLI rejects both up front.
@@ -277,11 +289,17 @@ the CLI rejects both up front.
277
289
  | --- | --- |
278
290
  | `backreel list [--all] [-k] [--page] [--limit]` | `GET /backreel/post/search/my` (`--all`: `GET /backreel/post/search`) |
279
291
  | `backreel get <postId>` | `GET /backreel/post/list/:id` |
280
- | `backreel create <title> [--kind showcase\|crowdfunding] [--logline] [--category] [--project-status] [--tags a,b] [-d text\|@file] [--cover assetId] [--cover-portrait] [--trailer] [--body json]` | `POST /backreel/post/create` (always a draft) |
292
+ | `backreel create <title> [--kind showcase\|crowdfunding] [--logline] [--media assetId...] [--category] [--project-status] [--tags a,b] [-d text\|@file] [--cover assetId] [--cover-portrait] [--trailer] [--body json]` | `POST /backreel/post/create` (always a draft) |
281
293
  | `backreel set <postId> [--title] [same flags]` | `PUT /backreel/post/list/:id` with only the given fields |
282
294
  | `backreel publish\|unpublish <postId>` | `POST /backreel/post/list/:id/publish\|unpublish` (publish needs a cover, media or an episode) |
283
295
  | `backreel rm <postId> [-y]` | `DELETE /backreel/post/list/:id` |
284
296
  | `backreel creators [-k] [--role kind] [--verified] [--no-featured] [--page] [--limit ≤48]` | `GET /backreel/creator/list` — editor-picked `featured` plus a heat-ranked page (recent likes, favorites ×2); creators with no recent activity are not listed. `--role`: investor, production_company, brand, distributor, sales_agent |
297
+ | `backreel image <file...> --slot cover\|portrait\|media\|photo [--post id] [--check]` | reads the size locally, warns on ratio / resolution, `POST /assets/v2/upload` with width/height, then `PUT {cover\|coverPortrait\|assets}` (media appends, ≤9) |
298
+ | `backreel image-specs` | recommended size per slot (16:9 1920×1080, 9:16 1080×1920, 3:4 1536×2048, 1:1 800×800) |
299
+ | `backreel check <postId>` | publish blockers (title, description text/img, cover\|media\|episode, crowdfunding goal ≥1) and advice (portrait, logline, credits, VOD not ready) |
300
+ | `backreel episode list\|add\|set\|rm\|move\|tiers\|status\|play` | whole `episodes[]` read-modify-`PUT` (≤30, showcase only). A file: `POST /backreel/vod/upload-token` → signed ApplyUploadInfo / PUT / CommitUploadInfo → `POST /backreel/vod/claim` → `vodVid`; `--legacy` / `--asset` = WJI asset. `status` / `play` use `GET …/episodes/:order/play` (409 = transcoding) |
301
+ | `backreel enquiry list\|unread\|get\|reply\|status\|grant\|download` | `/backreel/enquiry/search?box=`, `unread-count`, `list/:id` + `list/:id/messages`, `POST list/:id/messages {body, attachments}` (files via `POST /backreel/file/upload?purpose=enquiry`), `POST list/:id/status`, `POST list/:id/grant`, `GET /backreel/file/:id/download` |
302
+ | `backreel fund show\|set\|tier\|supporter\|donations` | read-modify-`PUT` of `campaign` (crowdfunding only) and `donation` (any post); `donations` = `GET /backreel/donation/post/:id/manage` |
285
303
  | `backreel credit list <postId>` | the post's `credits[]`, numbered |
286
304
  | `backreel credit add <postId> --role [--name] [--kind cast\|crew\|creative] [--npc] [--user] [--link] [--job <type>]` | read, append, `PUT {credits}`; `--job` then appends to the NPC's `jobs` (own NPCs only, checked first) |
287
305
  | `backreel credit rm <postId> <n...> [-y]` | read, drop, `PUT {credits}` |
@@ -290,7 +308,9 @@ Project status: planning, pre_production, in_production, post_production,
290
308
  completed. `--logline` is a one-line hook (≤200 chars, HTML stripped, `""`
291
309
  clears it) shown large on the post page and **always public**, even when the
292
310
  description is gated. The post detail no longer carries playable URLs for VOD
293
- episodes — playback is gated per episode on the web. `-d` plain text becomes `<p>` paragraphs; HTML passes through and
311
+ episodes — playback is gated per episode on the web. Every `backreel` call
312
+ sends `X-App: backreel` so notifications and mail link to Backreel. The
313
+ `backreel` skill covers the creator workflow in depth. `-d` plain text becomes `<p>` paragraphs; HTML passes through and
294
314
  is sanitized server-side. Admin routes (`/api/backreel/*`) reject `sk_` keys.
295
315
 
296
316
  ## gen
@@ -304,7 +324,7 @@ Shared flags: `-m/--model` (required), `-p/--prompt`, `-n/--n`, `-w/--workspace`
304
324
  | --- | --- | --- |
305
325
  | `gen image` | `--ref`, `--omni`, `--style-ref`, `--reference-weight`, `--stylize`, `--model-options` | `POST /ai/assets/history/image/generations` |
306
326
  | `gen video` | `-d/--duration`, `--start-image`, `--end-image`, `--ref`, `--ref-video`, `--ref-audio` | `POST /ai/assets/history/video/generations` |
307
- | `gen audio` | `-d/--duration`, `--ref-audio` | `POST /ai/assets/history/audio/generations` |
327
+ | `gen audio` | `-d/--duration`, `--ref-audio`, `--ref` (one image, e.g. a headshot → a Seed Audio voice sample; not with `--ref-audio`) | `POST /ai/assets/history/audio/generations` |
308
328
  | `gen cost -t <type> -m <model>` | `-n`, `-p`, `-d`, `-r`, `--refs`, `--values` | `POST /ai/assets/preComputeCost` |
309
329
 
310
330
  Every generation goes through the history endpoint — there is no raw mode. The