claude-task-worker 0.98.0 → 0.100.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/README.md +14 -4
- package/dist/index.js +81 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,8 +55,8 @@ CLI が GitHub ラベルを検知してタスクを起動し、プラグイン
|
|
|
55
55
|
|---|---|
|
|
56
56
|
| `plugin/skills/` | ワーカーが呼ぶスキル群と、対話セッション用の補助スキル(`commit-push` / `create-pr` / `breakdown-issues` / `edit-pencil-design` など) |
|
|
57
57
|
| `plugin/agents/` | サブエージェント定義(`explore-agent` / `frontend-implementer` / `general-purpose-assistant` / `lightweight-assistant` / `pencil-design-updater` / `requirement-todo-organizer`) |
|
|
58
|
-
| `plugin/hooks/` | `SessionStart`(worktree セットアップ / `git fetch --prune`)と `UserPromptSubmit`(`codegraph prompt-hook`)のフック定義 |
|
|
59
|
-
| `plugin/scripts/` | フック・スキルから呼ばれるスクリプト(`setup-worktree.sh` / `stop-servers.mjs` / `resolve-pr-comments.sh` — `resolve-pr-comments` スキルが GitHub MCP を使えない場合の `gh` フォールバック) |
|
|
58
|
+
| `plugin/hooks/` | `SessionStart`(worktree セットアップ / CodeGraph インデックス構築(クラウドのみ) / `git fetch --prune`)と `UserPromptSubmit`(`codegraph prompt-hook`)のフック定義 |
|
|
59
|
+
| `plugin/scripts/` | フック・スキルから呼ばれるスクリプト(`setup-worktree.sh` / `setup-codegraph.sh` / `stop-servers.mjs` / `resolve-pr-comments.sh` — `resolve-pr-comments` スキルが GitHub MCP を使えない場合の `gh` フォールバック) |
|
|
60
60
|
| `plugin/references/` | 複数スキルが共有する参照ドキュメント(GitHub アクセス方針など) |
|
|
61
61
|
| `plugin/.mcp.json` | MCP サーバー定義(`codegraph` / `context7` / `next-devtools` / `shadcn` / `playwright`) |
|
|
62
62
|
|
|
@@ -98,7 +98,16 @@ claude plugin install claude-task-worker@claude-task-worker
|
|
|
98
98
|
|
|
99
99
|
herdr が必要な場合は `curl -fsSL https://herdr.dev/install.sh | sh` または `brew install herdr`([ドキュメント](https://herdr.dev/docs/install/))。
|
|
100
100
|
|
|
101
|
-
クラウド実行(`--cloud` フラグ)を使う場合は、クラウド VM(Claude Code on the web)側にもプラグイン・CLI が必要になる。claude.ai の環境設定(Environment setup script /
|
|
101
|
+
クラウド実行(`--cloud` フラグ)を使う場合は、クラウド VM(Claude Code on the web)側にもプラグイン・CLI が必要になる。claude.ai の環境設定(Environment setup script / セットアップスクリプト欄)に次の2行を記載しておく。
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx claude-task-worker install
|
|
105
|
+
npx claude-task-worker cloud-setup
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`cloud-setup` は VM 側の `~/.claude/settings.json` に権限モード(`permissions.defaultMode: "auto"`)・出力スタイル(`outputStyle: "Proactive"`)・言語(`language: "Japanese"`)を書き込み、あわせてグローバル gitignore へ `.codegraph/` を登録する(CodeGraph のインデックス構築自体はプラグインの `SessionStart` フックが毎セッション行う)。クラウドセッションは起動フラグの `--permission-mode` を受理するだけで反映しないため、この設定ファイルが権限モードを指定する唯一の経路になる(設定しないと「編集を受け入れる」で動く)。書き込みはキー単位のマージで、既存の設定は消さない。
|
|
109
|
+
|
|
110
|
+
あわせて、クラウドセッションが push / PR 作成を行うには対象リポジトリの GitHub App 連携が必要。
|
|
102
111
|
|
|
103
112
|
UIデザイン先行ワークフローを使う場合は、同じ claude.ai の環境設定の環境変数欄に `PEN_CLI_KEY` も設定する。`.pen` を扱うスキル(`edit-pencil-design` / `inspect-pencil-node` / `resolve-pencil-conflict`)の Pen CLI 認証に使うもので、クラウド VM では対話ログインができないため。キーの発行元と値の形式は後述の「[Pen CLI のログイン](#pen-cli-のログイン)」を参照。
|
|
104
113
|
|
|
@@ -189,6 +198,7 @@ claude-task-worker <command> [--epic <issue-number>]... [--label <label>]... [--
|
|
|
189
198
|
| `yolo` | 全ワーカーを同時にポーリング(`all` + `triage-created-issue` + `triage-pr` + `check-dependabot`) |
|
|
190
199
|
| `init` | ラベル・テンプレート・設定ファイルの作成と CodeGraph セットアップ |
|
|
191
200
|
| `install` / `update` | 上記「セットアップ」を参照 |
|
|
201
|
+
| `cloud-setup [--force]` | クラウドセッションの VM を準備する(`~/.claude/settings.json` に権限モード・出力スタイル・言語を書き込み、グローバル gitignore へ `.codegraph/` を登録する)。claude.ai の環境設定のセットアップスクリプト欄から `install` の後に呼ぶ想定。既存のキーは上書きしない(`--force` で上書き) |
|
|
192
202
|
| `usage` | Claude API 使用状況(5時間/7日間の利用率とリセット時刻)を表示し、Slack にも通知 |
|
|
193
203
|
| `version` | CLI のバージョンを表示(`--version` / `-v` も可) |
|
|
194
204
|
|
|
@@ -261,7 +271,7 @@ claude-task-worker all --cloud
|
|
|
261
271
|
- `config.json` の `mode` が `"herdr"` であること。新しいクラウドセッションの作成には TTY が必要で、`"default"` の子プロセス実行では作れない。`mode` が `"herdr"` でないのに `--cloud` を付けた場合は**タスクを1件も起動せずエラー終了する**(`"default"` へフォールバックしない)
|
|
262
272
|
- claude.ai アカウントでのサインインが必須。API キー認証(`ANTHROPIC_API_KEY` / `ANTHROPIC_AUTH_TOKEN`)・第三者プロバイダ(Bedrock / Vertex)・カスタムエンドポイント構成では利用できない。この検査(`claude auth status --json` の実行)は `--cloud` を指定したときだけ行う
|
|
263
273
|
- 対象リポジトリの GitHub App 連携(クラウド VM から push / PR 作成を行うため)
|
|
264
|
-
- claude.ai の環境設定のセットアップスクリプト欄に `npx claude-task-worker install`
|
|
274
|
+
- claude.ai の環境設定のセットアップスクリプト欄に `npx claude-task-worker install` と `npx claude-task-worker cloud-setup` をこの順で記載しておくこと。前者でプラグイン・CLI を導入し、後者で VM 側の `~/.claude/settings.json`(権限モード・出力スタイル・言語)の書き込みとグローバル gitignore への `.codegraph/` 登録を行う(手順は「[インストール](#インストール)」参照)
|
|
265
275
|
- UIデザイン先行ワークフローを使う場合のみ、claude.ai の環境設定の環境変数欄に `PEN_CLI_KEY`(pen.dev の組織設定 > Developer Keys で発行)を設定しておくこと。`.pen` を扱う3スキルの Pen CLI 認証に使う(「[Pen CLI のログイン](#pen-cli-のログイン)」参照)
|
|
266
276
|
|
|
267
277
|
上記のうち静的検査されるのは1〜2番目だけで、GitHub App 連携・クラウド VM 側の導入状況・環境変数の設定はローカルから確認できないため検査されない。
|
package/dist/index.js
CHANGED
|
@@ -1635,7 +1635,7 @@ import { readFileSync, writeFileSync } from "node:fs";
|
|
|
1635
1635
|
import { isAbsolute, join, normalize, sep as SEP } from "node:path";
|
|
1636
1636
|
|
|
1637
1637
|
// src/dispatch-args.ts
|
|
1638
|
-
var FLAG_INCOMPATIBLE_COMMANDS = ["init", "install", "update", "usage", "version"];
|
|
1638
|
+
var FLAG_INCOMPATIBLE_COMMANDS = ["init", "install", "update", "cloud-setup", "usage", "version"];
|
|
1639
1639
|
function collectFlagValues(argv, flag) {
|
|
1640
1640
|
const values = [];
|
|
1641
1641
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -5089,6 +5089,78 @@ async function install() {
|
|
|
5089
5089
|
console.log("[install] Done.");
|
|
5090
5090
|
}
|
|
5091
5091
|
|
|
5092
|
+
// src/commands/cloud-setup.ts
|
|
5093
|
+
import { mkdir as mkdir3, writeFile as writeFile3, readFile as readFile2 } from "node:fs/promises";
|
|
5094
|
+
import { homedir as homedir6 } from "node:os";
|
|
5095
|
+
import { join as join8 } from "node:path";
|
|
5096
|
+
var LOG_PREFIX = "cloud-setup";
|
|
5097
|
+
var CLOUD_DEFAULT_PERMISSION_MODE = "auto";
|
|
5098
|
+
var CLOUD_SETTINGS_DEFAULTS = {
|
|
5099
|
+
outputStyle: "Proactive",
|
|
5100
|
+
language: "Japanese"
|
|
5101
|
+
};
|
|
5102
|
+
function claudeSettingsPath() {
|
|
5103
|
+
const dir = process.env.CLAUDE_CONFIG_DIR;
|
|
5104
|
+
return join8(dir && dir.length > 0 ? dir : join8(homedir6(), ".claude"), "settings.json");
|
|
5105
|
+
}
|
|
5106
|
+
function withCloudDefaults(existing, force) {
|
|
5107
|
+
const parsed = existing === null ? {} : JSON.parse(existing);
|
|
5108
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
5109
|
+
throw new Error("not a JSON object");
|
|
5110
|
+
}
|
|
5111
|
+
const settings = { ...parsed };
|
|
5112
|
+
const current = settings["permissions"] ?? {};
|
|
5113
|
+
if (typeof current !== "object" || current === null || Array.isArray(current)) {
|
|
5114
|
+
throw new Error("`permissions` is not an object");
|
|
5115
|
+
}
|
|
5116
|
+
const permissions = { ...current };
|
|
5117
|
+
let changed = false;
|
|
5118
|
+
const set = (target, key, value) => {
|
|
5119
|
+
if (key in target && !force) return;
|
|
5120
|
+
if (target[key] === value) return;
|
|
5121
|
+
target[key] = value;
|
|
5122
|
+
changed = true;
|
|
5123
|
+
};
|
|
5124
|
+
set(permissions, "defaultMode", CLOUD_DEFAULT_PERMISSION_MODE);
|
|
5125
|
+
for (const [key, value] of Object.entries(CLOUD_SETTINGS_DEFAULTS)) set(settings, key, value);
|
|
5126
|
+
if (!changed) return null;
|
|
5127
|
+
return `${JSON.stringify({ ...settings, permissions }, null, 2)}
|
|
5128
|
+
`;
|
|
5129
|
+
}
|
|
5130
|
+
async function writeClaudeSettings(force) {
|
|
5131
|
+
const path2 = claudeSettingsPath();
|
|
5132
|
+
let existing;
|
|
5133
|
+
try {
|
|
5134
|
+
existing = await readFile2(path2, "utf-8");
|
|
5135
|
+
} catch {
|
|
5136
|
+
existing = null;
|
|
5137
|
+
}
|
|
5138
|
+
let next;
|
|
5139
|
+
try {
|
|
5140
|
+
next = withCloudDefaults(existing, force);
|
|
5141
|
+
} catch (e) {
|
|
5142
|
+
console.log(`[${LOG_PREFIX}] Skipped: ${path2} (${e instanceof Error ? e.message : String(e)})`);
|
|
5143
|
+
return;
|
|
5144
|
+
}
|
|
5145
|
+
if (next === null) {
|
|
5146
|
+
console.log(`[${LOG_PREFIX}] Already set: ${path2}`);
|
|
5147
|
+
return;
|
|
5148
|
+
}
|
|
5149
|
+
try {
|
|
5150
|
+
await mkdir3(join8(path2, ".."), { recursive: true });
|
|
5151
|
+
await writeFile3(path2, next, "utf-8");
|
|
5152
|
+
} catch (e) {
|
|
5153
|
+
console.log(`[${LOG_PREFIX}] Failed to write ${path2}: ${e instanceof Error ? e.message : String(e)}`);
|
|
5154
|
+
return;
|
|
5155
|
+
}
|
|
5156
|
+
console.log(`[${LOG_PREFIX}] ${existing === null ? "Created" : "Updated"}: ${path2}`);
|
|
5157
|
+
}
|
|
5158
|
+
async function cloudSetup(options = {}) {
|
|
5159
|
+
await writeClaudeSettings(options.force ?? false);
|
|
5160
|
+
await ensureCodegraphGitIgnore(LOG_PREFIX);
|
|
5161
|
+
console.log(`[${LOG_PREFIX}] Done.`);
|
|
5162
|
+
}
|
|
5163
|
+
|
|
5092
5164
|
// src/commands/update.ts
|
|
5093
5165
|
init_run_command();
|
|
5094
5166
|
var PLUGIN_NAME2 = "claude-task-worker";
|
|
@@ -5144,14 +5216,14 @@ async function update() {
|
|
|
5144
5216
|
|
|
5145
5217
|
// src/commands/version.ts
|
|
5146
5218
|
import { readFileSync as readFileSync5 } from "node:fs";
|
|
5147
|
-
import { dirname as dirname3, join as
|
|
5219
|
+
import { dirname as dirname3, join as join9 } from "node:path";
|
|
5148
5220
|
import { fileURLToPath } from "node:url";
|
|
5149
5221
|
import { styleText } from "node:util";
|
|
5150
5222
|
var REGISTRY_URL = "https://registry.npmjs.org/claude-task-worker/latest";
|
|
5151
5223
|
var FETCH_TIMEOUT_MS = 3e3;
|
|
5152
5224
|
function localVersion() {
|
|
5153
5225
|
const here = dirname3(fileURLToPath(import.meta.url));
|
|
5154
|
-
const pkgPath =
|
|
5226
|
+
const pkgPath = join9(here, "..", "package.json");
|
|
5155
5227
|
const pkg = JSON.parse(readFileSync5(pkgPath, "utf8"));
|
|
5156
5228
|
return pkg.version ?? "unknown";
|
|
5157
5229
|
}
|
|
@@ -5217,6 +5289,7 @@ Commands:
|
|
|
5217
5289
|
init [--force] Create required GitHub labels and config file (use --force to overwrite existing files)
|
|
5218
5290
|
install Add the claude-task-worker marketplace, install the plugin, and install/update the CLI
|
|
5219
5291
|
update Update the claude-task-worker plugin/marketplace and the CLI itself
|
|
5292
|
+
cloud-setup [--force] Prepare a cloud session VM (writes permission mode, output style, and language into ~/.claude/settings.json). Meant for a cloud environment setup script
|
|
5220
5293
|
usage Notify current usage to Slack
|
|
5221
5294
|
version Print the installed claude-task-worker CLI version (aliases: --version, -v)
|
|
5222
5295
|
|
|
@@ -5267,7 +5340,7 @@ if (!workerType) {
|
|
|
5267
5340
|
printUsage();
|
|
5268
5341
|
process.exit(1);
|
|
5269
5342
|
}
|
|
5270
|
-
if (workerType !== "all" && workerType !== "yolo" && workerType !== "init" && workerType !== "install" && workerType !== "update" && workerType !== "usage" && !WORKERS[workerType]) {
|
|
5343
|
+
if (workerType !== "all" && workerType !== "yolo" && workerType !== "init" && workerType !== "install" && workerType !== "update" && workerType !== "cloud-setup" && workerType !== "usage" && !WORKERS[workerType]) {
|
|
5271
5344
|
console.error(`Unknown command: ${workerType}`);
|
|
5272
5345
|
printUsage();
|
|
5273
5346
|
process.exit(1);
|
|
@@ -5452,6 +5525,10 @@ if (hasProjectFilter()) {
|
|
|
5452
5525
|
(async () => {
|
|
5453
5526
|
await update();
|
|
5454
5527
|
})();
|
|
5528
|
+
} else if (workerType === "cloud-setup") {
|
|
5529
|
+
(async () => {
|
|
5530
|
+
await cloudSetup({ force: process.argv.slice(3).includes("--force") });
|
|
5531
|
+
})();
|
|
5455
5532
|
} else if (workerType === "usage") {
|
|
5456
5533
|
(async () => {
|
|
5457
5534
|
const text = await buildTokenLimitText();
|