qq-bot-roost 0.9.8 → 0.9.9

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/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  <img src="https://img.shields.io/badge/dependencies-0-brightgreen" alt="零依赖">
11
11
  <img src="https://img.shields.io/badge/tests-679%20passed-brightgreen" alt="测试 679 项">
12
12
  <img src="https://img.shields.io/badge/plugins-JS%20%7C%20Python%20%7C%20Go%20%7C%20any-blue" alt="多语言插件">
13
- <img src="https://img.shields.io/badge/version-0.9.8-blueviolet" alt="版本 0.9.8">
13
+ <img src="https://img.shields.io/badge/version-0.9.9-blueviolet" alt="版本 0.9.9">
14
14
  <img src="https://img.shields.io/badge/license-Non--Commercial-red" alt="禁止商用">
15
15
  <a href="https://github.com/tdcq9594/qq-bot-roost/actions"><img src="https://img.shields.io/github/actions/workflow/status/tdcq9594/qq-bot-roost/ci.yml?branch=master" alt="CI"></a>
16
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qq-bot-roost",
3
- "version": "0.9.8",
3
+ "version": "0.9.9",
4
4
  "type": "module",
5
5
  "description": "栖 Roost:零依赖的 QQ 官方机器人框架,填 AppID/AppSecret 即连,插件可写任意语言",
6
6
  "license": "SEE LICENSE IN LICENSE",
package/src/message.js CHANGED
@@ -259,6 +259,11 @@ export function buildMessage(eventName, d, { api, cfg, outbound, session, traceI
259
259
  * 让插件生成会出现「同一条消息被两个插件各生成一个 id」。
260
260
  */
261
261
  traceId: String(traceId || newTraceId()),
262
+ /**
263
+ * 内核拿到这条事件的时间。四段耗时的第一段靠它算:
264
+ * 官方事件到达 → 插件真正拿到,中间是内核的分发排队。
265
+ */
266
+ receivedAt,
262
267
  kind,
263
268
  event: eventName,
264
269
  // 事件元信息(属于哪个 intent、中文说明),来自 src/events.js
package/web/app.js CHANGED
@@ -2268,6 +2268,7 @@ function renderMarketRows() {
2268
2268
  <span class="kind-tag ${p.runtime === 'node' ? 'int' : 'ext'}">
2269
2269
  ${p.runtime === 'node' ? '内建 · node' : '外部 · ' + escapeHtml(p.runtime || '')}
2270
2270
  </span>
2271
+ ${verifyTag(p)}
2271
2272
  ${p.author ? `<span class="hint">by ${escapeHtml(p.author)}</span>` : ''}
2272
2273
  ${p.credits ? `<span class="hint">${escapeHtml(p.credits)}</span>` : ''}
2273
2274
  ${p.description ? '<br>' + escapeHtml(p.description) : ''}
@@ -3585,6 +3586,23 @@ function escapeHtml(s) {
3585
3586
  return String(s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
3586
3587
  }
3587
3588
 
3589
+ /**
3590
+ * 插件分级标签。
3591
+ *
3592
+ * 分级是**我们的判断**(写在插件仓的 verified.json 里),不是插件自述;
3593
+ * 签名是另一回事——它是「这份索引没被改过」的全体属性,所有签名插件
3594
+ * 都落同一个状态,所以不能做成档位。
3595
+ */
3596
+ function verifyTag(p) {
3597
+ const map = {
3598
+ official: ['官方维护', 'vt-official', '跟着框架一起发布,代码在同一个仓库里'],
3599
+ reviewed: ['已复核', 'vt-reviewed', '我们看过代码、试过能跑,但不由我们维护'],
3600
+ self: ['作者自证', 'vt-self', '作者声明的内容,我们没有核对'],
3601
+ };
3602
+ const [label, cls, tip] = map[p.verified] || ['未验证', 'vt-none', '没有分级信息'];
3603
+ return `<span class="verify-tag ${cls}" title="${escapeHtml(tip)}">${label}</span>`;
3604
+ }
3605
+
3588
3606
  function applyFilter() {
3589
3607
  renderLogs();
3590
3608
  }
package/web/style.css CHANGED
@@ -971,6 +971,17 @@ label.switch.small { font-size: 12.5px; color: var(--muted); }
971
971
  background: var(--primary-soft, var(--panel-3)); color: var(--primary);
972
972
  }
973
973
 
974
+ /* 插件分级标签:官方 / 已复核 / 作者自证 / 未验证 */
975
+ .verify-tag {
976
+ display: inline-block; margin-right: 6px; padding: 0 6px;
977
+ border-radius: 4px; font-size: 10.5px; font-weight: 600;
978
+ vertical-align: 1px;
979
+ }
980
+ .verify-tag.vt-official { background: var(--primary-soft); color: var(--primary); }
981
+ .verify-tag.vt-reviewed { background: var(--c-teal-soft); color: var(--c-teal); }
982
+ .verify-tag.vt-self { background: var(--warn-soft); color: var(--warn); }
983
+ .verify-tag.vt-none { background: var(--panel-3); color: var(--muted); }
984
+
974
985
  /* Beta 标记:签名开关还是 beta,不能让它看起来跟别的开关一样成熟 */
975
986
  .beta-tag {
976
987
  display: inline-block; margin-left: 6px; padding: 0 7px;