@xiaozhi-pro/connector 1.0.2 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiaozhi-pro/connector",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "XiaozhiPro Agent Connector: bridge local ACP agents to XiaozhiPro Agent Gateway",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/src/acp.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { spawn } from 'node:child_process';
2
2
  import readline from 'node:readline';
3
3
  import { log } from './log.js';
4
+ import { VERSION } from './version.js';
4
5
 
5
6
  const PROTOCOL_VERSION = 1;
6
7
  const STDERR_LIMIT = 12000;
@@ -72,7 +73,7 @@ export class ACPProcess {
72
73
  {
73
74
  protocolVersion: PROTOCOL_VERSION,
74
75
  clientCapabilities: { elicitation: { form: {} } },
75
- clientInfo: { name: 'xiaozhi-pro-connector', version: '1.0.0' },
76
+ clientInfo: { name: 'xiaozhi-pro-connector', version: VERSION },
76
77
  },
77
78
  15000,
78
79
  );
package/src/cli.js CHANGED
@@ -1,8 +1,7 @@
1
1
  import { AGENT_LABELS, AGENT_ORDER, collectTargets } from './detection.js';
2
2
  import { Connector } from './connector.js';
3
3
  import { log } from './log.js';
4
-
5
- const VERSION = '1.0.1';
4
+ import { VERSION } from './version.js';
6
5
  const SERVER = 'wss://api.qlcloud.top/xzp';
7
6
 
8
7
  const HELP = `Usage: xiaozhi-pro-connector [options]
package/src/version.js ADDED
@@ -0,0 +1,8 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+
5
+ // 版本号唯一来源:package.json。禁止在其他文件硬编码,避免发布后 --version 对不上。
6
+ export const VERSION = JSON.parse(
7
+ readFileSync(path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'package.json'), 'utf8'),
8
+ ).version;