@pennyfarthing/cyclist 11.0.0 → 11.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/bikerack.js +1 -1
  2. package/dist/bikerack.js.map +1 -1
  3. package/dist/git-cache.d.ts +10 -0
  4. package/dist/git-cache.d.ts.map +1 -1
  5. package/dist/git-cache.js +40 -5
  6. package/dist/git-cache.js.map +1 -1
  7. package/dist/public/js/react/react.js +3 -3
  8. package/dist/websocket.d.ts.map +1 -1
  9. package/dist/websocket.js +53 -8
  10. package/dist/websocket.js.map +1 -1
  11. package/package.json +3 -87
  12. package/portraits/stephen-king/large/christine-25112.png +0 -0
  13. package/portraits/stephen-king/large/danny-53243.png +0 -0
  14. package/portraits/stephen-king/large/flagg-55311.png +0 -0
  15. package/portraits/stephen-king/large/jack-44224.png +0 -0
  16. package/portraits/stephen-king/large/johnny-44353.png +0 -0
  17. package/portraits/stephen-king/large/paul-45233.png +0 -0
  18. package/portraits/stephen-king/large/pennywise-54411.png +0 -0
  19. package/portraits/stephen-king/medium/christine-25112.png +0 -0
  20. package/portraits/stephen-king/medium/danny-53243.png +0 -0
  21. package/portraits/stephen-king/medium/flagg-55311.png +0 -0
  22. package/portraits/stephen-king/medium/jack-44224.png +0 -0
  23. package/portraits/stephen-king/medium/johnny-44353.png +0 -0
  24. package/portraits/stephen-king/medium/paul-45233.png +0 -0
  25. package/portraits/stephen-king/medium/pennywise-54411.png +0 -0
  26. package/dist/hooks/cyclist-pretooluse-hook.d.ts +0 -60
  27. package/dist/hooks/cyclist-pretooluse-hook.d.ts.map +0 -1
  28. package/dist/hooks/cyclist-pretooluse-hook.js +0 -57
  29. package/dist/hooks/cyclist-pretooluse-hook.js.map +0 -1
  30. package/dist/hooks/pretooluse-hook.d.ts +0 -89
  31. package/dist/hooks/pretooluse-hook.d.ts.map +0 -1
  32. package/dist/hooks/pretooluse-hook.js +0 -235
  33. package/dist/hooks/pretooluse-hook.js.map +0 -1
  34. package/dist/notification-sound.d.ts +0 -59
  35. package/dist/notification-sound.d.ts.map +0 -1
  36. package/dist/notification-sound.js +0 -219
  37. package/dist/notification-sound.js.map +0 -1
  38. package/dist/plugin-loader.test.d.ts +0 -17
  39. package/dist/plugin-loader.test.d.ts.map +0 -1
  40. package/dist/plugin-loader.test.js +0 -407
  41. package/dist/plugin-loader.test.js.map +0 -1
@@ -1,57 +0,0 @@
1
- /**
2
- * Cyclist PreToolUse Hook - Core Logic
3
- *
4
- * Testable module containing all hook logic. Invoked via cyclist-pretooluse-hook.sh
5
- * which calls `npx tsx` on this file, matching the .sh wrapper pattern used by
6
- * all other hooks in .claude/settings.local.json.
7
- *
8
- * Flow:
9
- * 1. Claude Code calls cyclist-pretooluse-hook.sh with tool info via stdin (JSON)
10
- * 2. Shell wrapper invokes this module via npx tsx
11
- * 3. Script reads port from .cyclist-port in project directory
12
- * 4. Script sends request to WheelHub's /api/hook-request endpoint
13
- * 5. WheelHub checks grants / shows approval modal, user decides
14
- * 6. Script receives response, outputs JSON decision to stdout
15
- * 7. Claude Code proceeds or blocks based on decision
16
- *
17
- * Per ADR-0004: All communication converges through WheelHub.
18
- *
19
- * Story: MSSCI-14320 - Update and register PreToolUse hook
20
- */
21
- // =============================================================================
22
- // Constants
23
- // =============================================================================
24
- export const DEFAULT_PORT = 7432;
25
- export const HOST = '127.0.0.1';
26
- export const TIMEOUT_MS = 120_000; // 2 minutes for user to decide
27
- export const PORT_FILE = '.cyclist-port';
28
- export const LEGACY_PORT_FILE = '.cyclist-approval-port';
29
- export const ENDPOINT = '/api/hook-request';
30
- // =============================================================================
31
- // Stubs - Dev implements these to GREEN
32
- // =============================================================================
33
- export function findProjectRoot(startDir) {
34
- throw new Error('findProjectRoot not implemented');
35
- }
36
- export function getPort(projectRoot) {
37
- throw new Error('getPort not implemented');
38
- }
39
- export function readPortFile(filePath) {
40
- throw new Error('readPortFile not implemented');
41
- }
42
- export async function readStdin() {
43
- throw new Error('readStdin not implemented');
44
- }
45
- export async function requestApproval(toolData, port) {
46
- throw new Error('requestApproval not implemented');
47
- }
48
- export function buildOutput(decision, reason, updatedInput) {
49
- throw new Error('buildOutput not implemented');
50
- }
51
- export function outputDecision(decision, reason, updatedInput) {
52
- throw new Error('outputDecision not implemented');
53
- }
54
- export async function main() {
55
- throw new Error('main not implemented');
56
- }
57
- //# sourceMappingURL=cyclist-pretooluse-hook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cyclist-pretooluse-hook.js","sourceRoot":"","sources":["../../src/hooks/cyclist-pretooluse-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AACjC,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC;AAChC,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,CAAC,+BAA+B;AAClE,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;AACzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AACzD,MAAM,CAAC,MAAM,QAAQ,GAAG,mBAAmB,CAAC;AAmC5C,gFAAgF;AAChF,wCAAwC;AACxC,gFAAgF;AAEhF,MAAM,UAAU,eAAe,CAAC,QAAiB;IAC/C,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,WAA2B;IACjD,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,QAAyB,EACzB,IAAa;IAEb,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,QAAgB,EAChB,MAAc,EACd,YAA6C;IAE7C,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,QAAgB,EAChB,MAAc,EACd,YAA6C;IAE7C,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC1C,CAAC"}
@@ -1,89 +0,0 @@
1
- /**
2
- * Cyclist PreToolUse Hook - Core Logic
3
- *
4
- * Testable module containing all hook logic. The companion runner script
5
- * (cyclist-pretooluse-hook.js) imports from the compiled output and invokes main().
6
- *
7
- * Flow:
8
- * 1. Claude Code calls the runner script with tool info via stdin (JSON)
9
- * 2. Script reads port from .cyclist-port in project directory
10
- * 3. Script sends request to WheelHub's /api/hook-request endpoint
11
- * 4. WheelHub checks grants / shows approval modal, user decides
12
- * 5. Script receives response, outputs JSON decision to stdout
13
- * 6. Claude Code proceeds or blocks based on decision
14
- *
15
- * Per ADR-0004: All communication converges through WheelHub.
16
- *
17
- * Story: MSSCI-14320 - Update and register PreToolUse hook
18
- */
19
- export declare const DEFAULT_PORT = 7432;
20
- export declare const HOST = "127.0.0.1";
21
- export declare const TIMEOUT_MS = 120000;
22
- export declare const PORT_FILE = ".cyclist-port";
23
- export declare const LEGACY_PORT_FILE = ".cyclist-approval-port";
24
- export declare const ENDPOINT = "/api/hook-request";
25
- export interface ToolData {
26
- tool_name: string;
27
- tool_use_id: string;
28
- tool_input: Record<string, unknown>;
29
- session_id?: string;
30
- }
31
- export interface ApprovalRequest {
32
- toolName: string;
33
- toolId: string;
34
- input: Record<string, unknown>;
35
- sessionId?: string;
36
- }
37
- export interface ApprovalResponse {
38
- decision: 'allow' | 'deny' | 'ask';
39
- reason?: string;
40
- data?: Record<string, unknown>;
41
- }
42
- export interface HookOutput {
43
- hookSpecificOutput: {
44
- hookEventName: 'PreToolUse';
45
- permissionDecision: string;
46
- permissionDecisionReason: string;
47
- updatedInput?: Record<string, unknown>;
48
- };
49
- }
50
- /**
51
- * Find the project root by looking for port files or .claude directory.
52
- * Walks up from startDir (defaults to cwd) until found or reaches filesystem root.
53
- */
54
- export declare function findProjectRoot(startDir?: string): string | null;
55
- /**
56
- * Read the WheelHub server port. Prefers .cyclist-port, falls back to
57
- * .cyclist-approval-port for migration compatibility, then default port.
58
- *
59
- * Mirrors hooks.py:get_cyclist_port() behavior.
60
- */
61
- export declare function getPort(projectRoot?: string | null): number;
62
- /**
63
- * Read a port number from a file. Returns null if file doesn't exist or is invalid.
64
- */
65
- export declare function readPortFile(filePath: string): number | null;
66
- /**
67
- * Read all stdin as JSON.
68
- */
69
- export declare function readStdin(): Promise<ToolData>;
70
- /**
71
- * Send approval request to WheelHub and wait for response.
72
- * Returns { decision: "ask" } when WheelHub is unreachable (ECONNREFUSED).
73
- */
74
- export declare function requestApproval(toolData: ApprovalRequest, port?: number): Promise<ApprovalResponse>;
75
- /**
76
- * Build the Claude Code hook output object.
77
- * MSSCI-11947: Supports updatedInput passthrough for interactive tools.
78
- */
79
- export declare function buildOutput(decision: string, reason: string, updatedInput?: Record<string, unknown> | null): HookOutput;
80
- /**
81
- * Output decision to stdout in Claude Code hook format.
82
- */
83
- export declare function outputDecision(decision: string, reason: string, updatedInput?: Record<string, unknown> | null): void;
84
- /**
85
- * Main hook logic. Reads stdin, sends to WheelHub, outputs decision.
86
- * MSSCI-11947: Handles data field passthrough for interactive tools.
87
- */
88
- export declare function main(): Promise<void>;
89
- //# sourceMappingURL=pretooluse-hook.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pretooluse-hook.d.ts","sourceRoot":"","sources":["../../src/h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C,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAmB3D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAgB5D;AAMD;;GAEG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,QAAQ,CAAC,CAcnD;AAMD;;;GAGG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,eAAe,EACzB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,gBAAgB,CAAC,CA6C3B;AAMD;;;GAGG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAC5C,UAAU,CAcZ;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAC5C,IAAI,CAEN;AAMD;;;GAGG;AACH,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CA2B1C"}
@@ -1,235 +0,0 @@
1
- /**
2
- * Cyclist PreToolUse Hook - Core Logic
3
- *
4
- * Testable module containing all hook logic. The companion runner script
5
- * (cyclist-pretooluse-hook.js) imports from the compiled output and invokes main().
6
- *
7
- * Flow:
8
- * 1. Claude Code calls the runner script with tool info via stdin (JSON)
9
- * 2. Script reads port from .cyclist-port in project directory
10
- * 3. Script sends request to WheelHub's /api/hook-request endpoint
11
- * 4. WheelHub checks grants / shows approval modal, user decides
12
- * 5. Script receives response, outputs JSON decision to stdout
13
- * 6. Claude Code proceeds or blocks based on decision
14
- *
15
- * Per ADR-0004: All communication converges through WheelHub.
16
- *
17
- * Story: MSSCI-14320 - Update and register PreToolUse hook
18
- */
19
- import http from 'node:http';
20
- import fs from 'node:fs';
21
- import path from 'node:path';
22
- // =============================================================================
23
- // Constants
24
- // =============================================================================
25
- export const DEFAULT_PORT = 7432;
26
- export const HOST = '127.0.0.1';
27
- export const TIMEOUT_MS = 120_000; // 2 minutes for user to decide
28
- export const PORT_FILE = '.cyclist-port';
29
- export const LEGACY_PORT_FILE = '.cyclist-approval-port';
30
- export const ENDPOINT = '/api/hook-request';
31
- // =============================================================================
32
- // Project Root Detection
33
- // =============================================================================
34
- /**
35
- * Find the project root by looking for port files or .claude directory.
36
- * Walks up from startDir (defaults to cwd) until found or reaches filesystem root.
37
- */
38
- export function findProjectRoot(startDir) {
39
- let dir = startDir ?? process.cwd();
40
- const root = path.parse(dir).root;
41
- while (dir !== root) {
42
- if (fs.existsSync(path.join(dir, PORT_FILE))) {
43
- return dir;
44
- }
45
- if (fs.existsSync(path.join(dir, LEGACY_PORT_FILE))) {
46
- return dir;
47
- }
48
- if (fs.existsSync(path.join(dir, '.claude'))) {
49
- return dir;
50
- }
51
- dir = path.dirname(dir);
52
- }
53
- return null;
54
- }
55
- // =============================================================================
56
- // Port Discovery
57
- // =============================================================================
58
- /**
59
- * Read the WheelHub server port. Prefers .cyclist-port, falls back to
60
- * .cyclist-approval-port for migration compatibility, then default port.
61
- *
62
- * Mirrors hooks.py:get_cyclist_port() behavior.
63
- */
64
- export function getPort(projectRoot) {
65
- const root = projectRoot ?? findProjectRoot();
66
- if (!root) {
67
- return DEFAULT_PORT;
68
- }
69
- // Try canonical port file first
70
- const port = readPortFile(path.join(root, PORT_FILE));
71
- if (port !== null) {
72
- return port;
73
- }
74
- // Fall back to legacy port file
75
- const legacyPort = readPortFile(path.join(root, LEGACY_PORT_FILE));
76
- if (legacyPort !== null) {
77
- return legacyPort;
78
- }
79
- return DEFAULT_PORT;
80
- }
81
- /**
82
- * Read a port number from a file. Returns null if file doesn't exist or is invalid.
83
- */
84
- export function readPortFile(filePath) {
85
- if (!fs.existsSync(filePath)) {
86
- return null;
87
- }
88
- try {
89
- const content = fs.readFileSync(filePath, 'utf-8').trim();
90
- const port = parseInt(content, 10);
91
- if (!isNaN(port) && port > 0 && port < 65536) {
92
- return port;
93
- }
94
- }
95
- catch {
96
- // Fall through
97
- }
98
- return null;
99
- }
100
- // =============================================================================
101
- // Stdin Reading
102
- // =============================================================================
103
- /**
104
- * Read all stdin as JSON.
105
- */
106
- export async function readStdin() {
107
- return new Promise((resolve, reject) => {
108
- let data = '';
109
- process.stdin.setEncoding('utf8');
110
- process.stdin.on('data', (chunk) => { data += chunk; });
111
- process.stdin.on('end', () => {
112
- try {
113
- resolve(JSON.parse(data));
114
- }
115
- catch (e) {
116
- reject(new Error(`Invalid JSON input: ${e.message}`));
117
- }
118
- });
119
- process.stdin.on('error', reject);
120
- });
121
- }
122
- // =============================================================================
123
- // HTTP Request
124
- // =============================================================================
125
- /**
126
- * Send approval request to WheelHub and wait for response.
127
- * Returns { decision: "ask" } when WheelHub is unreachable (ECONNREFUSED).
128
- */
129
- export async function requestApproval(toolData, port) {
130
- const resolvedPort = port ?? getPort();
131
- const postData = JSON.stringify(toolData);
132
- return new Promise((resolve, reject) => {
133
- const options = {
134
- hostname: HOST,
135
- port: resolvedPort,
136
- path: ENDPOINT,
137
- method: 'POST',
138
- headers: {
139
- 'Content-Type': 'application/json',
140
- 'Content-Length': Buffer.byteLength(postData),
141
- },
142
- timeout: TIMEOUT_MS,
143
- };
144
- const req = http.request(options, (res) => {
145
- let data = '';
146
- res.on('data', (chunk) => { data += chunk; });
147
- res.on('end', () => {
148
- try {
149
- resolve(JSON.parse(data));
150
- }
151
- catch (e) {
152
- reject(new Error(`Invalid response from WheelHub: ${e.message}`));
153
- }
154
- });
155
- });
156
- req.on('error', (e) => {
157
- if (e.code === 'ECONNREFUSED') {
158
- resolve({ decision: 'ask', reason: 'WheelHub not running, deferring to Claude Code' });
159
- }
160
- else {
161
- reject(e);
162
- }
163
- });
164
- req.on('timeout', () => {
165
- req.destroy();
166
- reject(new Error('Approval request timed out'));
167
- });
168
- req.write(postData);
169
- req.end();
170
- });
171
- }
172
- // =============================================================================
173
- // Output Formatting
174
- // =============================================================================
175
- /**
176
- * Build the Claude Code hook output object.
177
- * MSSCI-11947: Supports updatedInput passthrough for interactive tools.
178
- */
179
- export function buildOutput(decision, reason, updatedInput) {
180
- const output = {
181
- hookSpecificOutput: {
182
- hookEventName: 'PreToolUse',
183
- permissionDecision: decision,
184
- permissionDecisionReason: reason,
185
- },
186
- };
187
- if (updatedInput) {
188
- output.hookSpecificOutput.updatedInput = updatedInput;
189
- }
190
- return output;
191
- }
192
- /**
193
- * Output decision to stdout in Claude Code hook format.
194
- */
195
- export function outputDecision(decision, reason, updatedInput) {
196
- console.log(JSON.stringify(buildOutput(decision, reason, updatedInput)));
197
- }
198
- // =============================================================================
199
- // Main Entry Point
200
- // =============================================================================
201
- /**
202
- * Main hook logic. Reads stdin, sends to WheelHub, outputs decision.
203
- * MSSCI-11947: Handles data field passthrough for interactive tools.
204
- */
205
- export async function main() {
206
- try {
207
- const toolData = await readStdin();
208
- const { tool_name, tool_input, tool_use_id, session_id } = toolData;
209
- const response = await requestApproval({
210
- toolName: tool_name,
211
- toolId: tool_use_id,
212
- input: tool_input,
213
- sessionId: session_id,
214
- });
215
- if (response.decision === 'allow') {
216
- outputDecision('allow', response.reason || 'Approved by user', response.data || null);
217
- }
218
- else if (response.decision === 'deny') {
219
- outputDecision('deny', response.reason || 'Rejected by user', response.data || null);
220
- }
221
- else if (response.decision === 'ask') {
222
- outputDecision('ask', response.reason || 'Deferred to Claude Code');
223
- }
224
- else {
225
- // Unknown decision - defer to Claude Code rather than silently allowing
226
- outputDecision('ask', 'Unknown response from WheelHub');
227
- }
228
- }
229
- catch (error) {
230
- console.error(`[cyclist-hook] Error: ${error.message}`);
231
- // Output ask so Claude Code shows its built-in dialog, don't silently allow
232
- outputDecision('ask', 'Hook error, deferring to Claude Code');
233
- }
234
- }
235
- //# sourceMappingURL=pretooluse-hook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pretooluse-h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,EAAE,CAAC;YAClC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,IAAI,kBAAkB,EAAE,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;QACxF,CAAC;aAAM,IAAI,QAAQ,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;YACxC,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI,kBAAkB,EAAE,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;QACvF,CAAC;aAAM,IAAI,QAAQ,CAAC,QAAQ,KAAK,KAAK,EAAE,CAAC;YACvC,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,IAAI,yBAAyB,CAAC,CAAC;QACtE,CAAC;aAAM,CAAC;YACN,wEAAwE;YACxE,cAAc,CAAC,KAAK,EAAE,gCAAgC,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,yBAA0B,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;QACnE,4EAA4E;QAC5E,cAAc,CAAC,KAAK,EAAE,sCAAsC,CAAC,CAAC;IAChE,CAAC;AACH,CAAC"}
@@ -1,59 +0,0 @@
1
- /**
2
- * Notification Sound Service (Story MSSCI-14191)
3
- *
4
- * Provides audio notifications for workflow events using Web Audio API.
5
- * Different tones for different event types:
6
- * - HANDOFF: Low tone (agent transition)
7
- * - QUESTION: Higher tone (user input needed)
8
- * - COMPLETION: Chord (workflow complete)
9
- *
10
- * State is managed in-memory but can sync with settings via loadNotificationSoundSetting().
11
- */
12
- /**
13
- * Notification event types that trigger sounds
14
- */
15
- export declare const NotificationEvent: {
16
- readonly HANDOFF: "handoff";
17
- readonly QUESTION: "question";
18
- readonly COMPLETION: "completion";
19
- };
20
- export type NotificationEventType = (typeof NotificationEvent)[keyof typeof NotificationEvent];
21
- /**
22
- * Service class for notification sounds (exported for type checking)
23
- */
24
- export declare class NotificationSound {
25
- static isEnabled(): boolean;
26
- static setEnabled(enabled: boolean): void;
27
- static play(event: NotificationEventType): Promise<void>;
28
- }
29
- /**
30
- * Check if notification sounds are enabled
31
- */
32
- export declare function isNotificationSoundEnabled(): boolean;
33
- /**
34
- * Enable or disable notification sounds
35
- */
36
- export declare function setNotificationSoundEnabled(enabled: boolean): void;
37
- /**
38
- * Load notification sound setting from REST API
39
- */
40
- export declare function loadNotificationSoundSetting(): Promise<void>;
41
- /**
42
- * Check if audio playback is permitted (handles autoplay restrictions)
43
- * Returns true if audio can play, false if user gesture is required
44
- */
45
- export declare function checkAudioPermission(): Promise<boolean>;
46
- /**
47
- * Play a notification sound for the given event type
48
- */
49
- export declare function playNotificationSound(event: NotificationEventType): Promise<void>;
50
- /**
51
- * Reset state (for testing)
52
- */
53
- export declare function resetNotificationSoundState(): void;
54
- /**
55
- * Inject a custom AudioContext class (for testing)
56
- * Pass null to use the default detection
57
- */
58
- export declare function setAudioContextClass(cls: (new () => AudioContext) | null): void;
59
- //# sourceMappingURL=notification-sound.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notification-sound.d.ts","sourceRoot":"","sources":["../src/notification-sound.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;CAIpB,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AA0B/F;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,MAAM,CAAC,SAAS,IAAI,OAAO;IAI3B,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;WAI5B,IAAI,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/D;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAEpD;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAElE;AAED;;GAEG;AACH,wBAAsB,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC,CAUlE;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAa7D;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BvF;AA6ED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAUlD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,CAAC,UAAU,YAAY,CAAC,GAAG,IAAI,GAAG,IAAI,CAI/E"}