Files
plyngent/doc/architecture.md
NCBM 0e8b0f8bd4 docs: describe deletes that go to the trash
A new page, `doc/trash.md`, covers what a delete does now: where a path lands on
each platform, what is still deleted outright (an explicit `permanent=true`, a
host that cleared `[trash]`, scratch paths under the OS temp dir, the
`copy_path` / `move_path` overwrite, the temporary-workspace cleanup), what
happens when a trashing is refused — the file stays and the error says how to
delete it on purpose — and the two things the trash cannot help with: a shell
`rm` and anything a plugin or MCP server does on its own.

`[trash]` joins the example config and the README snippet, the README gains the
one-paragraph version, `AGENTS.md` the tool/config notes (including the confirm
wording a delete now uses), and the default tool playbook tells the model that
`delete_path` is undoable and what `permanent=true` costs.
2026-10-21 20:25:27 +08:00

2.9 KiB

Code Architecture

  • plyngent
    • typedef: Shared type aliases.
    • lmproto: Protocols for interacting with LLM service.
      • (common)
        • model: Messages models of specified providers.
        • config: Configurations for specified providers.
        • client: Clients for accessing existent specified services.
        • server: Servers for accepting other clients.
      • openai_compatible: Chat Completions base (kind=chat_completions).
      • openai: Platform Responses + chat (kind=responses).
      • anthropic: Messages API (kind=messages).
      • deepseek
        • openai_compat (kind=chat_completions)
        • responses (kind=responses; DeepSeek Responses API)
        • anthropic (kind=messages; DeepSeek Anthropic-compatible API on https://api.deepseek.com/anthropic)
    • utils: Common utilities for code architecture.
      • components: Utilities for class composition.
    • memory: Storage controlling for sessions and messages.
    • config: Plyngent configuration center (TOML), including [plugins] and [networking] (e.g. fetch SSRF Fake-IP CIDR exemptions). Model entries may override provider preset / url for mixed API routing. [skills] holds the skill roots, discovery sources, catalog limits, and the standing write grant.
    • runtime: create_client maps effective provider preset → protocol client.
    • skills: Skill discovery (ordered roots, SKILL.md frontmatter subset, mtime-cached store) and the read/write path rules the tools use.
    • agent: Kind-based tool loop, streaming, usage, compact; bridges: responses_bridge/responses_dispatch, messages_bridge/messages_dispatch; @tool / tags / registry. History stays chat-completions-shaped.
    • tools: Workspace file/process/VCS/chat/todo/net/skill tools + directory-access grants (access); catalog; plugins; instance/session context and views.
    • prompting: Shared ask/choose/form for CLI and tools; the hooks a host uses to take over a prompt (output break, SIGINT guard, waiting notification).
    • cli: Click entry, slash registry, REPL, one-shot chat; notify announces a prompt that waits on the human.
    • web: Web service (Phase H; not implemented).

Plugins (third-party entry points, allowlisted under [plugins]): plugins.md. Conversation units (a round = one request→response plus its tool batch, a turn = a user message to the explicit stop): turns-and-rounds.md. Images (a turn's pictures, a tool result's pictures, what each wire surface takes): images.md. Prompt notifications (a prompt that waits on the human, and how it can be answered from the notification): notifications.md. Deletes (a delete_path call moves the path into the system trash, and what that does not cover): trash.md.