@thelastwinner/opencode-notifier 0.1.30
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.
- package/LICENSE +21 -0
- package/README.md +16 -0
- package/dist/command.d.ts +2 -0
- package/dist/command.js +25 -0
- package/dist/config.d.ts +81 -0
- package/dist/config.js +245 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4598 -0
- package/dist/logos/opencode-logo-dark.png +0 -0
- package/dist/logos/opencode-logo-light.png +0 -0
- package/dist/notify.d.ts +1 -0
- package/dist/notify.js +124 -0
- package/dist/sound.d.ts +2 -0
- package/dist/sound.js +127 -0
- package/dist/sounds/complete.wav +0 -0
- package/dist/sounds/error.wav +0 -0
- package/dist/sounds/permission.wav +0 -0
- package/dist/sounds/question.wav +0 -0
- package/dist/sounds/subagent_complete.wav +0 -0
- package/dist/wechat-webhook.d.ts +8 -0
- package/dist/wechat-webhook.js +43 -0
- package/logos/opencode-logo-dark.png +0 -0
- package/logos/opencode-logo-light.png +0 -0
- package/package.json +48 -0
- package/sounds/complete.wav +0 -0
- package/sounds/error.wav +0 -0
- package/sounds/permission.wav +0 -0
- package/sounds/question.wav +0 -0
- package/sounds/subagent_complete.wav +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Mohak S
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
[English](./README_EN.md) | **简体中文**
|
|
3
|
+
|
|
4
|
+
OpenCode 插件,在需要权限、生成完成、发生错误或调用 question 工具时播放提示音并发送系统通知。支持 macOS、Linux 和 Windows。
|
|
5
|
+
|
|
6
|
+
## 快速开始
|
|
7
|
+
|
|
8
|
+
在你的 \`opencode.json\` 中添加:
|
|
9
|
+
|
|
10
|
+
\`\`\`json
|
|
11
|
+
{
|
|
12
|
+
"plugin": ["@theLastWinner/opencode-notifier@latest"]
|
|
13
|
+
}
|
|
14
|
+
\`\`\`
|
|
15
|
+
|
|
16
|
+
重启 OpenCode。完成。
|
package/dist/command.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/command.ts
|
|
2
|
+
import { spawn } from "child_process";
|
|
3
|
+
function substituteTokens(value, event, message, sessionTitle, projectName) {
|
|
4
|
+
let result = value.replaceAll("{event}", event).replaceAll("{message}", message);
|
|
5
|
+
result = result.replaceAll("{sessionTitle}", sessionTitle || "");
|
|
6
|
+
result = result.replaceAll("{projectName}", projectName || "");
|
|
7
|
+
return result;
|
|
8
|
+
}
|
|
9
|
+
function runCommand(config, event, message, sessionTitle, projectName) {
|
|
10
|
+
if (!config.command.enabled || !config.command.path) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const args = (config.command.args ?? []).map((arg) => substituteTokens(arg, event, message, sessionTitle, projectName));
|
|
14
|
+
const command = substituteTokens(config.command.path, event, message, sessionTitle, projectName);
|
|
15
|
+
const proc = spawn(command, args, {
|
|
16
|
+
stdio: "ignore",
|
|
17
|
+
detached: true
|
|
18
|
+
});
|
|
19
|
+
proc.on("error", () => {
|
|
20
|
+
});
|
|
21
|
+
proc.unref();
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
runCommand
|
|
25
|
+
};
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export type EventType = "permission" | "complete" | "subagent_complete" | "error" | "question" | "interrupted" | "user_cancelled";
|
|
2
|
+
export interface EventConfig {
|
|
3
|
+
sound: boolean;
|
|
4
|
+
notification: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface CommandConfig {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
path: string;
|
|
9
|
+
args?: string[];
|
|
10
|
+
minDuration?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface WechatWebhookConfig {
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
webhookUrl: string;
|
|
15
|
+
mentionedList?: string[];
|
|
16
|
+
mentionedMobileList?: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface LinuxConfig {
|
|
19
|
+
grouping: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface MessageContext {
|
|
22
|
+
sessionTitle?: string | null;
|
|
23
|
+
projectName?: string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface NotifierConfig {
|
|
26
|
+
sound: boolean;
|
|
27
|
+
notification: boolean;
|
|
28
|
+
timeout: number;
|
|
29
|
+
showProjectName: boolean;
|
|
30
|
+
showSessionTitle: boolean;
|
|
31
|
+
showIcon: boolean;
|
|
32
|
+
notificationSystem: "osascript" | "node-notifier";
|
|
33
|
+
linux: LinuxConfig;
|
|
34
|
+
command: CommandConfig;
|
|
35
|
+
wechatWebhook: WechatWebhookConfig;
|
|
36
|
+
events: {
|
|
37
|
+
permission: EventConfig;
|
|
38
|
+
complete: EventConfig;
|
|
39
|
+
subagent_complete: EventConfig;
|
|
40
|
+
error: EventConfig;
|
|
41
|
+
question: EventConfig;
|
|
42
|
+
interrupted: EventConfig;
|
|
43
|
+
user_cancelled: EventConfig;
|
|
44
|
+
};
|
|
45
|
+
messages: {
|
|
46
|
+
permission: string;
|
|
47
|
+
complete: string;
|
|
48
|
+
subagent_complete: string;
|
|
49
|
+
error: string;
|
|
50
|
+
question: string;
|
|
51
|
+
interrupted: string;
|
|
52
|
+
user_cancelled: string;
|
|
53
|
+
};
|
|
54
|
+
sounds: {
|
|
55
|
+
permission: string | null;
|
|
56
|
+
complete: string | null;
|
|
57
|
+
subagent_complete: string | null;
|
|
58
|
+
error: string | null;
|
|
59
|
+
question: string | null;
|
|
60
|
+
interrupted: string | null;
|
|
61
|
+
user_cancelled: string | null;
|
|
62
|
+
};
|
|
63
|
+
volumes: {
|
|
64
|
+
permission: number;
|
|
65
|
+
complete: number;
|
|
66
|
+
subagent_complete: number;
|
|
67
|
+
error: number;
|
|
68
|
+
question: number;
|
|
69
|
+
interrupted: number;
|
|
70
|
+
user_cancelled: number;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export declare function getConfigPath(): string;
|
|
74
|
+
export declare function loadConfig(): NotifierConfig;
|
|
75
|
+
export declare function isEventSoundEnabled(config: NotifierConfig, event: EventType): boolean;
|
|
76
|
+
export declare function isEventNotificationEnabled(config: NotifierConfig, event: EventType): boolean;
|
|
77
|
+
export declare function getMessage(config: NotifierConfig, event: EventType): string;
|
|
78
|
+
export declare function getSoundPath(config: NotifierConfig, event: EventType): string | null;
|
|
79
|
+
export declare function getSoundVolume(config: NotifierConfig, event: EventType): number;
|
|
80
|
+
export declare function getIconPath(config: NotifierConfig): string | undefined;
|
|
81
|
+
export declare function interpolateMessage(message: string, context: MessageContext): string;
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
// src/config.ts
|
|
2
|
+
import { readFileSync, existsSync } from "fs";
|
|
3
|
+
import { join, dirname } from "path";
|
|
4
|
+
import { homedir } from "os";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
var DEFAULT_EVENT_CONFIG = {
|
|
7
|
+
sound: true,
|
|
8
|
+
notification: true
|
|
9
|
+
};
|
|
10
|
+
var DEFAULT_CONFIG = {
|
|
11
|
+
sound: true,
|
|
12
|
+
notification: true,
|
|
13
|
+
timeout: 5,
|
|
14
|
+
showProjectName: true,
|
|
15
|
+
showSessionTitle: false,
|
|
16
|
+
showIcon: true,
|
|
17
|
+
notificationSystem: "osascript",
|
|
18
|
+
linux: {
|
|
19
|
+
grouping: false
|
|
20
|
+
},
|
|
21
|
+
command: {
|
|
22
|
+
enabled: false,
|
|
23
|
+
path: "",
|
|
24
|
+
minDuration: 0
|
|
25
|
+
},
|
|
26
|
+
wechatWebhook: {
|
|
27
|
+
enabled: false,
|
|
28
|
+
webhookUrl: ""
|
|
29
|
+
},
|
|
30
|
+
events: {
|
|
31
|
+
permission: { ...DEFAULT_EVENT_CONFIG },
|
|
32
|
+
complete: { ...DEFAULT_EVENT_CONFIG },
|
|
33
|
+
subagent_complete: { sound: false, notification: false },
|
|
34
|
+
error: { ...DEFAULT_EVENT_CONFIG },
|
|
35
|
+
question: { ...DEFAULT_EVENT_CONFIG },
|
|
36
|
+
interrupted: { ...DEFAULT_EVENT_CONFIG },
|
|
37
|
+
user_cancelled: { sound: false, notification: false }
|
|
38
|
+
},
|
|
39
|
+
messages: {
|
|
40
|
+
permission: "Session needs permission: {sessionTitle}",
|
|
41
|
+
complete: "Session has finished: {sessionTitle}",
|
|
42
|
+
subagent_complete: "Subagent task completed: {sessionTitle}",
|
|
43
|
+
error: "Session encountered an error: {sessionTitle}",
|
|
44
|
+
question: "Session has a question: {sessionTitle}",
|
|
45
|
+
interrupted: "Session was interrupted: {sessionTitle}",
|
|
46
|
+
user_cancelled: "Session was cancelled by user: {sessionTitle}"
|
|
47
|
+
},
|
|
48
|
+
sounds: {
|
|
49
|
+
permission: null,
|
|
50
|
+
complete: null,
|
|
51
|
+
subagent_complete: null,
|
|
52
|
+
error: null,
|
|
53
|
+
question: null,
|
|
54
|
+
interrupted: null,
|
|
55
|
+
user_cancelled: null
|
|
56
|
+
},
|
|
57
|
+
volumes: {
|
|
58
|
+
permission: 1,
|
|
59
|
+
complete: 1,
|
|
60
|
+
subagent_complete: 1,
|
|
61
|
+
error: 1,
|
|
62
|
+
question: 1,
|
|
63
|
+
interrupted: 1,
|
|
64
|
+
user_cancelled: 1
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
function getConfigPath() {
|
|
68
|
+
if (process.env.OPENCODE_NOTIFIER_CONFIG_PATH) {
|
|
69
|
+
return process.env.OPENCODE_NOTIFIER_CONFIG_PATH;
|
|
70
|
+
}
|
|
71
|
+
return join(homedir(), ".config", "opencode", "opencode-notifier.json");
|
|
72
|
+
}
|
|
73
|
+
function parseEventConfig(userEvent, defaultConfig) {
|
|
74
|
+
if (userEvent === void 0) {
|
|
75
|
+
return defaultConfig;
|
|
76
|
+
}
|
|
77
|
+
if (typeof userEvent === "boolean") {
|
|
78
|
+
return {
|
|
79
|
+
sound: userEvent,
|
|
80
|
+
notification: userEvent
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
sound: userEvent.sound ?? defaultConfig.sound,
|
|
85
|
+
notification: userEvent.notification ?? defaultConfig.notification
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function parseVolume(value, defaultVolume) {
|
|
89
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
90
|
+
return defaultVolume;
|
|
91
|
+
}
|
|
92
|
+
if (value < 0) {
|
|
93
|
+
return 0;
|
|
94
|
+
}
|
|
95
|
+
if (value > 1) {
|
|
96
|
+
return 1;
|
|
97
|
+
}
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
function loadConfig() {
|
|
101
|
+
const configPath = getConfigPath();
|
|
102
|
+
if (!existsSync(configPath)) {
|
|
103
|
+
return DEFAULT_CONFIG;
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
const fileContent = readFileSync(configPath, "utf-8");
|
|
107
|
+
const userConfig = JSON.parse(fileContent);
|
|
108
|
+
const globalSound = userConfig.sound ?? DEFAULT_CONFIG.sound;
|
|
109
|
+
const globalNotification = userConfig.notification ?? DEFAULT_CONFIG.notification;
|
|
110
|
+
const defaultWithGlobal = {
|
|
111
|
+
sound: globalSound,
|
|
112
|
+
notification: globalNotification
|
|
113
|
+
};
|
|
114
|
+
const userCommand = userConfig.command ?? {};
|
|
115
|
+
const commandArgs = Array.isArray(userCommand.args) ? userCommand.args.filter((arg) => typeof arg === "string") : void 0;
|
|
116
|
+
const commandMinDuration = typeof userCommand.minDuration === "number" && Number.isFinite(userCommand.minDuration) && userCommand.minDuration > 0 ? userCommand.minDuration : 0;
|
|
117
|
+
const userWechatWebhook = userConfig.wechatWebhook ?? {};
|
|
118
|
+
const wechatWebhookEnabled = typeof userWechatWebhook.enabled === "boolean" ? userWechatWebhook.enabled : false;
|
|
119
|
+
const wechatWebhookUrl = typeof userWechatWebhook.webhookUrl === "string" ? userWechatWebhook.webhookUrl : "";
|
|
120
|
+
let wechatMentionedList = void 0;
|
|
121
|
+
if (Array.isArray(userWechatWebhook.mentionedList)) {
|
|
122
|
+
wechatMentionedList = userWechatWebhook.mentionedList.filter((item) => typeof item === "string");
|
|
123
|
+
}
|
|
124
|
+
let wechatMentionedMobileList = void 0;
|
|
125
|
+
if (Array.isArray(userWechatWebhook.mentionedMobileList)) {
|
|
126
|
+
wechatMentionedMobileList = userWechatWebhook.mentionedMobileList.filter((item) => typeof item === "string");
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
sound: globalSound,
|
|
130
|
+
notification: globalNotification,
|
|
131
|
+
timeout: typeof userConfig.timeout === "number" && userConfig.timeout > 0 ? userConfig.timeout : DEFAULT_CONFIG.timeout,
|
|
132
|
+
showProjectName: userConfig.showProjectName ?? DEFAULT_CONFIG.showProjectName,
|
|
133
|
+
showSessionTitle: userConfig.showSessionTitle ?? DEFAULT_CONFIG.showSessionTitle,
|
|
134
|
+
showIcon: userConfig.showIcon ?? DEFAULT_CONFIG.showIcon,
|
|
135
|
+
notificationSystem: userConfig.notificationSystem === "node-notifier" ? "node-notifier" : "osascript",
|
|
136
|
+
linux: {
|
|
137
|
+
grouping: typeof userConfig.linux?.grouping === "boolean" ? userConfig.linux.grouping : DEFAULT_CONFIG.linux.grouping
|
|
138
|
+
},
|
|
139
|
+
command: {
|
|
140
|
+
enabled: typeof userCommand.enabled === "boolean" ? userCommand.enabled : DEFAULT_CONFIG.command.enabled,
|
|
141
|
+
path: typeof userCommand.path === "string" ? userCommand.path : DEFAULT_CONFIG.command.path,
|
|
142
|
+
args: commandArgs,
|
|
143
|
+
minDuration: commandMinDuration
|
|
144
|
+
},
|
|
145
|
+
wechatWebhook: {
|
|
146
|
+
enabled: wechatWebhookEnabled,
|
|
147
|
+
webhookUrl: wechatWebhookUrl,
|
|
148
|
+
mentionedList: wechatMentionedList,
|
|
149
|
+
mentionedMobileList: wechatMentionedMobileList
|
|
150
|
+
},
|
|
151
|
+
events: {
|
|
152
|
+
permission: parseEventConfig(userConfig.events?.permission ?? userConfig.permission, defaultWithGlobal),
|
|
153
|
+
complete: parseEventConfig(userConfig.events?.complete ?? userConfig.complete, defaultWithGlobal),
|
|
154
|
+
subagent_complete: parseEventConfig(userConfig.events?.subagent_complete ?? userConfig.subagent_complete, { sound: false, notification: false }),
|
|
155
|
+
error: parseEventConfig(userConfig.events?.error ?? userConfig.error, defaultWithGlobal),
|
|
156
|
+
question: parseEventConfig(userConfig.events?.question ?? userConfig.question, defaultWithGlobal),
|
|
157
|
+
interrupted: parseEventConfig(userConfig.events?.interrupted ?? userConfig.interrupted, defaultWithGlobal),
|
|
158
|
+
user_cancelled: parseEventConfig(userConfig.events?.user_cancelled ?? userConfig.user_cancelled, { sound: false, notification: false })
|
|
159
|
+
},
|
|
160
|
+
messages: {
|
|
161
|
+
permission: userConfig.messages?.permission ?? DEFAULT_CONFIG.messages.permission,
|
|
162
|
+
complete: userConfig.messages?.complete ?? DEFAULT_CONFIG.messages.complete,
|
|
163
|
+
subagent_complete: userConfig.messages?.subagent_complete ?? DEFAULT_CONFIG.messages.subagent_complete,
|
|
164
|
+
error: userConfig.messages?.error ?? DEFAULT_CONFIG.messages.error,
|
|
165
|
+
question: userConfig.messages?.question ?? DEFAULT_CONFIG.messages.question,
|
|
166
|
+
interrupted: userConfig.messages?.interrupted ?? DEFAULT_CONFIG.messages.interrupted,
|
|
167
|
+
user_cancelled: userConfig.messages?.user_cancelled ?? DEFAULT_CONFIG.messages.user_cancelled
|
|
168
|
+
},
|
|
169
|
+
sounds: {
|
|
170
|
+
permission: userConfig.sounds?.permission ?? DEFAULT_CONFIG.sounds.permission,
|
|
171
|
+
complete: userConfig.sounds?.complete ?? DEFAULT_CONFIG.sounds.complete,
|
|
172
|
+
subagent_complete: userConfig.sounds?.subagent_complete ?? DEFAULT_CONFIG.sounds.subagent_complete,
|
|
173
|
+
error: userConfig.sounds?.error ?? DEFAULT_CONFIG.sounds.error,
|
|
174
|
+
question: userConfig.sounds?.question ?? DEFAULT_CONFIG.sounds.question,
|
|
175
|
+
interrupted: userConfig.sounds?.interrupted ?? DEFAULT_CONFIG.sounds.interrupted,
|
|
176
|
+
user_cancelled: userConfig.sounds?.user_cancelled ?? DEFAULT_CONFIG.sounds.user_cancelled
|
|
177
|
+
},
|
|
178
|
+
volumes: {
|
|
179
|
+
permission: parseVolume(userConfig.volumes?.permission, DEFAULT_CONFIG.volumes.permission),
|
|
180
|
+
complete: parseVolume(userConfig.volumes?.complete, DEFAULT_CONFIG.volumes.complete),
|
|
181
|
+
subagent_complete: parseVolume(
|
|
182
|
+
userConfig.volumes?.subagent_complete,
|
|
183
|
+
DEFAULT_CONFIG.volumes.subagent_complete
|
|
184
|
+
),
|
|
185
|
+
error: parseVolume(userConfig.volumes?.error, DEFAULT_CONFIG.volumes.error),
|
|
186
|
+
question: parseVolume(userConfig.volumes?.question, DEFAULT_CONFIG.volumes.question),
|
|
187
|
+
interrupted: parseVolume(userConfig.volumes?.interrupted, DEFAULT_CONFIG.volumes.interrupted),
|
|
188
|
+
user_cancelled: parseVolume(userConfig.volumes?.user_cancelled, DEFAULT_CONFIG.volumes.user_cancelled)
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
} catch {
|
|
192
|
+
return DEFAULT_CONFIG;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function isEventSoundEnabled(config, event) {
|
|
196
|
+
return config.events[event].sound;
|
|
197
|
+
}
|
|
198
|
+
function isEventNotificationEnabled(config, event) {
|
|
199
|
+
return config.events[event].notification;
|
|
200
|
+
}
|
|
201
|
+
function getMessage(config, event) {
|
|
202
|
+
return config.messages[event];
|
|
203
|
+
}
|
|
204
|
+
function getSoundPath(config, event) {
|
|
205
|
+
return config.sounds[event];
|
|
206
|
+
}
|
|
207
|
+
function getSoundVolume(config, event) {
|
|
208
|
+
return config.volumes[event];
|
|
209
|
+
}
|
|
210
|
+
function getIconPath(config) {
|
|
211
|
+
if (!config.showIcon) {
|
|
212
|
+
return void 0;
|
|
213
|
+
}
|
|
214
|
+
try {
|
|
215
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
216
|
+
const __dirname = dirname(__filename);
|
|
217
|
+
const iconPath = join(__dirname, "..", "logos", "opencode-logo-dark.png");
|
|
218
|
+
if (existsSync(iconPath)) {
|
|
219
|
+
return iconPath;
|
|
220
|
+
}
|
|
221
|
+
} catch {
|
|
222
|
+
}
|
|
223
|
+
return void 0;
|
|
224
|
+
}
|
|
225
|
+
function interpolateMessage(message, context) {
|
|
226
|
+
let result = message;
|
|
227
|
+
const sessionTitle = context.sessionTitle || "";
|
|
228
|
+
result = result.replaceAll("{sessionTitle}", sessionTitle);
|
|
229
|
+
const projectName = context.projectName || "";
|
|
230
|
+
result = result.replaceAll("{projectName}", projectName);
|
|
231
|
+
result = result.replace(/\s*[:\-|]\s*$/, "").trim();
|
|
232
|
+
result = result.replace(/\s{2,}/g, " ");
|
|
233
|
+
return result;
|
|
234
|
+
}
|
|
235
|
+
export {
|
|
236
|
+
getConfigPath,
|
|
237
|
+
getIconPath,
|
|
238
|
+
getMessage,
|
|
239
|
+
getSoundPath,
|
|
240
|
+
getSoundVolume,
|
|
241
|
+
interpolateMessage,
|
|
242
|
+
isEventNotificationEnabled,
|
|
243
|
+
isEventSoundEnabled,
|
|
244
|
+
loadConfig
|
|
245
|
+
};
|
package/dist/index.d.ts
ADDED