@pennyfarthing/cyclist 10.4.0 → 11.0.0-alpha.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 (270) hide show
  1. package/dist/api/agent-load.d.ts +1 -2
  2. package/dist/api/agent-load.d.ts.map +1 -1
  3. package/dist/api/agent-load.js +2 -123
  4. package/dist/api/agent-load.js.map +1 -1
  5. package/dist/api/audit-log.d.ts +1 -17
  6. package/dist/api/audit-log.d.ts.map +1 -1
  7. package/dist/api/audit-log.js +2 -162
  8. package/dist/api/audit-log.js.map +1 -1
  9. package/dist/api/background-tasks.d.ts +1 -26
  10. package/dist/api/background-tasks.d.ts.map +1 -1
  11. package/dist/api/background-tasks.js +2 -55
  12. package/dist/api/background-tasks.js.map +1 -1
  13. package/dist/api/bell.d.ts +1 -18
  14. package/dist/api/bell.d.ts.map +1 -1
  15. package/dist/api/bell.js +2 -33
  16. package/dist/api/bell.js.map +1 -1
  17. package/dist/api/code-markers.d.ts +1 -8
  18. package/dist/api/code-markers.d.ts.map +1 -1
  19. package/dist/api/code-markers.js +2 -61
  20. package/dist/api/code-markers.js.map +1 -1
  21. package/dist/api/complexity.d.ts +1 -2
  22. package/dist/api/complexity.d.ts.map +1 -1
  23. package/dist/api/complexity.js +2 -46
  24. package/dist/api/complexity.js.map +1 -1
  25. package/dist/api/context.d.ts +1 -37
  26. package/dist/api/context.d.ts.map +1 -1
  27. package/dist/api/context.js +2 -143
  28. package/dist/api/context.js.map +1 -1
  29. package/dist/api/dead-code.d.ts +1 -2
  30. package/dist/api/dead-code.d.ts.map +1 -1
  31. package/dist/api/dead-code.js +2 -69
  32. package/dist/api/dead-code.js.map +1 -1
  33. package/dist/api/dependencies.d.ts +1 -2
  34. package/dist/api/dependencies.d.ts.map +1 -1
  35. package/dist/api/dependencies.js +2 -42
  36. package/dist/api/dependencies.js.map +1 -1
  37. package/dist/api/evaluation.d.ts +1 -19
  38. package/dist/api/evaluation.d.ts.map +1 -1
  39. package/dist/api/evaluation.js +2 -127
  40. package/dist/api/evaluation.js.map +1 -1
  41. package/dist/api/file-browser.d.ts +1 -8
  42. package/dist/api/file-browser.d.ts.map +1 -1
  43. package/dist/api/file-browser.js +2 -114
  44. package/dist/api/file-browser.js.map +1 -1
  45. package/dist/api/git.d.ts +1 -46
  46. package/dist/api/git.d.ts.map +1 -1
  47. package/dist/api/git.js +2 -354
  48. package/dist/api/git.js.map +1 -1
  49. package/dist/api/health-score.d.ts +1 -2
  50. package/dist/api/health-score.d.ts.map +1 -1
  51. package/dist/api/health-score.js +2 -46
  52. package/dist/api/health-score.js.map +1 -1
  53. package/dist/api/hook-request.d.ts +1 -40
  54. package/dist/api/hook-request.d.ts.map +1 -1
  55. package/dist/api/hook-request.js +2 -277
  56. package/dist/api/hook-request.js.map +1 -1
  57. package/dist/api/hotspots.d.ts +1 -2
  58. package/dist/api/hotspots.d.ts.map +1 -1
  59. package/dist/api/hotspots.js +2 -61
  60. package/dist/api/hotspots.js.map +1 -1
  61. package/dist/api/identity.d.ts +1 -16
  62. package/dist/api/identity.d.ts.map +1 -1
  63. package/dist/api/identity.js +2 -78
  64. package/dist/api/identity.js.map +1 -1
  65. package/dist/api/index.d.ts +1 -34
  66. package/dist/api/index.d.ts.map +1 -1
  67. package/dist/api/index.js +2 -44
  68. package/dist/api/index.js.map +1 -1
  69. package/dist/api/mode.d.ts +1 -22
  70. package/dist/api/mode.d.ts.map +1 -1
  71. package/dist/api/mode.js +2 -37
  72. package/dist/api/mode.js.map +1 -1
  73. package/dist/api/otlp.d.ts +1 -2
  74. package/dist/api/otlp.d.ts.map +1 -1
  75. package/dist/api/otlp.js +2 -46
  76. package/dist/api/otlp.js.map +1 -1
  77. package/dist/api/permissions.d.ts +1 -15
  78. package/dist/api/permissions.d.ts.map +1 -1
  79. package/dist/api/permissions.js +2 -66
  80. package/dist/api/permissions.js.map +1 -1
  81. package/dist/api/persona.d.ts +1 -8
  82. package/dist/api/persona.d.ts.map +1 -1
  83. package/dist/api/persona.js +2 -67
  84. package/dist/api/persona.js.map +1 -1
  85. package/dist/api/portrait.d.ts +1 -5
  86. package/dist/api/portrait.d.ts.map +1 -1
  87. package/dist/api/portrait.js +2 -27
  88. package/dist/api/portrait.js.map +1 -1
  89. package/dist/api/settings.d.ts +1 -53
  90. package/dist/api/settings.d.ts.map +1 -1
  91. package/dist/api/settings.js +2 -464
  92. package/dist/api/settings.js.map +1 -1
  93. package/dist/api/spans.d.ts +1 -16
  94. package/dist/api/spans.d.ts.map +1 -1
  95. package/dist/api/spans.js +2 -244
  96. package/dist/api/spans.js.map +1 -1
  97. package/dist/api/stats.d.ts +1 -12
  98. package/dist/api/stats.d.ts.map +1 -1
  99. package/dist/api/stats.js +2 -84
  100. package/dist/api/stats.js.map +1 -1
  101. package/dist/api/story.d.ts +1 -2
  102. package/dist/api/story.d.ts.map +1 -1
  103. package/dist/api/story.js +2 -14
  104. package/dist/api/story.js.map +1 -1
  105. package/dist/api/telemetry.d.ts +1 -18
  106. package/dist/api/telemetry.d.ts.map +1 -1
  107. package/dist/api/telemetry.js +2 -164
  108. package/dist/api/telemetry.js.map +1 -1
  109. package/dist/api/theme-agents.d.ts +1 -60
  110. package/dist/api/theme-agents.d.ts.map +1 -1
  111. package/dist/api/theme-agents.js +2 -213
  112. package/dist/api/theme-agents.js.map +1 -1
  113. package/dist/api/todos.d.ts +1 -32
  114. package/dist/api/todos.d.ts.map +1 -1
  115. package/dist/api/todos.js +2 -43
  116. package/dist/api/todos.js.map +1 -1
  117. package/dist/api/token-stats.d.ts +1 -7
  118. package/dist/api/token-stats.d.ts.map +1 -1
  119. package/dist/api/token-stats.js +2 -35
  120. package/dist/api/token-stats.js.map +1 -1
  121. package/dist/api/welcome.d.ts +1 -21
  122. package/dist/api/welcome.d.ts.map +1 -1
  123. package/dist/api/welcome.js +2 -34
  124. package/dist/api/welcome.js.map +1 -1
  125. package/dist/env.d.ts +6 -0
  126. package/dist/env.d.ts.map +1 -0
  127. package/dist/env.js +10 -0
  128. package/dist/env.js.map +1 -0
  129. package/dist/focus.d.ts +53 -0
  130. package/dist/focus.d.ts.map +1 -0
  131. package/dist/focus.js +122 -0
  132. package/dist/focus.js.map +1 -0
  133. package/dist/menu-builder.d.ts.map +1 -1
  134. package/dist/menu-builder.js +0 -1
  135. package/dist/menu-builder.js.map +1 -1
  136. package/dist/public/css/react.css +1 -1
  137. package/dist/public/js/react/react.js +51 -59
  138. package/dist/server.d.ts +16 -85
  139. package/dist/server.d.ts.map +1 -1
  140. package/dist/server.js +38 -409
  141. package/dist/server.js.map +1 -1
  142. package/dist/sprint-data.d.ts +1 -1
  143. package/dist/sprint-data.d.ts.map +1 -1
  144. package/dist/sprint-data.js +2 -2
  145. package/dist/sprint-data.js.map +1 -1
  146. package/dist/websocket.d.ts +2 -0
  147. package/dist/websocket.d.ts.map +1 -1
  148. package/dist/websocket.js +42 -75
  149. package/dist/websocket.js.map +1 -1
  150. package/package.json +3 -6
  151. package/portraits/hogans-heroes/large/burkhalter-35312.png +0 -0
  152. package/portraits/hogans-heroes/large/carter-34352.png +0 -0
  153. package/portraits/hogans-heroes/large/hochstetter-45314.png +0 -0
  154. package/portraits/hogans-heroes/large/hogan-44541.png +0 -0
  155. package/portraits/hogans-heroes/large/kinch-35241.png +0 -0
  156. package/portraits/hogans-heroes/large/klink-23434.png +0 -0
  157. package/portraits/hogans-heroes/large/lebeau-45443.png +0 -0
  158. package/portraits/hogans-heroes/large/marya-53543.png +0 -0
  159. package/portraits/hogans-heroes/large/newkirk-54432.png +0 -0
  160. package/portraits/hogans-heroes/large/schultz-42453.png +0 -0
  161. package/portraits/hogans-heroes/large/underground-55131.png +0 -0
  162. package/portraits/hogans-heroes/medium/burkhalter-35312.png +0 -0
  163. package/portraits/hogans-heroes/medium/carter-34352.png +0 -0
  164. package/portraits/hogans-heroes/medium/hochstetter-45314.png +0 -0
  165. package/portraits/hogans-heroes/medium/hogan-44541.png +0 -0
  166. package/portraits/hogans-heroes/medium/kinch-35241.png +0 -0
  167. package/portraits/hogans-heroes/medium/klink-23434.png +0 -0
  168. package/portraits/hogans-heroes/medium/lebeau-45443.png +0 -0
  169. package/portraits/hogans-heroes/medium/marya-53543.png +0 -0
  170. package/portraits/hogans-heroes/medium/newkirk-54432.png +0 -0
  171. package/portraits/hogans-heroes/medium/schultz-42453.png +0 -0
  172. package/portraits/hogans-heroes/medium/underground-55131.png +0 -0
  173. package/portraits/monty-python/large/announcer-44441.png +0 -0
  174. package/portraits/monty-python/large/arguer-35412.png +0 -0
  175. package/portraits/monty-python/large/bicycle-repair-man-35241.png +0 -0
  176. package/portraits/monty-python/large/colonel-35423.png +0 -0
  177. package/portraits/monty-python/large/counsellor-45341.png +0 -0
  178. package/portraits/monty-python/large/gumbys-23524.png +0 -0
  179. package/portraits/monty-python/large/nudge-43533.png +0 -0
  180. package/portraits/monty-python/large/praline-45413.png +0 -0
  181. package/portraits/monty-python/large/silly-walks-55322.png +0 -0
  182. package/portraits/monty-python/large/wensleydale-54451.png +0 -0
  183. package/portraits/monty-python/large/xim-nez-43534.png +0 -0
  184. package/portraits/monty-python/medium/announcer-44441.png +0 -0
  185. package/portraits/monty-python/medium/arguer-35412.png +0 -0
  186. package/portraits/monty-python/medium/bicycle-repair-man-35241.png +0 -0
  187. package/portraits/monty-python/medium/colonel-35423.png +0 -0
  188. package/portraits/monty-python/medium/counsellor-45341.png +0 -0
  189. package/portraits/monty-python/medium/gumbys-23524.png +0 -0
  190. package/portraits/monty-python/medium/nudge-43533.png +0 -0
  191. package/portraits/monty-python/medium/praline-45413.png +0 -0
  192. package/portraits/monty-python/medium/silly-walks-55322.png +0 -0
  193. package/portraits/monty-python/medium/wensleydale-54451.png +0 -0
  194. package/portraits/monty-python/medium/xim-nez-43534.png +0 -0
  195. package/portraits/stephen-king/large/andy-55231.png +0 -0
  196. package/portraits/stephen-king/large/christine-25112.png +0 -0
  197. package/portraits/stephen-king/large/danny-53243.png +0 -0
  198. package/portraits/stephen-king/large/flagg-55311.png +0 -0
  199. package/portraits/stephen-king/large/gaunt-54421.png +0 -0
  200. package/portraits/stephen-king/large/jack-44224.png +0 -0
  201. package/portraits/stephen-king/large/johnny-44353.png +0 -0
  202. package/portraits/stephen-king/large/margaret-15415.png +0 -0
  203. package/portraits/stephen-king/large/paul-45233.png +0 -0
  204. package/portraits/stephen-king/large/pennywise-54411.png +0 -0
  205. package/portraits/stephen-king/large/roland-35121.png +0 -0
  206. package/portraits/stephen-king/medium/andy-55231.png +0 -0
  207. package/portraits/stephen-king/medium/christine-25112.png +0 -0
  208. package/portraits/stephen-king/medium/danny-53243.png +0 -0
  209. package/portraits/stephen-king/medium/flagg-55311.png +0 -0
  210. package/portraits/stephen-king/medium/gaunt-54421.png +0 -0
  211. package/portraits/stephen-king/medium/jack-44224.png +0 -0
  212. package/portraits/stephen-king/medium/johnny-44353.png +0 -0
  213. package/portraits/stephen-king/medium/margaret-15415.png +0 -0
  214. package/portraits/stephen-king/medium/paul-45233.png +0 -0
  215. package/portraits/stephen-king/medium/pennywise-54411.png +0 -0
  216. package/portraits/stephen-king/medium/roland-35121.png +0 -0
  217. package/src/public/App.tsx +21 -5
  218. package/src/public/components/BikeRackIndex.tsx +0 -1
  219. package/src/public/components/BikeRackWorkspace.tsx +86 -11
  220. package/src/public/components/DockviewWorkspace.tsx +19 -8
  221. package/src/public/components/StandalonePanel.tsx +1 -3
  222. package/src/public/components/panel-registry.ts +3 -1
  223. package/src/public/components/panels/AuditLogPanel.tsx +28 -4
  224. package/src/public/components/panels/GitPanel.tsx +1 -20
  225. package/src/public/components/panels/SettingsPanel.tsx +0 -1
  226. package/src/public/components/panels/SprintPanel.tsx +32 -1
  227. package/src/public/components/panels/index.ts +0 -2
  228. package/src/public/hooks/useFocusPanel.ts +137 -0
  229. package/src/public/hooks/useLayoutPersistence.ts +8 -5
  230. package/src/public/styles/dockview-theme.css +1 -84
  231. package/src/public/styles/tailwind.css +27 -32
  232. package/src/public/utils/slash-commands.ts +122 -98
  233. package/dist/hooks/cyclist-pretooluse-hook.d.ts +0 -60
  234. package/dist/hooks/cyclist-pretooluse-hook.d.ts.map +0 -1
  235. package/dist/hooks/cyclist-pretooluse-hook.js +0 -57
  236. package/dist/hooks/cyclist-pretooluse-hook.js.map +0 -1
  237. package/dist/hooks/pretooluse-hook.d.ts +0 -89
  238. package/dist/hooks/pretooluse-hook.d.ts.map +0 -1
  239. package/dist/hooks/pretooluse-hook.js +0 -235
  240. package/dist/hooks/pretooluse-hook.js.map +0 -1
  241. package/dist/notification-sound.d.ts +0 -59
  242. package/dist/notification-sound.d.ts.map +0 -1
  243. package/dist/notification-sound.js +0 -219
  244. package/dist/notification-sound.js.map +0 -1
  245. package/dist/plugin-loader.test.d.ts +0 -17
  246. package/dist/plugin-loader.test.d.ts.map +0 -1
  247. package/dist/plugin-loader.test.js +0 -407
  248. package/dist/plugin-loader.test.js.map +0 -1
  249. package/portraits/star-trek-tng/large/beverly-44352.png +0 -0
  250. package/portraits/star-trek-tng/large/data-55241.png +0 -0
  251. package/portraits/star-trek-tng/large/deanna-43353.png +0 -0
  252. package/portraits/star-trek-tng/large/geordi-54342.png +0 -0
  253. package/portraits/star-trek-tng/large/jean-luc-45342.png +0 -0
  254. package/portraits/star-trek-tng/large/kathryn-45332.png +0 -0
  255. package/portraits/star-trek-tng/large/miles-35342.png +0 -0
  256. package/portraits/star-trek-tng/large/q-53521.png +0 -0
  257. package/portraits/star-trek-tng/large/spock-45231.png +0 -0
  258. package/portraits/star-trek-tng/large/troi-44352.png +0 -0
  259. package/portraits/star-trek-tng/medium/beverly-44352.png +0 -0
  260. package/portraits/star-trek-tng/medium/data-55241.png +0 -0
  261. package/portraits/star-trek-tng/medium/deanna-43353.png +0 -0
  262. package/portraits/star-trek-tng/medium/geordi-54342.png +0 -0
  263. package/portraits/star-trek-tng/medium/jean-luc-45342.png +0 -0
  264. package/portraits/star-trek-tng/medium/kathryn-45332.png +0 -0
  265. package/portraits/star-trek-tng/medium/miles-35342.png +0 -0
  266. package/portraits/star-trek-tng/medium/q-53521.png +0 -0
  267. package/portraits/star-trek-tng/medium/spock-45231.png +0 -0
  268. package/portraits/star-trek-tng/medium/troi-44352.png +0 -0
  269. package/src/public/components/panels/TTYPanel.tsx +0 -299
  270. package/src/public/types/electron.d.ts +0 -18
@@ -1,41 +1,2 @@
1
- /**
2
- * Hook Request API Router
3
- *
4
- * Handles approval requests from Claude Code hooks via WheelHub.
5
- * Per ADR-0004: All communication converges through WheelHub.
6
- *
7
- * Flow:
8
- * 1. Hook script sends POST /api/hook-request with tool data
9
- * 2. WheelHub checks allowlist/grants for auto-approval
10
- * 3. If manual approval needed, broadcasts to WebSocket clients
11
- * 4. Client shows approval modal, user decides
12
- * 5. Client sends decision back via WebSocket
13
- * 6. WheelHub returns HTTP response to hook
14
- *
15
- * Story: MSSCI-12409 - Hook consistency and WheelHub consolidation
16
- */
17
- import { Router } from 'express';
18
- import { WebSocket } from 'ws';
19
- export type HookSeverity = 'safe' | 'normal' | 'destructive';
20
- interface SeverityResult {
21
- severity: HookSeverity;
22
- warning?: string;
23
- }
24
- /**
25
- * Classify the severity of a hook request server-side.
26
- * Combines tool-name classification with dangerous-path detection.
27
- */
28
- export declare function classifyHookSeverity(toolName: string, input: Record<string, unknown>): SeverityResult;
29
- export declare function getHookClients(): Set<WebSocket>;
30
- export declare function addHookClient(ws: WebSocket): void;
31
- /**
32
- * Resolve a pending approval from client response
33
- */
34
- export declare function resolveApproval(toolId: string, approved: boolean, data?: Record<string, unknown>): boolean;
35
- /**
36
- * Handle WebSocket message from client
37
- */
38
- export declare function handleHookWebSocketMessage(ws: WebSocket, message: string): void;
39
- export declare function createHookRequestRouter(): Router;
40
- export {};
1
+ export * from '@pennyfarthing/core/dist/server/api/hook-request.js';
41
2
  //# sourceMappingURL=hook-request.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hook-request.d.ts","sourceRoot":"","sources":["../../src/api/hook-request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAqB,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AA2E/B,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,CAAC;AAE7D,UAAU,cAAc;IACtB,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAuBD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,cAAc,CAkDhB;AAMD,wBAAgB,cAAc,IAAI,GAAG,CAAC,SAAS,CAAC,CAE/C;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI,CAGjD;AA+BD;;GAEG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,OAAO,EACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAcT;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CA6B/E;AAwFD,wBAAgB,uBAAuB,IAAI,MAAM,CAkBhD"}
1
+ {"version":3,"file":"hook-request.d.ts","sourceRoot":"","sources":["../../src/api/hook-request.ts"],"names":[],"mappings":"AACA,cAAc,qDAAqD,CAAC"}
@@ -1,278 +1,3 @@
1
- /**
2
- * Hook Request API Router
3
- *
4
- * Handles approval requests from Claude Code hooks via WheelHub.
5
- * Per ADR-0004: All communication converges through WheelHub.
6
- *
7
- * Flow:
8
- * 1. Hook script sends POST /api/hook-request with tool data
9
- * 2. WheelHub checks allowlist/grants for auto-approval
10
- * 3. If manual approval needed, broadcasts to WebSocket clients
11
- * 4. Client shows approval modal, user decides
12
- * 5. Client sends decision back via WebSocket
13
- * 6. WheelHub returns HTTP response to hook
14
- *
15
- * Story: MSSCI-12409 - Hook consistency and WheelHub consolidation
16
- */
17
- import { Router } from 'express';
18
- import { WebSocket } from 'ws';
19
- import { checkGrant, isAllowlisted, addGrant } from '../settings-store.js';
20
- import { isDangerousPath, getPathCategory, extractBashTargetPaths } from '../dangerous-path.js';
21
- // =============================================================================
22
- // State
23
- // =============================================================================
24
- // Pending approval requests, keyed by toolId
25
- const pendingApprovals = new Map();
26
- // WebSocket clients for hook notifications
27
- const hookClients = new Set();
28
- // Approval timeout (2 minutes)
29
- const APPROVAL_TIMEOUT_MS = 120000;
30
- // =============================================================================
31
- // Scope Extraction (MSSCI-14321)
32
- // =============================================================================
33
- /**
34
- * Extract the scope identifier from tool input for grant matching.
35
- * Modeled after getToolScope() in approval-gate.ts.
36
- */
37
- function extractToolScope(toolName, input) {
38
- switch (toolName) {
39
- case 'Bash':
40
- return input.command || '';
41
- case 'WebFetch':
42
- return input.url || '';
43
- case 'Edit':
44
- case 'Write':
45
- case 'Read':
46
- return input.file_path || '';
47
- default:
48
- return JSON.stringify(input);
49
- }
50
- }
51
- const SAFE_TOOLS = new Set(['Read', 'Grep', 'Glob', 'WebSearch']);
52
- const DESTRUCTIVE_BASH_PATTERNS = [
53
- /rm\s+(-[rf]+\s+)*/,
54
- /git\s+(reset\s+--hard|push\s+--force|clean\s+-[fd])/,
55
- /drop\s+database/i,
56
- /truncate\s+table/i,
57
- ];
58
- const SAFE_BASH_PATTERNS = [
59
- /^(ls|cat|head|tail|grep|find|pwd|echo|which|type|file|stat|wc|diff)\b/,
60
- /^git\s+(status|log|diff|show|branch|remote)\b/,
61
- ];
62
- const CATEGORY_WARNINGS = {
63
- secrets: 'Modifying sensitive secrets/credentials file',
64
- git: 'Modifying git internals',
65
- dependencies: 'Modifying dependency files',
66
- system: 'Modifying system files',
67
- };
68
- /**
69
- * Classify the severity of a hook request server-side.
70
- * Combines tool-name classification with dangerous-path detection.
71
- */
72
- export function classifyHookSeverity(toolName, input) {
73
- // Safe tools are always safe
74
- if (SAFE_TOOLS.has(toolName)) {
75
- return { severity: 'safe' };
76
- }
77
- // Check dangerous paths for Write/Edit
78
- if (toolName === 'Write' || toolName === 'Edit') {
79
- const filePath = input.file_path || '';
80
- if (filePath && isDangerousPath(filePath)) {
81
- const category = getPathCategory(filePath);
82
- return {
83
- severity: 'destructive',
84
- warning: category ? CATEGORY_WARNINGS[category] : 'Modifying sensitive path',
85
- };
86
- }
87
- return { severity: 'normal' };
88
- }
89
- // Bash command classification
90
- if (toolName === 'Bash') {
91
- const command = input.command || '';
92
- // Check for destructive bash patterns
93
- if (DESTRUCTIVE_BASH_PATTERNS.some(p => p.test(command))) {
94
- return { severity: 'destructive', warning: 'Destructive command detected' };
95
- }
96
- // Check for bash redirecting to dangerous paths
97
- const targetPaths = extractBashTargetPaths(command);
98
- for (const targetPath of targetPaths) {
99
- if (isDangerousPath(targetPath)) {
100
- const category = getPathCategory(targetPath);
101
- return {
102
- severity: 'destructive',
103
- warning: category ? CATEGORY_WARNINGS[category] : 'Redirecting to sensitive path',
104
- };
105
- }
106
- }
107
- // Check for safe bash patterns
108
- if (SAFE_BASH_PATTERNS.some(p => p.test(command))) {
109
- return { severity: 'safe' };
110
- }
111
- return { severity: 'normal' };
112
- }
113
- // Default: normal
114
- return { severity: 'normal' };
115
- }
116
- // =============================================================================
117
- // WebSocket Client Management
118
- // =============================================================================
119
- export function getHookClients() {
120
- return hookClients;
121
- }
122
- export function addHookClient(ws) {
123
- hookClients.add(ws);
124
- ws.on('close', () => hookClients.delete(ws));
125
- }
126
- /**
127
- * Broadcast hook request to all connected clients
128
- */
129
- function broadcastHookRequest(data) {
130
- const message = JSON.stringify(data);
131
- for (const client of hookClients) {
132
- if (client.readyState === WebSocket.OPEN) {
133
- client.send(message);
134
- }
135
- }
136
- }
137
- // =============================================================================
138
- // Approval Resolution
139
- // =============================================================================
140
- /**
141
- * Resolve a pending approval from client response
142
- */
143
- export function resolveApproval(toolId, approved, data) {
144
- const pending = pendingApprovals.get(toolId);
145
- if (!pending) {
146
- return false;
147
- }
148
- pending.resolve({
149
- decision: approved ? 'allow' : 'deny',
150
- reason: approved ? 'Approved by user' : 'Rejected by user',
151
- data,
152
- });
153
- pendingApprovals.delete(toolId);
154
- return true;
155
- }
156
- /**
157
- * Handle WebSocket message from client
158
- */
159
- export function handleHookWebSocketMessage(ws, message) {
160
- try {
161
- const data = JSON.parse(message);
162
- if (data.type === 'hook-response') {
163
- // Store grant if user approved with a grantScope (MSSCI-14321 AC8)
164
- if (data.approved && data.data?.grantScope) {
165
- const pending = pendingApprovals.get(data.toolId);
166
- const scope = pending
167
- ? extractToolScope(pending.toolName, pending.input)
168
- : '';
169
- const grant = {
170
- tool: pending?.toolName || '',
171
- scope,
172
- grant_type: data.data.grantScope,
173
- granted_at: new Date().toISOString(),
174
- };
175
- // Include agent from the original request if present
176
- if (pending?.agent) {
177
- grant.agent = pending.agent;
178
- }
179
- addGrant(grant);
180
- }
181
- resolveApproval(data.toolId, data.approved, data.data);
182
- }
183
- }
184
- catch (error) {
185
- console.error('[HookRequest] Failed to parse WebSocket message:', error);
186
- }
187
- }
188
- // =============================================================================
189
- // Request Handler
190
- // =============================================================================
191
- async function handleHookRequest(req, res) {
192
- const { toolName, toolId, input, sessionId: _sessionId, agent, context } = req.body;
193
- if (!toolName || !toolId) {
194
- res.status(400).json({ error: 'Missing required fields: toolName, toolId' });
195
- return;
196
- }
197
- // Check for auto-approval via grants (all tool types)
198
- const scope = extractToolScope(toolName, input || {});
199
- if (checkGrant(toolName, scope, agent)) {
200
- res.json({
201
- decision: 'allow',
202
- reason: 'Granted by permission grant',
203
- });
204
- return;
205
- }
206
- // Check Bash allowlist for backward compatibility
207
- if (toolName === 'Bash' && isAllowlisted(scope)) {
208
- res.json({
209
- decision: 'allow',
210
- reason: 'Command matches allowlist pattern',
211
- });
212
- return;
213
- }
214
- // No clients connected - fall through to Claude Code's built-in approval
215
- if (hookClients.size === 0) {
216
- res.json({
217
- decision: 'ask',
218
- reason: 'No Cyclist clients connected, deferring to Claude Code',
219
- });
220
- return;
221
- }
222
- // Create pending approval with timeout
223
- const approvalPromise = new Promise((resolve) => {
224
- pendingApprovals.set(toolId, {
225
- resolve,
226
- toolName,
227
- input: input || {},
228
- agent,
229
- timestamp: Date.now(),
230
- });
231
- // Set timeout
232
- setTimeout(() => {
233
- if (pendingApprovals.has(toolId)) {
234
- pendingApprovals.delete(toolId);
235
- resolve({
236
- decision: 'ask',
237
- reason: 'Approval timeout, deferring to Claude Code',
238
- });
239
- }
240
- }, APPROVAL_TIMEOUT_MS);
241
- });
242
- // Classify severity before broadcast (MSSCI-14323)
243
- const { severity, warning } = classifyHookSeverity(toolName, input || {});
244
- // Broadcast to clients (include context, severity, and agent for UI display)
245
- broadcastHookRequest({
246
- type: 'hook-request',
247
- toolId,
248
- toolName,
249
- input: input || {},
250
- severity,
251
- warning,
252
- agent,
253
- context,
254
- });
255
- // Wait for response
256
- const response = await approvalPromise;
257
- res.json(response);
258
- }
259
- // =============================================================================
260
- // Router
261
- // =============================================================================
262
- export function createHookRequestRouter() {
263
- const router = Router();
264
- // POST /api/hook-request - Handle hook approval requests
265
- router.post('/', handleHookRequest);
266
- // GET /api/hook-request/pending - List pending approvals (for debugging)
267
- router.get('/pending', (_req, res) => {
268
- const pending = Array.from(pendingApprovals.entries()).map(([id, p]) => ({
269
- toolId: id,
270
- toolName: p.toolName,
271
- timestamp: p.timestamp,
272
- age: Date.now() - p.timestamp,
273
- }));
274
- res.json({ pending });
275
- });
276
- return router;
277
- }
1
+ // Re-export from @pennyfarthing/core (Story 98-17)
2
+ export * from '@pennyfarthing/core/dist/server/api/hook-request.js';
278
3
  //# sourceMappingURL=hook-request.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hook-request.js","sourceRoot":"","sources":["../../src/api/hook-request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAqB,MAAM,SAAS,CAAC;AACp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ACpB,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC;IACvC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACrB,CAAC;AAED,gFAAgF;AAChF,SAAS;AACT,gFAAgF;AAEhF,MAAM,UAAU,uBAAuB;IACrC,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;IAExB,yDAAyD;IACzD,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IAEpC,yEAAyE;IACzE,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,IAAa,EAAE,GAAa,EAAE,EAAE;QACtD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACvE,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,SAAS,EAAE,CAAC,CAAC,SAAS;YACtB,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,SAAS;SAC9B,CAAC,CAAC,CAAC;QACJ,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"hook-request.js","sourceRoot":"","sources":["../../src/api/hook-request.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,cAAc,qDAAqD,CAAC"}
@@ -1,3 +1,2 @@
1
- import { Router } from 'express';
2
- export declare function createHotspotsRouter(getProjectDir: () => string): Router;
1
+ export * from '@pennyfarthing/core/dist/server/api/hotspots.js';
3
2
  //# sourceMappingURL=hotspots.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hotspots.d.ts","sourceRoot":"","sources":["../../src/api/hotspots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAKjC,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,MAAM,GAAG,MAAM,CA8DxE"}
1
+ {"version":3,"file":"hotspots.d.ts","sourceRoot":"","sources":["../../src/api/hotspots.ts"],"names":[],"mappings":"AACA,cAAc,iDAAiD,CAAC"}
@@ -1,62 +1,3 @@
1
- import { Router } from 'express';
2
- import { execFile } from 'child_process';
3
- import { join } from 'path';
4
- // Create hotspots API router
5
- export function createHotspotsRouter(getProjectDir) {
6
- const router = Router();
7
- // GET /api/hotspots?days=90&repo=pennyfarthing&skip_type=orchestrator
8
- router.get('/', (req, res) => {
9
- const projectDir = getProjectDir();
10
- const days = String(req.query.days || '90');
11
- const repo = req.query.repo;
12
- const skipType = req.query.skip_type;
13
- const args = [
14
- '-m', 'pennyfarthing_scripts.hotspots',
15
- 'analyze',
16
- '--format', 'json',
17
- '--days', days,
18
- ];
19
- if (repo) {
20
- args.push('--repo', repo);
21
- }
22
- else {
23
- args.push('--path', projectDir);
24
- }
25
- // Forward skip_type values to CLI
26
- if (skipType) {
27
- const types = Array.isArray(skipType) ? skipType : [skipType];
28
- for (const t of types) {
29
- args.push('--skip-type', String(t));
30
- }
31
- }
32
- // Find python in the project's pennyfarthing dir
33
- const pythonPath = join(projectDir, 'pennyfarthing');
34
- execFile('python3', args, {
35
- cwd: pythonPath,
36
- env: { ...process.env, PYTHONPATH: pythonPath },
37
- timeout: 30000,
38
- }, (err, stdout, stderr) => {
39
- if (err) {
40
- console.error('[Hotspots] Analysis failed:', stderr || err.message);
41
- res.status(500).json({
42
- success: false,
43
- error: stderr || err.message,
44
- });
45
- return;
46
- }
47
- try {
48
- const data = JSON.parse(stdout);
49
- res.json(data);
50
- }
51
- catch (parseErr) {
52
- console.error('[Hotspots] JSON parse failed:', parseErr);
53
- res.status(500).json({
54
- success: false,
55
- error: 'Failed to parse hotspot analysis output',
56
- });
57
- }
58
- });
59
- });
60
- return router;
61
- }
1
+ // Re-export from @pennyfarthing/core (Story 98-17)
2
+ export * from '@pennyfarthing/core/dist/server/api/hotspots.js';
62
3
  //# sourceMappingURL=hotspots.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hotspots.js","sourceRoot":"","sources":["../../src/api/hotspots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,6BAA6B;AAC7B,MAAM,UAAU,oBAAoB,CAAC,aAA2B;IAC9D,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;IAExB,sEAAsE;IACtE,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC3B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;QAC5C,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,IAA0B,CAAC;QAClD,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC;QAErC,MAAM,IAAI,GAAG;YACX,IAAI,EAAE,gCAAgC;YACtC,SAAS;YACT,UAAU,EAAE,MAAM;YAClB,QAAQ,EAAE,IAAI;SACf,CAAC;QAEF,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC5B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAClC,CAAC;QAED,kCAAkC;QAClC,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,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,CAAC"}
1
+ {"version":3,"file":"hotspots.js","sourceRoot":"","sources":["../../src/api/hotspots.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,cAAc,iDAAiD,CAAC"}
@@ -1,17 +1,2 @@
1
- /**
2
- * Identity API - Get user identity information from CLI tools
3
- * MSSCI-12469: Stats strip redesign with identity context
4
- *
5
- * Returns Jira email and GitHub username from respective CLI configs.
6
- */
7
- import { Router } from 'express';
8
- export interface IdentityInfo {
9
- jiraEmail: string | null;
10
- githubUsername: string | null;
11
- avatarUrl: string | null;
12
- }
13
- /**
14
- * Create identity API router
15
- */
16
- export declare function createIdentityRouter(): Router;
1
+ export * from '@pennyfarthing/core/dist/server/api/identity.js';
17
2
  //# sourceMappingURL=identity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/api/identity.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGjC,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAgED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAU7C"}
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/api/identity.ts"],"names":[],"mappings":"AACA,cAAc,iDAAiD,CAAC"}
@@ -1,79 +1,3 @@
1
- /**
2
- * Identity API - Get user identity information from CLI tools
3
- * MSSCI-12469: Stats strip redesign with identity context
4
- *
5
- * Returns Jira email and GitHub username from respective CLI configs.
6
- */
7
- import { Router } from 'express';
8
- import { execSync } from 'child_process';
9
- /**
10
- * Get Jira email from jira CLI config
11
- * Runs: jira me --raw | grep email
12
- */
13
- function getJiraEmail() {
14
- try {
15
- // jira me returns JSON with email field
16
- const output = execSync('jira me --raw 2>/dev/null', {
17
- encoding: 'utf-8',
18
- timeout: 5000,
19
- });
20
- const data = JSON.parse(output);
21
- return data.emailAddress || null;
22
- }
23
- catch {
24
- // jira CLI not configured or not installed
25
- return null;
26
- }
27
- }
28
- /**
29
- * Get GitHub username from gh CLI config
30
- * Runs: gh api user
31
- */
32
- function getGithubUsername() {
33
- try {
34
- const output = execSync('gh api user 2>/dev/null', {
35
- encoding: 'utf-8',
36
- timeout: 5000,
37
- });
38
- const data = JSON.parse(output);
39
- return data.login || null;
40
- }
41
- catch {
42
- // gh CLI not configured or not installed
43
- return null;
44
- }
45
- }
46
- // Cache identity info (refresh every 5 minutes)
47
- let cachedIdentity = null;
48
- let lastFetch = 0;
49
- const CACHE_TTL = 5 * 60 * 1000; // 5 minutes
50
- /**
51
- * Get identity info with caching
52
- */
53
- function getIdentity() {
54
- const now = Date.now();
55
- if (cachedIdentity && now - lastFetch < CACHE_TTL) {
56
- return cachedIdentity;
57
- }
58
- const githubUsername = getGithubUsername();
59
- cachedIdentity = {
60
- jiraEmail: getJiraEmail(),
61
- githubUsername,
62
- avatarUrl: githubUsername ? `https://avatars.githubusercontent.com/${githubUsername}` : null,
63
- };
64
- lastFetch = now;
65
- return cachedIdentity;
66
- }
67
- /**
68
- * Create identity API router
69
- */
70
- export function createIdentityRouter() {
71
- const router = Router();
72
- // GET /api/identity - Get current user identity
73
- router.get('/', (_req, res) => {
74
- const identity = getIdentity();
75
- res.json(identity);
76
- });
77
- return router;
78
- }
1
+ // Re-export from @pennyfarthing/core (Story 98-17)
2
+ export * from '@pennyfarthing/core/dist/server/api/identity.js';
79
3
  //# sourceMappingURL=identity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/api/identity.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAQzC;;;GAGG;AACH,SAAS,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Ac,EAAE,CAAC,CAAC,CAAC,IAAI;KAC7F,CAAC;IACF,SAAS,GAAG,GAAG,CAAC;IAEhB,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;IAExB,gDAAgD;IAChD,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QAC5B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;QAC/B,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/api/identity.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,cAAc,iDAAiD,CAAC"}
@@ -1,35 +1,2 @@
1
- export { createStatsRouter, broadcastStats, getCurrentStats, getStatsClients, updatePwd } from './stats.js';
2
- export { createPortraitRouter, getCurrentPortrait } from './portrait.js';
3
- export { createPersonaRouter, broadcastPersona, getPersonaClients, getStreamingState, setStreamingState } from './persona.js';
4
- export { createGitRouter, getGitInfo, getAllReposGitInfo, getGitInfoAsync, getAllReposGitInfoAsync } from './git.js';
5
- export type { GitInfo } from './git.js';
6
- export { createOTLPRouter } from './otlp.js';
7
- export { createStoryRouter } from './story.js';
8
- export { createHotspotsRouter } from './hotspots.js';
9
- export { createFileBrowserRouter } from './file-browser.js';
10
- export { createTokenStatsRouter, broadcastTokenStats, getTokenStatsClients, initTokenStatsBroadcast } from './token-stats.js';
11
- export { createContextRouter, getContextUsage } from './context.js';
12
- export type { ContextInfo } from './context.js';
13
- export { createThemeAgentsRouter, getThemeAgents } from './theme-agents.js';
14
- export type { AgentCharacterMap } from './theme-agents.js';
15
- export { createModeRouter, getModeInfo } from './mode.js';
16
- export type { ModeInfo } from './mode.js';
17
- export { createTelemetryRouter } from './telemetry.js';
18
- export { createEvaluationRouter } from './evaluation.js';
19
- export { createSettingsRouter } from './settings.js';
20
- export { createBackgroundTasksRouter, getBackgroundTaskClients, broadcastBackgroundTaskEvent, initBackgroundTaskBroadcast } from './background-tasks.js';
21
- export { createSpansRouter } from './spans.js';
22
- export { getBellClients, broadcastBellConsumed } from './bell.js';
23
- export { createHookRequestRouter, getHookClients, addHookClient, resolveApproval, handleHookWebSocketMessage } from './hook-request.js';
24
- export { createIdentityRouter } from './identity.js';
25
- export type { IdentityInfo } from './identity.js';
26
- export { createTodosRouter, setWebModeTodos, getWebModeTodos } from './todos.js';
27
- export { createAuditLogRouter } from './audit-log.js';
28
- export { createPermissionsRouter } from './permissions.js';
29
- export { createAgentLoadRouter } from './agent-load.js';
30
- export { createCodeMarkersRouter } from './code-markers.js';
31
- export { createDeadCodeRouter } from './dead-code.js';
32
- export { createComplexityRouter } from './complexity.js';
33
- export { createDependenciesRouter } from './dependencies.js';
34
- export { createHealthScoreRouter } from './health-score.js';
1
+ export * from '@pennyfarthing/core/dist/server/api/index.js';
35
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5G,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC9H,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,kBAAkB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACrH,YAAY,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,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AE,MAAM,YAAY,CAAC;AAEjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AACA,cAAc,8CAA8C,CAAC"}
package/dist/api/index.js CHANGED
@@ -1,45 +1,3 @@
1
- // API module exports
2
- export { createStatsRouter, broadcastStats, getCurrentStats, getStatsClients, updatePwd } from './stats.js';
3
- export { createPortraitRouter, getCurrentPortrait } from './portrait.js';
4
- export { createPersonaRouter, broadcastPersona, getPersonaClients, getStreamingState, setStreamingState } from './persona.js';
5
- export { createGitRouter, getGitInfo, getAllReposGitInfo, getGitInfoAsync, getAllReposGitInfoAsync } from './git.js';
6
- export { createOTLPRouter } from './otlp.js';
7
- export { createStoryRouter } from './story.js';
8
- export { createHotspotsRouter } from './hotspots.js';
9
- export { createFileBrowserRouter } from './file-browser.js';
10
- export { createTokenStatsRouter, broadcastTokenStats, getTokenStatsClients, initTokenStatsBroadcast } from './token-stats.js';
11
- export { createContextRouter, getContextUsage } from './context.js';
12
- export { createThemeAgentsRouter, getThemeAgents } from './theme-agents.js';
13
- export { createModeRouter, getModeInfo } from './mode.js';
14
- export { createTelemetryRouter } from './telemetry.js';
15
- export { createEvaluationRouter } from './evaluation.js';
16
- // 35-1: Settings API for contextual settings
17
- export { createSettingsRouter } from './settings.js';
18
- // 35-16: Background tasks API
19
- export { createBackgroundTasksRouter, getBackgroundTaskClients, broadcastBackgroundTaskEvent, initBackgroundTaskBroadcast } from './background-tasks.js';
20
- // MSSCI-11734: Enriched spans API
21
- export { createSpansRouter } from './spans.js';
22
- // Bell mode WebSocket broadcast
23
- export { getBellClients, broadcastBellConsumed } from './bell.js';
24
- // MSSCI-12409: Hook request API (WheelHub consolidation)
25
- export { createHookRequestRouter, getHookClients, addHookClient, resolveApproval, handleHookWebSocketMessage } from './hook-request.js';
26
- // MSSCI-12469: Identity API for stats strip
27
- export { createIdentityRouter } from './identity.js';
28
- // Todos API for web mode fallback
29
- export { createTodosRouter, setWebModeTodos, getWebModeTodos } from './todos.js';
30
- // Audit log API
31
- export { createAuditLogRouter } from './audit-log.js';
32
- // MSSCI-14325: Permissions API (grant management)
33
- export { createPermissionsRouter } from './permissions.js';
34
- // MSSCI-14461: Agent Load Analyzer API
35
- export { createAgentLoadRouter } from './agent-load.js';
36
- // MSSCI-14456: Code Markers API
37
- export { createCodeMarkersRouter } from './code-markers.js';
38
- // MSSCI-14460: Dead Code API
39
- export { createDeadCodeRouter } from './dead-code.js';
40
- // MSSCI-14468: Complexity + Dependencies APIs
41
- export { createComplexityRouter } from './complexity.js';
42
- export { createDependenciesRouter } from './dependencies.js';
43
- // MSSCI-14471: Health Score API
44
- export { createHealthScoreRouter } from './health-score.js';
1
+ // Re-export from @pennyfarthing/core (Story 98-17)
2
+ export * from '@pennyfarthing/core/dist/server/api/index.js';
45
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5G,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EA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