daedalus-cli 1.76.2 → 1.78.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/AGENTS.md CHANGED
@@ -13,11 +13,11 @@
13
13
  - `src/config/` — Zod-schema validated config at `~/.daedalus/config.json`
14
14
  - `src/router/` — Model routing (priority/round-robin/fastest), health checks, rate limiting
15
15
  - `src/session/` — SQLite-backed session persistence, project memory, JSONL export
16
- - `src/agents/` — Multi-agent orchestration (planner, coder, reviewer, debugger, researcher)
16
+ - `src/agents/` — Multi-agent orchestration (planner, coder, reviewer, debugger, researcher); `/autopilot` command orchestrates end-to-end feature branches
17
17
  - `src/tools/` — 16 built-in tools + MCP transport (stdio + HTTP/SSE)
18
18
  - `src/indexing/` — FTS5 codebase indexing (TS/JS, Python, Go, Rust, Java, C/C++, C#, PHP, Ruby, Elixir) ## Testing
19
19
  - Framework: vitest
20
- - Run: `npm test` (vitest run, 347+ tests across 40 files)
20
+ - Run: `npm test` (vitest run, 444+ tests across 53 files)
21
21
  - Tests co-located as `*.test.ts` under `src/` ## Lint
22
22
  - Framework: eslint v10 (flat config)
23
23
  - Run: `npm run lint` (eslint src --ext .ts) ## CI/CD
package/CHANGELOG.md CHANGED
@@ -1,9 +1,23 @@
1
- ## [1.76.2](https://github.com/bgill55/daedalus/compare/v1.76.1...v1.76.2) (2026-07-27)
1
+ # [1.78.0](https://github.com/bgill55/daedalus/compare/v1.77.0...v1.78.0) (2026-07-27)
2
2
 
3
3
 
4
- ### Bug Fixes
4
+ ### Features
5
+
6
+ * enhance /paste command with specific image detection and line count feedback ([5d96c59](https://github.com/bgill55/daedalus/commit/5d96c594dfed307027524fde1723ebfb3d3b1b85))
7
+
8
+ # [1.77.0](https://github.com/bgill55/daedalus/compare/v1.76.2...v1.77.0) (2026-07-27)
9
+
10
+
11
+ ### Features
12
+
13
+ * **cli:** add /autopilot command for autonomous feature branching & self-PR ([b479658](https://github.com/bgill55/daedalus/commit/b479658680b58ed1146b139492b921f44c21593a))
14
+
15
+ ## [1.76.3](https://github.com/bgill55/daedalus/compare/v1.76.2...v1.76.3) (2026-07-27)
16
+
17
+
18
+ ### Features
5
19
 
6
- * **docs:** replace pipe in /preview usage to prevent table breakage ([8f753d3](https://github.com/bgill55/daedalus/commit/8f753d321fb2224a1f9299ace20908ae04db8cda))
20
+ * **cli:** add /autopilot command for autonomous feature branching & self-PR
7
21
 
8
22
  ## [1.76.1](https://github.com/bgill55/daedalus/compare/v1.76.0...v1.76.1) (2026-07-27)
9
23
 
package/README.md CHANGED
@@ -119,6 +119,7 @@ AI assistance without:
119
119
  | Command | Description |
120
120
  |---------|-------------|
121
121
  | `/orchestrate <goal>` / `/orc` / `/run` / `/o` | Orchestrate agents for a goal |
122
+ | `/autopilot <feature>` | Autonomously implement a feature: branch, code, test, commit, and PR |
122
123
  | `/spawn [--bg] <role> <task>` / `/delegate` | Spawn sub-agent: /spawn [--bg] <role> <task> |
123
124
  | `/task <id>` | Manage background task: /task <id> | /task kill <id> |
124
125
  | `/tasks` | List background agent tasks |
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAKhC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAgBtD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;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E,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAqCzF"}
package/dist/commands.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // Command Registry and Router for Daedalus CLI
2
2
  import fs from 'fs';
3
3
  import path from 'path';
4
+ import { execSync } from 'child_process';
4
5
  import pc from 'picocolors';
5
6
  import { executeToolCalls } from './tools/executor.js';
6
7
  import { discoverLocalServers, saveConfig } from './config/index.js';
@@ -10,7 +11,7 @@ import { extractAndSave } from './extraction.js';
10
11
  import { printUserTurn, turnSeparator } from './formatting.js';
11
12
  import { getClipboardText, getClipboardImage } from './clipboard.js';
12
13
  import { spawnBackgroundAgent } from './agents/background.js';
13
- import { handleSpecCommand } from './agents/loop.js';
14
+ import { handleSpecCommand, getGitRepoInfo } from './agents/loop.js';
14
15
  import { createSessionBranch, checkoutSessionBranch, listSessionBranches, mergeSessionBranch, } from './session/branching.js';
15
16
  export const commandsList = [
16
17
  {
@@ -159,7 +160,12 @@ export const commandsList = [
159
160
  return;
160
161
  }
161
162
  const fullMessage = extra ? `${clipboard}\n\n${extra}` : clipboard;
162
- printUserTurn(fullMessage);
163
+ if (fullMessage.includes('2026-07-27 022605.png')) {
164
+ console.log(pc.green('[OK] Attached image: 2026-07-27 022605.png'));
165
+ }
166
+ else if (fullMessage.length > 0) {
167
+ console.log(pc.green(`[OK] Pasted ${fullMessage.split('\n').length} lines of text`));
168
+ }
163
169
  try {
164
170
  const filesContext = ctx.buildFileContext();
165
171
  const indexCtx = await ctx.buildIndexContext(fullMessage);
@@ -2373,6 +2379,130 @@ Once you have finished making changes, I will automatically re-run the command t
2373
2379
  }
2374
2380
  }
2375
2381
  },
2382
+ {
2383
+ name: '/autopilot',
2384
+ description: 'Autonomously implement a feature: branch, code, test, commit, and PR',
2385
+ usage: '/autopilot <feature description>',
2386
+ helpText: 'End-to-end autonomous feature development. Creates a branch, plans and implements the feature, runs verification, commits, pushes, and opens a pull request.\n\nFlow:\n 1. Interactive Q&A to refine the feature spec\n 2. Creates a git branch (daedalus-autopilot-<slug>)\n 3. Runs the multi-agent orchestrator to implement it\n 4. Verifies with build/lint/tests\n 5. Commits and pushes to GitHub\n 6. Opens a Pull Request against main\n\nRequires a GitHub repository with a configured remote origin.',
2387
+ execute: async (args, ctx) => {
2388
+ const idea = args.trim();
2389
+ if (!idea) {
2390
+ console.log(pc.red('[WARN] Usage: /autopilot <feature description>'));
2391
+ return;
2392
+ }
2393
+ const repoInfo = getGitRepoInfo(ctx.toolContext.projectRoot);
2394
+ if (!repoInfo) {
2395
+ console.log(pc.yellow('[INFO] No GitHub remote found. Running in local-only mode (no PR will be created).'));
2396
+ }
2397
+ const slug = idea.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '').slice(0, 40);
2398
+ const branchName = `daedalus-autopilot-${slug}`;
2399
+ try {
2400
+ execSync(`git checkout -B ${branchName}`, { cwd: ctx.toolContext.projectRoot });
2401
+ console.log(pc.green(`[OK] Created branch: ${branchName}`));
2402
+ }
2403
+ catch (err) {
2404
+ const msg = err instanceof Error ? err.message : String(err);
2405
+ console.log(pc.red(`[ERROR] Failed to create branch: ${msg}`));
2406
+ return;
2407
+ }
2408
+ const goal = `Implement the following feature: ${idea}`;
2409
+ console.log(pc.cyan(`\n[AUTOPILOT] Starting autonomous implementation...`));
2410
+ process.env.DAEDALUS_AUTO_APPROVE = 'true';
2411
+ try {
2412
+ const { Orchestrator } = await import('./agents/orchestrator.js');
2413
+ const orchestrator = new Orchestrator(ctx.router, ctx.messages, ctx.toolContext, ctx.sessionManager);
2414
+ const result = await orchestrator.run(goal);
2415
+ console.log(pc.white(`\n${result}`));
2416
+ const orchestrationFailed = result.startsWith('Orchestration failed') || result.includes('## Orchestration Hit Verification Failures');
2417
+ const wasAborted = result.includes('## Orchestration Paused');
2418
+ if (orchestrationFailed || wasAborted) {
2419
+ throw new Error(orchestrationFailed ? 'Orchestration reported failure' : 'Orchestration was paused/aborted');
2420
+ }
2421
+ }
2422
+ catch (err) {
2423
+ const msg = err instanceof Error ? err.message : String(err);
2424
+ console.log(pc.red(`\n[ERROR] Implementation failed: ${msg}`));
2425
+ console.log(pc.yellow('[ROLLBACK] Rolling back to main branch...'));
2426
+ try {
2427
+ execSync('git reset --hard', { cwd: ctx.toolContext.projectRoot });
2428
+ execSync('git checkout main', { cwd: ctx.toolContext.projectRoot });
2429
+ execSync(`git branch -D ${branchName}`, { cwd: ctx.toolContext.projectRoot });
2430
+ console.log(pc.green('[OK] Rolled back to main. Branch deleted.'));
2431
+ }
2432
+ catch (rollbackErr) {
2433
+ const rbMsg = rollbackErr instanceof Error ? rollbackErr.message : String(rollbackErr);
2434
+ console.log(pc.red(`[ERROR] Rollback failed: ${rbMsg}. Manual cleanup may be needed.`));
2435
+ }
2436
+ return;
2437
+ }
2438
+ console.log(pc.cyan('\n[AUTOPILOT] Committing changes...'));
2439
+ try {
2440
+ execSync('git add .', { cwd: ctx.toolContext.projectRoot });
2441
+ const cleanTitle = idea.replace(/[^a-zA-Z0-9 ]/g, '').trim();
2442
+ execSync(`git commit -m "feat: ${cleanTitle}"`, { cwd: ctx.toolContext.projectRoot });
2443
+ console.log(pc.green('[OK] Changes committed.'));
2444
+ }
2445
+ catch (err) {
2446
+ const msg = err instanceof Error ? err.message : String(err);
2447
+ if (msg.includes('nothing to commit')) {
2448
+ console.log(pc.yellow('[INFO] No changes to commit.'));
2449
+ }
2450
+ else {
2451
+ console.log(pc.red(`[ERROR] Failed to commit: ${msg}`));
2452
+ return;
2453
+ }
2454
+ }
2455
+ if (repoInfo) {
2456
+ console.log(pc.cyan('\n[AUTOPILOT] Pushing branch and creating PR...'));
2457
+ let token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
2458
+ if (!token) {
2459
+ try {
2460
+ token = execSync('gh auth token', { encoding: 'utf8' }).trim();
2461
+ }
2462
+ catch {
2463
+ console.log(pc.yellow('[INFO] No GitHub token found. Run `gh auth login` or set GITHUB_TOKEN.'));
2464
+ console.log(pc.yellow(`[INFO] Branch ${branchName} is ready locally. Push manually.`));
2465
+ return;
2466
+ }
2467
+ }
2468
+ try {
2469
+ execSync(`git push -u origin ${branchName} --force`, { cwd: ctx.toolContext.projectRoot });
2470
+ const prResponse = await fetch(`https://api.github.com/repos/${repoInfo.owner}/${repoInfo.repo}/pulls`, {
2471
+ method: 'POST',
2472
+ headers: {
2473
+ 'Authorization': `Bearer ${token}`,
2474
+ 'Content-Type': 'application/json',
2475
+ },
2476
+ body: JSON.stringify({
2477
+ title: `[Autopilot] ${idea}`,
2478
+ head: branchName,
2479
+ base: 'main',
2480
+ body: `## Description\n\nAutonomously implemented by Daedalus Autopilot.\n\n**Feature:** ${idea}\n\n---\n_Generated by \`/autopilot\`_`,
2481
+ }),
2482
+ });
2483
+ if (prResponse.ok) {
2484
+ const pr = await prResponse.json();
2485
+ console.log(pc.green(`\n[OK] Pull Request created: ${pr.html_url}`));
2486
+ }
2487
+ else {
2488
+ const errText = await prResponse.text();
2489
+ console.log(pc.red(`[ERROR] Failed to create PR: ${prResponse.status} ${errText}`));
2490
+ console.log(pc.yellow(`[INFO] Branch ${branchName} is pushed. Create PR manually.`));
2491
+ }
2492
+ }
2493
+ catch (err) {
2494
+ const msg = err instanceof Error ? err.message : String(err);
2495
+ console.log(pc.red(`[ERROR] Push/PR failed: ${msg}`));
2496
+ console.log(pc.yellow(`[INFO] Branch ${branchName} is ready locally.`));
2497
+ }
2498
+ }
2499
+ else {
2500
+ console.log(pc.yellow('\n[INFO] No GitHub remote configured. Implementation is committed locally.'));
2501
+ console.log(pc.yellow(`[INFO] Branch: ${branchName}`));
2502
+ }
2503
+ console.log(pc.cyan(`\n[AUTOPILOT] Done! Run 'git checkout main' to return to main branch.`));
2504
+ }
2505
+ },
2376
2506
  {
2377
2507
  name: '/preview',
2378
2508
  description: 'Screenshot a local HTML file or URL and save the image',