cc-workspace 4.0.0 → 4.0.1
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/bin/cli.js +26 -11
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -203,8 +203,23 @@ function installGlobals(force) {
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
// ─── Generate settings.json with hooks ──────────────────────
|
|
206
|
+
// Claude Code hook format: { matcher: { tools: [...] }, hooks: [{ type: "command", command: "...", timeout: N }] }
|
|
207
|
+
// For hooks without tool matcher: { hooks: [{ type: "command", command: "...", timeout: N }] }
|
|
206
208
|
function generateSettings(orchDir) {
|
|
207
209
|
const hp = ".claude/hooks";
|
|
210
|
+
|
|
211
|
+
function hook(command, timeout) {
|
|
212
|
+
return { type: "command", command: `bash ${hp}/${command}`, timeout };
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function withMatcher(tools, command, timeout) {
|
|
216
|
+
return { matcher: { tools }, hooks: [hook(command, timeout)] };
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function withoutMatcher(command, timeout) {
|
|
220
|
+
return { hooks: [hook(command, timeout)] };
|
|
221
|
+
}
|
|
222
|
+
|
|
208
223
|
const settings = {
|
|
209
224
|
env: {
|
|
210
225
|
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: "1",
|
|
@@ -212,35 +227,35 @@ function generateSettings(orchDir) {
|
|
|
212
227
|
},
|
|
213
228
|
hooks: {
|
|
214
229
|
PreToolUse: [
|
|
215
|
-
|
|
216
|
-
|
|
230
|
+
withMatcher(["Write", "Edit", "MultiEdit"], "block-orchestrator-writes.sh", 5),
|
|
231
|
+
withMatcher(["Teammate"], "validate-spawn-prompt.sh", 5)
|
|
217
232
|
],
|
|
218
233
|
SessionStart: [
|
|
219
|
-
|
|
234
|
+
withoutMatcher("session-start-context.sh", 10)
|
|
220
235
|
],
|
|
221
236
|
UserPromptSubmit: [
|
|
222
|
-
|
|
237
|
+
withoutMatcher("user-prompt-guard.sh", 3)
|
|
223
238
|
],
|
|
224
239
|
SubagentStart: [
|
|
225
|
-
|
|
240
|
+
withoutMatcher("subagent-start-context.sh", 5)
|
|
226
241
|
],
|
|
227
242
|
PermissionRequest: [
|
|
228
|
-
|
|
243
|
+
withoutMatcher("permission-auto-approve.sh", 3)
|
|
229
244
|
],
|
|
230
245
|
PostToolUse: [
|
|
231
|
-
|
|
246
|
+
withMatcher(["Write", "Edit", "MultiEdit"], "track-file-modifications.sh", 3)
|
|
232
247
|
],
|
|
233
248
|
TeammateIdle: [
|
|
234
|
-
|
|
249
|
+
withoutMatcher("teammate-idle-check.sh", 5)
|
|
235
250
|
],
|
|
236
251
|
TaskCompleted: [
|
|
237
|
-
|
|
252
|
+
withoutMatcher("task-completed-check.sh", 3)
|
|
238
253
|
],
|
|
239
254
|
WorktreeCreate: [
|
|
240
|
-
|
|
255
|
+
withoutMatcher("worktree-create-context.sh", 3)
|
|
241
256
|
],
|
|
242
257
|
Notification: [
|
|
243
|
-
|
|
258
|
+
withoutMatcher("notify-user.sh", 5)
|
|
244
259
|
]
|
|
245
260
|
}
|
|
246
261
|
};
|
package/package.json
CHANGED