@wport/cli 0.7.1 → 0.9.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/CHANGELOG.md CHANGED
@@ -5,6 +5,50 @@
5
5
 
6
6
  ---
7
7
 
8
+ ## [0.9.0] — 2026-08-10
9
+
10
+ ### Added
11
+
12
+ - **個人線(pm_47)· `wport personal apply` 投遞**(對接 talent `/api/v1/personal/applications`):
13
+ - 單筆:`personal apply <job_enc_id> --resume <enc_id> --message <text> | --message-file <path|-> --confirm`
14
+ ——message 互斥二擇一必填、trim 後 1~2000 字**本地先驗**(超長/空 exit 2 不發請求)、`-` 讀 stdin;
15
+ 投遞對雇主可見,無 `--confirm` 一律 exit 2 不發請求;自動附 `Idempotency-Key`。
16
+ - 批次:`personal apply --file <batch.json> --confirm`——`{"applications":[…]}` ≤20 筆與逐筆 message
17
+ 本地先驗(超限 exit 2);輸出 succeeded/failed 表,`--output json` 給完整陣列。
18
+ - **錯誤分流**:冷卻 409(印 `next_apply_at`)、職缺終態 409、日上限 429(印剩餘額度 / `resets_at`)
19
+ → 統一 exit 3 + 人類可讀;其餘 4xx 沿既有 exit code 契約。
20
+ - codegen:凍結 `docs/handoff/swagger-wport-personal-api-v1.{json,yaml}` 納入 applications 端點,
21
+ `PERSONAL_APPLICATIONS_BASE` 常數;`gen:openapi:personal` 經 `--keep-prefix` 自動含 applications。
22
+
23
+ ## [0.8.0] — 2026-07-30
24
+
25
+ ### Added
26
+
27
+ - **個人線(pm_47)· OAuth 認證基座**:`wport login`(RFC 8628 device flow,自動開瀏覽器、
28
+ `--no-browser`/`--force`)、`whoami`、`logout`(RFC 7009 revoke)、
29
+ `sessions list / revoke <enc_id> [--all-others]`(session 治理、失竊自救)。
30
+ access token 過期自動 refresh(rotation),使用者無感;token 全程不落 log、不 echo。
31
+ - **`wport personal resumes` 全套**(GUI parity,US-1 北極星):
32
+ - 本地三件套(離線可用):`schema [--section]`(聚合格式 JSON Schema 自描述)、
33
+ `template`(骨架 full.json)、`validate --file`(unknown-field reject + 欄位級錯誤清單)
34
+ - API 面:`list`(含 quota)、`view`(聚合全節)、`create --file`(聚合編排:建殼 → rename →
35
+ 逐節寫入、partial success 不回滾)、`update <enc_id> --file [--section]`(item 帶 `enc_id`
36
+ 走更新、頂層 `name` 走改名)、`copy`、`publish`/`unpublish`、`delete --confirm`、`export`
37
+ - **credentials.json 升級 v2 雙區**:enterprise(`wpk_live_`)與 personal(OAuth)並存,
38
+ 舊格式自動遷移、零使用者動作。
39
+ - `doctor` 增列個人線登入態與 OAuth AS 連通性探測。
40
+
41
+ ### Notes
42
+
43
+ - 個人線需後端 personal API(W101-TalentSearchHub PR #139)——**已部署 prod / staging**,
44
+ 本版即為全功能可用。
45
+ - `update` 陣列節語義:item 帶 `enc_id`(來自 `view` 的 round-trip)→ 更新該筆;無 `enc_id`
46
+ → 一律新增。**不做宣告式刪除**——不在輸入檔內的既有 item 不會被刪(`portfolio_links`
47
+ 例外,該端點本身為宣告式 bulk upsert,不在陣列中的連結會被刪)。部分失敗重試前請先
48
+ `view` 取得已寫入 item 的 `enc_id`,避免重複新增。
49
+
50
+ ---
51
+
8
52
  ## [0.7.1] — 2026-07-23
9
53
 
10
54
  ### Changed
package/README.md CHANGED
@@ -105,6 +105,53 @@ mode 600 (owner-only) on macOS/Linux. **On Windows, file permissions are best-ef
105
105
  prefer the `WPORT_API_KEY` env var if you need stricter isolation.** The CLI never prints
106
106
  more than the last 4 characters of a key.
107
107
 
108
+ ## Personal commands
109
+
110
+ Manage your own candidate profile data as a job seeker. Sign in once with OAuth
111
+ (browser-based device flow — no passwords, no API keys); tokens refresh silently and
112
+ can be revoked anytime from any logged-in machine.
113
+
114
+ ```bash
115
+ # One-time: opens your browser to authorize this machine (SSH? add --no-browser)
116
+ wport login
117
+
118
+ # Who am I / which devices are signed in / kick a stolen laptop
119
+ wport whoami
120
+ wport sessions list
121
+ wport sessions revoke --all-others
122
+
123
+ # Resume workflow, agent-first (US-1): schema → fill → validate → create
124
+ wport personal resumes schema > schema.json # machine-readable field docs (offline)
125
+ wport personal resumes template --out full.json # skeleton with example values (offline)
126
+ wport personal resumes validate --file full.json # local check, no API quota spent (offline)
127
+ wport personal resumes create --file full.json --output json # per-section success report
128
+
129
+ # Read / edit round-trip: view emits enc_id per item; items WITH enc_id get updated,
130
+ # items WITHOUT enc_id get appended. Existing items are never deleted implicitly
131
+ # (exception: portfolio_links is a declarative bulk upsert).
132
+ wport personal resumes view <enc_id> --output json > mine.json
133
+ wport personal resumes update <enc_id> --file mine.json
134
+
135
+ # Housekeeping
136
+ wport personal resumes list # includes quota (max 6)
137
+ wport personal resumes copy <enc_id> --name "英文版"
138
+ wport personal resumes publish <enc_id> # searchable by companies (reversible)
139
+ wport personal resumes delete <enc_id> --confirm
140
+ wport personal resumes export --out ./backup
141
+
142
+ # Apply to jobs (visible to the employer; requires --confirm; 20/day)
143
+ wport personal apply <job_enc_id> --resume <enc_id> --message "自我介紹…" --confirm
144
+ wport personal apply <job_enc_id> --resume <enc_id> --message-file intro.txt --confirm # or - for stdin
145
+ wport personal apply --file batch.json --confirm # { "applications": [...] }, max 20, partial success
146
+
147
+ # Sign out (revokes the refresh token server-side, clears local credentials)
148
+ wport logout
149
+ ```
150
+
151
+ Personal OAuth tokens live in the same `credentials.json` as the enterprise key
152
+ (separate sections, mode 600); the two lines never interfere. Personal auth is
153
+ OAuth-only by design — there is no personal API key and no `--token` flag.
154
+
108
155
  ## Example output
109
156
 
110
157
  Default `table` output in a TTY (`wport jobs search --keyword backend`):
@@ -287,3 +334,17 @@ This CLI tracks the `api.wport.me` public job endpoints (`GET /api/jobs/search`,
287
334
  **Post-1.0 (1.x.y and beyond) — firm semver**: The `1.0.0` release will commit to standard semver. Any breaking server-side change that affects the CLI surface will be released as a CLI **major** bump (`2.0.0`, `3.0.0`, ...). Additive changes (new flags, new fields) → minor; bug fixes → patch.
288
335
 
289
336
  Until `1.0.0` ships, treat this CLI as an early-access tool. Open an issue or contact the maintainer before building production automation on top of it.
337
+
338
+ ## 審查流程(開發端審查 + CI Review Gate)
339
+
340
+ 審查在**開發端本地跑**(本機 Claude,不需任何 CI token/secret):
341
+
342
+ 1. 分支開發完成後跑 `review-pipeline` skill(review → fix → verify 一條龍),
343
+ 依 `.claude/skills/code-review-assistant/references/` 的 checklist 審查,
344
+ 產出結構化報告到 `docs/code-review/`(frontmatter 含 `reviewed_head`)。
345
+ 2. findings 修到 `critical: 0` 且 `major: 0`(或 review-verifier 驗到 `status: all_fixed`)。
346
+ 3. **報告 commit 進分支**再 push、開 PR。
347
+
348
+ CI 端 `.github/workflows/review-gate.yml`(純 shell、零 secret)守門:
349
+ 報告存在、`reviewed_head` 之後只動過文件類檔案(否則判過期要求重審)、findings 達標才綠。
350
+ docs-only PR 免報告直接放行。`security` label 僅作人工提醒標記,不改變 gate 行為。