fix(deploy): 修正 domain 前綴歧義與 kiro-cli 探測

What: deploy.sh 收到帶 jsc- 前綴的 domain 名時自動去掉前綴再組 jsc-{domain}@jsc;deploy_kiro 先探測這個版本的 kiro-cli 認不認得 plugin 子指令,不認得就整批直接走本地複製退路。
Why: marketplace.json 的 plugins[].name 本身就帶 jsc- 前綴,SKILL.md 只寫「domain 名單來自 marketplace」沒講清楚要不要去前綴,實際執行時餵進去兜成 jsc-jsc-ask@jsc 雙重前綴,claude、copilot、antigravity、kiro 四支 CLI 的更新全部第一輪失敗。另外 kiro-cli 2.18.1 這個版本已經完全沒有 plugin 子指令,逐一嘗試再退回複製會先洗出一長串看似失敗、實則設計內的錯誤訊息。
How: 腳本層正規化 domain 參數(去前綴),比只改文件更可靠——不管呼叫端傳哪種格式都對。kiro 的探測用 kiro-cli --help-all 抓子指令清單,一次性判斷,不逐一撞錯誤才退回;探測本身不算部署動作,不印 cmd/exit。SKILL.md 同步補上前綴說明。
Who: jsc-cli:deploy 的執行正確性與輸出可讀性。
This commit is contained in:
2026-08-26 11:30:18 +08:00
parent 9067c643b2
commit 49cd4d3ee4
5 changed files with 55 additions and 20 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ description: Batch install, update, or uninstall the whole jsc skill set on ever
3. Ask the user for the mode per the `jsc-ask:ask` rules: `install` / `update` / `uninstall`. Every option states its impact scope: which CLIs it touches and which configs it writes. Done when the user has named exactly one of `install`, `update` or `uninstall`.
4. Get the domain list (**never hardcode it**; this skill follows automatically when domains are added or removed): read `plugins[].name` from the unified marketplace via
`jsc-gitea/tools/gitea.sh api GET /repos/plugins/meta/raw/.claude-plugin/marketplace.json`.
The marketplace is unified as `jsc`; the install token is `jsc-{domain}@jsc`. Done when the domain list comes from that response and holds at least one name.
The marketplace is unified as `jsc`; the install token is `jsc-{domain}@jsc`. Each `plugins[].name` already carries the `jsc-` prefix (e.g. `jsc-ask`) — pass it to `tools/deploy.sh` as-is, prefixed or not; the script normalizes it. Done when the domain list comes from that response and holds at least one name.
5. Run `tools/deploy.sh {mode} {cli} {domain}...` once per detected CLI, passing the whole domain list in one call so the marketplace command runs only once. This step **MUST run as a sub agent** (one sub agent per CLI). The script prints `cmd` and `exit` lines for every command, then one `result` line; `-n` prints the commands without running them. Antigravity cannot install from a Gitea URL, so the script clones each domain into the local plugin directory (`JSC_LOCAL_PLUGINS`, default `$JSC_HOME/plugins`) and installs from that path — keep that clone, because update pulls the same one. That default deliberately avoids a development checkout: when the directory holds uncommitted changes or unpushed commits, the script prints a `skip` line, leaves the tree untouched, and installs the on-disk content. Done when every detected CLI has reported an exit status for every command it ran.
6. After install or update, call `jsc-hooks:hooks-install` to rewire the hooks. Done when hooks-install reports a wiring result for each detected CLI.
7. Report the result and any failure reason for every CLI × mode, plus every `skip` line and every CLI that could not be version-checked in step 2. Done when every detected CLI appears in the report with its `result` status.