diff --git a/package.json b/package.json
index f49e4ef..fa19397 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,7 @@
"dev": "ts-node src/index.ts",
"watch": "tsc --watch",
"logs": "ts-node src/inspectLogs.ts",
- "test": "API_PASSWORD=test_password ts-node test-revolver.ts && API_PASSWORD=test_password ts-node test-integration.ts && API_PASSWORD=test_password ts-node test-timeout-keepalive.ts && API_PASSWORD=test_password ts-node test-live-watcher.ts && API_PASSWORD=test_password ts-node test-telemetry-fallback.ts && API_PASSWORD=test_password ts-node test-content-length-resilience.ts && API_PASSWORD=test_password ts-node test-circuit-breaker-fallback.ts && API_PASSWORD=test_password ts-node test-moderation-and-cooldown-recovery.ts && API_PASSWORD=test_password ts-node test-log-compression.ts"
+ "test": "API_PASSWORD=test_password ts-node test-revolver.ts && API_PASSWORD=test_password ts-node test-filters.ts && API_PASSWORD=test_password ts-node test-integration.ts && API_PASSWORD=test_password ts-node test-timeout-keepalive.ts && API_PASSWORD=test_password ts-node test-live-watcher.ts && API_PASSWORD=test_password ts-node test-telemetry-fallback.ts && API_PASSWORD=test_password ts-node test-content-length-resilience.ts && API_PASSWORD=test_password ts-node test-circuit-breaker-fallback.ts && API_PASSWORD=test_password ts-node test-moderation-and-cooldown-recovery.ts && API_PASSWORD=test_password ts-node test-log-compression.ts"
},
"keywords": [
"openai",
diff --git a/src/admin/filtersPage.ts b/src/admin/filtersPage.ts
new file mode 100644
index 0000000..930838b
--- /dev/null
+++ b/src/admin/filtersPage.ts
@@ -0,0 +1,1732 @@
+import { renderAdminLayout } from './layout';
+
+export function renderFiltersPage(): string {
+ const extraStyles = `
+ .filters-top-bar {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ gap: 1rem;
+ flex-wrap: wrap;
+ margin-bottom: 1.25rem;
+ }
+
+ .filter-pills {
+ display: flex;
+ gap: 0.4rem;
+ flex-wrap: wrap;
+ }
+
+ .filter-pill-btn {
+ background: rgba(255, 255, 255, 0.05);
+ border: 1px solid var(--border-dark);
+ color: var(--muted-dark);
+ padding: 0.4rem 0.85rem;
+ border-radius: 20px;
+ font-size: 0.8rem;
+ font-weight: 600;
+ cursor: pointer;
+ transition: all 0.2s ease;
+ }
+
+ .filter-pill-btn.active,
+ .filter-pill-btn:hover {
+ background: rgba(187, 134, 252, 0.18);
+ color: var(--primary-color);
+ border-color: var(--primary-color);
+ }
+
+ .filter-card-meta {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.4rem;
+ margin-bottom: 0.85rem;
+ }
+
+ .filter-rule-preview {
+ background: rgba(0, 0, 0, 0.28);
+ border: 1px solid var(--border-dark);
+ border-radius: 8px;
+ padding: 0.65rem 0.8rem;
+ font-family: monospace;
+ font-size: 0.8rem;
+ color: var(--text-dark);
+ margin-bottom: 0.85rem;
+ overflow-x: auto;
+ white-space: pre-wrap;
+ word-break: break-word;
+ }
+
+ body.light-theme .filter-rule-preview {
+ background: rgba(0, 0, 0, 0.04);
+ border-color: var(--border-light);
+ color: var(--text-light);
+ }
+
+ .filter-trigger-summary {
+ font-size: 0.78rem;
+ color: var(--muted-dark);
+ margin-bottom: 0.75rem;
+ display: flex;
+ align-items: center;
+ gap: 0.4rem;
+ flex-wrap: wrap;
+ }
+
+ .pipeline-orchestrator-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 1.5rem;
+ margin-top: 2rem;
+ }
+
+ @media (max-width: 980px) {
+ .pipeline-orchestrator-grid {
+ grid-template-columns: 1fr;
+ }
+ }
+
+ .pipeline-chain-list {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+ margin: 0.85rem 0;
+ min-height: 80px;
+ }
+
+ .pipeline-chain-item {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ gap: 0.75rem;
+ background: rgba(0, 0, 0, 0.24);
+ border: 1px solid var(--border-dark);
+ border-radius: 8px;
+ padding: 0.6rem 0.85rem;
+ }
+
+ body.light-theme .pipeline-chain-item {
+ background: rgba(0, 0, 0, 0.03);
+ border-color: var(--border-light);
+ }
+
+ .pipeline-chain-index {
+ width: 24px;
+ height: 24px;
+ border-radius: 50%;
+ background: rgba(187, 134, 252, 0.2);
+ color: var(--primary-color);
+ font-size: 0.75rem;
+ font-weight: 700;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+ }
+
+ .builder-box {
+ background: rgba(187, 134, 252, 0.06);
+ border: 1px solid rgba(187, 134, 252, 0.22);
+ border-radius: 10px;
+ padding: 1rem;
+ margin-bottom: 1rem;
+ }
+
+ .rule-row {
+ display: flex;
+ gap: 0.5rem;
+ align-items: center;
+ margin-bottom: 0.5rem;
+ flex-wrap: wrap;
+ }
+
+ .flag-chip {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.3rem;
+ background: rgba(0, 0, 0, 0.25);
+ border: 1px solid var(--border-dark);
+ border-radius: 6px;
+ padding: 0.35rem 0.6rem;
+ font-size: 0.8rem;
+ cursor: pointer;
+ user-select: none;
+ }
+
+ .var-chip {
+ background: rgba(187, 134, 252, 0.14);
+ border: 1px solid rgba(187, 134, 252, 0.3);
+ color: var(--primary-color);
+ border-radius: 6px;
+ padding: 2px 8px;
+ font-family: monospace;
+ font-size: 0.75rem;
+ cursor: pointer;
+ transition: all 0.15s ease;
+ }
+
+ .var-chip:hover {
+ background: var(--primary-color);
+ color: #121212;
+ }
+
+ .regex-highlight-box {
+ background: rgba(0, 0, 0, 0.35);
+ border: 1px solid var(--border-dark);
+ border-radius: 8px;
+ padding: 0.75rem;
+ font-family: monospace;
+ font-size: 0.82rem;
+ white-space: pre-wrap;
+ word-break: break-word;
+ min-height: 54px;
+ }
+
+ .regex-match-mark {
+ background: rgba(3, 218, 198, 0.28);
+ border-bottom: 2px solid var(--accent-success);
+ color: #fff;
+ padding: 0 2px;
+ border-radius: 3px;
+ }
+
+ .trace-step-row {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ gap: 0.5rem;
+ padding: 0.45rem 0.65rem;
+ border-radius: 6px;
+ background: rgba(0, 0, 0, 0.2);
+ border: 1px solid var(--border-dark);
+ font-size: 0.8rem;
+ margin-bottom: 0.4rem;
+ }
+ `;
+
+ const bodyHtml = `
+
+ Create reusable Input & Output filters (Word/Text Replacement, Interactive Regex, Instruction Injection, or Sandboxed JS Scripts) and bind them to any Custom Model in any execution order.
+
+
+ Text Processing Filters & Triggers
+
+
No text filters found in this view. Click "New Text Filter" to create one.
Attach and order Input/Output filters for this model, or manage filter definitions in Text Filters.
+