adhdev 0.1.32 → 0.1.33
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/dist/index.js +20 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3877,11 +3877,27 @@ var init_daemon_commands = __esm({
|
|
|
3877
3877
|
return { success: true, streams };
|
|
3878
3878
|
}
|
|
3879
3879
|
async handleAgentStreamSend(args) {
|
|
3880
|
-
|
|
3881
|
-
const agentType = args?.agentType || args?.agent || this.agentStream.activeAgentType;
|
|
3880
|
+
const agentType = args?.agentType || args?.agent;
|
|
3882
3881
|
const text = args?.text || args?.message;
|
|
3883
|
-
if (!
|
|
3884
|
-
|
|
3882
|
+
if (!text) return { success: false, error: "text required" };
|
|
3883
|
+
if (agentType && this.ctx.adapters) {
|
|
3884
|
+
for (const [key, adapter] of this.ctx.adapters.entries()) {
|
|
3885
|
+
if (adapter.cliType === agentType || key.includes(agentType)) {
|
|
3886
|
+
console.log(`[agent_stream_send] Routing to CLI adapter: ${adapter.cliType}`);
|
|
3887
|
+
try {
|
|
3888
|
+
await adapter.sendMessage(text);
|
|
3889
|
+
return { success: true, sent: true, targetAgent: adapter.cliType };
|
|
3890
|
+
} catch (e) {
|
|
3891
|
+
console.log(`[agent_stream_send] CLI adapter failed: ${e.message}`);
|
|
3892
|
+
return { success: false, error: `CLI send failed: ${e.message}` };
|
|
3893
|
+
}
|
|
3894
|
+
}
|
|
3895
|
+
}
|
|
3896
|
+
}
|
|
3897
|
+
if (!this.agentStream || !this.getCdp()) return { success: false, error: "AgentStream or CDP not available" };
|
|
3898
|
+
const resolvedAgent = agentType || this.agentStream.activeAgentType;
|
|
3899
|
+
if (!resolvedAgent) return { success: false, error: "agentType required" };
|
|
3900
|
+
const ok = await this.agentStream.sendToAgent(this.getCdp(), resolvedAgent, text, this._currentIdeType);
|
|
3885
3901
|
return { success: ok };
|
|
3886
3902
|
}
|
|
3887
3903
|
async handleAgentStreamResolve(args) {
|