repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
deepagents | libs/code/deepagents_code/goal_rubric.py | .py | """Server-side helpers for drafting acceptance criteria from goal objectives."""
from __future__ import annotations
import inspect
import json
import logging
import threading
from collections import OrderedDict
from typing import TYPE_CHECKING, Annotated, Any, Literal, NotRequired, cast
from deepagents.middleware.fi... | 1,507 | 55,655 |
deepagents | libs/code/deepagents_code/approval_mode.py | .py | """Approval-mode state shared by the Textual client and agent server."""
from __future__ import annotations
import contextlib
import inspect
import json
import logging
import os
import tempfile
import threading
from collections.abc import Iterator, Mapping
from contextlib import contextmanager
from enum import StrEnu... | 596 | 19,224 |
deepagents | libs/code/deepagents_code/_invocation.py | .py | """Resolution of the command name this process was launched with.
Hints that tell the user how to resume a thread have to echo a command the user
can actually paste back. `dcode` is only one of the names that reach this code:
the package ships both `deepagents-code` and `dcode` console scripts, and
per-project shims (... | 134 | 5,371 |
deepagents | libs/code/deepagents_code/_startup_error.py | .py | """Stderr marker emission used by the langgraph server graph entry point.
Lives in its own module so unit tests can exercise the marker contract
without triggering `server_graph.make_graph()` at import time.
"""
from __future__ import annotations
import logging
import sys
import traceback
logger = logging.getLogger... | 46 | 1,796 |
deepagents | libs/code/deepagents_code/reliable_rubric.py | .py | """Rubric middleware retries for transient grader transport failures."""
from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Any, NotRequired, cast
import httpx
from deepagents.middleware.rubric import (
RUBRIC_GRADER_MESSAGE_SOURCE,
GraderResponse,
RubricMiddleware,
R... | 346 | 11,427 |
deepagents | libs/code/deepagents_code/server_graph.py | .py | """Server-side graph entry point for `langgraph dev`.
This module is referenced by the generated `langgraph.json` and exposes a graph
factory that the LangGraph server can load and serve.
The graph is created by `make_graph()`, which reads configuration from
`ServerConfig.from_env()` — the same dataclass the CLI uses... | 423 | 16,620 |
deepagents | libs/code/deepagents_code/offload_middleware.py | .py | """CLI-specific conversation compaction middleware."""
from __future__ import annotations
import asyncio
import hashlib
import logging
from functools import partial
from pathlib import Path
from typing import TYPE_CHECKING, Annotated, Any, NamedTuple, cast
from deepagents.backends.protocol import FILE_NOT_FOUND
from... | 821 | 31,567 |
deepagents | libs/code/deepagents_code/tool_catalog.py | .py | """Enumerate the tools available to the agent.
Backs two entry points: the `dcode tools list` CLI command (`_run_tools_list`)
and the interactive `/tools` slash command (`app._handle_tools_command`).
The tool set is read from the *real* tool objects the agent binds rather than a
hand-maintained catalog, so names and ... | 568 | 23,065 |
deepagents | libs/code/deepagents_code/terminal_capabilities.py | .py | """Terminal capability detection.
Detect optional terminal features without reading from `stdin`.
The app only uses kitty-keyboard-protocol support to choose a user-facing
newline shortcut label. To keep startup safe on remote or high-latency PTYs,
detection is conservative and relies on side-effect-free terminal ide... | 116 | 3,894 |
deepagents | libs/code/deepagents_code/json_types.py | .py | """Shared recursive types for JSON-compatible data."""
from typing import TypeAlias
from pydantic import JsonValue as PydanticJsonValue, TypeAdapter
JsonScalar: TypeAlias = str | int | float | bool | None
JsonValue: TypeAlias = PydanticJsonValue
JsonObject: TypeAlias = dict[str, JsonValue]
JSON_VALUE_ADAPTER = Type... | 13 | 385 |
deepagents | libs/code/deepagents_code/config.py | .py | """Configuration, constants, and model creation."""
from __future__ import annotations
import functools
import importlib
import json
import keyword
import logging
import os
import re
import shlex
import shutil
import sys
import threading
from collections.abc import Mapping
from dataclasses import dataclass, field as ... | 5,362 | 206,050 |
deepagents | libs/code/deepagents_code/mcp_disabled.py | .py | """Persistent store of MCP server names the user has disabled.
Disabled servers are skipped at config merge time so their tools never
reach the agent and no connection is attempted. State lives under
`[mcp].disabled_servers` in `~/.deepagents/config.toml`, alongside the
user's other MCP configuration.
The store keys ... | 213 | 6,756 |
deepagents | libs/code/deepagents_code/tools.py | .py | """Custom tools for the agent."""
from __future__ import annotations
import contextlib
import ipaddress
import logging
import socket
import threading
from html.parser import HTMLParser
from typing import TYPE_CHECKING, Annotated, Any, Literal
from urllib.parse import urljoin, urlparse
from langchain_core.tools impor... | 505 | 17,911 |
deepagents | libs/code/deepagents_code/_debug.py | .py | """Shared debug-logging configuration for runtime and file-based tracing.
When the `DEEPAGENTS_CODE_DEBUG` environment variable is set, modules that handle
streaming or remote communication can enable detailed file-based logging. This
helper centralizes the setup so the env-var names, file path, log level, and
format ... | 149 | 5,758 |
deepagents | libs/code/deepagents_code/mcp_auth.py | .py | """OAuth login flow and token storage for MCP servers.
Note: `mcp.shared.auth.OAuthToken` is a pydantic model whose default
`repr` includes the access and refresh token strings verbatim. Never
log one via `%r`, `str()`, f-string interpolation, or
`logger.exception`/`exc_info` on an exception that wraps one — the
token... | 2,192 | 89,574 |
deepagents | libs/code/deepagents_code/cost_tracking.py | .py | """Estimate and persist cumulative model cost for each thread.
The graph owns the durable total. `CostTrackingMiddleware` is the only writer of
`_session_cost_usd`, so each cost update rides the model checkpoint and works for
local, headless, and remote graph execution without a client-side state update.
The client is... | 2,428 | 104,572 |
deepagents | libs/code/deepagents_code/memory_guard.py | .py | """Protect machine-managed memory blocks from agent edits.
The onboarding flow writes the user's preferred name into the user `AGENTS.md`
inside a marker-delimited block (see `onboarding.ONBOARDING_NAME_MEMORY_START` /
`ONBOARDING_NAME_MEMORY_END`). `MemoryMiddleware` strips HTML comments before
injecting memory, so t... | 475 | 19,571 |
deepagents | libs/code/deepagents_code/paste_collapse.py | .py | r"""Large paste collapsing for the chat input.
When the user pastes text exceeding a size or line threshold, the full text
is stored off-screen and a compact `[Pasted text #N +M lines]` placeholder
is inserted into the input box instead. At submission time the placeholder
is expanded back to the original content so t... | 104 | 3,153 |
deepagents | libs/code/deepagents_code/auth_display.py | .py | """Shared provider auth status formatting."""
from __future__ import annotations
from typing import TYPE_CHECKING, assert_never
from textual.content import Content
from deepagents_code.model_config import (
CODEX_PROVIDER,
ProviderAuthSource,
ProviderAuthState,
ProviderAuthStatus,
resolved_env_v... | 186 | 6,573 |
deepagents | libs/code/deepagents_code/event_bus.py | .py | """External event ingress for the Textual app.
Exposes a small `EventSource` protocol plus a Unix-domain-socket implementation
that lets local processes push commands, prompts, and signals into a running
session over a newline-delimited JSON wire protocol.
!!! warning "Experimental"
The wire format and configura... | 412 | 14,892 |
deepagents | libs/code/deepagents_code/media_utils.py | .py | """Utilities for handling image and video media from clipboard and files."""
import base64
import io
import logging
import os
import pathlib
import re
import shutil
# S404: subprocess needed for clipboard access via pngpaste/osascript
import subprocess # noqa: S404
import sys
import tempfile
from collections import ... | 636 | 21,650 |
deepagents | libs/code/deepagents_code/_fake_models.py | .py | """Fake chat model base shared by integration tests and tool enumeration.
Holds the tool-binding base that both the local integration-test fakes
(`_testing_models`) and the `dcode tools list` tool-enumeration path
(`tool_catalog._CatalogModel`) build on. It lives in a use-neutral module — not
under a `_testing_`-prefi... | 67 | 2,776 |
deepagents | libs/code/deepagents_code/doctor.py | .py | """The `dcode doctor` command: report install health and diagnostics.
Inspired by `claude doctor`, this prints a grouped, tree-style summary of the
running install, update status, and configuration locations so the output is
safe to paste into a bug report. It stays offline: the update section reads
only the local cac... | 637 | 22,221 |
deepagents | libs/code/deepagents_code/agent.py | .py | """Agent management and creation."""
from __future__ import annotations
import functools
import inspect
import logging
import os
import re
import shutil
import tomllib
import warnings
from dataclasses import dataclass
from pathlib import Path, PurePosixPath
from typing import TYPE_CHECKING, Any, cast
from deepagents... | 3,078 | 125,934 |
deepagents | libs/code/deepagents_code/_paths.py | .py | """Filesystem-path classification shared by the diagnostic CLI commands.
`dcode doctor` and `dcode config path` both probe whether config locations
exist. `Path.exists()` can report `False` for `OSError` cases such as EACCES
when a parent directory denies traversal, so a bare `.exists()` can hide the
very permissions ... | 70 | 2,219 |
deepagents | libs/code/deepagents_code/formatting.py | .py | """Lightweight text-formatting helpers.
Keep this module free of heavy dependencies so it can be imported anywhere
in the app without pulling in large frameworks.
"""
from __future__ import annotations
import locale
import logging
import subprocess # noqa: S404
import sys
from datetime import UTC, datetime
from fun... | 136 | 4,862 |
deepagents | libs/code/deepagents_code/theme.py | .py | """LangChain brand colors and semantic constants for the app.
Single source of truth for color values used in Python code (Rich markup,
`Content.styled`, `Content.from_markup`). CSS-side styling should reference
Textual CSS variables: built-in variables
(`$primary`, `$background`, `$text-muted`, `$error-muted`, etc.)... | 892 | 29,692 |
deepagents | libs/code/deepagents_code/_debug_buffer.py | .py | r"""In-memory ring buffer of recent log records for the in-app Debug Console.
A lightweight `logging.Handler` keeps the most recent structured log records in
bounded per-level `deque`s so the Debug Console (`Ctrl+\`) can show a live tail
without requiring the opt-in file logging from `_debug.configure_debug_logging`.
... | 251 | 9,964 |
deepagents | libs/code/deepagents_code/mcp_login_service.py | .py | """UI-agnostic helpers for resolving an MCP login target.
The MCP login flow historically inlined config discovery, trust gating,
shape validation, and `print()`-based error reporting. The TUI cannot
consume those print statements, so this module extracts the same logic
into pure functions that return structured resul... | 556 | 20,968 |
deepagents | libs/code/deepagents_code/client/non_interactive.py | .py | """Non-interactive execution mode.
Provides `run_non_interactive` which runs a single user task against the
agent graph, streams results to stdout, and exits with an appropriate code.
The agent runs inside a `langgraph dev` server subprocess, connected via
the `RemoteAgent` client (see `server_manager.server_session`... | 2,283 | 90,263 |
deepagents | libs/code/deepagents_code/client/remote_client.py | .py | """Remote agent client — thin wrapper around LangGraph's `RemoteGraph`.
Delegates streaming, state management, and SSE handling to
`langgraph.pregel.remote.RemoteGraph`. This wrapper converts streamed message
dicts into LangChain message objects for the app's Textual adapter, but leaves
state snapshots in the server's... | 789 | 28,112 |
deepagents | libs/code/deepagents_code/client/launch/server.py | .py | """LangGraph server lifecycle management for the app.
Handles starting/stopping a `langgraph dev` server process and generating the
required `langgraph.json` configuration file.
"""
from __future__ import annotations
import asyncio
import contextlib
import json
import logging
import os
import signal
import subproces... | 1,105 | 42,121 |
deepagents | libs/code/deepagents_code/client/launch/server_manager.py | .py | """Server lifecycle orchestration for the app.
Provides `start_server_and_get_agent` which handles the full flow of:
1. Building a `ServerConfig` from application arguments
2. Writing config to env vars via `ServerConfig.to_env()`
3. Scaffolding a workspace (langgraph.json, checkpointer, pyproject)
4. Starting the `l... | 591 | 23,862 |
deepagents | libs/code/deepagents_code/client/commands/mcp.py | .py | """CLI commands of the MCP module."""
from __future__ import annotations
import sys
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
import argparse
from collections.abc import Callable
from deepagents_code.mcp_login_service import ConfigResolutionError
def _lazy_ui_help(fn_name: str) -> Callab... | 301 | 11,176 |
deepagents | libs/code/deepagents_code/client/commands/extras.py | .py | """CLI install path for optional deepagents-code extras.
`dcode install <name>` installs a curated optional extra (for example a sandbox
or model-provider dependency) into the current `dcode` environment. The legacy
global flags `dcode --install <name>` / `--package` / `--yes` remain as
compatible aliases and call the... | 305 | 11,226 |
deepagents | libs/code/deepagents_code/client/commands/auth.py | .py | """CLI commands for the `auth` group: manage stored provider credentials.
These subcommands mirror the in-TUI `/auth` modal verbs so credentials can be
managed non-interactively (dotfile bootstrap, CI, remote boxes) without
launching the Textual app:
- `auth list` — one row per known provider with its resolution stat... | 542 | 18,717 |
deepagents | libs/code/deepagents_code/client/commands/config.py | .py | """CLI commands for inspecting the configuration surface.
Bare `config` resolves each option against the app credential store (for
credentials), the live environment, and `config.toml`, reporting the effective
value and which source provided it. `config get <key>` reports the same for a
single option, and `config get ... | 924 | 32,502 |
deepagents | libs/code/deepagents_code/client/commands/tools.py | .py | """The `dcode tools` command group: provision managed external tools.
`dcode tools install` fetches the pinned, SHA-256-verified ripgrep binary into
`~/.deepagents/bin` (the same managed path used on first run) and is also handy
for repairing a missing or stale `rg`. The install script calls this verb
instead of re-en... | 419 | 15,636 |
deepagents | libs/code/deepagents_code/hooks/transcript.py | .py | """Client-owned conversation transcript projections for Hooks v2.
Materializes versioned per-thread and per-subagent JSONL files that hook
commands can read via `transcript_path` / `agent_transcript_path`.
Lag semantics:
The on-disk JSONL may lag behind live checkpoint/UI state. Callers that need
the just-fin... | 646 | 22,109 |
deepagents | libs/code/deepagents_code/hooks/server_middleware.py | .py | """Server-owned Hooks v2 lifecycle middleware.
Emits `PreCompact`, `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `Stop`,
`SubagentStart`, and `SubagentStop` through the LangGraph interrupt channel so the
client runtime can execute matching handlers and return typed decisions.
"""
from __future__ import annotatio... | 1,356 | 45,932 |
deepagents | libs/code/deepagents_code/hooks/client_lifecycle.py | .py | """Client-owned Hooks v2 lifecycle facade."""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import TYPE_CHECKING
from uuid import UUID
from deepagents_code.approval_mode import ApprovalMode
from deepagents_code.hooks.models.domain import (
CompactTrigger,
DcodeNotifi... | 418 | 13,416 |
deepagents | libs/code/deepagents_code/hooks/legacy.py | .py | """Lightweight hook dispatch for external tool integration.
DEPRECATED: This is the legacy hook system, kept for backward compatibility
until September 1, 2026. New integrations should use Hooks v2 — see
`deepagents_code.hooks.loading` for config locations and
`deepagents_code.hooks.models` for the schema. Legacy docu... | 364 | 15,775 |
deepagents | libs/code/deepagents_code/hooks/loading.py | .py | """Validated Hooks v2 configuration loading, merging, and hashing.
Precedence (highest first, earlier in reduction order):
1. Project: `{project_root}/.deepagents/hooks.json`
2. User: `~/.deepagents/hooks.json` (or `config_dir/hooks.json` in tests)
3. Plugin: `hooks.json` documents contributed by enabled plugins
Sou... | 548 | 18,963 |
deepagents | libs/code/deepagents_code/hooks/interrupt.py | .py | """Client↔server interrupt transport for Hooks v2 server-owned events."""
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Literal, TypeAlias
from pydantic import BaseModel, ConfigDict, TypeAdapter
from deepagents_code.hooks.models.adapters import (
HOOK_INVOCATION_RESPONSE_ADAPTER,
)
f... | 122 | 3,682 |
deepagents | libs/code/deepagents_code/hooks/runtime.py | .py | """Session-scoped client facade for the Hooks v2 runtime."""
from __future__ import annotations
from dataclasses import dataclass
from pathlib import ( # noqa: TC003 - used in runtime fields and path joins
Path,
)
from typing import TYPE_CHECKING
from deepagents_code.hooks.client import HookFulfillmentLedger
fr... | 243 | 8,964 |
deepagents | libs/code/deepagents_code/hooks/presenter.py | .py | """User-facing presentation for Hooks v2 execution.
`HookPresenter` is the single place that turns hook results into something a
person sees. It is owned by `HooksManager`, handed to every runtime that
manager loads, and kept alive across reloads so its output sinks can be
rebound once a UI exists without any other ob... | 218 | 7,428 |
deepagents | libs/code/deepagents_code/hooks/reducer.py | .py | """Event-aware reduction for Hooks v2 command output."""
from __future__ import annotations
from dataclasses import dataclass, field
from functools import singledispatch
from typing import TYPE_CHECKING
from deepagents_code.hooks.capabilities import (
ExitCodePolicy,
PlainOutputPolicy,
get_event_spec,
)
... | 561 | 17,819 |
deepagents | libs/code/deepagents_code/hooks/trust.py | .py | """Persistent workspace trust for project-scoped hooks."""
from __future__ import annotations
import hashlib
import json
import logging
import os
import tempfile
import threading
from contextlib import contextmanager, suppress
from dataclasses import dataclass, replace
from datetime import UTC, datetime
from pathlib ... | 527 | 17,248 |
deepagents | libs/code/deepagents_code/hooks/manager.py | .py | """Single-owner coordinator for client-side Hooks v2 state.
`HooksManager` is the only place in the client that builds or holds a
`HooksRuntime`. The Textual app, the Textual stream adapter, and the headless
runner each hold a manager and call intention-revealing lifecycle methods on
it; none of them inspect the runti... | 653 | 22,735 |
deepagents | libs/code/deepagents_code/hooks/runner.py | .py | """Bounded asynchronous command execution for Hooks v2."""
from __future__ import annotations
import asyncio
import contextlib
import ctypes
import json
import ntpath
import os
import signal
from contextlib import suppress
from dataclasses import dataclass
from typing import TYPE_CHECKING
from pydantic import Valida... | 345 | 11,543 |
deepagents | libs/code/deepagents_code/hooks/__init__.py | .py | """Hook contracts and compatibility dispatch.
This package contains two hook systems: Hooks v2 (current) and legacy hooks
(deprecated, removal September 1, 2026).
To write a new hook integration, use the v2 config format — see
`deepagents_code.hooks.loading` for file locations and precedence, and
`deepagents_code.hoo... | 37 | 1,083 |
deepagents | libs/code/deepagents_code/hooks/snapshot.py | .py | """Immutable runtime snapshots for Hooks v2 configuration."""
from __future__ import annotations
import logging
import re
from dataclasses import dataclass
from types import MappingProxyType
from typing import TYPE_CHECKING
from deepagents_code.hooks.capabilities import HookOwner, get_event_spec
from deepagents_code... | 280 | 10,237 |
deepagents | libs/code/deepagents_code/hooks/engine.py | .py | """Standalone orchestration for the Hooks v2 execution engine."""
from __future__ import annotations
import asyncio
import logging
from dataclasses import dataclass, field
from typing import TYPE_CHECKING
from deepagents_code.hooks.capabilities import get_event_spec
from deepagents_code.hooks.env import sanitize_hoo... | 171 | 5,511 |
deepagents | libs/code/deepagents_code/hooks/client.py | .py | """Client-side fulfillment for server-owned Hooks v2 interrupts."""
from __future__ import annotations
import asyncio
from dataclasses import dataclass, field
from typing import TYPE_CHECKING
from uuid import UUID
from deepagents_code.hooks.interrupt import (
build_hook_resume_value,
parse_hook_interrupt_pay... | 153 | 4,884 |
deepagents | libs/code/deepagents_code/hooks/capabilities.py | .py | """Capability registry for Hooks v2 events."""
from __future__ import annotations
from dataclasses import dataclass
from enum import StrEnum
from types import MappingProxyType
from typing import TYPE_CHECKING, Final, Literal, TypeAlias, assert_never
from deepagents_code.hooks.models.domain import (
HookEvent,
... | 288 | 11,017 |
deepagents | libs/code/deepagents_code/hooks/context.py | .py | """Helpers for attaching Hooks v2 session identity to graph context."""
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from deepagents_code._cli_context import CLIContext
from deepagents_code.hooks.runtime import HooksRuntime
def apply_hooks_context(
context: CLIC... | 39 | 1,167 |
deepagents | libs/code/deepagents_code/hooks/permissions.py | .py | """Translation between `PermissionRequest` decisions and HITL review payloads.
Shared by the Textual and headless approval paths so both surfaces resolve
hook-driven permission decisions identically.
"""
from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING, Literal, N... | 161 | 4,994 |
deepagents | libs/code/deepagents_code/hooks/validate_terminal_sequence.py | .py | """Terminal escape-sequence validation for hook output."""
from __future__ import annotations
import re
_ALLOWED_SEQUENCE = re.compile(
r"(?:"
r"\x1b\](?:0|1|2|9|99|777);[^\x00-\x1f\x7f-\x9f]*(?:\x07|\x1b\\)"
r"|"
r"\x07"
r")+"
)
def validate_terminal_sequence(value: str) -> str | None:
"""... | 31 | 803 |
deepagents | libs/code/deepagents_code/hooks/projection.py | .py | """Projection from Hooks v2 domain invocations to compatible wire input."""
from __future__ import annotations
from functools import singledispatch
from typing import TYPE_CHECKING, NotRequired, TypedDict
from deepagents_code.approval_mode import ApprovalMode
from deepagents_code.hooks.models.adapters import HOOK_WI... | 406 | 12,165 |
deepagents | libs/code/deepagents_code/hooks/envelope.py | .py | """Canonical boundary between hook domain and wire models."""
from __future__ import annotations
from typing import TYPE_CHECKING
from deepagents_code.hooks.projection import project_hook_input, serialize_hook_input
from deepagents_code.hooks.reducer import reduce_hook_results
if TYPE_CHECKING:
from collections... | 79 | 2,246 |
deepagents | libs/code/deepagents_code/hooks/tools.py | .py | """Native dcode tool vocabulary mapped to compatible wire names."""
from __future__ import annotations
import re
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from collections.abc import Callable
from deepagents_code.hooks.models.domain import ToolCallData
from deepagents_code.json_types import Jso... | 148 | 4,299 |
deepagents | libs/code/deepagents_code/hooks/env.py | .py | """Sanitized subprocess environments for Hooks v2 command handlers."""
from __future__ import annotations
import os
from typing import TYPE_CHECKING
from deepagents_code.config_manifest import _is_secret_env
if TYPE_CHECKING:
from collections.abc import Mapping
# Shared bound for legacy hook subprocesses and t... | 34 | 1,086 |
deepagents | libs/code/deepagents_code/hooks/migration.py | .py | """Legacy dotted-event migration helpers for Hooks v2 configuration.
Legacy documents are converted by the loader so lifecycle call sites dispatch
only canonical events and do not duplicate old dotted-event hooks.
`_LEGACY_EVENT_MAP` is the authoritative list of legacy events migrated into
Hooks v2. Events absent fro... | 196 | 7,034 |
deepagents | libs/code/deepagents_code/hooks/models/transport.py | .py | """Versioned hook invocation transport models."""
from __future__ import annotations
from datetime import ( # noqa: TC003 - Pydantic resolves model annotations at runtime.
datetime,
)
from typing import Literal
from uuid import UUID # noqa: TC003 - Pydantic resolves model annotations at runtime.
from pydantic ... | 41 | 1,043 |
deepagents | libs/code/deepagents_code/hooks/models/wire.py | .py | """External JSON-compatible hook input and output models."""
from __future__ import annotations
from enum import StrEnum
from typing import Annotated, Literal, TypeAlias
from uuid import (
UUID, # ruff:ignore[typing-only-standard-library-import] - Pydantic resolves model annotations at runtime.
)
from pydantic ... | 499 | 14,749 |
deepagents | libs/code/deepagents_code/hooks/models/domain.py | .py | """Domain models for hook lifecycle invocations and decisions."""
from __future__ import annotations
from enum import StrEnum
from pathlib import (
Path, # ruff:ignore[typing-only-standard-library-import] - Pydantic resolves model annotations at runtime.
)
from typing import TYPE_CHECKING, Annotated, Any, Litera... | 470 | 12,647 |
deepagents | libs/code/deepagents_code/hooks/models/adapters.py | .py | """Cached runtime validators for hook model boundaries."""
from pydantic import TypeAdapter
from deepagents_code.hooks.models.config import HooksConfig
from deepagents_code.hooks.models.domain import (
HookDecision,
HookDomainEvent,
HookInvocation,
)
from deepagents_code.hooks.models.transport import (
... | 25 | 909 |
deepagents | libs/code/deepagents_code/hooks/models/config.py | .py | """Validated hook configuration models."""
from __future__ import annotations
from typing import Literal, TypeAlias
from pydantic import BaseModel, ConfigDict, Field, field_validator
from deepagents_code.hooks.models.domain import ( # ruff:ignore[typing-only-first-party-import] - Pydantic runtime annotation.
H... | 76 | 2,533 |
deepagents | libs/code/deepagents_code/tui/textual_adapter.py | .py | """Textual UI adapter for agent execution."""
from __future__ import annotations
import asyncio
import contextlib
import inspect
import logging
import math
import time
import uuid
from typing import TYPE_CHECKING, Any, NamedTuple, cast
import httpx
if TYPE_CHECKING:
from collections.abc import (
AsyncIt... | 3,607 | 178,280 |
deepagents | libs/code/deepagents_code/tui/widgets/cwd_switch.py | .py | """Prompt for switching cwd when resuming or switching threads."""
from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar, Literal, assert_never, cast
from textual.binding import Binding, BindingType
from textual.containers import Vertical
from textual.content import Content
from textual.scree... | 326 | 11,581 |
deepagents | libs/code/deepagents_code/tui/widgets/launch_init.py | .py | """Onboarding screens for the interactive TUI."""
from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Any, ClassVar
from textual.app import ScreenStackError
from textual.binding import Binding, BindingType
from textual.containers import Vertical, VerticalScroll
from textual.content im... | 658 | 22,614 |
deepagents | libs/code/deepagents_code/tui/widgets/_paste_textarea.py | .py | """Shared paste handling for text-area inputs.
Terminals deliver a paste in one of two shapes: a single bracketed `Paste`
event, or — when bracketed paste is unavailable — a rapid stream of individual
key events. Both the primary chat input and the inline free-text prompts need
to (a) keep a multi-line paste grouped i... | 689 | 29,155 |
deepagents | libs/code/deepagents_code/tui/widgets/_inline_prompt.py | .py | """Shared primitives for inline prompts."""
from __future__ import annotations
import asyncio
import logging
import time
from collections import Counter
from typing import TYPE_CHECKING, Any, Generic, TypeVar
from textual.containers import Horizontal
from textual.content import Content
from textual.message import Me... | 432 | 15,598 |
deepagents | libs/code/deepagents_code/tui/widgets/update_progress.py | .py | """Progress modal for app self-update installs."""
from __future__ import annotations
from collections import deque
from typing import TYPE_CHECKING, ClassVar
from textual.binding import Binding, BindingType
from textual.containers import Horizontal, Vertical
from textual.screen import ModalScreen
from textual.widge... | 328 | 10,672 |
deepagents | libs/code/deepagents_code/tui/widgets/approval.py | .py | """Approval widget for HITL - using standard Textual patterns."""
from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Any, ClassVar
from textual.binding import Binding, BindingType
from textual.containers import Container, Vertical, VerticalScroll
from textual.content import Content
f... | 739 | 31,244 |
deepagents | libs/code/deepagents_code/tui/widgets/ask_user.py | .py | """Ask user widget for interactive questions during agent execution."""
from __future__ import annotations
import logging
import re
from typing import TYPE_CHECKING, Any, ClassVar, Literal
from textual.binding import Binding, BindingType
from textual.containers import Container, Vertical
from textual.message import ... | 543 | 20,622 |
deepagents | libs/code/deepagents_code/tui/widgets/welcome.py | .py | """Welcome banner widget."""
from __future__ import annotations
import asyncio
import logging
from pathlib import Path
from typing import TYPE_CHECKING, Any, Final
from textual.color import Color as TColor
from textual.content import Content
from textual.style import Style as TStyle
from textual.widgets import Stati... | 604 | 22,603 |
deepagents | libs/code/deepagents_code/tui/widgets/effort_selector.py | .py | """Interactive reasoning effort selector for `/effort`."""
from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from textual.binding import Binding, BindingType
from textual.containers import Vertical
from textual.content import Content
from textual.css.query import NoMatches
from textual.sc... | 189 | 6,066 |
deepagents | libs/code/deepagents_code/tui/widgets/tool_renderers.py | .py | """Tool renderers for approval widgets - registry pattern."""
from __future__ import annotations
import difflib
import logging
from typing import TYPE_CHECKING, Any
from deepagents_code.diff_utils import split_diff_lines
from deepagents_code.file_ops import (
build_approval_preview,
format_display_path,
... | 282 | 11,537 |
deepagents | libs/code/deepagents_code/tui/widgets/startup_tip.py | .py | """Startup tip widget shown above the chat input."""
from __future__ import annotations
import random
from typing import Any
from textual.content import Content
from textual.widgets import Static
from deepagents_code._env_vars import HIDE_SPLASH_TIPS, is_env_truthy
from deepagents_code.editor import editor_display_... | 144 | 5,776 |
deepagents | libs/code/deepagents_code/tui/widgets/goal_review.py | .py | """Goal acceptance-criteria review widget."""
from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar, Literal, TypedDict
from textual.binding import Binding, BindingType
from textual.containers import Container, Vertical, VerticalScroll
from textual.content import Content
from textual.message ... | 417 | 14,899 |
deepagents | libs/code/deepagents_code/tui/widgets/notification_center.py | .py | """Notification center modal for pending actionable notices.
Surfaces a list of `PendingNotification` entries as single-line rows.
Selecting a row drills into a dedicated detail modal
(`UpdateAvailableScreen` for update entries, `NotificationDetailScreen`
otherwise) stacked on top of the center. When the detail modal
... | 457 | 16,302 |
deepagents | libs/code/deepagents_code/tui/widgets/loading.py | .py | """Loading widget with animated spinner for agent activity."""
from __future__ import annotations
from time import time
from typing import TYPE_CHECKING
from textual.containers import Horizontal
from textual.content import Content
from textual.widgets import Static
from deepagents_code.config import get_glyphs
from... | 228 | 7,446 |
deepagents | libs/code/deepagents_code/tui/widgets/update_confirm.py | .py | """Confirmation modals for `/update` dependency-refresh flows in the TUI.
When `deepagents-code` itself is already on the latest release, `/update` can
still re-resolve its dependencies to the newest versions allowed by the pinned
ranges (e.g. a new `langchain-openai`). The already-current path dry-runs the
resolution... | 185 | 6,337 |
deepagents | libs/code/deepagents_code/tui/widgets/diff.py | .py | """Renderers turning a unified diff into one `Static` per row.
Rows carry a line-number gutter, a `+`/`-` marker, syntax highlighting lifted
from whole-file lexer state, and word-level emphasis on the spans that actually
changed between a paired removed/added line.
"""
from __future__ import annotations
import loggi... | 687 | 29,371 |
deepagents | libs/code/deepagents_code/tui/widgets/plugin_reload.py | .py | """Confirmation modal offered after reload-relevant plugin changes."""
from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar, Literal
from textual.binding import Binding, BindingType
from textual.containers import Vertical
from textual.screen import ModalScreen
from textual.widgets import Sta... | 97 | 2,697 |
deepagents | libs/code/deepagents_code/tui/widgets/__init__.py | .py | """Textual widgets for `deepagents-code`.
Import directly from submodules, e.g.:
```python
from deepagents_code.tui.widgets.chat_input import ChatInput
from deepagents_code.tui.widgets.messages import AssistantMessage
```
"""
| 10 | 244 |
deepagents | libs/code/deepagents_code/tui/widgets/_copy_spans.py | .py | """Shared click-to-copy span metadata for Textual widgets.
Widgets that render `label: value` rows (the debug console snapshot, the welcome
banner) mark individual value spans as copyable by embedding the copy text and a
toast label in the span's style meta. Keeping the meta keys and the
build/extract pair here means ... | 53 | 1,785 |
deepagents | libs/code/deepagents_code/tui/widgets/notification_settings.py | .py | """Notification settings screen for `/notifications` command."""
from __future__ import annotations
import asyncio
import logging
from typing import TYPE_CHECKING, ClassVar
from textual.binding import Binding, BindingType
from textual.containers import VerticalGroup
from textual.screen import ModalScreen
from textua... | 178 | 5,740 |
deepagents | libs/code/deepagents_code/tui/widgets/subagent_panel.py | .py | """Live panel showing subagents fanned out from within `js_eval` calls.
When the agent writes code that calls the top-level `task()` global, each
dispatch runs as a subagent *inside* a single `js_eval` tool call which is
invisible to the normal message stream. The QuickJS task bridge emits
lifecycle events on the cust... | 944 | 34,992 |
deepagents | libs/code/deepagents_code/tui/widgets/auth.py | .py | """TUI screens for managing stored model-provider credentials.
`AuthPromptScreen` accepts an API key for a single provider, persists it via
`auth_store`, and is the sole place that deletes existing credentials (after
a `DeleteCredentialConfirmScreen` confirmation). `AuthManagerScreen` lists
known providers and routes ... | 1,998 | 80,338 |
deepagents | libs/code/deepagents_code/tui/widgets/agent_selector.py | .py | """Interactive agent selector screen for `/agents` command."""
from __future__ import annotations
import asyncio
import contextlib
import logging
from typing import TYPE_CHECKING, ClassVar
from textual.binding import Binding, BindingType
from textual.containers import Vertical
from textual.content import Content
fro... | 421 | 15,609 |
deepagents | libs/code/deepagents_code/tui/widgets/goal_status.py | .py | """Persistent inline display for the current goal."""
from __future__ import annotations
from typing import TYPE_CHECKING
from textual.content import Content
from textual.widgets import Static
if TYPE_CHECKING:
from deepagents_code.resume_state import GoalStatus
class GoalStatusPanel(Static):
"""Keep the ... | 51 | 1,579 |
deepagents | libs/code/deepagents_code/tui/widgets/_js_eval_display.py | .py | """Helpers for displaying `js_eval` tool output."""
from __future__ import annotations
import re
from dataclasses import dataclass
@dataclass(frozen=True, slots=True)
class JsEvalStdout:
"""Captured stdout printed during a `js_eval` evaluation."""
body: str
"""Stdout text, verbatim (the wire format doe... | 140 | 4,975 |
deepagents | libs/code/deepagents_code/tui/widgets/restart_prompt.py | .py | """Confirmation modal offered when a change needs an owned-server respawn.
Some changes take effect only when the app-owned LangGraph server subprocess
spawns: provider/sandbox extras and `--package` installs are imported at spawn
time, and a Tavily key saved via `/auth` binds the `web_search` tool only at
spawn time.... | 159 | 5,359 |
deepagents | libs/code/deepagents_code/tui/widgets/auto_mode_notice.py | .py | """First-enable confirmation modal for Auto mode.
Shown at most once per install (per notice version) after Auto successfully
becomes active. Enter keeps Auto and records the notice; Esc reverts to Manual
and leaves the notice unsaved so it can appear again next time.
"""
from __future__ import annotations
from typi... | 236 | 8,626 |
deepagents | libs/code/deepagents_code/tui/widgets/debug_console.py | .py | r"""Read-only in-app Debug Console modal.
Toggled with `Ctrl+\` (or the hidden `/debug` command), this overlay shows a
live session/runtime snapshot plus a live tail of recent
`deepagents_code.*` log records sourced from the in-memory ring buffer in
`_debug_buffer`. The snapshot is seeded at open and, when the host su... | 1,269 | 49,345 |
deepagents | libs/code/deepagents_code/tui/widgets/update_available.py | .py | """Dedicated modal for the update-available notification.
Shown automatically at startup when a newer version of
`deepagents-code` is available on PyPI. Surfaces the same actions the
notification center would offer for the update entry but with a
focused, single-purpose presentation instead of the generic
notification... | 312 | 10,648 |
deepagents | libs/code/deepagents_code/tui/widgets/thread_selector.py | .py | """Interactive thread selector screen for `/threads` command."""
from __future__ import annotations
import asyncio
import contextlib
import logging
import sqlite3
from pathlib import Path
from typing import TYPE_CHECKING, ClassVar, cast
from rich.cells import cell_len
from rich.text import Text
from textual.binding ... | 2,565 | 93,168 |
deepagents | libs/code/deepagents_code/tui/widgets/chat_input.py | .py | """Chat input widget for deepagents-code with autocomplete and history support."""
from __future__ import annotations
import asyncio
import contextlib
import logging
import time
from pathlib import Path
from typing import TYPE_CHECKING, Any, Literal, assert_never
from rich.cells import cell_len
from rich.segment imp... | 3,548 | 141,033 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.