linco-connect 1.0.9 → 1.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.
@@ -16,6 +16,10 @@ const {
16
16
  } = require('../src/config');
17
17
  const { ensureLocalToken, localUrlWithToken } = require('../src/localAuth');
18
18
  const { checkGatewayHealth, resolveHermesGatewayOptions } = require('../src/hermesGateway');
19
+ const {
20
+ checkGatewayHealth: checkOpenClawGatewayHealth,
21
+ resolveOpenClawGatewayOptions,
22
+ } = require('../src/openclawGateway');
19
23
  const pkg = require('../package.json');
20
24
 
21
25
  const rootDir = path.resolve(__dirname, '..');
@@ -147,6 +151,8 @@ function mergeInitConfig(current, values) {
147
151
  appSecret: values.appSecret,
148
152
  enabled: true,
149
153
  };
154
+ if (values.agentType === 'openclaw') accountEntry.openclawAgentId = 'main';
155
+ const agentType = values.agentType || 'claude';
150
156
 
151
157
  return {
152
158
  ...current,
@@ -157,13 +163,13 @@ function mergeInitConfig(current, values) {
157
163
  ...(current.channels?.linco || {}),
158
164
  agents: {
159
165
  ...(current.channels?.linco?.agents || {}),
160
- [values.agentType]: {
161
- ...(current.channels?.linco?.agents?.[values.agentType] || {}),
166
+ [agentType]: {
167
+ ...(current.channels?.linco?.agents?.[agentType] || {}),
162
168
  defaultAccount: values.account,
163
169
  accounts: {
164
- ...(current.channels?.linco?.agents?.[values.agentType]?.accounts || {}),
170
+ ...(current.channels?.linco?.agents?.[agentType]?.accounts || {}),
165
171
  [values.account]: {
166
- ...(current.channels?.linco?.agents?.[values.agentType]?.accounts?.[values.account] || {}),
172
+ ...(current.channels?.linco?.agents?.[agentType]?.accounts?.[values.account] || {}),
167
173
  ...accountEntry,
168
174
  },
169
175
  },
@@ -425,6 +431,19 @@ async function doctorCommand() {
425
431
  } else {
426
432
  checks.push([`${agentType} Gateway`, false, `未运行,且 autoStartGateway=false ${options.gatewayUrl}`]);
427
433
  }
434
+ } else if (agentType === 'openclaw') {
435
+ const options = resolveOpenClawGatewayOptions(agent);
436
+ const health = await checkOpenClawGatewayHealth(options.gatewayUrl, agent, { timeoutMs: 3000 });
437
+ if (health.ok) {
438
+ checks.push([`${agentType} Gateway`, true, options.gatewayUrl]);
439
+ } else if (agent.autoStartGateway !== false) {
440
+ const hasCli = !agent.enabled || (path.isAbsolute(options.openclawBin) ? fs.existsSync(options.openclawBin) : commandExists(options.openclawBin));
441
+ checks.push([`${agentType} Gateway`, true, `not running; OpenClaw messages will auto-start ${options.gatewayUrl}`]);
442
+ checks.push([`${agentType} CLI`, hasCli, options.openclawBin]);
443
+ } else {
444
+ checks.push([`${agentType} Gateway`, false, `not running and autoStartGateway=false ${options.gatewayUrl}`]);
445
+ }
446
+ checks.push([`${agentType} Agent ID`, true, agent.openclawAgentId || 'main']);
428
447
  } else {
429
448
  checks.push([`${agentType} CLI`, !agent.enabled || (path.isAbsolute(agent.bin) ? fs.existsSync(agent.bin) : commandExists(agent.bin)), agent.bin]);
430
449
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linco-connect",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "自研 IM 桥接多 Agent 服务",
5
5
  "main": "server.js",
6
6
  "bin": {
package/public/index.html CHANGED
@@ -577,6 +577,7 @@
577
577
  <option value="claude">Claude Code</option>
578
578
  <option value="codex">Codex</option>
579
579
  <option value="hermes">Hermes</option>
580
+ <option value="openclaw">OpenClaw</option>
580
581
  </select>
581
582
  </div>
582
583
  <div id="messages"></div>
@@ -1180,11 +1181,11 @@
1180
1181
 
1181
1182
  function normalizeAgentType(value) {
1182
1183
  const type = String(value || 'claude').trim().toLowerCase();
1183
- return ['claude', 'codex', 'hermes'].includes(type) ? type : 'claude';
1184
+ return ['claude', 'codex', 'hermes', 'openclaw'].includes(type) ? type : 'claude';
1184
1185
  }
1185
1186
 
1186
1187
  function agentLabel(type) {
1187
- return type === 'codex' ? 'Codex' : type === 'hermes' ? 'Hermes' : 'Claude Code';
1188
+ return type === 'codex' ? 'Codex' : type === 'hermes' ? 'Hermes' : type === 'openclaw' ? 'OpenClaw' : 'Claude Code';
1188
1189
  }
1189
1190
 
1190
1191
  function setAgentSelection(agentType, options = {}) {
@@ -1,11 +1,13 @@
1
1
  const claude = require('./agents/claude');
2
2
  const codex = require('./agents/codex');
3
3
  const hermes = require('./agents/hermes');
4
+ const openclaw = require('./agents/openclaw');
4
5
 
5
6
  const providers = {
6
7
  claude,
7
8
  codex,
8
9
  hermes,
10
+ openclaw,
9
11
  };
10
12
 
11
13
  function providerFor(session) {