@lasso-ai/cli 1.3.1 → 1.3.3
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/agent.js +18 -1
- package/dist/cli/bridge.d.ts +22 -0
- package/dist/cli/bridge.js +448 -74
- package/dist/cli/oneshot.js +59 -43
- package/dist/cli/snapshot.d.ts +33 -0
- package/dist/cli/snapshot.js +225 -0
- package/dist/overlay.js +444 -3
- package/package.json +2 -1
package/dist/cli/agent.js
CHANGED
|
@@ -19,6 +19,7 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
19
19
|
const node_child_process_1 = require("node:child_process");
|
|
20
20
|
const node_util_1 = require("node:util");
|
|
21
21
|
const auth_1 = require("./auth");
|
|
22
|
+
const layout_intelligence_1 = require("@lasso-ai/layout-intelligence");
|
|
22
23
|
const execFileAsync = (0, node_util_1.promisify)(node_child_process_1.execFile);
|
|
23
24
|
const execAsync = (0, node_util_1.promisify)(node_child_process_1.exec);
|
|
24
25
|
function detectProjectStructure(cwd) {
|
|
@@ -1002,6 +1003,22 @@ async function proposeChanges(cwd, input, config, signal, onProgress, onPrompt)
|
|
|
1002
1003
|
: "";
|
|
1003
1004
|
// Detect project structure for instruction
|
|
1004
1005
|
const structure = detectProjectStructure(cwd);
|
|
1006
|
+
// Query layout intelligence for relevant patterns
|
|
1007
|
+
let layoutContext = "";
|
|
1008
|
+
try {
|
|
1009
|
+
const layoutQuery = input.instruction;
|
|
1010
|
+
const relevantLayouts = await (0, layout_intelligence_1.searchLayouts)(layoutQuery);
|
|
1011
|
+
if (relevantLayouts.length > 0) {
|
|
1012
|
+
layoutContext = `\n\nLAYOUT INTELLIGENCE:
|
|
1013
|
+
Based on your request, here are relevant layout patterns you should consider:
|
|
1014
|
+
${relevantLayouts.slice(0, 3).map((result) => `- ${result.pattern.name}: ${result.pattern.description}`).join("\n")}
|
|
1015
|
+
Use these patterns as inspiration for your implementation. Focus on matching the layout structure, spacing, and composition principles.`;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
catch (error) {
|
|
1019
|
+
// Layout intelligence is optional; continue without it if it fails
|
|
1020
|
+
console.warn("Layout intelligence query failed:", error);
|
|
1021
|
+
}
|
|
1005
1022
|
const instruction = `Selection context:
|
|
1006
1023
|
${JSON.stringify(input.element, null, 2)}
|
|
1007
1024
|
${JSON.stringify(visualContext, null, 2)}
|
|
@@ -1016,7 +1033,7 @@ Previous change history for this selection:
|
|
|
1016
1033
|
${priorChanges}
|
|
1017
1034
|
|
|
1018
1035
|
Relevant source context:
|
|
1019
|
-
${context || "No matching source context was found. Ask for a more specific selection rather than inventing a file."}${dragHint}${runtimeErrorHint}
|
|
1036
|
+
${context || "No matching source context was found. Ask for a more specific selection rather than inventing a file."}${dragHint}${runtimeErrorHint}${layoutContext}
|
|
1020
1037
|
|
|
1021
1038
|
CRITICAL INSTRUCTIONS:
|
|
1022
1039
|
0. PROJECT STRUCTURE AWARENESS: This project has specific directory structure. Before creating or moving files, verify the actual structure. Do not assume standard locations.
|
package/dist/cli/bridge.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type SourceChange, type AgentPrompt } from "./agent";
|
|
2
2
|
import type { CollabConfig } from "./project";
|
|
3
|
+
import { type TimelineSnapshot, type ConflictInfo } from "./snapshot";
|
|
3
4
|
export declare const DEFAULT_BRIDGE_PORT = 3056;
|
|
4
5
|
type GitState = {
|
|
5
6
|
isRepo: boolean;
|
|
@@ -143,6 +144,19 @@ export type BridgeMessage = {
|
|
|
143
144
|
}>;
|
|
144
145
|
taskId?: string;
|
|
145
146
|
pageContext?: any;
|
|
147
|
+
} | {
|
|
148
|
+
type: "resolve_conflict";
|
|
149
|
+
taskId: string;
|
|
150
|
+
action: "retry" | "force" | "rebase";
|
|
151
|
+
conflicts: ConflictInfo[];
|
|
152
|
+
} | {
|
|
153
|
+
type: "restore_snapshot";
|
|
154
|
+
snapshotId: string;
|
|
155
|
+
} | {
|
|
156
|
+
type: "get_timeline";
|
|
157
|
+
} | {
|
|
158
|
+
type: "delete_snapshot";
|
|
159
|
+
snapshotId: string;
|
|
146
160
|
};
|
|
147
161
|
type ModelOption = {
|
|
148
162
|
id: string;
|
|
@@ -235,6 +249,14 @@ export type ServerBridgeMessage = {
|
|
|
235
249
|
text?: string;
|
|
236
250
|
provider?: string;
|
|
237
251
|
error?: string;
|
|
252
|
+
} | {
|
|
253
|
+
type: "conflict_detected";
|
|
254
|
+
taskId: string;
|
|
255
|
+
conflicts: ConflictInfo[];
|
|
256
|
+
message: string;
|
|
257
|
+
} | {
|
|
258
|
+
type: "timeline";
|
|
259
|
+
snapshots: TimelineSnapshot[];
|
|
238
260
|
};
|
|
239
261
|
export declare function restartBridge(port?: number): Promise<{
|
|
240
262
|
ok: boolean;
|