@lasso-ai/cli 2.1.5 → 2.1.7

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 (2) hide show
  1. package/dist/overlay.js +78 -16
  2. package/package.json +1 -1
package/dist/overlay.js CHANGED
@@ -19600,6 +19600,48 @@
19600
19600
  var activeStartTime = 0;
19601
19601
  var activeConversationId = null;
19602
19602
  var conversationList = [];
19603
+ function isConversationalPrompt(prompt) {
19604
+ const p = prompt.trim().toLowerCase().replace(/[!?.,;:]+$/, "");
19605
+ const greetings = [
19606
+ "hi",
19607
+ "hello",
19608
+ "hey",
19609
+ "heya",
19610
+ "howdy",
19611
+ "sup",
19612
+ "yo",
19613
+ "good morning",
19614
+ "good afternoon",
19615
+ "good evening",
19616
+ "thanks",
19617
+ "thank you",
19618
+ "thx",
19619
+ "ty",
19620
+ "cool",
19621
+ "awesome",
19622
+ "great",
19623
+ "nice",
19624
+ "who are you",
19625
+ "what are you",
19626
+ "what can you do",
19627
+ "help",
19628
+ "help me",
19629
+ "what is lasso",
19630
+ "how do you work",
19631
+ "how does this work"
19632
+ ];
19633
+ if (greetings.includes(p)) return true;
19634
+ if (/^(hi|hello|hey|howdy|yo)\b/i.test(p) && p.split(/\s+/).length <= 4) {
19635
+ const buildKeywords = /(build|create|add|make|fix|update|modify|change|refactor|implement|delete|remove|style|install|wire|code)/i;
19636
+ if (!buildKeywords.test(p)) return true;
19637
+ }
19638
+ const questionOnly = /^(what is|what's|how do i|why does|can you explain|tell me about)\b/i.test(p);
19639
+ const actionVerbs = /(build|create|add|make|fix|update|modify|change|refactor|implement|write code|code this|delete|remove|generate)/i;
19640
+ if (questionOnly && !actionVerbs.test(p)) {
19641
+ return true;
19642
+ }
19643
+ return false;
19644
+ }
19603
19645
  function isRetryIntent(prompt) {
19604
19646
  const p = prompt.trim().toLowerCase().replace(/[!?.]+$/, "");
19605
19647
  return /^(try\s+again|retry|re-?try|do\s+it\s+again|run\s+again|attempt\s+again|go\s+again|one\s+more\s+time|again)$/.test(p);
@@ -20373,7 +20415,8 @@
20373
20415
  const taskId2 = `oneshot-${Date.now()}`;
20374
20416
  activeTaskId = taskId2;
20375
20417
  activeStartTime = Date.now();
20376
- const initialStepTitle = "Thinking\u2026";
20418
+ const isChat = isConversationalPrompt(prompt);
20419
+ const initialStepTitle = isChat ? "Preparing response\u2026" : "Preparing task\u2026";
20377
20420
  commandMessages.push({
20378
20421
  id: taskId2,
20379
20422
  role: "assistant",
@@ -20473,14 +20516,17 @@
20473
20516
  expanded: true
20474
20517
  };
20475
20518
  }
20476
- for (const step of targetMsg.thinking.steps) {
20477
- if (step.status === "running") step.status = "completed";
20519
+ const stepTitle = (message.message || "").trim();
20520
+ if (stepTitle && stepTitle !== "Thinking\u2026" && stepTitle !== "Thinking") {
20521
+ for (const step of targetMsg.thinking.steps) {
20522
+ if (step.status === "running") step.status = "completed";
20523
+ }
20524
+ targetMsg.thinking.steps.push({
20525
+ title: stepTitle,
20526
+ detail: message.detail,
20527
+ status: "running"
20528
+ });
20478
20529
  }
20479
- targetMsg.thinking.steps.push({
20480
- title: message.message,
20481
- detail: message.detail,
20482
- status: "running"
20483
- });
20484
20530
  renderMessages();
20485
20531
  scrollToBottom();
20486
20532
  } else if (message.status === "review" || message.status === "complete") {
@@ -20580,14 +20626,30 @@
20580
20626
  }
20581
20627
  }
20582
20628
  function handleCommandBarPrompt(message) {
20583
- if (message.prompt?.question) {
20584
- const targetMsg = [...commandMessages].reverse().find((m) => m.role === "assistant");
20585
- if (targetMsg) {
20586
- targetMsg.content += `
20587
-
20588
- **${message.prompt.question}**`;
20589
- renderMessages();
20590
- }
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();
20591
20653
  }
20592
20654
  }
20593
20655
  function renderMessages() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lasso-ai/cli",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "description": "Select any part of your running app, describe a change, and let AI edit the real source code.",
5
5
  "type": "commonjs",
6
6
  "main": "dist/cli/index.js",