@pmate/cli 0.35.5 → 0.35.7

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.
@@ -25,10 +25,11 @@ function createDesktopNotifications({ ipcMain, Notification, origin, appId, getW
25
25
  if (pending.has(input.notificationId)) return pending.get(input.notificationId)
26
26
  const window = getWindow()
27
27
  if (input.digestThreads !== undefined) {
28
- if (!Array.isArray(input.digestThreads) || !input.digestThreads.length || input.digestThreads.length > 1000 || input.digestThreads.some(item => !item || typeof item.threadId !== 'string' || !item.threadId || item.threadId.length > 512 || typeof item.title !== 'string' || item.title.length > 512 || !Number.isSafeInteger(item.count) || item.count < 1)) throw new Error('Invalid notification digest')
28
+ if (!Array.isArray(input.digestThreads) || !input.digestThreads.length || input.digestThreads.length > 1000 || input.digestThreads.some(item => !item || typeof item.threadId !== 'string' || !item.threadId || item.threadId.length > 512 || (item.teamId !== undefined && (typeof item.teamId !== 'string' || !item.teamId || item.teamId.length > 512)) || typeof item.title !== 'string' || item.title.length > 512 || !Number.isSafeInteger(item.count) || item.count < 1)) throw new Error('Invalid notification digest')
29
29
  const visible = input.digestThreads.filter(item => !(item.threadId === activeThreadId && window && window.isVisible() && window.isFocused() && !window.isMinimized()))
30
30
  if (!visible.length) return 'suppressed'
31
31
  input = { ...input, threadId: visible.length === 1 ? visible[0].threadId : undefined,
32
+ teamId: visible.length === 1 ? visible[0].teamId ?? input.teamId : input.teamId,
32
33
  body: visible.length === input.digestThreads.length ? input.body : `${visible.length} 个会话中有 ${visible.reduce((sum, item) => sum + item.count, 0)} 条新消息` }
33
34
  }
34
35
  if (input.threadId && input.threadId === activeThreadId && window && window.isVisible() && window.isFocused() && !window.isMinimized()) return 'suppressed'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmate/cli",
3
- "version": "0.35.5",
3
+ "version": "0.35.7",
4
4
  "description": "CLI utilities for the pMate project",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -11,16 +11,6 @@
11
11
  "files": [
12
12
  "dist"
13
13
  ],
14
- "scripts": {
15
- "build": "npm run clean && tsup --config tsup.config.ts && node scripts/copy-templates.js",
16
- "clean": "rimraf dist",
17
- "dev": "ts-node src/index.ts",
18
- "release": "pnpm publish",
19
- "start": "node dist/index.js",
20
- "test": "vitest run src/tests",
21
- "typecheck": "tsc --noEmit",
22
- "prepare": "npm run build"
23
- },
24
14
  "keywords": [
25
15
  "cli",
26
16
  "typescript",
@@ -67,10 +57,13 @@
67
57
  "typescript": "^5.9.3",
68
58
  "vitest": "^4.0.17"
69
59
  },
70
- "pnpm": {
71
- "overrides": {
72
- "@pmate/meta": "^1.3.1",
73
- "@pmate/utils": "^1.1.4"
74
- }
60
+ "scripts": {
61
+ "build": "npm run clean && tsup --config tsup.config.ts && node scripts/copy-templates.js",
62
+ "clean": "rimraf dist",
63
+ "dev": "ts-node src/index.ts",
64
+ "release": "pnpm publish",
65
+ "start": "node dist/index.js",
66
+ "test": "vitest run src/tests",
67
+ "typecheck": "tsc --noEmit"
75
68
  }
76
- }
69
+ }