@lasso-ai/cli 1.4.5 → 1.5.0
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.d.ts +9 -89
- package/dist/cli/agent.js +66 -1412
- package/dist/cli/bridge-old.d.ts +259 -0
- package/dist/cli/bridge-old.js +1350 -0
- package/dist/cli/bridge.d.ts +19 -12
- package/dist/cli/bridge.js +625 -1181
- package/dist/cli/host/next-host-entry.js +0 -2
- package/dist/cli/host/vite-host-entry.js +1 -3
- package/dist/cli/oneshot.js +159 -961
- package/dist/cli/runtime-client.d.ts +229 -0
- package/dist/cli/runtime-client.js +143 -0
- package/dist/cli/snapshot.d.ts +3 -1
- package/dist/cli/snapshot.js +8 -1
- package/package.json +1 -1
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { type SourceChange, type AgentPrompt } from "./agent";
|
|
2
|
+
import type { CollabConfig } from "./project";
|
|
3
|
+
import { type TimelineSnapshot } from "./snapshot";
|
|
4
|
+
export declare const DEFAULT_BRIDGE_PORT = 3056;
|
|
5
|
+
type GitState = {
|
|
6
|
+
isRepo: boolean;
|
|
7
|
+
branch?: string;
|
|
8
|
+
status?: string[];
|
|
9
|
+
hasChanges?: boolean;
|
|
10
|
+
hasRemote?: boolean;
|
|
11
|
+
remote?: string;
|
|
12
|
+
};
|
|
13
|
+
export type BridgeMessage = {
|
|
14
|
+
type: "hello";
|
|
15
|
+
from: "overlay" | "cli";
|
|
16
|
+
} | {
|
|
17
|
+
type: "edit";
|
|
18
|
+
taskId: string;
|
|
19
|
+
instruction: string;
|
|
20
|
+
model: string;
|
|
21
|
+
provider?: "anthropic" | "openai" | "google" | "ollama" | "nvidia" | "cli";
|
|
22
|
+
messages?: Array<{
|
|
23
|
+
role: string;
|
|
24
|
+
content: string;
|
|
25
|
+
createdAt?: string;
|
|
26
|
+
}>;
|
|
27
|
+
changesHistory?: Array<{
|
|
28
|
+
summary: string;
|
|
29
|
+
changes: SourceChange[];
|
|
30
|
+
createdAt?: string;
|
|
31
|
+
}>;
|
|
32
|
+
context?: {
|
|
33
|
+
selectionId?: string;
|
|
34
|
+
position?: Record<string, number>;
|
|
35
|
+
viewport?: Record<string, unknown>;
|
|
36
|
+
styles?: Record<string, string>;
|
|
37
|
+
attributes?: Record<string, string>;
|
|
38
|
+
runtimeErrors?: string[];
|
|
39
|
+
screenshots?: {
|
|
40
|
+
full?: string;
|
|
41
|
+
element?: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
element: {
|
|
45
|
+
tag: string;
|
|
46
|
+
group: string;
|
|
47
|
+
label: string;
|
|
48
|
+
html?: string;
|
|
49
|
+
sourceHint?: string;
|
|
50
|
+
};
|
|
51
|
+
} | {
|
|
52
|
+
type: "ask";
|
|
53
|
+
taskId: string;
|
|
54
|
+
question: string;
|
|
55
|
+
model: string;
|
|
56
|
+
provider?: "anthropic" | "openai" | "google" | "ollama" | "nvidia" | "cli";
|
|
57
|
+
messages?: Array<{
|
|
58
|
+
role: string;
|
|
59
|
+
content: string;
|
|
60
|
+
createdAt?: string;
|
|
61
|
+
}>;
|
|
62
|
+
context?: {
|
|
63
|
+
selectionId?: string;
|
|
64
|
+
position?: Record<string, number>;
|
|
65
|
+
viewport?: Record<string, unknown>;
|
|
66
|
+
styles?: Record<string, string>;
|
|
67
|
+
attributes?: Record<string, string>;
|
|
68
|
+
runtimeErrors?: string[];
|
|
69
|
+
screenshots?: {
|
|
70
|
+
full?: string;
|
|
71
|
+
element?: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
element: {
|
|
75
|
+
tag: string;
|
|
76
|
+
group: string;
|
|
77
|
+
label: string;
|
|
78
|
+
html?: string;
|
|
79
|
+
sourceHint?: string;
|
|
80
|
+
};
|
|
81
|
+
} | {
|
|
82
|
+
type: "runtime_error";
|
|
83
|
+
selectionId?: string;
|
|
84
|
+
details: string;
|
|
85
|
+
} | {
|
|
86
|
+
type: "apply";
|
|
87
|
+
taskId: string;
|
|
88
|
+
changes: SourceChange[];
|
|
89
|
+
} | {
|
|
90
|
+
type: "undo";
|
|
91
|
+
taskId?: string;
|
|
92
|
+
} | {
|
|
93
|
+
type: "stop";
|
|
94
|
+
taskId?: string;
|
|
95
|
+
} | {
|
|
96
|
+
type: "agent_prompt_response";
|
|
97
|
+
taskId: string;
|
|
98
|
+
response: string;
|
|
99
|
+
} | {
|
|
100
|
+
type: "list_page_folders";
|
|
101
|
+
path?: string;
|
|
102
|
+
} | {
|
|
103
|
+
type: "create_page";
|
|
104
|
+
folder: string;
|
|
105
|
+
fileName: string;
|
|
106
|
+
content: string;
|
|
107
|
+
} | {
|
|
108
|
+
type: "create_page_folder";
|
|
109
|
+
parent: string;
|
|
110
|
+
name: string;
|
|
111
|
+
} | {
|
|
112
|
+
type: "git_status";
|
|
113
|
+
} | {
|
|
114
|
+
type: "git_generate_message";
|
|
115
|
+
model: string;
|
|
116
|
+
provider?: "anthropic" | "openai" | "google" | "ollama" | "nvidia" | "cli";
|
|
117
|
+
} | {
|
|
118
|
+
type: "git_init";
|
|
119
|
+
} | {
|
|
120
|
+
type: "git_commit";
|
|
121
|
+
message: string;
|
|
122
|
+
} | {
|
|
123
|
+
type: "git_push";
|
|
124
|
+
} | {
|
|
125
|
+
type: "agent_status";
|
|
126
|
+
taskId?: string;
|
|
127
|
+
status: "thinking" | "working" | "review" | "error" | "stopped";
|
|
128
|
+
message: string;
|
|
129
|
+
} | {
|
|
130
|
+
type: "transcribe";
|
|
131
|
+
requestId: string;
|
|
132
|
+
audio: string;
|
|
133
|
+
mimeType?: string;
|
|
134
|
+
language?: string;
|
|
135
|
+
} | {
|
|
136
|
+
type: "oneshot";
|
|
137
|
+
prompt: string;
|
|
138
|
+
scope?: "project" | "component";
|
|
139
|
+
model?: string;
|
|
140
|
+
provider?: "anthropic" | "openai" | "google" | "ollama" | "nvidia" | "cli";
|
|
141
|
+
messages?: Array<{
|
|
142
|
+
role: "user" | "assistant";
|
|
143
|
+
content: string;
|
|
144
|
+
}>;
|
|
145
|
+
taskId?: string;
|
|
146
|
+
pageContext?: any;
|
|
147
|
+
} | {
|
|
148
|
+
type: "restore_snapshot";
|
|
149
|
+
snapshotId: string;
|
|
150
|
+
} | {
|
|
151
|
+
type: "get_timeline";
|
|
152
|
+
} | {
|
|
153
|
+
type: "delete_snapshot";
|
|
154
|
+
snapshotId: string;
|
|
155
|
+
};
|
|
156
|
+
type ModelOption = {
|
|
157
|
+
id: string;
|
|
158
|
+
label: string;
|
|
159
|
+
provider: "anthropic" | "openai" | "google" | "ollama" | "nvidia" | "cli";
|
|
160
|
+
locked?: boolean;
|
|
161
|
+
lockedReason?: string;
|
|
162
|
+
};
|
|
163
|
+
type PageEntry = {
|
|
164
|
+
name: string;
|
|
165
|
+
path: string;
|
|
166
|
+
type: "directory" | "file";
|
|
167
|
+
};
|
|
168
|
+
export type ServerBridgeMessage = {
|
|
169
|
+
type: "config";
|
|
170
|
+
apiKeyConfigured: boolean;
|
|
171
|
+
agentConfigured: boolean;
|
|
172
|
+
models: ModelOption[];
|
|
173
|
+
collab?: CollabConfig | null;
|
|
174
|
+
user?: {
|
|
175
|
+
name?: string;
|
|
176
|
+
email?: string;
|
|
177
|
+
} | null;
|
|
178
|
+
} | {
|
|
179
|
+
type: "git_state";
|
|
180
|
+
git: GitState;
|
|
181
|
+
} | {
|
|
182
|
+
type: "git_result";
|
|
183
|
+
message?: string;
|
|
184
|
+
error?: string;
|
|
185
|
+
} | {
|
|
186
|
+
type: "git_progress";
|
|
187
|
+
message: string;
|
|
188
|
+
} | {
|
|
189
|
+
type: "git_commit_message";
|
|
190
|
+
message?: string;
|
|
191
|
+
error?: string;
|
|
192
|
+
} | {
|
|
193
|
+
type: "agent_status";
|
|
194
|
+
taskId?: string;
|
|
195
|
+
status: "thinking" | "working" | "review" | "error" | "stopped";
|
|
196
|
+
message: string;
|
|
197
|
+
detail?: string;
|
|
198
|
+
changes?: SourceChange[];
|
|
199
|
+
thinking?: Array<{
|
|
200
|
+
title: string;
|
|
201
|
+
detail?: string;
|
|
202
|
+
durationMs?: number;
|
|
203
|
+
}>;
|
|
204
|
+
totalThinkingTimeMs?: number;
|
|
205
|
+
} | {
|
|
206
|
+
type: "agent_prompt";
|
|
207
|
+
taskId: string;
|
|
208
|
+
prompt: AgentPrompt;
|
|
209
|
+
} | {
|
|
210
|
+
type: "page_folders";
|
|
211
|
+
path: string;
|
|
212
|
+
entries: PageEntry[];
|
|
213
|
+
project?: string;
|
|
214
|
+
error?: string;
|
|
215
|
+
} | {
|
|
216
|
+
type: "page_created";
|
|
217
|
+
path: string;
|
|
218
|
+
error?: string;
|
|
219
|
+
} | {
|
|
220
|
+
type: "page_folder_created";
|
|
221
|
+
path: string;
|
|
222
|
+
error?: string;
|
|
223
|
+
} | {
|
|
224
|
+
type: "assistant_message";
|
|
225
|
+
taskId?: string;
|
|
226
|
+
message: string;
|
|
227
|
+
} | {
|
|
228
|
+
type: "applied";
|
|
229
|
+
taskId?: string;
|
|
230
|
+
message: string;
|
|
231
|
+
validation?: {
|
|
232
|
+
passed: boolean;
|
|
233
|
+
errors: string[];
|
|
234
|
+
command: string;
|
|
235
|
+
};
|
|
236
|
+
} | {
|
|
237
|
+
type: "undone";
|
|
238
|
+
taskId?: string;
|
|
239
|
+
message: string;
|
|
240
|
+
} | {
|
|
241
|
+
type: "transcribe_result";
|
|
242
|
+
requestId: string;
|
|
243
|
+
success: boolean;
|
|
244
|
+
text?: string;
|
|
245
|
+
provider?: string;
|
|
246
|
+
error?: string;
|
|
247
|
+
} | {
|
|
248
|
+
type: "timeline";
|
|
249
|
+
snapshots: TimelineSnapshot[];
|
|
250
|
+
};
|
|
251
|
+
export declare function restartBridge(port?: number): Promise<{
|
|
252
|
+
ok: boolean;
|
|
253
|
+
error?: string;
|
|
254
|
+
}>;
|
|
255
|
+
export declare function startBridge(cwd?: string, collabConfig?: CollabConfig | null, bridgePort?: number): Promise<{
|
|
256
|
+
send: (msg: ServerBridgeMessage) => void;
|
|
257
|
+
close(): void;
|
|
258
|
+
}>;
|
|
259
|
+
export {};
|