@easysociable/cli 0.1.10 → 0.1.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easysociable/cli",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Agent-first CLI for EasySociable: Content Engine, Template, Slideshow, and MCP",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -11,7 +11,7 @@ description: >
11
11
  Triggers: 推荐产品, 评测工具, compare tools, review an AI product
12
12
  — edit `recommendations/`; do not treat third-party subjects as owned Products.
13
13
  Triggers: 做成选题, 开一单, 出图
14
- — follow engine CLAUDE.md (§ Topics / § Open a run / § PagePack).
14
+ — follow engine CLAUDE.md (§ Topics / § Open a run / § PagePack: Page Contracts → Media → Template Selection before templates).
15
15
  If no engine exists, copy/clone the Content Engine core (see Create below;
16
16
  `easysociable engine init` is optional offline scaffold). Then follow
17
17
  Content Engine/CLAUDE.md. Render handoff: easysociable-template (1 page) or
@@ -131,9 +131,9 @@ CLI republishes.
131
131
  | 扫需求选题 | **NEEDS.md** then Topics from `needs/` `status=captured` — **ask `generation_mode` first** |
132
132
  | 做成选题 / 生成 topic | engine **§ Topics** — explicit input; **ask `generation_mode` before write** |
133
133
  | 开一单 / 用 T-… 开一单 | engine **§ Open a run** (ask platform; multi → N runs) |
134
- | 1 page image | **easysociable-template** (after hard gate) |
135
- | 2+ pages on tiktok / instagram / linkedin / threads | **easysociable-slideshow** (after hard gate) |
136
- | x / xiaohongshu images | **easysociable-template** only (after hard gate) |
134
+ | 1 page / `media_mode=single_visual` | **easysociable-template** (after hard gate) |
135
+ | 2+ pages / `media_mode=multi_page_pack` (any platform, incl. X + `pack_hook`) | **easysociable-slideshow** (after hard gate + **ADR-0036 identity chain**: Studio login → API key → `easysociable auth login` → create) |
136
+ | X / xiaohongshu text-only | No render skill — ship copy from the Run |
137
137
 
138
138
  ## Render hard gate
139
139
 
@@ -145,7 +145,7 @@ On fail: **stay in this skill**. List missing files. Do not call template or sli
145
145
  easysociable engine validate --run <run-dir> --require-pack --require-knowledge
146
146
  ```
147
147
 
148
- Slideshow packs need an **Arc** line first. Do not default Cover → Point → Steps → Recap → CTA. Page 1 is not automatically `cover`. Handoff: **easysociable-slideshow** (`references/ARC.md`).
148
+ Slideshow packs need an **Arc** line, then **Page Contracts** (no `templateId`), then Media, then Template Selection. Do not default Cover → Point → Steps → Recap → CTA. Page 1 is cover/hook class; later pages are not. Handoff: **easysociable-slideshow** (`references/ARC.md`). Validate with `python3 scripts/validate-pack.py`.
149
149
 
150
150
  ## Research (Needs)
151
151
 
@@ -25,8 +25,10 @@ Page order is the argument of **this pack**, not a catalog recipe.
25
25
  calls go through Gateway; never call Directus, R2, Stripe or private services.
26
26
  3. Choose a Brand (or Profile/Theme) and an explicit Page Template for every
27
27
  page. The server never silently chooses or replaces a Page Template.
28
- Select by **platform + canvas + slotSummary + density**. `role` is a weak
29
- retrieval tag, not sequence position.
28
+ Prefer templates already chosen on the Content Engine pack (**Template
29
+ Selection** after **Page Contracts**). Otherwise select by **platform +
30
+ canvas + slotSummary + density + layoutFamily**. `role` / `supportedRoles`
31
+ are weak retrieval tags, not sequence position.
30
32
  4. **Cover / hook placement (hard):** a template is cover/hook class when
31
33
  `supportedRoles` includes `cover` or `hook`. `pages[0]` must use one.
32
34
  Cover/hook class templates must not appear on any later page. Later pages
@@ -55,6 +57,15 @@ Page order is the argument of **this pack**, not a catalog recipe.
55
57
  **easysociable-content** / refuse create; list missing files. Do not add
56
58
  Gateway or MCP params. User must say **强制继续** / **force continue**
57
59
  to call Gateway.
60
+ 8c. **Identity chain (ADR-0036, hard):** before create, the CLI must be
61
+ logged in with the **user's Dashboard Workspace API key** (same account
62
+ that will open Studio). Refuse fixture `workspace_local` / local
63
+ `test-key` unless the user explicitly asked for a local fixture
64
+ (`--allow-local-fixture`). Order: Studio login → create API key →
65
+ `easysociable auth login --api-key <key>` → create Run → open
66
+ `studioUrl` while logged in as that user. If Studio shows “belongs to
67
+ another account”, recreate with the current key — do not invent
68
+ cross-workspace access.
58
69
  9. Preview is free. Free Download is 3 successful ZIPs per month and one
59
70
  platform. Paid Download is unmetered.
60
71
  10. **Forbidden default:** do not assemble Cover → Point → Steps → Recap → CTA
@@ -66,12 +77,14 @@ Page order is the argument of **this pack**, not a catalog recipe.
66
77
  ## Workflow
67
78
 
68
79
  1. Write one arc line (`references/ARC.md`). Do not skip this for a five-family fill-in.
69
- 2. Validate the Pack and platform/page count.
80
+ 2. Validate Page Contracts / pack when present:
81
+ `python3 scripts/validate-pack.py runs/<slug>/pack.md` (in the Content Engine).
82
+ Refuse create if contracts are empty or contain `templateId`.
70
83
  3. Resolve or create the user's Brand through the unified CLI/MCP.
71
- 4. List the published catalog. `pages[0]` must be cover/hook class
72
- (`supportedRoles` includes `cover` or `hook`). Remaining pages: platform +
73
- canvas + slot counts + density — not `beat name == family name`. Never
74
- place a cover/hook class template after page 1.
84
+ 4. Prefer pack **Template Selection** ids. If re-listing the catalog, verify
85
+ hard filters and cover/hook placement; never place a cover/hook class
86
+ template after page 1. Record Layout Family evidence as `hypothesis` unless
87
+ comparable history supports `tested` / `supported`.
75
88
  5. List existing Runs when the Pack has a stable content slug:
76
89
 
77
90
  ```bash
@@ -14,3 +14,12 @@ GET /v1/render-jobs/{jobId}/manifest
14
14
 
15
15
  There are no V1 publish, unpublish, public-piece or Slideshow-template routes.
16
16
  All requests use the account's unified credential and owner isolation.
17
+
18
+ ## Identity (ADR-0036)
19
+
20
+ - Create and GET are **owner-scoped**. Same Workspace API key / Studio session
21
+ workspace that created the Run must open Studio.
22
+ - Authenticated GET of another workspace's Run → `403 RUN_WRONG_WORKSPACE`
23
+ (not a silent 404).
24
+ - Fixture `workspace_local` create is blocked under Directus persistence unless
25
+ `SLIDESHOW_ALLOW_FIXTURE_STUDIO=1`. See `docs/operations/studio-identity-chain.md`.
@@ -2,16 +2,24 @@
2
2
 
3
3
  1. Write one arc line (`references/ARC.md`). Forbidden default:
4
4
  Cover → Point → Steps → Recap → CTA.
5
- 2. Build `content-pack.v1` from that argument. Page count follows the beats
6
- (TikTok often 4–8), not the number of P0 families.
7
- 3. Check platform hardMin/hardMax.
8
- 4. List published Page Templates. `pages[0]` must be cover/hook class
9
- (`supportedRoles` includes `cover` or `hook`). Do not use that class on
10
- later pages. Remaining pages: platform + canvas + `slotSummary` + density.
11
- `role` is a weak tag.
12
- 5. If `contentSlug` already has a Run: update only when topology matches
5
+ 2. Prefer a Content Engine `pack.md` that already has **Page Contracts**,
6
+ **Media**, and **Template Selection** filled. If contracts are missing,
7
+ stop and hand back to **easysociable-content** — do not invent page
8
+ purposes from catalog family names.
9
+ 3. Build `content-pack.v1` from that argument. Page count follows the beats
10
+ (TikTok often 4–8), not the number of P0 families. Carry the chosen
11
+ `pageTemplateId`s from Template Selection (explicit — server must not
12
+ silent-replace).
13
+ 4. Check platform hardMin/hardMax.
14
+ 5. List published Page Templates only to **verify** hard filters still hold:
15
+ platform → canvas → slotSummary → density → page-position cover/hook.
16
+ Prefer ranking by Layout Family (`layoutFamily`) + history; `supportedRoles`
17
+ is a weak tag. `pages[0]` must be cover/hook class. Do not use that class on
18
+ later pages. Prefer families already recorded on linked W- judgments
19
+ (`fits` / `avoid` / `trial`) when comparable evidence exists.
20
+ 6. If `contentSlug` already has a Run: update only when topology matches
13
21
  (same page count and `pageTemplateId`s). Otherwise create a new Run.
14
- 6. **Before** `create_run` / `slideshows create` (every create, not only the
22
+ 7. **Before** `create_run` / `slideshows create` (every create, not only the
15
23
  first Run): check the knowledge hard gate — Identity Role / What I build /
16
24
  Point of view have no `(fill)` and are non-empty; `boundaries.md` exists
17
25
  with Not covering and Never claim non-empty; if `needs/` exists, ≥3 `N-`
@@ -20,7 +28,14 @@
20
28
  Fail → hand back to **easysociable-content** / refuse create; list missing
21
29
  files. User must say **强制继续** / **force continue** to call Gateway.
22
30
  No new Gateway or MCP params.
23
- 7. Call `create_run` / `slideshows create` through Gateway.
24
- 8. Save `runId`, `studioUrl`, and `status=draft`.
25
- 9. Do not call a Deck API, create a carousel template, or send a product
26
- `pageSequence` / `arc` field.
31
+ 7b. **Identity chain (ADR-0036):** confirm CLI auth is the user's Dashboard
32
+ Workspace API key (not `workspace_local` / `test-key`). If needed:
33
+ Studio login → Dashboard create key →
34
+ `easysociable auth login --api-key <key>`. Refuse create on fixture
35
+ identity unless the user asked for `--allow-local-fixture`.
36
+ 8. Call `create_run` / `slideshows create` through Gateway with the explicit
37
+ template ids from the pack.
38
+ 9. Save `runId`, `studioUrl`, and `status=draft`. Tell the user to open
39
+ `studioUrl` **while logged into the same Studio account**.
40
+ 10. Do not call a Deck API, create a carousel template, or send a product
41
+ `pageSequence` / `arc` field.