@lasso-ai/cli 2.1.6 → 2.1.8
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/cli/bridge.js +15 -1
- package/dist/overlay.js +24 -8
- package/package.json +1 -1
package/dist/cli/bridge.js
CHANGED
|
@@ -22,6 +22,16 @@ const backends_1 = require("./backends");
|
|
|
22
22
|
const local_runtime_1 = require("./local-runtime");
|
|
23
23
|
exports.DEFAULT_BRIDGE_PORT = 3056;
|
|
24
24
|
const execFileAsync = (0, node_util_1.promisify)(node_child_process_1.execFile);
|
|
25
|
+
function isConversationalPrompt(prompt) {
|
|
26
|
+
const value = prompt.trim().toLowerCase().replace(/[!?.,;:]+$/, "");
|
|
27
|
+
if (/^(hi|hello|hey|heya|howdy|sup|yo|good morning|good afternoon|good evening|thanks|thank you|thx|ty|what can you do|what can i ask you|who are you|how do you work|how does this work)$/.test(value))
|
|
28
|
+
return true;
|
|
29
|
+
if (/^(what can you do|what can i ask|who are you|how do you work|how does this work)\b/.test(value))
|
|
30
|
+
return true;
|
|
31
|
+
if (/^(what is|what's|how do i|why does|can you explain|tell me about)\b/.test(value))
|
|
32
|
+
return true;
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
25
35
|
function cleanConversationReply(value) {
|
|
26
36
|
const text = typeof value === "string" ? value.trim() : "";
|
|
27
37
|
if (!text)
|
|
@@ -567,7 +577,7 @@ async function startBridge(cwd = process.cwd(), collabConfig = null, bridgePort
|
|
|
567
577
|
const controller = new AbortController();
|
|
568
578
|
taskControllers.set(taskId, controller);
|
|
569
579
|
const isLocalAgent = ["claude_code", "opencode", "codex_cli", "cursor"].includes(provider || "");
|
|
570
|
-
if (message.type === "ask" && !isLocalAgent) {
|
|
580
|
+
if ((message.type === "ask" || isConversationalPrompt(instruction)) && !isLocalAgent) {
|
|
571
581
|
await handleHostedConversation(taskId, instruction, model, provider, messages, socket, controller.signal);
|
|
572
582
|
return;
|
|
573
583
|
}
|
|
@@ -896,6 +906,10 @@ async function startBridge(cwd = process.cwd(), collabConfig = null, bridgePort
|
|
|
896
906
|
// there are no canned assistant responses in the bridge.
|
|
897
907
|
try {
|
|
898
908
|
const isLocalAgent = ["claude_code", "opencode", "codex_cli", "cursor"].includes(provider || "");
|
|
909
|
+
if (isConversationalPrompt(prompt) && !isLocalAgent) {
|
|
910
|
+
await handleHostedConversation(taskId, prompt, model, provider, message.messages, socket, controller.signal);
|
|
911
|
+
return;
|
|
912
|
+
}
|
|
899
913
|
const backendModelId = (0, backends_1.modelIdForBackend)(model || "", provider || "");
|
|
900
914
|
const sessionInput = {
|
|
901
915
|
userPrompt: prompt,
|
package/dist/overlay.js
CHANGED
|
@@ -20626,14 +20626,30 @@
|
|
|
20626
20626
|
}
|
|
20627
20627
|
}
|
|
20628
20628
|
function handleCommandBarPrompt(message) {
|
|
20629
|
-
|
|
20630
|
-
|
|
20631
|
-
|
|
20632
|
-
|
|
20633
|
-
|
|
20634
|
-
|
|
20635
|
-
|
|
20636
|
-
|
|
20629
|
+
const taskId2 = message.taskId;
|
|
20630
|
+
let targetMsg = commandMessages.find((m) => m.id === taskId2);
|
|
20631
|
+
if (!targetMsg) {
|
|
20632
|
+
targetMsg = [...commandMessages].reverse().find((m) => m.role === "assistant");
|
|
20633
|
+
}
|
|
20634
|
+
if (!targetMsg) return;
|
|
20635
|
+
if (activeThinkingInterval) {
|
|
20636
|
+
clearInterval(activeThinkingInterval);
|
|
20637
|
+
activeThinkingInterval = null;
|
|
20638
|
+
}
|
|
20639
|
+
targetMsg.thinking = void 0;
|
|
20640
|
+
const question = message.prompt?.question || message.message || "";
|
|
20641
|
+
targetMsg.content = question;
|
|
20642
|
+
targetMsg.isStreaming = false;
|
|
20643
|
+
activeTaskId = null;
|
|
20644
|
+
updateSubmitButton(false);
|
|
20645
|
+
collabEmit("collab:action", {
|
|
20646
|
+
sessionId: state.collabProjectId,
|
|
20647
|
+
status: "idle"
|
|
20648
|
+
});
|
|
20649
|
+
renderMessages();
|
|
20650
|
+
scrollToBottom();
|
|
20651
|
+
if (commandInput) {
|
|
20652
|
+
commandInput.focus();
|
|
20637
20653
|
}
|
|
20638
20654
|
}
|
|
20639
20655
|
function renderMessages() {
|
package/package.json
CHANGED