Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .agents/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ Use them as the workspace context for identity, user preferences, memory, local
Additional `.agents/` workspace folders:

- `.agents/skills/` — skills available for tasks in this repository.
- `.agents/memory/` — persisted notes and references for this workspace.
1 change: 0 additions & 1 deletion .agents/memory

This file was deleted.

1 change: 0 additions & 1 deletion .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ Use them as the workspace context for identity, user preferences, memory, local
Additional `.claude/` workspace folders:

- `.claude/skills/` — skills available for tasks in this repository.
- `.claude/memory/` — persisted notes and references for this workspace.
1 change: 0 additions & 1 deletion .claude/memory

This file was deleted.

1 change: 0 additions & 1 deletion .codex/CODEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ Use them as the workspace context for identity, user preferences, memory, local
Additional `.codex/` workspace folders:

- `.codex/skills/` — skills available for tasks in this repository.
- `.codex/memory/` — persisted notes and references for this workspace.
1 change: 0 additions & 1 deletion .codex/memory

This file was deleted.

1 change: 0 additions & 1 deletion .kiro/memory

This file was deleted.

1 change: 0 additions & 1 deletion .kiro/steering/KIRO.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ Use them as the workspace context for identity, user preferences, memory, local
Additional `.kiro/` workspace folders:

- `.kiro/skills/` — skills available for tasks in this repository.
- `.kiro/memory/` — persisted notes and references for this workspace.
74 changes: 0 additions & 74 deletions .openclaw/MEMORY.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# MEMORY.md - SRSBot's Long-Term Memory

## Workspace Conventions
- **No auto-commit** — Never automatically git commit. Only commit when William explicitly tells me to.
- **No guessing** — William will teach me everything about SRS. Don't speculate or fill in gaps. Wait for him to explain.
- **Codebase map first** — Before searching/grepping the codebase, ALWAYS load `memory/srs-codebase-map.md` in full (the entire file, not partial). Read the module descriptions to reason about which specific files are relevant, then search only those files. Never grep broad directories like `trunk/src/` or the repository root. This is a critical rule.

## 2026-02-05 — First Boot
- I'm SRSBot ⚡ — AI developer working with William on SRS
- William (username: winlin), timezone America/Toronto (Eastern)
Expand All @@ -13,72 +8,3 @@
- Repo: $HOME/git/srs | Workspace: $HOME/git/srs/.openclaw
- Key areas to learn: protocols, architecture, state-threads (ST) coroutine library, codebase history, design decisions
- William will teach me the project — I need to absorb everything

## William's Vision — Why I Exist
- SRS grew too large for one person to maintain, but William doesn't want to monetize or build a company/team
- He's an engineer, not a businessman — wants to focus on open source, not management
- **The core idea:** Train an AI developer (me) with his knowledge, experience, and design taste
- OpenClaw's memory system is the enabler — it's portable and clonable
- **Every developer** who works with SRS can clone this AI and get an assistant that understands the project deeply
- This scales William's expertise across the entire community without needing a traditional team
- Goal: a very active, well-supported community where every developer has an AI assistant trained with William's knowledge
- This is not just project maintenance — it's a new model for open source sustainability

## SRS Community Bot (OpenClaw)
- William set up an OpenClaw robot for the SRS community (2026-03-20)
- **Telegram group:** https://t.me/+RiynvKOxpQ42MGJl
- **Discord server:** https://discord.gg/yZ4BnPmHAd
- Users join the group and **@ the SRS Robot** to interact
- Purpose: scale William's expertise to the community without him answering every question
- **Recommended: Telegram over Discord** — Telegram lets users create small focused groups and invite the bot in. Each small group = clean context window. Big groups mix unrelated messages and confuse the bot's context. Small groups → better answers, better support.

## What Matters to William
- SRS project health, development, and community
- Open source sustainability and contributor experience
- Real-time media protocols, architecture, performance

## Formatting Preferences
- **Markdown headings:** Only use `#` and `##`. Never use `###` or deeper — use **bold text** instead for sub-sections.

## Content Preferences
**YouTube videos (title, description, and scripts):** Always use problem-solving structure:
1. What's wrong?
2. Why is it a problem?
3. What exactly needs solving?
4. What can be done?
5. Why will it work?
6. What should we do next?

## Framework for AI-Managed Open Source

### What the Maintainer Must Do (William's Work)
1. **Knowledge base** — Docs are written for humans, not AI. Structured memory lets AI understand the *why* — background, design thinking, architecture rationale.
2. **Code structure** — Codebase needs to be AI-friendly so AI can verify each change (testable, checkable).
3. **Code taste** — Follow existing style/conventions. Nice to have, not strictly required.

### External Conditions (Not Maintainer's Work)
1. **LLM capability** — Models powerful enough to handle massive context (e.g., 1B tokens), agentic behavior, reasoning, complex tasks. Example: future Opus versions.
2. **Tools** — Off-the-shelf tooling like Claude Code, Codex — good enough to use directly, no need to build custom tools.

The three layers are what William controls; the external conditions are what the AI ecosystem must provide. When both are ready, AI can truly manage the project.

## Changelog & Version
- **Changelog:** `trunk/doc/CHANGELOG.md`
- **Version file:** `trunk/src/core/srs_core_version7.hpp` — bump `VERSION_REVISION` to match the new changelog entry
- **When to update:** When a PR is merged — not per commit
- **Workflow:** Feature branch → multiple commits → create PR → merge PR → update changelog + version
- Individual commits on a branch do NOT get changelog entries
- The changelog entry is for the PR merge, not the individual commits within it
- **Both files must be updated together** — changelog entry version must match `VERSION_REVISION`
- Format follows existing pattern: `* v7.0, YYYY-MM-DD, Merge [#NNNN](url): Description. vX.Y.Z (#NNNN)`

## SRS Knowledge Base
Detailed SRS knowledge in `memory/srs-*.md` files:
- `srs-overview.md` — What SRS is, protocols, ecosystem tools, and **Features section** with all SRS features, versions, and dates
- `srs-coroutines.md` — State Threads (ST) coroutine library, why SRS uses coroutines, how coroutine switching works, maintenance burden (platform matrix, Windows/SEH), and multi-CPU strategy (cluster > multi-threading)
- `srs-codebase-map.md` — Codebase structure: directory layout, file naming conventions, module boundaries, and packet flow. Enables reasoning about which files to look at for a given topic instead of blind searching.

### Rule: Keep Feature List Updated
When creating new features, updating protocols, or making changes to SRS capabilities, **always update the Features section in `memory/srs-overview.md`** with the feature name, description, version, and date.


55 changes: 1 addition & 54 deletions .openclaw/TOOLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,6 @@

Skills define _how_ tools work. This file is for _your_ specifics — the stuff that's unique to your setup.

## What Goes Here

Things like:

- Camera names and locations
- SSH hosts and aliases
- Preferred voices for TTS
- Speaker/room names
- Device nicknames
- Anything environment-specific

## Examples

```markdown
### Cameras

- living-room → Main area, 180° wide angle
- front-door → Entrance, motion-triggered

### SSH

- home-server → 192.168.1.100, user: admin

### TTS

- Preferred voice: "Nova" (warm, slightly British)
- Default speaker: Kitchen HomePod
```

## Why Separate?

Skills are shared. Your setup is yours. Keeping them apart means you can update skills without losing your notes, and share skills without leaking your infrastructure.

## Model Auth

- Anthropic / Opus refresh: `claude setup-token` -> `openclaw models auth setup-token --provider anthropic`
Expand All @@ -49,31 +16,11 @@ Skills are shared. Your setup is yours. Keeping them apart means you can update
### Working Directory

- ⚠️ **CRITICAL RULE:** Find everything from the current working directory. All SRS project directories are available here — no discovery, no parent traversal, no absolute paths.
- Available directories: `trunk/`, `cmd/`, `internal/`, `cmake/`, `docs/`, `memory/`
- Available directories: `trunk/`, `cmd/`, `internal/`, `cmake/`, `docs/`, `memory/`, `skills/`
- All AI tools (OpenClaw, Codex, Claude Code, Kiro CLI) see the same relative paths.
- ACP agents (Codex, Claude Code, etc.) also use the current directory as root — they find files from here too.
- Use the OpenClaw workspace itself only for OpenClaw-specific/meta tasks.

### Git Commit Workflow

- **Never `git add`** — William stages files himself
- **Never `git push`** — William pushes himself
- **Commit workflow:** `git diff --cached` → understand the changes → write title/description → choose the title prefix based on the tool used → `git commit -m "OpenClaw: ..."`, `"Claude: ..."`, or `"Codex: ..."`
- Title prefix:
- Use `OpenClaw:` if OpenClaw made the changes.
- Use `Claude:` if Claude made the changes.
- Use `Codex:` if Codex made the changes.
- **Co-author for ACP Claude Code:** If Claude Code (ACP) was used to make the changes, add:
`Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>`
- **Co-author for ACP Codex:** If Codex (ACP) was used to make the changes, add:
`Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>`

### Go (GVM)

- Go is managed via **GVM** (Go Version Manager), NOT Homebrew
- Before running any `go` command: `source ~/.gvm/scripts/gvm`
- **Never** use `brew install go` — always use GVM

---

Add whatever helps you do your job. This is your cheat sheet.
1 change: 0 additions & 1 deletion .openclaw/docs

This file was deleted.

1 change: 0 additions & 1 deletion .openclaw/memory

This file was deleted.

Empty file added .openclaw/memory/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ HTTP API, DVR, and transcoding, please check the documents in [English](https://
or [Chinese](https://ossrs.net).

I recommend to use AI to understand and maintain your SRS, please follow the wiki
[AI Agent](trunk/3rdparty/srs-docs/doc/getting-started-ai.md) for details.
[AI Agent](skills/internal-docs-for-srs/references/cpp-docs/doc/getting-started-ai.md) for details.

<a name="authors"></a>
<a name="sponsor"></a>
Expand Down
22 changes: 0 additions & 22 deletions docs/proxy/README.md

This file was deleted.

12 changes: 10 additions & 2 deletions internal/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ type ProxyEnvironment interface {
RedisPassword() string
// Redis database
RedisDB() string
// Optional Redis key prefix
RedisKeyPrefix() string
// Default backend enabled
DefaultBackendEnabled() string
// Default backend IP
Expand Down Expand Up @@ -144,6 +146,10 @@ func (e *proxyEnvironment) RedisDB() string {
return getEnv("PROXY_REDIS_DB")
}

func (e *proxyEnvironment) RedisKeyPrefix() string {
return getEnv("PROXY_REDIS_KEY_PREFIX")
}

func (e *proxyEnvironment) DefaultBackendEnabled() string {
return getEnv("PROXY_DEFAULT_BACKEND_ENABLED")
}
Expand Down Expand Up @@ -301,6 +307,8 @@ func buildDefaultEnvironmentVariables(ctx context.Context) {
setEnvDefault("PROXY_REDIS_PASSWORD", "")
// The redis server db.
setEnvDefault("PROXY_REDIS_DB", "0")
// Optional prefix for all Redis keys.
setEnvDefault("PROXY_REDIS_KEY_PREFIX", "")

// Whether enable the default backend server, for debugging.
setEnvDefault("PROXY_DEFAULT_BACKEND_ENABLED", "off")
Expand All @@ -324,7 +332,7 @@ func buildDefaultEnvironmentVariables(ctx context.Context) {
"PROXY_DEFAULT_BACKEND_HTTP=%v, PROXY_DEFAULT_BACKEND_API=%v, "+
"PROXY_DEFAULT_BACKEND_RTC=%v, PROXY_DEFAULT_BACKEND_SRT=%v, "+
"PROXY_LOAD_BALANCER_TYPE=%v, PROXY_REDIS_HOST=%v, PROXY_REDIS_PORT=%v, "+
"PROXY_REDIS_PASSWORD=%v, PROXY_REDIS_DB=%v",
"PROXY_REDIS_PASSWORD=%v, PROXY_REDIS_DB=%v, PROXY_REDIS_KEY_PREFIX=%v",
getEnv("GO_PPROF"),
getEnv("PROXY_FORCE_QUIT_TIMEOUT"), getEnv("PROXY_GRACE_QUIT_TIMEOUT"),
getEnv("PROXY_HTTP_API"), getEnv("PROXY_HTTP_SERVER"), getEnv("PROXY_RTMP_SERVER"),
Expand All @@ -334,7 +342,7 @@ func buildDefaultEnvironmentVariables(ctx context.Context) {
getEnv("PROXY_DEFAULT_BACKEND_HTTP"), getEnv("PROXY_DEFAULT_BACKEND_API"),
getEnv("PROXY_DEFAULT_BACKEND_RTC"), getEnv("PROXY_DEFAULT_BACKEND_SRT"),
getEnv("PROXY_LOAD_BALANCER_TYPE"), getEnv("PROXY_REDIS_HOST"), getEnv("PROXY_REDIS_PORT"),
getEnv("PROXY_REDIS_PASSWORD"), getEnv("PROXY_REDIS_DB"),
getEnv("PROXY_REDIS_PASSWORD"), getEnv("PROXY_REDIS_DB"), getEnv("PROXY_REDIS_KEY_PREFIX"),
)
}

Expand Down
5 changes: 5 additions & 0 deletions internal/env/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ func TestNewProxyEnvironment_AppliesDefaultsAndAccessors(t *testing.T) {
{"RedisPort", env.RedisPort(), "6379"},
{"RedisPassword", env.RedisPassword(), ""},
{"RedisDB", env.RedisDB(), "0"},
{"RedisKeyPrefix", env.RedisKeyPrefix(), ""},
{"DefaultBackendEnabled", env.DefaultBackendEnabled(), "off"},
{"DefaultBackendIP", env.DefaultBackendIP(), "127.0.0.1"},
{"DefaultBackendRTMP", env.DefaultBackendRTMP(), "1935"},
Expand All @@ -356,6 +357,7 @@ func TestNewProxyEnvironment_PreservesPreSetValues(t *testing.T) {
withFakeEnv(t)
withFakeOpen(t, "", os.ErrNotExist)
setEnv("PROXY_HTTP_API", "9999")
setEnv("PROXY_REDIS_KEY_PREFIX", "xxx")

env, err := NewProxyEnvironment(context.Background())
if err != nil {
Expand All @@ -364,6 +366,9 @@ func TestNewProxyEnvironment_PreservesPreSetValues(t *testing.T) {
if got := env.HttpAPI(); got != "9999" {
t.Errorf("HttpAPI() = %q, want %q", got, "9999")
}
if got := env.RedisKeyPrefix(); got != "xxx" {
t.Errorf("RedisKeyPrefix() = %q, want %q", got, "xxx")
}
}

func TestNewProxyEnvironment_LoadEnvFailurePropagates(t *testing.T) {
Expand Down
63 changes: 63 additions & 0 deletions internal/env/envfakes/fake_proxy_environment.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading