@pennyfarthing/cyclist 10.3.1 → 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 (271) 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 +29 -8
  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 +45 -78
  149. package/dist/websocket.js.map +1 -1
  150. package/package.json +33 -35
  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/LICENSE +0 -14
  234. package/dist/hooks/cyclist-pretooluse-hook.d.ts +0 -60
  235. package/dist/hooks/cyclist-pretooluse-hook.d.ts.map +0 -1
  236. package/dist/hooks/cyclist-pretooluse-hook.js +0 -57
  237. package/dist/hooks/cyclist-pretooluse-hook.js.map +0 -1
  238. package/dist/hooks/pretooluse-hook.d.ts +0 -89
  239. package/dist/hooks/pretooluse-hook.d.ts.map +0 -1
  240. package/dist/hooks/pretooluse-hook.js +0 -235
  241. package/dist/hooks/pretooluse-hook.js.map +0 -1
  242. package/dist/notification-sound.d.ts +0 -59
  243. package/dist/notification-sound.d.ts.map +0 -1
  244. package/dist/notification-sound.js +0 -219
  245. package/dist/notification-sound.js.map +0 -1
  246. package/dist/plugin-loader.test.d.ts +0 -17
  247. package/dist/plugin-loader.test.d.ts.map +0 -1
  248. package/dist/plugin-loader.test.js +0 -407
  249. package/dist/plugin-loader.test.js.map +0 -1
  250. package/portraits/star-trek-tng/large/beverly-44352.png +0 -0
  251. package/portraits/star-trek-tng/large/data-55241.png +0 -0
  252. package/portraits/star-trek-tng/large/deanna-43353.png +0 -0
  253. package/portraits/star-trek-tng/large/geordi-54342.png +0 -0
  254. package/portraits/star-trek-tng/large/jean-luc-45342.png +0 -0
  255. package/portraits/star-trek-tng/large/kathryn-45332.png +0 -0
  256. package/portraits/star-trek-tng/large/miles-35342.png +0 -0
  257. package/portraits/star-trek-tng/large/q-53521.png +0 -0
  258. package/portraits/star-trek-tng/large/spock-45231.png +0 -0
  259. package/portraits/star-trek-tng/large/troi-44352.png +0 -0
  260. package/portraits/star-trek-tng/medium/beverly-44352.png +0 -0
  261. package/portraits/star-trek-tng/medium/data-55241.png +0 -0
  262. package/portraits/star-trek-tng/medium/deanna-43353.png +0 -0
  263. package/portraits/star-trek-tng/medium/geordi-54342.png +0 -0
  264. package/portraits/star-trek-tng/medium/jean-luc-45342.png +0 -0
  265. package/portraits/star-trek-tng/medium/kathryn-45332.png +0 -0
  266. package/portraits/star-trek-tng/medium/miles-35342.png +0 -0
  267. package/portraits/star-trek-tng/medium/q-53521.png +0 -0
  268. package/portraits/star-trek-tng/medium/spock-45231.png +0 -0
  269. package/portraits/star-trek-tng/medium/troi-44352.png +0 -0
  270. package/src/public/components/panels/TTYPanel.tsx +0 -299
  271. package/src/public/types/electron.d.ts +0 -18
@@ -1,61 +1,2 @@
1
- import { Router } from 'express';
2
- /**
3
- * Agent character mapping from theme
4
- */
5
- export interface AgentCharacterMap {
6
- [role: string]: {
7
- character: string;
8
- shortName?: string;
9
- };
10
- }
11
- /**
12
- * MSSCI-12403: Enhanced agent data for persona popup team roster
13
- */
14
- export interface EnhancedThemeAgent {
15
- role: string;
16
- character: string;
17
- shortName?: string;
18
- style: string;
19
- background: string;
20
- quirks: string[];
21
- slug: string;
22
- lift?: number;
23
- ocean?: {
24
- O: number;
25
- C: number;
26
- E: number;
27
- A: number;
28
- N: number;
29
- };
30
- helper?: {
31
- name: string;
32
- style: string;
33
- plural?: boolean;
34
- };
35
- }
36
- /**
37
- * MSSCI-12403: Full theme data including tier and all agents
38
- */
39
- export interface EnhancedThemeData {
40
- theme: string;
41
- themeName: string;
42
- tier: 'S' | 'A' | 'B' | 'C' | null;
43
- agents: EnhancedThemeAgent[];
44
- }
45
- /**
46
- * Get all agent-to-character mappings from current theme
47
- * @param projectDir - The project directory
48
- * @returns Map of role -> character data
49
- */
50
- export declare function getThemeAgents(projectDir: string): AgentCharacterMap | null;
51
- /**
52
- * MSSCI-12403: Get enhanced theme data with full agent details for persona popup
53
- * @param projectDir - The project directory
54
- * @returns Full theme data including tier and detailed agent info
55
- */
56
- export declare function getEnhancedThemeData(projectDir: string): EnhancedThemeData | null;
57
- /**
58
- * Create theme agents API router
59
- */
60
- export declare function createThemeAgentsRouter(getProjectDir: () => string): Router;
1
+ export * from '@pennyfarthing/core/dist/server/api/theme-agents.js';
61
2
  //# sourceMappingURL=theme-agents.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme-agents.d.ts","sourceRo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E,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAwFjF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,MAAM,MAAM,GAAG,MAAM,CAwB3E"}
1
+ {"version":3,"file":"theme-agents.d.ts","sourceRoot":"","sources":["../../src/api/theme-agents.ts"],"names":[],"mappings":"AACA,cAAc,qDAAqD,CAAC"}
@@ -1,214 +1,3 @@
1
- import { Router } from 'express';
2
- import { existsSync, readFileSync } from 'fs';
3
- import { join, dirname } from 'path';
4
- import { fileURLToPath } from 'url';
5
- import { parse as parseYaml } from 'yaml';
6
- import { detectPennyfarthingProject, loadThemeConfig, loadThemeYaml } from '../pennyfarthing.js';
7
- // ESM-compatible __dirname equivalent
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = dirname(__filename);
10
- const CYCLIST_ROOT = join(__dirname, '..', '..', '..', '..'); // packages/cyclist/src/api -> pennyfarthing-2
11
- /**
12
- * Convert a name to a URL-safe slug (lowercase kebab-case)
13
- */
14
- function toSlug(name) {
15
- return name
16
- .toLowerCase()
17
- .replace(/[^a-z0-9]+/g, '-')
18
- .replace(/^-|-$/g, '');
19
- }
20
- /**
21
- * Generate OCEAN suffix from scores (e.g., "54432")
22
- */
23
- function oceanSuffix(ocean) {
24
- return `${ocean.O}${ocean.C}${ocean.E}${ocean.A}${ocean.N}`;
25
- }
26
- /**
27
- * Generate character slug from shortName and OCEAN scores
28
- */
29
- function generateSlug(shortName, ocean) {
30
- const baseSlug = toSlug(shortName);
31
- return `${baseSlug}-${oceanSuffix(ocean)}`;
32
- }
33
- /**
34
- * Humanize a slug/kebab-case string to title case
35
- */
36
- function humanize(str) {
37
- if (!str)
38
- return '';
39
- const smallWords = ['of', 'the', 'a', 'an', 'and', 'or', 'but', 'in', 'on', 'at', 'to', 'for'];
40
- return str
41
- .split('-')
42
- .map((word, index) => {
43
- const lower = word.toLowerCase();
44
- if (index === 0 || !smallWords.includes(lower)) {
45
- return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
46
- }
47
- return lower;
48
- })
49
- .join(' ');
50
- }
51
- /**
52
- * Find theme file path checking multiple locations
53
- */
54
- function findThemePath(projectDir, themeName) {
55
- const possiblePaths = [];
56
- // 1. Packaged Electron app: Contents/Resources/pennyfarthing-dist/personas/themes
57
- if (process.resourcesPath) {
58
- possiblePaths.push(join(process.resourcesPath, 'pennyfarthing-dist', 'personas', 'themes', `${themeName}.yaml`));
59
- }
60
- // 2. Runtime via symlinks: .pennyfarthing/personas/themes (orchestrator pattern)
61
- possiblePaths.push(join(projectDir, '.pennyfarthing', 'personas', 'themes', `${themeName}.yaml`));
62
- // 3. Development mode: relative to cyclist package (pennyfarthing-2/pennyfarthing-dist)
63
- possiblePaths.push(join(CYCLIST_ROOT, 'pennyfarthing-dist', 'personas', 'themes', `${themeName}.yaml`));
64
- // 4. Legacy and fallback project directory paths
65
- possiblePaths.push(join(projectDir, '.claude', 'personas', 'themes', `${themeName}.yaml`), join(projectDir, '.claude', 'pennyfarthing', 'themes', `${themeName}.yaml`), join(projectDir, 'pennyfarthing-dist', 'personas', 'themes', `${themeName}.yaml`), join(projectDir, 'node_modules', '@pennyfarthing', 'core', 'pennyfarthing-dist', 'personas', 'themes', `${themeName}.yaml`));
66
- for (const path of possiblePaths) {
67
- if (existsSync(path)) {
68
- return path;
69
- }
70
- }
71
- return null;
72
- }
73
- /**
74
- * Get all agent-to-character mappings from current theme
75
- * @param projectDir - The project directory
76
- * @returns Map of role -> character data
77
- */
78
- export function getThemeAgents(projectDir) {
79
- if (!detectPennyfarthingProject(projectDir)) {
80
- return null;
81
- }
82
- const config = loadThemeConfig(projectDir);
83
- if (!config) {
84
- return null;
85
- }
86
- const themePath = findThemePath(projectDir, config.theme);
87
- if (!themePath) {
88
- return null;
89
- }
90
- const agents = loadThemeYaml(themePath);
91
- if (!agents) {
92
- return null;
93
- }
94
- // Build mapping of role -> character info
95
- const result = {};
96
- for (const [role, persona] of Object.entries(agents)) {
97
- result[role] = {
98
- character: persona.character,
99
- shortName: persona.shortName,
100
- };
101
- }
102
- return result;
103
- }
104
- /**
105
- * MSSCI-12403: Get enhanced theme data with full agent details for persona popup
106
- * @param projectDir - The project directory
107
- * @returns Full theme data including tier and detailed agent info
108
- */
109
- export function getEnhancedThemeData(projectDir) {
110
- if (!detectPennyfarthingProject(projectDir)) {
111
- return null;
112
- }
113
- const config = loadThemeConfig(projectDir);
114
- if (!config) {
115
- return null;
116
- }
117
- const themePath = findThemePath(projectDir, config.theme);
118
- if (!themePath) {
119
- return null;
120
- }
121
- // Load full theme YAML
122
- let themeData;
123
- try {
124
- const content = readFileSync(themePath, 'utf-8');
125
- themeData = parseYaml(content);
126
- }
127
- catch {
128
- return null;
129
- }
130
- const themeMetadata = themeData.theme;
131
- const agents = themeData.agents;
132
- if (!agents) {
133
- return null;
134
- }
135
- // Extract theme-level metadata
136
- const tier = themeMetadata?.tier || null;
137
- const themeName = themeMetadata?.name || humanize(config.theme);
138
- // Build enhanced agent list
139
- const enhancedAgents = [];
140
- for (const [role, rawAgent] of Object.entries(agents)) {
141
- const character = rawAgent.character;
142
- const shortName = rawAgent.shortName || character.split(' ')[0];
143
- const style = rawAgent.style || '';
144
- const background = rawAgent.role || ''; // 'role' in theme YAML is character background
145
- const quirks = rawAgent.quirks || [];
146
- const ocean = rawAgent.ocean;
147
- const rawHelper = rawAgent.helper;
148
- const helper = rawHelper?.name ? { name: rawHelper.name, style: rawHelper.style || '', ...(rawHelper.plural ? { plural: true } : {}) } : undefined;
149
- // Generate portrait slug
150
- const slug = ocean ? generateSlug(shortName, ocean) : role;
151
- // Extract lift from YAML comments (stored in special field if present)
152
- // For now, we'll parse from the YAML comment pattern "JOB FAIR OPTIMIZED: ... (+X.X over ...)"
153
- // This would need the raw YAML to parse, so we'll leave as undefined for now
154
- // TODO: Add lift field to theme YAML schema
155
- const lift = undefined;
156
- enhancedAgents.push({
157
- role,
158
- character,
159
- shortName,
160
- style,
161
- background,
162
- quirks,
163
- slug,
164
- lift,
165
- ocean,
166
- helper,
167
- });
168
- }
169
- // Sort agents by a consistent order (orchestrator, sm, tea, dev, reviewer, architect, pm, tech-writer, ux-designer, devops, ba)
170
- const roleOrder = ['orchestrator', 'sm', 'tea', 'dev', 'reviewer', 'architect', 'pm', 'tech-writer', 'ux-designer', 'devops', 'ba'];
171
- enhancedAgents.sort((a, b) => {
172
- const aIndex = roleOrder.indexOf(a.role);
173
- const bIndex = roleOrder.indexOf(b.role);
174
- if (aIndex === -1 && bIndex === -1)
175
- return a.role.localeCompare(b.role);
176
- if (aIndex === -1)
177
- return 1;
178
- if (bIndex === -1)
179
- return -1;
180
- return aIndex - bIndex;
181
- });
182
- return {
183
- theme: config.theme,
184
- themeName,
185
- tier: tier,
186
- agents: enhancedAgents,
187
- };
188
- }
189
- /**
190
- * Create theme agents API router
191
- */
192
- export function createThemeAgentsRouter(getProjectDir) {
193
- const router = Router();
194
- // Theme Agents API - GET all agent character mappings (legacy format)
195
- router.get('/', (_req, res) => {
196
- const projectDir = getProjectDir();
197
- const agents = getThemeAgents(projectDir);
198
- if (!agents) {
199
- return res.status(404).json({ error: 'No theme agents found' });
200
- }
201
- res.json(agents);
202
- });
203
- // MSSCI-12403: Enhanced theme data for persona popup team roster
204
- router.get('/full', (_req, res) => {
205
- const projectDir = getProjectDir();
206
- const themeData = getEnhancedThemeData(projectDir);
207
- if (!themeData) {
208
- return res.status(404).json({ error: 'No theme data found' });
209
- }
210
- res.json(themeData);
211
- });
212
- return router;
213
- }
1
+ // Re-export from @pennyfarthing/core (Story 98-17)
2
+ export * from '@pennyfarthing/core/dist/server/api/theme-agents.js';
214
3
  //# sourceMappingURL=theme-agents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme-agents.js","sourceRoot":"","sources":["../../src/api/theme-agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;A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AAC,CAAC;QAC1C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,uBAAuB,EAAE,CAAC,CAAC;QAClE,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,iEAAiE;IACjE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QAChC,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;QACnC,MAAM,SAAS,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACnD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC,CAAC;QAChE,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"theme-agents.js","sourceRoot":"","sources":["../../src/api/theme-agents.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,cAAc,qDAAqD,CAAC"}
@@ -1,33 +1,2 @@
1
- /**
2
- * Todos API Router
3
- *
4
- * Provides HTTP API endpoint for todo list data.
5
- * In web mode, todos are limited since they come from Claude's message stream
6
- * which is only available in Electron mode. This endpoint returns empty array
7
- * in web mode to allow graceful degradation.
8
- *
9
- * GET /api/todos - Get current todos (empty in web mode)
10
- */
11
- import { Router } from 'express';
12
- declare let webModeTodos: Array<{
13
- id: string;
14
- content: string;
15
- activeForm: string;
16
- status: 'pending' | 'in_progress' | 'completed';
17
- blockedBy?: string[];
18
- blocks?: string[];
19
- }>;
20
- /**
21
- * Update todos from external source (for future WebSocket integration)
22
- */
23
- export declare function setWebModeTodos(todos: typeof webModeTodos): void;
24
- /**
25
- * Get current web mode todos
26
- */
27
- export declare function getWebModeTodos(): typeof webModeTodos;
28
- /**
29
- * Create the todos router
30
- */
31
- export declare function createTodosRouter(): Router;
32
- export {};
1
+ export * from '@pennyfarthing/core/dist/server/api/todos.js';
33
2
  //# sourceMappingURL=todos.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"todos.d.ts","sourceRoot":"","sources":["../../src/api/todos.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAKjC,QAAA,IAAI,YAAY,EAAE,KAAK,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAM,CAAC;AAER;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,YAAY,GAAG,IAAI,CAEhE;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,YAAY,CAErD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAc1C"}
1
+ {"version":3,"file":"todos.d.ts","sourceRoot":"","sources":["../../src/api/todos.ts"],"names":[],"mappings":"AACA,cAAc,8CAA8C,CAAC"}
package/dist/api/todos.js CHANGED
@@ -1,44 +1,3 @@
1
- /**
2
- * Todos API Router
3
- *
4
- * Provides HTTP API endpoint for todo list data.
5
- * In web mode, todos are limited since they come from Claude's message stream
6
- * which is only available in Electron mode. This endpoint returns empty array
7
- * in web mode to allow graceful degradation.
8
- *
9
- * GET /api/todos - Get current todos (empty in web mode)
10
- */
11
- import { Router } from 'express';
12
- // In-memory todos store for web mode
13
- // In Electron mode, todos are managed by main.ts and accessed via IPC
14
- // In web mode, this could be populated via WebSocket in the future
15
- let webModeTodos = [];
16
- /**
17
- * Update todos from external source (for future WebSocket integration)
18
- */
19
- export function setWebModeTodos(todos) {
20
- webModeTodos = todos;
21
- }
22
- /**
23
- * Get current web mode todos
24
- */
25
- export function getWebModeTodos() {
26
- return webModeTodos;
27
- }
28
- /**
29
- * Create the todos router
30
- */
31
- export function createTodosRouter() {
32
- const router = Router();
33
- /**
34
- * GET / - Get current todos
35
- * Returns empty array in web mode (todos require Claude message stream)
36
- */
37
- router.get('/', (_req, res) => {
38
- // In web mode, return whatever todos we have (usually empty)
39
- // In the future, this could be populated via WebSocket from Claude stream
40
- res.json(webModeTodos);
41
- });
42
- return router;
43
- }
1
+ // Re-export from @pennyfarthing/core (Story 98-17)
2
+ export * from '@pennyfarthing/core/dist/server/api/todos.js';
44
3
  //# sourceMappingURL=todos.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"todos.js","sourceRoot":"","sources":["../../src/api/todos.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,qCAAqC;AACrC,sEAAsE;AACtE,mEAAmE;AACnE,IAAI,YAAY,GAOX,EAAE,CAAC;AAER;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAA0B;IACxD,YAAY,GAAG,KAAK,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QAC5B,6DAA6D;QAC7D,0EAA0E;QAC1E,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"todos.js","sourceRoot":"","sources":["../../src/api/todos.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,cAAc,8CAA8C,CAAC"}
@@ -1,8 +1,2 @@
1
- import { Router } from 'express';
2
- import { WebSocket } from 'ws';
3
- import { TokenStats } from '../otlp-receiver.js';
4
- export declare function getTokenStatsClients(): Set<WebSocket>;
5
- export declare function broadcastTokenStats(stats: TokenStats): void;
6
- export declare function createTokenStatsRouter(): Router;
7
- export declare function initTokenStatsBroadcast(): void;
1
+ export * from '@pennyfarthing/core/dist/server/api/token-stats.js';
8
2
  //# sourceMappingURL=token-stats.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-stats.d.ts","sourceRoot":"","sources":["../../src/api/token-stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAwC,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAMvF,wBAAgB,oBAAoB,IAAI,GAAG,CAAC,SAAS,CAAC,CAErD;AAGD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAO3D;AAGD,wBAAgB,sBAAsB,IAAI,MAAM,CAS/C;AAKD,wBAAgB,uBAAuB,IAAI,IAAI,CAI9C"}
1
+ {"version":3,"file":"token-stats.d.ts","sourceRoot":"","sources":["../../src/api/token-stats.ts"],"names":[],"mappings":"AACA,cAAc,oDAAoD,CAAC"}
@@ -1,36 +1,3 @@
1
- import { Router } from 'express';
2
- import { WebSocket } from 'ws';
3
- import { getTokenStats, addTokenStatsListener } from '../otlp-receiver.js';
4
- // Token stats WebSocket clients (for real-time updates)
5
- const tokenStatsClients = new Set();
6
- // Get token stats clients set (for WebSocket setup)
7
- export function getTokenStatsClients() {
8
- return tokenStatsClients;
9
- }
10
- // Broadcast token stats to all connected WebSocket clients
11
- export function broadcastTokenStats(stats) {
12
- const message = JSON.stringify(stats);
13
- for (const client of tokenStatsClients) {
14
- if (client.readyState === WebSocket.OPEN) {
15
- client.send(message);
16
- }
17
- }
18
- }
19
- // Create token stats API router
20
- export function createTokenStatsRouter() {
21
- const router = Router();
22
- // Token Stats API - GET current token stats
23
- router.get('/', (_req, res) => {
24
- res.json(getTokenStats());
25
- });
26
- return router;
27
- }
28
- // Initialize token stats listener for WebSocket broadcasts
29
- // Called once during server setup
30
- // Uses addTokenStatsListener to support multiple subscribers (e.g., IPC + WebSocket)
31
- export function initTokenStatsBroadcast() {
32
- addTokenStatsListener((stats) => {
33
- broadcastTokenStats(stats);
34
- });
35
- }
1
+ // Re-export from @pennyfarthing/core (Story 98-17)
2
+ export * from '@pennyfarthing/core/dist/server/api/token-stats.js';
36
3
  //# sourceMappingURL=token-stats.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-stats.js","sourceRoot":"","sources":["../../src/api/token-stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAc,MAAM,qBAAqB,CAAC;AAEvF,wDAAwD;AACxD,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAa,CAAC;AAE/C,oDAAoD;AACpD,MAAM,UAAU,oBAAoB;IAClC,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,mBAAmB,CAAC,KAAiB;IACnD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACtC,KAAK,MAAM,MAAM,IAAI,iBAAiB,EAAE,CAAC;QACvC,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC;YACzC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;AACH,CAAC;AAED,gCAAgC;AAChC,MAAM,UAAU,sBAAsB;IACpC,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;IAExB,4CAA4C;IAC5C,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QAC5B,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,2DAA2D;AAC3D,kCAAkC;AAClC,qFAAqF;AACrF,MAAM,UAAU,uBAAuB;IACrC,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE;QAC9B,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"token-stats.js","sourceRoot":"","sources":["../../src/api/token-stats.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,cAAc,oDAAoD,CAAC"}
@@ -1,22 +1,2 @@
1
- /**
2
- * Welcome API - Broadcasts welcome messages on session start
3
- *
4
- * When the SessionStart hook runs, it calls POST /api/welcome with
5
- * project name and theme. This module broadcasts that to all connected
6
- * WebSocket clients on /ws/welcome so Cyclist can display a welcome
7
- * message with the pennyfarthing logo.
8
- */
9
- import { WebSocket } from 'ws';
10
- export interface WelcomeMessage {
11
- project: string;
12
- theme: string;
13
- }
14
- /**
15
- * Get the set of connected welcome clients
16
- */
17
- export declare function getWelcomeClients(): Set<WebSocket>;
18
- /**
19
- * Broadcast a welcome message to all connected clients
20
- */
21
- export declare function broadcastWelcome(message: WelcomeMessage): void;
1
+ export * from '@pennyfarthing/core/dist/server/api/welcome.js';
22
2
  //# sourceMappingURL=welcome.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"welcome.d.ts","sourceRoot":"","sources":["../../src/api/welcome.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAK/B,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,CAAC,SAAS,CAAC,CAElD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAe9D"}
1
+ {"version":3,"file":"welcome.d.ts","sourceRoot":"","sources":["../../src/api/welcome.ts"],"names":[],"mappings":"AACA,cAAc,gDAAgD,CAAC"}
@@ -1,35 +1,3 @@
1
- /**
2
- * Welcome API - Broadcasts welcome messages on session start
3
- *
4
- * When the SessionStart hook runs, it calls POST /api/welcome with
5
- * project name and theme. This module broadcasts that to all connected
6
- * WebSocket clients on /ws/welcome so Cyclist can display a welcome
7
- * message with the pennyfarthing logo.
8
- */
9
- import { WebSocket } from 'ws';
10
- // WebSocket clients subscribed to welcome events
11
- const welcomeClients = new Set();
12
- /**
13
- * Get the set of connected welcome clients
14
- */
15
- export function getWelcomeClients() {
16
- return welcomeClients;
17
- }
18
- /**
19
- * Broadcast a welcome message to all connected clients
20
- */
21
- export function broadcastWelcome(message) {
22
- const payload = JSON.stringify({
23
- type: 'welcome',
24
- project: message.project,
25
- theme: message.theme,
26
- timestamp: Date.now(),
27
- });
28
- for (const client of welcomeClients) {
29
- if (client.readyState === WebSocket.OPEN) {
30
- client.send(payload);
31
- }
32
- }
33
- console.log(`[Welcome] Broadcast to ${welcomeClients.size} clients:`, message);
34
- }
1
+ // Re-export from @pennyfarthing/core (Story 98-17)
2
+ export * from '@pennyfarthing/core/dist/server/api/welcome.js';
35
3
  //# sourceMappingURL=welcome.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"welcome.js","sourceRoot":"","sources":["../../src/api/welcome.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B,iDAAiD;AACjD,MAAM,cAAc,GAAG,IAAI,GAAG,EAAa,CAAC;AAO5C;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAuB;IACtD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC;QAC7B,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;KACtB,CAAC,CAAC;IAEH,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE,CAAC;QACpC,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC;YACzC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,0BAA0B,cAAc,CAAC,IAAI,WAAW,EAAE,OAAO,CAAC,CAAC;AACjF,CAAC"}
1
+ {"version":3,"file":"welcome.js","sourceRoot":"","sources":["../../src/api/welcome.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,cAAc,gDAAgD,CAAC"}
package/dist/env.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Centralized gate — all mode checks go through this function.
3
+ * Returns true when IS_BIKERACK env var is set (by bikerack.ts entry point).
4
+ */
5
+ export declare function isBikeRackMode(): boolean;
6
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAExC"}
package/dist/env.js ADDED
@@ -0,0 +1,10 @@
1
+ // BikeRack mode detection (ADR-0024, Rule 1)
2
+ // Extracted to break circular import: server → api/index → mode → server
3
+ /**
4
+ * Centralized gate — all mode checks go through this function.
5
+ * Returns true when IS_BIKERACK env var is set (by bikerack.ts entry point).
6
+ */
7
+ export function isBikeRackMode() {
8
+ return process.env.IS_BIKERACK === '1';
9
+ }
10
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,yEAAyE;AAEzE;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,GAAG,CAAC;AACzC,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Focus panel management — reads/writes focus state from config.local.yaml
3
+ *
4
+ * Story 104-2: WheelHub config file watch + panel focus broadcast
5
+ * Epic 104: /bc CLI Panel Focus (MSSCI-14952)
6
+ *
7
+ * Extracted from websocket.ts for testability. The websocket module
8
+ * imports these functions and wires them into the WS channel + config watcher.
9
+ */
10
+ /** Valid panel IDs that can be focused */
11
+ export declare const VALID_FOCUS_PANELS: readonly ["sprint", "git", "diffs", "todo", "workflow", "background", "audit-log", "changed", "ac", "debug", "settings"];
12
+ export type FocusPanelId = typeof VALID_FOCUS_PANELS[number];
13
+ export interface FocusMessage {
14
+ type: 'init' | 'update';
15
+ focus: string | null;
16
+ }
17
+ /**
18
+ * Read the current focus value from config.local.yaml.
19
+ * Returns the panel ID string or null if no focus is set.
20
+ */
21
+ export declare function getConfigFocus(projectDir: string): string | null;
22
+ /**
23
+ * Determine if a focus broadcast should be sent.
24
+ * Only returns true when the focus value has actually changed.
25
+ */
26
+ export declare function shouldBroadcastFocus(newFocus: string | null, lastKnownFocus: string | null): boolean;
27
+ /**
28
+ * Create a focus WebSocket message payload.
29
+ */
30
+ export declare function createFocusMessage(type: 'init' | 'update', focus: string | null): FocusMessage;
31
+ /**
32
+ * Validate that a panel ID is a valid focus target.
33
+ */
34
+ export declare function isValidFocusPanel(panelId: string): boolean;
35
+ /**
36
+ * Read the last-viewed panel from config.local.yaml.
37
+ *
38
+ * Story 103-8: Panel persistence — single source of truth for last-viewed
39
+ * panel, shared between ERB (BikeRack) and TUI.
40
+ *
41
+ * Returns the panel ID string or null if not saved.
42
+ */
43
+ export declare function getLastPanel(projectDir: string): string | null;
44
+ /**
45
+ * Save the last-viewed panel to config.local.yaml.
46
+ *
47
+ * Story 103-8: Panel persistence — persists the active panel so it can
48
+ * be restored on next launch. Preserves other config keys.
49
+ *
50
+ * Returns true on success, false on failure.
51
+ */
52
+ export declare function saveLastPanel(projectDir: string, panelId: string): boolean;
53
+ //# sourceMappingURL=focus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../src/focus.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,0CAA0C;AAC1C,eAAO,MAAM,kBAAkB,0HAGrB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAahE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,cAAc,EAAE,MAAM,GAAG,IAAI,GAC5B,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,GAAG,QAAQ,EACvB,KAAK,EAAE,MAAM,GAAG,IAAI,GACnB,YAAY,CAEd;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAgB9D;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAyB1E"}