claude-task-worker 0.117.0 → 0.119.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 +10 -4
- package/dist/{chunk-FAD5CNP4.js → chunk-Z2IEIKI3.js} +42 -16
- package/dist/commands/init.d.ts +1 -0
- package/dist/config.d.ts +9 -1
- package/dist/index.js +22 -10
- package/dist/lib.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ GitHub Issues/PRを定期ポーリングし、Claude Codeに処理を委譲す
|
|
|
4
4
|
|
|
5
5
|
同梱の Claude Code プラグイン(`plugin/`)と組み合わせることで、Issue の実装からPRのレビュー対応、Dependabot PR の対応までを自動化する。CLI 本体(npm パッケージ)とプラグイン(Claude Code マーケットプレイス)は同じリポジトリ・同じ名前で提供される。
|
|
6
6
|
|
|
7
|
+
使い方のマニュアル(ハンズオン形式の導入・カスタムワーカーの作り方・設定のパッケージ化など)は [`docs/`](./docs/README.md) にある。
|
|
8
|
+
|
|
7
9
|
## アーキテクチャ
|
|
8
10
|
|
|
9
11
|
CLI が GitHub ラベルを検知してタスクを起動し、プラグインのスキルが実際の処理を担う。
|
|
@@ -181,7 +183,7 @@ claude-task-worker exec-issue --cloud
|
|
|
181
183
|
claude-task-worker all --cloud
|
|
182
184
|
```
|
|
183
185
|
|
|
184
|
-
|
|
186
|
+
`--cloud` を付けたプロセスが起動するワーカーはすべてクラウドで実行される。ワーカーごとの向き不向きは [`docs/cloud.md`](./docs/cloud.md) を参照。
|
|
185
187
|
|
|
186
188
|
前提条件:
|
|
187
189
|
|
|
@@ -213,7 +215,7 @@ npx claude-task-worker cloud-setup
|
|
|
213
215
|
- `--cloud` と併用できないコマンド: `init` / `apply-labels` / `install` / `update` / `cloud-setup` / `usage` / `version` / `list-workers`
|
|
214
216
|
- `--cloud` は `mode`(`default` / `herdr`)に依存しない。クラウドセッションの作成は `script` コマンドの疑似 pty で完結し、herdr のペインを使わないため、どちらの `mode` でも同じ経路を通る
|
|
215
217
|
|
|
216
|
-
詳細は [`docs/
|
|
218
|
+
詳細は [`docs/cloud.md`](./docs/cloud.md) を参照。
|
|
217
219
|
|
|
218
220
|
### `--debug`
|
|
219
221
|
|
|
@@ -237,13 +239,17 @@ claude-task-worker all --inherit-config ~/ctw/shared.json
|
|
|
237
239
|
claude-task-worker init --inherit-config ~/ctw/shared.json # 指定パスへ設定ファイルを生成する
|
|
238
240
|
```
|
|
239
241
|
|
|
242
|
+
- フラグの代わりに、cwd 直下の `claude-task-worker.json`(または `claude-task-worker.local.json`。local が勝つ)のトップレベル `inheritConfig` に土台ファイルのパスを書いてもよい(例: `"inheritConfig": "~/ctw/shared.json"`)。挙動はフラグと同一で、相対パスは cwd 基準、`~` はホーム展開。フラグとキーの両方があればフラグが勝つ。土台ファイル側の `inheritConfig` は解釈しない(継承は1段のみ)。非 string・空文字は警告して未指定扱い
|
|
240
243
|
- 未指定時は従来どおり cwd 直下の `claude-task-worker.json` / `claude-task-worker.local.json` だけを読む
|
|
241
244
|
- 値自体の相対パスは起動時の cwd 基準。ファイル内の相対パス(`workerFiles` / `uiDesign.designDir`)は**そのファイルの所在ディレクトリ基準**で解決する
|
|
245
|
+
- 配列(`labels` / `workerFiles` など)は置き換えではなく、cwd 側の値を土台の後ろへ追記する(重複は除く)。cwd の `claude-task-worker.json` と `claude-task-worker.local.json` 同士は従来どおり local が丸ごと置き換え、その結果を土台へ追記する
|
|
242
246
|
- `claude-task-worker.local.json` は常に cwd 直下のものを読む(指定ファイルと同じディレクトリのものは読まない)。cwd 直下の `claude-task-worker.json` は無くてもよい
|
|
243
|
-
-
|
|
247
|
+
- 指定ファイルが存在しなければエラー終了する(既定ファイルへは倒さない。メッセージは指定元に応じて `--inherit-config <path>` / `inheritConfig <path>`)。`--project` では絶対パスにして各プロジェクトへ転送する
|
|
244
248
|
- 定期ワーカーの `lastRun` は指定に関わらずリポジトリ直下の `claude-task-worker.json` で読み書きする。リポジトリ直下に同ファイルが無ければ `lastRun` だけを持つファイルが作られる(他のキーを持たないので土台の設定とは衝突しない)。`init` を `--inherit-config` 付きで実行した場合も、未記録のワーカーの `lastRun` はリポジトリ直下へ記録する(セットアップ直後に定期ワーカーが一斉に走らないようにするため)
|
|
245
249
|
- スキル(`create-ui-design` / `update-design-md` / `triage-created-issue`)はリポジトリ直下の `claude-task-worker.json` を直接読むため、**`uiDesign` の設定は `--inherit-config` のファイルに書いてもスキルには届かない**。`uiDesign` はリポジトリ直下に書くこと
|
|
246
250
|
|
|
251
|
+
設定・カスタムワーカー・スキルを1つのリポジトリにまとめて配る手順は [`docs/config-package.md`](./docs/config-package.md) を参照。
|
|
252
|
+
|
|
247
253
|
### Pen CLI のログイン
|
|
248
254
|
|
|
249
255
|
`.pen` を扱うスキルは Pen CLI の認証を必要とする。UIデザイン先行ワークフローを使うなら一度ログインしておく。
|
|
@@ -374,7 +380,7 @@ export const myWorker = createIssuePollingWorker({
|
|
|
374
380
|
});
|
|
375
381
|
```
|
|
376
382
|
|
|
377
|
-
起動時に全件を検証し、次のいずれかがあればタスクを1件も起動せず exit 1 する(メッセージにファイルパスと直し方を含む): ファイルが存在しない/読み込み・トランスパイルに失敗/定義が1つも export されていない/`name` がプリセットと衝突/`name` がカスタム同士で衝突。`claude-task-worker list-workers`
|
|
383
|
+
起動時に全件を検証し、次のいずれかがあればタスクを1件も起動せず exit 1 する(メッセージにファイルパスと直し方を含む): ファイルが存在しない/読み込み・トランスパイルに失敗/定義が1つも export されていない/`name` がプリセットと衝突/`name` がカスタム同士で衝突。`claude-task-worker list-workers` でロード結果を確認できる。作り方の詳しい手順は [`docs/custom-worker.md`](./docs/custom-worker.md) を参照。
|
|
378
384
|
|
|
379
385
|
## ワークフロー
|
|
380
386
|
|
|
@@ -514,6 +514,7 @@ function buildForwardedCommand(argv) {
|
|
|
514
514
|
|
|
515
515
|
// src/config.ts
|
|
516
516
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
517
|
+
import { homedir } from "node:os";
|
|
517
518
|
import { dirname, isAbsolute, join, normalize, relative, resolve as resolve2, sep as SEP } from "node:path";
|
|
518
519
|
var DEFAULT_UI_DESIGN_CONFIG = {
|
|
519
520
|
enabled: false,
|
|
@@ -922,11 +923,15 @@ function resolveWorkerFilePath(entry, configDir, home) {
|
|
|
922
923
|
function isPlainObject(val) {
|
|
923
924
|
return typeof val === "object" && val !== null && !Array.isArray(val);
|
|
924
925
|
}
|
|
925
|
-
function mergeConfigRaw(base, local) {
|
|
926
|
+
function mergeConfigRaw(base, local, appendArrays = false) {
|
|
926
927
|
const result = { ...base };
|
|
927
928
|
for (const [key, val] of Object.entries(local)) {
|
|
928
929
|
const current = result[key];
|
|
929
|
-
|
|
930
|
+
if (appendArrays && Array.isArray(current) && Array.isArray(val)) {
|
|
931
|
+
result[key] = [...current, ...val.filter((v) => !current.includes(v))];
|
|
932
|
+
} else {
|
|
933
|
+
result[key] = isPlainObject(current) && isPlainObject(val) ? mergeConfigRaw(current, val, appendArrays) : val;
|
|
934
|
+
}
|
|
930
935
|
}
|
|
931
936
|
return result;
|
|
932
937
|
}
|
|
@@ -961,19 +966,39 @@ function resolveInheritedRelativePaths(raw, configDir, repoRoot) {
|
|
|
961
966
|
}
|
|
962
967
|
return result;
|
|
963
968
|
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
969
|
+
var INHERIT_CONFIG_KEY = "inheritConfig";
|
|
970
|
+
var cachedInheritConfigSource;
|
|
971
|
+
function resolveInheritConfigSource() {
|
|
972
|
+
if (cachedInheritConfigSource !== void 0) return cachedInheritConfigSource;
|
|
973
|
+
const flagPath = getInheritConfigPath();
|
|
974
|
+
if (flagPath) return cachedInheritConfigSource = { path: flagPath, origin: INHERIT_CONFIG_FLAG };
|
|
975
|
+
const raw = readCwdRawConfig();
|
|
976
|
+
if (!(INHERIT_CONFIG_KEY in raw)) return cachedInheritConfigSource = null;
|
|
977
|
+
const val = raw[INHERIT_CONFIG_KEY];
|
|
978
|
+
if (typeof val !== "string" || val.trim().length === 0) {
|
|
979
|
+
console.warn(`[config] invalid ${INHERIT_CONFIG_KEY}: ${String(val)}, ignoring`);
|
|
980
|
+
return cachedInheritConfigSource = null;
|
|
981
|
+
}
|
|
982
|
+
cachedInheritConfigSource = {
|
|
983
|
+
path: resolveWorkerFilePath(val.trim(), process.cwd(), homedir()),
|
|
984
|
+
origin: INHERIT_CONFIG_KEY
|
|
985
|
+
};
|
|
986
|
+
return cachedInheritConfigSource;
|
|
987
|
+
}
|
|
988
|
+
function readInheritedRawConfig(source, repoRoot) {
|
|
989
|
+
if (!existsSync(source.path)) {
|
|
990
|
+
throw new Error(`${source.origin} ${source.path} does not exist`);
|
|
967
991
|
}
|
|
968
|
-
|
|
992
|
+
const { [INHERIT_CONFIG_KEY]: _ignored, ...raw } = readRawConfig(source.path);
|
|
993
|
+
return resolveInheritedRelativePaths(raw, dirname(source.path), repoRoot);
|
|
969
994
|
}
|
|
970
995
|
function readCwdRawConfig() {
|
|
971
996
|
return mergeConfigRaw(readRawConfig(CONFIG_PATH), readRawConfig(LOCAL_CONFIG_PATH));
|
|
972
997
|
}
|
|
973
998
|
function loadConfig() {
|
|
974
|
-
const
|
|
999
|
+
const inheritSource = resolveInheritConfigSource();
|
|
975
1000
|
const cwdRaw = readCwdRawConfig();
|
|
976
|
-
const raw =
|
|
1001
|
+
const raw = inheritSource ? mergeConfigRaw(readInheritedRawConfig(inheritSource, process.cwd()), cwdRaw, true) : cwdRaw;
|
|
977
1002
|
const result = {
|
|
978
1003
|
...DEFAULT_CONFIG,
|
|
979
1004
|
labels: [],
|
|
@@ -1094,7 +1119,7 @@ function getUiDesignConfig() {
|
|
|
1094
1119
|
|
|
1095
1120
|
// src/user-config.ts
|
|
1096
1121
|
import { readFileSync as readFileSync2, statSync } from "node:fs";
|
|
1097
|
-
import { homedir } from "node:os";
|
|
1122
|
+
import { homedir as homedir2 } from "node:os";
|
|
1098
1123
|
import { isAbsolute as isAbsolute2, join as join2, resolve as resolve3 } from "node:path";
|
|
1099
1124
|
var RESERVED_ALL = "all";
|
|
1100
1125
|
var DEFAULT_RUN_MODE = "default";
|
|
@@ -1116,7 +1141,7 @@ var UserConfigError = class extends Error {
|
|
|
1116
1141
|
};
|
|
1117
1142
|
function getConfigDir() {
|
|
1118
1143
|
const xdg = process.env.XDG_CONFIG_HOME;
|
|
1119
|
-
const configHome = xdg && xdg.length > 0 ? xdg : join2(
|
|
1144
|
+
const configHome = xdg && xdg.length > 0 ? xdg : join2(homedir2(), ".config");
|
|
1120
1145
|
return join2(configHome, "claude-task-worker");
|
|
1121
1146
|
}
|
|
1122
1147
|
function getUserConfigPath() {
|
|
@@ -1612,7 +1637,7 @@ import { StringDecoder } from "node:string_decoder";
|
|
|
1612
1637
|
|
|
1613
1638
|
// src/task-result.ts
|
|
1614
1639
|
var STDERR_TAIL_LIMIT = 8 * 1024;
|
|
1615
|
-
var CLOUD_FAILURE_GUIDANCE = "[worker] \u30AF\u30E9\u30A6\u30C9\u5B9F\u884C\u306E\u524D\u63D0\u6761\u4EF6\uFF08GitHub \u9023\u643A / allow_remote_sessions \u7D44\u7E54\u30DD\u30EA\u30B7\u30FC\uFF09\u304C\u6E80\u305F\u3055\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u8A73\u7D30\u306F docs/cloud
|
|
1640
|
+
var CLOUD_FAILURE_GUIDANCE = "[worker] \u30AF\u30E9\u30A6\u30C9\u5B9F\u884C\u306E\u524D\u63D0\u6761\u4EF6\uFF08GitHub \u9023\u643A / allow_remote_sessions \u7D44\u7E54\u30DD\u30EA\u30B7\u30FC\uFF09\u304C\u6E80\u305F\u3055\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u8A73\u7D30\u306F docs/cloud.md \u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002";
|
|
1616
1641
|
function appendCloudFailureGuidance(result, cloud) {
|
|
1617
1642
|
if (!cloud || result.status === "completed") return result;
|
|
1618
1643
|
return { ...result, output: `${CLOUD_FAILURE_GUIDANCE}
|
|
@@ -2334,15 +2359,15 @@ function isGeneratedWorktreeName(name) {
|
|
|
2334
2359
|
// src/slack.ts
|
|
2335
2360
|
import { exec } from "node:child_process";
|
|
2336
2361
|
import { readFileSync as readFileSync3, writeFileSync as writeFileSync4 } from "node:fs";
|
|
2337
|
-
import { homedir as
|
|
2362
|
+
import { homedir as homedir4 } from "node:os";
|
|
2338
2363
|
import { join as join4 } from "node:path";
|
|
2339
2364
|
import { promisify as promisify2 } from "node:util";
|
|
2340
2365
|
|
|
2341
2366
|
// src/runcat.ts
|
|
2342
2367
|
import { mkdirSync as mkdirSync2, renameSync as renameSync2, rmSync, writeFileSync as writeFileSync3 } from "node:fs";
|
|
2343
|
-
import { homedir as
|
|
2368
|
+
import { homedir as homedir3 } from "node:os";
|
|
2344
2369
|
import { dirname as dirname2, join as join3 } from "node:path";
|
|
2345
|
-
var RUNCAT_OUT_FILE = process.env.RUNCAT_OUT_FILE ?? join3(process.env.HOME ??
|
|
2370
|
+
var RUNCAT_OUT_FILE = process.env.RUNCAT_OUT_FILE ?? join3(process.env.HOME ?? homedir3(), ".claude", "runcat-usage.json");
|
|
2346
2371
|
var JST = "Asia/Tokyo";
|
|
2347
2372
|
function formatG(value) {
|
|
2348
2373
|
return String(Number(value.toPrecision(6)));
|
|
@@ -2443,7 +2468,7 @@ async function getOAuthToken() {
|
|
|
2443
2468
|
const { stdout } = await execAsync('security find-generic-password -s "Claude Code-credentials" -w');
|
|
2444
2469
|
return extractToken(JSON.parse(stdout.trim()));
|
|
2445
2470
|
} catch {
|
|
2446
|
-
const raw = readFileSync3(join4(
|
|
2471
|
+
const raw = readFileSync3(join4(homedir4(), ".claude", ".credentials.json"), "utf-8");
|
|
2447
2472
|
return extractToken(JSON.parse(raw));
|
|
2448
2473
|
}
|
|
2449
2474
|
}
|
|
@@ -3332,7 +3357,6 @@ export {
|
|
|
3332
3357
|
hasProjectFilter,
|
|
3333
3358
|
assertProjectCompatibleCommand,
|
|
3334
3359
|
hasCloudFlag,
|
|
3335
|
-
INHERIT_CONFIG_FLAG,
|
|
3336
3360
|
getInheritConfigPath,
|
|
3337
3361
|
assertCloudCompatibleCommand,
|
|
3338
3362
|
buildForwardedCommand,
|
|
@@ -3345,6 +3369,8 @@ export {
|
|
|
3345
3369
|
CONFIG_PATH,
|
|
3346
3370
|
LOCAL_CONFIG_PATH,
|
|
3347
3371
|
resolveWorkerFilePath,
|
|
3372
|
+
INHERIT_CONFIG_KEY,
|
|
3373
|
+
resolveInheritConfigSource,
|
|
3348
3374
|
loadConfig,
|
|
3349
3375
|
getWorkerConfig,
|
|
3350
3376
|
isWorkerEnabled,
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export declare function buildLabelSpecs(custom: string[]): {
|
|
|
10
10
|
export declare function applyLabels(): Promise<void>;
|
|
11
11
|
export declare const ISSUE_TEMPLATE = "name: \"[claude-task-worker] Issue\u4F5C\u6210\u4F9D\u983C\"\ndescription: claude-task-worker\u3067GitHub Issue\u3092\u4F5C\u6210\u3059\u308B\ntitle: \"[claude-task-worker] Issue\u4F5C\u6210\u4F9D\u983C\"\nlabels:\n - cc-triage-scope\n - cc-issue-request\nbody:\n - type: textarea\n id: request\n attributes:\n label: \u4F9D\u983C\u5185\u5BB9\n description: \u4F5C\u6210\u3057\u3066\u307B\u3057\u3044Issue\u306E\u5185\u5BB9\u3092\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\n validations:\n required: true\n";
|
|
12
12
|
export declare const ASSIGN_CREATOR_WORKFLOW = "name: Assign creator on issue request\n\non:\n issues:\n types: [opened]\n\njobs:\n assign:\n if: contains(github.event.issue.labels.*.name, 'cc-issue-request')\n runs-on: ubuntu-latest\n permissions:\n issues: write\n steps:\n - uses: actions/github-script@v9\n with:\n script: |\n await github.rest.issues.addAssignees({\n owner: context.repo.owner,\n repo: context.repo.repo,\n issue_number: context.issue.number,\n assignees: [context.payload.issue.user.login]\n });\n";
|
|
13
|
+
export declare function buildInitialConfig(now: string): Record<string, unknown>;
|
|
13
14
|
export declare function seedCwdLastRun(at: Date): void;
|
|
14
15
|
export declare function isContentMismatch(result: "created" | "overwritten" | "skipped", expected: string, actual: string): boolean;
|
|
15
16
|
export declare function init(options?: {
|
package/dist/config.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { INHERIT_CONFIG_FLAG } from "./dispatch-args";
|
|
1
2
|
export type WorkerName = "exec-issue" | "answer-issue-questions" | "create-issue" | "update-issue" | "triage-created-issue" | "fix-review-point" | "check-dependabot" | "triage-pr" | "resolve-conflict" | "epic-issue" | "create-ui-design" | "apply-ui-design" | "update-coding-guidelines" | "update-requirement-rules" | "update-design-md";
|
|
2
3
|
export interface WorkerRuntimeConfig {
|
|
3
4
|
skill: string;
|
|
@@ -60,8 +61,15 @@ export declare function parseLastRunEntry(val: unknown): LastRunLog;
|
|
|
60
61
|
export declare function parseLabelsEntry(val: unknown): string[];
|
|
61
62
|
export declare function parseWorkerFilesEntry(val: unknown): string[];
|
|
62
63
|
export declare function resolveWorkerFilePath(entry: string, configDir: string, home: string): string;
|
|
63
|
-
export declare function mergeConfigRaw(base: Record<string, unknown>, local: Record<string, unknown
|
|
64
|
+
export declare function mergeConfigRaw(base: Record<string, unknown>, local: Record<string, unknown>, appendArrays?: boolean): Record<string, unknown>;
|
|
64
65
|
export declare function resolveInheritedRelativePaths(raw: Record<string, unknown>, configDir: string, repoRoot: string): Record<string, unknown>;
|
|
66
|
+
export declare const INHERIT_CONFIG_KEY = "inheritConfig";
|
|
67
|
+
export interface InheritConfigSource {
|
|
68
|
+
path: string;
|
|
69
|
+
origin: typeof INHERIT_CONFIG_FLAG | typeof INHERIT_CONFIG_KEY;
|
|
70
|
+
}
|
|
71
|
+
export declare function resolveInheritConfigSource(): InheritConfigSource | null;
|
|
72
|
+
export declare function resetInheritConfigSourceCache(): void;
|
|
65
73
|
export declare function loadConfig(): Config;
|
|
66
74
|
export declare function getWorkerConfig(workerName: string): WorkerRuntimeConfig;
|
|
67
75
|
export declare function isWorkerEnabled(workerName: string): boolean;
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
CONFIG_PATH,
|
|
5
5
|
DEFAULT_CONFIG,
|
|
6
6
|
DEFAULT_UI_DESIGN_CONFIG,
|
|
7
|
-
|
|
7
|
+
INHERIT_CONFIG_KEY,
|
|
8
8
|
LOCAL_CONFIG_PATH,
|
|
9
9
|
SCHEDULED_WORKER_NAMES,
|
|
10
10
|
UserConfigError,
|
|
@@ -57,6 +57,7 @@ import {
|
|
|
57
57
|
partitionEnabledWorkers,
|
|
58
58
|
removeStaleWorktrees,
|
|
59
59
|
renderTable,
|
|
60
|
+
resolveInheritConfigSource,
|
|
60
61
|
resolveTargetProjects,
|
|
61
62
|
resolveWorkerFilePath,
|
|
62
63
|
send,
|
|
@@ -64,7 +65,7 @@ import {
|
|
|
64
65
|
shutdown,
|
|
65
66
|
waitForAllProcesses,
|
|
66
67
|
writeLastRun
|
|
67
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-Z2IEIKI3.js";
|
|
68
69
|
import {
|
|
69
70
|
captureConsole
|
|
70
71
|
} from "./chunk-N42YU3GJ.js";
|
|
@@ -921,14 +922,18 @@ function logWriteResult(result, path) {
|
|
|
921
922
|
else if (result === "overwritten") console.log(`[init] Overwritten: ${path}`);
|
|
922
923
|
else console.log(`[init] Already exists: ${path}`);
|
|
923
924
|
}
|
|
924
|
-
|
|
925
|
-
const
|
|
926
|
-
|
|
927
|
-
...
|
|
925
|
+
function buildInitialConfig(now) {
|
|
926
|
+
const { labels: _labels, workerFiles: _workerFiles, ...rest } = DEFAULT_CONFIG;
|
|
927
|
+
return {
|
|
928
|
+
...rest,
|
|
928
929
|
uiDesign: { ...DEFAULT_UI_DESIGN_CONFIG },
|
|
929
930
|
lastRun: Object.fromEntries(SCHEDULED_WORKER_NAMES.map((name) => [name, now])),
|
|
930
931
|
workers: {}
|
|
931
932
|
};
|
|
933
|
+
}
|
|
934
|
+
async function createConfig(force) {
|
|
935
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
936
|
+
const initialConfig = buildInitialConfig(now);
|
|
932
937
|
const inheritPath = getInheritConfigPath();
|
|
933
938
|
const path = inheritPath ?? CONFIG_PATH;
|
|
934
939
|
const result = await writeFileWithMode(path, JSON.stringify(initialConfig, null, 2), force);
|
|
@@ -1533,10 +1538,17 @@ if (workerType === "version" || workerType === "--version" || workerType === "-v
|
|
|
1533
1538
|
process.exit(process.exitCode ?? 0);
|
|
1534
1539
|
}
|
|
1535
1540
|
void notifyIfOutdated();
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1541
|
+
if (workerType !== "init") {
|
|
1542
|
+
let inheritSource;
|
|
1543
|
+
try {
|
|
1544
|
+
inheritSource = resolveInheritConfigSource();
|
|
1545
|
+
} catch {
|
|
1546
|
+
inheritSource = null;
|
|
1547
|
+
}
|
|
1548
|
+
if (inheritSource && !(hasProjectFilter() && inheritSource.origin === INHERIT_CONFIG_KEY) && !existsSync3(inheritSource.path)) {
|
|
1549
|
+
console.error(`${inheritSource.origin} ${inheritSource.path} does not exist`);
|
|
1550
|
+
process.exit(1);
|
|
1551
|
+
}
|
|
1540
1552
|
}
|
|
1541
1553
|
var customWorkers = workerType && !NON_WORKER_COMMANDS.includes(workerType) && !hasProjectFilter() ? await loadCustomWorkersOrExit() : [];
|
|
1542
1554
|
var WORKERS = Object.fromEntries(
|
package/dist/lib.js
CHANGED