hammoc 1.7.2 → 1.8.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 (130) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -1
  3. package/packages/client/dist/assets/{agentExampleHighlight-De1SlBXH.js → agentExampleHighlight-B2IJxYzN.js} +1 -1
  4. package/packages/client/dist/assets/{commandTokenHighlight-COQi5YnH.js → commandTokenHighlight-BdGXkDR5.js} +1 -1
  5. package/packages/client/dist/assets/{index-D8XvfvVS.js → index-BFWGN51V.js} +1 -1
  6. package/packages/client/dist/assets/index-BX7y_Qt3.css +32 -0
  7. package/packages/client/dist/assets/{index-CQgqPGOG.js → index-lmx-m-iP.js} +552 -478
  8. package/packages/client/dist/assets/{snippetTokenHighlight-jMAHlrFd.js → snippetTokenHighlight-B9bH9Npx.js} +1 -1
  9. package/packages/client/dist/index.html +2 -2
  10. package/packages/client/dist/sw.js +1 -1
  11. package/packages/server/dist/app.d.ts.map +1 -1
  12. package/packages/server/dist/app.js +25 -1
  13. package/packages/server/dist/app.js.map +1 -1
  14. package/packages/server/dist/config/index.d.ts +10 -0
  15. package/packages/server/dist/config/index.d.ts.map +1 -1
  16. package/packages/server/dist/config/index.js +10 -0
  17. package/packages/server/dist/config/index.js.map +1 -1
  18. package/packages/server/dist/controllers/accountController.d.ts +19 -0
  19. package/packages/server/dist/controllers/accountController.d.ts.map +1 -0
  20. package/packages/server/dist/controllers/accountController.js +92 -0
  21. package/packages/server/dist/controllers/accountController.js.map +1 -0
  22. package/packages/server/dist/controllers/projectController.d.ts +1 -1
  23. package/packages/server/dist/controllers/projectController.d.ts.map +1 -1
  24. package/packages/server/dist/controllers/projectController.js +19 -5
  25. package/packages/server/dist/controllers/projectController.js.map +1 -1
  26. package/packages/server/dist/controllers/serverController.d.ts.map +1 -1
  27. package/packages/server/dist/controllers/serverController.js +8 -1
  28. package/packages/server/dist/controllers/serverController.js.map +1 -1
  29. package/packages/server/dist/handlers/websocket.d.ts.map +1 -1
  30. package/packages/server/dist/handlers/websocket.js +83 -6
  31. package/packages/server/dist/handlers/websocket.js.map +1 -1
  32. package/packages/server/dist/index.js +8 -0
  33. package/packages/server/dist/index.js.map +1 -1
  34. package/packages/server/dist/middleware/session.d.ts.map +1 -1
  35. package/packages/server/dist/middleware/session.js +7 -5
  36. package/packages/server/dist/middleware/session.js.map +1 -1
  37. package/packages/server/dist/routes/accounts.d.ts +13 -0
  38. package/packages/server/dist/routes/accounts.d.ts.map +1 -0
  39. package/packages/server/dist/routes/accounts.js +18 -0
  40. package/packages/server/dist/routes/accounts.js.map +1 -0
  41. package/packages/server/dist/routes/config.d.ts +3 -0
  42. package/packages/server/dist/routes/config.d.ts.map +1 -0
  43. package/packages/server/dist/routes/config.js +59 -0
  44. package/packages/server/dist/routes/config.js.map +1 -0
  45. package/packages/server/dist/routes/preferences.d.ts.map +1 -1
  46. package/packages/server/dist/routes/preferences.js +22 -4
  47. package/packages/server/dist/routes/preferences.js.map +1 -1
  48. package/packages/server/dist/services/accountInfoService.js +6 -6
  49. package/packages/server/dist/services/accountInfoService.js.map +1 -1
  50. package/packages/server/dist/services/accountStorageService.d.ts +119 -0
  51. package/packages/server/dist/services/accountStorageService.d.ts.map +1 -0
  52. package/packages/server/dist/services/accountStorageService.js +285 -0
  53. package/packages/server/dist/services/accountStorageService.js.map +1 -0
  54. package/packages/server/dist/services/chatService.d.ts.map +1 -1
  55. package/packages/server/dist/services/chatService.js +4 -8
  56. package/packages/server/dist/services/chatService.js.map +1 -1
  57. package/packages/server/dist/services/claudeLoginService.d.ts +124 -0
  58. package/packages/server/dist/services/claudeLoginService.d.ts.map +1 -0
  59. package/packages/server/dist/services/claudeLoginService.js +417 -0
  60. package/packages/server/dist/services/claudeLoginService.js.map +1 -0
  61. package/packages/server/dist/services/cliChatEngine.d.ts.map +1 -1
  62. package/packages/server/dist/services/cliChatEngine.js +85 -33
  63. package/packages/server/dist/services/cliChatEngine.js.map +1 -1
  64. package/packages/server/dist/services/cliGridCards.d.ts +30 -10
  65. package/packages/server/dist/services/cliGridCards.d.ts.map +1 -1
  66. package/packages/server/dist/services/cliGridCards.js +80 -34
  67. package/packages/server/dist/services/cliGridCards.js.map +1 -1
  68. package/packages/server/dist/services/cliModalDetect.d.ts +15 -7
  69. package/packages/server/dist/services/cliModalDetect.d.ts.map +1 -1
  70. package/packages/server/dist/services/cliModalDetect.js +16 -12
  71. package/packages/server/dist/services/cliModalDetect.js.map +1 -1
  72. package/packages/server/dist/services/cliScreenModel.d.ts +3 -2
  73. package/packages/server/dist/services/cliScreenModel.d.ts.map +1 -1
  74. package/packages/server/dist/services/cliScreenModel.js +2 -0
  75. package/packages/server/dist/services/cliScreenModel.js.map +1 -1
  76. package/packages/server/dist/services/cliService.d.ts.map +1 -1
  77. package/packages/server/dist/services/cliService.js +2 -7
  78. package/packages/server/dist/services/cliService.js.map +1 -1
  79. package/packages/server/dist/services/cliSessionPool.d.ts +13 -1
  80. package/packages/server/dist/services/cliSessionPool.d.ts.map +1 -1
  81. package/packages/server/dist/services/cliSessionPool.js +14 -4
  82. package/packages/server/dist/services/cliSessionPool.js.map +1 -1
  83. package/packages/server/dist/services/preferencesService.d.ts +1 -0
  84. package/packages/server/dist/services/preferencesService.d.ts.map +1 -1
  85. package/packages/server/dist/services/preferencesService.js +25 -2
  86. package/packages/server/dist/services/preferencesService.js.map +1 -1
  87. package/packages/server/dist/services/queueService.d.ts +1 -0
  88. package/packages/server/dist/services/queueService.d.ts.map +1 -1
  89. package/packages/server/dist/services/queueService.js +3 -0
  90. package/packages/server/dist/services/queueService.js.map +1 -1
  91. package/packages/server/dist/services/rateLimitProbeService.d.ts +7 -0
  92. package/packages/server/dist/services/rateLimitProbeService.d.ts.map +1 -1
  93. package/packages/server/dist/services/rateLimitProbeService.js +10 -0
  94. package/packages/server/dist/services/rateLimitProbeService.js.map +1 -1
  95. package/packages/server/dist/services/workspaceContext.d.ts +29 -3
  96. package/packages/server/dist/services/workspaceContext.d.ts.map +1 -1
  97. package/packages/server/dist/services/workspaceContext.js +100 -8
  98. package/packages/server/dist/services/workspaceContext.js.map +1 -1
  99. package/packages/server/dist/snippets/promote-to-story +86 -9
  100. package/packages/server/dist/utils/cliDebugLog.d.ts +6 -5
  101. package/packages/server/dist/utils/cliDebugLog.d.ts.map +1 -1
  102. package/packages/server/dist/utils/cliDebugLog.js +11 -8
  103. package/packages/server/dist/utils/cliDebugLog.js.map +1 -1
  104. package/packages/server/dist/utils/logger.d.ts +7 -0
  105. package/packages/server/dist/utils/logger.d.ts.map +1 -1
  106. package/packages/server/dist/utils/logger.js +13 -1
  107. package/packages/server/dist/utils/logger.js.map +1 -1
  108. package/packages/server/resources/manual/01-getting-started.md +11 -5
  109. package/packages/server/resources/manual/03-sessions.md +1 -0
  110. package/packages/server/resources/manual/04-slash-commands-favorites.md +1 -0
  111. package/packages/server/resources/manual/13-settings.md +34 -10
  112. package/packages/server/resources/manual/16-troubleshooting.md +4 -7
  113. package/packages/shared/dist/index.d.ts +2 -1
  114. package/packages/shared/dist/index.d.ts.map +1 -1
  115. package/packages/shared/dist/index.js +2 -0
  116. package/packages/shared/dist/index.js.map +1 -1
  117. package/packages/shared/dist/types/accounts.d.ts +104 -0
  118. package/packages/shared/dist/types/accounts.d.ts.map +1 -0
  119. package/packages/shared/dist/types/accounts.js +14 -0
  120. package/packages/shared/dist/types/accounts.js.map +1 -0
  121. package/packages/shared/dist/types/preferences.d.ts +39 -0
  122. package/packages/shared/dist/types/preferences.d.ts.map +1 -1
  123. package/packages/shared/dist/types/preferences.js.map +1 -1
  124. package/packages/shared/dist/types/sdk.d.ts +3 -1
  125. package/packages/shared/dist/types/sdk.d.ts.map +1 -1
  126. package/packages/shared/dist/types/sdk.js.map +1 -1
  127. package/packages/shared/dist/types/websocket.d.ts +23 -1
  128. package/packages/shared/dist/types/websocket.d.ts.map +1 -1
  129. package/packages/client/dist/assets/index-BsHMOF5r.css +0 -32
  130. package/packages/server/dist/snippets/promote-issue +0 -9
@@ -1,9 +1,86 @@
1
- /BMad:agents:pm
2
- ---
3
- *create-brownfield-story
4
-
5
- Read the issue file {arg1} and use it as context.
6
- ---
7
- *doc-out
8
-
9
- Save the story document to the appropriate project directory.
1
+ /BMad:agents:pm
2
+ ---
3
+ *create-brownfield-story
4
+
5
+ Read the issue file {arg1} and use it as context.
6
+
7
+ Write the story document using this template structure:
8
+
9
+ ```markdown
10
+ # Story: {title derived from issue}
11
+
12
+ ## Status
13
+
14
+ Draft
15
+
16
+ ## Story
17
+
18
+ **As a** {user role},
19
+ **I want** {desired feature/change},
20
+ **So that** {benefit/value}.
21
+
22
+ ## Story Context
23
+
24
+ | Item | Detail |
25
+ |------|--------|
26
+ | **Integrates with** | {existing modules/services affected} |
27
+ | **Technology** | {tech stack involved} |
28
+ | **Follows pattern** | {existing patterns to follow} |
29
+ | **Touch points** | {data flow: module → module → module} |
30
+
31
+ ## Acceptance Criteria
32
+
33
+ ### {Requirement Group 1}
34
+
35
+ 1. {Specific, testable criterion}
36
+ 2. ...
37
+
38
+ ### {Requirement Group 2}
39
+
40
+ 3. ...
41
+
42
+ ## Tasks / Subtasks
43
+
44
+ - [ ] Task 1: {title} (AC: {linked AC numbers})
45
+ - {implementation detail with file paths}
46
+
47
+ ## Dev Notes
48
+
49
+ ### Relevant Source Tree
50
+
51
+ {ASCII tree of affected files}
52
+
53
+ ### {Implementation Section Title}
54
+
55
+ {Key constraints, current code snippets, migration notes}
56
+
57
+ ## Risk Assessment
58
+
59
+ | Item | Detail |
60
+ |------|--------|
61
+ | **Primary risk** | {what could go wrong} |
62
+ | **Mitigation** | {how to prevent it} |
63
+ | **Rollback** | {how to undo if needed} |
64
+
65
+ ## Definition of Done
66
+
67
+ - [ ] {criterion matching each AC group}
68
+ - [ ] All tests pass
69
+ - [ ] No regression in existing functionality
70
+
71
+ ## File List
72
+
73
+ | File | Action | Description |
74
+ |------|--------|-------------|
75
+ | {path} | {Created/Modified/Deleted} | {what changed} |
76
+
77
+ ## Change Log
78
+
79
+ | Date | Version | Description | Author |
80
+ |------|---------|-------------|--------|
81
+ | {today} | 0.1 | Initial draft | {agent} |
82
+ ```
83
+ ---
84
+ *doc-out
85
+
86
+ Save the story document to `docs/stories/` with the filename pattern `BS-{N}.{kebab-case-title}.story.md`, where {N} is one greater than the highest existing BS- number in that directory.
@@ -7,10 +7,11 @@
7
7
  * land in ONE chronological file so a post-mortem can diff server-emitted vs
8
8
  * client-received at each timestamp.
9
9
  *
10
- * Activation: opt-in via the HAMMOC_CLI_DEBUG env var (off by default). When unset the logger
11
- * is a no-op no directory, no file, no writes — so a released install never accumulates
12
- * per-turn JSONL files on the user's disk. When set, one WriteStream per turn (best-effort)
13
- * writes under `logs/cli-debug/` (gitignored).
10
+ * Activation: opt-in via the `enabled` constructor flag (off by default), which the caller
11
+ * resolves from the debugCliTrace preference with a HAMMOC_CLI_DEBUG env var fallback
12
+ * (Story BS-6). When disabled the logger is a no-op — no directory, no file, no writes — so
13
+ * a released install never accumulates per-turn JSONL files on the user's disk. When enabled,
14
+ * one WriteStream per turn (best-effort) writes under `logs/cli-debug/` (gitignored).
14
15
  *
15
16
  * Format (one JSON line per entry):
16
17
  * {"ts":"2026-06-20T10:15:32.123Z","src":"S","ev":"grid-card-emit","d":{...}}
@@ -27,7 +28,7 @@ export interface CliDebugLogEntry {
27
28
  export declare class CliDebugLog {
28
29
  private stream;
29
30
  readonly filePath: string;
30
- constructor(sessionId: string);
31
+ constructor(sessionId: string, enabled: boolean);
31
32
  /** Server-side decision log. */
32
33
  server(event: string, data?: Record<string, unknown>): void;
33
34
  /** Client-side decision log (relayed from browser via socket). */
@@ -1 +1 @@
1
- {"version":3,"file":"cliDebugLog.d.ts","sourceRoot":"","sources":["../../src/utils/cliDebugLog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,GAAG,GA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MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI3D,kEAAkE;IAClE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI3D,yEAAyE;IACzE,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI7E,KAAK,IAAI,IAAI;IAKb,OAAO,CAAC,KAAK;CAMd"}
@@ -7,10 +7,11 @@
7
7
  * land in ONE chronological file so a post-mortem can diff server-emitted vs
8
8
  * client-received at each timestamp.
9
9
  *
10
- * Activation: opt-in via the HAMMOC_CLI_DEBUG env var (off by default). When unset the logger
11
- * is a no-op no directory, no file, no writes — so a released install never accumulates
12
- * per-turn JSONL files on the user's disk. When set, one WriteStream per turn (best-effort)
13
- * writes under `logs/cli-debug/` (gitignored).
10
+ * Activation: opt-in via the `enabled` constructor flag (off by default), which the caller
11
+ * resolves from the debugCliTrace preference with a HAMMOC_CLI_DEBUG env var fallback
12
+ * (Story BS-6). When disabled the logger is a no-op — no directory, no file, no writes — so
13
+ * a released install never accumulates per-turn JSONL files on the user's disk. When enabled,
14
+ * one WriteStream per turn (best-effort) writes under `logs/cli-debug/` (gitignored).
14
15
  *
15
16
  * Format (one JSON line per entry):
16
17
  * {"ts":"2026-06-20T10:15:32.123Z","src":"S","ev":"grid-card-emit","d":{...}}
@@ -24,13 +25,15 @@ const LOG_DIR = path.join(process.cwd(), 'logs', 'cli-debug');
24
25
  export class CliDebugLog {
25
26
  stream = null;
26
27
  filePath;
27
- constructor(sessionId) {
28
+ constructor(sessionId, enabled) {
28
29
  const sid = sessionId || 'unknown';
29
30
  const fname = `${sid}-${Date.now()}.jsonl`;
30
31
  this.filePath = path.join(LOG_DIR, fname);
31
- // Opt-in: only open the trace file when HAMMOC_CLI_DEBUG is set. Off by default the
32
- // stream stays null and every write() below is a no-op (no directory, no file created).
33
- if (!process.env.HAMMOC_CLI_DEBUG)
32
+ // Opt-in: only open the trace file when enabled (resolved by the caller from the
33
+ // debugCliTrace preference, falling back to the HAMMOC_CLI_DEBUG env var Story BS-6).
34
+ // Off by default → the stream stays null and every write() below is a no-op (no
35
+ // directory, no file created).
36
+ if (!enabled)
34
37
  return;
35
38
  try {
36
39
  mkdirSync(LOG_DIR, { recursive: true });
@@ -1 +1 @@
1
- {"version":3,"file":"cliDebugLog.js","sourceRoot":"","sources":["../../src/utils/cliDebugLog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAoB,MAAM,IAAI,CAAC;AACpE,OAAO,IAAI,MAAM,MAAM,CAAC;AASxB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;AAE9D,MAAM,OAAO,WAAW;IACd,MAAM,GAAuB,IAAI,CAAC;IACjC,QAAQ,CAAS;IAE1B,YAAY,SAAiB;QAC3B,MAAM,GAAG,GAAG,SAAS,IAAI,SAAS,CAAC;QACnC,MAAM,KAAK,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC1C,sFAAsF;QACtF,wFAAwF;QACxF,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB;YAAE,OAAO;QAC1C,IAAI,CAAC;YACH,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACxC,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC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AC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QAClD,CAAC;QAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;IAC/B,CAAC;CACF"}
@@ -25,4 +25,11 @@ export interface Logger {
25
25
  export declare function createLogger(module: string): Logger;
26
26
  /** Get current effective log level (for display/diagnostics) */
27
27
  export declare function getEffectiveLogLevel(): LogLevel;
28
+ /**
29
+ * Change the active log level at runtime (Story BS-6 debug settings panel).
30
+ * Takes effect immediately for all loggers (they share this module-level `currentLevel`),
31
+ * with no server restart. Does not persist — the caller (preferences route) persists the
32
+ * preference separately, and the level re-initializes from env on the next boot.
33
+ */
34
+ export declare function setLogLevel(level: LogLevel): void;
28
35
  //# sourceMappingURL=logger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,QAAQ,EAAiB,MAAM,gBAAgB,CAAC;AA8DzD,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjD,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CACpD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQnD;AAED,gEAAgE;AAChE,wBAAgB,oBAAoB,IAAI,QAAQ,CAE/C"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,QAAQ,EAAiB,MAAM,gBAAgB,CAAC;AAiEzD,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjD,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CACpD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQnD;AAED,gEAAgE;AAChE,wBAAgB,oBAAoB,IAAI,QAAQ,CAE/C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAEjD"}
@@ -18,7 +18,10 @@ import { LogLevel, parseLogLevel } from '@hammoc/shared';
18
18
  // Reads process.env directly (not from config/index.ts) to avoid circular dependency
19
19
  const envLevel = parseLogLevel(process.env.LOG_LEVEL);
20
20
  const isProduction = process.env.NODE_ENV === 'production';
21
- const currentLevel = envLevel ?? (isProduction ? LogLevel.INFO : LogLevel.DEBUG);
21
+ // `let` (not `const`) so the debug settings panel can change the active level at runtime
22
+ // via setLogLevel() — see Story BS-6. Initialized from process.env.LOG_LEVEL at module
23
+ // load (config is intentionally NOT imported here to avoid a circular dependency).
24
+ let currentLevel = envLevel ?? (isProduction ? LogLevel.INFO : LogLevel.DEBUG);
22
25
  // Ensure logs directory exists
23
26
  const logsDir = path.join(process.cwd(), 'logs');
24
27
  if (!existsSync(logsDir)) {
@@ -84,4 +87,13 @@ export function createLogger(module) {
84
87
  export function getEffectiveLogLevel() {
85
88
  return currentLevel;
86
89
  }
90
+ /**
91
+ * Change the active log level at runtime (Story BS-6 debug settings panel).
92
+ * Takes effect immediately for all loggers (they share this module-level `currentLevel`),
93
+ * with no server restart. Does not persist — the caller (preferences route) persists the
94
+ * preference separately, and the level re-initializes from env on the next boot.
95
+ */
96
+ export function setLogLevel(level) {
97
+ currentLevel = level;
98
+ }
87
99
  //# sourceMappingURL=logger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEzD,+CAA+C;AAC/C,qFAAqF;AACrF,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACtD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC;AAC3D,MAAM,YAAY,GAAa,QAAQ,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAE3F,+BAA+B;AAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;AACjD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;IACzB,SAAS,CAAC,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EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAClG,IAAI,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAChG,IAAI,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAChG,KAAK,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAClG,OAAO,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;KACvG,CAAC;AACJ,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,oBAAoB;IAClC,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,KAAe;IACzC,YAAY,GAAG,KAAK,CAAC;AACvB,CAAC"}
@@ -32,11 +32,17 @@ npm run dev
32
32
 
33
33
  ### 1.3 First Launch
34
34
 
35
- 1. Open http://localhost:3000 in your browser
36
- 2. **Password Setup**: Set an admin password on first visit. This protects your instance from unauthorized access.
37
- 3. **Login**: Enter your password to sign in. **"Stay signed in"** keeps you logged in for 30 days (checked by default). After too many failed attempts, login is temporarily locked with a countdown timer.
38
- 4. **CLI Verification**: The onboarding wizard checks that Claude Code CLI is installed and authenticated. Follow the prompts if any step fails.
39
- 5. **Project Selection**: Choose an existing Claude Code project or create a new one.
35
+ Open http://localhost:3000 in your browser. A multi-step onboarding wizard walks you through initial setup. Steps that are already configured are automatically skipped — returning users go straight to the login screen.
36
+
37
+ 1. **Display Name** Optionally set a name for the AI to use when addressing you (can also be changed later in Settings, see §13.12). Click **Next** or **Skip**
38
+ 2. **Password** Set an admin password (minimum 4 characters) to protect your instance. On return visits this step becomes a login screen instead. After too many failed attempts, login is temporarily locked with a countdown timer
39
+ 3. **Auth Method** Choose how to connect to Claude:
40
+ - **Claude subscription** — Sign in with a Pro, Max, Team, or Enterprise account. An OAuth flow opens the authorization page in a new tab; copy the authorization code back into the wizard to complete sign-in
41
+ - **API key** — Enter an Anthropic API key directly (format: `sk-ant-...`)
42
+ 4. **First Project** — Enter a project directory path or click **Browse** to pick a folder visually (see §5.2 for the directory picker). Click **Skip** to add a project later
43
+ 5. **All Set** — Confirmation screen with auto-redirect to the home page
44
+
45
+ Use the **Back** button or `Escape` to return to a previous step at any time.
40
46
 
41
47
  ### 1.4 Mobile Access
42
48
 
@@ -15,6 +15,7 @@ Access the session list via the sidebar or quick panel:
15
15
  - **Pending question indicator** — Cyan pulsing dot with "Awaiting selection" badge when a session has an active `AskUserQuestion` waiting for user input. Appears alongside the session entry so you can spot sessions that need attention without opening each one
16
16
  - **Queue badge** — Shown when queue runner is active on the session
17
17
  - **Early visibility** — New sessions appear in the list as soon as a message is sent, with no brief delay
18
+ - **Active session promotion** — When a session starts streaming, it jumps to the top of the list so the session you're actively using stays the most visible
18
19
  - Empty sessions are hidden by default (toggle with the eye icon)
19
20
 
20
21
  ### 3.2 Creating a New Session
@@ -82,6 +82,7 @@ Type `%` in the chat input to open the snippet autocomplete popup:
82
82
 
83
83
  - **Grouped by source** — Sections labeled "Project", "Global", and "Bundled"
84
84
  - **Preview** — Shows the first line of each snippet's content (up to 80 characters)
85
+ - **Expand full content** — Each row has a chevron (▸) toggle on the right; click it to reveal an inline, scrollable preview of the snippet's entire body in monospace, so you can confirm what you're inserting before committing to it. Only one snippet stays expanded at a time, and arrow-key navigation does not auto-expand — you expand on demand. Content is cached after the first load for instant reopen
85
86
  - **Real-time filtering** — Type after `%` to filter by name or preview text (case-insensitive)
86
87
  - **Keyboard navigation** — ArrowUp/Down to navigate, Enter or Tab to select, Escape to close
87
88
  - **Click** to select a snippet
@@ -187,13 +187,37 @@ Get notified on your phone when Claude needs attention:
187
187
 
188
188
  ### 13.14 Claude Account
189
189
 
190
- Shows the Claude Code account that Hammoc is using, plus live subscription usage:
190
+ Shows the Claude Code account that Hammoc is using, plus live subscription usage. Also provides in-app sign-in and multi-account management.
191
+
192
+ **Active account info:**
191
193
 
192
194
  - **Account info** — Email, Subscription plan, Provider (e.g., Claude API / Claude.ai), Organization (if applicable), and the timestamp of the last fetch
193
195
  - **Usage bars** — Two progress bars showing consumption of the **5-hour window** and **7-day window** quotas, with color thresholds (green / yellow / red at 50% / 80%) and reset times
194
196
  - **Refresh** — Manually fetch the latest account info and usage from the API (spinner shown while refreshing). Toast confirms success or failure
197
+ - **Sign out** — Log out of the active Claude account
195
198
  - If no data has been fetched yet, a helper line explains that account info fills in automatically after the first chat or after clicking Refresh
196
199
 
200
+ **In-app sign-in:**
201
+
202
+ Sign in to Claude directly from Hammoc — no terminal needed:
203
+
204
+ 1. Click **"Sign in to Claude"** (shown when no account is linked, or when adding an account)
205
+ 2. Click **"Open authorization page"** to open the OAuth page in a new browser tab (or use **"Copy link"** to copy the URL)
206
+ 3. Approve access on the Claude website, then paste the authorization code into the input field
207
+ 4. Click **"Submit code"** to complete sign-in
208
+
209
+ If an error occurs, a **"Try again"** button restarts the flow. The same sign-in flow is also available during onboarding (see §1.3).
210
+
211
+ **Multi-account management:**
212
+
213
+ Store and switch between multiple Claude accounts without re-authenticating each time:
214
+
215
+ - **Accounts list** — All stored accounts are shown below the active account info. The active account is highlighted with a green border and checkmark
216
+ - **Switch** — Click the **Switch** button on any inactive account to make it the active account. If the session has expired, Hammoc prompts a re-login
217
+ - **Remove** — Click the trash icon on an inactive account to permanently delete its stored credential (with confirmation dialog). The active account cannot be removed — switch to another account first
218
+ - **Add account** — Click **"+ Add account"** at the bottom of the list to sign in to another Claude account using the same OAuth flow. Click **Cancel** to close without adding
219
+ - Account changes sync across all open browser tabs in real-time
220
+
197
221
  ### 13.15 Hammoc User
198
222
 
199
223
  Local Hammoc authentication (independent of your Claude Code account):
@@ -203,17 +227,17 @@ Local Hammoc authentication (independent of your Claude Code account):
203
227
 
204
228
  ### 13.16 System Prompt
205
229
 
206
- Customize Claude's behavior with a fully editable system prompt template:
230
+ Customize Claude's behavior by adding your own instructions on top of Hammoc's maintained base prompt. The editor is split into a read-only **system-managed** area and an editable **additions** area, so you layer your customizations on top instead of replacing the entire prompt:
207
231
 
208
- - **Warning banner** — Displayed at the top, cautioning about the impact of modifications
209
- - **Editable textarea** — Edit the system prompt with **auto-save**
210
- - **Character count** — Shown below the editor
211
- - **"Customized" indicator** — Blue banner when a custom prompt is active
212
- - **Restore to Default** button — Appears when the prompt has been modified
232
+ - **System-managed sections (read-only)** — A collapsible accordion showing the base prompt Hammoc assembles automatically: a common section (Hammoc identity, code-reference conventions, feature pointers), an engine-specific section (SDK or CLI), and a BMad section when the project is a BMad project. Labeled "Auto-assembled — not editable"; expand it to see exactly what is being sent
233
+ - **Your additions** — An editable textarea (with **auto-save**) where you append your own instructions. These are added to the base prompt rather than overwriting it. A **"Custom additions in use"** badge appears when the area is non-empty
234
+ - **Migration banner** — If you previously customized the prompt in the old single-textarea editor, a one-time notice explains that the prompt was restructured; review your additions, remove anything that now duplicates the managed sections, and dismiss it
235
+ - **Character count** — Total characters shown below the editor; hover to see the **system + you** breakdown
236
+ - **Restore Default** button — Appears once you have additions; clears your additions back to empty (the managed sections are always present and cannot be removed)
213
237
  - **Template variables** — Listed below the editor with descriptions (e.g., `{gitBranch}`, `{gitMainBranch}`, `{gitStatus}`); variables are resolved at runtime
214
- - **Resolved preview** — Toggle to see the fully rendered prompt with variables replaced for the current project
238
+ - **Preview Full Prompt** — Toggle to see the fully assembled prompt (managed sections plus your additions) with variables resolved for the current project
215
239
 
216
- The system prompt applies to both conversation engines (SDK and CLI). The default template focuses Claude on Hammoc-specific features (snippets, queue runner, board, BMAD, permission modes, sessions) and points at the manual + internals docs that Hammoc syncs to `~/.hammoc/docs/` on every server boot, so agents always have current docs even when run from a fresh install.
240
+ The system prompt applies to both conversation engines (SDK and CLI). The managed base focuses Claude on Hammoc-specific features (snippets, queue runner, board, BMAD, permission modes, sessions) and points at the manual + internals docs that Hammoc syncs to `~/.hammoc/docs/` on every server boot, so agents always have current docs even when run from a fresh install.
217
241
 
218
242
  ### 13.17 Conversation Engine
219
243
 
@@ -243,7 +267,7 @@ CLI engine settings have moved to **Advanced Settings** (see §13.18) under the
243
267
  Settings in the Advanced tab are organized into three groups: Common (both engines), SDK engine only, and CLI engine only.
244
268
 
245
269
  **Common (both engines):**
246
- - **System prompt** — Customizable prompt template that applies to both engines (see §13.16)
270
+ - **System prompt** — Add your own instructions on top of the managed base prompt; applies to both engines (see §13.16)
247
271
  - **Server management** — Development mode: "Server Rebuild" button. Production mode: version display, update check, and install
248
272
  - **File checkpointing** — Chat sessions (default on, required for code rewind §2.20) and queue runner (default off)
249
273
  - **Card entrance animation** — Streaming cards fade/slide in one at a time (default on, both engines)
@@ -8,17 +8,14 @@ Claude Code CLI must be installed and in your PATH:
8
8
  claude --version
9
9
  ```
10
10
 
11
- If not installed, follow the [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code). The Onboarding page shows CLI installation, authentication, and API key status at a glance.
11
+ If not installed, follow the [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code). The onboarding wizard checks CLI status automatically on first launch (see §1.3).
12
12
 
13
13
  ### 16.2 "Authentication required" / `claude login`
14
14
 
15
- If the chat displays an authentication error, Claude Code CLI needs to be logged in:
15
+ If the chat displays an authentication error, Claude Code needs to be logged in. Two options:
16
16
 
17
- ```bash
18
- claude login
19
- ```
20
-
21
- The Onboarding page (shown when CLI is not authenticated) displays the current auth status and provides setup commands.
17
+ - **In-app** — Go to **Settings > Claude Account** and click **"Sign in to Claude"** to complete the OAuth flow without leaving Hammoc (see §13.14)
18
+ - **Terminal** — Run `claude login` in a terminal session
22
19
 
23
20
  ### 16.3 API rate limit exceeded
24
21
 
@@ -12,7 +12,7 @@ export { AUTH_ERROR_MESSAGES } from './types/auth.js';
12
12
  export type { ChangePasswordRequest, ChangePasswordResponse } from './types/auth.js';
13
13
  export { ProjectInfo, ProjectListResponse, PROJECT_ERRORS, CreateProjectRequest, CreateProjectResponse, DeleteProjectResponse, ValidatePathRequest, ValidatePathResponse, BmadVersionsResponse, ProjectSettings, UpdateProjectSettingsRequest, ProjectSettingsApiResponse, SetupBmadRequest, SetupBmadResponse, } from './types/project.js';
14
14
  export { SlashCommand, StarCommand, CommandsResponse, SnippetItem } from './types/command.js';
15
- export { CommandFavoriteEntry, UserPreferences, PromptHistoryData, DEFAULT_PREFERENCES, PreferencesApiResponse, TelegramSettings, TelegramSettingsApiResponse, UpdateTelegramSettingsRequest, WebPushSettings, WebPushSettingsApiResponse, WebPushSubscribeRequest, SupportedLanguage, SUPPORTED_LANGUAGES, PermissionSyncPolicy, } from './types/preferences.js';
15
+ export { CommandFavoriteEntry, UserPreferences, PromptHistoryData, DEFAULT_PREFERENCES, PreferencesApiResponse, TelegramSettings, TelegramSettingsApiResponse, UpdateTelegramSettingsRequest, WebPushSettings, WebPushSettingsApiResponse, WebPushSubscribeRequest, SupportedLanguage, SUPPORTED_LANGUAGES, PermissionSyncPolicy, SystemPromptSectionsResponse, ProjectSystemPromptResponse, } from './types/preferences.js';
16
16
  export { RawJSONLMessage, HistoryMessage, PaginationInfo, HistoryMessagesResponse, PaginationOptions, ContentBlock, TextContentBlock, ThinkingContentBlock, ToolUseContentBlock, ToolResultContentBlock, ImageContentBlock, } from './types/history.js';
17
17
  export * from './types/fileSystem.js';
18
18
  export * from './types/systemBrowse.js';
@@ -34,4 +34,5 @@ export * from './types/harnessBundle.js';
34
34
  export * from './types/bmadCoreConfig.js';
35
35
  export * from './types/contextBuilder.js';
36
36
  export * from './types/marketplace.js';
37
+ export * from './types/accounts.js';
37
38
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAG/B,cAAc,sBAAsB,CAAC;AAGrC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AAIrC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EACL,UAAU,EACV,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,YAAY,GACb,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAIrF,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,4BAA4B,EAC5B,0BAA0B,EAC1B,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG9F,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,2BAA2B,EAC3B,6BAA6B,EAC7B,eAAe,EACf,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,EACnB,o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,cAAc,uBAAuB,CAAC;AAGtC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG/E,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAG/F,cAAc,gBAAgB,CAAC;AAG/B,cAAc,qBAAqB,CAAC;AAGpC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG5D,cAAc,oBAAoB,CAAC;AAGnC,cAAc,0BAA0B,CAAC;AAGzC,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAGzE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAG3F,cAAc,0BAA0B,CAAC;AAGzC,cAAc,2BAA2B,CAAC;AAG1C,cAAc,2BAA2B,CAAC;AAG1C,cAAc,wBAAwB,CAAC;AAGvC,cAAc,qBAAqB,CAAC"}
@@ -65,4 +65,6 @@ export * from './types/bmadCoreConfig.js';
65
65
  export * from './types/contextBuilder.js';
66
66
  // Story 31.4: Plugin marketplace catalog DTOs (Epic 31)
67
67
  export * from './types/marketplace.js';
68
+ // Story BS-8: Multi-account management DTOs (credential store + switch)
69
+ export * from './types/accounts.js';
68
70
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,cAAc,gBAAgB,CAAC;AAE/B,+CAA+C;AAC/C,cAAc,sBAAsB,CAAC;AAErC,2CAA2C;AAC3C,cAAc,sBAAsB,C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c stores the OAuth credentials produced by each Claude Code login in
5
+ * `~/.hammoc/accounts.json` so a user can keep several Claude accounts and switch
6
+ * between them. Switching overwrites the single-account `~/.claude/.credentials.json`
7
+ * the CLI binary reads (it has no `--profile` flag — see Story BS-8 Dev Notes).
8
+ *
9
+ * The credential token material (`accessToken` / `refreshToken`) lives ONLY in the
10
+ * server-side {@link StoredAccount.credential} block. It is never serialized into an
11
+ * API response or a WebSocket payload — those carry the token-free {@link AccountSummary}.
12
+ */
13
+ /**
14
+ * The `claudeAiOauth` block from `~/.claude/.credentials.json`, captured verbatim.
15
+ * Shape verified against the live file (BS-8 Dev Notes › Credential File Structure):
16
+ * `expiresAt` is epoch milliseconds (a number, not an ISO string / JWT), and
17
+ * `subscriptionType` (the account tier) lives inside this block. `email` does NOT —
18
+ * it only comes from accountInfoService, hence the fallback key (AC1a).
19
+ */
20
+ export interface ClaudeOAuthCredential {
21
+ claudeAiOauth: {
22
+ accessToken: string;
23
+ refreshToken?: string;
24
+ /** Epoch milliseconds. Expiry check = `expiresAt < Date.now()`. */
25
+ expiresAt?: number;
26
+ scopes?: string[];
27
+ /** Account tier, e.g. "max" / "pro" / "team". Read directly here (no SDK needed). */
28
+ subscriptionType?: string;
29
+ rateLimitTier?: string;
30
+ [key: string]: unknown;
31
+ };
32
+ }
33
+ /**
34
+ * A stored account entry in `~/.hammoc/accounts.json`.
35
+ * The {@link credential} field is server-side only — see the file header.
36
+ */
37
+ export interface StoredAccount {
38
+ /** Account email, or null when accountInfoService could not supply one (AC1a). */
39
+ email: string | null;
40
+ /** Subscription tier read from `credential.claudeAiOauth.subscriptionType`. */
41
+ tier: string | null;
42
+ /** The captured `claudeAiOauth` block (tokens — never sent to clients). */
43
+ credential: ClaudeOAuthCredential;
44
+ /** Epoch ms of the last capture / activation of this account. */
45
+ lastUsedAt: number;
46
+ /** True when keyed by the `account:<hash>` fallback and the email needs back-fill (AC1a). */
47
+ needsEmailBackfill?: boolean;
48
+ }
49
+ /**
50
+ * On-disk shape of `~/.hammoc/accounts.json`.
51
+ * `activeKey` mirrors which credential is currently written to `~/.claude/.credentials.json`.
52
+ */
53
+ export interface AccountsStore {
54
+ /** Store key (email or `account:<hash>` fallback) of the active account, or null. */
55
+ activeKey: string | null;
56
+ /** Stored accounts keyed by email or the `account:<hash>` fallback. */
57
+ accounts: Record<string, StoredAccount>;
58
+ }
59
+ /**
60
+ * Token-free public view of a stored account for API + WebSocket payloads (AC14, AC15).
61
+ * Exposes only the store key, email, tier, and bookkeeping flags — never tokens.
62
+ */
63
+ export interface AccountSummary {
64
+ /** Store key: the account email, or the `account:<hash>` fallback (AC1a). */
65
+ key: string;
66
+ email: string | null;
67
+ tier: string | null;
68
+ /** True when this is the currently active account. */
69
+ active: boolean;
70
+ lastUsedAt: number;
71
+ needsEmailBackfill?: boolean;
72
+ }
73
+ /** GET /api/accounts response — token-free account list + active marker. */
74
+ export interface AccountListResponse {
75
+ accounts: AccountSummary[];
76
+ activeKey: string | null;
77
+ }
78
+ /** POST /api/accounts/switch request — `key` is the store key (email or fallback). */
79
+ export interface AccountSwitchRequest {
80
+ key: string;
81
+ }
82
+ /** POST /api/accounts/switch response. */
83
+ export interface AccountSwitchResponse {
84
+ success: boolean;
85
+ activeKey: string | null;
86
+ /**
87
+ * True when the switched-to credential is already past `expiresAt` (AC12). The switch
88
+ * still completes; the client should offer the BS-7 re-login flow for this account.
89
+ * Phase 1 performs NO custom OAuth refresh call (BS-8 Dev Notes › Token Refresh).
90
+ */
91
+ reauthRequired: boolean;
92
+ accounts: AccountSummary[];
93
+ }
94
+ /** WebSocket `account:switched` payload — token-free (AC15). */
95
+ export interface AccountSwitchedEvent {
96
+ key: string;
97
+ email: string | null;
98
+ tier: string | null;
99
+ }
100
+ /** WebSocket `account:removed` payload — token-free. */
101
+ export interface AccountRemovedEvent {
102
+ key: string;
103
+ }
104
+ //# sourceMappingURL=accounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources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mBAAmB;IAClC,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,sFAAsF;AACtF,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AAED,gEAAgE;AAChE,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;CACb"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Multi-Account Management types (Story BS-8)
3
+ *
4
+ * Hammoc stores the OAuth credentials produced by each Claude Code login in
5
+ * `~/.hammoc/accounts.json` so a user can keep several Claude accounts and switch
6
+ * between them. Switching overwrites the single-account `~/.claude/.credentials.json`
7
+ * the CLI binary reads (it has no `--profile` flag — see Story BS-8 Dev Notes).
8
+ *
9
+ * The credential token material (`accessToken` / `refreshToken`) lives ONLY in the
10
+ * server-side {@link StoredAccount.credential} block. It is never serialized into an
11
+ * API response or a WebSocket payload — those carry the token-free {@link AccountSummary}.
12
+ */
13
+ export {};
14
+ //# sourceMappingURL=accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/types/accounts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}