stella-coder 5.1.0 → 5.1.1
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/package.json +1 -1
- package/stella-cli/autonomous-agent.mjs +97 -23
- package/stella-cli/index.mjs +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stella-coder",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Stella Coder 5.0 — AI coding agent with Telegram bot, huge context, TDD, Git ecosystem, presentations, computer control, smart home, Office automation, and antivirus",
|
|
6
6
|
"main": "stella-cli/index.mjs",
|
|
@@ -62,7 +62,30 @@ export class AutonomousAgent {
|
|
|
62
62
|
|
|
63
63
|
const g = goal.toLowerCase()
|
|
64
64
|
|
|
65
|
-
if (g.includes("
|
|
65
|
+
if (g.includes("видео") || g.includes("video")) {
|
|
66
|
+
plan.steps = [
|
|
67
|
+
{ id: "concept", name: "Create video concept and script", status: "pending", subtasks: [
|
|
68
|
+
"Write a compelling script/storyboard for the video",
|
|
69
|
+
"Create HTML presentation with animations showing the product",
|
|
70
|
+
"Add text overlays, transitions, and effects"
|
|
71
|
+
], results: [] },
|
|
72
|
+
{ id: "build_video", name: "Build HTML video/animation", status: "pending", subtasks: [
|
|
73
|
+
"Create self-contained HTML file with CSS animations",
|
|
74
|
+
"Add GSAP or CSS keyframe animations",
|
|
75
|
+
"Create cinematic transitions between scenes",
|
|
76
|
+
"Add background music placeholder"
|
|
77
|
+
], results: [] },
|
|
78
|
+
{ id: "export", name: "Export and place on desktop", status: "pending", subtasks: [
|
|
79
|
+
"Copy the HTML video file to Desktop",
|
|
80
|
+
"Create a .bat launcher to open it in browser",
|
|
81
|
+
"Create a poster/thumbnail image"
|
|
82
|
+
], results: [] },
|
|
83
|
+
{ id: "promote", name: "Promote the content", status: "pending", subtasks: [
|
|
84
|
+
"Create social media post templates",
|
|
85
|
+
"Write promotional text for sharing"
|
|
86
|
+
], results: [] }
|
|
87
|
+
]
|
|
88
|
+
} else if (g.includes("приложен") || g.includes("app") || g.includes("заработ") || g.includes("$") || g.includes("монетиз") || g.includes("donate") || g.includes("заработ")) {
|
|
66
89
|
plan.steps = [
|
|
67
90
|
{ id: "research", name: "Research market & competitors", status: "pending", subtasks: [
|
|
68
91
|
"Search for trending app ideas and niches",
|
|
@@ -175,40 +198,79 @@ export class AutonomousAgent {
|
|
|
175
198
|
const prompt = `You are an autonomous coding agent. Complete this task: "${subtask}"
|
|
176
199
|
Context: Goal is "${goal}"
|
|
177
200
|
|
|
178
|
-
You
|
|
179
|
-
|
|
180
|
-
- npm/pnpm (install packages)
|
|
181
|
-
- Git (commit, push)
|
|
182
|
-
- Web search (find information)
|
|
183
|
-
- Shell commands (run anything)
|
|
184
|
-
|
|
185
|
-
DO NOT just describe what to do. ACTUALLY DO IT. Create REAL files, run REAL commands, make REAL progress.
|
|
201
|
+
You MUST return a JSON object with actual executable commands and file contents.
|
|
202
|
+
DO NOT just describe — ACTUALLY PLAN THE EXECUTION.
|
|
186
203
|
|
|
187
|
-
Return
|
|
204
|
+
Return this exact JSON structure:
|
|
188
205
|
{
|
|
189
|
-
"action": "what
|
|
190
|
-
"
|
|
191
|
-
|
|
192
|
-
|
|
206
|
+
"action": "what will be done",
|
|
207
|
+
"filesToCreate": [
|
|
208
|
+
{"path": "relative/path/file.ext", "content": "FULL file content with all code"}
|
|
209
|
+
],
|
|
210
|
+
"commandsToRun": [
|
|
211
|
+
"shell command 1",
|
|
212
|
+
"shell command 2"
|
|
213
|
+
],
|
|
214
|
+
"result": "description of what will happen",
|
|
193
215
|
"nextSteps": ["what to do next"]
|
|
194
|
-
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
IMPORTANT:
|
|
219
|
+
- filesToCreate must contain REAL, COMPLETE, WORKING code (not placeholders)
|
|
220
|
+
- commandsToRun must be real shell commands (npm init, mkdir, etc.)
|
|
221
|
+
- Return ONLY the JSON, no markdown, no explanations`
|
|
195
222
|
|
|
196
223
|
const response = await apiCall(prompt)
|
|
197
224
|
let parsed
|
|
198
225
|
try {
|
|
199
|
-
|
|
226
|
+
// Strip markdown code fences if present
|
|
227
|
+
let clean = response.trim()
|
|
228
|
+
if (clean.startsWith("```")) {
|
|
229
|
+
clean = clean.replace(/^```(?:json)?\n?/, "").replace(/\n?```$/, "")
|
|
230
|
+
}
|
|
231
|
+
parsed = JSON.parse(clean)
|
|
200
232
|
} catch {
|
|
201
|
-
parsed = { action: "completed", result: response,
|
|
233
|
+
parsed = { action: "completed", result: response, filesToCreate: [], commandsToRun: [] }
|
|
202
234
|
}
|
|
203
235
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
236
|
+
const created = []
|
|
237
|
+
const executed = []
|
|
238
|
+
|
|
239
|
+
// Create actual files
|
|
240
|
+
if (parsed.filesToCreate && Array.isArray(parsed.filesToCreate)) {
|
|
241
|
+
for (const file of parsed.filesToCreate) {
|
|
242
|
+
if (file.path && file.content) {
|
|
243
|
+
try {
|
|
244
|
+
const fullPath = join(process.cwd(), file.path)
|
|
245
|
+
const dir = dirname(fullPath)
|
|
246
|
+
if (!existsSync(dir)) mkdirSync(dir, { recursive: true })
|
|
247
|
+
writeFileSync(fullPath, file.content, "utf-8")
|
|
248
|
+
created.push(file.path)
|
|
249
|
+
this.memory.projects.push({ file: file.path, created: new Date().toISOString(), goal, subtask })
|
|
250
|
+
logEntry("FILE_CREATED", file.path)
|
|
251
|
+
} catch (err) {
|
|
252
|
+
logEntry("FILE_ERROR", `${file.path}: ${err.message}`)
|
|
253
|
+
}
|
|
254
|
+
}
|
|
207
255
|
}
|
|
208
256
|
}
|
|
209
|
-
|
|
257
|
+
|
|
258
|
+
// Execute actual commands
|
|
259
|
+
if (parsed.commandsToRun && Array.isArray(parsed.commandsToRun)) {
|
|
260
|
+
for (const cmd of parsed.commandsToRun) {
|
|
261
|
+
try {
|
|
262
|
+
execSync(cmd, { timeout: 30000, stdio: "pipe", shell: true, cwd: process.cwd() })
|
|
263
|
+
executed.push(cmd)
|
|
264
|
+
logEntry("CMD_RUN", cmd)
|
|
265
|
+
} catch (err) {
|
|
266
|
+
logEntry("CMD_FAIL", `${cmd}: ${err.message?.slice(0, 100)}`)
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
logEntry("SUBTASK_DONE", `${subtask}: ${created.length} files, ${executed.length} cmds`)
|
|
210
272
|
this.save()
|
|
211
|
-
return parsed
|
|
273
|
+
return { ...parsed, filesCreated: created, commandsRun: executed }
|
|
212
274
|
}
|
|
213
275
|
|
|
214
276
|
async runIteration(apiCall, onProgress) {
|
|
@@ -227,7 +289,7 @@ Return a JSON object:
|
|
|
227
289
|
|
|
228
290
|
step.status = "running"
|
|
229
291
|
this.save()
|
|
230
|
-
if (onProgress) onProgress(
|
|
292
|
+
if (onProgress) onProgress(`⚡ Executing: ${step.name}`)
|
|
231
293
|
logEntry("STEP_START", step.name)
|
|
232
294
|
|
|
233
295
|
const stepResults = []
|
|
@@ -238,6 +300,18 @@ Return a JSON object:
|
|
|
238
300
|
if (onProgress) onProgress(` → ${subtask}`)
|
|
239
301
|
const result = await this.executeSubtask(subtask, plan.goal, apiCall)
|
|
240
302
|
stepResults.push(result)
|
|
303
|
+
|
|
304
|
+
// Report created files
|
|
305
|
+
if (result.filesCreated && result.filesCreated.length > 0) {
|
|
306
|
+
for (const f of result.filesCreated) {
|
|
307
|
+
if (onProgress) onProgress(` 📄 Created: ${f}`)
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (result.commandsRun && result.commandsRun.length > 0) {
|
|
311
|
+
for (const c of result.commandsRun) {
|
|
312
|
+
if (onProgress) onProgress(` ⚙️ Ran: ${c}`)
|
|
313
|
+
}
|
|
314
|
+
}
|
|
241
315
|
} catch (err) {
|
|
242
316
|
logEntry("SUBTASK_FAIL", `${subtask}: ${err.message}`)
|
|
243
317
|
stepResults.push({ error: err.message })
|
package/stella-cli/index.mjs
CHANGED
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
generateAdminCode, listAuthorizedUsers,
|
|
42
42
|
} from "./telegram-bot.mjs"
|
|
43
43
|
|
|
44
|
-
const VERSION = "5.1.
|
|
44
|
+
const VERSION = "5.1.1"
|
|
45
45
|
const CONFIG_DIR = path.join(os.homedir(), ".stella")
|
|
46
46
|
const CONFIG_PATH = path.join(CONFIG_DIR, "config.json")
|
|
47
47
|
const HISTORY_PATH = path.join(CONFIG_DIR, "history.json")
|