@syengup/fridaynext-hermes-channel 0.1.0-beta.2 → 0.1.0-beta.4

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.
Files changed (92) hide show
  1. package/README.md +2 -2
  2. package/install-config.js +67 -0
  3. package/install-runtime.js +18 -9
  4. package/install.js +6 -4
  5. package/package.json +2 -1
  6. package/plugin/README.md +2 -2
  7. package/plugin/fridaynext_plugin/__init__.py +10 -0
  8. package/plugin/fridaynext_plugin/adapter.py +231 -12
  9. package/plugin/fridaynext_plugin/agent_management.py +158 -0
  10. package/plugin/fridaynext_plugin/canonical_control.py +12 -4
  11. package/plugin/fridaynext_plugin/compat_v0225.py +1247 -4
  12. package/plugin/fridaynext_plugin/continuations.py +271 -0
  13. package/plugin/fridaynext_plugin/device-tools-v1.json +302 -0
  14. package/plugin/fridaynext_plugin/device_tools.py +144 -0
  15. package/plugin/fridaynext_plugin/history.py +25 -3
  16. package/plugin/fridaynext_plugin/host.py +7 -4
  17. package/plugin/fridaynext_plugin/media_input.py +56 -9
  18. package/plugin/fridaynext_plugin/message_speech.py +143 -0
  19. package/plugin/fridaynext_plugin/multi_agent.py +221 -0
  20. package/plugin/fridaynext_plugin/reply_context.py +39 -0
  21. package/plugin/fridaynext_plugin/runtime_port.py +23 -1
  22. package/plugin/fridaynext_plugin/scheduled_tasks.py +229 -0
  23. package/plugin/fridaynext_plugin/settings.py +7 -3
  24. package/plugin/fridaynext_plugin/slash_commands.py +163 -0
  25. package/plugin/fridaynext_plugin/stream_bridge.py +83 -26
  26. package/plugin/fridaynext_plugin/stream_projection.py +30 -6
  27. package/plugin/fridaynext_plugin/subagents.py +228 -0
  28. package/plugin/plugin.yaml +11 -0
  29. package/plugin/runtime/dist/commands-routes.js +94 -0
  30. package/plugin/runtime/dist/device-tools-v1.json +302 -0
  31. package/plugin/runtime/dist/hosted-backend.js +293 -25
  32. package/plugin/runtime/dist/hosted-continuations.js +41 -0
  33. package/plugin/runtime/dist/hosted-device-tools.js +82 -0
  34. package/plugin/runtime/dist/hosted-media.js +54 -13
  35. package/plugin/runtime/dist/hosted-stream.js +124 -14
  36. package/plugin/runtime/dist/hosted-subagents.js +78 -0
  37. package/plugin/runtime/dist/platform-service.js +4 -0
  38. package/plugin/runtime/dist/plugin-control.js +10 -6
  39. package/plugin/runtime/dist/scheduled-routes.js +63 -0
  40. package/plugin/runtime/dist/service-host.js +40 -5
  41. package/plugin/runtime/dist/speech-routes.js +111 -0
  42. package/plugin/runtime/dist/tool-presentation.js +399 -0
  43. package/plugin/runtime/node_modules/.package-lock.json +6 -6
  44. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/API.md +125 -5
  45. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/README.md +21 -1
  46. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/history.d.ts +1 -0
  47. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/history.js +3 -0
  48. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/operations.d.ts +136 -0
  49. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/operations.js +105 -0
  50. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/settings-schema.d.ts +3 -0
  51. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/settings-schema.js +45 -0
  52. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/tool-presentation.d.ts +10 -0
  53. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/tool-presentation.js +2 -0
  54. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/types.d.ts +27 -2
  55. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/types.js +1 -0
  56. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/work-context.d.ts +56 -0
  57. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/work-context.js +60 -0
  58. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/device-request/pending-store.js +3 -3
  59. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/index.d.ts +5 -0
  60. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/index.js +5 -0
  61. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/canonical-update-batcher.d.ts +26 -0
  62. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/canonical-update-batcher.js +112 -0
  63. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/channel-kernel.d.ts +4 -1
  64. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/channel-kernel.js +30 -5
  65. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/durable-run-store.d.ts +18 -1
  66. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/durable-run-store.js +187 -51
  67. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/runner.d.ts +1 -0
  68. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/runner.js +52 -2
  69. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/work-context.d.ts +13 -0
  70. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/work-context.js +73 -0
  71. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/service/channel-service.js +1 -1
  72. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/command-lifecycle.d.ts +47 -0
  73. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/command-lifecycle.js +184 -0
  74. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/controls.d.ts +1 -1
  75. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/controls.js +11 -0
  76. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/messages.js +12 -6
  77. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/operations.d.ts +13 -0
  78. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/operations.js +336 -0
  79. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/runtime.d.ts +1 -0
  80. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/runtime.js +52 -10
  81. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/session-settings.js +38 -6
  82. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/sessions.js +8 -8
  83. package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/package.json +6 -7
  84. package/plugin/runtime/node_modules/tslib/README.md +3 -8
  85. package/plugin/runtime/node_modules/tslib/package.json +1 -1
  86. package/plugin/runtime/node_modules/tslib/tslib.d.ts +4 -2
  87. package/plugin/runtime/node_modules/tslib/tslib.es6.js +10 -1
  88. package/plugin/runtime/node_modules/tslib/tslib.es6.mjs +10 -1
  89. package/plugin/runtime/node_modules/tslib/tslib.js +10 -1
  90. package/plugin/runtime/package-lock.json +7 -7
  91. package/plugin/runtime/package.json +1 -1
  92. package/plugin/tools.py +3 -0
package/README.md CHANGED
@@ -8,9 +8,9 @@
8
8
 
9
9
  ## 使用与数据
10
10
 
11
- 运行本包默认命令即可安装并配对;可选--profile指定已有配置,--hermes指定CLI路径。只使用Hermes公开插件、配置和网关命令;不使用旧独立canonical客户端。官方在途任务及监督器保护保持,不带--all、--force或--yes重启网关。
11
+ 运行本包默认命令即可安装并配对;可选--profile指定已有配置,--hermes指定CLI路径。--public-access on|off用于本次明确选择公网准备;省略时保留原值,包括来源不明的旧false。只使用Hermes公开插件、配置和网关命令;不使用旧独立canonical客户端。官方在途任务及监督器保护保持,不带--all、--force或--yes重启网关。
12
12
 
13
- 已有模型配置、允许用户、Node路径、数据目录和服务身份保留。已有允许用户不含owner时先明确修复授权。全新服务准备LAN监听;已有监听不重置。安装记录与私有备份保留在当前Hermes配置目录的.fridaynext-installer下。失败会标为未完成,保留备份供修复;不会声称已回滚运行中的服务,也不取消任务或清除数据。安装器更新时重新运行发行命令;Hermes登记本机包来源,不声称官方catalog自动更新。
13
+ 已有模型配置、允许用户、Node路径、数据目录和服务身份保留。已有允许用户不含owner时先明确修复授权。全新服务准备LAN监听,并沿标准插件默认准备FridayTunnel网关待机;已有监听、显式公网开关和私有配置不重置。旧安装器写入但没有来源标记的false保守保留,需要用户明确配置选择后才启用。网关待机不代表用户权益、grant、隧道在线或模型就绪。安装记录与私有备份保留在当前Hermes配置目录的.fridaynext-installer下,config-origins.json只记录值摘要与来源,不保存配置/凭据明文;来源记录损坏或写入失败时停止并保留未完成状态,不猜用户意图。失败不会声称已回滚运行中的服务,也不取消任务或清除数据。安装器更新时重新运行发行命令;Hermes登记本机包来源,不声称官方catalog自动更新。
14
14
 
15
15
  ## 配对与手动连接
16
16
 
@@ -0,0 +1,67 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { createHash, randomUUID } from 'node:crypto';
4
+
5
+ const origins = new Set(['unset', 'unattributed', 'installer-default', 'installer-action', 'explicit']);
6
+ const hash = value => createHash('sha256').update(JSON.stringify(value)).digest('hex');
7
+ const isHash = value => typeof value === 'string' && /^[a-f0-9]{64}$/.test(value);
8
+ const problem = (code, message) => Object.assign(new Error(message), { code });
9
+
10
+ /// 安装配置的通用来源合同;读写由宿主公开入口注入,元数据不保存配置或凭据明文。
11
+ export class InstallerConfig {
12
+ constructor({ file, profileRoot, sourceHash, read, write }) {
13
+ Object.assign(this, { file, profileRoot, sourceHash, read, set: write });
14
+ this.entries = Object.create(null);
15
+ let stat;
16
+ try { stat = fs.lstatSync(file); }
17
+ catch (error) { if (error.code === 'ENOENT') return; throw problem('CONFIG_PROVENANCE_UNREADABLE', '无法读取安装配置来源记录。'); }
18
+ if (!stat.isFile() || stat.isSymbolicLink()) throw problem('CONFIG_PROVENANCE_UNSAFE', '安装配置来源记录必须是本机普通文件。');
19
+ try {
20
+ if (stat.size > 1024 * 1024) throw new Error('记录过大');
21
+ const saved = JSON.parse(fs.readFileSync(file, 'utf8'));
22
+ if (saved.version !== 1 || saved.profileRoot !== profileRoot || !saved.entries || typeof saved.entries !== 'object' || Array.isArray(saved.entries)) throw new Error('来源范围不符');
23
+ for (const [key, entry] of Object.entries(saved.entries)) {
24
+ if (!entry || !origins.has(entry.origin) || !isHash(entry.valueHash)
25
+ || (entry.sourceHash !== undefined && !isHash(entry.sourceHash))
26
+ || (entry.pending && (!origins.has(entry.pending.origin) || !isHash(entry.pending.valueHash) || !isHash(entry.pending.sourceHash)))) throw new Error('来源格式不符');
27
+ this.entries[key] = entry;
28
+ }
29
+ } catch { throw problem('CONFIG_PROVENANCE_UNREADABLE', '安装配置来源记录损坏或不属于当前Hermes配置,请先核对备份。'); }
30
+ }
31
+
32
+ observe(key) {
33
+ const value = this.read(key), valueHash = hash(value), previous = this.entries[key];
34
+ // 同值本身不能证明来源。只有已有完整记录且指纹未变时才保留原来源;未完成写入保守降级。
35
+ this.entries[key] = value === null ? { origin: 'unset', valueHash }
36
+ : previous && !previous.pending && previous.valueHash === valueHash ? previous
37
+ : { origin: 'unattributed', valueHash };
38
+ return value;
39
+ }
40
+
41
+ save() {
42
+ const temporary = path.join(path.dirname(this.file), '.config-origins-' + randomUUID() + '.tmp');
43
+ let fd;
44
+ try {
45
+ fd = fs.openSync(temporary, 'wx', 0o600);
46
+ fs.writeFileSync(fd, JSON.stringify({ version: 1, profileRoot: this.profileRoot, entries: this.entries }, null, 2) + '\n');
47
+ fs.fsyncSync(fd); fs.closeSync(fd); fd = undefined;
48
+ fs.renameSync(temporary, this.file);
49
+ } catch { throw problem('CONFIG_PROVENANCE_WRITE_FAILED', '安装配置来源记录未能保存,请检查电脑磁盘后重试。'); }
50
+ finally {
51
+ if (fd !== undefined) try { fs.closeSync(fd); } catch {}
52
+ try { fs.unlinkSync(temporary); } catch {}
53
+ }
54
+ }
55
+
56
+ write(key, value, origin) {
57
+ const previous = this.observe(key), valueHash = hash(value);
58
+ if (hash(previous) !== valueHash) {
59
+ this.entries[key] = { ...this.entries[key], pending: { origin, valueHash, sourceHash: this.sourceHash } };
60
+ this.save();
61
+ this.set(key, value);
62
+ if (hash(this.read(key)) !== valueHash) throw problem('CONFIG_READBACK_MISMATCH', 'Hermes配置写入结果尚未确认,请在电脑核对后重试。');
63
+ }
64
+ this.entries[key] = { origin, valueHash, sourceHash: this.sourceHash };
65
+ this.save();
66
+ }
67
+ }
@@ -3,6 +3,7 @@ import path from 'node:path';
3
3
  import { createHash, randomUUID } from 'node:crypto';
4
4
  import { spawnSync } from 'node:child_process';
5
5
  import { pathToFileURL } from 'node:url';
6
+ import { InstallerConfig } from './install-config.js';
6
7
 
7
8
  export class InstallationError extends Error {
8
9
  constructor(code, message) { super(message); this.code = code; }
@@ -50,7 +51,8 @@ function fingerprint(root) {
50
51
  export function installAndPair(options) {
51
52
  const { source, hermes = 'hermes', profile, env = process.env, platform = process.platform,
52
53
  nodeVersion = process.versions.node,
53
- run = (file, args, opts) => spawnSync(file, args, opts), progress = () => {} } = options;
54
+ run = (file, args, opts) => spawnSync(file, args, opts), progress = () => {}, publicAccess } = options;
55
+ if (publicAccess !== undefined && typeof publicAccess !== 'boolean') throw new InstallationError('PUBLIC_ACCESS_CHOICE_INVALID', '公网准备选项必须为on或off。');
54
56
  const parts = nodeVersion.split('.').map(Number);
55
57
  if (!Number.isInteger(parts[0]) || !Number.isInteger(parts[1]) || parts[0] < 22 || (parts[0] === 22 && parts[1] < 13)) {
56
58
  throw new InstallationError('NODE_VERSION_UNSUPPORTED', '需要Node.js 22.13或更高版本。');
@@ -108,7 +110,6 @@ export function installAndPair(options) {
108
110
  throw new InstallationError('OWNER_AUTHORIZATION_REQUIRED', '现有允许用户配置未授权owner,请在Hermes确认授权后重试。');
109
111
  }
110
112
  const node = get('platforms.fridaynext.node_bin');
111
- const publicAccess = get('platforms.fridaynext.public_access');
112
113
  const validation = JSON.parse(cli(['plugins', 'validate', source, '--json']));
113
114
  for (const warning of validation.warnings ?? []) {
114
115
  if (typeof warning !== 'string' || !warning.startsWith('private core imports')
@@ -131,9 +132,15 @@ export function installAndPair(options) {
131
132
  }
132
133
  const receipt = { version: 1, state: 'prepared', profileRoot: home, backup, contentHash: fingerprint(source) };
133
134
  const receiptFile = path.join(backup, 'receipt.json');
135
+ const configProvenanceFile = path.join(installer, 'config-origins.json');
136
+ receipt.configProvenanceFile = configProvenanceFile;
134
137
  const save = state => { receipt.state = state; fs.writeFileSync(receiptFile, JSON.stringify(receipt, null, 2) + '\n', { mode: 0o600 }); };
135
138
  save('prepared');
136
139
  try {
140
+ const config = new InstallerConfig({ file: configProvenanceFile, profileRoot: home, sourceHash: receipt.contentHash,
141
+ read: get, write: (key, value) => cli(['config', 'set', key, typeof value === 'string' ? value : JSON.stringify(value)], false) });
142
+ for (const key of ['FRIDAYNEXT_ALLOWED_USERS', 'platforms.fridaynext.node_bin', 'platforms.fridaynext.enabled', 'platforms.fridaynext.public_access']) config.observe(key);
143
+ config.save();
137
144
  const service = data || path.join(home, 'plugin-data', 'fridaynext', 'service');
138
145
  if (!fs.existsSync(service)) {
139
146
  // 新安装复用本组件相同的身份/进程锁实现准备LAN坐标;已有数据、token、TLS和监听策略均不重建。
@@ -151,9 +158,7 @@ export function installAndPair(options) {
151
158
  command(process.execPath, ['--input-type=module', '-e', script, service, home]);
152
159
  receipt.newServicePrepared = true;
153
160
  }
154
- if (publicAccess === null && !fs.existsSync(path.join(service, 'public-access.json'))) {
155
- cli(['config', 'set', 'platforms.fridaynext.public_access', 'false'], false);
156
- }
161
+ // 全新服务沿标准插件的Kit公网待机默认值;已有显式选择和私有配置保持,不代开用户权益。
157
162
  // 官方安装器接收Git源;保留包内源码的本地Git来源,供Hermes登记和后续检查,不临时伪造远端地址。
158
163
  const release = path.join(installer, 'releases', receipt.contentHash);
159
164
  if (!fs.existsSync(path.join(release, '.git'))) {
@@ -166,9 +171,11 @@ export function installAndPair(options) {
166
171
  }
167
172
  progress('安装标准插件');
168
173
  cli(['plugins', 'install', pathToFileURL(release).href, '--force', '--enable', '--yes-deps'], false);
169
- if (allowed === null) cli(['config', 'set', 'FRIDAYNEXT_ALLOWED_USERS', 'owner'], false);
170
- if (!node) cli(['config', 'set', 'platforms.fridaynext.node_bin', process.execPath], false);
171
- cli(['config', 'set', 'platforms.fridaynext.enabled', 'true'], false);
174
+ // 只有本次明确选择才迁移旧公网值;缺省及无来源的旧false不自动更改。
175
+ if (publicAccess !== undefined) config.write('platforms.fridaynext.public_access', publicAccess, 'explicit');
176
+ if (allowed === null) config.write('FRIDAYNEXT_ALLOWED_USERS', 'owner', 'installer-default');
177
+ if (!node) config.write('platforms.fridaynext.node_bin', process.execPath, 'installer-default');
178
+ config.write('platforms.fridaynext.enabled', true, 'installer-action');
172
179
  save('installed');
173
180
  progress('启动或重载 Hermes 网关');
174
181
  // 不使用--all/--force/--yes;沿宿主的在途任务保护和监督器所有权处理。
@@ -182,7 +189,9 @@ export function installAndPair(options) {
182
189
  throw new InstallationError('PAIRING_NOT_CREATED', '插件已安装,配对资料尚未生成。请检查Hermes网关后重试。');
183
190
  }
184
191
  save('paired');
185
- return { pairingFile, qrFile: pairingFile.slice(0, -5) + '.png', backup, receiptFile };
192
+ const compactFile = pairingFile.slice(0, -5) + '.code.txt';
193
+ return { pairingFile, pairingCodeFile: fs.existsSync(compactFile) ? compactFile : pairingFile,
194
+ qrFile: pairingFile.slice(0, -5) + '.png', backup, receiptFile, configProvenanceFile };
186
195
  } catch (error) {
187
196
  receipt.lastCompletedState = receipt.state;
188
197
  receipt.errorCode = error.code ?? 'INSTALL_FAILED';
package/install.js CHANGED
@@ -7,22 +7,24 @@ import { installAndPair } from './install-runtime.js';
7
7
 
8
8
  const args = process.argv.slice(2);
9
9
  if (args.includes('--help') || args.includes('-h')) {
10
- console.log('FridayNext Hermes 安装并配对\n默认安装Hermes标准平台插件、启动或重载网关并生成配对码。\n需要已配置的Hermes 0.22.5、macOS和Node.js >=22.13。\n选项:--profile 配置名 --hermes Hermes可执行文件');
10
+ console.log('FridayNext Hermes 安装并配对\n默认安装Hermes标准平台插件、启动或重载网关并生成配对码。\n需要已配置的Hermes 0.22.5、macOS和Node.js >=22.13。\n选项:--profile 配置名 --hermes Hermes可执行文件\n--public-access on|off 明确选择公网准备;省略时保留现有配置。');
11
11
  } else {
12
12
  try {
13
13
  const options = {};
14
14
  for (let i = 0; i < args.length; i += 2) {
15
- if (!['--profile', '--hermes'].includes(args[i]) || !args[i + 1] || args[i + 1].startsWith('--') || options[args[i]]) {
15
+ if (!['--profile', '--hermes', '--public-access'].includes(args[i]) || !args[i + 1] || args[i + 1].startsWith('--') || options[args[i]]) {
16
16
  throw new Error('未知或重复的安装选项,请使用--help。');
17
17
  }
18
18
  options[args[i]] = args[i + 1];
19
19
  }
20
+ if (options['--public-access'] !== undefined && !['on', 'off'].includes(options['--public-access'])) throw new Error('公网准备选项必须为on或off。');
20
21
  const root = path.dirname(fileURLToPath(import.meta.url));
21
22
  const result = installAndPair({ source: path.join(root, 'plugin'), profile: options['--profile'], hermes: options['--hermes'],
23
+ publicAccess: options['--public-access'] === undefined ? undefined : options['--public-access'] === 'on',
22
24
  progress: message => console.log('› ' + message) });
23
- const payload = fs.readFileSync(result.pairingFile, 'utf8');
25
+ const payload = fs.readFileSync(result.pairingCodeFile ?? result.pairingFile, 'utf8');
24
26
  // 交互终端展示票据二维码;管道/日志只输出私有文件位置。
25
- if (process.stdout.isTTY) console.log(await QRCode.toString(payload, { type: 'terminal', small: true }));
27
+ if (process.stdout.isTTY) console.log(await QRCode.toString(payload, { type: 'terminal', small: true, errorCorrectionLevel: 'L' }));
26
28
  console.log('在 FridayNext 中选择 Hermes 并扫描;相机不可用时,请按安装说明使用网关地址和令牌手动连接。');
27
29
  console.log('二维码图片:' + result.qrFile);
28
30
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syengup/fridaynext-hermes-channel",
3
- "version": "0.1.0-beta.2",
3
+ "version": "0.1.0-beta.4",
4
4
  "type": "module",
5
5
  "description": "通过Hermes官方CLI安装FridayNext标准平台插件并生成配对码",
6
6
  "license": "UNLICENSED",
@@ -13,6 +13,7 @@
13
13
  "files": [
14
14
  "install.js",
15
15
  "install-runtime.js",
16
+ "install-config.js",
16
17
  "plugin",
17
18
  "README.md"
18
19
  ],
package/plugin/README.md CHANGED
@@ -8,9 +8,9 @@
8
8
 
9
9
  ## 使用与数据
10
10
 
11
- 运行本包默认命令即可安装并配对;可选--profile指定已有配置,--hermes指定CLI路径。只使用Hermes公开插件、配置和网关命令;不使用旧独立canonical客户端。官方在途任务及监督器保护保持,不带--all、--force或--yes重启网关。
11
+ 运行本包默认命令即可安装并配对;可选--profile指定已有配置,--hermes指定CLI路径。--public-access on|off用于本次明确选择公网准备;省略时保留原值,包括来源不明的旧false。只使用Hermes公开插件、配置和网关命令;不使用旧独立canonical客户端。官方在途任务及监督器保护保持,不带--all、--force或--yes重启网关。
12
12
 
13
- 已有模型配置、允许用户、Node路径、数据目录和服务身份保留。已有允许用户不含owner时先明确修复授权。全新服务准备LAN监听;已有监听不重置。安装记录与私有备份保留在当前Hermes配置目录的.fridaynext-installer下。失败会标为未完成,保留备份供修复;不会声称已回滚运行中的服务,也不取消任务或清除数据。安装器更新时重新运行发行命令;Hermes登记本机包来源,不声称官方catalog自动更新。
13
+ 已有模型配置、允许用户、Node路径、数据目录和服务身份保留。已有允许用户不含owner时先明确修复授权。全新服务准备LAN监听,并沿标准插件默认准备FridayTunnel网关待机;已有监听、显式公网开关和私有配置不重置。旧安装器写入但没有来源标记的false保守保留,需要用户明确配置选择后才启用。网关待机不代表用户权益、grant、隧道在线或模型就绪。安装记录与私有备份保留在当前Hermes配置目录的.fridaynext-installer下,config-origins.json只记录值摘要与来源,不保存配置/凭据明文;来源记录损坏或写入失败时停止并保留未完成状态,不猜用户意图。失败不会声称已回滚运行中的服务,也不取消任务或清除数据。安装器更新时重新运行发行命令;Hermes登记本机包来源,不声称官方catalog自动更新。
14
14
 
15
15
  ## 配对与手动连接
16
16
 
@@ -43,6 +43,9 @@ def validate_config(config):
43
43
 
44
44
  def register(ctx):
45
45
  from .control_cli import setup, dispatch
46
+ from .device_tools import register_tools
47
+
48
+ register_tools(ctx)
46
49
 
47
50
  ctx.register_cli_command(
48
51
  name="fridaynext",
@@ -53,6 +56,11 @@ def register(ctx):
53
56
  ctx.on_unload(FridayNextAdapter.unload)
54
57
  ctx.register_hook("api_request_error", FridayNextAdapter.record_api_error)
55
58
  ctx.register_hook("on_stream_delta", FridayNextAdapter.record_reasoning_delta)
59
+ ctx.register_hook("subagent_start", FridayNextAdapter.record_subagent_start)
60
+ ctx.register_hook("subagent_stop", FridayNextAdapter.record_subagent_stop)
61
+ ctx.register_hook("on_stream_end", FridayNextAdapter.record_subagent_stream_end)
62
+ ctx.register_hook("post_api_request", FridayNextAdapter.record_subagent_tools_planned)
63
+ ctx.register_hook("post_tool_call", FridayNextAdapter.record_subagent_tool_end)
56
64
  ctx.register_platform(
57
65
  name="fridaynext",
58
66
  label="FridayNext",
@@ -63,6 +71,8 @@ def register(ctx):
63
71
  install_hint="Install Node >=22.13 and the prepared FridayNext plugin runtime; configure FRIDAYNEXT_NODE_BIN",
64
72
  allowed_users_env="FRIDAYNEXT_ALLOWED_USERS",
65
73
  allow_all_env="FRIDAYNEXT_ALLOW_ALL_USERS",
74
+ # 声明标准 cron 投递平台,显式目标仍由原任务的设备标识决定。
75
+ cron_deliver_env_var="FRIDAYNEXT_HOME_CHANNEL",
66
76
  max_message_length=0,
67
77
  display_tier="minimal",
68
78
  emoji="💬",