claude-task-worker 0.86.0 → 0.88.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 (3) hide show
  1. package/README.md +20 -1
  2. package/dist/index.js +48 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -66,7 +66,7 @@ CLI が GitHub ラベルを検知してタスクを起動し、プラグイン
66
66
  | [Git](https://git-scm.com/) | worktree の作成・ブランチ操作 |
67
67
  | [jq](https://jqlang.org/) | プラグインスキル内での JSON 加工 |
68
68
  | [CodeGraph](https://www.npmjs.com/package/@colbymchenry/codegraph) | コード探索用インデックス。任意(未導入でも探索がテキスト検索に落ちるだけ) |
69
- | [Pencil CLI](https://docs.pencil.dev/for-developers/pencil-cli) | `.pen` デザインファイルの編集・参照。UIデザイン先行ワークフロー使用時のみ(呼び出しは `claude-task-worker pencil` 経由) |
69
+ | [Pen CLI](https://docs.pencil.dev/for-developers/pen-cli) | `.pen` デザインファイルの編集・参照。UIデザイン先行ワークフロー使用時のみ(要ログイン。呼び出しは `claude-task-worker pencil` 経由) |
70
70
  | [herdr](https://herdr.dev) | `--project` / `mode: "herdr"` 使用時のみ |
71
71
 
72
72
  CLI 本体に npm の実行時依存はない(esbuild で `dist/index.js` に単一バンドルされ、Node.js 標準モジュールのみで動作する)。
@@ -89,6 +89,25 @@ claude plugin install claude-task-worker@claude-task-worker
89
89
 
90
90
  herdr が必要な場合は `curl -fsSL https://herdr.dev/install.sh | sh` または `brew install herdr`([ドキュメント](https://herdr.dev/docs/install/))。
91
91
 
92
+ ### Pen CLI のログイン
93
+
94
+ `.pen` を扱うスキル(`edit-pencil-design` / `inspect-pencil-node` / `resolve-pencil-conflict`)は Pen CLI の認証を必要とする。未ログインだと `.pen` の読み書きが失敗するため、UIデザイン先行ワークフローを使うなら**インストール後に一度ログインしておく**(`.pen` を触らないので `claude-task-worker pencil` ラッパー経由でなくてよい)。
95
+
96
+ ```bash
97
+ pencil login # メールアドレス + パスワード、またはメールアドレス + OTP コード
98
+ pencil status # 認証状態の確認
99
+ ```
100
+
101
+ セッショントークンは `~/.pencil/session-cli.json` に保存され、以降のコマンドで再利用される。
102
+
103
+ CI やワーカーを実行するマシンなど対話ログインできない環境では、環境変数 `PEN_CLI_KEY`(pen.dev の組織設定 > Developer Keys で発行)を使う。保存済みトークンより優先される。
104
+
105
+ ```bash
106
+ export PEN_CLI_KEY=pencil_cli_...
107
+ ```
108
+
109
+ 詳細は [Pen CLI のドキュメント](https://docs.pencil.dev/for-developers/pen-cli)を参照。
110
+
92
111
  ### 更新
93
112
 
94
113
  ```bash
package/dist/index.js CHANGED
@@ -4231,11 +4231,22 @@ async function installPenCli(logPrefix) {
4231
4231
  try {
4232
4232
  await runCommand2("npm", ["install", "-g", `${PEN_PACKAGE}@latest`]);
4233
4233
  console.log(`[${logPrefix}] Pen CLI installed.`);
4234
- return true;
4235
4234
  } catch (err) {
4236
4235
  console.error(`[${logPrefix}] Failed to install Pen CLI: ${err.message}`);
4237
4236
  return false;
4238
4237
  }
4238
+ await warnIfPenLoggedOut(logPrefix);
4239
+ return true;
4240
+ }
4241
+ async function warnIfPenLoggedOut(logPrefix) {
4242
+ const { runCommand: runCommand2 } = await loadRunCommand3();
4243
+ try {
4244
+ await runCommand2("pencil", ["status"]);
4245
+ } catch {
4246
+ console.log(
4247
+ `[${logPrefix}] Pen CLI is not authenticated. Run \`pencil login\` (or set PEN_CLI_KEY) before using .pen designs.`
4248
+ );
4249
+ }
4239
4250
  }
4240
4251
 
4241
4252
  // src/commands/install.ts
@@ -4523,12 +4534,43 @@ async function update() {
4523
4534
  import { readFileSync as readFileSync5 } from "node:fs";
4524
4535
  import { dirname as dirname3, join as join8 } from "node:path";
4525
4536
  import { fileURLToPath } from "node:url";
4526
- function version() {
4537
+ import { styleText } from "node:util";
4538
+ var REGISTRY_URL = "https://registry.npmjs.org/claude-task-worker/latest";
4539
+ var FETCH_TIMEOUT_MS = 3e3;
4540
+ function localVersion() {
4527
4541
  const here = dirname3(fileURLToPath(import.meta.url));
4528
4542
  const pkgPath = join8(here, "..", "package.json");
4543
+ const pkg = JSON.parse(readFileSync5(pkgPath, "utf8"));
4544
+ return pkg.version ?? "unknown";
4545
+ }
4546
+ function isOutdated(current, latest) {
4547
+ const parse = (v) => v.split("-")[0].split(".").map(Number);
4548
+ const a = parse(current);
4549
+ const b = parse(latest);
4550
+ for (let i = 0; i < 3; i++) {
4551
+ const x = a[i] ?? 0;
4552
+ const y = b[i] ?? 0;
4553
+ if (!Number.isFinite(x) || !Number.isFinite(y)) return false;
4554
+ if (x !== y) return y > x;
4555
+ }
4556
+ return false;
4557
+ }
4558
+ async function notifyIfOutdated() {
4559
+ try {
4560
+ const current = localVersion();
4561
+ const res = await fetch(REGISTRY_URL, { signal: AbortSignal.timeout(FETCH_TIMEOUT_MS) });
4562
+ if (!res.ok) return;
4563
+ const { version: latest } = await res.json();
4564
+ if (!latest || !isOutdated(current, latest)) return;
4565
+ console.log(
4566
+ styleText("yellow", "[update] A new version of claude-task-worker is available: ") + styleText("dim", current) + styleText("yellow", " -> ") + styleText(["green", "bold"], latest) + styleText("yellow", ". Run ") + styleText("cyan", '"claude-task-worker update"') + styleText("yellow", " to update.")
4567
+ );
4568
+ } catch {
4569
+ }
4570
+ }
4571
+ function version() {
4529
4572
  try {
4530
- const pkg = JSON.parse(readFileSync5(pkgPath, "utf8"));
4531
- console.log(pkg.version ?? "unknown");
4573
+ console.log(localVersion());
4532
4574
  } catch (err) {
4533
4575
  console.error(`[version] Failed to read version: ${err.message}`);
4534
4576
  process.exitCode = 1;
@@ -4672,8 +4714,10 @@ Example:
4672
4714
  var workerType = process.argv[2];
4673
4715
  if (workerType === "version" || workerType === "--version" || workerType === "-v") {
4674
4716
  version();
4717
+ await notifyIfOutdated();
4675
4718
  process.exit(process.exitCode ?? 0);
4676
4719
  }
4720
+ void notifyIfOutdated();
4677
4721
  if (!workerType) {
4678
4722
  printUsage();
4679
4723
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-task-worker",
3
- "version": "0.86.0",
3
+ "version": "0.88.0",
4
4
  "description": "CLI tool that polls GitHub Issues/PRs and delegates work to Claude CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",