@lightcone-ai/daemon 0.15.55 → 0.15.56

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.
@@ -11,7 +11,7 @@ import {
11
11
  } from './core.js';
12
12
 
13
13
  const TOOL_SCHEMA = {
14
- data_source_id: z.string().describe('数据源 ID(当前实现映射为 credential_id)'),
14
+ data_source_id: z.string().describe('工作区数据源 ID。credential broker 会在运行时解析到绑定凭据。'),
15
15
  sql: z.string().describe('要执行的 SQL。支持参数占位符 ?'),
16
16
  params: z.array(z.any()).optional().describe('SQL 参数数组(按顺序对应 ? 占位符)'),
17
17
  limit: z.number().int().positive().optional().describe('结果行数上限。默认 200,最大 1000'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightcone-ai/daemon",
3
- "version": "0.15.55",
3
+ "version": "0.15.56",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -184,6 +184,7 @@ export class AgentManager {
184
184
  case 'agent:start': return this._startAgent(msg, connection);
185
185
  case 'agent:stop': return this._stopAgent(msg.agentId, msg.workspaceId, connection);
186
186
  case 'agent:deliver': return this._deliverMessage(msg, connection);
187
+ case 'agent:reprobe': return this._reprobeCapability(msg, connection);
187
188
  case 'publish:job': return this._handlePublishJob(msg, connection);
188
189
  case 'browser:start_login': return this._startBrowserLogin(msg, connection);
189
190
  case 'browser:stop_login': return this._stopBrowserLogin(msg);
@@ -504,6 +505,49 @@ export class AgentManager {
504
505
  });
505
506
  }
506
507
 
508
+ async _reprobeCapability({ agentId, workspaceId }, connection) {
509
+ const normalizedAgentId = String(agentId ?? '').trim();
510
+ if (!normalizedAgentId) {
511
+ console.log('[AgentManager] agent:reprobe ignored: missing agentId');
512
+ return;
513
+ }
514
+ const normalizedWorkspaceId = String(workspaceId ?? '').trim();
515
+ const workspaceDir = this._workspaceDir(normalizedAgentId, normalizedWorkspaceId);
516
+ const chatBridgePath = new URL('./chat-bridge.js', import.meta.url).pathname;
517
+
518
+ this._emitCapabilityProbe(connection, {
519
+ agentId: normalizedAgentId,
520
+ workspaceId: normalizedWorkspaceId,
521
+ capabilityId: CHAT_CAPABILITY_ID,
522
+ state: 'unknown',
523
+ reason: 'reprobe_pending',
524
+ details: { stage: 'reprobe' },
525
+ });
526
+
527
+ const result = await probeChatBridgeCapability({
528
+ chatBridgePath,
529
+ cwd: workspaceDir,
530
+ timeoutMs: CAPABILITY_PROBE_TIMEOUT_MS,
531
+ env: {
532
+ SERVER_URL: this.serverUrl,
533
+ MACHINE_API_KEY: this.machineApiKey,
534
+ AGENT_ID: normalizedAgentId,
535
+ WORKSPACE_ID: normalizedWorkspaceId,
536
+ WORKSPACE_DIR: workspaceDir,
537
+ },
538
+ });
539
+
540
+ this._emitCapabilityProbe(connection, {
541
+ agentId: normalizedAgentId,
542
+ workspaceId: normalizedWorkspaceId,
543
+ capabilityId: CHAT_CAPABILITY_ID,
544
+ state: result.state,
545
+ reason: result.reason,
546
+ details: { ...(result.details ?? {}), stage: 'reprobe' },
547
+ latencyMs: result.latencyMs,
548
+ });
549
+ }
550
+
507
551
  _emitCapabilityProbe(connection, {
508
552
  agentId,
509
553
  workspaceId,