Implementation:1ay1 Agentty Paste Config
| Knowledge Sources | |
|---|---|
| Domains | Configuration, Clipboard |
| Last Updated | 2026-10-28 12:00 GMT |
Overview
Pure domain config type for how Ctrl+V and `agentty paste` read the clipboard, exposed as settings rows (paste.*).
Description
The agentty::paste_cfg module is the domain config for clipboard paste behavior. agentty owns the choices: which routes a paste may take, how big a paste may be, what a pasted file turns into. They are settings rows (`paste.*`), so they live in settings.json, show in Settings → Paste, take `AGENTTY_PASTE_*` overrides, and work with `agentty config get|set`.
Pure: no IO, no globals. `io/clipboard.cpp` turns a `Config` into richpaste's `rp::Config`. Constants define the bounds that both the settings registry rows and the dispatch seam clamp to, pinned together by compile-time proofs.
Usage
Import this when you need to: access paste config in the domain layer, define paste settings bounds, or convert to richpaste's runtime config.
Code Reference
Source Location
- Repository: 1ay1_Agentty
- File: include/agentty/domain/paste_config.hpp
- Lines: 1-69
Signature
namespace agentty::paste_cfg {
inline constexpr int kMaxMbMin = 1, kMaxMbMax = 1024, kMaxMbDefault = 32;
inline constexpr int kInlineKbMin = 0, kInlineKbMax = 4096, kInlineKbDefault = 256;
inline constexpr std::string_view kTerminalModes = "auto|osc5522|osc52|off";
struct Config {
bool forwards = true; // laptop clipboard over ssh
bool display = true; // this machine's clipboard
bool server_display = false; // server's clipboard over ssh
std::string terminal = "auto"; // OSC 5522/52 terminal query
bool decode_text = true; // richpaste:1: → image/file
int max_mb = kMaxMbDefault;
int inline_kb = kInlineKbDefault;
std::string save_dir; // empty = ~/.agentty/paste/pasted
std::string socket; // single agent socket; empty = find all
bool operator==(const Config&) const = default;
};
}
Import
#include "agentty/domain/paste_config.hpp"
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| Config | struct | Yes | Paste behavior config (routes, limits, terminal mode) |
Outputs
| Name | Type | Description |
|---|---|---|
| Config | struct | Read by io/clipboard.cpp, turned into richpaste's rp::Config |
Usage Examples
Access Paste Settings
#include "agentty/domain/paste_config.hpp"
auto& paste = settings.paste;
if (paste.forwards) {
// Over ssh, read laptop's clipboard through forwarded agent
}
if (paste.max_mb > agentty::paste_cfg::kMaxMbMax) {
paste.max_mb = agentty::paste_cfg::kMaxMbMax; // clamped
}