diff --git a/.gitignore b/.gitignore index b3452621..65b0bb82 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,7 @@ tmp dist ts-dist .turbo -# Web/edge build artifacts (nitro .output, cloudflare .wrangler) — e.g. packages/console, packages/stats +# Web/edge build artifacts (nitro .output, cloudflare .wrangler) - e.g. packages/console, packages/stats .output .wrangler packages/console/app/public/sitemap.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b8e91a1..6dd963d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,65 @@ # Changelog +## V4.0.4 - Contract-gap closure (engine-decoupled) + +- Fix Plan Gate deadlock: stale-plan latch now warns (never hard-blocks) on tool execution, aligned with codex exec-policy philosophy. A mutating tool on a stale plan receives a reminder but always runs. +- Fix goal-loop scorer false positives: `extractValidationResults` now scopes extraction to declared validation commands only (toolCallId→command mapping), with latest-wins per command. Diagnostic bash calls no longer poison the score. +- Fix cancel/loop test flake: `maxRetries:0` in the test provider config prevents AI SDK exponential-backoff retries against the intentionally-dead test URL; per-test budgets raised from 3 s to 15 s. +- Bump desktop app to 1.4.2. +- Publishing truth: fix quick-start command (`deepagent-code run`), comment out unpublished npm install, unify domain to `deepagent.ltd`, replace `lessweb`/`anomalyco` org handles, update SECURITY.md supported-version line and M-CRED status, update CHANGELOG. + +## V4.0.3 - Upstream kernel alignment (AppNode foundation) + +- AppNode foundation: additive node export layer aligning with upstream opencode V2 session architecture. +- DocumentStore concurrency-safe durable body (F30-1): atomic CAS writes, version conflicts, recovery. +- Plan single source of truth (I33-1): goal path and tool path write one plan document; DocumentStore is the authority. +- safeGit hardening (I33-5): `--no-ext-diff --no-textconv` added to all read-path git calls; hook execution disabled via `core.hooksPath=/dev/null`; clean/smudge/process filters never invoked on read-only paths. + +## V4.1 - Steering + plan hot-edit + +- Steering foundation (S1.1): absorb mid-turn user input at the next turn boundary without aborting the current turn. +- Goal plan hot-edit (S1.2): update plan steps while a goal loop is running; orphan-doc bug fixed (upsert-by-description → updateWithProvenance by-id). +- Cache regression fix: DeepAgent gateway no longer bakes per-round volatile state (round number, budget, previous results) into the system prefix, preserving prompt cache across intra-turn calls. +- Subagent panel and session fork lineage: forks use `metadata.forkedFrom`; depth cap 3; derived-from banner and folder-tree nesting. + +## V4.0 - Event-driven paradigm + +- Event-driven Agent OS: durable events, priority routing, backpressure, worker claims, leases, handoffs, retries, dead-letter recovery. +- Consumer-driven goals: `goal.tick.requested` claims and executes one idempotent tick, records facts, schedules next tick when goal remains eligible. +- V4.0-beta closeout: producer-starvation fix, security fails-closed, half-wired consumers wired. Autonomous path live in production. +- V4.0.1 long-task design: soft-landing compression (P0), World State responsibility separation (P1), budget hot-swap without restart (P2), idempotent + per-model output (P3). Four feature flags. Fully verified. +- Plan gate P0+P1: plan-stale signals all degrade to warn; U9 per-step binding retains hard block with grace release. +- CLI ↔ GUI parity: full legacy server surface mounted on new CLI daemon; sessionClient wrapper seam. +- Config data-root unification: global config moved from `~/.config/deepagent-code` to `~/.deepagent/code/config.jsonc` (claude/codex style). +- Zero-config provider: add third-party provider with URL + key; protocol auto-detect; model discovery from `/models`. + +## V3.9 - Repo/Wiki + Expert Panel + Goal Loop + +- Repo and Wiki integration: session archive, wiki-backed knowledge, cross-session search. +- Expert Panel: chat-button convenes a panel of domain experts; `panel.consult` tool. +- Goal Loop: `goal_driver.ts` drives multi-step autonomous goals; goal-tick event pipeline. +- AST code-graph: tree-sitter based symbol graph for semantic navigation. +- Subagent plan permissions: plan-write capability gating per subagent. +- Adversarial review wave: 20-file fix commit; flag-gating, budget-ceiling, anonymization, leaf-calls, sealed-leak all fixed; Arbiter + security boundary verified. +- Cache hit regression root cause: volatile per-round state in system prefix → fixed by moving it out of the cached prefix. + +## V3.8 - V4.0 pre-release foundation + +- Session-internal scheduler: all sub-agent execution driven via `SessionPrompt.Service`; no-op stack replaced. +- Context wiring: full context assembly pipeline connected end-to-end. +- Sub-agent strength levels: permission presets per agent mode. +- Mode redesign: codex-aligned auto/loop/design modes; flag kill-switch; permission presets. +- Server mode connection: desktop→Server Edition gateway; wire contract; client code map. + +## V3.5 - M-CRED secure secret storage + +- Secrets stored in OS-backed secret storage: macOS Keychain (production), Linux Secret Service and Windows Credential Manager stubs with 0600-file fallback. +- MCP credential values no longer persist in plain-text configuration; only variable names or references travel through config. +- Credential migration: existing stored secrets migrated to the new store on first launch. +- PTY and terminal fixes: stale-worktree redirect, terminal split circular-tree bug. +- Archived sessions: restore, unarchive, delete operations. +- Stale worktree redirect: same-repo clones share one project row; `fromDirectory` now returns live clone dir. + ## V3.4.1 - Public release hardening - Switch project license to AGPL-3.0-or-later. diff --git a/README.md b/README.md index 3e8d672f..09f64850 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Enterprise
-Desktop 1.4.1 · DeepAgent Core V4.1
+Desktop 1.4.2 · DeepAgent Core V4.0
--- @@ -105,8 +105,12 @@ V4.1 brings the complete DeepAgent control plane together: ## Installation +> **Note:** The `deepagent-code` npm package is not yet publicly published. +> Install via the desktop app or the install script below. + ```bash -npm install -g deepagent-code +# Install script (macOS / Linux) +curl -fsSL https://deepagent.ltd/install | bash ``` Then run: @@ -183,7 +187,7 @@ reference (base URL overrides, headers, per-model config, gateways). Start the agent and give it a task: ```bash -deepagent-code "add rate limiting to /api/users endpoint" +deepagent-code run "add rate limiting to /api/users endpoint" ``` The agent will: diff --git a/SECURITY.md b/SECURITY.md index dc4bf2ae..ee97178b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,7 +8,7 @@ Do not include live secrets in reports. Use redacted examples or synthetic crede ## Supported versions -Before the first public stable tag, the supported line is the current `main` branch and the latest published pre-release. Security fixes may be released as patch versions. +The active development line is the `dev` branch. The supported release is the latest published version on the `core-v4.0-beta` branch and the desktop app release derived from it. Security fixes are applied to the active line and backported to the latest release where feasible. ## Source availability @@ -20,13 +20,13 @@ Preset MCP servers are opt-in. The preset catalog records intended risk tiers, b Read-only database presets are intended to use restricted server modes and SQL guardrails. Guardrails are defense in depth, not a substitute for least-privilege database users. -## Known limitation: preset MCP credentials in V3.4.1 +## MCP credential security (V4.0+) -When enabling preset MCP servers that require credentials, credential values may currently be persisted in local configuration. Until V3.5 M-CRED lands: +As of V4.0, MCP server credentials are stored in OS-backed secret storage where available (macOS Keychain; Linux and Windows fall back to a 0600 file). Credential values are not persisted in plain-text configuration. Only variable names or references travel through config files; values are resolved at runtime. + +If you are running a version older than V4.0: - Do not commit DeepAgent Code configuration files containing secrets. - Prefer environment-variable indirection where a server supports it. - Use least-privilege tokens and database users. - Rotate credentials if they were accidentally committed or shared. - -The planned V3.5 M-CRED work stores secrets in OS-backed secret storage where available (macOS Keychain, Windows Credential Manager, Linux Secret Service), passes only variable names or references through configuration, and resolves values at runtime. diff --git a/bun.lock b/bun.lock index 82ed0bd7..5e95c744 100644 --- a/bun.lock +++ b/bun.lock @@ -29,7 +29,7 @@ }, "packages/app": { "name": "@deepagent-code/app", - "version": "1.4.0", + "version": "1.0.0-beta", "dependencies": { "@codemirror/autocomplete": "6", "@codemirror/commands": "6", @@ -109,15 +109,20 @@ "lildax": "./bin/lildax.cjs", }, "dependencies": { + "@agentclientprotocol/sdk": "^0.21.0", "@deepagent-code/core": "workspace:*", "@deepagent-code/sdk": "workspace:*", "@deepagent-code/server": "workspace:*", "@deepagent-code/tui": "workspace:*", "@effect/platform-node": "catalog:", "@opentui/core": "catalog:", + "@opentui/keymap": "catalog:", "@opentui/solid": "catalog:", "@parcel/watcher": "2.5.1", + "deepagent-code": "workspace:*", + "drizzle-orm": "catalog:", "effect": "catalog:", + "jsonc-parser": "^3.3.1", "solid-js": "catalog:", }, "devDependencies": { @@ -344,7 +349,7 @@ }, "packages/desktop": { "name": "@deepagent-code/desktop", - "version": "1.4.0", + "version": "1.2.0", "dependencies": { "@zip.js/zip.js": "2.7.62", "effect": "catalog:", diff --git a/design/README.md b/design/README.md index bd41fcfb..86c26ebc 100644 --- a/design/README.md +++ b/design/README.md @@ -1,266 +1,120 @@ -# DeepAgent Code Architecture & Design +# DeepAgent Code — Architecture & Design -> Public architecture baseline for DeepAgent Core V4.1. +> **Public design overview.** Internal implementation details and roadmap docs live in the private `docs/` tree (not version-controlled). This directory contains the publicly visible architectural narrative. -DeepAgent Code is a document-centered, event-driven AI coding system. It combines a coding-agent runtime with a durable control plane that owns context, planning, learning, collaboration, safety, and human oversight. +--- -The architecture is designed around one requirement: a long-running agent must remain correct and governable after many model turns, tool calls, user interventions, process restarts, and worker handoffs. +## What is DeepAgent Code? -## Design Principles +DeepAgent Code is an AI coding agent that adds a **control plane** on top of the [opencode](https://github.com/sst/opencode) runtime. It keeps the proven opencode foundations (runtime, tool, MCP, session, provider stack) and layers in: -### One durable truth per concept +- **Durable document memory** — knowledge base with retrieval gates, dedup, and merge +- **Context assembly** — selective, evidence-backed context building (not raw file dumps) +- **Plan system** — structured task planning with staleness detection and rollback +- **Failure triage** — three-tier classifier (auto-fixable / needs-narrowing / not-auto-fixable) +- **Domain adapters** — pluggable domain packs for specialized workflows +- **AI IDE microservice** — LSP-backed semantic code navigation via `code_intel` +- **MCP catalog** — curated, one-click-enable MCP servers with safety tiers -Sessions, inputs, plans, documents, goals, events, approvals, and learning decisions each have one authoritative durable representation. In-memory state is a cache or an ownership hint, never a competing source of truth. +--- -### Admission is separate from execution +## Architectural Principles -A user instruction is durably admitted before execution is scheduled. A successful API response therefore means the instruction is recorded, not merely present in a process-local queue. +### 1. Enhance, don't replace -### One provider-turn contract +DeepAgent is built **on top of** the opencode agent/runtime/session/tool/MCP stack. It does not rewrite the execution engine, tool system, or provider layer. The default agent behavior is not degraded. The lower-strength `general` mode stays close to the inherited runtime contract. -Native and AI SDK providers pass through the same model-turn boundary. Budget, permissions, tool policy, prompt assembly, artifacts, audit, learning, and close semantics cannot be bypassed by selecting another provider implementation. +### 2. Control-plane only -### Context is selected, not accumulated +DeepAgent is responsible for **strategy / context / budget / audit / verification / document graph**. It does not directly spawn LSP processes or execute MCP tools — those go through the existing `LSP.Service` and `MCP.Service` respectively. -The model receives a bounded working set assembled from explicit Context Sources. Full tool output and durable history remain referenceable artifacts; only admitted summaries, evidence, and snippets enter the active context. +### 3. Full tool output does not enter context -### Safety fails closed +Per the deterministic task control contract: raw LSP results, diagnostic dumps, and capability indexes are written to **evidence artifacts** (ref-linked, tool-only visibility). Only summaries and `file:line` snippets appear in the model context. -External events, credentials, tools, paths, autonomy, worker placement, and outbound messages are checked at their execution boundaries. Missing identity, trust, capability, or approval never widens access. +### 4. Fail-closed on safety -### Humans can always intervene +MCP catalog entries default to **not connected** (zero startup overhead). Dangerous write operations (force-push, DROP, file delete) require explicit approval. Read-only DB connections enforce restricted-mode at the server level. -Steering, plan editing, approval, pause, resume, takeover, rollback, and review are part of the runtime contract. They are not dashboard-only controls layered over an autonomous black box. +--- -## System Map +## Component Map -```text -┌─────────────────────────────────────────────────────────────────────┐ -│ Experience │ -│ Desktop · Web · TUI · IM · Repo & Wiki · Expert Panel · Oversight │ -└──────────────────────────────┬──────────────────────────────────────┘ - │ -┌──────────────────────────────▼──────────────────────────────────────┐ -│ Durable Session Runtime │ -│ Session V2 · System Context · Context Epoch · Steering · Queue │ -│ Prompt cache policy · Provider-turn lifecycle · Tool materialization│ -└──────────────────────────────┬──────────────────────────────────────┘ - │ -┌──────────────────────────────▼──────────────────────────────────────┐ -│ DeepAgent Control Plane │ -│ PlanController · GoalController · Context Graph · Learning │ -│ Event Router · Scheduler · Worker Pool · Handoff · Security gates │ -└──────────────────────────────┬──────────────────────────────────────┘ - │ -┌──────────────────────────────▼──────────────────────────────────────┐ -│ Durable State │ -│ DocumentStore · Session/Event database · Event Bus · Audit/Artifacts│ -└──────────────────────────────┬──────────────────────────────────────┘ - │ -┌──────────────────────────────▼──────────────────────────────────────┐ -│ Execution Services │ -│ Provider · Tool · LSP · MCP · Git/Worktree · Debug · Profile │ -└─────────────────────────────────────────────────────────────────────┘ +``` +┌─────────────────────────────────────────────────────────────┐ +│ DeepAgent Control Plane │ +│ │ +│ ┌──────────────┐ ┌─────────────┐ ┌───────────────────┐ │ +│ │ Plan System │ │ Doc Memory │ │ Failure Triage │ │ +│ │ (task/plan) │ │ (knowledge │ │ (3-tier classify)│ │ +│ └──────┬───────┘ │ store) │ └─────────┬─────────┘ │ +│ │ └──────┬──────┘ │ │ +│ ┌──────▼──────────────────▼──────────────────▼───────────┐ │ +│ │ Agent Gateway (core) │ │ +│ │ audit · budget · permission · capability index │ │ +│ └──────┬─────────────────────────────────────────────────┘ │ +└─────────│───────────────────────────────────────────────────┘ + │ +┌─────────▼──────────────────────────────────────────────────┐ +│ opencode Foundation (unchanged) │ +│ │ +│ Session ─── Tool Registry ─── MCP Service │ +│ │ │ │ │ +│ Provider LSP Service 38 lang servers │ +│ (Claude/…) code_intel tool + MCP catalog │ +└────────────────────────────────────────────────────────────┘ ``` -## Session V2 - -Session V2 separates durable prompt admission from model execution. - -### Prompt admission - -- Each prompt creates one durable `session_input` before scheduling work. -- Reusing a Session ID adopts that Session rather than creating a parallel execution entity. -- Reusing a prompt message ID is accepted only for an exact retry with the same Session, content, and delivery mode. -- Conflicting ID reuse fails instead of silently reconciling different user intent. -- A prompt can be admitted without waking execution when the caller requests admit-only behavior. - -### Delivery vocabulary - -| Delivery | Meaning | -|---|---| -| normal turn | Start a normal activity when the Session is idle | -| `steer` | Add guidance to the active activity at the next safe provider-turn boundary | -| `goal_steer` | Add guidance to the next Goal tick | -| `queue` | Open a future FIFO activity after the active activity settles | -| interrupt | Target the active process-local ownership chain immediately | - -Steering never aborts an in-flight tool or stream. The input is persisted first, absorbed in stable order, and materialized into history exactly once. - -### Execution ownership - -`SessionExecution` is process-global and keyed by Session ID. A drain discovers placement from durable Session location only when it starts. SessionRunner, model resolution, tools, permissions, and filesystem services remain Location-scoped. - -Same-Session resumes join one coordinator; advisory wakes coalesce; different Sessions can run concurrently. Every provider turn performs one explicit `llm.stream(request)` call and reloads projected history before durable continuation. - -### Prompt cache invariant - -The system prompt is split into a byte-stable prefix and one append-only volatile tail: - -- Agent instructions, stable policy, and System Context baseline stay in the prefix. -- Round state, budgets, plan snapshots, prior results, fan-out decisions, and steering stay in the tail. -- OpenAI-compatible providers use a stable Session cache key; providers with cache markers use their protocol-native breakpoint. -- Prefix hash and cache outcomes distinguish normal compaction misses from accidental prefix drift. - -## Document System - -DocumentStore is the durable body for DeepAgent state. Documents carry: - -- a stable ID and monotonic version; -- type, scope, status, domain, tags, and description; -- provenance and evidence references; -- confidence, sensitivity, and approval risk; -- typed links such as `supports`, `blocks`, `conflicts`, `validates`, `supersedes`, `contains`, `imports`, and `calls`. - -Writes use atomic replacement and conflict detection. Concurrent handles observe one authority, process-level writers coordinate through lock/CAS semantics, and migrations are incremental, restartable, and integrity-checked. - -### Scope - -| Scope | Purpose | -|---|---| -| `session-private` | Current conversation and run-local state | -| `project-shared` | Knowledge and decisions shared by one project | -| `user-global` | Cross-project preferences and explicitly promoted knowledge | -| `public-system` | Built-in skills and domain-pack documents | -| `sealed` | Audit/evaluator material that cannot enter model context | - -Plans, run context, worklogs, designs, diagnoses, evaluations, knowledge, memory, strategies, methodologies, skills, and failure dossiers share this document algebra instead of maintaining separate storage models. - -## System Context and the Four Graphs - -The Context System connects four projections over the same durable knowledge surface: - -1. **Code:** files, symbols, imports, calls, definitions, references, diagnostics. -2. **Knowledge:** facts, strategies, methodologies, skills, and failure dossiers. -3. **Memory:** decisions, constraints, project conventions, environment facts, and handoffs. -4. **Documents:** plans, designs, run context, evidence, worklogs, and evaluations. - -Context Sources produce typed observations from their domains. Session-owned selection applies budget, relevance, scope, sensitivity, evidence strength, conflict, and snapshot rules. A Context Epoch records the selected baseline so a provider turn is reproducible and observable. - -The Event Router can attach a context strategy to an event. SessionRunner executes that strategy in the target Location, records query and admission decisions in trace, and degrades safely when an optional source is unavailable. - -Compaction preserves a stable structure: goal, constraints, completed and active work, blockers, decisions, next steps, critical facts/open questions, and relevant files. Durable references remain outside the prose summary and can be reloaded when needed. - -## Planning and Goal Execution - -### Plan authority - -A structural plan is a versioned DocumentStore document. Session hot state keeps only its plan pointer/version and stale latch. The model plan tool, human plan editor, Goal worker, UI, Grader, and archive all read and update the same plan through version-aware writes. - -The runtime derives plan staleness from facts it already observes: - -- the user adds new guidance; -- a tool or execution step fails; -- validation fails; -- repeated work makes no progress; -- the active domain-pack snapshot changes. - -Read and diagnosis tools remain available while stale. Mutating tools require the plan to be synchronized, with bounded anti-deadlock behavior. - -### Goal Loop - -A Goal has objective completion criteria, a plan, a durable run context, a budget ledger, and a bounded controller. Each tick: - -1. claims the expected durable Goal/plan version; -2. applies pending user plan edits and steering; -3. executes one coherent step; -4. records tools, tokens, cost, time, evidence, and progress; -5. evaluates objective criteria and stall state; -6. emits facts and schedules the next tick only when eligible. - -`goal.tick.requested` is a durable command, not a post-hoc trace marker. Duplicate delivery cannot repeat provider or tool side effects. Pause, stop, takeover, hard limits, quiet hours, needs-human, and terminal state all stop self-continuation. - -Hot plan edits preserve reusable step IDs and completed evidence, increment the plan version, and reset progress/stall baselines without interrupting the in-flight tick. - -## Event-Driven Agent Runtime - -The Event Bus provides persist-before-dispatch delivery, idempotency, priority, retry, acknowledgement, dead-letter handling, retention, replay, and correlation. Local deployments use the embedded backend; distributed deployments use Redis Streams or Kafka through the same backend contract. - -The Router combines event type, trusted source, actor identity, Agent trigger/capability metadata, autonomy ceiling, approval intent, context strategy, deduplication, priority, and workspace backpressure into one traceable route decision. - -The Worker Pool owns bounded concurrency, placement, claims, leases, renewal, recovery, and handoff. Independent DAG nodes run concurrently; dependency edges remain ordered. File and symbol claims are shared across Workers so conflicting writes cannot run together. - -Write-capable Agents use isolated worktrees by default. Parent Agents receive bounded summaries, status, artifact/session references, and necessary diffs; complete child transcripts remain in their own Sessions. - -## Human Collaboration and Oversight - -### Repo & Wiki - -Repo & Wiki is a human-facing projection, never a second source of truth. It exposes document and code navigation, full-text search, docs-to-code links, knowledge governance, and execution archives. Organization and workspace identity are enforced on query, index, archive, and promotion paths. - -### Expert Panel - -Panelists receive the same frozen question and evidence under differentiated lenses. Anonymous multi-round debate avoids identity anchoring. A deterministic Arbiter applies quorum, preserves minority opinions, and routes unsafe ambiguity to the Approval Queue. Distributed panelists run through the Worker Pool. - -### IM and proactive delivery - -Project IM supports groups, direct conversations, threads, search, attachments, agent mentions, progress streaming, and permission revalidation when project bindings change. Event-driven notifications and digests pass through content safety, path ACL, external-link, rate, and quiet-hours policies before delivery. - -### Oversight - -Correlation IDs connect event, route, context, worker claim, Session, provider turn, tool, artifact, approval, and outbound action. Operators can inspect Approval Queue items, dead letters, budgets, conflicts, takeovers, rollbacks, and final delivery without reconstructing state from logs. - -## Learning and Knowledge Governance - -Learning runs outside the interactive turn on idle, pause, project switch, and Session finalization triggers. Candidates enter the same DocumentStore lifecycle used by human governance. - -- Low-risk project candidates can pass deterministic auto-review. -- Medium-risk/global candidates use an isolated blank-thread reviewer with no Session history. -- Sensitive, strategic, regulated, or irreversible candidates require human review. -- Rejection status, reason, and fingerprint remain authoritative in DocumentStore; auxiliary indexes are rebuildable projections. -- Promotion changes the same document's status/version instead of copying it into a second identity. -- Released retrieval sets name a snapshot and carry evaluation matrix, baseline, repeats, and ablation verdict. +--- -A failed release gate restores the previous knowledge snapshot. Selected and rejected refs remain reproducible in run artifacts. +## code_intel — AI IDE Microservice -## Code Intelligence +The `code_intel` tool wraps the LSP stack as a **symbol-driven semantic API**. The agent specifies a symbol name and an intent; `code_intel` resolves line/column coordinates internally and returns `file:line` + code snippets. -The AI IDE surface combines: +```typescript +code_intel({ symbol: "AgentGateway.open", intent: "overview" }) +// → definition + type + references + callers + callees + doc summary +// full detail → evidence artifact (ref only in context) +``` -- semantic symbol lookup and intent-oriented `code_intel` queries; -- definitions, references, calls, imports, type hierarchy, diagnostics, and rename preview; -- unsaved-buffer `textDocument/didOpen`, `didChange`, `didSave`, and `didClose` synchronization; -- incremental code indexing with exact mtime I/O hints and content-SHA correctness authority; -- deterministic fallback to repository search/read when a language server is unavailable. +Supported intents: `definition · references · implementations · type · calls_in · calls_out · supertypes · subtypes · type_hints · hover · rename_preview · quick_fix · outline · diagnostics · overview` -Full LSP output stays in evidence artifacts. The model receives bounded summaries and precise source references. +Graceful degradation: if no LSP server is configured for the file type, returns a hint to use `grep/read`. Capability only grows, never drops. -## MCP and Credential Security +--- -MCP servers can be added from the curated catalog or configured manually through Desktop, HTTP, or CLI. Catalog risk tiers are derived from trusted templates rather than mutable user configuration. Servers default to disconnected; writes, external fetches, and privileged actions pass through runtime permission gates. +## MCP Catalog — Safety Model -Credentials use indirection rather than plaintext project configuration: +Each catalog entry carries a **risk tier** derived at load time from the catalog template. The tier is **not user-writable** — it is computed from the entry definition, preventing config-injection attacks. -- `${VAR}` and `${VAR:-default}` resolve at connection time; -- `secret://` handles resolve through macOS Keychain, Linux Secret Service, or Windows Credential Manager/DPAPI; -- environments without a native keyring require explicit approval for an audited local fallback outside the project repository; -- logs, artifacts, outbound messages, and config views redact resolved values. +| Tier | Examples | Default behavior | +|------|----------|-----------------| +| `read_only` | postgres-readonly | All ops auto-allowed | +| `write_guarded` | filesystem, github, git | Write ops require explicit approval | +| `external_fetch` | fetch, browser (Playwright) | External requests require explicit approval | -## Security Boundaries +**Credentials** are declared by key name in the catalog template (`CredentialSpec`). Values are filled at enable-time. -Autonomous execution passes four independent gates: +> **Known limitation (V3.4):** credential values are stored in plaintext in the local config file. Do not commit config files containing credentials to version control. A secure-storage mechanism (OS keyring, aligned with the codex approach) is planned for V3.5. -1. the event source is trusted for the workspace; -2. the actor has permission for the project and resource; -3. the Agent descriptor permits the trigger, capability, and autonomy level; -4. the runtime permits the concrete tool, path, network target, and side effect. +--- -Additional controls include durable budgets, rate limits, quiet hours, secret/path/link filtering, worktree isolation, hardened read-only Git, human approval, takeover, rollback, and complete audit correlation. +## Security Model Summary -## Repository Map +| Mechanism | Status | +|-----------|--------| +| MCP risk tier — catalog-derived, not config-injectable | ✅ V3.4 | +| MCP catalog defaults to not connected | ✅ V3.4 | +| Dangerous writes: approval gate (`ctx.ask`) | ✅ V3.4 | +| Read-only DB: restricted-mode enforced at server | ✅ V3.4 | +| Credential secure storage (OS keyring) | ⏳ V3.5 M-CRED | -| Area | Path | -|---|---| -| Core Session, documents, context, event, and policy algebra | `packages/core/src/` | -| CLI/server runtime, tools, Goal and event wiring | `packages/deepagent-code/src/` | -| Desktop/Web application UI | `packages/app/src/` | -| Electron host and isolated browser views | `packages/desktop/src/` | -| Provider abstraction | `packages/llm/` | -| Domain knowledge packs | `packages/domain-packs/` | -| Generated JavaScript SDK | `packages/sdk/js/` | +--- -## License and Source +## License -DeepAgent Code is licensed under **AGPL-3.0-or-later**. The canonical repository is [github.com/deepagent-ltd/deepagent-code](https://github.com/deepagent-ltd/deepagent-code). +DeepAgent Code is licensed under **AGPL-3.0-or-later**. +Source code: [github.com/lessweb/deepagent-code](https://github.com/lessweb/deepagent-code) -The project is derived from [opencode](https://github.com/sst/opencode) under the MIT License. Upstream attribution is preserved in [NOTICE](../NOTICE). +DeepAgent Code is derived from [opencode](https://github.com/sst/opencode) (MIT). +See `NOTICE` in the repository root for the full upstream attribution. diff --git a/github/README.md b/github/README.md index 86f4d99f..9d75e57b 100644 --- a/github/README.md +++ b/github/README.md @@ -88,7 +88,7 @@ This will walk you through installing the GitHub app, creating the workflow, and persist-credentials: false - name: Run deepagent-code - uses: lessweb/deepagent-code/github@latest + uses: deepagent-ltd/deepagent-code/github@latest env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -101,7 +101,7 @@ This will walk you through installing the GitHub app, creating the workflow, and ## Support -This is an early release. If you encounter issues or have feedback, please create an issue at https://github.com/lessweb/deepagent-code/issues. +This is an early release. If you encounter issues or have feedback, please create an issue at https://github.com/deepagent-ltd/deepagent-code/issues. ## Development diff --git a/github/action.yml b/github/action.yml index 47f9d13d..249fd2a9 100644 --- a/github/action.yml +++ b/github/action.yml @@ -45,7 +45,7 @@ runs: id: version shell: bash run: | - VERSION=$(curl -sf https://api.github.com/repos/lessweb/deepagent-code/releases/latest | grep -o '"tag_name": *"[^"]*"' | cut -d'"' -f4) + VERSION=$(curl -sf https://api.github.com/repos/deepagent-ltd/deepagent-code/releases/latest | grep -o '"tag_name": *"[^"]*"' | cut -d'"' -f4) echo "version=${VERSION:-latest}" >> $GITHUB_OUTPUT - name: Cache deepagent-code diff --git a/package.json b/package.json index 6e0cdade..4d838030 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "prepare": "husky", "random": "echo 'Random script'", "sso": "aws sso login --sso-session=deepagent-code --no-browser", - "test": "echo 'do not run tests from root' && exit 1" + "test": "bun run --cwd packages/app test && bun run --cwd packages/ui test" }, "workspaces": { "packages": [ diff --git a/packages/app/README.md b/packages/app/README.md index 9040c386..1bf37cbd 100644 --- a/packages/app/README.md +++ b/packages/app/README.md @@ -1,33 +1,32 @@ -## Usage +# @deepagent-code/app — Desktop Application -Dependencies for these templates are managed with [pnpm](https://pnpm.io) using `pnpm up -Lri`. +SolidJS front-end shell for the DeepAgent Code desktop app (Electron/Tauri). -This is the reason you see a `pnpm-lock.yaml`. That said, any package manager will work. This file can safely be removed once you clone a template. +## Stack -```bash -$ npm install # or pnpm install or yarn install -``` - -### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs) - -## Available Scripts +- **UI:** SolidJS + Vite (Bun) +- **Backend:** `deepagent-code` package spawned as a local server or connected via the server-mode gateway +- **Build output:** `dist/` — consumed by the Electron/Tauri packager in CI -In the project directory, you can run: +## Development -### `npm run dev` or `npm start` +```bash +# from repo root +bun install +bun run dev # hot-reload dev server +``` -Runs the app in the development mode.