dsh-workbench-message 0.0.0-stage → 0.1.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.
@@ -0,0 +1,280 @@
1
+ /**
2
+ * 消息插件的配置项:白名单 schema + 本地读写。
3
+ *
4
+ * 与四个业务插件同一套范式:配置只存覆盖项,默认值留在代码里;存放位置是宿主的
5
+ * meta 表(键 `config.message.<id>`),不建新表、不进同步、不进备份。
6
+ * 读取永远宽松(表缺失/JSON 坏/取值越界都回退默认值并给 warnings),只有写入会抛错。
7
+ */
8
+
9
+ import { tableExists, tx } from "../db/db.js";
10
+
11
+ export const DOMAIN = "message";
12
+ export const SCHEMA_VERSION = 1;
13
+
14
+ const GROUPS = [
15
+ { id: "sound", zh: "提示音", en: "Sound" },
16
+ { id: "quiet", zh: "免打扰", en: "Quiet hours" },
17
+ { id: "retention", zh: "保留期", en: "Retention" },
18
+ { id: "list", zh: "列表", en: "List" },
19
+ ];
20
+
21
+ const ITEMS = [
22
+ {
23
+ id: "sound.enabled", group: "sound", type: "bool", surface: "ui", apply: "mount", default: true,
24
+ zh: "新消息提示音", en: "Sound for new messages",
25
+ hintZh: "关闭后收到新消息不再发声(未读数照常增加)", hintEn: "When off, new messages stay silent (unread count still grows)",
26
+ },
27
+ {
28
+ id: "sound.volume", group: "sound", type: "number", surface: "ui", apply: "mount", default: 0.4, min: 0, max: 1,
29
+ zh: "音量", en: "Volume",
30
+ hintZh: "0 到 1 之间,默认 0.4", hintEn: "Between 0 and 1, default 0.4",
31
+ },
32
+ {
33
+ id: "sound.whileHidden", group: "sound", type: "bool", surface: "ui", apply: "mount", default: false,
34
+ zh: "窗口不在前台也响", en: "Play while hidden",
35
+ hintZh: "关闭时只在工作台可见时发声,避免后台突然响", hintEn: "When off, only sound while the workbench is visible",
36
+ },
37
+ {
38
+ id: "quiet.enabled", group: "quiet", type: "bool", surface: "ui", apply: "mount", default: false,
39
+ zh: "启用免打扰", en: "Enable quiet hours",
40
+ hintZh: "开启后时间段内不发声,消息照常入库", hintEn: "Inside the window messages are stored silently",
41
+ },
42
+ {
43
+ id: "quiet.from", group: "quiet", type: "time", surface: "ui", apply: "mount", default: "22:00",
44
+ zh: "免打扰开始", en: "Quiet from",
45
+ hintZh: "24 小时制 HH:MM;跨零点自动按夜间区间处理", hintEn: "24h HH:MM; windows crossing midnight are handled",
46
+ },
47
+ {
48
+ id: "quiet.to", group: "quiet", type: "time", surface: "ui", apply: "mount", default: "08:00",
49
+ zh: "免打扰结束", en: "Quiet until",
50
+ hintZh: "等于开始时间表示全天免打扰", hintEn: "Same as start means all day",
51
+ },
52
+ {
53
+ id: "quiet.levels", group: "quiet", type: "multi", surface: "ui", apply: "mount", default: ["warning", "error"],
54
+ zh: "免打扰仍响的级别", en: "Levels that still sound",
55
+ hintZh: "默认只放行警告与错误", hintEn: "By default only warning and error are let through",
56
+ values: [
57
+ { value: "info", zh: "提示", en: "Info" },
58
+ { value: "success", zh: "成功", en: "Success" },
59
+ { value: "warning", zh: "警告", en: "Warning" },
60
+ { value: "error", zh: "错误", en: "Error" },
61
+ ],
62
+ },
63
+ {
64
+ id: "retention.readDays", group: "retention", type: "int", surface: "api", apply: "api", default: 30, min: 0, max: 3650,
65
+ zh: "已读保留天数", en: "Keep read messages (days)",
66
+ hintZh: "已读消息超过该天数自动清理;未读永不按时间清理,0 表示不按时间清理", hintEn: "Read messages older than this are pruned; unread never expires by time, 0 disables",
67
+ },
68
+ {
69
+ id: "list.pageSize", group: "list", type: "enum", surface: "ui", apply: "mount", default: 20,
70
+ zh: "每页条数", en: "Page size",
71
+ hintZh: "收件箱每页显示多少条", hintEn: "Messages per page in Inbox",
72
+ values: [
73
+ { value: 12, zh: "12 条", en: "12" },
74
+ { value: 20, zh: "20 条", en: "20" },
75
+ { value: 50, zh: "50 条", en: "50" },
76
+ ],
77
+ },
78
+ ];
79
+
80
+ const BY_ID = new Map(ITEMS.map((item) => [item.id, item]));
81
+
82
+ function label(item) {
83
+ return item.zh + "(" + item.id + ")";
84
+ }
85
+
86
+ function coerceValue(item, raw) {
87
+ if (item.type === "bool") {
88
+ if (typeof raw !== "boolean") throw new Error(label(item) + " 需要 true/false");
89
+ return raw;
90
+ }
91
+ if (item.type === "int" || item.type === "number") {
92
+ const value = Number(raw);
93
+ if (!Number.isFinite(value)) throw new Error(label(item) + " 需要数字");
94
+ const min = item.min === undefined ? -Infinity : item.min;
95
+ const max = item.max === undefined ? Infinity : item.max;
96
+ if (value < min || value > max) throw new Error(label(item) + " 需要在 " + min + "–" + max + " 之间");
97
+ return item.type === "int" ? Math.round(value) : value;
98
+ }
99
+ if (item.type === "enum") {
100
+ const values = (item.values || []).map((option) => option.value);
101
+ const hit = values.indexOf(raw);
102
+ if (hit < 0) throw new Error(label(item) + " 只接受:" + values.join(" / "));
103
+ return values[hit];
104
+ }
105
+ if (item.type === "multi") {
106
+ if (!Array.isArray(raw)) throw new Error(label(item) + " 需要数组");
107
+ const values = (item.values || []).map((option) => option.value);
108
+ const seen = [];
109
+ for (const entry of raw) {
110
+ if (values.indexOf(entry) < 0) throw new Error(label(item) + " 含未知取值:" + entry);
111
+ if (seen.indexOf(entry) < 0) seen.push(entry);
112
+ }
113
+ return seen;
114
+ }
115
+ if (item.type === "time") {
116
+ if (typeof raw !== "string" || !/^([01]\d|2[0-3]):[0-5]\d$/.test(raw)) throw new Error(label(item) + " 需要 HH:MM");
117
+ return raw;
118
+ }
119
+ if (item.type === "string") {
120
+ if (typeof raw !== "string") throw new Error(label(item) + " 需要字符串");
121
+ const max = item.maxLength || 200;
122
+ if (raw.length > max) throw new Error(label(item) + " 不能超过 " + max + " 个字符");
123
+ return raw;
124
+ }
125
+ throw new Error(label(item) + " 的类型不受支持:" + item.type);
126
+ }
127
+
128
+ function metaRows(db) {
129
+ if (!tableExists(db, "meta")) return [];
130
+ try {
131
+ return db.prepare("SELECT k,v FROM meta WHERE k LIKE ?").all("config." + DOMAIN + ".%");
132
+ } catch {
133
+ return [];
134
+ }
135
+ }
136
+
137
+ function metaSet(db, key, value) {
138
+ db.prepare("INSERT INTO meta(k,v) VALUES(?,?) ON CONFLICT(k) DO UPDATE SET v=excluded.v").run(String(key), String(value));
139
+ }
140
+
141
+ function metaDelete(db, key) {
142
+ db.prepare("DELETE FROM meta WHERE k=?").run(String(key));
143
+ }
144
+
145
+ function keyOf(id) {
146
+ return "config." + DOMAIN + "." + id;
147
+ }
148
+
149
+ export function loadConfig(db) {
150
+ const overrides = Object.create(null);
151
+ const values = Object.create(null);
152
+ const warnings = [];
153
+ for (const item of ITEMS) values[item.id] = item.default;
154
+ const rows = metaRows(db);
155
+ const prefix = "config." + DOMAIN + ".";
156
+ for (const row of rows) {
157
+ const id = String(row.k).slice(prefix.length);
158
+ const item = BY_ID.get(id);
159
+ if (!item) {
160
+ warnings.push({ code: "config_unknown_key", id: id, message: "未知配置项已忽略:" + id });
161
+ continue;
162
+ }
163
+ let parsed = null;
164
+ try {
165
+ parsed = JSON.parse(String(row.v));
166
+ } catch {
167
+ warnings.push({ code: "config_bad_json", id: id, message: "配置值不是合法 JSON,已回退默认:" + id });
168
+ continue;
169
+ }
170
+ try {
171
+ const value = coerceValue(item, parsed);
172
+ overrides[id] = value;
173
+ values[id] = value;
174
+ } catch (error) {
175
+ warnings.push({ code: "config_invalid", id: id, message: String((error && error.message) || error) + ",已回退默认" });
176
+ }
177
+ }
178
+ return { values: values, overrides: overrides, warnings: warnings };
179
+ }
180
+
181
+ export function configValues(db) {
182
+ return loadConfig(db).values;
183
+ }
184
+
185
+ function publicItem(item) {
186
+ return {
187
+ id: item.id,
188
+ group: item.group,
189
+ type: item.type,
190
+ surface: item.surface,
191
+ apply: item.apply,
192
+ default: item.default,
193
+ zh: item.zh,
194
+ en: item.en,
195
+ hintZh: item.hintZh,
196
+ hintEn: item.hintEn,
197
+ min: item.min,
198
+ max: item.max,
199
+ values: item.values,
200
+ };
201
+ }
202
+
203
+ export function configState(db) {
204
+ const loaded = loadConfig(db);
205
+ return {
206
+ domain: DOMAIN,
207
+ schemaVersion: SCHEMA_VERSION,
208
+ groups: GROUPS,
209
+ items: ITEMS.map(publicItem),
210
+ values: loaded.values,
211
+ overrides: loaded.overrides,
212
+ warnings: loaded.warnings,
213
+ table: "meta",
214
+ };
215
+ }
216
+
217
+ export function writeConfig(db, raw) {
218
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) throw new Error("values 需要 { 配置项: 值 } 形式");
219
+ const ids = Object.keys(raw);
220
+ if (!ids.length) throw new Error("没有要保存的配置项");
221
+ const prepared = [];
222
+ for (const id of ids) {
223
+ const item = BY_ID.get(id);
224
+ if (!item) throw new Error("未知配置项:" + id + "(可用 message.configGet 查看全部)");
225
+ prepared.push({ id: id, value: coerceValue(item, raw[id]) });
226
+ }
227
+ tx(db, function () {
228
+ for (const row of prepared) metaSet(db, keyOf(row.id), JSON.stringify(row.value));
229
+ });
230
+ return {
231
+ changed: prepared.map((row) => row.id),
232
+ values: loadConfig(db).values,
233
+ state: configState(db),
234
+ };
235
+ }
236
+
237
+ export function resetConfig(db, ids) {
238
+ const targets = Array.isArray(ids) && ids.length ? ids : ITEMS.map((item) => item.id);
239
+ for (const id of targets) {
240
+ if (!BY_ID.has(id)) throw new Error("未知配置项:" + id);
241
+ }
242
+ tx(db, function () {
243
+ for (const id of targets) metaDelete(db, keyOf(id));
244
+ });
245
+ return { reset: targets.slice(), values: loadConfig(db).values, state: configState(db) };
246
+ }
247
+
248
+ export function registerConfigActions(api) {
249
+ const action = api.action;
250
+ action("message.configGet", {
251
+ description: "只读:消息插件的配置项定义、当前值与覆盖项(含提示音、免打扰、保留期、列表分页)",
252
+ input: { type: "object", properties: {}, additionalProperties: false },
253
+ execute: () => configState(api.db),
254
+ render: (r) =>
255
+ "消息配置 " + Object.keys(r.values || {}).length + " 项;覆盖 " + Object.keys(r.overrides || {}).length + " 项" +
256
+ (r.warnings && r.warnings.length ? ";warnings " + r.warnings.length : "") + "。",
257
+ });
258
+ action("message.configSet", {
259
+ description: "写入配置覆盖项(值会做类型与范围校验,越界抛错);配置存本地 meta 表,不进同步与备份",
260
+ input: {
261
+ type: "object",
262
+ properties: {
263
+ values: { type: "object", description: "要写入的配置项,如 {\"sound.enabled\": false, \"quiet.from\": \"22:30\"}" },
264
+ },
265
+ required: ["values"],
266
+ },
267
+ examples: [{ purpose: "关闭提示音并设置免打扰", args: { values: { "sound.enabled": false, "quiet.enabled": true, "quiet.from": "22:30" } } }],
268
+ execute: (args) => writeConfig(api.db, args.values),
269
+ render: (r) => "已更新消息配置:" + (r.changed || []).join("、"),
270
+ });
271
+ action("message.configReset", {
272
+ description: "清除配置覆盖项,回退默认值;不传 ids 表示全部重置",
273
+ input: {
274
+ type: "object",
275
+ properties: { ids: { type: "array", items: { type: "string" }, description: "要重置的配置项 id 列表" } },
276
+ },
277
+ execute: (args) => resetConfig(api.db, args.ids),
278
+ render: (r) => "已重置 " + (r.reset || []).length + " 个配置项。",
279
+ });
280
+ }
@@ -0,0 +1,216 @@
1
+ /**
2
+ * 消息插件的数据页:只读浏览本插件负责的表(message)。
3
+ *
4
+ * 两个 action(消息数据页的数据源,不经过宿主统一接口):
5
+ * - message.dataTables:表清单 + 列元信息 + 行数/索引统计;
6
+ * - message.dataQuery:分页/排序/关键字过滤,只读,表名与排序列走白名单。
7
+ *
8
+ * 刻意不提供任意 SQL、导出与写操作。
9
+ */
10
+
11
+ import { DOMAIN } from "./config.js";
12
+
13
+ export const SCHEMA_VERSION = 1;
14
+
15
+ const TABLES = [{ name: "message", zh: "消息", en: "Messages" }];
16
+
17
+ const COLUMN_LABELS = {
18
+ id: { zh: "ID", en: "ID" },
19
+ title: { zh: "标题", en: "Title" },
20
+ body: { zh: "正文", en: "Body" },
21
+ level: { zh: "级别", en: "Level" },
22
+ source: { zh: "来源", en: "Source" },
23
+ audience: { zh: "收件人", en: "Audience" },
24
+ dedupe_key: { zh: "去重键", en: "Dedupe key" },
25
+ meta: { zh: "附加信息", en: "Meta" },
26
+ created_at: { zh: "创建时间", en: "Created at" },
27
+ read_at: { zh: "已读时间", en: "Read at" },
28
+ deleted_at: { zh: "删除时间", en: "Deleted at" },
29
+ rev: { zh: "版本号", en: "Rev" },
30
+ };
31
+
32
+ const SYSTEM_COLUMNS = new Set(["rev", "created_at", "read_at", "deleted_at"]);
33
+ const PAGE_SIZES = [10, 25, 50, 100, 200];
34
+ const MAX_SEARCH = 100;
35
+ const MAX_FILTERS = 20;
36
+
37
+ function labelOf(name) {
38
+ const hit = COLUMN_LABELS[name];
39
+ return hit ? { zh: hit.zh, en: hit.en } : { zh: name, en: name };
40
+ }
41
+
42
+ function kindOf(name, declared) {
43
+ const type = String(declared || "").toUpperCase();
44
+ if (name === "id" || name.endsWith("_id")) return "id";
45
+ if (name.endsWith("_at") && type === "INTEGER") return "timestamp";
46
+ if (type === "INTEGER" || type === "REAL") return "number";
47
+ return "text";
48
+ }
49
+
50
+ function pickPageSize(input) {
51
+ const n = Math.floor(Number(input));
52
+ if (!Number.isFinite(n) || n <= 0) return 50;
53
+ let best = PAGE_SIZES[0];
54
+ for (const size of PAGE_SIZES) if (Math.abs(size - n) < Math.abs(best - n)) best = size;
55
+ return best;
56
+ }
57
+
58
+ function likeEscape(text) {
59
+ return String(text).slice(0, MAX_SEARCH).replace(/[\\%_]/g, (m) => "\\" + m);
60
+ }
61
+
62
+ function normalizeFilters(raw, names) {
63
+ if (raw === undefined || raw === null) return [];
64
+ if (typeof raw !== "object" || Array.isArray(raw)) throw new Error("filters 需要是 {列名: 值} 对象");
65
+ const keys = Object.keys(raw);
66
+ if (keys.length > MAX_FILTERS) throw new Error("列筛选最多 " + MAX_FILTERS + " 列");
67
+ const out = [];
68
+ for (const key of keys) {
69
+ const column = String(key);
70
+ if (names.indexOf(column) < 0) throw new Error("未知筛选列:" + column);
71
+ const value = raw[key];
72
+ if (value === undefined || value === null) continue;
73
+ const text = String(value).trim().slice(0, MAX_SEARCH);
74
+ if (text) out.push({ column: column, value: text });
75
+ }
76
+ return out;
77
+ }
78
+
79
+ function toPlain(row) {
80
+ const out = {};
81
+ for (const key of Object.keys(row)) out[key] = typeof row[key] === "bigint" ? Number(row[key]) : row[key];
82
+ return out;
83
+ }
84
+
85
+ export function registerDataActions(api) {
86
+ const db = api.db;
87
+
88
+ function tableMeta() {
89
+ return TABLES.map((def) => {
90
+ const table = def.name;
91
+ let columns = [];
92
+ try {
93
+ columns = db.prepare("PRAGMA table_info(" + table + ")").all().map((c) => ({
94
+ name: c.name,
95
+ type: String(c.type || ""),
96
+ kind: kindOf(c.name, c.type),
97
+ label: labelOf(c.name),
98
+ system: SYSTEM_COLUMNS.has(c.name),
99
+ pk: !!c.pk,
100
+ }));
101
+ } catch {
102
+ columns = [];
103
+ }
104
+ let count = 0;
105
+ let deletedCount = 0;
106
+ try {
107
+ const row = db
108
+ .prepare("SELECT COUNT(*) AS total, SUM(CASE WHEN deleted_at IS NULL THEN 1 ELSE 0 END) AS live FROM " + table)
109
+ .get();
110
+ count = Number(row && row.live) || 0;
111
+ deletedCount = Math.max(0, (Number(row && row.total) || 0) - count);
112
+ } catch {
113
+ count = 0;
114
+ }
115
+ return { name: table, label: { zh: def.zh, en: def.en }, columns: columns, count: count, deletedCount: deletedCount };
116
+ });
117
+ }
118
+
119
+ function tableStats() {
120
+ return TABLES.map((def) => {
121
+ const out = { rows: 0, columnCount: 0, primaryKey: [], indexes: [], lastWrite: null };
122
+ try {
123
+ const info = db.prepare("PRAGMA table_info(" + def.name + ")").all();
124
+ out.columnCount = info.length;
125
+ out.primaryKey = info.filter((c) => c.pk).map((c) => c.name);
126
+ out.rows = Number(db.prepare("SELECT COUNT(*) AS n FROM " + def.name).get().n) || 0;
127
+ out.indexes = db.prepare("PRAGMA index_list(" + def.name + ")").all().map((ix) => ({
128
+ name: ix.name,
129
+ unique: !!ix.unique,
130
+ origin: ix.origin || "c",
131
+ }));
132
+ const last = db.prepare("SELECT MAX(created_at) AS ts FROM " + def.name).get();
133
+ out.lastWrite = last && last.ts ? Number(last.ts) : null;
134
+ } catch {
135
+ /* 表缺失:保持零值 */
136
+ }
137
+ return { name: def.name, stats: out };
138
+ });
139
+ }
140
+
141
+ api.action("message.dataTables", {
142
+ description: "只读:消息插件负责的表清单、列元信息、行数与索引统计",
143
+ input: { type: "object", properties: { stats: { type: "boolean", description: "附带索引/主键统计" } } },
144
+ execute: (args) => {
145
+ const tables = tableMeta();
146
+ if (args && args.stats === true) {
147
+ const stats = tableStats();
148
+ for (const table of tables) {
149
+ const hit = stats.find((row) => row.name === table.name);
150
+ table.stats = hit ? hit.stats : null;
151
+ }
152
+ }
153
+ return { domain: DOMAIN, tables: tables };
154
+ },
155
+ render: (r) => "消息数据表 " + r.tables.length + " 张:" + r.tables.map((t) => t.name + "(" + t.count + ")").join("、"),
156
+ });
157
+
158
+ api.action("message.dataQuery", {
159
+ description: "只读:分页查询消息表;表名/排序列/筛选列都走白名单",
160
+ input: {
161
+ type: "object",
162
+ properties: {
163
+ table: { type: "string", description: "表名,目前只有 message" },
164
+ page: { type: "number", description: "页码,从 1 开始,默认 1" },
165
+ pageSize: { type: "number", description: "每页数量,取 10/25/50/100/200 中最近的值,默认 50" },
166
+ sort: { type: "string", description: "排序列名(必须是真实列)" },
167
+ order: { type: "string", enum: ["asc", "desc"], description: "排序方向,默认 desc" },
168
+ search: { type: "string", description: "标题/正文/来源模糊搜索" },
169
+ filters: { type: "object", description: "逐列包含筛选:{列名: 值}" },
170
+ includeDeleted: { type: "boolean", description: "包含已软删的行" },
171
+ },
172
+ required: ["table"],
173
+ },
174
+ execute: (args) => {
175
+ const input = args || {};
176
+ const def = TABLES.find((row) => row.name === String(input.table || ""));
177
+ if (!def) throw new Error("未知数据表:" + String(input.table || ""));
178
+ const columns = tableMeta().find((row) => row.name === def.name).columns;
179
+ const names = columns.map((col) => col.name);
180
+ const pageSize = pickPageSize(input.pageSize === undefined ? 50 : input.pageSize);
181
+ const page = Math.max(1, Number(input.page) || 1);
182
+ const order = input.order === "asc" ? "asc" : "desc";
183
+ const sort = input.sort && names.indexOf(String(input.sort)) >= 0 ? String(input.sort) : "created_at";
184
+ const where = [];
185
+ const params = [];
186
+ if (input.includeDeleted !== true) where.push("deleted_at IS NULL");
187
+ const search = String(input.search || "").trim().slice(0, MAX_SEARCH);
188
+ if (search) {
189
+ where.push("(instr(lower(title), lower(?)) > 0 OR instr(lower(body), lower(?)) > 0 OR instr(lower(source), lower(?)) > 0)");
190
+ params.push(search, search, search);
191
+ }
192
+ for (const item of normalizeFilters(input.filters, names)) {
193
+ where.push("CAST(" + item.column + " AS TEXT) LIKE ? ESCAPE '\\'");
194
+ params.push("%" + likeEscape(item.value) + "%");
195
+ }
196
+ const whereSql = where.length ? where.join(" AND ") : "1=1";
197
+ const total = Number(db.prepare("SELECT COUNT(*) AS n FROM " + def.name + " WHERE " + whereSql).get(...params).n);
198
+ const rows = db
199
+ .prepare("SELECT * FROM " + def.name + " WHERE " + whereSql + " ORDER BY " + sort + " " + order + ", id " + order + " LIMIT ? OFFSET ?")
200
+ .all(...params, pageSize, (page - 1) * pageSize)
201
+ .map(toPlain);
202
+ return {
203
+ table: def.name,
204
+ columns: columns,
205
+ rows: rows,
206
+ total: total,
207
+ page: page,
208
+ pageSize: pageSize,
209
+ pages: Math.max(1, Math.ceil(total / pageSize)),
210
+ sort: sort,
211
+ order: order,
212
+ };
213
+ },
214
+ render: (r) => "表 " + r.table + " 共 " + r.total + " 行,第 " + r.page + "/" + r.pages + " 页返回 " + r.rows.length + " 行。",
215
+ });
216
+ }
package/package.json CHANGED
@@ -1,6 +1,94 @@
1
1
  {
2
2
  "name": "dsh-workbench-message",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "个人工作台消息插件:统一消息发送入口、收件箱、未读统计与提示音",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "files": [
8
+ "lib",
9
+ "cordis.patch.yml",
10
+ "package.json",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "wb": {
15
+ "addon": {
16
+ "id": "wb-addon-message",
17
+ "title": "消息",
18
+ "description": "统一消息入口 + 统计/收件箱/配置/数据四个视图:子插件与 agent 都能发消息,带未读计数与提示音",
19
+ "version": "0.1.0",
20
+ "minShell": "0.6.5",
21
+ "tables": [
22
+ "message"
23
+ ],
24
+ "views": [
25
+ "stats",
26
+ "inbox",
27
+ "config",
28
+ "data",
29
+ "actions"
30
+ ],
31
+ "toolActions": [
32
+ "message.send",
33
+ "message.list",
34
+ "message.unreadCount",
35
+ "message.markRead",
36
+ "message.stats",
37
+ "message.configGet",
38
+ "message.configSet",
39
+ "message.configReset",
40
+ "message.dataTables",
41
+ "message.dataQuery"
42
+ ],
43
+ "client": "lib/client.js"
44
+ }
45
+ },
46
+ "exports": {
47
+ ".": "./lib/index.js",
48
+ "./client": "./lib/client.js",
49
+ "./package.json": "./package.json"
50
+ },
51
+ "dependencies": {
52
+ "dsh-workbench-host": "^0.7.0"
53
+ },
54
+ "dsh": {
55
+ "bundle": {
56
+ "patch": "./cordis.patch.yml"
57
+ },
58
+ "client": {
59
+ "platform": "web",
60
+ "inject": [
61
+ "dsh-workbench-host"
62
+ ]
63
+ },
64
+ "engines": {
65
+ "dsh": ">=0.2.0-rc.1 <0.3.0"
66
+ }
67
+ },
68
+ "license": "MIT",
69
+ "author": "ityyq777",
70
+ "keywords": [
71
+ "dsh",
72
+ "dsh-plugin",
73
+ "deepseek-harness",
74
+ "message",
75
+ "notification",
76
+ "inbox",
77
+ "sound"
78
+ ],
79
+ "repository": {
80
+ "type": "git",
81
+ "url": "git+https://github.com/ityyq777/dsh-workbench.git",
82
+ "directory": "packages/message"
83
+ },
84
+ "homepage": "https://github.com/ityyq777/dsh-workbench#readme",
85
+ "bugs": {
86
+ "url": "https://github.com/ityyq777/dsh-workbench/issues"
87
+ },
88
+ "engines": {
89
+ "node": ">=22.5"
90
+ },
91
+ "publishConfig": {
92
+ "access": "public"
93
+ }
94
+ }