daedalus-cli 0.4.2 → 0.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/AGENTS.md ADDED
@@ -0,0 +1,34 @@
1
+ # Daedalus — Agent Conventions
2
+
3
+ ## Project Identity
4
+ - **Name:** Daedalus (`daedalus-cli` on npm)
5
+ - **Description:** Local-first AI coding CLI with embedded model router, multi-agent orchestration, and codebase indexing
6
+ - **Language:** TypeScript (ESM, `"type": "module"`)
7
+ - **Node:** >=20
8
+
9
+ ## Code Conventions
10
+ - **No comments** in source files unless absolutely necessary for clarity
11
+ - No emoji in code or docs unless user explicitly requests
12
+ - Exports: named exports only (no default exports)
13
+ - Types: Zod schemas in config files, interfaces in `src/types.ts`
14
+ - Imports: always include `.js` extension in ESM imports (e.g., `'./file.js'`)
15
+ - Error handling: throw typed errors, prefer `result` pattern for tool returns
16
+
17
+ ## Architecture
18
+ - `src/index.ts` — CLI entry point, REPL loop, command dispatch
19
+ - `src/config/` — Zod-schema validated config at `~/.daedalus/config.json`
20
+ - `src/router/` — Model routing (priority/round-robin/fastest), health checks, rate limiting
21
+ - `src/session/` — SQLite-backed session persistence, project memory, JSONL export
22
+ - `src/agents/` — Multi-agent orchestration (planner, coder, reviewer, debugger, researcher)
23
+ - `src/tools/` — 16 built-in tools + MCP transport (stdio + HTTP/SSE)
24
+ - `src/indexing/` — FTS5 codebase indexing (TS/JS, Python, Go, Rust)
25
+
26
+ ## Testing
27
+ - Framework: vitest
28
+ - Run: `npm test` (vitest run)
29
+ - No tests exist yet — add them under `src/` co-located as `*.test.ts`
30
+
31
+ ## important
32
+ - never lint before asking
33
+ - do not add comments
34
+ - never use emojis
package/CHANGELOG.md ADDED
@@ -0,0 +1,70 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ - CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md — open-source governance docs
13
+ - AGENTS.md — AI assistant conventions for tool-aided development
14
+ - GitHub issue templates (bug report, feature request) and PR template
15
+ - CHANGELOG.md — project changelog
16
+ - User approval gate before dangerous tool execution (terminal, write_file)
17
+ - MCP tool registration warning on startup
18
+ - Personality: dry humor injected into system prompts, tool descriptions, agent roles, banner, and diff UI
19
+
20
+ ### Fixed
21
+
22
+ - CRITICAL: Path traversal in resolvePath — now enforces project directory boundary
23
+ - CRITICAL: Sub-agent auto-approval in diff UI — removed isSubAgent bypass
24
+ - HIGH: Environment variables leaked to child processes — sanitized env in terminal and MCP stdio
25
+ - HIGH: Shell injection in search_files — replaced shell command construction with direct spawn
26
+ - HIGH: Config file world-readable permissions — chmod 0600 on non-Windows
27
+ - HIGH: openEditor shell:true — changed to shell:false
28
+ - HIGH: MCP stdio command injection — validates command for shell metacharacters
29
+ - HIGH: Clipboard script security — added random suffix to temp files, size limit on text paste
30
+
31
+ ## [0.4.2] - 2026-06-18
32
+
33
+ ### Changed
34
+
35
+ - Word-wrap box content to terminal width for better readability
36
+ - User top border alignment fix
37
+ - All message boxes share consistent border width
38
+
39
+ ### Added
40
+
41
+ - Image paste support via `/paste` command
42
+ - Dynamic version read from package.json
43
+
44
+ ## [0.4.1] - 2026-06-18
45
+
46
+ ### Changed
47
+
48
+ - Made `indexCodebase` fully async so auto-index doesn't block startup
49
+ - Updated README and package metadata
50
+ - Renamed npm package to `daedalus-cli` (name conflict resolution)
51
+
52
+ ## [0.3.0] - 2026-06-18
53
+
54
+ ### Added
55
+
56
+ - Initial release
57
+ - CLI REPL with command dispatch, streaming chat, and tool execution
58
+ - Model router with priority, round-robin, and fastest-response strategies
59
+ - Health checking and token-bucket rate limiter
60
+ - Session persistence via SQLite with JSONL import/export
61
+ - Project memory — persisted facts and conventions auto-injected every turn
62
+ - 16 built-in tools: file read/write/patch, terminal, git, web, todo, delegation, codebase search, project config
63
+ - Interactive diff UI with y/n/a/s/e/d workflow
64
+ - MCP support: stdio and HTTP/SSE transport
65
+ - Multi-agent orchestration with 6 roles (orchestrator, planner, coder, reviewer, debugger, researcher)
66
+ - Codebase indexing with FTS5 for TS/JS, Python, Go, Rust
67
+ - Auto-discovery of local LLM servers (LM Studio, Ollama, llama.cpp, vLLM)
68
+ - First-run onboarding wizard
69
+ - Syntax highlighting for code blocks
70
+ - Cross-platform support (Windows + Unix)
@@ -0,0 +1,112 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ - Demonstrating empathy and kindness toward other people
21
+ - Being respectful of differing opinions, viewpoints, and experiences
22
+ - Giving and gracefully accepting constructive feedback
23
+ - Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ - Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ - The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ - Trolling, insulting or derogatory comments, and personal or political attacks
33
+ - Public or private harassment
34
+ - Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ - Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies within all community spaces, and also applies when
49
+ an individual is officially representing the community in public spaces.
50
+
51
+ ## Enforcement
52
+
53
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
54
+ reported to the community leaders responsible for enforcement at
55
+ bgill55_dev@voxvivid.com. All complaints will be reviewed and investigated
56
+ promptly and fairly.
57
+
58
+ ## Enforcement Guidelines
59
+
60
+ Community leaders will follow these Community Impact Guidelines in determining
61
+ the consequences for any action they deem in violation of this Code of Conduct:
62
+
63
+ ### 1. Correction
64
+
65
+ **Community Impact:** Use of inappropriate language or other behavior deemed
66
+ unprofessional or unwelcome in the community.
67
+
68
+ **Consequence:** A private, written warning from community leaders, providing
69
+ clarity around the nature of the violation and an explanation of why the
70
+ behavior was inappropriate. A public apology may be requested.
71
+
72
+ ### 2. Warning
73
+
74
+ **Community Impact:** A violation through a single incident or series of actions.
75
+
76
+ **Consequence:** A warning with consequences for continued behavior. No
77
+ interaction with the people involved, including unsolicited interaction with
78
+ those enforcing the Code of Conduct, for a specified period of time. This
79
+ includes avoiding interactions in community spaces as well as external channels
80
+ like social media. Violating these terms may lead to a temporary or
81
+ permanent ban.
82
+
83
+ ### 3. Temporary Ban
84
+
85
+ **Community Impact:** A serious violation of community standards, including
86
+ sustained inappropriate behavior.
87
+
88
+ **Consequence:** A temporary ban from any sort of interaction or public
89
+ communication with the community for a specified period of time. No public or
90
+ private interaction with the people involved, including unsolicited interaction
91
+ with those enforcing the Code of Conduct, is allowed during this period.
92
+ Violating these terms may lead to a permanent ban.
93
+
94
+ ### 4. Permanent Ban
95
+
96
+ **Community Impact:** Demonstrating a pattern of violation of community
97
+ standards, including sustained inappropriate behavior, harassment of an
98
+ individual, or aggression toward or disparagement of classes of individuals.
99
+
100
+ **Consequence:** A permanent ban from any sort of public interaction within
101
+ the community.
102
+
103
+ ## Attribution
104
+
105
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
106
+ version 2.1, available at
107
+ https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
108
+
109
+ [homepage]: https://www.contributor-covenant.org
110
+
111
+ For answers to common questions about this code of conduct, see the FAQ at
112
+ https://www.contributor-covenant.org/faq.
@@ -0,0 +1,165 @@
1
+ # Contributing to Daedalus
2
+
3
+ Thanks for your interest in contributing! Daedalus is a local-first AI coding CLI, and we welcome contributions of all kinds — bug fixes, features, documentation, and more.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Code of Conduct](#code-of-conduct)
8
+ - [Getting Started](#getting-started)
9
+ - [Development Setup](#development-setup)
10
+ - [Project Structure](#project-structure)
11
+ - [Coding Standards](#coding-standards)
12
+ - [Commit Guidelines](#commit-guidelines)
13
+ - [Pull Request Process](#pull-request-process)
14
+ - [Testing](#testing)
15
+ - [Reporting Issues](#reporting-issues)
16
+
17
+ ## Code of Conduct
18
+
19
+ This project is governed by the [Contributor Covenant](CODE_OF_CONDUCT.md). By participating, you agree to uphold its terms.
20
+
21
+ ## Getting Started
22
+
23
+ 1. Fork the repository
24
+ 2. Clone your fork: `git clone https://github.com/<your-username>/daedalus.git`
25
+ 3. Create a feature branch: `git checkout -b feat/your-feature-name`
26
+
27
+ ## Development Setup
28
+
29
+ ```bash
30
+ # Install dependencies
31
+ npm install
32
+
33
+ # Run in dev mode (hot reload)
34
+ npm run dev
35
+
36
+ # Build
37
+ npm run build
38
+
39
+ # Type check
40
+ npx tsc --noEmit
41
+ ```
42
+
43
+ ### Prerequisites
44
+
45
+ - Node.js 20+
46
+ - A local LLM server (LM Studio, Ollama, llama.cpp, vLLM) or a remote API key
47
+
48
+ ## Project Structure
49
+
50
+ ```
51
+ src/
52
+ ├── index.ts # CLI entry point, REPL, command dispatch
53
+ ├── types.ts # Shared type definitions
54
+ ├── highlight.ts # Syntax highlighting
55
+ ├── config/ # Configuration loading, schema, discovery
56
+ ├── router/ # Model routing engine
57
+ ├── session/ # Session persistence (SQLite, JSONL)
58
+ ├── agents/ # Multi-agent system
59
+ ├── tools/ # Tool system (16 built-in tools + MCP)
60
+ │ ├── builtin/ # File, terminal, git, web, todo, etc.
61
+ │ └── mcp/ # MCP transport (stdio, HTTP/SSE)
62
+ ├── indexing/ # FTS5 codebase indexing
63
+ └── onboarding/ # Setup wizard
64
+ ```
65
+
66
+ ## Coding Standards
67
+
68
+ ### Language & Runtime
69
+
70
+ - **TypeScript** with strict mode
71
+ - **ESM** only (`"type": "module"`) — always use `.js` extension in local imports
72
+ - **Node.js 20+** target
73
+
74
+ ### Style
75
+
76
+ - **No comments** in source code unless the logic is non-obvious
77
+ - **No default exports** — use named exports everywhere
78
+ - **No emoji** in code or documentation
79
+ - **Descriptive names** — prefer clarity over brevity
80
+
81
+ ### Imports
82
+
83
+ ```typescript
84
+ // Local imports must include .js extension
85
+ import { RouterConfig } from '../router/types.js';
86
+
87
+ // npm imports need no extension
88
+ import { z } from 'zod';
89
+ ```
90
+
91
+ ### Error Handling
92
+
93
+ - Throw typed errors with descriptive messages
94
+ - Tools return `{ success: boolean, content: string, error?: string }`
95
+
96
+ ## Commit Guidelines
97
+
98
+ We follow [Conventional Commits](https://www.conventionalcommits.org/):
99
+
100
+ ```
101
+ <type>(<scope>): <description>
102
+
103
+ [optional body]
104
+ ```
105
+
106
+ ### Types
107
+
108
+ | Type | Usage |
109
+ |----------|------------------------------|
110
+ | feat | New feature |
111
+ | fix | Bug fix |
112
+ | docs | Documentation only |
113
+ | style | Formatting, missing semicolons |
114
+ | refactor | Code change that fixes neither bug nor adds feature |
115
+ | perf | Performance improvement |
116
+ | test | Adding or updating tests |
117
+ | chore | Build process, tooling, CI |
118
+
119
+ ### Examples
120
+
121
+ ```
122
+ feat(router): add temperature-per-model support
123
+ fix(indexing): handle symlinked directories
124
+ docs: add contributing guide
125
+ test(session): add SQLite CRUD tests
126
+ ```
127
+
128
+ ## Pull Request Process
129
+
130
+ 1. **Small PRs are better** — keep each PR focused on one concern
131
+ 2. **Update the CHANGELOG** — add your change under the `[Unreleased]` section
132
+ 3. **Include tests** — new features should include tests; bug fixes should add a regression test
133
+ 4. **Pass CI** — ensure all checks pass (type check, lint, tests)
134
+ 5. **Request review** — tag a maintainer or mention `@bgill55`
135
+
136
+ ### PR Title Format
137
+
138
+ Same as commit messages: `type(scope): description`
139
+
140
+ ## Testing
141
+
142
+ ```bash
143
+ # Run all tests
144
+ npm test
145
+
146
+ # Watch mode
147
+ npx vitest
148
+
149
+ # With coverage
150
+ npx vitest --coverage
151
+ ```
152
+
153
+ Tests are written with [vitest](https://vitest.dev/) and co-located with source files as `*.test.ts`.
154
+
155
+ ## Reporting Issues
156
+
157
+ - **Bug reports** — use the [bug report template](.github/ISSUE_TEMPLATE/bug_report.md)
158
+ - **Feature requests** — use the [feature request template](.github/ISSUE_TEMPLATE/feature_request.md)
159
+ - **Security issues** — see [SECURITY.md](SECURITY.md)
160
+
161
+ Before filing, please search [existing issues](https://github.com/bgill55/daedalus/issues) to avoid duplicates.
162
+
163
+ ## Questions?
164
+
165
+ Open a [Discussion](https://github.com/bgill55/daedalus/discussions) or reach out to the maintainer.
package/README.md CHANGED
@@ -249,6 +249,20 @@ It's for local-first, private, customizable AI coding — with the power to grow
249
249
 
250
250
  ---
251
251
 
252
+ ## Contributing
253
+
254
+ Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for our contribution guidelines, coding standards, and pull request process.
255
+
256
+ This project is governed by a [Code of Conduct](CODE_OF_CONDUCT.md). Please report any unacceptable behavior.
257
+
258
+ ## Changelog
259
+
260
+ See [CHANGELOG.md](CHANGELOG.md) for the project history.
261
+
262
+ ## Security
263
+
264
+ Report security vulnerabilities privately to bgill55_art@outlook.com — see [SECURITY.md](SECURITY.md) for details.
265
+
252
266
  ## License
253
267
 
254
268
  MIT
package/SECURITY.md ADDED
@@ -0,0 +1,52 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ We release patches for security vulnerabilities. This table shows which versions are currently supported:
6
+
7
+ | Version | Supported |
8
+ |---------|--------------------|
9
+ | 0.4.x | :white_check_mark: |
10
+ | < 0.4 | :x: |
11
+
12
+ ## Reporting a Vulnerability
13
+
14
+ We take security seriously. If you discover a security vulnerability in Daedalus, please **do not** open a public issue.
15
+
16
+ Instead, send a private report to **bgill55_dev@voxvivid.com** with:
17
+
18
+ - A description of the vulnerability
19
+ - Steps to reproduce it
20
+ - Affected versions
21
+ - Any potential mitigations you've identified
22
+
23
+ You should receive a response within 48 hours. If you don't, please follow up to ensure we received your message.
24
+
25
+ ### What to expect
26
+
27
+ 1. **Acknowledgment** — we'll confirm receipt within 48 hours
28
+ 2. **Assessment** — we'll investigate and determine impact and severity
29
+ 3. **Fix** — we'll develop and test a patch
30
+ 4. **Release** — we'll publish a security advisory and a patched release
31
+
32
+ ### Disclosure
33
+
34
+ We ask that you allow us reasonable time to fix and release a patch before publicly disclosing the vulnerability.
35
+
36
+ ## Security Best Practices
37
+
38
+ When using Daedalus:
39
+
40
+ - **API keys** are stored in `~/.daedalus/config.json` — keep this file secure
41
+ - **Local LLM servers** should be bound to localhost (127.0.0.1) to avoid network exposure
42
+ - **Review tool execution** — Daedalus runs terminal commands you approve; review them before confirming
43
+ - Keep Daedalus updated to the latest version to receive security patches
44
+
45
+ ## Scope
46
+
47
+ The following are **out of scope**:
48
+
49
+ - Social engineering attacks against Daedalus maintainers
50
+ - Attacks requiring physical access to the victim's machine
51
+ - Vulnerabilities in third-party LLM servers or providers
52
+ - Denial of service against local services
@@ -1 +1 @@
1
- {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/agents/roles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAqHjD,CAAC;AAGF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAEpD;AAGD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,EAAE,CAI9F"}
1
+ {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/agents/roles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAuHjD,CAAC;AAGF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAEpD;AAGD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,EAAE,CAI9F"}
@@ -3,23 +3,23 @@ export const AGENT_ROLES = {
3
3
  orchestrator: {
4
4
  name: 'orchestrator',
5
5
  description: 'Plans, delegates, and coordinates multi-agent workflows',
6
- systemPrompt: `You are an Orchestrator Agent. Your job is to break down complex tasks into subtasks and delegate them to specialized agents.
6
+ systemPrompt: `You are the Orchestrator Agent — the only agent allowed to have an ego. Your job is to break down complex tasks and delegate them to sub-agents who do the actual work.
7
7
 
8
8
  AVAILABLE SUB-AGENTS:
9
- - planner: Break down vague tasks into concrete, ordered subtasks
10
- - coder: Implement changes, write/edit files, fix bugs
11
- - reviewer: Code review: correctness, security, style, tests
12
- - debugger: Reproduce, isolate, fix bugs; add logging; bisect
13
- - researcher: Web search, docs lookup, API exploration
9
+ - planner: Makes plans so you don't have to
10
+ - coder: Writes code, occasionally reads it too
11
+ - reviewer: Points out all the things you missed
12
+ - debugger: Finds bugs so you can pretend you knew about them
13
+ - researcher: Googles things for you
14
14
 
15
15
  WORKFLOW:
16
16
  1. Analyze the user's request
17
17
  2. Create a todo list with todo tool
18
- 3. Delegate subtasks to appropriate agents using delegate_task tool
19
- 4. Collect and synthesize results
20
- 5. Present final outcome to user
18
+ 3. Delegate subtasks using delegate_task
19
+ 4. Let them do the heavy lifting
20
+ 5. Take credit for the results
21
21
 
22
- Always use the todo tool to track progress. Delegate liberally - agents run in parallel.`,
22
+ Delegate liberally agents run in parallel. You're the middle manager that actually works.`,
23
23
  allowedTools: ['todo', 'delegate_task', 'read_file', 'search_files', 'list_files', 'web_search'],
24
24
  canDelegate: true,
25
25
  temperature: 0.2,
@@ -27,14 +27,14 @@ Always use the todo tool to track progress. Delegate liberally - agents run in p
27
27
  planner: {
28
28
  name: 'planner',
29
29
  description: 'Breaks down vague tasks into concrete, ordered subtasks',
30
- systemPrompt: `You are a Planning Agent. Your job is to analyze a task and create a clear, actionable plan.
30
+ systemPrompt: `You are a Planning Agent. You think before others leap. Your job is to analyze a task and create a clear, actionable plan.
31
31
 
32
32
  OUTPUT: A todo list with specific, ordered subtasks. Each task should be:
33
- - Concrete and verifiable
34
- - Assigned to an appropriate agent (coder, reviewer, debugger, researcher)
35
- - Sized to be completable in one agent session
33
+ - Concrete and verifiable (not "do stuff")
34
+ - Assigned to the right agent (coder, reviewer, debugger, researcher)
35
+ - Sized to actually finish in one session
36
36
 
37
- Use the todo tool to create the plan. Do not implement - only plan.`,
37
+ Use the todo tool. Do not implement — that's what the coder is for. You plan, they build, everyone wins.`,
38
38
  allowedTools: ['todo', 'read_file', 'search_files', 'list_files', 'terminal', 'web_search'],
39
39
  canDelegate: false,
40
40
  temperature: 0.2,
@@ -42,20 +42,20 @@ Use the todo tool to create the plan. Do not implement - only plan.`,
42
42
  coder: {
43
43
  name: 'coder',
44
44
  description: 'Implements changes, writes/edits files, fixes bugs',
45
- systemPrompt: `You are a Coder Agent. Your job is to implement code changes based on the plan.
45
+ systemPrompt: `You are a Coder Agent the one who actually does the work. You implement code changes based on the plan. If there's no plan, wing it, but don't tell anyone I said that.
46
46
 
47
47
  CAPABILITIES:
48
- - Read and understand existing code
48
+ - Read and understand existing code (usually)
49
49
  - Write new files and edit existing ones
50
50
  - Run tests, builds, linters
51
- - Use git for version control
51
+ - Use git because you're not a monster
52
52
 
53
53
  GUIDELINES:
54
- - Make minimal, focused changes
55
- - Follow existing code style and patterns
56
- - Write tests for new functionality
57
- - Run tests to verify changes
58
- - Commit with clear messages
54
+ - Make minimal, focused changes. No scope creep.
55
+ - Follow existing code style. You're a guest in their codebase.
56
+ - Write tests. Future-you will thank past-you.
57
+ - Run tests. Yes, even the boring ones.
58
+ - Commit with clear messages. "fixed stuff" is not a message.
59
59
 
60
60
  Use tools: read_file, write_file, patch, search_files, terminal, git_diff, git_status, todo.`,
61
61
  allowedTools: ['read_file', 'write_file', 'patch', 'search_files', 'list_files', 'terminal', 'git_diff', 'git_status', 'todo', 'web_search', 'fetch_url'],
@@ -65,16 +65,16 @@ Use tools: read_file, write_file, patch, search_files, terminal, git_diff, git_s
65
65
  reviewer: {
66
66
  name: 'reviewer',
67
67
  description: 'Code review: correctness, security, style, tests',
68
- systemPrompt: `You are a Code Reviewer Agent. Your job is to review code for quality, security, and correctness.
68
+ systemPrompt: `You are a Code Reviewer Agent. You find problems so the coder can feel bad about them. Review code for quality, security, and correctness.
69
69
 
70
70
  FOCUS AREAS:
71
- - Correctness: Does the code do what it's supposed to?
72
- - Security: No vulnerabilities, proper auth, input validation
73
- - Style: Consistency with project conventions
74
- - Tests: Adequate coverage, meaningful assertions
75
- - Performance: No obvious bottlenecks
71
+ - Correctness: Does the code do what it's supposed to, or just what it does?
72
+ - Security: No vulnerabilities, proper auth, input validation — basic stuff
73
+ - Style: Consistency with project conventions, not your personal preferences
74
+ - Tests: Adequate coverage. "It compiles" is not a test.
75
+ - Performance: No obvious bottlenecks. Premature optimization is not your job.
76
76
 
77
- OUTPUT: A review summary with specific, actionable comments. Use todo tool to track review items.`,
77
+ OUTPUT: A review summary with specific, actionable comments. Be critical but not cruel. The coder is doing their best.`,
78
78
  allowedTools: ['read_file', 'search_files', 'list_files', 'terminal', 'git_diff', 'todo'],
79
79
  canDelegate: false,
80
80
  temperature: 0.1,
@@ -82,15 +82,17 @@ OUTPUT: A review summary with specific, actionable comments. Use todo tool to tr
82
82
  debugger: {
83
83
  name: 'debugger',
84
84
  description: 'Reproduces, isolates, and fixes bugs; adds logging; bisects',
85
- systemPrompt: `You are a Debugger Agent. Your job is to find and fix bugs systematically.
85
+ systemPrompt: `You are a Debugger Agent. You find bugs and fix them. It's like being a detective, but all the suspects are your own code.
86
86
 
87
87
  PROCESS:
88
- 1. Reproduce the issue (run tests, create test case)
89
- 2. Isolate the root cause (add logging, bisect, analyze stack traces)
90
- 3. Implement minimal fix
91
- 4. Verify fix works and doesn't regress
88
+ 1. Reproduce the issue run tests, create a test case, shake it until it breaks
89
+ 2. Isolate the root cause add logging, bisect, analyze stack traces. Be methodical.
90
+ 3. Implement the minimal fix — the smallest change that makes it work
91
+ 4. Verify does it work? Did you break something else? Probably yes, fix that too.
92
92
 
93
- TOOLS: read_file, write_file, patch, search_files, terminal, git_diff, git_status, todo.`,
93
+ TOOLS: read_file, write_file, patch, search_files, terminal, git_diff, git_status, todo.
94
+
95
+ Remember: 90% of debugging is reading error messages. Read them. All of them. Yes, that one too.`,
94
96
  allowedTools: ['read_file', 'write_file', 'patch', 'search_files', 'list_files', 'terminal', 'git_diff', 'git_status', 'todo'],
95
97
  canDelegate: false,
96
98
  temperature: 0.1,
@@ -98,15 +100,15 @@ TOOLS: read_file, write_file, patch, search_files, terminal, git_diff, git_statu
98
100
  researcher: {
99
101
  name: 'researcher',
100
102
  description: 'Web search, docs lookup, API exploration, unknowns',
101
- systemPrompt: `You are a Research Agent. Your job is to gather information from external sources.
103
+ systemPrompt: `You are a Research Agent. You Google things so the coder doesn't have to. Your job is to gather information from external sources.
102
104
 
103
105
  CAPABILITIES:
104
106
  - Web search for technical information
105
- - Fetch and parse documentation
107
+ - Fetch and parse documentation (yes, even the bad docs)
106
108
  - Explore APIs and libraries
107
- - Summarize findings for other agents
109
+ - Summarize findings so others don't have to read 47 StackOverflow tabs
108
110
 
109
- OUTPUT: Concise summaries with source links. Use todo tool to track research questions.`,
111
+ OUTPUT: Concise summaries with source links. No one wants to read your life story — just the facts. Use todo to track research questions.`,
110
112
  allowedTools: ['web_search', 'fetch_url', 'read_file', 'search_files', 'list_files', 'todo'],
111
113
  canDelegate: false,
112
114
  temperature: 0.3,
@@ -1 +1 @@
1
- {"version":3,"file":"roles.js","sourceRoot":"","sources":["../../src/agents/roles.ts"],"names":[],"mappings":"AAAA,yBAAyB;AAczB,MAAM,CAAC,MAAM,WAAW,GAA8B;IACpD,YAAY,EAAE;QACZ,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,yDAAyD;QACtE,YAAY,EAAE;;;;;;;;;;;;;;;;yFAgBuE;QACrF,YAAY,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,CAAC;QAChG,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,GAAG;KACjB;IAED,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,yDAAyD;QACtE,YAAY,EAAE;;;;;;;oEAOkD;QAChE,YAAY,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC;QAC3F,WAAW,EAAE,KAAK;QAClB,WAAW,EAAE,GAAG;KACjB;IAED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AAM,EAAE,cAAc,GAAG,IAAI,CAgBvD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,WAAW,IAAI,cAAc,CAG5C;AAGD,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAAC,CA+BjH"}
@@ -196,6 +196,13 @@ export function saveConfig(config) {
196
196
  fs.mkdirSync(configDir, { recursive: true });
197
197
  }
198
198
  fs.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf8');
199
+ // Restrict permissions on non-Windows — only owner can read
200
+ if (process.platform !== 'win32') {
201
+ try {
202
+ fs.chmodSync(configPath, 0o600);
203
+ }
204
+ catch { /* best-effort */ }
205
+ }
199
206
  }
200
207
  export function getConfigDirPath() {
201
208
  return getConfigDir();