RELAYLINK

Repository layout

Document ID: DEV-001
Status: Active
Version: v1.16.0
Updated: 2026-11-29

RelayLink/
├── README.md                              English product overview and doc entry
├── README.zh-CN.md                        Chinese product overview and doc entry
├── AGENTS.md                              Repository-level agent collaboration rules
├── CONTRIBUTING.md                        Contributor and commit guidelines
├── Directory.Build.props                  Solution-wide .NET 10 build, analyzer, and SemVer defaults
├── NuGet.Config                           NuGet package source configuration
├── RelayLink.slnx                         Solution file
├── .editorconfig                          Formatting baseline
├── .gitattributes                         Line-ending rules
├── .gitignore                             Local artifact and secret exclusions
├── .github/workflows/                     GitHub Actions CI, Release, and Pages workflows
├── website/                               GitHub Pages product and docs static site source
│   └── en/                                Native English docs source tree (guides/ and docs/)
├── docs/
│   ├── README.md                          Documentation index
│   ├── research/                          Research reports and technical evaluations
│   ├── requirements/                      Requirements and acceptance criteria
│   ├── design/                            Technical designs and protocol specifications
│   ├── adr/                               Architecture Decision Records
│   ├── development/                       Development and documentation policies
│   ├── operations/                        Installation and operations guides
│   ├── testing/                           Verification status and test evidence
│   ├── releases/                          Version release notes
│   └── intro/                             External presentation sources, assets, and build scripts
├── src/
│   ├── RelayLink.Protocol/                Wire protocol (v3-v5), DTOs, error codes, SemVer, platform probe, update helpers
│   ├── RelayLink.Transport/               TLS, framing, UDP encapsulation, duplex pump, and P2P direct primitives
│   ├── RelayLink.Logging/                 Serilog file logging, level splitting, and rolling retention
│   ├── RelayLink.AdminWeb/                React/TypeScript Server Admin Web UI source
│   ├── RelayLink.AgentWeb/                React/TypeScript Agent local Web UI source
│   ├── RelayLink.Agent.ConfigMigrator/    Standalone pre-start Agent configuration migrator
│   ├── RelayLink.AutomationClient/        Shared Automation HTTP and ECDSA proof client for CLI
│   ├── RelayLink.Cli/                     AI automation command-line tool (relaylink)
│   ├── RelayLink.Sdk/                     C#/.NET data-plane discovery and connection SDK (netstandard2.0/net8.0/net10.0)
│   ├── RelayLink.Server/                  Linux/Windows Server, dashboard, admin API, STUN, and automation surface
│   └── RelayLink.Agent/                   Windows/Linux/macOS Agent service and local loopback dashboard host
├── sdk/                                   Python, TypeScript, Go, Java, Rust data-plane SDKs (6 languages with RelayLink.Sdk)
├── skills/relaylink-admin/                Operations agent skill shipped with CLI distributions
├── contract/                              Automation OpenAPI spec, error/exit code maps, conformance fixtures
├── tests/                                 Unit and integration test suites
│   ├── RelayLink.UnitTests/               Config, framing, state machines, P2P policy, tokens, updates, and SDK tests
│   ├── RelayLink.IntegrationTests/        Real TCP/TLS, P2P direct, HTTP, CLI, fault, and SQL integration tests
│   └── Support/                           Shared test fixtures and private directory helpers
├── tools/                                 Simulated target and caller executables
│   ├── RelayLink.SimulatedCaller/         Simulated business caller
│   └── RelayLink.SimulatedTarget/         Simulated private target
├── config/examples/                       Sanitized committable config examples (*.example.json)
├── deploy/                                Platform deployment templates and guides
│   ├── docker/                            Server container image, Compose files, and guide
│   ├── linux/                             Linux systemd unit templates and guide
│   ├── macos/                             macOS launchd plist, wrapper script, and guide
│   └── windows/                           Windows Server/Agent service scripts and Inno Setup installer
└── scripts/                               Build, verification, publish, and website generation scripts

Directory Ownership

  • P2P Direct and Relay Fallback (DES-011) modules:
    • src/RelayLink.Server/Runtime/ hosts server-side control coordination, persistent direct lease occupancy recovery, and the optional STUN responder: DirectLeaseStore.cs, PeerDirectSession.cs, and StunServerService.cs.
    • src/RelayLink.Agent/ hosts Agent candidate exchange, probe coordination, and lease renewal: PeerDirectAgentAttempt.cs.
    • src/RelayLink.Transport/ hosts direct transports, probe policy, mutual binding authentication, STUN wire protocol, and suspend-aware monotonic clock: PeerQuicDirectTransport.cs, PeerPlainTcpDirectTransport.cs, PeerProbePolicy.cs, PeerDirectAuth.cs, StunProtocol.cs, and SuspendAwareClock.cs.
  • HTTP/HTTPS Reverse Proxy (DES-008): The virtual HTTP host and YARP forwarder live in src/RelayLink.Agent/HttpProxyRuntime.cs; PeerApplicationStream in RelayLink.Transport unwraps inner peer TLS application records; RelayLink.Protocol defines v5 HTTP options, ingress context, and status messages; RelayLink.Server handles centralized config, version/readiness checks, and relay pairing. Business HTTP virtual ingresses open no OS listening socket and stay separate from local status dashboards. See HTTP Reverse Proxy Guide and HTTP Verification.
  • Agent Local Web UI (AgentWeb): Provides clickable browser URLs and URL copy for ready HTTP/HTTPS peer entries, and loopback 127.0.0.1:<port> address copy for raw TCP and unicast UDP entries (the former raw TCP "Connection Methods" dropdown was removed under REQ-001Q). It also displays routing policy badges, active direct transport paths (direct_quic / direct_tcp / relay), and assisted-update banners per DES-004.
  • Shared Library Boundaries: The solution root uses RelayLink.slnx and per-project .csproj files. Shared libraries must never depend on Server or Agent, and Protocol must not depend on host abstractions. Aside from system path inspection needed for shared update platform detection, directory permission checks, and external upgrade command helpers, Protocol performs no host filesystem I/O or config file loading.
  • File Logging: Server and Agent share file logging policy through RelayLink.Logging; each component chooses its directory and filename prefix, and the logging library has zero dependencies on protocol types, runtime configuration, or business payloads.
  • Assisted Updates (DES-012): Shared SemVer parsing and external command generation live in src/RelayLink.Protocol/; Server release polling, caching, leases, and endpoints live in src/RelayLink.Server/Runtime/ (GitHubReleaseClient.cs, UpdateCacheStore.cs, UpdateCheckService.cs, UpdateDownloadRegistry.cs) and UpdateEndpoints.cs; Agent download coordination and rate-limited transfer live in src/RelayLink.Agent/AgentUpdateCoordinator.cs and AgentUpdateDownloads.cs.
  • Configuration and Deployment Templates: config/examples/ stores sanitized examples named *.example.json. Real deployment configurations belong outside the repository; any temporary local config needed during testing must live in the git-ignored .local/ directory. deploy/ holds executable deployment templates (docker/, linux/, macos/, windows/), while docs/design/ explains policy so duplicate templates are never maintained in two places.
  • Scripts, Tools, and CI: scripts/ contains repeatable development, packaging, website build, and local acceptance scripts; scratch files go into git-ignored work/, and build outputs go into git-ignored artifacts/. .github/workflows/ holds daily CI validation, tag releases, and GitHub Pages deployment without real secrets or credentials; see CI Pipeline. tools/ contains standalone simulated caller and target executables with zero runtime dependency from Server or Agent.
  • Product Website and Multilingual Docs (website/ and website/en/): website/ contains the GitHub Pages template, social preview image (og-image.png), AI agent installation instructions (install.md / install.zh-CN.md), content catalog (content.json), quick-start fragments (quickstart.html), English UI and release note translations (locale.js, release-translations.en.json), locked npm dependencies, and site tests (tests/site.test.mjs). website/en/ holds native English documentation (website/en/guides/ and website/en/docs/) mapped via sourceEn in content.json. Note that scripts/build-website.mjs resolves relative links in website/en/ entries against the directory of their corresponding Chinese source file so cross-references to docs/ and repository files resolve uniformly. Build output lands in git-ignored artifacts/site/ with Chinese at root and English under /en/; see Website Maintenance.
  • External Presentation Sources: docs/intro/ is the sole location for slide decks and launch articles, with pages.json as page source; generated PPTX and figures are committed while .build/, .cache/, .slidep/, and legacy-bak/ are excluded by the local .gitignore.
  • Standalone Frontend Bundles: Server Admin UI source lives in src/RelayLink.AdminWeb and Agent local UI source lives in src/RelayLink.AgentWeb; generated dist/ directories are not committed and are copied into wwwroot/ during Server and Agent build/publish for same-origin Kestrel hosting; see ADR-0004 and ADR-0021.
  • AI Automation and 6-Language SDKs: The automation surface lives in src/RelayLink.Server/Automation/ (config section, pairing, tokens, ECDSA device proof, change requests, store) with HTTP endpoints in src/RelayLink.Server/AutomationEndpoints.cs, sharing the same process state, write lock, audit store, and config editors. The CLI lives in src/RelayLink.Cli/ (relaylink), the shared automation client lives in src/RelayLink.AutomationClient/, and the C#/.NET data-plane SDK lives in src/RelayLink.Sdk/ (BCL-only—it never references RelayLink.Protocol, which targets net10.0 only). The other five data-plane SDKs (Python, TypeScript, Go, Java, Rust) live in sdk/. contract/ holds the OpenAPI spec, error/exit code maps, and cross-language conformance fixtures as the single source of truth; skills/relaylink-admin/ provides the operations agent skill (SKILL.md, references/, and scripts/relaylink.mjs). See DES-010.

Naming

Projects, assemblies, and namespaces use the RelayLink prefix. Linux deployment paths use /opt/relaylink and /etc/relaylink, with recommended service account relaylink. The wire magic NTP1 is part of the original protocol design and must not be silently renamed; any future change requires updating the protocol specification and compatibility notes.

Repository source