@yunzai-ng/core 0.1.0 → 0.1.1

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.
@@ -42,10 +42,10 @@ export declare const coreConfigSchema: import("./schema.js").Schema<{
42
42
  dir?: string | undefined;
43
43
  };
44
44
  server: {
45
+ readonly: boolean;
45
46
  enable: boolean;
46
47
  host: string;
47
48
  port: number;
48
- readonly: boolean;
49
49
  token?: string | undefined;
50
50
  publicUrl?: string | undefined;
51
51
  };
package/dist/store/sql.js CHANGED
@@ -114,10 +114,10 @@ export class SqliteHandle {
114
114
  * @throws 版本号未严格递增,或某条迁移执行失败
115
115
  */
116
116
  async migrate(migrations) {
117
- await this.run(`CREATE TABLE IF NOT EXISTS ${MIGRATION_TABLE} (
118
- version INTEGER PRIMARY KEY,
119
- name TEXT NOT NULL,
120
- applied_at INTEGER NOT NULL
117
+ await this.run(`CREATE TABLE IF NOT EXISTS ${MIGRATION_TABLE} (
118
+ version INTEGER PRIMARY KEY,
119
+ name TEXT NOT NULL,
120
+ applied_at INTEGER NOT NULL
121
121
  )`);
122
122
  const sorted = [...migrations].sort((a, b) => a.version - b.version);
123
123
  for (let i = 1; i < sorted.length; i++) {
package/package.json CHANGED
@@ -1,9 +1,19 @@
1
1
  {
2
2
  "name": "@yunzai-ng/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Yunzai NG 内核:插件宿主、统一事件模型、中间件管线、存储与渲染抽象",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",
7
+ "homepage": "https://github.com/Yunzai-NG/yunzai-ng#readme",
8
+ "bugs": "https://github.com/Yunzai-NG/yunzai-ng/issues",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/Yunzai-NG/yunzai-ng.git",
12
+ "directory": "packages/core"
13
+ },
14
+ "engines": {
15
+ "node": ">=20.11.0"
16
+ },
7
17
  "main": "./dist/index.js",
8
18
  "types": "./dist/index.d.ts",
9
19
  "exports": {
@@ -29,7 +39,7 @@
29
39
  "pino": "^9.6.0",
30
40
  "undici": "^7.3.0",
31
41
  "yaml": "^2.7.0",
32
- "@yunzai-ng/types": "0.1.0"
42
+ "@yunzai-ng/types": "0.1.1"
33
43
  },
34
44
  "optionalDependencies": {
35
45
  "better-sqlite3": "^11.8.1",
@@ -17,7 +17,7 @@
17
17
  * 正在进行的 `connect()` —— 被动接入的适配器要等对端连入才返回,不先 abort 会卡住停机。
18
18
  *
19
19
  * **适配器插件卸载时账号要同步下线。** `onUnregister` 是同步回调(见 registry.ts),
20
- * 故此处同步改状态并 abort,异步的 socket 关闭交给 `#closing` 由 `stop()` 兜底 await。
20
+ * 故此处同步改状态并 abort,异步的 socket 关闭交给 `#closing` 由 `stop()` 兜底 await。
21
21
  */
22
22
  import type {
23
23
  AccountRecord,
@@ -11,7 +11,7 @@
11
11
  * 否则用户会收到两条一样的回复。
12
12
  *
13
13
  * **只有发送类调用套 `sendTimeout`。** 查询类不套:`getGroupMemberList` 在千人群上本就要
14
- * 十几秒,按「发一条消息」的尺度掐掉它是错的,那属于适配器自己的 HTTP 超时。
14
+ * 十几秒,按「发一条消息」的尺度掐掉它是错的,那属于适配器自己的 HTTP 超时。
15
15
  */
16
16
  import type {
17
17
  BotApi,
@@ -16,7 +16,7 @@
16
16
  * `DisposalRegistry`,账号一断开即全部回收,适配器不必自行记录。
17
17
  *
18
18
  * 工厂分两层是刻意的:内核装配时绑定一次全局依赖,账号管理器每次连接只补「该账号」专属
19
- * 的几项 —— 于是账号管理器不必认识分发器与服务器,`adapter` 层也不会反向依赖 `pipeline`。
19
+ * 的几项 —— 于是账号管理器不必认识分发器与服务器,`adapter` 层也不会反向依赖 `pipeline`。
20
20
  */
21
21
  import type {
22
22
  AccountRecord,
@@ -13,7 +13,7 @@
13
13
  * 问题(把手机号填进验证码框),故 `answer()` 必须带 `seq`,对不上就拒绝。
14
14
  *
15
15
  * **一切都有上限**:步骤数、每次提问的超时、整个会话的 TTL,结束即自毁 —— 一个人点开
16
- * 登录页就走开,不该留下一个永远挂着的 promise 和一张常驻内存的二维码。
16
+ * 登录页就走开,不该留下一个永远挂着的 promise 和一张常驻内存的二维码。
17
17
  */
18
18
  import type {
19
19
  AccountRecord,