dvalincode 0.12.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/LICENSE +22 -0
- package/README.md +649 -0
- package/README.zh-CN.md +623 -0
- package/THIRD_PARTY_NOTICES.md +432 -0
- package/dist/agent/compact.d.ts +4 -0
- package/dist/agent/compact.js +40 -0
- package/dist/agent/compact.js.map +1 -0
- package/dist/agent/loop.d.ts +44 -0
- package/dist/agent/loop.js +262 -0
- package/dist/agent/loop.js.map +1 -0
- package/dist/agent/modes.d.ts +13 -0
- package/dist/agent/modes.js +44 -0
- package/dist/agent/modes.js.map +1 -0
- package/dist/agent/runner.d.ts +37 -0
- package/dist/agent/runner.js +171 -0
- package/dist/agent/runner.js.map +1 -0
- package/dist/agent/session.d.ts +73 -0
- package/dist/agent/session.js +282 -0
- package/dist/agent/session.js.map +1 -0
- package/dist/agent/types.d.ts +86 -0
- package/dist/agent/types.js +26 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/audit/diffStat.d.ts +8 -0
- package/dist/audit/diffStat.js +17 -0
- package/dist/audit/diffStat.js.map +1 -0
- package/dist/audit/hash.d.ts +10 -0
- package/dist/audit/hash.js +33 -0
- package/dist/audit/hash.js.map +1 -0
- package/dist/audit/log.d.ts +147 -0
- package/dist/audit/log.js +163 -0
- package/dist/audit/log.js.map +1 -0
- package/dist/audit/minimize.d.ts +10 -0
- package/dist/audit/minimize.js +61 -0
- package/dist/audit/minimize.js.map +1 -0
- package/dist/audit/report.d.ts +8 -0
- package/dist/audit/report.js +113 -0
- package/dist/audit/report.js.map +1 -0
- package/dist/audit/taps.d.ts +8 -0
- package/dist/audit/taps.js +67 -0
- package/dist/audit/taps.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +56 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/ask.d.ts +3 -0
- package/dist/commands/ask.js +14 -0
- package/dist/commands/ask.js.map +1 -0
- package/dist/commands/chat.d.ts +3 -0
- package/dist/commands/chat.js +148 -0
- package/dist/commands/chat.js.map +1 -0
- package/dist/commands/data.d.ts +2 -0
- package/dist/commands/data.js +65 -0
- package/dist/commands/data.js.map +1 -0
- package/dist/commands/evidence.d.ts +2 -0
- package/dist/commands/evidence.js +50 -0
- package/dist/commands/evidence.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.js +18 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/memory.d.ts +2 -0
- package/dist/commands/memory.js +74 -0
- package/dist/commands/memory.js.map +1 -0
- package/dist/commands/policy.d.ts +2 -0
- package/dist/commands/policy.js +95 -0
- package/dist/commands/policy.js.map +1 -0
- package/dist/commands/provider.d.ts +2 -0
- package/dist/commands/provider.js +130 -0
- package/dist/commands/provider.js.map +1 -0
- package/dist/commands/report.d.ts +2 -0
- package/dist/commands/report.js +47 -0
- package/dist/commands/report.js.map +1 -0
- package/dist/commands/runTool.d.ts +3 -0
- package/dist/commands/runTool.js +41 -0
- package/dist/commands/runTool.js.map +1 -0
- package/dist/commands/scan.d.ts +2 -0
- package/dist/commands/scan.js +15 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/commands/serve.d.ts +2 -0
- package/dist/commands/serve.js +18 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/tools.d.ts +3 -0
- package/dist/commands/tools.js +11 -0
- package/dist/commands/tools.js.map +1 -0
- package/dist/commands/trust.d.ts +2 -0
- package/dist/commands/trust.js +16 -0
- package/dist/commands/trust.js.map +1 -0
- package/dist/commands/tui.d.ts +2 -0
- package/dist/commands/tui.js +13 -0
- package/dist/commands/tui.js.map +1 -0
- package/dist/core/context.d.ts +28 -0
- package/dist/core/context.js +29 -0
- package/dist/core/context.js.map +1 -0
- package/dist/core/diffPreview.d.ts +6 -0
- package/dist/core/diffPreview.js +37 -0
- package/dist/core/diffPreview.js.map +1 -0
- package/dist/core/ignorefile.d.ts +1 -0
- package/dist/core/ignorefile.js +14 -0
- package/dist/core/ignorefile.js.map +1 -0
- package/dist/core/permissions.d.ts +3 -0
- package/dist/core/permissions.js +9 -0
- package/dist/core/permissions.js.map +1 -0
- package/dist/core/policy.d.ts +182 -0
- package/dist/core/policy.js +358 -0
- package/dist/core/policy.js.map +1 -0
- package/dist/core/projectScanner.d.ts +12 -0
- package/dist/core/projectScanner.js +85 -0
- package/dist/core/projectScanner.js.map +1 -0
- package/dist/core/subprocessSandbox.d.ts +42 -0
- package/dist/core/subprocessSandbox.js +132 -0
- package/dist/core/subprocessSandbox.js.map +1 -0
- package/dist/core/trust.d.ts +50 -0
- package/dist/core/trust.js +191 -0
- package/dist/core/trust.js.map +1 -0
- package/dist/core/workspace.d.ts +9 -0
- package/dist/core/workspace.js +55 -0
- package/dist/core/workspace.js.map +1 -0
- package/dist/data/archive.d.ts +39 -0
- package/dist/data/archive.js +127 -0
- package/dist/data/archive.js.map +1 -0
- package/dist/evidence/compliance.d.ts +22 -0
- package/dist/evidence/compliance.js +57 -0
- package/dist/evidence/compliance.js.map +1 -0
- package/dist/evidence/pack.d.ts +56 -0
- package/dist/evidence/pack.js +123 -0
- package/dist/evidence/pack.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/client.d.ts +45 -0
- package/dist/mcp/client.js +111 -0
- package/dist/mcp/client.js.map +1 -0
- package/dist/mcp/config.d.ts +10 -0
- package/dist/mcp/config.js +18 -0
- package/dist/mcp/config.js.map +1 -0
- package/dist/mcp/governedFetch.d.ts +16 -0
- package/dist/mcp/governedFetch.js +44 -0
- package/dist/mcp/governedFetch.js.map +1 -0
- package/dist/mcp/register.d.ts +26 -0
- package/dist/mcp/register.js +77 -0
- package/dist/mcp/register.js.map +1 -0
- package/dist/memory/importers.d.ts +17 -0
- package/dist/memory/importers.js +186 -0
- package/dist/memory/importers.js.map +1 -0
- package/dist/memory/store.d.ts +71 -0
- package/dist/memory/store.js +251 -0
- package/dist/memory/store.js.map +1 -0
- package/dist/providers/egress.d.ts +2 -0
- package/dist/providers/egress.js +172 -0
- package/dist/providers/egress.js.map +1 -0
- package/dist/providers/localPlanner.d.ts +3 -0
- package/dist/providers/localPlanner.js +21 -0
- package/dist/providers/localPlanner.js.map +1 -0
- package/dist/providers/manager.d.ts +30 -0
- package/dist/providers/manager.js +48 -0
- package/dist/providers/manager.js.map +1 -0
- package/dist/providers/openaiCompatible.d.ts +5 -0
- package/dist/providers/openaiCompatible.js +176 -0
- package/dist/providers/openaiCompatible.js.map +1 -0
- package/dist/providers/pool.d.ts +14 -0
- package/dist/providers/pool.js +59 -0
- package/dist/providers/pool.js.map +1 -0
- package/dist/providers/secrets.d.ts +8 -0
- package/dist/providers/secrets.js +17 -0
- package/dist/providers/secrets.js.map +1 -0
- package/dist/providers/trustedBaseUrls.d.ts +1 -0
- package/dist/providers/trustedBaseUrls.js +49 -0
- package/dist/providers/trustedBaseUrls.js.map +1 -0
- package/dist/providers/types.d.ts +59 -0
- package/dist/providers/types.js +2 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/remediation/cases.d.ts +37 -0
- package/dist/remediation/cases.js +90 -0
- package/dist/remediation/cases.js.map +1 -0
- package/dist/remediation/localScan.d.ts +2 -0
- package/dist/remediation/localScan.js +212 -0
- package/dist/remediation/localScan.js.map +1 -0
- package/dist/remediation/sarif.d.ts +26 -0
- package/dist/remediation/sarif.js +150 -0
- package/dist/remediation/sarif.js.map +1 -0
- package/dist/remediation/worktree.d.ts +11 -0
- package/dist/remediation/worktree.js +90 -0
- package/dist/remediation/worktree.js.map +1 -0
- package/dist/server/configStore.d.ts +59 -0
- package/dist/server/configStore.js +73 -0
- package/dist/server/configStore.js.map +1 -0
- package/dist/server/index.d.ts +17 -0
- package/dist/server/index.js +120 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/playbookHandler.d.ts +3 -0
- package/dist/server/playbookHandler.js +44 -0
- package/dist/server/playbookHandler.js.map +1 -0
- package/dist/server/routes/config.d.ts +1 -0
- package/dist/server/routes/config.js +184 -0
- package/dist/server/routes/config.js.map +1 -0
- package/dist/server/routes/data.d.ts +1 -0
- package/dist/server/routes/data.js +29 -0
- package/dist/server/routes/data.js.map +1 -0
- package/dist/server/routes/files.d.ts +1 -0
- package/dist/server/routes/files.js +20 -0
- package/dist/server/routes/files.js.map +1 -0
- package/dist/server/routes/git.d.ts +1 -0
- package/dist/server/routes/git.js +29 -0
- package/dist/server/routes/git.js.map +1 -0
- package/dist/server/routes/projects.d.ts +3 -0
- package/dist/server/routes/projects.js +178 -0
- package/dist/server/routes/projects.js.map +1 -0
- package/dist/server/routes/remediation.d.ts +1 -0
- package/dist/server/routes/remediation.js +99 -0
- package/dist/server/routes/remediation.js.map +1 -0
- package/dist/server/routes/sessions.d.ts +1 -0
- package/dist/server/routes/sessions.js +46 -0
- package/dist/server/routes/sessions.js.map +1 -0
- package/dist/server/routes/skills.d.ts +1 -0
- package/dist/server/routes/skills.js +48 -0
- package/dist/server/routes/skills.js.map +1 -0
- package/dist/server/routes/tools.d.ts +1 -0
- package/dist/server/routes/tools.js +12 -0
- package/dist/server/routes/tools.js.map +1 -0
- package/dist/server/security.d.ts +7 -0
- package/dist/server/security.js +128 -0
- package/dist/server/security.js.map +1 -0
- package/dist/server/wsHandler.d.ts +2 -0
- package/dist/server/wsHandler.js +212 -0
- package/dist/server/wsHandler.js.map +1 -0
- package/dist/sessions/journal.d.ts +65 -0
- package/dist/sessions/journal.js +98 -0
- package/dist/sessions/journal.js.map +1 -0
- package/dist/sessions/markdown.d.ts +8 -0
- package/dist/sessions/markdown.js +69 -0
- package/dist/sessions/markdown.js.map +1 -0
- package/dist/sessions/store.d.ts +26 -0
- package/dist/sessions/store.js +136 -0
- package/dist/sessions/store.js.map +1 -0
- package/dist/skills/store.d.ts +24 -0
- package/dist/skills/store.js +215 -0
- package/dist/skills/store.js.map +1 -0
- package/dist/tools/deleteFile.d.ts +8 -0
- package/dist/tools/deleteFile.js +37 -0
- package/dist/tools/deleteFile.js.map +1 -0
- package/dist/tools/editFile.d.ts +10 -0
- package/dist/tools/editFile.js +66 -0
- package/dist/tools/editFile.js.map +1 -0
- package/dist/tools/gitDiff.d.ts +10 -0
- package/dist/tools/gitDiff.js +59 -0
- package/dist/tools/gitDiff.js.map +1 -0
- package/dist/tools/gitStatus.d.ts +5 -0
- package/dist/tools/gitStatus.js +45 -0
- package/dist/tools/gitStatus.js.map +1 -0
- package/dist/tools/listFiles.d.ts +9 -0
- package/dist/tools/listFiles.js +36 -0
- package/dist/tools/listFiles.js.map +1 -0
- package/dist/tools/listRemediationCases.d.ts +8 -0
- package/dist/tools/listRemediationCases.js +23 -0
- package/dist/tools/listRemediationCases.js.map +1 -0
- package/dist/tools/listSkills.d.ts +6 -0
- package/dist/tools/listSkills.js +21 -0
- package/dist/tools/listSkills.js.map +1 -0
- package/dist/tools/memoryDelete.d.ts +8 -0
- package/dist/tools/memoryDelete.js +24 -0
- package/dist/tools/memoryDelete.js.map +1 -0
- package/dist/tools/memoryImport.d.ts +18 -0
- package/dist/tools/memoryImport.js +64 -0
- package/dist/tools/memoryImport.js.map +1 -0
- package/dist/tools/memorySearch.d.ts +13 -0
- package/dist/tools/memorySearch.js +40 -0
- package/dist/tools/memorySearch.js.map +1 -0
- package/dist/tools/memoryUpdate.d.ts +19 -0
- package/dist/tools/memoryUpdate.js +38 -0
- package/dist/tools/memoryUpdate.js.map +1 -0
- package/dist/tools/memoryWrite.d.ts +22 -0
- package/dist/tools/memoryWrite.js +36 -0
- package/dist/tools/memoryWrite.js.map +1 -0
- package/dist/tools/prepareRemediationWorktree.d.ts +8 -0
- package/dist/tools/prepareRemediationWorktree.js +48 -0
- package/dist/tools/prepareRemediationWorktree.js.map +1 -0
- package/dist/tools/projectScripts.d.ts +11 -0
- package/dist/tools/projectScripts.js +64 -0
- package/dist/tools/projectScripts.js.map +1 -0
- package/dist/tools/readFile.d.ts +10 -0
- package/dist/tools/readFile.js +57 -0
- package/dist/tools/readFile.js.map +1 -0
- package/dist/tools/readSkill.d.ts +8 -0
- package/dist/tools/readSkill.js +25 -0
- package/dist/tools/readSkill.js.map +1 -0
- package/dist/tools/registry.d.ts +15 -0
- package/dist/tools/registry.js +121 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/runCheck.d.ts +17 -0
- package/dist/tools/runCheck.js +125 -0
- package/dist/tools/runCheck.js.map +1 -0
- package/dist/tools/runSecurityScan.d.ts +8 -0
- package/dist/tools/runSecurityScan.js +36 -0
- package/dist/tools/runSecurityScan.js.map +1 -0
- package/dist/tools/searchText.d.ts +11 -0
- package/dist/tools/searchText.js +67 -0
- package/dist/tools/searchText.js.map +1 -0
- package/dist/tools/shell.d.ts +16 -0
- package/dist/tools/shell.js +114 -0
- package/dist/tools/shell.js.map +1 -0
- package/dist/tools/types.d.ts +57 -0
- package/dist/tools/types.js +2 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/tools/writeFile.d.ts +9 -0
- package/dist/tools/writeFile.js +89 -0
- package/dist/tools/writeFile.js.map +1 -0
- package/dist/tui/app.d.ts +8 -0
- package/dist/tui/app.js +178 -0
- package/dist/tui/app.js.map +1 -0
- package/dist/tui/presets.d.ts +13 -0
- package/dist/tui/presets.js +11 -0
- package/dist/tui/presets.js.map +1 -0
- package/dist/tui/render.d.ts +14 -0
- package/dist/tui/render.js +83 -0
- package/dist/tui/render.js.map +1 -0
- package/dist/ui/output.d.ts +4 -0
- package/dist/ui/output.js +21 -0
- package/dist/ui/output.js.map +1 -0
- package/package.json +77 -0
package/README.md
ADDED
|
@@ -0,0 +1,649 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/logo.png" alt="DvalinCode" width="480">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<b>English</b> · <a href="README.zh-CN.md">中文</a> · <a href="https://dvalincode.dev">🌐 dvalincode.dev</a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://github.com/arthurpanhku/dvalincode/releases/latest"><img src="https://img.shields.io/github/v/release/arthurpanhku/dvalincode?style=for-the-badge&color=818cf8&label=Release" alt="Release"></a>
|
|
11
|
+
<a href="https://github.com/arthurpanhku/dvalincode/releases"><img src="https://img.shields.io/github/downloads/arthurpanhku/dvalincode/total?style=for-the-badge&color=blue&label=Downloads" alt="Downloads"></a>
|
|
12
|
+
<a href="#-tests"><img src="https://img.shields.io/badge/Tests-203%20%2F%20203%20%E2%9C%93-success?style=for-the-badge" alt="Tests"></a>
|
|
13
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-green?style=for-the-badge" alt="License"></a>
|
|
14
|
+
<a href="https://scorecard.dev/viewer/?uri=github.com/arthurpanhku/dvalincode"><img src="https://api.scorecard.dev/projects/github.com/arthurpanhku/dvalincode/badge" alt="OpenSSF Scorecard"></a>
|
|
15
|
+
<a href="docs/governance/ISO-42001-AIMS.md"><img src="https://img.shields.io/badge/ISO%2FIEC%2042001-AIMS%20Aligned-0F766E?style=for-the-badge" alt="ISO/IEC 42001 AIMS aligned"></a>
|
|
16
|
+
<a href="docs/EVIDENCE-PACK.md"><img src="https://img.shields.io/badge/Compliance-Evidence%20Pack-2563EB?style=for-the-badge" alt="Compliance evidence pack"></a>
|
|
17
|
+
<a href="docs/security/OPENSSF-SCORECARD.md"><img src="https://img.shields.io/badge/DevSecOps-Native-B91C1C?style=for-the-badge" alt="DevSecOps native"></a>
|
|
18
|
+
<a href="#-quick-install"><img src="https://img.shields.io/badge/Platforms-macOS%20·%20Windows%20·%20Linux-blue?style=for-the-badge" alt="Platforms"></a>
|
|
19
|
+
<a href="#-providers"><img src="https://img.shields.io/badge/LLM-OpenAI%20·%20Claude%20·%20DeepSeek%20·%20Ollama%20·%20Groq-7C3AED?style=for-the-badge" alt="LLM Support"></a>
|
|
20
|
+
<a href="README.zh-CN.md"><img src="https://img.shields.io/badge/i18n-EN%20·%20中文-orange?style=for-the-badge" alt="English / 中文"></a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<b>The approvable coding agent for regulated teams.</b><br>
|
|
25
|
+
<b>Built for finance, healthcare, and security-sensitive engineering where AI coding must be controllable, transparent, and auditable.</b>
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
<p align="center">
|
|
29
|
+
<b>🔑 Any model · local-first · policy-bound · audit-ready — the agent your security team can actually approve.</b>
|
|
30
|
+
</p>
|
|
31
|
+
|
|
32
|
+
<p align="center">
|
|
33
|
+
Bring your own model — DeepSeek, OpenAI, Claude (via OpenRouter), Groq, Ollama, or any OpenAI-compatible endpoint. Switch with one click, no code changes, no lock-in.
|
|
34
|
+
</p>
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## ⏱️ 60 seconds to proof
|
|
39
|
+
|
|
40
|
+
Don't take the claims on trust — verify them on your own machine:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
curl -fsSL https://raw.githubusercontent.com/arthurpanhku/dvalincode/main/scripts/install.sh | bash
|
|
44
|
+
dvalincode trust
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`trust` prints this install's **live security posture**: the resolved org policy and its hash, per-boundary network enforcement (provider · shell · MCP), and the tamper-evident audit status — the exact evidence a security reviewer needs, straight from the tool itself.
|
|
48
|
+
|
|
49
|
+
<p align="center">
|
|
50
|
+
<img src="assets/cli-trust.gif" alt="dvalincode trust — live security posture under an org policy" width="100%">
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
Then let the agent work, and prove what it did after the fact:
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
dvalincode report verify # re-derive the hash chain of the last run's audit log
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
<table>
|
|
62
|
+
<tr><td><b>🗨️ Chat mode</b></td><td>Read-only Q&A with one-click prompt templates — explain a codebase, find TODOs, review changes, write tests. The agent can read files and search, but never writes.</td></tr>
|
|
63
|
+
<tr><td><b>👥 Cowork mode</b></td><td>Plan-then-execute. The agent drafts a numbered plan, you click <b>Proceed</b>, and every file write asks for explicit approval — with an inline red/green diff before you say yes.</td></tr>
|
|
64
|
+
<tr><td><b>⚡ Code mode</b></td><td>Autonomous agent with full tool access. Run tests, type-check, build, lint — one click via the <b>Routines</b> panel. macOS shell calls run inside a <code>sandbox-exec</code> profile with network denied.</td></tr>
|
|
65
|
+
<tr><td><b>🏦 Regulated teams</b></td><td>Designed for finance, healthcare, security-sensitive SaaS, and internal platform teams that need AI coding under policy, audit, data minimization, and supply-chain review — not just developer convenience.</td></tr>
|
|
66
|
+
<tr><td><b>🛡️ Secure remediation</b></td><td>Run a local security scan or import SARIF from CodeQL, GitHub Code Scanning, Semgrep, or compatible scanners, then create an isolated remediation worktree and turn findings into focused repair tasks with source context and PR-ready reporting. <a href="docs/SECURE-REMEDIATION.md">Workflow →</a></td></tr>
|
|
67
|
+
<tr><td><b>📚 Skills</b></td><td>Upload, download, and inspect local skill bundles. DvalinCode ships built-in secure-code-scan and secure-code-remediation skills, plus agent tools for listing skills, reading skill instructions, scanning, listing cases, and preparing remediation worktrees. <a href="docs/SKILLS.md">Format →</a></td></tr>
|
|
68
|
+
<tr><td><b>🛡️ Audit trail</b></td><td>Every run emits a tamper-evident, hash-chained JSONL log — every file read/written, every command, every approval. A Run Report renders it as Markdown; <code>dvalincode report verify</code> proves the chain is intact. <a href="docs/AUDIT-TRAIL.md">Threat model →</a></td></tr>
|
|
69
|
+
<tr><td><b>🔒 Org policy & <code>trust</code></b></td><td>A company — not the developer — bounds the agent. A <code>dvalin.policy.json</code> constrains modes, shell commands, file paths, tools, and models; a repo policy can only ever <i>narrow</i> the machine-level one, never widen it. Each run records the governing policy's hash. <code>dvalincode trust</code> prints the install's live security posture — active policy + hashes, audit status, runtime — so a reviewer can verify it directly. <a href="docs/POLICY-REFERENCE.md">Policy reference →</a> · <a href="docs/APPROVABILITY-PLAN.md">Approvability plan →</a></td></tr>
|
|
70
|
+
<tr><td><b>🏛️ Governance evidence</b></td><td>OpenSSF Scorecard, CodeQL, Dependabot, pinned GitHub Actions, CODEOWNERS, and ISO/IEC 42001 AIMS alignment docs are maintained as reviewable project evidence. <a href="docs/security/OPENSSF-SCORECARD.md">Scorecard map →</a> · <a href="docs/governance/ISO-42001-AIMS.md">ISO 42001 alignment →</a></td></tr>
|
|
71
|
+
<tr><td><b>🖥️ First-class GUI</b></td><td>Modern web UI with code highlighting, file <code>@</code>-references, <code>/</code> slash commands, Git branch indicator, live token + cost counter, multi-profile LLM config, and a dark / light / system theme switcher.</td></tr>
|
|
72
|
+
<tr><td><b>🖥️ Terminal or web — one binary</b></td><td>Run it bare for an interactive <b>terminal agent</b> with streaming output, inline approvals, and red/green diffs, or <code>dvalincode serve</code> to host the <b>web GUI</b> for browser/remote use. Both frontends drive the same agent core.</td></tr>
|
|
73
|
+
<tr><td><b>🪶 Zero-dependency binary</b></td><td>Single ~25MB executable per platform. No Node, no Python, no Docker.</td></tr>
|
|
74
|
+
<tr><td><b>🔐 Local-first</b></td><td>Sessions, config, profiles, and audit logs live in <code>~/.dvalincode/</code>. <code>.dvalincodeignore</code> blocks the agent from reading sensitive files. <code>AGENTS.md</code> in your repo becomes persistent project instructions.</td></tr>
|
|
75
|
+
<tr><td><b>💾 Portable & exportable</b></td><td>Export <b>all</b> local data (memory, sessions, config, audit) to one file and import it on another machine — your setup moves with you. Any conversation downloads as a clean <b>Markdown</b> transcript.</td></tr>
|
|
76
|
+
</table>
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 🎯 Core Goal
|
|
81
|
+
|
|
82
|
+
> **Make AI coding approvable for regulated and security-sensitive teams.**
|
|
83
|
+
|
|
84
|
+
DvalinCode is built as an **approvable agent runtime**, not just another coding
|
|
85
|
+
agent app. The core product is not only "AI writes code"; it is the evidence a
|
|
86
|
+
security, compliance, or platform team needs to safely allow AI coding in
|
|
87
|
+
financial services, healthcare, internal enterprise platforms, and other
|
|
88
|
+
confidential codebases.
|
|
89
|
+
|
|
90
|
+
- **Any model** — every OpenAI-compatible endpoint is a first-class citizen, local models included. Your workflow should never be hostage to one vendor's pricing, rate limits, or quality swings.
|
|
91
|
+
- **Safe by default** — three-tier approvals with diff preview, an undo stack, and sandboxed shell execution. An agent you can trust on full-auto.
|
|
92
|
+
- **Small enough to audit** — one ~25MB binary, a handful of runtime dependencies, a codebase you can read in a weekend. Trust through inspection, not promises. As of v0.5, **every agent run is auditable too**: a tamper-evident, hash-chained log of every action, verifiable after the fact.
|
|
93
|
+
- **Open enough to embed** — the agent core speaks a clean REST + WebSocket API, ready to be wired into your own product, CI, or internal tools.
|
|
94
|
+
- **Approvable by any company** — governance is built in, not bolted on. An org policy bounds the blast radius (**controllable**), `dvalincode trust` makes the posture self-verifiable (**transparent**), and the hash-chained log proves what every run did (**auditable**). Those three together are exactly what a security review needs to say yes — and what cloud, closed, mutable-log agents structurally struggle to provide. [Approvability plan →](docs/APPROVABILITY-PLAN.md)
|
|
95
|
+
|
|
96
|
+
The bundled **web GUI is the runtime's reference implementation and showcase** — the first consumer of that public API, demonstrating everything the runtime can do.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## ✅ Why Teams Pick DvalinCode
|
|
101
|
+
|
|
102
|
+
DvalinCode is differentiated by **approvability**. It is built for teams that
|
|
103
|
+
need AI coding to pass security, compliance, and data-governance review before
|
|
104
|
+
it can touch production repositories.
|
|
105
|
+
|
|
106
|
+
- **Closed-loop secure remediation** — scan locally or import SARIF from
|
|
107
|
+
CodeQL, GitHub Code Scanning, Semgrep, or compatible scanners; persist
|
|
108
|
+
findings as local remediation cases; create an isolated
|
|
109
|
+
`dvalin/remediate/...` worktree; then send a focused repair prompt with
|
|
110
|
+
source context and verification instructions.
|
|
111
|
+
- **Skills as governed operating procedures** — upload, download, and inspect
|
|
112
|
+
local skill bundles. Built-in secure scanning and remediation skills tell
|
|
113
|
+
agents which tools to use and keep workflows portable across machines.
|
|
114
|
+
- **Model freedom without policy drift** — use DeepSeek, OpenAI, Claude via
|
|
115
|
+
OpenRouter, Groq, Ollama, or any OpenAI-compatible endpoint while keeping
|
|
116
|
+
tool permissions, audit, and workspace policy consistent.
|
|
117
|
+
- **Security evidence, not just security claims** — OpenSSF Scorecard support,
|
|
118
|
+
CodeQL, Dependabot, pinned Actions, CODEOWNERS, ISO/IEC 42001 alignment docs,
|
|
119
|
+
AI change-impact records, and hash-chained run logs are part of the project.
|
|
120
|
+
- **Local-first by default** — sessions, config, profiles, memory, and audit
|
|
121
|
+
logs stay under `~/.dvalincode/`; `.dvalincodeignore` and policy controls
|
|
122
|
+
bound what the agent can read, write, or execute.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 🛡️ Security & Governance
|
|
127
|
+
|
|
128
|
+
DvalinCode maintains project-level governance evidence for open-source and
|
|
129
|
+
enterprise review. This is the differentiator for teams where AI coding must
|
|
130
|
+
pass security approval before it can reach production repositories:
|
|
131
|
+
|
|
132
|
+
- **Threat model** — the full attack surface of an agentic coding runtime
|
|
133
|
+
(malicious `AGENTS.md`, poisoned MCP servers, prompt-injection escalation,
|
|
134
|
+
egress, audit tampering, supply chain, sandbox escape), each mapped to the
|
|
135
|
+
control that defends it and the honest residual gap. [Threat model →](docs/THREAT-MODEL.md)
|
|
136
|
+
- **OpenSSF Scorecard support** — scheduled Scorecard workflow, SARIF upload,
|
|
137
|
+
CodeQL, Dependabot, CODEOWNERS, least-privilege workflow permissions, and
|
|
138
|
+
SHA-pinned GitHub Actions. [Control map →](docs/security/OPENSSF-SCORECARD.md)
|
|
139
|
+
- **ISO/IEC 42001 alignment** — an AI management system scope, AI policy, role
|
|
140
|
+
map, risk register, AI change classification, required records, and review
|
|
141
|
+
cadence. [AIMS alignment →](docs/governance/ISO-42001-AIMS.md)
|
|
142
|
+
- **AI change impact assessment** — a reusable template for changes that affect
|
|
143
|
+
model/provider behavior, prompts, permissions, tools, audit logs, or release
|
|
144
|
+
security. [Template →](docs/governance/AI-CHANGE-IMPACT-ASSESSMENT.md)
|
|
145
|
+
- **Regulated-use posture** — local-first data handling, policy-controlled
|
|
146
|
+
autonomy, minimized audit records, and release supply-chain evidence for
|
|
147
|
+
finance, healthcare, security-sensitive SaaS, and internal enterprise use.
|
|
148
|
+
- **Secure remediation workflow** — local scan and SARIF import turn built-in,
|
|
149
|
+
CodeQL, GitHub Code Scanning, Semgrep, and compatible scanner findings into
|
|
150
|
+
local remediation cases and isolated worktree repair tasks with source
|
|
151
|
+
context and verification/reporting instructions.
|
|
152
|
+
[Workflow →](docs/SECURE-REMEDIATION.md)
|
|
153
|
+
|
|
154
|
+
These documents are implementation evidence and operating procedures; they do
|
|
155
|
+
not claim third-party ISO certification.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## ⭐ What's New in v0.9.0 — 🛡️ Secure remediation · Skills · CodeQL hardening
|
|
160
|
+
|
|
161
|
+
- **🛡️ Secure remediation workflow** — run a built-in local scan or import SARIF
|
|
162
|
+
from CodeQL, GitHub Code Scanning, Semgrep, and compatible scanners; findings
|
|
163
|
+
become local remediation cases with source context, verification guidance, and
|
|
164
|
+
isolated worktree repair tasks.
|
|
165
|
+
- **📚 Skills** — upload, download, inspect, and reuse local skill bundles.
|
|
166
|
+
DvalinCode now ships built-in secure-code-scan and secure-code-remediation
|
|
167
|
+
skills, plus agent tools for listing skills, reading instructions, scanning,
|
|
168
|
+
listing remediation cases, and preparing remediation worktrees.
|
|
169
|
+
- **🔐 CodeQL path hardening** — user-controlled workspace, remediation, and
|
|
170
|
+
skill paths now go through explicit root-containment checks, with regression
|
|
171
|
+
tests covering traversal-safe resolution and skill import boundaries.
|
|
172
|
+
- **🎨 App icons** — dark and light theme application icons now ship with the web
|
|
173
|
+
bundle and desktop build inputs.
|
|
174
|
+
|
|
175
|
+
<details>
|
|
176
|
+
<summary>v0.8.0 — 🔒 Governance: controllable · transparent · auditable</summary>
|
|
177
|
+
|
|
178
|
+
- **🔒 Org policy** — a `dvalin.policy.json` lets a *company*, not the developer, bound the agent: which modes, shell commands, file paths, tools, and models are allowed. Two layers (machine `~/.dvalincode/policy.json` + repo) resolve by **narrowing** — a repo policy can only ever make the machine policy stricter, never widen it. With no policy file, behavior is identical to before. Enforced at a single chokepoint; every denial is an inline `⛔ Blocked by policy` plus a `policy_violation` audit event. [Policy reference →](docs/POLICY-REFERENCE.md)
|
|
179
|
+
- **🔎 `dvalincode trust`** — prints this install's live security posture in one command — active policy + source hashes, audit status, runtime, dependencies — so a reviewer can verify what the agent may and may not do directly, instead of taking claims on trust. `--json` for tooling.
|
|
180
|
+
- **`dvalincode policy check`** — validates `dvalin.policy.json` against the schema, prints the resolved policy + canonical hash (after narrowing with the machine layer), and exits non-zero on failure — for CI and policy authoring. [Policy reference →](docs/POLICY-REFERENCE.md)
|
|
181
|
+
- **🧾 Policy-aware audit** — every run records the hash of the governing policy (and which files contributed) in `run_start`, so the tamper-evident log proves *which* rules were in force.
|
|
182
|
+
- **📐 Approvability plan** — the through-line is documented in [docs/APPROVABILITY-PLAN.md](docs/APPROVABILITY-PLAN.md): make DvalinCode trivially approvable by any company — controllable, transparent, auditable.
|
|
183
|
+
|
|
184
|
+
</details>
|
|
185
|
+
|
|
186
|
+
<details>
|
|
187
|
+
<summary>v0.7.0 — 🧪 Desktop app (beta)</summary>
|
|
188
|
+
|
|
189
|
+
- **🧠 Portable memory & full data export/import** — the upgraded local memory mechanism, plus every session, config, profile, and audit log, can now be bundled into a single file and restored on another machine. Migrate your whole setup in one step: `dvalincode export` / `dvalincode import`, or the **Export / Import** buttons in the GUI Settings panel.
|
|
190
|
+
- **📝 Download any AI interaction as Markdown** — every conversation can be saved as a clean Markdown transcript (user turns, assistant replies, tool calls + results, decisions — all inline). Use the download icon on any session in the sidebar, `dvalincode session md <id>`, or `GET /api/sessions/:id/markdown`.
|
|
191
|
+
- **🖥️ Native desktop app** — a real application window (not a browser tab) over the same engine: `DvalinCode.app` on macOS, plus Windows/Linux builds. Built with [webview-bun](https://github.com/tr1ckydev/webview-bun) using the OS-native webview (WKWebView / WebView2 / WebKitGTK) — no Electron, stays a small self-contained binary.
|
|
192
|
+
- **🧩 A third frontend, one core** — the desktop app, terminal UI, and web GUI all drive the same shared turn-runner. The current `dvalincode` binary is now positioned purely as the **CLI** (terminal + `serve`).
|
|
193
|
+
- **Status:** the desktop binaries are **experimental / unverified** — grab them from the latest **pre-release** and please report how the window behaves on your OS.
|
|
194
|
+
|
|
195
|
+
</details>
|
|
196
|
+
|
|
197
|
+
<details>
|
|
198
|
+
<summary>v0.6.0 — terminal agent · <code>serve</code> · shared turn-runner</summary>
|
|
199
|
+
|
|
200
|
+
- **🖥️ Terminal agent** — run `dvalincode` bare for an interactive terminal coding agent, Claude-Code-style: streaming responses, inline `[y/N]` write approvals with red/green diffs, `/mode` · `/clear` · `/git` · `/plan` · `/compact` · `/undo` · `/help`, Ctrl-C to interrupt, and a guided first-run provider setup. Defaults to read-only **Chat**, switchable live.
|
|
201
|
+
- **🌐 `dvalincode serve`** — the web GUI now lives behind a command, so the *same* binary deploys headless on a server: `dvalincode serve --host 0.0.0.0 --no-open`.
|
|
202
|
+
- **🧩 One engine, two frontends** — the terminal UI and web GUI both drive a shared, transport-agnostic turn-runner (`src/agent/session.ts`), keeping them at feature parity.
|
|
203
|
+
|
|
204
|
+
</details>
|
|
205
|
+
|
|
206
|
+
<details>
|
|
207
|
+
<summary>v0.5.0 — security-grade audit trail · Run Report · theme switcher</summary>
|
|
208
|
+
|
|
209
|
+
- **🛡️ Security-grade audit trail** — every Cowork/Code run writes a tamper-evident, hash-chained JSONL log to `~/.dvalincode/audit/` (`run_start`, every `tool_call` / `file_*` / `shell_exec` / `approval`, `run_end`). The hash chain makes any after-the-fact edit detectable. No local coding agent ships verifiable behavior logs. [Format + threat model →](docs/AUDIT-TRAIL.md)
|
|
210
|
+
- **📋 Run Report + `dvalincode report` CLI** — a Markdown summary of each run (files read/changed, commands, decisions, test result), rendered as a collapsible card in the GUI and from the CLI:
|
|
211
|
+
```sh
|
|
212
|
+
dvalincode report --last # render the most recent run
|
|
213
|
+
dvalincode report <run-id> --format json
|
|
214
|
+
dvalincode report verify <run-id> # ✓ chain intact / ✗ broken at seq N
|
|
215
|
+
```
|
|
216
|
+
- **🎨 Theme switcher** — choose **dark / light / system** in Settings. `system` follows your OS live; the choice persists across sessions.
|
|
217
|
+
|
|
218
|
+
</details>
|
|
219
|
+
|
|
220
|
+
<details>
|
|
221
|
+
<summary>v0.4.0 — <code>/compact</code> · <code>dvalin.json</code> team playbook · self-contained binaries</summary>
|
|
222
|
+
|
|
223
|
+
- **`/compact`** — LLM-based context compaction: replaces conversation history with a structured five-section summary (Goal / Completed / Decisions / Current State / Pending). A divider in the chat thread shows the token reduction (e.g. `8,412 → 1,203 tokens −85%`).
|
|
224
|
+
- **`dvalin.json` team playbook** — commit a shared set of automation prompts to your repo. The sidebar loads them automatically and lets teammates run the same one-click routines without any manual setup. Export button converts your personal routines to `dvalin.json` in one click.
|
|
225
|
+
- **Self-contained binaries** — single ~25 MB executable per platform; no Node, no Python, no Docker. Auto-opens your browser on launch. Built with `bun --compile` so the web UI is bundled alongside the server binary.
|
|
226
|
+
|
|
227
|
+
</details>
|
|
228
|
+
|
|
229
|
+
<details>
|
|
230
|
+
<summary>v0.3.0 — Mode-aware sidebar · one-line installer · multi-profile LLM config</summary>
|
|
231
|
+
|
|
232
|
+
- **Mode-aware sidebar** — Chat shows quick-prompt **Templates**, Cowork shows a **Projects** folder tree, Code shows custom **Routines** (one-click commands like "Run tests" / "Git status" / "Type check"). Add your own routines from the sidebar — they persist in `localStorage`.
|
|
233
|
+
- **One-line installer** — `curl … | bash` auto-detects your OS + arch, drops the binary into `~/.dvalincode/`, and patches your `PATH`. No package manager dependencies.
|
|
234
|
+
- **Multi-profile LLM config** — save named (provider, model, API key) sets and switch in one click from the sidebar; live per-session cost counter in the topbar so you can compare providers on the fly.
|
|
235
|
+
|
|
236
|
+
</details>
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## 📸 Preview
|
|
241
|
+
|
|
242
|
+
<p align="center">
|
|
243
|
+
<img src="assets/hero.png" alt="DvalinCode UI" width="100%">
|
|
244
|
+
</p>
|
|
245
|
+
|
|
246
|
+
**Switching modes — each mode has its own sidebar:**
|
|
247
|
+
|
|
248
|
+
<p align="center">
|
|
249
|
+
<img src="assets/modes.gif" alt="Mode switching" width="100%">
|
|
250
|
+
</p>
|
|
251
|
+
|
|
252
|
+
**Slash commands & file references in the composer:**
|
|
253
|
+
|
|
254
|
+
<p align="center">
|
|
255
|
+
<img src="assets/slash.gif" alt="Slash commands and @ file references" width="100%">
|
|
256
|
+
</p>
|
|
257
|
+
|
|
258
|
+
### 🔒 Governance, from the command line
|
|
259
|
+
|
|
260
|
+
**`dvalincode trust` — the install's live security posture (resolved policy, per-boundary enforcement, audit status) that a security review can read directly.** Field semantics and copy-paste recipes: [docs/POLICY-REFERENCE.md](docs/POLICY-REFERENCE.md).
|
|
261
|
+
|
|
262
|
+
<p align="center">
|
|
263
|
+
<img src="assets/cli-trust.gif" alt="dvalincode trust — live security posture under an org policy" width="100%">
|
|
264
|
+
</p>
|
|
265
|
+
|
|
266
|
+
**`dvalincode policy check` — validate `dvalin.policy.json` in CI: schema check, the resolved policy after machine-layer narrowing, and its canonical hash.**
|
|
267
|
+
|
|
268
|
+
<p align="center">
|
|
269
|
+
<img src="assets/cli-policy.gif" alt="dvalincode policy check — validate and inspect the resolved org policy" width="100%">
|
|
270
|
+
</p>
|
|
271
|
+
|
|
272
|
+
**Tamper-evident audit — every agent run is a hash-chained, minimized report you can verify offline:**
|
|
273
|
+
|
|
274
|
+
<p align="center">
|
|
275
|
+
<img src="assets/cli-audit.gif" alt="dvalincode report — run report, then report verify proving the chain intact" width="100%">
|
|
276
|
+
</p>
|
|
277
|
+
|
|
278
|
+
**Evidence Pack — one command bundles policy, posture, and audit proofs into a single file a reviewer can verify fully offline:**
|
|
279
|
+
|
|
280
|
+
<p align="center">
|
|
281
|
+
<img src="assets/cli-evidence.gif" alt="dvalincode evidence export and verify — offline-verifiable governance evidence" width="100%">
|
|
282
|
+
</p>
|
|
283
|
+
|
|
284
|
+
**Project intelligence — `dvalincode scan` maps the workspace before the agent touches it:**
|
|
285
|
+
|
|
286
|
+
<p align="center">
|
|
287
|
+
<img src="assets/cli-scan.gif" alt="dvalincode scan — project intelligence" width="100%">
|
|
288
|
+
</p>
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## 🆚 When to choose DvalinCode
|
|
293
|
+
|
|
294
|
+
| If you need… | DvalinCode's answer |
|
|
295
|
+
|---|---|
|
|
296
|
+
| **An agent your security team can approve** | Policy-bound tools, explicit approval modes, `dvalincode trust`, audit logs, OpenSSF evidence, and ISO/IEC 42001 alignment docs. |
|
|
297
|
+
| **AI coding for regulated repositories** — finance, healthcare, enterprise data, customer-confidential code | Local-first runtime, bring-your-own-model, `.dvalincodeignore`, governed egress, and minimized audit records. |
|
|
298
|
+
| **A safer alternative to generic autonomous coding agents** | The product thesis is controllable / transparent / auditable, not only "the model can edit files". |
|
|
299
|
+
| **IDE-centric AI workflows** | Zero-dep binary (~25 MB). Runs anywhere, no IDE required. macOS shell is sandboxed by default — network denied, writes capped to `cwd`. |
|
|
300
|
+
| **Terminal-first AI workflows** | CLI start → auto-opens a modern Web UI with code highlighting and red/green diff approval. One install command, nothing else needed. |
|
|
301
|
+
| **Cloud-only AI workflows** | Every OpenAI-compatible endpoint is a first-class citizen. Run Ollama with Qwen2.5-Coder: no key, no internet, no per-token cost. |
|
|
302
|
+
| **Single-machine AI setup** | `AGENTS.md` committed to the repo ships AI context to every clone. `dvalin.json` ships the team's automation commands the same way — export from the sidebar, commit, done. |
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## 🚀 Quick Install
|
|
307
|
+
|
|
308
|
+
### macOS / Linux (one-liner)
|
|
309
|
+
|
|
310
|
+
```sh
|
|
311
|
+
curl -fsSL https://raw.githubusercontent.com/arthurpanhku/dvalincode/main/scripts/install.sh | bash
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Detects your OS + arch, downloads the right binary, installs to `~/.dvalincode/`, and adds it to your `PATH`. After reload:
|
|
315
|
+
|
|
316
|
+
```sh
|
|
317
|
+
source ~/.zshrc # or ~/.bashrc
|
|
318
|
+
dvalincode # interactive terminal agent
|
|
319
|
+
dvalincode serve # start the web GUI, open the browser
|
|
320
|
+
dvalincode serve --host 0.0.0.0 --no-open # host it on a server for remote/browser use
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Windows
|
|
324
|
+
|
|
325
|
+
Download `dvalincode-v*-windows-x64.zip` from [Releases](https://github.com/arthurpanhku/dvalincode/releases/latest), unzip, then double-click `start.bat`.
|
|
326
|
+
|
|
327
|
+
### Manual download
|
|
328
|
+
|
|
329
|
+
Grab the archive for your platform from the [Releases page](https://github.com/arthurpanhku/dvalincode/releases/latest):
|
|
330
|
+
|
|
331
|
+
| Platform | Archive |
|
|
332
|
+
|---|---|
|
|
333
|
+
| macOS Apple Silicon (M1/M2/M3) | `dvalincode-v*-macos-arm64.tar.gz` |
|
|
334
|
+
| macOS Intel | `dvalincode-v*-macos-x64.tar.gz` |
|
|
335
|
+
| Windows x64 | `dvalincode-v*-windows-x64.zip` |
|
|
336
|
+
| Linux ARM64 | `dvalincode-v*-linux-arm64.tar.gz` |
|
|
337
|
+
| Linux x64 | `dvalincode-v*-linux-x64.tar.gz` |
|
|
338
|
+
|
|
339
|
+
Verify against `SHA256SUMS.txt` (included in each release).
|
|
340
|
+
|
|
341
|
+
> **macOS Gatekeeper:** binaries are unsigned. On first run, either clear the quarantine flag with `xattr -dr com.apple.quarantine ~/.dvalincode`, or right-click the binary in Finder → Open → confirm.
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
## 🎬 First-time setup
|
|
346
|
+
|
|
347
|
+
**Terminal (default):** run `dvalincode`. On first launch it walks you through a one-time provider setup (pick a provider, paste your API key, choose a model) and saves it to `~/.dvalincode/config.json`. Then you're at the prompt — type to chat, `/mode` to switch between Chat / Cowork / Code, `/help` for commands.
|
|
348
|
+
|
|
349
|
+
**Web GUI:** run `dvalincode serve` and:
|
|
350
|
+
|
|
351
|
+
1. The server starts on `http://localhost:3000` and your browser opens automatically.
|
|
352
|
+
2. Click **LLM Configuration** in the sidebar (bottom-left).
|
|
353
|
+
3. Pick a provider, paste your API key, choose a model, hit **Save**.
|
|
354
|
+
4. Optional: save the current config as a named profile (e.g. `fast`, `cheap`, `local-ollama`) to switch quickly later.
|
|
355
|
+
|
|
356
|
+
Both share the same config and sessions in `~/.dvalincode/`.
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## ✨ Features
|
|
361
|
+
|
|
362
|
+
| Category | Feature | Notes |
|
|
363
|
+
|---|---|---|
|
|
364
|
+
| **Modes** | Chat / Cowork / Code | Each with a distinct sidebar (Templates / Projects / Routines) and tool-access policy |
|
|
365
|
+
| **Code permissions** | Ask Permissions / Plan Mode / Auto Mode / Bypass permissions | Verified behavior: Ask requests approval before writes/commands, Plan is read-only and does not write files, Auto runs operations automatically, Bypass runs without confirmation prompts |
|
|
366
|
+
| **Workspaces** | Open folder / Import Git / Add worktree | Cowork and Code can switch to a local folder, clone a Git project, or create a Git worktree from the UI |
|
|
367
|
+
| **Governance** | OpenSSF Scorecard / ISO 42001 AIMS alignment | Scorecard, CodeQL, Dependabot, pinned Actions, AI impact assessment, risk register, and review cadence are documented under `docs/security/` and `docs/governance/` |
|
|
368
|
+
| **Secure remediation** | Local scan / SARIF import / case queue / remediation worktree | Code mode can scan common local risks, import SARIF findings, persist local cases, and create isolated `dvalin/remediate/...` worktrees with repair prompts |
|
|
369
|
+
| **Skills** | Upload / download / built-in security skills | Skills live under `~/.dvalincode/skills`; built-ins guide security scanning and remediation with dedicated agent tools. [Format →](docs/SKILLS.md) |
|
|
370
|
+
| **Composer** | `@` file references | Type `@` for a fuzzy file search; selected files get inlined into the prompt |
|
|
371
|
+
| | `/` slash commands | `/clear` `/compact` `/git` `/plan` `/undo` `/help` |
|
|
372
|
+
| | Multiline + interrupt | <kbd>Shift</kbd>+<kbd>Enter</kbd> for newline, stop button to abort mid-stream |
|
|
373
|
+
| **Tool UI** | Inline diffs | `edit_file` and `write_file` results render as red/green unified diff, default folded |
|
|
374
|
+
| | Approval dialog with diff | Cowork mode shows the diff *before* the change is applied |
|
|
375
|
+
| | Live tool counter + token + cost | Topbar shows session totals in real time |
|
|
376
|
+
| **Agent** | LLM-based context compaction | `/compact` summarises into Goal / Completed / Decisions / Pending |
|
|
377
|
+
| | Persistent undo stack | `/undo [N]` reverses the last N tool calls |
|
|
378
|
+
| | Run Report | Markdown summary per run (files, commands, decisions, test result) — GUI card + `dvalincode report` |
|
|
379
|
+
| | Git awareness | Branch name in topbar; `git_status` tool; git context auto-injected into prompt |
|
|
380
|
+
| | `AGENTS.md` project memory | Per-repo persistent instructions, auto-loaded each turn |
|
|
381
|
+
| **Security** | Tamper-evident audit trail | Hash-chained JSONL per run in `~/.dvalincode/audit/`; `dvalincode report verify` detects edits |
|
|
382
|
+
| | macOS shell sandbox | `sandbox-exec` denies network; allows writes only inside cwd + `/tmp` |
|
|
383
|
+
| | `.dvalincodeignore` | gitignore-style exclusion; blocks `read_file` / `list_files` / `search_text` |
|
|
384
|
+
| | Per-action approval | Approve/deny each write / delete / shell call in Cowork mode |
|
|
385
|
+
| **Appearance** | Theme switcher | Dark / light / system, persisted; `system` follows the OS live |
|
|
386
|
+
| **Providers** | OpenAI-compatible endpoints | DeepSeek · OpenAI · Groq · OpenRouter · Ollama · custom |
|
|
387
|
+
| | Multi-profile config | Save and switch between named (provider, model, API key) sets |
|
|
388
|
+
| **Sessions** | Auto-save + restore | All sessions persisted to `~/.dvalincode/sessions/` as JSON |
|
|
389
|
+
| | LLM summary memory | Cross-session summary keeps the agent oriented after restart |
|
|
390
|
+
| **Memory** | Local user/project memory | Searchable facts, preferences, and decisions in `~/.dvalincode/memory/`; import from Claude/Hermes/Markdown |
|
|
391
|
+
| **Data portability** | Export / import all data | One bundle of memory + sessions + config + audit — `dvalincode export` / `import`, or GUI Settings → Export / Import |
|
|
392
|
+
| | Markdown transcript | Download any conversation as Markdown — sidebar download icon, `dvalincode session md <id>`, or `/api/sessions/:id/markdown` |
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## ⌨️ Slash Commands
|
|
397
|
+
|
|
398
|
+
| Command | Description |
|
|
399
|
+
|---|---|
|
|
400
|
+
| `/clear` | Clear the current conversation (client-side, starts a fresh session) |
|
|
401
|
+
| `/compact` | LLM-based context compaction — replaces history with a structured summary |
|
|
402
|
+
| `/undo [N]` | Reverse the last N tool calls (default 1) |
|
|
403
|
+
| `/git` | Run `git_status` and show branch, recent commits, changed files |
|
|
404
|
+
| `/plan <task>` | Ask the agent to plan the task step-by-step *without* executing |
|
|
405
|
+
| `/help` | Show all available slash commands |
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
## 🛠️ Architecture
|
|
410
|
+
|
|
411
|
+
```
|
|
412
|
+
┌───────────────────────────┐ ┌─────────────────────────┐
|
|
413
|
+
│ Terminal UI (readline) │ │ Browser GUI (React/Vite)│
|
|
414
|
+
│ streaming · approvals │ │ ChatThread · DiffViewer │
|
|
415
|
+
└─────────────┬─────────────┘ └────────────┬────────────┘
|
|
416
|
+
│ in-process HTTP / WebSocket
|
|
417
|
+
│ ┌───────────────▼─────────────┐
|
|
418
|
+
│ │ Express + ws server │
|
|
419
|
+
│ │ /api/* · `dvalincode serve` │
|
|
420
|
+
│ └───────────────┬─────────────┘
|
|
421
|
+
└──────────────┬─────────────────┘
|
|
422
|
+
┌────────────────────────────▼────────────────────────────┐
|
|
423
|
+
│ runAgentTurn — shared turn-runner (src/agent/session) │
|
|
424
|
+
│ provider · prompt (mode · git · AGENTS.md) · session │
|
|
425
|
+
└────────────────────────────┬────────────────────────────┘
|
|
426
|
+
│
|
|
427
|
+
┌────────────────────────────▼────────────────────────────┐
|
|
428
|
+
│ Agent Engine │
|
|
429
|
+
│ AgentLoop (8-state machine) → AgentRunner │
|
|
430
|
+
│ Streaming · Interrupt · Undo stack · LLM compaction │
|
|
431
|
+
│ run_start / run_end → AuditSink (hash-chained JSONL) │
|
|
432
|
+
└──────────────────────────┬──────────────────────────────┘
|
|
433
|
+
│ run()
|
|
434
|
+
┌──────────────────────────▼──────────────────────────────┐
|
|
435
|
+
│ ToolRegistry — Zod schemas + permission gating │
|
|
436
|
+
│ + audit taps: tool_call · file_* · shell_exec │
|
|
437
|
+
│ read_file · list_files · search_text · git_status · │
|
|
438
|
+
│ write_file · edit_file · delete_file · shell │
|
|
439
|
+
└─────────────────────────────────────────────────────────┘
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### Agent Loop — 8 States
|
|
443
|
+
|
|
444
|
+
```
|
|
445
|
+
RESTORE → COMPACT → COMMAND → BUILD → RUN → SAVE → RESPOND → DONE
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
1. **RESTORE** — Load session from `~/.dvalincode/sessions/`
|
|
449
|
+
2. **COMPACT** — If context near the limit, compress history (LLM summary)
|
|
450
|
+
3. **COMMAND** — Handle built-in slash commands
|
|
451
|
+
4. **BUILD** — Assemble system prompt (mode prompt + project + git + AGENTS.md)
|
|
452
|
+
5. **RUN** — Delegate to `AgentRunner` for the LLM tool-calling loop
|
|
453
|
+
6. **SAVE** — Persist session
|
|
454
|
+
7. **RESPOND** — Generate cross-session summary memory
|
|
455
|
+
8. **DONE**
|
|
456
|
+
|
|
457
|
+
---
|
|
458
|
+
|
|
459
|
+
## 🧪 Tests
|
|
460
|
+
|
|
461
|
+
```sh
|
|
462
|
+
npm test
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
**203 tests · 36 files · all green.**
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
469
|
+
## 🏗️ Build from source
|
|
470
|
+
|
|
471
|
+
Requires [Bun](https://bun.sh) (`curl -fsSL https://bun.sh/install | bash`).
|
|
472
|
+
|
|
473
|
+
```sh
|
|
474
|
+
git clone https://github.com/arthurpanhku/dvalincode
|
|
475
|
+
cd dvalincode
|
|
476
|
+
npm install
|
|
477
|
+
npm run dev:all # start backend (3001) + Vite (5173)
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
Build release binaries for every platform:
|
|
481
|
+
|
|
482
|
+
```sh
|
|
483
|
+
bash scripts/build-release.sh # → release/ with tar.gz / zip + SHA256SUMS.txt
|
|
484
|
+
bash scripts/build-release.sh darwin # macOS only
|
|
485
|
+
bash scripts/build-release.sh windows # Windows only
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
Before publishing a release:
|
|
489
|
+
|
|
490
|
+
```sh
|
|
491
|
+
(cd release && shasum -a 256 -c SHA256SUMS.txt)
|
|
492
|
+
unzip -l release/dvalincode-v*-windows-x64.zip | grep 'web/dist/index.html'
|
|
493
|
+
tar tzf release/dvalincode-v*-macos-arm64.tar.gz | grep 'DvalinCode.app/Contents/Resources/AppIcon.icns'
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
Windows smoke test: unzip `dvalincode-v*-windows-x64.zip` on Windows and run `start.bat` from the extracted folder. The server should open `http://localhost:3000`. If it reports an `ENOENT` path under `B:\~BUN\root\web\dist`, the compiled Bun virtual path detection has regressed; the packaged binary must resolve `web/dist` beside the extracted executable.
|
|
497
|
+
|
|
498
|
+
Note: Bun only allows Windows `.exe` icon/metadata injection when compiling on Windows. macOS/Linux cross-builds still produce a valid Windows archive, but without an embedded `.exe` icon.
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
502
|
+
## 🌐 Providers
|
|
503
|
+
|
|
504
|
+
DvalinCode supports any OpenAI-compatible endpoint. Built-in presets, sorted by cost:
|
|
505
|
+
|
|
506
|
+
| Provider | Cheapest model | Input / Output | Notes |
|
|
507
|
+
|---|---|---|---|
|
|
508
|
+
| **Groq** | `llama-3.1-8b-instant` | Free tier | Fastest open models — Llama 3.3 70B, Mixtral |
|
|
509
|
+
| **Ollama** | `qwen2.5-coder` | $0 (local) | No API key needed, runs on your machine |
|
|
510
|
+
| **DeepSeek** | `deepseek-chat` | $0.14 / $0.28 per 1M | Cheap and strong; v3 nearly matches GPT-4 quality |
|
|
511
|
+
| **OpenRouter** | `google/gemini-2.0-flash-001` | $0.10 / $0.40 per 1M | 200+ models including Claude, Gemini, Llama |
|
|
512
|
+
| **OpenAI** | `gpt-4o-mini` | $0.15 / $0.60 per 1M | Reliable; `o1` available for deep reasoning |
|
|
513
|
+
| **Custom** | — | depends | Any OpenAI-compatible base URL |
|
|
514
|
+
|
|
515
|
+
DvalinCode shows the per-session cost live in the topbar — flip between providers in the **LLM Configuration** modal, save named profiles, and compare on the fly.
|
|
516
|
+
|
|
517
|
+
---
|
|
518
|
+
|
|
519
|
+
## ❓ FAQ
|
|
520
|
+
|
|
521
|
+
<details>
|
|
522
|
+
<summary><b>Does it send my code to a third party?</b></summary>
|
|
523
|
+
<br>
|
|
524
|
+
Only what the agent sends to the LLM you configured. Sessions, configs, and profiles all live on your machine in <code>~/.dvalincode/</code>. To exclude sensitive files from the agent's view, drop a <code>.dvalincodeignore</code> in your repo root (gitignore-style patterns).
|
|
525
|
+
</details>
|
|
526
|
+
|
|
527
|
+
<details>
|
|
528
|
+
<summary><b>Can I run this without an API key?</b></summary>
|
|
529
|
+
<br>
|
|
530
|
+
Yes — use Ollama. Pull a model (<code>ollama pull qwen2.5-coder</code>), then in the LLM Configuration modal pick the <b>Ollama</b> provider. No key, no internet, no per-token cost.
|
|
531
|
+
</details>
|
|
532
|
+
|
|
533
|
+
<details>
|
|
534
|
+
<summary><b>Why three modes? Can't I just use one?</b></summary>
|
|
535
|
+
<br>
|
|
536
|
+
Each mode has different <b>tool access</b> and <b>safety</b> defaults: Chat is read-only, Cowork requires approval per write, Code is full-auto. Each also has a different sidebar (Templates / Projects / Routines) optimized for that workflow. You can switch any time — the conversation continues.
|
|
537
|
+
</details>
|
|
538
|
+
|
|
539
|
+
<details>
|
|
540
|
+
<summary><b>Is the shell tool sandboxed?</b></summary>
|
|
541
|
+
<br>
|
|
542
|
+
On macOS, yes — every <code>shell</code> tool invocation is wrapped in <code>sandbox-exec</code> with a profile that <i>denies network access</i> and allows file writes only inside <code>cwd</code>, <code>/tmp</code>, and <code>/var</code>. Linux and Windows sandboxing is planned.
|
|
543
|
+
</details>
|
|
544
|
+
|
|
545
|
+
<details>
|
|
546
|
+
<summary><b>How do I see what the agent actually did — and is the log trustworthy?</b></summary>
|
|
547
|
+
<br>
|
|
548
|
+
Every run writes a JSONL audit log to <code>~/.dvalincode/audit/run-<timestamp>-<id>.jsonl</code>. Render it with <code>dvalincode report --last</code> (or see the collapsible Run Report card in the GUI). Each record is chained to the previous one with a SHA-256 hash, so any after-the-fact edit is detectable — <code>dvalincode report verify <run-id></code> reports <code>✓ chain intact</code> or the exact position of a break. It's tamper-<b>evident</b>, not tamper-<b>proof</b>: a local attacker who can rewrite the whole file could recompute the chain. The value is forensic/accountability. See <a href="docs/AUDIT-TRAIL.md">docs/AUDIT-TRAIL.md</a> for the full threat model.
|
|
549
|
+
</details>
|
|
550
|
+
|
|
551
|
+
<details>
|
|
552
|
+
<summary><b>Will it overwrite my files without asking?</b></summary>
|
|
553
|
+
<br>
|
|
554
|
+
Depends on the mode. <b>Chat</b> never writes. <b>Cowork</b> requires approval per file (with inline red/green diff before you click Allow). <b>Code</b> is full-auto — use it for trusted tasks or in a feature branch.
|
|
555
|
+
</details>
|
|
556
|
+
|
|
557
|
+
<details>
|
|
558
|
+
<summary><b>The macOS binary won't open — "unverified developer"</b></summary>
|
|
559
|
+
<br>
|
|
560
|
+
The binary is unsigned. Run this once to clear the quarantine flag:
|
|
561
|
+
<pre><code>xattr -dr com.apple.quarantine ~/.dvalincode</code></pre>
|
|
562
|
+
Or right-click the binary in Finder → Open → confirm once.
|
|
563
|
+
</details>
|
|
564
|
+
|
|
565
|
+
<details>
|
|
566
|
+
<summary><b>How do I save a routine in Code mode?</b></summary>
|
|
567
|
+
<br>
|
|
568
|
+
Switch to Code mode, click the <b>+</b> next to "ROUTINES" in the sidebar. Enter a name (e.g. "Deploy preview") and a prompt or slash command (e.g. "<code>/git</code>" or "Build the project and deploy to staging"). Routines persist in your browser's <code>localStorage</code>.
|
|
569
|
+
</details>
|
|
570
|
+
|
|
571
|
+
<details>
|
|
572
|
+
<summary><b>Does <code>AGENTS.md</code> get sent every turn?</b></summary>
|
|
573
|
+
<br>
|
|
574
|
+
Yes — DvalinCode reads <code>AGENTS.md</code> from the project root before each turn and injects it under <code>=== PROJECT INSTRUCTIONS ===</code> in the system prompt. Keep it focused — it counts toward your token budget.
|
|
575
|
+
</details>
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
579
|
+
## 🤝 Contributing
|
|
580
|
+
|
|
581
|
+
Contributions welcome. The codebase is intentionally small and surgical — see [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
582
|
+
|
|
583
|
+
```sh
|
|
584
|
+
git clone https://github.com/arthurpanhku/dvalincode
|
|
585
|
+
cd dvalincode && npm install
|
|
586
|
+
npm test # 65/65 ✅
|
|
587
|
+
npm run typecheck
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
---
|
|
591
|
+
|
|
592
|
+
## 📄 License
|
|
593
|
+
|
|
594
|
+
MIT — see [LICENSE](LICENSE).
|
|
595
|
+
|
|
596
|
+
---
|
|
597
|
+
|
|
598
|
+
## 🔗 Independence & Attribution
|
|
599
|
+
|
|
600
|
+
DvalinCode is an independent implementation. It is not affiliated with,
|
|
601
|
+
sponsored by, or endorsed by Anthropic, Claude, Claude Code, OpenAI, OpenAI
|
|
602
|
+
Codex, GitHub, Cursor, Aider, opencode, Cline, HKUDS/nanobot, or any other
|
|
603
|
+
project or vendor named here.
|
|
604
|
+
|
|
605
|
+
We gratefully acknowledge that DvalinCode's product direction and architecture
|
|
606
|
+
were informed by public research, open-source projects, published papers,
|
|
607
|
+
standards, release notes, and common workflow patterns across the agentic coding
|
|
608
|
+
ecosystem:
|
|
609
|
+
|
|
610
|
+
- [HKUDS/nanobot](https://github.com/HKUDS/nanobot) (MIT) helped validate the
|
|
611
|
+
explicit turn-state approach used in DvalinCode's `TurnState` flow.
|
|
612
|
+
- The [ReAct paper](https://arxiv.org/abs/2210.03629) (Yao et al., 2022)
|
|
613
|
+
provides the widely used "reason, act, observe" loop that informs many modern
|
|
614
|
+
tool-using agents.
|
|
615
|
+
- OpenAI's `tool_calls` message format, along with the broader
|
|
616
|
+
OpenAI-compatible provider ecosystem, gives DvalinCode a portable interface
|
|
617
|
+
for model/tool interaction.
|
|
618
|
+
- OpenAI Codex / Codex CLI, Claude Code, Aider, opencode, Cursor, Cline, and
|
|
619
|
+
similar coding agents clarified user expectations around terminal agents,
|
|
620
|
+
plan/build modes, permission prompts, project-local context, sandboxing,
|
|
621
|
+
session lifecycle, MCP integration, and diff-first editing workflows.
|
|
622
|
+
- The `AGENTS.md` project-instruction convention, common in coding-agent tools,
|
|
623
|
+
informed DvalinCode's project-local instruction loading behavior.
|
|
624
|
+
- CodeQL, GitHub Code Scanning, Semgrep, SARIF, OpenSSF Scorecard, and ISO/IEC
|
|
625
|
+
42001 informed DvalinCode's security-remediation and approvability posture.
|
|
626
|
+
- Git worktree, MCP, and local-first developer tooling patterns influenced the
|
|
627
|
+
product direction for isolated remediation, governed tool access, and
|
|
628
|
+
auditable execution.
|
|
629
|
+
|
|
630
|
+
These references shaped our understanding of what users expect from coding
|
|
631
|
+
agents. DvalinCode's source code, prompts, UI text, tool schemas, module layout,
|
|
632
|
+
and product implementation remain original unless explicitly noted. No source
|
|
633
|
+
code, prompts, or UI text from the projects above was copied.
|
|
634
|
+
|
|
635
|
+
Full source references: [docs/REFERENCES.md](docs/REFERENCES.md)
|
|
636
|
+
|
|
637
|
+
---
|
|
638
|
+
|
|
639
|
+
## ⭐ Star Growth
|
|
640
|
+
|
|
641
|
+
<p align="center">
|
|
642
|
+
<a href="https://www.star-history.com/#arthurpanhku/dvalincode&Date">
|
|
643
|
+
<picture>
|
|
644
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=arthurpanhku/dvalincode&type=Date&theme=dark">
|
|
645
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=arthurpanhku/dvalincode&type=Date">
|
|
646
|
+
<img alt="DvalinCode Star History Chart" src="https://api.star-history.com/svg?repos=arthurpanhku/dvalincode&type=Date">
|
|
647
|
+
</picture>
|
|
648
|
+
</a>
|
|
649
|
+
</p>
|