@hailer/mcp 1.0.29 → 1.1.2

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 (233) hide show
  1. package/.claude/.session-checked +1 -0
  2. package/.claude/agents/agent-ada-skill-builder.md +10 -2
  3. package/.claude/agents/agent-alejandro-function-fields.md +104 -37
  4. package/.claude/agents/agent-bjorn-config-audit.md +41 -21
  5. package/.claude/agents/agent-builder-agent-creator.md +13 -3
  6. package/.claude/agents/agent-code-simplifier.md +53 -0
  7. package/.claude/agents/agent-dmitri-activity-crud.md +126 -11
  8. package/.claude/agents/agent-giuseppe-app-builder.md +212 -22
  9. package/.claude/agents/agent-gunther-mcp-tools.md +7 -36
  10. package/.claude/agents/agent-helga-workflow-config.md +75 -10
  11. package/.claude/agents/agent-igor-activity-mover-automation.md +125 -0
  12. package/.claude/agents/agent-ingrid-doc-templates.md +164 -36
  13. package/.claude/agents/agent-ivan-monolith.md +154 -0
  14. package/.claude/agents/agent-kenji-data-reader.md +15 -8
  15. package/.claude/agents/agent-lars-code-inspector.md +56 -8
  16. package/.claude/agents/agent-marco-mockup-builder.md +110 -0
  17. package/.claude/agents/agent-marcus-api-documenter.md +323 -0
  18. package/.claude/agents/agent-marketplace-publisher.md +232 -72
  19. package/.claude/agents/agent-marketplace-reviewer.md +255 -79
  20. package/.claude/agents/agent-permissions-handler.md +208 -0
  21. package/.claude/agents/agent-simple-writer.md +48 -0
  22. package/.claude/agents/agent-svetlana-code-review.md +127 -14
  23. package/.claude/agents/agent-tanya-test-runner.md +333 -0
  24. package/.claude/agents/agent-ui-designer.md +100 -0
  25. package/.claude/agents/agent-viktor-sql-insights.md +19 -6
  26. package/.claude/agents/agent-web-search.md +55 -0
  27. package/.claude/agents/agent-yevgeni-discussions.md +7 -1
  28. package/.claude/agents/agent-zara-zapier.md +159 -0
  29. package/.claude/commands/app-squad.md +135 -0
  30. package/.claude/commands/audit-squad.md +158 -0
  31. package/.claude/commands/autoplan.md +563 -0
  32. package/.claude/commands/cleanup-squad.md +98 -0
  33. package/.claude/commands/config-squad.md +106 -0
  34. package/.claude/commands/crud-squad.md +87 -0
  35. package/.claude/commands/data-squad.md +97 -0
  36. package/.claude/commands/debug-squad.md +303 -0
  37. package/.claude/commands/doc-squad.md +65 -0
  38. package/.claude/commands/handoff.md +137 -0
  39. package/.claude/commands/health.md +49 -0
  40. package/.claude/commands/help.md +2 -1
  41. package/.claude/commands/help:agents.md +96 -16
  42. package/.claude/commands/help:commands.md +55 -11
  43. package/.claude/commands/help:faq.md +16 -1
  44. package/.claude/commands/help:skills.md +93 -0
  45. package/.claude/commands/hotfix-squad.md +112 -0
  46. package/.claude/commands/integration-squad.md +82 -0
  47. package/.claude/commands/janitor-squad.md +167 -0
  48. package/.claude/commands/learn-auto.md +120 -0
  49. package/.claude/commands/learn.md +120 -0
  50. package/.claude/commands/mcp-list.md +27 -0
  51. package/.claude/commands/onboard-squad.md +140 -0
  52. package/.claude/commands/plan-workspace.md +732 -0
  53. package/.claude/commands/prd.md +131 -0
  54. package/.claude/commands/project-status.md +82 -0
  55. package/.claude/commands/publish.md +138 -0
  56. package/.claude/commands/recap.md +69 -0
  57. package/.claude/commands/restore.md +64 -0
  58. package/.claude/commands/review-squad.md +152 -0
  59. package/.claude/commands/save.md +24 -0
  60. package/.claude/commands/stats.md +19 -0
  61. package/.claude/commands/swarm.md +210 -0
  62. package/.claude/commands/tool-builder.md +3 -1
  63. package/.claude/commands/ws-pull.md +1 -1
  64. package/.claude/commands/yolo-off.md +17 -0
  65. package/.claude/commands/yolo.md +82 -0
  66. package/.claude/hooks/_shared-memory.cjs +305 -0
  67. package/.claude/hooks/_utils.cjs +134 -0
  68. package/.claude/hooks/agent-failure-detector.cjs +164 -79
  69. package/.claude/hooks/agent-usage-logger.cjs +204 -0
  70. package/.claude/hooks/app-edit-guard.cjs +20 -4
  71. package/.claude/hooks/auto-learn.cjs +316 -0
  72. package/.claude/hooks/bash-guard.cjs +282 -0
  73. package/.claude/hooks/builder-mode-manager.cjs +183 -54
  74. package/.claude/hooks/bulk-activity-guard.cjs +283 -0
  75. package/.claude/hooks/context-watchdog.cjs +292 -0
  76. package/.claude/hooks/delegation-reminder.cjs +478 -0
  77. package/.claude/hooks/design-system-lint.cjs +283 -0
  78. package/.claude/hooks/post-scaffold-hook.cjs +16 -3
  79. package/.claude/hooks/prompt-guard.cjs +366 -0
  80. package/.claude/hooks/publish-template-guard.cjs +16 -0
  81. package/.claude/hooks/session-start.cjs +35 -0
  82. package/.claude/hooks/shared-memory-writer.cjs +147 -0
  83. package/.claude/hooks/skill-injector.cjs +140 -0
  84. package/.claude/hooks/skill-usage-logger.cjs +258 -0
  85. package/.claude/hooks/src-edit-guard.cjs +16 -1
  86. package/.claude/hooks/sync-marketplace-agents.cjs +53 -8
  87. package/.claude/scripts/yolo-toggle.cjs +142 -0
  88. package/.claude/settings.json +141 -14
  89. package/.claude/skills/SDK-activity-patterns/SKILL.md +428 -0
  90. package/.claude/skills/SDK-document-templates/SKILL.md +1033 -0
  91. package/.claude/skills/SDK-function-fields/SKILL.md +542 -0
  92. package/.claude/skills/SDK-generate-skill/SKILL.md +92 -0
  93. package/.claude/skills/SDK-init-skill/SKILL.md +127 -0
  94. package/.claude/skills/SDK-insight-queries/SKILL.md +787 -0
  95. package/.claude/skills/SDK-ws-config-skill/SKILL.md +1139 -0
  96. package/.claude/skills/agent-structure/SKILL.md +98 -0
  97. package/.claude/skills/api-documentation-patterns/SKILL.md +474 -0
  98. package/.claude/skills/chrome-mcp-reference/SKILL.md +370 -0
  99. package/.claude/skills/delegation-routing/SKILL.md +202 -0
  100. package/.claude/skills/frontend-design/SKILL.md +254 -0
  101. package/.claude/skills/hailer-activity-mover/SKILL.md +213 -0
  102. package/.claude/skills/hailer-api-client/SKILL.md +518 -0
  103. package/.claude/skills/hailer-app-builder/SKILL.md +939 -11
  104. package/.claude/skills/hailer-apps-pictures/SKILL.md +269 -0
  105. package/.claude/skills/hailer-design-system/SKILL.md +235 -0
  106. package/.claude/skills/hailer-monolith-automations/SKILL.md +686 -0
  107. package/.claude/skills/hailer-permissions-system/SKILL.md +121 -0
  108. package/.claude/skills/hailer-project-protocol/SKILL.md +488 -0
  109. package/.claude/skills/hailer-rest-api/SKILL.md +61 -0
  110. package/.claude/skills/hailer-rest-api/hailer-activities.md +184 -0
  111. package/.claude/skills/hailer-rest-api/hailer-admin.md +473 -0
  112. package/.claude/skills/hailer-rest-api/hailer-calendar.md +256 -0
  113. package/.claude/skills/hailer-rest-api/hailer-feed.md +249 -0
  114. package/.claude/skills/hailer-rest-api/hailer-insights.md +195 -0
  115. package/.claude/skills/hailer-rest-api/hailer-messaging.md +276 -0
  116. package/.claude/skills/hailer-rest-api/hailer-workflows.md +283 -0
  117. package/.claude/skills/insight-join-patterns/SKILL.md +3 -0
  118. package/.claude/skills/integration-patterns/SKILL.md +421 -0
  119. package/.claude/skills/json-only-output/SKILL.md +52 -12
  120. package/.claude/skills/lsp-setup/SKILL.md +160 -0
  121. package/.claude/skills/mcp-direct-tools/SKILL.md +153 -0
  122. package/.claude/skills/optional-parameters/SKILL.md +32 -23
  123. package/.claude/skills/publish-hailer-app/SKILL.md +76 -12
  124. package/.claude/skills/testing-patterns/SKILL.md +630 -0
  125. package/.claude/skills/tool-builder/SKILL.md +250 -0
  126. package/.claude/skills/tool-parameter-usage/SKILL.md +59 -45
  127. package/.claude/skills/tool-response-verification/SKILL.md +82 -48
  128. package/.claude/skills/zapier-hailer-patterns/SKILL.md +581 -0
  129. package/.env.example +26 -7
  130. package/CLAUDE.md +290 -224
  131. package/dist/CLAUDE.md +370 -0
  132. package/dist/app.d.ts +1 -1
  133. package/dist/app.js +101 -101
  134. package/dist/bot/bot-config.d.ts +26 -0
  135. package/dist/bot/bot-config.js +135 -0
  136. package/dist/bot/bot-manager.d.ts +40 -0
  137. package/dist/bot/bot-manager.js +137 -0
  138. package/dist/bot/bot.d.ts +127 -0
  139. package/dist/bot/bot.js +1328 -0
  140. package/dist/bot/operation-logger.d.ts +28 -0
  141. package/dist/bot/operation-logger.js +132 -0
  142. package/dist/bot/services/conversation-manager.d.ts +60 -0
  143. package/dist/bot/services/conversation-manager.js +246 -0
  144. package/dist/bot/services/index.d.ts +9 -0
  145. package/dist/bot/services/index.js +18 -0
  146. package/dist/bot/services/message-classifier.d.ts +42 -0
  147. package/dist/bot/services/message-classifier.js +228 -0
  148. package/dist/bot/services/message-formatter.d.ts +88 -0
  149. package/dist/bot/services/message-formatter.js +411 -0
  150. package/dist/bot/services/session-logger.d.ts +162 -0
  151. package/dist/bot/services/session-logger.js +724 -0
  152. package/dist/bot/services/token-billing.d.ts +78 -0
  153. package/dist/bot/services/token-billing.js +233 -0
  154. package/dist/bot/services/types.d.ts +169 -0
  155. package/dist/bot/services/types.js +12 -0
  156. package/dist/bot/services/typing-indicator.d.ts +23 -0
  157. package/dist/bot/services/typing-indicator.js +60 -0
  158. package/dist/bot/services/workspace-schema-cache.d.ts +122 -0
  159. package/dist/bot/services/workspace-schema-cache.js +506 -0
  160. package/dist/bot/tool-executor.d.ts +28 -0
  161. package/dist/bot/tool-executor.js +48 -0
  162. package/dist/bot/workspace-overview.d.ts +12 -0
  163. package/dist/bot/workspace-overview.js +94 -0
  164. package/dist/cli.d.ts +1 -8
  165. package/dist/cli.js +1 -253
  166. package/dist/config.d.ts +96 -3
  167. package/dist/config.js +148 -37
  168. package/dist/core.d.ts +5 -0
  169. package/dist/core.js +61 -8
  170. package/dist/lib/discussion-lock.d.ts +42 -0
  171. package/dist/lib/discussion-lock.js +110 -0
  172. package/dist/lib/logger.d.ts +0 -1
  173. package/dist/lib/logger.js +39 -23
  174. package/dist/lib/request-logger.d.ts +77 -0
  175. package/dist/lib/request-logger.js +147 -0
  176. package/dist/mcp/UserContextCache.js +16 -13
  177. package/dist/mcp/hailer-clients.js +18 -17
  178. package/dist/mcp/signal-handler.js +29 -13
  179. package/dist/mcp/tool-registry.d.ts +4 -15
  180. package/dist/mcp/tool-registry.js +94 -32
  181. package/dist/mcp/tools/activity.js +28 -69
  182. package/dist/mcp/tools/app-core.js +9 -4
  183. package/dist/mcp/tools/app-marketplace.js +22 -12
  184. package/dist/mcp/tools/app-member.js +5 -2
  185. package/dist/mcp/tools/app-scaffold.js +32 -18
  186. package/dist/mcp/tools/bot-config/constants.d.ts +23 -0
  187. package/dist/mcp/tools/bot-config/constants.js +94 -0
  188. package/dist/mcp/tools/bot-config/core.d.ts +253 -0
  189. package/dist/mcp/tools/bot-config/core.js +2456 -0
  190. package/dist/mcp/tools/bot-config/index.d.ts +10 -0
  191. package/dist/mcp/tools/bot-config/index.js +59 -0
  192. package/dist/mcp/tools/bot-config/tools.d.ts +7 -0
  193. package/dist/mcp/tools/bot-config/tools.js +15 -0
  194. package/dist/mcp/tools/bot-config/types.d.ts +50 -0
  195. package/dist/mcp/tools/bot-config/types.js +6 -0
  196. package/dist/mcp/tools/discussion.js +107 -77
  197. package/dist/mcp/tools/document.d.ts +11 -0
  198. package/dist/mcp/tools/document.js +741 -0
  199. package/dist/mcp/tools/file.js +5 -2
  200. package/dist/mcp/tools/insight.js +36 -12
  201. package/dist/mcp/tools/investigate.d.ts +9 -0
  202. package/dist/mcp/tools/investigate.js +254 -0
  203. package/dist/mcp/tools/user.d.ts +2 -4
  204. package/dist/mcp/tools/user.js +9 -50
  205. package/dist/mcp/tools/workflow.d.ts +1 -0
  206. package/dist/mcp/tools/workflow.js +164 -52
  207. package/dist/mcp/utils/hailer-api-client.js +26 -17
  208. package/dist/mcp/webhook-handler.d.ts +64 -3
  209. package/dist/mcp/webhook-handler.js +219 -9
  210. package/dist/mcp-server.d.ts +4 -0
  211. package/dist/mcp-server.js +237 -25
  212. package/dist/plugins/bug-fixer/index.d.ts +2 -0
  213. package/dist/plugins/bug-fixer/index.js +18 -0
  214. package/dist/plugins/bug-fixer/tools.d.ts +45 -0
  215. package/dist/plugins/bug-fixer/tools.js +1096 -0
  216. package/package.json +10 -10
  217. package/scripts/test-hal-tools.ts +154 -0
  218. package/.claude/agents/agent-nora-name-functions.md +0 -123
  219. package/.claude/assistant-knowledge.md +0 -23
  220. package/.claude/commands/install-plugin.md +0 -261
  221. package/.claude/commands/list-plugins.md +0 -42
  222. package/.claude/commands/marketplace-setup.md +0 -33
  223. package/.claude/commands/publish-plugin.md +0 -55
  224. package/.claude/commands/uninstall-plugin.md +0 -87
  225. package/.claude/hooks/interactive-mode.cjs +0 -87
  226. package/.claude/hooks/mcp-server-guard.cjs +0 -108
  227. package/.claude/skills/marketplace-publishing.md +0 -155
  228. package/dist/bot/chat-bot.d.ts +0 -31
  229. package/dist/bot/chat-bot.js +0 -357
  230. package/dist/mcp/tools/metrics.d.ts +0 -13
  231. package/dist/mcp/tools/metrics.js +0 -546
  232. package/dist/stdio-server.d.ts +0 -14
  233. package/dist/stdio-server.js +0 -114
@@ -1,8 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
+ * <hook-name>sync-marketplace-agents</hook-name>
4
+ * <purpose>Watches installed_plugins.json for changes and updates CLAUDE.md with available marketplace agents</purpose>
5
+ * <triggers>PostToolUse</triggers>
6
+ *
3
7
  * Sync Marketplace Agents Hook
4
- * Watches installed_plugins.json for changes and updates CLAUDE.md
5
- * with available marketplace agents when plugins are installed/uninstalled.
6
8
  */
7
9
 
8
10
  const fs = require('fs');
@@ -10,6 +12,20 @@ const path = require('path');
10
12
  const os = require('os');
11
13
  const crypto = require('crypto');
12
14
 
15
+ const ALLOW = JSON.stringify({ decision: 'allow' });
16
+
17
+ // Skip in yolo mode
18
+ try {
19
+ const statePath = path.join(process.env.CLAUDE_PROJECT_DIR || process.cwd(), '.claude', 'yolo-state.json');
20
+ const state = JSON.parse(fs.readFileSync(statePath, 'utf8'));
21
+ if (state.mode === 'yolo') { console.log(ALLOW); process.exit(0); }
22
+ } catch (e) {
23
+ // ENOENT is expected when not in yolo mode - only warn on unexpected errors
24
+ if (e.code !== 'ENOENT' && !e.message.includes('Unexpected')) {
25
+ console.error(`[sync-marketplace-agents] Warning: ${e.message}`);
26
+ }
27
+ }
28
+
13
29
  const PLUGINS_DIR = path.join(os.homedir(), '.claude', 'plugins', 'marketplaces');
14
30
  const INSTALLED_PLUGINS = path.join(os.homedir(), '.claude', 'plugins', 'installed_plugins.json');
15
31
  const PROJECT_DIR = process.env.CLAUDE_PROJECT_DIR || process.cwd();
@@ -79,6 +95,7 @@ function getInstalledPlugins() {
79
95
  }
80
96
  } catch (e) {
81
97
  // Ignore parse errors
98
+ console.error(`[sync-marketplace-agents] Warning: ${e.message}`);
82
99
  }
83
100
 
84
101
  return plugins;
@@ -222,6 +239,7 @@ function parseFrontmatter(content) {
222
239
 
223
240
  for (const line of lines) {
224
241
  const colonIndex = line.indexOf(':');
242
+ if (colonIndex <= 0 || line.startsWith(' ') || line.startsWith('\t')) continue; // skip indented/malformed lines
225
243
  if (colonIndex > 0) {
226
244
  const key = line.slice(0, colonIndex).trim();
227
245
  let value = line.slice(colonIndex + 1).trim();
@@ -267,16 +285,40 @@ function updateClaudeMd(agents) {
267
285
 
268
286
  const agentTable = generateAgentTable(agents);
269
287
 
270
- // Find and update plugin-marketplace section
271
- const sectionRegex = /(<plugin-marketplace>[\s\S]*?)(No marketplace agents installed\.|(\| Agent \|[\s\S]*?\n)(?=\n\*\*|<\/plugin-marketplace>))/;
288
+ // Find config-source section boundaries using indexOf
289
+ const sectionStart = content.indexOf('<config-source>');
290
+ const sectionEnd = content.indexOf('</config-source>');
291
+
292
+ if (sectionStart !== -1 && sectionEnd !== -1) {
293
+ // Find where table content starts (after section opening and any intro text)
294
+ const tableStart = content.indexOf('| Agent |', sectionStart);
295
+ const noAgentsMarker = content.indexOf('No marketplace agents installed.', sectionStart);
296
+
297
+ let replaceStart, replaceEnd;
298
+
299
+ if (tableStart !== -1 && tableStart < sectionEnd) {
300
+ // Table exists, replace from table start to section end
301
+ replaceStart = tableStart;
302
+ replaceEnd = sectionEnd;
303
+ } else if (noAgentsMarker !== -1 && noAgentsMarker < sectionEnd) {
304
+ // "No agents" text exists, replace it
305
+ replaceStart = noAgentsMarker;
306
+ replaceEnd = noAgentsMarker + 'No marketplace agents installed.'.length;
307
+ } else {
308
+ // No table or marker, insert after section opening
309
+ replaceStart = content.indexOf('\n', sectionStart) + 1;
310
+ replaceEnd = replaceStart;
311
+ }
312
+
313
+ const before = content.substring(0, replaceStart);
314
+ const after = content.substring(replaceEnd);
315
+ content = before + agentTable + '\n\n' + after;
272
316
 
273
- if (sectionRegex.test(content)) {
274
- content = content.replace(sectionRegex, `$1${agentTable}\n`);
275
317
  fs.writeFileSync(CLAUDE_MD, content);
276
318
  return { updated: true, count: agents.length };
277
319
  }
278
320
 
279
- return { updated: false, reason: 'plugin-marketplace section not found' };
321
+ return { updated: false, reason: 'config-source section not found' };
280
322
  }
281
323
 
282
324
  /**
@@ -285,6 +327,7 @@ function updateClaudeMd(agents) {
285
327
  function main() {
286
328
  // Skip if installed_plugins.json hasn't changed
287
329
  if (!pluginsChanged()) {
330
+ console.log(ALLOW);
288
331
  process.exit(0);
289
332
  }
290
333
 
@@ -305,9 +348,11 @@ function main() {
305
348
  console.error(`[sync-agents] Updated CLAUDE.md`);
306
349
  }
307
350
 
351
+ console.log(ALLOW);
308
352
  process.exit(0);
309
353
  } catch (error) {
310
- console.error(`[sync-agents] Error: ${error.message}`);
354
+ console.error(`[sync-marketplace-agents] Warning: ${error.message}`);
355
+ console.log(ALLOW);
311
356
  process.exit(0); // Don't block on errors
312
357
  }
313
358
  }
@@ -0,0 +1,142 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Yolo Mode Toggle
4
+ *
5
+ * Enables/disables autonomous mode:
6
+ * 1. Adds broad permissions to PROJECT .claude/settings.json (scoped to this project)
7
+ * 2. Creates .claude/yolo-state.json (hooks read this for delegation enforcement)
8
+ *
9
+ * In yolo mode:
10
+ * - Agents get full permissions (no prompts) - project-scoped
11
+ * - Orchestrator is FORCED to delegate by delegation-reminder hook
12
+ * - Push commands still require confirmation (safety hooks)
13
+ * - Other Claude Code sessions are NOT affected (project-scoped, not global)
14
+ *
15
+ * Usage:
16
+ * node yolo-toggle.cjs on
17
+ * node yolo-toggle.cjs off
18
+ */
19
+
20
+ const fs = require('fs');
21
+ const path = require('path');
22
+
23
+ const action = process.argv[2];
24
+
25
+ if (!['on', 'off'].includes(action)) {
26
+ console.log('Usage: node yolo-toggle.cjs on|off');
27
+ process.exit(1);
28
+ }
29
+
30
+ // Find project root (where .claude folder is)
31
+ let projectRoot = process.env.CLAUDE_PROJECT_DIR || process.cwd();
32
+ while (projectRoot !== '/' && !fs.existsSync(path.join(projectRoot, '.claude'))) {
33
+ projectRoot = path.dirname(projectRoot);
34
+ }
35
+
36
+ const settingsPath = path.join(projectRoot, '.claude', 'settings.json');
37
+ const yoloStatePath = path.join(projectRoot, '.claude', 'yolo-state.json');
38
+
39
+ // Broad permissions added in yolo mode (project-scoped)
40
+ const YOLO_PERMISSIONS = [
41
+ "Bash(*)",
42
+ "Edit(*)",
43
+ "Write(*)",
44
+ "Read(*)",
45
+ "Glob(*)",
46
+ "Grep(*)",
47
+ "WebFetch(*)",
48
+ "WebSearch(*)",
49
+ "Task(*)",
50
+ "mcp__hailer__*"
51
+ ];
52
+
53
+ function readJson(filePath) {
54
+ try {
55
+ return JSON.parse(fs.readFileSync(filePath, 'utf8'));
56
+ } catch {
57
+ return {};
58
+ }
59
+ }
60
+
61
+ function writeJson(filePath, data) {
62
+ fs.writeFileSync(filePath, JSON.stringify(data, null, 2) + '\n');
63
+ }
64
+
65
+ function enableYolo() {
66
+ // Check if already enabled
67
+ try {
68
+ const state = readJson(yoloStatePath);
69
+ if (state.mode === 'yolo') {
70
+ console.log('Yolo mode is already enabled.');
71
+ return;
72
+ }
73
+ } catch {}
74
+
75
+ // 1. Add broad permissions to project settings
76
+ const settings = readJson(settingsPath);
77
+ if (!settings.permissions) settings.permissions = {};
78
+ if (!settings.permissions.allow) settings.permissions.allow = [];
79
+
80
+ for (const perm of YOLO_PERMISSIONS) {
81
+ if (!settings.permissions.allow.includes(perm)) {
82
+ settings.permissions.allow.push(perm);
83
+ }
84
+ }
85
+ writeJson(settingsPath, settings);
86
+
87
+ // 2. Create yolo state (hooks read this for delegation enforcement)
88
+ writeJson(yoloStatePath, {
89
+ mode: 'yolo',
90
+ enabled: new Date().toISOString(),
91
+ permissions: YOLO_PERMISSIONS,
92
+ });
93
+
94
+ console.log('✓ Yolo mode ENABLED');
95
+ console.log(' - Broad permissions added to project .claude/settings.json');
96
+ console.log(' - Agents get full permissions (no prompts)');
97
+ console.log(' - Orchestrator must delegate (hooks enforce)');
98
+ console.log(' - Push commands still require confirmation');
99
+ console.log(' - Other sessions NOT affected (project-scoped)');
100
+ }
101
+
102
+ function disableYolo() {
103
+ // Check if enabled
104
+ let state;
105
+ try {
106
+ state = readJson(yoloStatePath);
107
+ if (state.mode !== 'yolo') {
108
+ console.log('Yolo mode is not enabled.');
109
+ return;
110
+ }
111
+ } catch {
112
+ console.log('Yolo mode is not enabled.');
113
+ return;
114
+ }
115
+
116
+ // 1. Remove yolo permissions from project settings
117
+ const permsToRemove = state.permissions || YOLO_PERMISSIONS;
118
+ const settings = readJson(settingsPath);
119
+ if (settings.permissions && settings.permissions.allow) {
120
+ settings.permissions.allow = settings.permissions.allow.filter(p => !permsToRemove.includes(p));
121
+ if (settings.permissions.allow.length === 0) {
122
+ delete settings.permissions.allow;
123
+ }
124
+ }
125
+ writeJson(settingsPath, settings);
126
+
127
+ // 2. Update yolo state
128
+ writeJson(yoloStatePath, {
129
+ mode: 'off',
130
+ disabled: new Date().toISOString(),
131
+ });
132
+
133
+ console.log('✓ Yolo mode DISABLED');
134
+ console.log(' - Yolo permissions removed from project settings');
135
+ console.log(' - Normal permission prompts restored');
136
+ }
137
+
138
+ if (action === 'on') {
139
+ enableYolo();
140
+ } else {
141
+ disableYolo();
142
+ }
@@ -12,17 +12,25 @@
12
12
  ]
13
13
  },
14
14
  "hooks": {
15
- "UserPromptSubmit": [
15
+ "SessionStart": [
16
16
  {
17
+ "matcher": "",
17
18
  "hooks": [
18
19
  {
19
20
  "type": "command",
20
- "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/interactive-mode.cjs\"",
21
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.cjs\"",
21
22
  "timeout": 5
22
- },
23
+ }
24
+ ]
25
+ }
26
+ ],
27
+ "UserPromptSubmit": [
28
+ {
29
+ "matcher": "",
30
+ "hooks": [
23
31
  {
24
32
  "type": "command",
25
- "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/sync-marketplace-agents.cjs\"",
33
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/prompt-guard.cjs\"",
26
34
  "timeout": 5
27
35
  }
28
36
  ]
@@ -44,7 +52,17 @@
44
52
  "hooks": [
45
53
  {
46
54
  "type": "command",
47
- "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/mcp-server-guard.cjs\"",
55
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/bash-guard.cjs\"",
56
+ "timeout": 5
57
+ }
58
+ ]
59
+ },
60
+ {
61
+ "matcher": "mcp__hailer__create_activity",
62
+ "hooks": [
63
+ {
64
+ "type": "command",
65
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/bulk-activity-guard.cjs\"",
48
66
  "timeout": 5
49
67
  }
50
68
  ]
@@ -88,6 +106,26 @@
88
106
  "timeout": 5
89
107
  }
90
108
  ]
109
+ },
110
+ {
111
+ "matcher": "Read",
112
+ "hooks": [
113
+ {
114
+ "type": "command",
115
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/delegation-reminder.cjs\"",
116
+ "timeout": 5
117
+ }
118
+ ]
119
+ },
120
+ {
121
+ "matcher": "mcp__hailer__",
122
+ "hooks": [
123
+ {
124
+ "type": "command",
125
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/delegation-reminder.cjs\"",
126
+ "timeout": 5
127
+ }
128
+ ]
91
129
  }
92
130
  ],
93
131
  "PostToolUse": [
@@ -112,19 +150,108 @@
112
150
  {
113
151
  "type": "command",
114
152
  "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/agent-failure-detector.cjs\"",
153
+ "timeout": 5,
154
+ "async": true
155
+ },
156
+ {
157
+ "type": "command",
158
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/auto-learn.cjs\"",
159
+ "timeout": 5,
160
+ "async": true
161
+ },
162
+ {
163
+ "type": "command",
164
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/agent-usage-logger.cjs\"",
165
+ "timeout": 5,
166
+ "async": true
167
+ },
168
+ {
169
+ "type": "command",
170
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/context-watchdog.cjs\"",
171
+ "timeout": 5
172
+ },
173
+ {
174
+ "type": "command",
175
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/shared-memory-writer.cjs\"",
176
+ "timeout": 5,
177
+ "async": true
178
+ },
179
+ {
180
+ "type": "command",
181
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/sync-marketplace-agents.cjs\"",
182
+ "timeout": 5,
183
+ "async": true
184
+ }
185
+ ]
186
+ },
187
+ {
188
+ "matcher": "Write",
189
+ "hooks": [
190
+ {
191
+ "type": "command",
192
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/design-system-lint.cjs\"",
193
+ "timeout": 5
194
+ }
195
+ ]
196
+ },
197
+ {
198
+ "matcher": "Edit",
199
+ "hooks": [
200
+ {
201
+ "type": "command",
202
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/design-system-lint.cjs\"",
203
+ "timeout": 5
204
+ }
205
+ ]
206
+ },
207
+ {
208
+ "matcher": "Skill",
209
+ "hooks": [
210
+ {
211
+ "type": "command",
212
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/skill-usage-logger.cjs\"",
213
+ "timeout": 5,
214
+ "async": true
215
+ }
216
+ ]
217
+ }
218
+ ],
219
+ "PreCompact": [
220
+ {
221
+ "matcher": "auto",
222
+ "hooks": [
223
+ {
224
+ "type": "command",
225
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/context-watchdog.cjs\"",
226
+ "timeout": 5
227
+ }
228
+ ]
229
+ }
230
+ ],
231
+ "SubagentStart": [
232
+ {
233
+ "matcher": "",
234
+ "hooks": [
235
+ {
236
+ "type": "command",
237
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/skill-injector.cjs\"",
238
+ "timeout": 10
239
+ }
240
+ ]
241
+ }
242
+ ],
243
+ "Stop": [
244
+ {
245
+ "matcher": "",
246
+ "hooks": [
247
+ {
248
+ "type": "command",
249
+ "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/context-watchdog.cjs\"",
115
250
  "timeout": 5
116
251
  }
117
252
  ]
118
253
  }
119
254
  ]
120
255
  },
121
- "enabledPlugins": {},
122
- "extraKnownMarketplaces": {
123
- "hailer-mcp-marketplace": {
124
- "source": {
125
- "source": "git",
126
- "url": "git@gitlab.com:hailer-repos/hailer-mcp-marketplace.git"
127
- }
128
- }
129
- }
256
+ "enabledPlugins": {}
130
257
  }