cliclaw 1.0.10 → 1.0.11
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/ecosystem.config.js +9 -1
- package/package.json +1 -1
- package/src/telegram.ts +14 -3
package/ecosystem.config.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
const path = require('path')
|
|
2
2
|
const HOME = process.env.HOME || process.env.USERPROFILE || '/root'
|
|
3
|
+
const SEP = process.platform === 'win32' ? ';' : ':'
|
|
4
|
+
// Always include npm global bin so spawned CLIs (claude, codex) are found
|
|
5
|
+
const NPM_BIN = process.platform === 'win32'
|
|
6
|
+
? path.join(process.env.APPDATA || path.join(HOME, 'AppData', 'Roaming'), 'npm')
|
|
7
|
+
: `${HOME}/.npm-global/bin:/usr/local/bin:/usr/bin:/bin`
|
|
8
|
+
const FULL_PATH = [process.env.PATH || '', NPM_BIN].filter(Boolean).join(SEP)
|
|
3
9
|
|
|
4
10
|
module.exports = {
|
|
5
11
|
apps: [{
|
|
@@ -12,8 +18,10 @@ module.exports = {
|
|
|
12
18
|
cwd: __dirname,
|
|
13
19
|
env: {
|
|
14
20
|
NODE_ENV: 'production',
|
|
15
|
-
PATH:
|
|
21
|
+
PATH: FULL_PATH,
|
|
16
22
|
HOME,
|
|
23
|
+
APPDATA: process.env.APPDATA || path.join(HOME, 'AppData', 'Roaming'),
|
|
24
|
+
USERPROFILE: process.env.USERPROFILE || HOME,
|
|
17
25
|
},
|
|
18
26
|
watch: false,
|
|
19
27
|
autorestart: true,
|
package/package.json
CHANGED
package/src/telegram.ts
CHANGED
|
@@ -36,10 +36,21 @@ export function formatTelegramMarkdown(text: string): string {
|
|
|
36
36
|
(_match, label = '', url = '') => `[${escapeTelegramMarkdownV2(label)}](${url.replace(/\\/g, '\\\\').replace(/\)/g, '\\)')})`
|
|
37
37
|
)
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
// Headings and bold must use protectSegments so their *markers* aren't
|
|
40
|
+
// escaped again by the global escapeTelegramMarkdownV2 call below.
|
|
41
|
+
protectSegments(
|
|
42
|
+
/^#{1,6}[ \t]+(.+)$/gm,
|
|
43
|
+
(_match, title = '') => `*${escapeTelegramMarkdownV2(title.trim())}*`
|
|
44
|
+
)
|
|
40
45
|
formatted = formatted.replace(/^(?:[ \t]*)([-*])[ \t]+/gm, '• ')
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
protectSegments(
|
|
47
|
+
/\*\*([^*\n]+)\*\*/g,
|
|
48
|
+
(_match, bold = '') => `*${escapeTelegramMarkdownV2(bold)}*`
|
|
49
|
+
)
|
|
50
|
+
protectSegments(
|
|
51
|
+
/__([^_\n]+)__/g,
|
|
52
|
+
(_match, bold = '') => `*${escapeTelegramMarkdownV2(bold)}*`
|
|
53
|
+
)
|
|
43
54
|
|
|
44
55
|
formatted = escapeTelegramMarkdownV2(formatted)
|
|
45
56
|
|