claude-task-worker 0.115.0 → 0.117.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 (64) hide show
  1. package/README.md +53 -7
  2. package/dist/chunk-3RY43CYR.js +41 -0
  3. package/dist/chunk-FAD5CNP4.js +3396 -0
  4. package/dist/chunk-N42YU3GJ.js +184 -0
  5. package/dist/claude-args.d.ts +62 -0
  6. package/dist/commands/cloud-setup.d.ts +14 -0
  7. package/dist/commands/codegraph.d.ts +39 -0
  8. package/dist/commands/design-md.d.ts +11 -0
  9. package/dist/commands/init.d.ts +17 -0
  10. package/dist/commands/install.d.ts +14 -0
  11. package/dist/commands/pen.d.ts +15 -0
  12. package/dist/commands/playwright.d.ts +27 -0
  13. package/dist/commands/run-command.d.ts +10 -0
  14. package/dist/commands/update.d.ts +1 -0
  15. package/dist/commands/version.d.ts +4 -0
  16. package/dist/config.d.ts +77 -0
  17. package/dist/custom-workers.d.ts +16 -0
  18. package/dist/dispatch-args.d.ts +13 -0
  19. package/dist/dispatcher-JKUMXTJ2.js +410 -0
  20. package/dist/dispatcher.d.ts +77 -0
  21. package/dist/gh.d.ts +112 -0
  22. package/dist/git.d.ts +7 -0
  23. package/dist/herdr-NDLUM6JF.js +309 -0
  24. package/dist/herdr-runner-33D6C2KI.js +307 -0
  25. package/dist/herdr-runner.d.ts +136 -0
  26. package/dist/herdr.d.ts +85 -0
  27. package/dist/index.d.ts +2 -0
  28. package/dist/index.js +855 -4984
  29. package/dist/last-run-pr.d.ts +16 -0
  30. package/dist/lib.d.ts +20 -0
  31. package/dist/lib.js +123 -0
  32. package/dist/process-manager.d.ts +38 -0
  33. package/dist/random-name.d.ts +2 -0
  34. package/dist/run-command-O2TMRPZK.js +8 -0
  35. package/dist/runcat.d.ts +23 -0
  36. package/dist/slack.d.ts +46 -0
  37. package/dist/table-DWVMNDS3.js +32 -0
  38. package/dist/table.d.ts +55 -0
  39. package/dist/task-result.d.ts +25 -0
  40. package/dist/transcript.d.ts +27 -0
  41. package/dist/user-config.d.ts +30 -0
  42. package/dist/workers/answer-issue-questions.d.ts +1 -0
  43. package/dist/workers/apply-ui-design.d.ts +1 -0
  44. package/dist/workers/check-dependabot.d.ts +1 -0
  45. package/dist/workers/create-issue.d.ts +1 -0
  46. package/dist/workers/create-ui-design.d.ts +2 -0
  47. package/dist/workers/epic-issue.d.ts +2 -0
  48. package/dist/workers/exec-issue.d.ts +15 -0
  49. package/dist/workers/fix-review-point.d.ts +1 -0
  50. package/dist/workers/issue-worker.d.ts +18 -0
  51. package/dist/workers/pr-worker.d.ts +18 -0
  52. package/dist/workers/registry.d.ts +8 -0
  53. package/dist/workers/resolve-conflict.d.ts +2 -0
  54. package/dist/workers/scheduled-worker.d.ts +8 -0
  55. package/dist/workers/triage-created-issue.d.ts +1 -0
  56. package/dist/workers/triage-pr.d.ts +5 -0
  57. package/dist/workers/ui-design.d.ts +14 -0
  58. package/dist/workers/update-coding-guidelines.d.ts +1 -0
  59. package/dist/workers/update-design-md.d.ts +1 -0
  60. package/dist/workers/update-issue.d.ts +1 -0
  61. package/dist/workers/update-requirement-rules.d.ts +1 -0
  62. package/dist/workers/worker-definition.d.ts +18 -0
  63. package/dist/worktree.d.ts +21 -0
  64. package/package.json +14 -3
@@ -0,0 +1,184 @@
1
+ // src/table.ts
2
+ import { format } from "node:util";
3
+ function getDisplayWidth(str) {
4
+ let width = 0;
5
+ for (const char of str.replace(CONTROL_CHARS, "")) {
6
+ const code = char.codePointAt(0);
7
+ if (code >= 4352 && code <= 4447 || code >= 11904 && code <= 12350 || code >= 12352 && code <= 13247 || code >= 13312 && code <= 19903 || code >= 19968 && code <= 42191 || code >= 44032 && code <= 55215 || code >= 63744 && code <= 64255 || code >= 65072 && code <= 65135 || code >= 65281 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 131072 && code <= 196605 || code >= 196608 && code <= 262141) {
8
+ width += 2;
9
+ } else {
10
+ width += 1;
11
+ }
12
+ }
13
+ return width;
14
+ }
15
+ function truncateToWidth(str, maxWidth) {
16
+ let width = 0;
17
+ let i = 0;
18
+ const chars = [...str];
19
+ while (i < chars.length) {
20
+ const charWidth = getDisplayWidth(chars[i]);
21
+ if (width + charWidth > maxWidth - 3) {
22
+ return chars.slice(0, i).join("") + "...";
23
+ }
24
+ width += charWidth;
25
+ i++;
26
+ }
27
+ return str;
28
+ }
29
+ function padToWidth(str, targetWidth) {
30
+ const currentWidth = getDisplayWidth(str);
31
+ const padding = targetWidth - currentWidth;
32
+ return padding > 0 ? str + " ".repeat(padding) : str;
33
+ }
34
+ var CLOUD_WORKTREE_LABEL = "\x1B[36m\u2601 running in cloud\x1B[0m";
35
+ function formatDuration(start, end = /* @__PURE__ */ new Date()) {
36
+ const diffMs = end.getTime() - start.getTime();
37
+ const totalSeconds = Math.floor(diffMs / 1e3);
38
+ const minutes = Math.floor(totalSeconds / 60);
39
+ const seconds = totalSeconds % 60;
40
+ return `${minutes}m ${String(seconds).padStart(2, "0")}s`;
41
+ }
42
+ function formatTime(date) {
43
+ const h = String(date.getHours()).padStart(2, "0");
44
+ const m = String(date.getMinutes()).padStart(2, "0");
45
+ const s = String(date.getSeconds()).padStart(2, "0");
46
+ return `${h}:${m}:${s}`;
47
+ }
48
+ function renderBoxTable(headers, groups) {
49
+ const allRows = groups.flat();
50
+ const widths = headers.map(
51
+ (h, i) => Math.max(1, getDisplayWidth(h), ...allRows.map((r) => getDisplayWidth(r[i] ?? "")))
52
+ );
53
+ const border = (l, m, r) => `${l}${widths.map((w) => "\u2500".repeat(w + 2)).join(m)}${r}`;
54
+ const row = (cells) => `\u2502 ${cells.map((c, i) => padToWidth(c ?? "", widths[i])).join(" \u2502 ")} \u2502`;
55
+ const lines = [];
56
+ lines.push(border("\u250C", "\u252C", "\u2510"));
57
+ lines.push(row(headers));
58
+ lines.push(border("\u251C", "\u253C", "\u2524"));
59
+ const nonEmpty = groups.filter((g) => g.length > 0);
60
+ nonEmpty.forEach((group, gi) => {
61
+ if (gi > 0) lines.push(border("\u251C", "\u253C", "\u2524"));
62
+ for (const r of group) lines.push(row(r));
63
+ });
64
+ lines.push(border("\u2514", "\u2534", "\u2518"));
65
+ return lines;
66
+ }
67
+ var TASK_DISPLAY_LIMIT = 20;
68
+ var LOG_DISPLAY_LIMIT = 20;
69
+ function taskRecency(t) {
70
+ return (t.finishedAt ?? t.startedAt).getTime();
71
+ }
72
+ function selectRecentTasks(entries, limit = TASK_DISPLAY_LIMIT) {
73
+ const byId = /* @__PURE__ */ new Map();
74
+ for (const e of entries) byId.set(e.id, e);
75
+ const unique = [...byId.values()];
76
+ const running = unique.filter((t) => t.status === "running").sort((a, b) => taskRecency(b) - taskRecency(a));
77
+ const finished = unique.filter((t) => t.status !== "running").sort((a, b) => taskRecency(b) - taskRecency(a));
78
+ return [...running, ...finished].slice(0, limit);
79
+ }
80
+ function buildTaskTableLines(entries, now = /* @__PURE__ */ new Date()) {
81
+ if (entries.length === 0) return [];
82
+ const runningTasks = entries.filter((t) => t.status === "running");
83
+ const finishedTasks = entries.filter((t) => t.status !== "running");
84
+ const maxTitleWidth = 40;
85
+ const maxPathWidth = 40;
86
+ const truncTitle = (s) => getDisplayWidth(s) > maxTitleWidth ? truncateToWidth(s, maxTitleWidth) : s;
87
+ const truncPath = (p) => p ? getDisplayWidth(p) > maxPathWidth ? truncateToWidth(p, maxPathWidth) : p : "";
88
+ const hasPath = entries.some((t) => truncPath(t.path) !== "");
89
+ const runningRows = runningTasks.map(
90
+ (t) => taskRow(
91
+ t,
92
+ truncTitle(t.title),
93
+ truncPath(t.path),
94
+ hasPath,
95
+ t.agentStatus ? `${t.status}:${t.agentStatus}` : t.status,
96
+ formatTime(t.startedAt),
97
+ formatDuration(t.startedAt, now)
98
+ )
99
+ );
100
+ const finishedRows = finishedTasks.map(
101
+ (t) => taskRow(
102
+ t,
103
+ truncTitle(t.title),
104
+ truncPath(t.path),
105
+ hasPath,
106
+ t.status,
107
+ formatTime(t.finishedAt ?? t.startedAt),
108
+ formatDuration(t.startedAt, t.finishedAt ?? now)
109
+ )
110
+ );
111
+ const headers = hasPath ? ["#", "Title", "Worker", "Worktree", "Status", "Time", "Duration"] : ["#", "Title", "Worker", "Status", "Time", "Duration"];
112
+ return renderBoxTable(headers, [runningRows, finishedRows]);
113
+ }
114
+ function taskRow(t, title, path, hasPath, status, time, duration) {
115
+ return hasPath ? [`#${t.id}`, title, t.workerName, path, status, time, duration] : [`#${t.id}`, title, t.workerName, status, time, duration];
116
+ }
117
+ var logLines = [];
118
+ function pushLogLine(entry) {
119
+ if (entry.text.trim().length === 0) return;
120
+ logLines.push(entry);
121
+ if (logLines.length > LOG_DISPLAY_LIMIT) {
122
+ logLines.splice(0, logLines.length - LOG_DISPLAY_LIMIT);
123
+ }
124
+ }
125
+ var rawLog = console.log.bind(console);
126
+ var rawClear = console.clear.bind(console);
127
+ function writeScreen(lines) {
128
+ rawClear();
129
+ rawLog(lines.join("\n"));
130
+ }
131
+ var consoleCaptured = false;
132
+ function captureConsole() {
133
+ if (consoleCaptured) return;
134
+ consoleCaptured = true;
135
+ process.on("exit", () => {
136
+ if (logLines.length > 0) rawLog(buildLogTableLines(logLines).join("\n"));
137
+ });
138
+ const streams = { log: "stdout", info: "stdout", warn: "stderr", error: "stderr" };
139
+ for (const [method, stream] of Object.entries(streams)) {
140
+ console[method] = (...args) => {
141
+ for (const line of format(...args).split("\n")) {
142
+ pushLogLine({ stream, text: line, time: /* @__PURE__ */ new Date() });
143
+ }
144
+ };
145
+ }
146
+ }
147
+ var CONTROL_CHARS = (
148
+ // eslint-disable-next-line no-control-regex -- ANSI/制御文字を意図的に対象にする
149
+ /\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b\[[0-9;?]*[ -/]*[@-~]|[\x00-\x08\x0b-\x1f\x7f]/g
150
+ );
151
+ function sanitizeLogText(text) {
152
+ return text.replace(CONTROL_CHARS, " ").replace(/\t/g, " ");
153
+ }
154
+ function buildLogTableLines(entries) {
155
+ if (entries.length === 0) return [];
156
+ const maxTextWidth = 100;
157
+ const rows = [...entries].reverse().map((e) => {
158
+ const text = sanitizeLogText(e.text);
159
+ return [
160
+ formatTime(e.time),
161
+ e.id === void 0 ? "-" : `#${e.id}`,
162
+ e.stream,
163
+ getDisplayWidth(text) > maxTextWidth ? truncateToWidth(text, maxTextWidth) : text
164
+ ];
165
+ });
166
+ return renderBoxTable(["Time", "#", "Stream", "Log"], [rows]);
167
+ }
168
+
169
+ export {
170
+ getDisplayWidth,
171
+ truncateToWidth,
172
+ padToWidth,
173
+ CLOUD_WORKTREE_LABEL,
174
+ TASK_DISPLAY_LIMIT,
175
+ LOG_DISPLAY_LIMIT,
176
+ selectRecentTasks,
177
+ buildTaskTableLines,
178
+ logLines,
179
+ pushLogLine,
180
+ writeScreen,
181
+ captureConsole,
182
+ CONTROL_CHARS,
183
+ buildLogTableLines
184
+ };
@@ -0,0 +1,62 @@
1
+ import { type PermissionMode, type RunMode } from "./user-config";
2
+ export declare const CLOUD_REPORT_HEADING = "## claude-task-worker \u5B9F\u884C\u7D50\u679C";
3
+ export declare const DISALLOWED_TOOLS: readonly ["Monitor", "ScheduleWakeup", "AskUserQuestion", "EnterPlanMode", "CronCreate", "CronDelete", "CronList", "RemoteTrigger", "EnterWorktree"];
4
+ export declare const DISALLOWED_TOOLS_ARG: string;
5
+ export declare const CLAUDE_SPAWN_ENV: {
6
+ readonly CLAUDE_CODE_DISABLE_BACKGROUND_TASKS: "1";
7
+ readonly CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS: "0";
8
+ };
9
+ export declare const SYSTEM_PROMPT_BASE = "\u3053\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306F `claude-task-worker` \u306E\u30EF\u30FC\u30AB\u30FC\u304B\u3089\u81EA\u52D5\u8D77\u52D5\u3055\u308C\u3066\u3044\u308B\uFF08\u5FDC\u7B54\u3067\u304D\u308B\u30E6\u30FC\u30B6\u30FC\u306F\u5E38\u99D0\u3057\u3066\u3044\u306A\u3044\uFF09\u3002\u4EE5\u4E0B\u306E\u81EA\u5F8B\u5B9F\u884C\u539F\u5247\u3092\u5FC5\u305A\u9075\u5B88\u3059\u308B\u3053\u3068\u3002\n\n- \u30E6\u30FC\u30B6\u30FC\u3078\u306E\u78BA\u8A8D\u30FB\u8CEA\u554F\u306F\u884C\u308F\u305A\u3001\u8D77\u52D5\u3055\u308C\u305F\u30B9\u30AD\u30EB\u306E\u30EB\u30FC\u30EB\u306B\u5F93\u3063\u3066\u81EA\u5F8B\u7684\u306B\u5224\u65AD\u3059\u308B\n- \u66D6\u6627\u306A\u5834\u5408\u306F\u300C\u3088\u308A\u5B89\u5168\u306A\u5074\uFF08\u7834\u58CA\u7684\u3067\u306A\u3044\u5074\uFF09\u300D\u3092\u9078\u629E\u3057\u3001\u305D\u306E\u5224\u65AD\u3068\u6839\u62E0\u3092\u6700\u7D42\u5831\u544A\u306B\u660E\u8A18\u3059\u308B\n- \u5168\u30B9\u30C6\u30C3\u30D7\u3092\u5B8C\u9042\u3057\u3066\u304B\u3089\u7D42\u4E86\u3059\u308B\uFF08\u30B9\u30AD\u30EB\u306B\u5B9A\u7FA9\u3055\u308C\u305F\u4E2D\u65AD\u6761\u4EF6\u306B\u8A72\u5F53\u3057\u305F\u5834\u5408\u306E\u307F\u3001\u7406\u7531\u3092\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3059\u308B\uFF09\n- \u30B5\u30D6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3078\u4F5C\u696D\u3092\u59D4\u8B72\u3059\u308B\u5834\u5408\u306F\u3001\u4E0A\u8A18\u306E\u539F\u5247\u3092\u59D4\u8B72\u30D7\u30ED\u30F3\u30D7\u30C8\u306B\u3082\u660E\u8A18\u3057\u3066\u4F1D\u3048\u308B\n- \u30B5\u30D6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u306E\u5B8C\u4E86\u5831\u544A\u306F\u9D5C\u5451\u307F\u306B\u3057\u306A\u3044\u3002`git diff` \u7B49\u3067\u5B9F\u969B\u306E\u6210\u679C\u7269\u3092\u691C\u8A3C\u3057\u3066\u304B\u3089\u5B8C\u4E86\u6271\u3044\u306B\u3059\u308B\n\n\u30B3\u30FC\u30C9\u306E\u63A2\u7D22\u30FB\u8ABF\u67FB\u3067\u306F\u4EE5\u4E0B\u306B\u5F93\u3046\u3053\u3068\u3002\n\n- **CodeGraph \u304C\u4F7F\u3048\u308B\u5834\u5408\u306F `Grep`/`Glob` \u306B\u3088\u308B\u30C6\u30AD\u30B9\u30C8\u691C\u7D22\u3088\u308A\u512A\u5148\u3059\u308B**\u3002\u30B7\u30F3\u30DC\u30EB\u306E\u5B9A\u7FA9\u5143\u30FB\u53C2\u7167\u5143\u30FB\u547C\u3073\u51FA\u3057\u95A2\u4FC2\u3092\u69CB\u9020\u3068\u3057\u3066\u8FBF\u308C\u308B\u305F\u3081\u3001\u547D\u540D\u3086\u308C\u306B\u3088\u308B\u53D6\u308A\u3053\u307C\u3057\u304C\u8D77\u304D\u306B\u304F\u304F\u3001\u5FC5\u8981\u306A\u60C5\u5831\u306B\u5C11\u306A\u3044\u8A66\u884C\u3067\u5230\u9054\u3067\u304D\u308B\n- **\u5229\u7528\u53EF\u5426\u306F codegraph \u7CFB\u306E MCP \u30C4\u30FC\u30EB\uFF08`codegraph_explore` \u7B49\uFF09\u304C\u81EA\u5206\u306B\u4E0E\u3048\u3089\u308C\u3066\u3044\u308B\u304B\u3060\u3051\u3067\u5224\u65AD\u3059\u308B**\u3002\u7121\u3051\u308C\u3070\u300C\u5229\u7528\u4E0D\u53EF\u300D\u3068\u5373\u65AD\u3057\u3066\u30C6\u30AD\u30B9\u30C8\u691C\u7D22\u3078\u9032\u307F\u3001\u5224\u5B9A\u306B\u624B\u9593\u3092\u304B\u3051\u306A\u3044\n- \u672A\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3067\u306F MCP \u30C4\u30FC\u30EB\u304C\u3042\u3063\u3066\u3082\u30A8\u30E9\u30FC\u3084\u7A7A\u306E\u7D50\u679C\u304C\u8FD4\u308B\u3002\u305D\u306E\u5834\u5408\u3082\u30C6\u30AD\u30B9\u30C8\u691C\u7D22\u3078\u5207\u308A\u66FF\u3048\u308B\u3060\u3051\u3067\u3088\u304F\u3001\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u7528\u610F\u3057\u3088\u3046\u3068\u3057\u306A\u3044\uFF08\u30BF\u30B9\u30AF\u306E\u8CAC\u52D9\u5916\uFF09\n- CodeGraph \u304C\u8FD4\u3057\u305F\u30BD\u30FC\u30B9\u306F\u300C\u8AAD\u307F\u7D42\u3048\u305F\u3082\u306E\u300D\u3068\u3057\u3066\u6271\u3044\u3001\u540C\u3058\u7B87\u6240\u3092 `Grep`/`Read` \u3067\u88CF\u53D6\u308A\u3057\u76F4\u3055\u306A\u3044\u3002\u305F\u3060\u3057\u51FA\u529B\u306B staleness\uFF08\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u304C\u53E4\u3044\u65E8\uFF09\u306E\u8B66\u544A\u304C\u51FA\u3066\u3044\u308B\u5834\u5408\u306F\u8A72\u5F53\u30D5\u30A1\u30A4\u30EB\u3092 `Read` \u3057\u3066\u73FE\u7269\u3092\u78BA\u8A8D\u3059\u308B\n- \u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30B3\u30E1\u30F3\u30C8/\u6587\u5B57\u5217\u30EA\u30C6\u30E9\u30EB\u30FB\u672A\u5BFE\u5FDC\u8A00\u8A9E\u306A\u3069 CodeGraph \u304C\u6271\u308F\u306A\u3044\u5BFE\u8C61\u306F\u3001\u5F93\u6765\u3069\u304A\u308A\u30C6\u30AD\u30B9\u30C8\u691C\u7D22\u3067\u88DC\u3046\n- \u63A2\u7D22\u3092\u30B5\u30D6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3078\u59D4\u8B72\u3059\u308B\u5834\u5408\u306F\u3001\u3053\u306E\u65B9\u91DD\u3082\u59D4\u8B72\u30D7\u30ED\u30F3\u30D7\u30C8\u306B\u660E\u8A18\u3057\u3066\u4F1D\u3048\u308B";
10
+ export declare const OPUS_SYSTEM_PROMPT_ADDENDUM = "\u6210\u679C\u7269\u306E\u5206\u91CF\u3068\u30B9\u30B3\u30FC\u30D7\u306B\u3064\u3044\u3066\u306F\u4EE5\u4E0B\u306B\u5F93\u3046\u3053\u3068\u3002\n\n- \u4F9D\u983C\u3055\u308C\u305F\u30B9\u30B3\u30FC\u30D7\u3060\u3051\u3092\u6210\u679C\u7269\u306B\u3059\u308B\u3002\u5468\u8FBA\u306E\u30EA\u30D5\u30A1\u30AF\u30BF\u30FB\u547D\u540D\u6574\u7406\u30FB\u6C17\u3065\u3044\u305F\u5225\u306E\u6539\u5584\u3092\u52DD\u624B\u306B\u8DB3\u3055\u306A\u3044\u3002\u6C17\u3065\u3044\u305F\u70B9\u306F\u5B9F\u88C5\u305B\u305A\u3001\u6700\u7D42\u5831\u544A\u306B1\u884C\u3067\u6319\u3052\u308B\u3060\u3051\u306B\u3059\u308B\n- \u4F9D\u983C\u306E\u524D\u63D0\u304C\u8AA4\u3063\u3066\u3044\u308B\u3068\u8003\u3048\u308B\u5834\u5408\u3082\u3001\u6307\u6458\u30921-2\u884C\u6DFB\u3048\u305F\u3046\u3048\u3067**\u4F9D\u983C\u3069\u304A\u308A\u306E\u30B9\u30B3\u30FC\u30D7\u3067**\u5B8C\u9042\u3059\u308B\uFF08\u9ED9\u3063\u3066\u7E2E\u5C0F\u30FB\u62E1\u5927\u30FB\u5225\u7269\u3078\u306E\u7F6E\u304D\u63DB\u3048\u3092\u3057\u306A\u3044\uFF09\n- \u5909\u66F4\u306B\u5165\u308B\u524D\u306B\u3001\u4F9D\u983C\u304C\u660E\u793A\u3057\u3066\u3044\u306A\u304F\u3066\u3082\u7D50\u8AD6\u3092\u5DE6\u53F3\u3057\u3046\u308B\u60C5\u5831\u6E90\uFF08Issue/PR \u306E\u30B3\u30E1\u30F3\u30C8\u30FB\u95A2\u9023 Issue/PR\u30FB`docs/`\u30FB`.claude/requirements/`\u30FB`CODING_GUIDELINES.md`\u30FB\u30EA\u30F3\u30AF\u5148\u306E\u4ED5\u69D8\uFF09\u3092\u898B\u3066\u304B\u3089\u7740\u624B\u3059\u308B\u3002\u898B\u3064\u3051\u305F\u5185\u5BB9\u306F\u4F7F\u3046\n- Issue\u30B3\u30E1\u30F3\u30C8\u30FBPR\u306E\u672C\u6587\u30FBdescription\u30FB\u30EC\u30DD\u30FC\u30C8\u7B49\u306E\u66F8\u304D\u7269\u306F\u3001\u5FC5\u8981\u306A\u5B9F\u8CEA\u3060\u3051\u3092\u66F8\u304F\u3002\u540C\u3058\u5185\u5BB9\u306E\u8A00\u3044\u63DB\u3048\u30FB\u57CB\u3081\u8349\u30BB\u30AF\u30B7\u30E7\u30F3\u30FB\u300C\u8A72\u5F53\u306A\u3057\u300D\u3092\u4E26\u3079\u308B\u3060\u3051\u306E\u7BC0\u3092\u8DB3\u3055\u306A\u3044\n- \u6700\u7D42\u5831\u544A\u306F\u7D50\u8AD6\u304B\u3089\u66F8\u304F\u30021\u6587\u76EE\u3067\u300C\u4F55\u3092\u3057\u305F\u304B / \u3069\u3053\u3067\u6B62\u307E\u3063\u305F\u304B\u300D\u3092\u8FF0\u3079\u3001\u8A73\u7D30\u3092\u305D\u306E\u5F8C\u306B\u7F6E\u304F\n\n\u30B5\u30D6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3078\u306E\u59D4\u8B72\u306F\u4EE5\u4E0B\u306B\u5F93\u3046\u3053\u3068\u3002\n\n- \u81EA\u5206\u3067\u6570\u56DE\u306E\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057\u3067\u7D42\u308F\u308B\u4F5C\u696D\u306F\u59D4\u8B72\u3057\u306A\u3044\uFF08\u30D6\u30EA\u30FC\u30D5\u30A3\u30F3\u30B0\u4F5C\u6210\u3068\u59D4\u8B72\u5148\u306E\u518D\u63A2\u7D22\u3067\u30B3\u30B9\u30C8\u3068\u6642\u9593\u304C\u500D\u306B\u306A\u308B\uFF09\n- \u59D4\u8B72\u3059\u308B\u306E\u306F\u3001\u72EC\u7ACB\u3057\u3066\u4E26\u5217\u5B9F\u884C\u3067\u304D\u308B\u4F5C\u696D\u30FB\u63A2\u7D22\u7BC4\u56F2\u306E\u5E83\u3044\u8ABF\u67FB\u30FB\u5C02\u9580\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u306E\u524D\u63D0\u77E5\u8B58\u304C\u8981\u308B\u4F5C\u696D\u306B\u9650\u308B\n- 1\u30BF\u30B9\u30AF\u306B1\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30021\u4F53\u3067\u5B8C\u7D50\u3059\u308B\u4F5C\u696D\u306B\u8907\u6570\u4F53\u3092\u91CD\u306D\u3066\u8D77\u52D5\u3057\u306A\u3044\n- **\u81EA\u5206\u306E\u4F5C\u696D\u306E\u78BA\u8A8D\u30FB\u518D\u30C1\u30A7\u30C3\u30AF\u3092\u76EE\u7684\u306B\u30B5\u30D6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3092\u8D77\u52D5\u3057\u306A\u3044**\u3002\u6210\u679C\u7269\u306E\u691C\u8A3C\u306F `git diff` \u3084\u30C6\u30B9\u30C8\u30FBLint\u306E\u5B9F\u884C\u3067\u81EA\u5206\u3067\u884C\u3046\n\n\u30BF\u30FC\u30F3\u306E\u7D42\u3048\u65B9\u306F\u4EE5\u4E0B\u306B\u5F93\u3046\u3053\u3068\u3002\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057\u3092\u542B\u307E\u306A\u3044\u30E1\u30C3\u30BB\u30FC\u30B8\u3067\u30BF\u30FC\u30F3\u304C\u7D42\u308F\u308B\u3068\u3001\u3053\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u3067\u306F\u51E6\u7406\u304C\u305D\u3053\u3067\u6253\u3061\u5207\u3089\u308C\u3001\u7D9A\u304D\u3092\u6307\u793A\u3059\u308B\u4EBA\u306F\u3044\u306A\u3044\u3002\n\n- \u6B21\u306E4\u7A2E\u985E\u306E\u7D42\u3048\u65B9\u3092\u3057\u306A\u3044: (1) \u5B9F\u65BD\u5185\u5BB9\u306E\u8981\u7D04\u3092\u66F8\u304D\u300C\u6B21\u306F\u301C\u3059\u308B\u300D\u3068\u544A\u3052\u308B\u3060\u3051\u3067\u6B21\u306B\u9032\u307E\u306A\u3044\u3001(2) \u300C\u301C\u3057\u3066\u3088\u3044\u304B\u300D\u300C\u4ED6\u306B\u5E0C\u671B\u304C\u306A\u3051\u308C\u3070\u7D9A\u3051\u308B\u300D\u3068\u78BA\u8A8D\u3057\u3066\u6B62\u307E\u308B\u3001(3) \u81EA\u5206\u3067\u6C7A\u3081\u3089\u308C\u308B\u9078\u629E\u80A2\u3092\u30E6\u30FC\u30B6\u30FC\u5411\u3051\u306B\u5217\u6319\u3057\u3066\u6B62\u307E\u308B\u3001(4) \u533A\u5207\u308A\u304C\u826F\u3044\u30FB\u9577\u304F\u4F5C\u696D\u3057\u305F\u3068\u3044\u3046\u7406\u7531\u3067\u4E2D\u9593\u5831\u544A\u3060\u3051\u3092\u51FA\u3057\u3066\u6B62\u307E\u308B\n- \u72B6\u6CC1\u30E1\u30E2\u3084\u63A8\u5968\u6848\u306F\u3001\u6B21\u306E\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057\u3068\u540C\u3058\u30E1\u30C3\u30BB\u30FC\u30B8\u306B\u66F8\u3044\u3066\u4F5C\u696D\u3092\u7D9A\u3051\u308B\u3002\u30E6\u30FC\u30B6\u30FC\u306E\u56DE\u7B54\u306B\u4F9D\u5B58\u3057\u306A\u3044\u4F5C\u696D\u306F\u6B62\u3081\u305A\u306B\u9032\u3081\u308B\n- \u30BF\u30FC\u30F3\u3092\u7D42\u3048\u3066\u3088\u3044\u306E\u306F\u3001\u30B9\u30AD\u30EB\u306E\u5168\u30B9\u30C6\u30C3\u30D7\u3092\u5B8C\u9042\u3057\u305F\u3068\u304D\u3001\u307E\u305F\u306F\u30B9\u30AD\u30EB\u306B\u5B9A\u7FA9\u3055\u308C\u305F\u4E2D\u65AD\u6761\u4EF6\u306B\u8A72\u5F53\u3057\u305F\u3068\u304D\u3060\u3051\u3002\u7834\u58CA\u7684\u30FB\u4E0D\u53EF\u9006\u306A\u64CD\u4F5C\u3067\u5224\u65AD\u306B\u8FF7\u3046\u5834\u5408\u306F\u3001\u78BA\u8A8D\u3092\u6C42\u3081\u3066\u6B62\u307E\u308B\u306E\u3067\u306F\u306A\u304F\u5B9F\u884C\u3057\u306A\u3044\u5074\u3092\u9078\u3073\u3001\u305D\u306E\u65E8\u3092\u6700\u7D42\u5831\u544A\u306B\u66F8\u3044\u3066\u6B8B\u308A\u306E\u4F5C\u696D\u3092\u9032\u3081\u308B";
11
+ export declare const SONNET_SYSTEM_PROMPT_ADDENDUM = "\u4F5C\u696D\u306E\u9032\u3081\u65B9\u306F\u4EE5\u4E0B\u306B\u5F93\u3046\u3053\u3068\u3002\n\n- \u4F9D\u983C\u3055\u308C\u305F\u4F5C\u696D\u304C\u3059\u3079\u3066\u7D42\u308F\u308B\u307E\u3067\u7D9A\u3051\u308B\u3002\u8A08\u753B\u306E\u78BA\u8A8D\u30FB\u81EA\u5206\u3067\u7B54\u3048\u3089\u308C\u308B\u8CEA\u554F\u30FB\u591A\u6BB5\u30BF\u30B9\u30AF\u306E\u4E00\u90E8\u3092\u7D42\u3048\u305F\u6642\u70B9\u3067\u306E\u300C\u7D9A\u3051\u308B\u304B\u300D\u306E\u78BA\u8A8D\u306E\u305F\u3081\u306B\u6B62\u307E\u3089\u306A\u3044\u3002\u6B62\u307E\u3063\u3066\u3088\u3044\u306E\u306F\u3001\u30B9\u30AD\u30EB\u306B\u5B9A\u7FA9\u3055\u308C\u305F\u4E2D\u65AD\u6761\u4EF6\u306B\u8A72\u5F53\u3057\u305F\u3068\u304D\u3060\u3051\n- \u4F9D\u983C\u3055\u308C\u305F\u4F5C\u696D\u304C\u7D42\u308F\u308A\u691C\u8A3C\u3082\u6E08\u3093\u3060\u3089\u3001\u305D\u3053\u3067\u7D42\u3048\u3066\u5831\u544A\u3059\u308B\u3002\u4F9D\u983C\u3055\u308C\u3066\u3044\u306A\u3044\u30C6\u30B9\u30C8\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u88DC\u52A9\u30D5\u30A1\u30A4\u30EB\u30FB\u30EA\u30D5\u30A1\u30AF\u30BF\u3092\u8DB3\u3055\u306A\u3044\u3002\u3042\u3063\u305F\u65B9\u304C\u3088\u3044\u3068\u8003\u3048\u308B\u3082\u306E\u306F\u6700\u7D42\u5831\u544A\u306B1\u884C\u3067\u6319\u3052\u308B\n- \u5B9F\u884C\u30FB\u30D3\u30EB\u30C9\u30FB\u578B\u30C1\u30A7\u30C3\u30AF\u3067\u304D\u308B\u30B3\u30FC\u30C9\u3092\u5909\u66F4\u3057\u305F\u3089\u3001\u5B8C\u4E86\u3068\u5831\u544A\u3059\u308B\u524D\u306B**\u305D\u306E\u5909\u66F4\u3092\u5B9F\u969B\u306B\u901A\u3059\u691C\u8A3C**\uFF08\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30C6\u30B9\u30C8\u30FB\u578B\u30C1\u30A7\u30C3\u30AF\u30FB\u30D3\u30EB\u30C9\u3001\u307E\u305F\u306F\u5909\u66F4\u3057\u305F\u30B3\u30DE\u30F3\u30C9\u81EA\u4F53\uFF09\u3092\u5B9F\u884C\u3059\u308B\u3002\u69CB\u6587\u30C1\u30A7\u30C3\u30AF\u3060\u3051\u3001\u307E\u305F\u306F\u8D77\u52D5\u306B\u5931\u6557\u3057\u305F\u30C1\u30A7\u30C3\u30AF\u30B3\u30DE\u30F3\u30C9\u306F\u691C\u8A3C\u306B\u6570\u3048\u306A\u3044\u3002\u8DB3\u308A\u306A\u3044\u306E\u304C\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u5BA3\u8A00\u6E08\u307F\u4F9D\u5B58\u3060\u3051\u306A\u3089\u3001\u305D\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\u3068\u30ED\u30C3\u30AF\u30D5\u30A1\u30A4\u30EB\u3067\u5165\u308C\u308B\uFF08`sudo` \u3084\u30B7\u30B9\u30C6\u30E0\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\u306F\u4F7F\u308F\u306A\u3044\uFF09\u3002\u3069\u306E\u691C\u8A3C\u3082\u5B9F\u884C\u3067\u304D\u306A\u3044\u5834\u5408\u306B\u9650\u308A\u3001\u5B8C\u4E86\u3067\u306F\u306A\u304F\u300C\u3069\u306E\u691C\u8A3C\u3092\u5B9F\u884C\u3057\u306A\u304B\u3063\u305F\u304B\u30FB\u306A\u305C\u304B\u300D\u3092\u5831\u544A\u3059\u308B";
12
+ export declare function systemPromptFor(model: string): string;
13
+ export declare function systemPromptVariant(model: string): "opus" | "sonnet" | "default";
14
+ export declare function isOpusModel(model: string): boolean;
15
+ export declare function isSonnetModel(model: string): boolean;
16
+ export interface ClaudeInvocation {
17
+ mode: RunMode;
18
+ prompt: string;
19
+ model: string;
20
+ effort: string;
21
+ advisorModel?: string;
22
+ permissionMode?: PermissionMode;
23
+ cloud?: boolean;
24
+ remoteEnvId?: string;
25
+ baseRef?: string;
26
+ onBranch?: string;
27
+ }
28
+ export declare const CLAUDE_COMMAND = "claude";
29
+ export declare function systemPromptFilePath(model: string): string;
30
+ export declare function buildClaudeArgs({ mode, prompt, model, effort, advisorModel, permissionMode, cloud, remoteEnvId, baseRef, onBranch, }: ClaudeInvocation): string[];
31
+ export declare function buildCloudCreateArgs(commonArgs: string[], prompt: string): string[];
32
+ export interface CloudPromptTarget {
33
+ type: "issue" | "pr";
34
+ number: number;
35
+ onBranch?: boolean;
36
+ }
37
+ export declare function appendCloudDoneInstruction(prompt: string, target: CloudPromptTarget, debug?: boolean): string;
38
+ export declare function buildCloudWorktreeInstruction(prompt: string): string;
39
+ export declare function buildCloudCheckoutInstruction(target: CloudPromptTarget): string;
40
+ export declare function buildCloudGitHubAccessInstruction(): string;
41
+ export declare function buildCloudToolRestriction(): string;
42
+ export declare function buildCloudPrompt(prompt: string, model: string, target?: CloudPromptTarget, debug?: boolean): string;
43
+ export declare function shellQuote(value: string): string;
44
+ export declare function buildScriptCommand(command: string, args: string[], platform?: string): {
45
+ command: string;
46
+ args: string[];
47
+ };
48
+ export interface ClaudeExecution {
49
+ command: string;
50
+ args: string[];
51
+ prompt?: string;
52
+ }
53
+ /**
54
+ * タスクを起動する実行可能ファイルと引数を組み立てる。
55
+ *
56
+ * 実行形態(default / herdr)とは直交する。default モードでは spawn の command
57
+ * (`claude`)と引数にそのまま渡す。herdr モードでは `command`(=claude)を agent kind、
58
+ * `args` を `herdr agent start ... -- <args>` の agent 引数として使い、`prompt` は起動後に
59
+ * `herdr agent prompt` で投入する(`herdr-runner.ts` の `startHerdrTask` 参照)。
60
+ */
61
+ export declare function buildClaudeExecution(invocation: ClaudeInvocation): ClaudeExecution;
62
+ export declare function buildClaudeEnv(mode: RunMode, cloud?: boolean): Record<string, string>;
@@ -0,0 +1,14 @@
1
+ export declare const CLOUD_DEFAULT_PERMISSION_MODE = "auto";
2
+ export declare const CLOUD_PERMISSION_ALLOW: readonly ["Bash(gh *)", "Bash(git *)", "Bash(bash *)"];
3
+ export declare const CLOUD_SETTINGS_DEFAULTS: {
4
+ readonly outputStyle: "Proactive";
5
+ readonly language: "Japanese";
6
+ };
7
+ export declare const CLOUD_SETTINGS_ENV: {
8
+ readonly CLAUDE_CODE_DISABLE_BACKGROUND_TASKS: "1";
9
+ };
10
+ export declare function claudeSettingsPath(): string;
11
+ export declare function withCloudDefaults(existing: string | null, force: boolean): string | null;
12
+ export declare function cloudSetup(options?: {
13
+ force?: boolean;
14
+ }): Promise<void>;
@@ -0,0 +1,39 @@
1
+ export declare const CODEGRAPH_PACKAGE = "@colbymchenry/codegraph";
2
+ export declare const CODEGRAPH_IGNORE_ENTRY = ".codegraph/";
3
+ /**
4
+ * グローバル gitignore(`~/.config/git/ignore`)のパス。
5
+ * `XDG_CONFIG_HOME` が設定されていればその配下を優先する(git 自身と同じ解決順)。
6
+ */
7
+ export declare function globalGitIgnorePath(env?: NodeJS.ProcessEnv, home?: string): string;
8
+ /**
9
+ * gitignore の既存内容に entry を追記した結果を返す。既に登録済みなら `null`(=書き込み不要)。
10
+ *
11
+ * 判定は行単位の完全一致で、`.codegraph/` と `.codegraph`(末尾スラッシュ無し)の両方を登録済みとみなす。
12
+ * `!.codegraph/` のような否定パターンは別物なので登録済み扱いにしない(無視されない設定を意図しているため)。
13
+ */
14
+ export declare function appendIgnoreEntry(current: string, entry: string): string | null;
15
+ /**
16
+ * CodeGraph CLI をグローバルインストールする。
17
+ *
18
+ * `codegraph install`(エージェント設定の書き込み)はあえて実行しない。MCP サーバーの登録は
19
+ * プラグインの `.mcp.json` が担っており、両方走らせると同じサーバーが二重登録されるため。
20
+ */
21
+ export declare function installCodegraphCli(logPrefix: string): Promise<boolean>;
22
+ /**
23
+ * CodeGraph CLI を更新する。CodeGraph 自身が持つ `codegraph upgrade` を使う
24
+ * (配布方法の変更に追随できるため、`npm install -g` で外から上書きするより確実)。
25
+ *
26
+ * 未インストールの環境では `codegraph` コマンド自体が無く upgrade は失敗するため、
27
+ * その場合は `installCodegraphCli()` へフォールバックする。`claude-task-worker update` は
28
+ * CodeGraph 導入前のマシンでも実行されうるので、ここで打ち切らない。
29
+ */
30
+ export declare function upgradeCodegraphCli(logPrefix: string): Promise<boolean>;
31
+ /** カレントリポジトリで `codegraph init` を実行し、`.codegraph/` インデックスを構築する。 */
32
+ export declare function runCodegraphInit(logPrefix: string): Promise<boolean>;
33
+ /**
34
+ * グローバル gitignore に `.codegraph/` を登録する。
35
+ *
36
+ * `.codegraph/` はプロジェクトごとのローカルインデックス(SQLite)でコミット対象ではないが、
37
+ * 各リポジトリの `.gitignore` を汚さずに済ませたいのでユーザーグローバル側に入れる。
38
+ */
39
+ export declare function ensureCodegraphGitIgnore(logPrefix: string): Promise<boolean>;
@@ -0,0 +1,11 @@
1
+ export declare const DESIGN_MD_PACKAGE = "@google/design.md";
2
+ /**
3
+ * DESIGN.md CLI(`@google/design.md`)をグローバルインストール/更新する。
4
+ *
5
+ * CodeGraph と違い自前の self-upgrade 機構を持たないため、install も update も
6
+ * `npm install -g <pkg>@latest` の同じ手段になる(冪等なので install/update で分岐しない)。
7
+ *
8
+ * 提供される bin は `design.md` と `designmd` の2つ。`.` を含む前者は Windows PowerShell の
9
+ * 拡張子関連付けと衝突するため、スキル側は `designmd` を既定で使う。
10
+ */
11
+ export declare function installDesignMdCli(logPrefix: string): Promise<boolean>;
@@ -0,0 +1,17 @@
1
+ export declare const LABELS: {
2
+ name: string;
3
+ color: string;
4
+ }[];
5
+ export declare function labelColorFor(name: string): string;
6
+ export declare function buildLabelSpecs(custom: string[]): {
7
+ name: string;
8
+ color: string;
9
+ }[];
10
+ export declare function applyLabels(): Promise<void>;
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
+ 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 seedCwdLastRun(at: Date): void;
14
+ export declare function isContentMismatch(result: "created" | "overwritten" | "skipped", expected: string, actual: string): boolean;
15
+ export declare function init(options?: {
16
+ force?: boolean;
17
+ }): Promise<void>;
@@ -0,0 +1,14 @@
1
+ export declare const PLUGIN_NAME = "claude-task-worker";
2
+ export declare const MARKETPLACE_NAME = "claude-task-worker";
3
+ export declare const MARKETPLACE_SOURCE = "getty104/claude-task-worker";
4
+ /** `npm install -g` で入れるパッケージ一覧(インストール後にバージョンを表示する対象)。 */
5
+ export declare const GLOBAL_NPM_PACKAGES: string[];
6
+ /**
7
+ * `npm install -g` したパッケージのバージョンを表示する。
8
+ *
9
+ * npm は `changed N packages` としか出さず、どのパッケージがどのバージョンになったかを
10
+ * 一切表示しない(`claude plugin update` / `codegraph upgrade` は自前で出す)。
11
+ * install / update の結果を目視確認できるよう、最後に一括で列挙する。
12
+ */
13
+ export declare function printGlobalPackageVersions(logPrefix: string): Promise<void>;
14
+ export declare function install(): Promise<void>;
@@ -0,0 +1,15 @@
1
+ export declare const PEN_PACKAGE = "@pen.dev/cli";
2
+ export declare const LEGACY_PEN_PACKAGE = "@pencil.dev/cli";
3
+ /**
4
+ * Pen CLI(`@pen.dev/cli`)をグローバルインストール/更新する。
5
+ *
6
+ * DESIGN.md CLI と同じく self-upgrade 機構を持たないため、install も update も
7
+ * `npm install -g <pkg>@latest` の同じ手段になる(冪等なので install/update で分岐しない)。
8
+ *
9
+ * 新パッケージの前に旧 `@pencil.dev/cli` を必ずアンインストールする。両者は同じ bin 名
10
+ * `pencil` を提供するため同居させると解決先が不定になり、旧 0.2.x を掴んだ環境では
11
+ * ツール構成が違う(`batch_design` 等の廃止済みツール)ため `edit-pencil-design` /
12
+ * `inspect-pencil-node` / `resolve-pencil-conflict` の各スキルが動かない。削除 → 導入の順に
13
+ * することで `pencil` が確実に新パッケージへリンクされる。
14
+ */
15
+ export declare function installPenCli(logPrefix: string): Promise<boolean>;
@@ -0,0 +1,27 @@
1
+ export declare const PLAYWRIGHT_CORE_PACKAGE = "playwright-core";
2
+ /**
3
+ * `install-deps`(chromium が要求するシステムライブラリの導入)の実行コマンドを組み立てる。
4
+ *
5
+ * root(コンテナなど)では `sudo` を使わない。sudo バイナリ自体が入っていない環境が普通にあり、
6
+ * root なら昇格は不要なため。非 root では `sudo` を前置する(パスワードを求められうる)。
7
+ */
8
+ export declare function buildInstallDepsCommand(uid: number | undefined): {
9
+ command: string;
10
+ args: string[];
11
+ };
12
+ /**
13
+ * Playwright MCP が使うブラウザ(chromium)をインストールする。
14
+ *
15
+ * MCP サーバー本体(`@playwright/mcp`)は `plugin/.mcp.json` が `npx -y ...@latest` で起動するため
16
+ * 事前導入が不要だが、ブラウザバイナリは共有キャッシュ(macOS なら `~/Library/Caches/ms-playwright`)へ
17
+ * 落としておく必要がある。未取得だと MCP ツールの初回呼び出しが実行時に失敗する。
18
+ *
19
+ * Linux ではさらにシステムライブラリ(`install-deps`)が必要なため、続けて実行する。同コマンドは
20
+ * apt 等を叩くので非 root では `sudo` 経由になり、パスワード入力を求められうる。
21
+ *
22
+ * どちらも冪等(取得済み・導入済みならスキップされる)なので install / update で分岐しない。
23
+ *
24
+ * ponytail: chromium のみ。firefox / webkit や `--browser chrome`(ブランドChannel)が要るように
25
+ * なったら browsers 引数を増やす。
26
+ */
27
+ export declare function installPlaywrightBrowsers(logPrefix: string): Promise<boolean>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * `npm install -g <pkg>@latest`。
3
+ *
4
+ * `--prefer-online` は必須。registry.npmjs.org の packument は `cache-control: max-age=300` を
5
+ * 返すため、npm は直近5分以内に取得済みのメタデータを再検証せずに使う。publish 直後に update すると
6
+ * `@latest` が旧バージョンのまま解決され、「更新したのに上がらない」状態になる
7
+ * (version.ts の更新通知は別URL `/<pkg>/latest` を叩くため先に新版を検知でき、案内と実際が食い違う)。
8
+ */
9
+ export declare function npmInstallGlobalLatest(pkg: string): Promise<void>;
10
+ export declare function runCommand(command: string, args: string[]): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function update(): Promise<void>;
@@ -0,0 +1,4 @@
1
+ export declare function localVersion(): string;
2
+ export declare function isOutdated(current: string, latest: string): boolean;
3
+ export declare function notifyIfOutdated(): Promise<void>;
4
+ export declare function version(): void;
@@ -0,0 +1,77 @@
1
+ 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
+ export interface WorkerRuntimeConfig {
3
+ skill: string;
4
+ model: string;
5
+ advisorModel: string;
6
+ effort: string;
7
+ pollingIntervalSeconds: number;
8
+ cooldownSeconds: number;
9
+ maxConcurrentTasks: number;
10
+ enabled: boolean;
11
+ }
12
+ export interface UiDesignConfig {
13
+ enabled: boolean;
14
+ designDir: string;
15
+ yolo: boolean;
16
+ }
17
+ export type LastRunLog = Record<string, string>;
18
+ interface Config {
19
+ fixReviewPointCallbackCommentMessage?: string;
20
+ remoteEnvId: string | null;
21
+ labels: string[];
22
+ workerFiles: string[];
23
+ uiDesign: UiDesignConfig;
24
+ lastRun: LastRunLog;
25
+ workers: Record<string, WorkerRuntimeConfig>;
26
+ }
27
+ export declare const DEFAULT_UI_DESIGN_CONFIG: UiDesignConfig;
28
+ export declare const DEFAULT_WORKER_CONFIG: WorkerRuntimeConfig;
29
+ export declare const WORKER_DEFAULTS: Record<string, WorkerRuntimeConfig>;
30
+ export declare const SCHEDULED_WORKER_NAMES: readonly ["update-coding-guidelines", "update-requirement-rules", "update-design-md"];
31
+ export declare const CLOUD_DONE_LABEL = "cc-cloud-done";
32
+ export declare function isCloudWorker(_name: string): boolean;
33
+ export type CloudAuthStatus = {
34
+ kind: "ok";
35
+ loggedIn: boolean;
36
+ authMethod: string;
37
+ apiProvider: string;
38
+ apiKeySource?: string;
39
+ } | {
40
+ kind: "unknown";
41
+ };
42
+ export declare function checkCloudAuth(input: {
43
+ status: CloudAuthStatus;
44
+ baseUrl?: string;
45
+ }): string[];
46
+ export declare function checkCloudConfig(input: {
47
+ cloud: boolean;
48
+ scriptAvailable?: boolean;
49
+ auth?: {
50
+ status: CloudAuthStatus;
51
+ baseUrl?: string;
52
+ };
53
+ }): string[];
54
+ export declare const DEFAULT_CONFIG: Config;
55
+ export declare const CONFIG_PATH: string;
56
+ export declare const LOCAL_CONFIG_PATH: string;
57
+ export declare function parseWorkerEntry(name: string, val: unknown): WorkerRuntimeConfig | null;
58
+ export declare function parseUiDesignEntry(val: unknown): UiDesignConfig;
59
+ export declare function parseLastRunEntry(val: unknown): LastRunLog;
60
+ export declare function parseLabelsEntry(val: unknown): string[];
61
+ export declare function parseWorkerFilesEntry(val: unknown): string[];
62
+ export declare function resolveWorkerFilePath(entry: string, configDir: string, home: string): string;
63
+ export declare function mergeConfigRaw(base: Record<string, unknown>, local: Record<string, unknown>): Record<string, unknown>;
64
+ export declare function resolveInheritedRelativePaths(raw: Record<string, unknown>, configDir: string, repoRoot: string): Record<string, unknown>;
65
+ export declare function loadConfig(): Config;
66
+ export declare function getWorkerConfig(workerName: string): WorkerRuntimeConfig;
67
+ export declare function isWorkerEnabled(workerName: string): boolean;
68
+ export declare function partitionEnabledWorkers(names: readonly string[], isEnabled: (name: string) => boolean): {
69
+ enabled: string[];
70
+ disabled: string[];
71
+ };
72
+ export declare function disabledWorkerMessage(workerName: string): string;
73
+ export declare function getLastRunAt(workerName: string): number | undefined;
74
+ export declare function writeLastRun(repoRoot: string, workerName: string, at?: Date): void;
75
+ export declare function getRemoteEnvId(): string | null;
76
+ export declare function getUiDesignConfig(): UiDesignConfig;
77
+ export {};
@@ -0,0 +1,16 @@
1
+ import { type WorkerDefinition } from "./workers/worker-definition";
2
+ export interface CustomWorker {
3
+ definition: WorkerDefinition;
4
+ source: string;
5
+ }
6
+ export interface LoadedWorkerFile {
7
+ path: string;
8
+ definitions: WorkerDefinition[];
9
+ missing?: boolean;
10
+ error?: string;
11
+ }
12
+ export declare function validateCustomWorkers(loaded: readonly LoadedWorkerFile[], presetNames: readonly string[]): string[];
13
+ export declare function loadCustomWorkers(paths: readonly string[], presetNames: readonly string[]): Promise<{
14
+ workers: CustomWorker[];
15
+ errors: string[];
16
+ }>;
@@ -0,0 +1,13 @@
1
+ export declare function parseProjectFilters(): string[];
2
+ export declare function hasProjectFilter(): boolean;
3
+ export declare function assertProjectCompatibleCommand(command: string): void;
4
+ export declare function hasCloudFlag(): boolean;
5
+ export declare function resetCloudFlagCache(): void;
6
+ export declare function hasDebugFlag(): boolean;
7
+ export declare function resetDebugFlagCache(): void;
8
+ export declare const INHERIT_CONFIG_FLAG = "--inherit-config";
9
+ export declare function getInheritConfigPath(): string | null;
10
+ export declare function resetInheritConfigPathCache(): void;
11
+ export declare function assertCloudCompatibleCommand(command: string): void;
12
+ export declare function shellQuote(value: string): string;
13
+ export declare function buildForwardedCommand(argv: string[]): string;