@lasso-ai/cli 2.1.17 → 2.1.18

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.
@@ -151,7 +151,7 @@ export type BridgeMessage = {
151
151
  language?: string;
152
152
  } | {
153
153
  type: "oneshot";
154
- prompt: string;
154
+ prompt?: string;
155
155
  scope?: "project" | "component";
156
156
  model?: string;
157
157
  provider?: "anthropic" | "openai" | "google" | "nvidia" | "ollama" | "claude_code" | "opencode" | "codex_cli" | "cursor";
@@ -164,7 +164,6 @@ export type BridgeMessage = {
164
164
  content: string;
165
165
  timestamp?: number;
166
166
  }>;
167
- conversationId?: string;
168
167
  taskId?: string;
169
168
  } | {
170
169
  type: "page_context_response";
@@ -989,8 +989,16 @@ async function startBridge(cwd = process.cwd(), collabConfig = null, bridgePort
989
989
  }
990
990
  // Handler for oneshot
991
991
  async function handleOneshot(message, socket, cwd) {
992
- const { taskId, prompt, model, provider, messages, conversation, conversationId } = message;
993
- const instruction = prompt;
992
+ const { taskId, prompt, model, provider, messages, conversation } = message;
993
+ const runtimeConversation = toRuntimeConversation(conversation || messages);
994
+ const instruction = [...(runtimeConversation || [])]
995
+ .reverse()
996
+ .find((entry) => entry.role === "user")
997
+ ?.content?.trim() || (typeof prompt === "string" ? prompt.trim() : "");
998
+ if (!instruction) {
999
+ socket.send(JSON.stringify({ type: "agent_status", taskId, status: "error", message: "A user message is required." }));
1000
+ return;
1001
+ }
994
1002
  taskControllers.get(taskId)?.abort();
995
1003
  const controller = new AbortController();
996
1004
  taskControllers.set(taskId, controller);
@@ -1000,11 +1008,10 @@ async function startBridge(cwd = process.cwd(), collabConfig = null, bridgePort
1000
1008
  const isLocalAgent = ["claude_code", "opencode", "codex_cli", "cursor"].includes(provider || "");
1001
1009
  const backendModelId = (0, backends_1.modelIdForBackend)(model || "", provider || "");
1002
1010
  const sessionInput = {
1003
- userPrompt: prompt,
1004
- // The sidebar is the source of truth for history. `conversation` is
1005
- // preferred; `messages` remains a compatibility alias for older overlays.
1006
- conversation: toRuntimeConversation(conversation || messages),
1007
- conversationUid: conversationId || undefined,
1011
+ userPrompt: instruction,
1012
+ // The sidebar is the source of truth for history. The runtime prompt
1013
+ // is derived from its final user message rather than sent separately.
1014
+ conversation: runtimeConversation,
1008
1015
  project: {
1009
1016
  projectId,
1010
1017
  framework,
package/dist/overlay.js CHANGED
@@ -19680,15 +19680,6 @@
19680
19680
  } catch {
19681
19681
  }
19682
19682
  }
19683
- async function createServerConversation(scope2 = "private") {
19684
- const projectId = state.collab?.projectId || state.collabProjectId;
19685
- if (!projectId) return null;
19686
- const data6 = await apiFetch("/agent/conversations", {
19687
- method: "POST",
19688
- body: JSON.stringify({ projectId, scope: scope2, title: "New Session" })
19689
- });
19690
- return data6?.conversation?.id || null;
19691
- }
19692
19683
  async function loadConversationList() {
19693
19684
  const projectId = state.collab?.projectId || state.collabProjectId;
19694
19685
  try {
@@ -20437,10 +20428,7 @@
20437
20428
  updateSubmitButton(false);
20438
20429
  renderSuggestions();
20439
20430
  renderMessages();
20440
- createServerConversation().then((id) => {
20441
- if (id) activeConversationId = id;
20442
- loadConversationList();
20443
- });
20431
+ void loadConversationList();
20444
20432
  }
20445
20433
  function updateSubmitButton(isWorking) {
20446
20434
  if (!commandSubmit) return;
@@ -20590,9 +20578,6 @@ Please proceed directly with the implementation and code changes from this point
20590
20578
  updateActiveTimerDisplay(activeMsg.thinking.durationSeconds);
20591
20579
  }
20592
20580
  }, 1e3);
20593
- if (!activeConversationId) {
20594
- activeConversationId = await createServerConversation();
20595
- }
20596
20581
  collabEmit("collab:action", {
20597
20582
  sessionId: state.collabProjectId,
20598
20583
  status: "building",
@@ -20602,16 +20587,13 @@ Please proceed directly with the implementation and code changes from this point
20602
20587
  state.bridgeSocket.send(
20603
20588
  JSON.stringify({
20604
20589
  type: "oneshot",
20605
- prompt,
20606
20590
  taskId: taskId2,
20607
- conversationId: activeConversationId || void 0,
20608
20591
  scope: "project",
20609
20592
  model: state.selectedModel.id,
20610
20593
  provider: state.selectedModel.provider,
20611
- // The current prompt is sent in its dedicated `prompt` field. Keep it
20612
- // out of history so the model sees it once, not once as history and
20613
- // once as the active request.
20614
- conversation: commandMessages.map((message, index) => ({ message, index })).filter(({ message, index }) => Boolean(message.content) && !message.error && index !== commandMessages.reduce((last, item, itemIndex) => item.role === "user" && item.content === prompt ? itemIndex : last, -1)).map(({ message }) => ({ role: message.role, content: message.content, timestamp: message.timestamp }))
20594
+ // The conversation already includes the current user message. It is
20595
+ // the only prompt context sent to the runtime.
20596
+ conversation: commandMessages.filter((message) => Boolean(message.content) && !message.error).map((message) => ({ role: message.role, content: message.content, timestamp: message.timestamp }))
20615
20597
  })
20616
20598
  );
20617
20599
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lasso-ai/cli",
3
- "version": "2.1.17",
3
+ "version": "2.1.18",
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",