step 1: rename module chat-switchboard → switchboard-core
- go.mod module name
- All 714 import references across 289 Go files
- VERSION: 0.1.0
- CI DB names: switchboard_core_{ci,dev,test}
- Docker image: gobha/switchboard-core
- Test fixtures: JWT issuer, repo names
- .env.example, docker-compose container name
- Compiles clean (go build exit 0)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# .gitea/workflows/ci.yaml
|
# .gitea/workflows/ci.yaml
|
||||||
# ============================================
|
# ============================================
|
||||||
# Chat Switchboard - CI/CD Pipeline (v0.17.3)
|
# Switchboard Core - CI/CD Pipeline (v0.17.3)
|
||||||
# ============================================
|
# ============================================
|
||||||
# Cluster deployments use SEPARATE FE + BE images.
|
# Cluster deployments use SEPARATE FE + BE images.
|
||||||
# Unified image is for Docker Hub only (docker-compose use).
|
# Unified image is for Docker Hub only (docker-compose use).
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
# - Bootstrap uses IF NOT EXISTS (idempotent)
|
# - Bootstrap uses IF NOT EXISTS (idempotent)
|
||||||
# - Dev wipe REFUSES to run on databases not ending in _dev
|
# - Dev wipe REFUSES to run on databases not ending in _dev
|
||||||
# - Admin creds never reach the backend pods
|
# - Admin creds never reach the backend pods
|
||||||
# - Each env has its own DB name (chat_switchboard_{dev,test,})
|
# - Each env has its own DB name (switchboard_core_{dev,test,})
|
||||||
#
|
#
|
||||||
# Required Gitea Variables:
|
# Required Gitea Variables:
|
||||||
# REGISTRY, NAMESPACE, DOMAIN, POSTGRES_HOST
|
# REGISTRY, NAMESPACE, DOMAIN, POSTGRES_HOST
|
||||||
@@ -90,7 +90,7 @@ env:
|
|||||||
POSTGRES_PORT: ${{ vars.POSTGRES_PORT || '5432' }}
|
POSTGRES_PORT: ${{ vars.POSTGRES_PORT || '5432' }}
|
||||||
FE_IMAGE: ${{ vars.REGISTRY }}/xcaliber/switchboard-fe
|
FE_IMAGE: ${{ vars.REGISTRY }}/xcaliber/switchboard-fe
|
||||||
BE_IMAGE: ${{ vars.REGISTRY }}/xcaliber/switchboard-be
|
BE_IMAGE: ${{ vars.REGISTRY }}/xcaliber/switchboard-be
|
||||||
DOCKERHUB_IMAGE: ${{ vars.DOCKERHUB_IMAGE || 'gobha/chat-switchboard' }}
|
DOCKERHUB_IMAGE: ${{ vars.DOCKERHUB_IMAGE || 'gobha/switchboard-core' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# ── Stage 0: Detect Changed Paths ──────────────
|
# ── Stage 0: Detect Changed Paths ──────────────
|
||||||
@@ -326,7 +326,7 @@ jobs:
|
|||||||
PGPASSWORD: ${{ secrets.POSTGRES_ADMIN_PASSWORD }}
|
PGPASSWORD: ${{ secrets.POSTGRES_ADMIN_PASSWORD }}
|
||||||
APP_USER: ${{ secrets.POSTGRES_USER }}
|
APP_USER: ${{ secrets.POSTGRES_USER }}
|
||||||
APP_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
|
APP_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
|
||||||
DB_NAME: chat_switchboard_ci
|
DB_NAME: switchboard_core_ci
|
||||||
run: |
|
run: |
|
||||||
echo "━━━ CI Test Database Setup ━━━"
|
echo "━━━ CI Test Database Setup ━━━"
|
||||||
# Create DB for Go integration tests (admin creds)
|
# Create DB for Go integration tests (admin creds)
|
||||||
@@ -370,7 +370,7 @@ jobs:
|
|||||||
PGUSER: ${{ secrets.POSTGRES_ADMIN_USER }}
|
PGUSER: ${{ secrets.POSTGRES_ADMIN_USER }}
|
||||||
PGPASSWORD: ${{ secrets.POSTGRES_ADMIN_PASSWORD }}
|
PGPASSWORD: ${{ secrets.POSTGRES_ADMIN_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
psql -c "DROP DATABASE IF EXISTS chat_switchboard_ci;" postgres
|
psql -c "DROP DATABASE IF EXISTS switchboard_core_ci;" postgres
|
||||||
echo "✓ Dropped CI test database"
|
echo "✓ Dropped CI test database"
|
||||||
|
|
||||||
# ── Stage 2: Build, Database, Deploy ─────────
|
# ── Stage 2: Build, Database, Deploy ─────────
|
||||||
@@ -413,7 +413,7 @@ jobs:
|
|||||||
echo "IMAGE_TAG=dev" >> "$GITHUB_OUTPUT"
|
echo "IMAGE_TAG=dev" >> "$GITHUB_OUTPUT"
|
||||||
echo "BASE_PATH=/dev" >> "$GITHUB_OUTPUT"
|
echo "BASE_PATH=/dev" >> "$GITHUB_OUTPUT"
|
||||||
echo "DEPLOY_SUFFIX=-dev" >> "$GITHUB_OUTPUT"
|
echo "DEPLOY_SUFFIX=-dev" >> "$GITHUB_OUTPUT"
|
||||||
echo "DB_NAME=chat_switchboard_dev" >> "$GITHUB_OUTPUT"
|
echo "DB_NAME=switchboard_core_dev" >> "$GITHUB_OUTPUT"
|
||||||
echo "DB_WIPE=true" >> "$GITHUB_OUTPUT"
|
echo "DB_WIPE=true" >> "$GITHUB_OUTPUT"
|
||||||
echo "FE_REPLICAS=1" >> "$GITHUB_OUTPUT"
|
echo "FE_REPLICAS=1" >> "$GITHUB_OUTPUT"
|
||||||
echo "BE_REPLICAS=1" >> "$GITHUB_OUTPUT"
|
echo "BE_REPLICAS=1" >> "$GITHUB_OUTPUT"
|
||||||
@@ -434,7 +434,7 @@ jobs:
|
|||||||
echo "EXTRA_TAG=${VERSION}" >> "$GITHUB_OUTPUT"
|
echo "EXTRA_TAG=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
echo "BASE_PATH=" >> "$GITHUB_OUTPUT"
|
echo "BASE_PATH=" >> "$GITHUB_OUTPUT"
|
||||||
echo "DEPLOY_SUFFIX=" >> "$GITHUB_OUTPUT"
|
echo "DEPLOY_SUFFIX=" >> "$GITHUB_OUTPUT"
|
||||||
echo "DB_NAME=chat_switchboard" >> "$GITHUB_OUTPUT"
|
echo "DB_NAME=switchboard_core" >> "$GITHUB_OUTPUT"
|
||||||
echo "DB_WIPE=false" >> "$GITHUB_OUTPUT"
|
echo "DB_WIPE=false" >> "$GITHUB_OUTPUT"
|
||||||
echo "FE_REPLICAS=2" >> "$GITHUB_OUTPUT"
|
echo "FE_REPLICAS=2" >> "$GITHUB_OUTPUT"
|
||||||
echo "BE_REPLICAS=2" >> "$GITHUB_OUTPUT"
|
echo "BE_REPLICAS=2" >> "$GITHUB_OUTPUT"
|
||||||
@@ -454,7 +454,7 @@ jobs:
|
|||||||
echo "IMAGE_TAG=test" >> "$GITHUB_OUTPUT"
|
echo "IMAGE_TAG=test" >> "$GITHUB_OUTPUT"
|
||||||
echo "BASE_PATH=/test" >> "$GITHUB_OUTPUT"
|
echo "BASE_PATH=/test" >> "$GITHUB_OUTPUT"
|
||||||
echo "DEPLOY_SUFFIX=-test" >> "$GITHUB_OUTPUT"
|
echo "DEPLOY_SUFFIX=-test" >> "$GITHUB_OUTPUT"
|
||||||
echo "DB_NAME=chat_switchboard_test" >> "$GITHUB_OUTPUT"
|
echo "DB_NAME=switchboard_core_test" >> "$GITHUB_OUTPUT"
|
||||||
echo "DB_WIPE=false" >> "$GITHUB_OUTPUT"
|
echo "DB_WIPE=false" >> "$GITHUB_OUTPUT"
|
||||||
echo "FE_REPLICAS=1" >> "$GITHUB_OUTPUT"
|
echo "FE_REPLICAS=1" >> "$GITHUB_OUTPUT"
|
||||||
echo "BE_REPLICAS=1" >> "$GITHUB_OUTPUT"
|
echo "BE_REPLICAS=1" >> "$GITHUB_OUTPUT"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# ============================================
|
# ============================================
|
||||||
# Chat Switchboard — Unified Dockerfile
|
# Switchboard Core — Unified Dockerfile
|
||||||
# ============================================
|
# ============================================
|
||||||
# Stage 1: Build Go backend
|
# Stage 1: Build Go backend
|
||||||
# Stage 2: Download JS vendor libs (marked, DOMPurify)
|
# Stage 2: Download JS vendor libs (marked, DOMPurify)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# ==========================================
|
# ==========================================
|
||||||
# Chat Switchboard - Frontend Dockerfile
|
# Switchboard Core - Frontend Dockerfile
|
||||||
# ==========================================
|
# ==========================================
|
||||||
# Static SPA served by nginx. In k8s, the
|
# Static SPA served by nginx. In k8s, the
|
||||||
# Ingress routes /api/ and /ws to the backend
|
# Ingress routes /api/ and /ws to the backend
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: chat-switchboard
|
container_name: switchboard-core
|
||||||
environment:
|
environment:
|
||||||
PORT: "8080"
|
PORT: "8080"
|
||||||
BASE_PATH: ""
|
BASE_PATH: ""
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ DB_MAX_CONNS=25
|
|||||||
# ── Auth ─────────────────────────────────────
|
# ── Auth ─────────────────────────────────────
|
||||||
JWT_SECRET=your-super-secret-jwt-key-change-in-production
|
JWT_SECRET=your-super-secret-jwt-key-change-in-production
|
||||||
JWT_EXPIRATION=24h
|
JWT_EXPIRATION=24h
|
||||||
JWT_ISSUER=chat-switchboard
|
JWT_ISSUER=switchboard-core
|
||||||
|
|
||||||
# ── Bootstrap Admin ──────────────────────────
|
# ── Bootstrap Admin ──────────────────────────
|
||||||
# Creates or updates admin account on every startup.
|
# Creates or updates admin account on every startup.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# ==========================================
|
# ==========================================
|
||||||
# Chat Switchboard - Backend Dockerfile
|
# Switchboard Core - Backend Dockerfile
|
||||||
# ==========================================
|
# ==========================================
|
||||||
# Standalone Go API server for cluster deployment.
|
# Standalone Go API server for cluster deployment.
|
||||||
# Build context is the repo root (not ./server).
|
# Build context is the repo root (not ./server).
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Mode string
|
type Mode string
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
const bcryptCost = 12
|
const bcryptCost = 12
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MTLSConfig holds mTLS-specific configuration.
|
// MTLSConfig holds mTLS-specific configuration.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package auth
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParseDN(t *testing.T) {
|
func TestParseDN(t *testing.T) {
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/golang-jwt/jwt/v5"
|
"github.com/golang-jwt/jwt/v5"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// OIDCConfig holds OIDC-specific configuration from env vars.
|
// OIDCConfig holds OIDC-specific configuration from env vars.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package auth_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"chat-switchboard/auth"
|
"switchboard-core/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestOIDCProvider_Discovery(t *testing.T) {
|
func TestOIDCProvider_Discovery(t *testing.T) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// EveryoneGroupID is the stable ID of the implicit "Everyone" group seeded in
|
// EveryoneGroupID is the stable ID of the implicit "Everyone" group seeded in
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"chat-switchboard/config"
|
"switchboard-core/config"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
const sessionCookieName = "sb_session"
|
const sessionCookieName = "sb_session"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package capabilities
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestLookupKnownModel_AlwaysFalse(t *testing.T) {
|
func TestLookupKnownModel_AlwaysFalse(t *testing.T) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Known Model Defaults ────────────────────
|
// ── Known Model Defaults ────────────────────
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ModelsForUser returns all models and Personas visible to a user.
|
// ModelsForUser returns all models and Personas visible to a user.
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/providers"
|
"switchboard-core/providers"
|
||||||
"chat-switchboard/roles"
|
"switchboard-core/roles"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
"chat-switchboard/treepath"
|
"switchboard-core/treepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Request / Result ────────────────────────
|
// ── Request / Result ────────────────────────
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
postgres "chat-switchboard/store/postgres"
|
postgres "switchboard-core/store/postgres"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Helpers ─────────────────────────────────
|
// ── Helpers ─────────────────────────────────
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package compaction
|
package compaction
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"chat-switchboard/treepath"
|
"switchboard-core/treepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Token Estimation ────────────────────────
|
// ── Token Estimation ────────────────────────
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package compaction
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"chat-switchboard/treepath"
|
"switchboard-core/treepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestEstimateTokens(t *testing.T) {
|
func TestEstimateTokens(t *testing.T) {
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/roles"
|
"switchboard-core/roles"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
"chat-switchboard/treepath"
|
"switchboard-core/treepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Defaults ────────────────────────────────
|
// ── Defaults ────────────────────────────────
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
_ "modernc.org/sqlite"
|
_ "modernc.org/sqlite"
|
||||||
|
|
||||||
"chat-switchboard/config"
|
"switchboard-core/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DB is the application-wide database connection pool.
|
// DB is the application-wide database connection pool.
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import (
|
|||||||
// Use SetupTestDB in TestMain and pass this to subtests.
|
// Use SetupTestDB in TestMain and pass this to subtests.
|
||||||
var TestDB *sql.DB
|
var TestDB *sql.DB
|
||||||
|
|
||||||
const testDBName = "chat_switchboard_ci"
|
const testDBName = "switchboard_core_ci"
|
||||||
|
|
||||||
// SetupTestDB connects to the appropriate database backend (Postgres or
|
// SetupTestDB connects to the appropriate database backend (Postgres or
|
||||||
// SQLite based on DB_DRIVER env), runs migrations, and sets database.DB
|
// SQLite based on DB_DRIVER env), runs migrations, and sets database.DB
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
|
|
||||||
"github.com/lib/pq"
|
"github.com/lib/pq"
|
||||||
|
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
)
|
)
|
||||||
|
|
||||||
const pgNotifyChannel = "switchboard_events"
|
const pgNotifyChannel = "switchboard_events"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TicketValidatorAdapter satisfies middleware.TicketValidator using a
|
// TicketValidatorAdapter satisfies middleware.TicketValidator using a
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
|
|
||||||
"chat-switchboard/metrics"
|
"switchboard-core/metrics"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── ChatGPT format types ─────────────────────
|
// ── ChatGPT format types ─────────────────────
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ package export
|
|||||||
// Sanitize* function returns a clean map ready for JSON marshalling.
|
// Sanitize* function returns a clean map ready for JSON marshalling.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── User ─────────────────────────────────────
|
// ── User ─────────────────────────────────────
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/sandbox"
|
"switchboard-core/sandbox"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DiscoverStarlarkFilters scans the package registry for active starlark
|
// DiscoverStarlarkFilters scans the package registry for active starlark
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// KBInjectFilter injects a system prompt listing active knowledge bases
|
// KBInjectFilter injects a system prompt listing active knowledge bases
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ import (
|
|||||||
|
|
||||||
"go.starlark.net/starlark"
|
"go.starlark.net/starlark"
|
||||||
|
|
||||||
"chat-switchboard/sandbox"
|
"switchboard-core/sandbox"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StarlarkFilter runs a Starlark package's on_pre_completion entry point.
|
// StarlarkFilter runs a Starlark package's on_pre_completion entry point.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module chat-switchboard
|
module switchboard-core
|
||||||
|
|
||||||
go 1.23.0
|
go 1.23.0
|
||||||
|
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
|
|
||||||
"chat-switchboard/auth"
|
"switchboard-core/auth"
|
||||||
"chat-switchboard/crypto"
|
"switchboard-core/crypto"
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/providers"
|
"switchboard-core/providers"
|
||||||
"chat-switchboard/storage"
|
"switchboard-core/storage"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
"chat-switchboard/tools/search"
|
"switchboard-core/tools/search"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AdminHandler struct {
|
type AdminHandler struct {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListGlobalConnections returns all global-scope connections.
|
// ListGlobalConnections returns all global-scope connections.
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/notifications"
|
"switchboard-core/notifications"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AdminEmailHandler handles admin SMTP configuration and test endpoints.
|
// AdminEmailHandler handles admin SMTP configuration and test endpoints.
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/crypto"
|
"switchboard-core/crypto"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ProviderConfigHandler handles user-facing provider config endpoints.
|
// ProviderConfigHandler handles user-facing provider config endpoints.
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AuditLog writes an audit entry via the store interface.
|
// AuditLog writes an audit entry via the store interface.
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ import (
|
|||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
|
|
||||||
"chat-switchboard/auth"
|
"switchboard-core/auth"
|
||||||
"chat-switchboard/config"
|
"switchboard-core/config"
|
||||||
"chat-switchboard/crypto"
|
"switchboard-core/crypto"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Claims represents the JWT payload.
|
// Claims represents the JWT payload.
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ import (
|
|||||||
"github.com/golang-jwt/jwt/v5"
|
"github.com/golang-jwt/jwt/v5"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
|
|
||||||
"chat-switchboard/auth"
|
"switchboard-core/auth"
|
||||||
"chat-switchboard/config"
|
"switchboard-core/config"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
func testConfig() *config.Config {
|
func testConfig() *config.Config {
|
||||||
@@ -44,7 +44,7 @@ func TestJWTGeneration(t *testing.T) {
|
|||||||
RegisteredClaims: jwt.RegisteredClaims{
|
RegisteredClaims: jwt.RegisteredClaims{
|
||||||
IssuedAt: jwt.NewNumericDate(now),
|
IssuedAt: jwt.NewNumericDate(now),
|
||||||
ExpiresAt: jwt.NewNumericDate(now.Add(15 * time.Minute)),
|
ExpiresAt: jwt.NewNumericDate(now.Add(15 * time.Minute)),
|
||||||
Issuer: "chat-switchboard",
|
Issuer: "switchboard-core",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
const avatarSize = 128
|
const avatarSize = 128
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
capspkg "chat-switchboard/capabilities"
|
capspkg "switchboard-core/capabilities"
|
||||||
"chat-switchboard/auth"
|
"switchboard-core/auth"
|
||||||
"chat-switchboard/health"
|
"switchboard-core/health"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ModelHandler provides the unified models endpoint.
|
// ModelHandler provides the unified models endpoint.
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Channel Models Handler ──────────────────
|
// ── Channel Models Handler ──────────────────
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Request / Response types ────────────────
|
// ── Request / Response types ────────────────
|
||||||
|
|||||||
@@ -14,23 +14,23 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/auth"
|
"switchboard-core/auth"
|
||||||
capspkg "chat-switchboard/capabilities"
|
capspkg "switchboard-core/capabilities"
|
||||||
"chat-switchboard/crypto"
|
"switchboard-core/crypto"
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/events"
|
"switchboard-core/events"
|
||||||
"chat-switchboard/filters"
|
"switchboard-core/filters"
|
||||||
"chat-switchboard/health"
|
"switchboard-core/health"
|
||||||
"chat-switchboard/knowledge"
|
"switchboard-core/knowledge"
|
||||||
"chat-switchboard/metrics"
|
"switchboard-core/metrics"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/notifications"
|
"switchboard-core/notifications"
|
||||||
"chat-switchboard/providers"
|
"switchboard-core/providers"
|
||||||
"chat-switchboard/routing"
|
"switchboard-core/routing"
|
||||||
"chat-switchboard/sandbox"
|
"switchboard-core/sandbox"
|
||||||
"chat-switchboard/storage"
|
"switchboard-core/storage"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
"chat-switchboard/tools"
|
"switchboard-core/tools"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Request Types ───────────────────────────
|
// ── Request Types ───────────────────────────
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"chat-switchboard/events"
|
"switchboard-core/events"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/providers"
|
"switchboard-core/providers"
|
||||||
|
|
||||||
capspkg "chat-switchboard/capabilities"
|
capspkg "switchboard-core/capabilities"
|
||||||
)
|
)
|
||||||
|
|
||||||
// maxChainDepth limits AI-to-AI chaining to prevent runaway loops.
|
// maxChainDepth limits AI-to-AI chaining to prevent runaway loops.
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"chat-switchboard/crypto"
|
"switchboard-core/crypto"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ConnectionResolverAdapter implements sandbox.ConnectionResolver.
|
// ConnectionResolverAdapter implements sandbox.ConnectionResolver.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ConnectionTypeEntry is a single connection type in the API response.
|
// ConnectionTypeEntry is a single connection type in the API response.
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/crypto"
|
"switchboard-core/crypto"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ConnectionHandler handles user-facing extension connection endpoints.
|
// ConnectionHandler handles user-facing extension connection endpoints.
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/events"
|
"switchboard-core/events"
|
||||||
"chat-switchboard/health"
|
"switchboard-core/health"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Dashboard Admin Handler ─────────────────
|
// ── Dashboard Admin Handler ─────────────────
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Extension Dependencies (v0.38.2) ──────────────────
|
// ── Extension Dependencies (v0.38.2) ──────────────────
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/export"
|
"switchboard-core/export"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/storage"
|
"switchboard-core/storage"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DataExportHandler serves data export endpoints.
|
// DataExportHandler serves data export endpoints.
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"go.starlark.net/starlark"
|
"go.starlark.net/starlark"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/sandbox"
|
"switchboard-core/sandbox"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ExtAPIHandler serves extension API routes via Starlark.
|
// ExtAPIHandler serves extension API routes via Starlark.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// validSchemaIdentifier matches safe SQL identifiers for table and column names.
|
// validSchemaIdentifier matches safe SQL identifiers for table and column names.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
_ "modernc.org/sqlite"
|
_ "modernc.org/sqlite"
|
||||||
|
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── mock ExtDataStore ────────────────────────────────────────────────────────
|
// ── mock ExtDataStore ────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ExtPermHandler serves extension permission management endpoints.
|
// ExtPermHandler serves extension permission management endpoints.
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ExtSecretsHandler serves extension secret management endpoints.
|
// ExtSecretsHandler serves extension secret management endpoints.
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
authpkg "chat-switchboard/auth"
|
authpkg "switchboard-core/auth"
|
||||||
"chat-switchboard/config"
|
"switchboard-core/config"
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/middleware"
|
"switchboard-core/middleware"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
postgres "chat-switchboard/store/postgres"
|
postgres "switchboard-core/store/postgres"
|
||||||
sqlite "chat-switchboard/store/sqlite"
|
sqlite "switchboard-core/store/sqlite"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Extension Test Harness ──────────────────
|
// ── Extension Test Harness ──────────────────
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ExtensionHandler serves extension management endpoints.
|
// ExtensionHandler serves extension management endpoints.
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/extraction"
|
"switchboard-core/extraction"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/storage"
|
"switchboard-core/storage"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
"chat-switchboard/workspace"
|
"switchboard-core/workspace"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Default Limits ─────────────────────────
|
// ── Default Limits ─────────────────────────
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
type FolderHandler struct {
|
type FolderHandler struct {
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GDPRHandler serves account deletion endpoints.
|
// GDPRHandler serves account deletion endpoints.
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
|
|
||||||
"golang.org/x/crypto/ssh"
|
"golang.org/x/crypto/ssh"
|
||||||
|
|
||||||
"chat-switchboard/crypto"
|
"switchboard-core/crypto"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
"chat-switchboard/workspace"
|
"switchboard-core/workspace"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/config"
|
"switchboard-core/config"
|
||||||
"chat-switchboard/crypto"
|
"switchboard-core/crypto"
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/middleware"
|
"switchboard-core/middleware"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
postgres "chat-switchboard/store/postgres"
|
postgres "switchboard-core/store/postgres"
|
||||||
sqlite "chat-switchboard/store/sqlite"
|
sqlite "switchboard-core/store/sqlite"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Git Credentials Test Harness ──────────
|
// ── Git Credentials Test Harness ──────────
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/auth"
|
"switchboard-core/auth"
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/notifications"
|
"switchboard-core/notifications"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Request types ───────────────────────────
|
// ── Request types ───────────────────────────
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
capspkg "chat-switchboard/capabilities"
|
capspkg "switchboard-core/capabilities"
|
||||||
"chat-switchboard/health"
|
"switchboard-core/health"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/providers"
|
"switchboard-core/providers"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Health Admin Handler ────────────────────
|
// ── Health Admin Handler ────────────────────
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/export"
|
"switchboard-core/export"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/storage"
|
"switchboard-core/storage"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DataImportHandler serves data import endpoints.
|
// DataImportHandler serves data import endpoints.
|
||||||
|
|||||||
@@ -15,16 +15,16 @@ import (
|
|||||||
"github.com/golang-jwt/jwt/v5"
|
"github.com/golang-jwt/jwt/v5"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"chat-switchboard/config"
|
"switchboard-core/config"
|
||||||
authpkg "chat-switchboard/auth"
|
authpkg "switchboard-core/auth"
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/middleware"
|
"switchboard-core/middleware"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/roles"
|
"switchboard-core/roles"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
postgres "chat-switchboard/store/postgres"
|
postgres "switchboard-core/store/postgres"
|
||||||
sqlite "chat-switchboard/store/sqlite"
|
sqlite "switchboard-core/store/sqlite"
|
||||||
"chat-switchboard/treepath"
|
"switchboard-core/treepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Test Harness ────────────────────────────
|
// ── Test Harness ────────────────────────────
|
||||||
@@ -477,7 +477,7 @@ func makeToken(userID, email, role string) string {
|
|||||||
RegisteredClaims: jwt.RegisteredClaims{
|
RegisteredClaims: jwt.RegisteredClaims{
|
||||||
IssuedAt: jwt.NewNumericDate(time.Now()),
|
IssuedAt: jwt.NewNumericDate(time.Now()),
|
||||||
ExpiresAt: jwt.NewNumericDate(time.Now().Add(1 * time.Hour)),
|
ExpiresAt: jwt.NewNumericDate(time.Now().Add(1 * time.Hour)),
|
||||||
Issuer: "chat-switchboard",
|
Issuer: "switchboard-core",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
|
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/knowledge"
|
"switchboard-core/knowledge"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/storage"
|
"switchboard-core/storage"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Limits ───────────────────────────────────
|
// ── Limits ───────────────────────────────────
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"chat-switchboard/compaction"
|
"switchboard-core/compaction"
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/roles"
|
"switchboard-core/roles"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
postgres "chat-switchboard/store/postgres"
|
postgres "switchboard-core/store/postgres"
|
||||||
sqlite "chat-switchboard/store/sqlite"
|
sqlite "switchboard-core/store/sqlite"
|
||||||
"chat-switchboard/treepath"
|
"switchboard-core/treepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ═══════════════════════════════════════════
|
// ═══════════════════════════════════════════
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/providers"
|
"switchboard-core/providers"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ═══════════════════════════════════════════
|
// ═══════════════════════════════════════════
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/memory"
|
"switchboard-core/memory"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MemoryHandler provides REST endpoints for memory management.
|
// MemoryHandler provides REST endpoints for memory management.
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"chat-switchboard/knowledge"
|
"switchboard-core/knowledge"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// maxMemoryChars is the approximate character budget for injected memories.
|
// maxMemoryChars is the approximate character budget for injected memories.
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
// seedMemory inserts a memory directly into the DB for testing.
|
// seedMemory inserts a memory directly into the DB for testing.
|
||||||
|
|||||||
@@ -12,16 +12,16 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
capspkg "chat-switchboard/capabilities"
|
capspkg "switchboard-core/capabilities"
|
||||||
"chat-switchboard/crypto"
|
"switchboard-core/crypto"
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/events"
|
"switchboard-core/events"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/providers"
|
"switchboard-core/providers"
|
||||||
"chat-switchboard/storage"
|
"switchboard-core/storage"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
"chat-switchboard/tools"
|
"switchboard-core/tools"
|
||||||
"chat-switchboard/treepath"
|
"switchboard-core/treepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Request / Response types ────────────────
|
// ── Request / Response types ────────────────
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ModelPrefsHandler handles user model preference endpoints.
|
// ModelPrefsHandler handles user model preference endpoints.
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"chat-switchboard/config"
|
"switchboard-core/config"
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/middleware"
|
"switchboard-core/middleware"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
postgres "chat-switchboard/store/postgres"
|
postgres "switchboard-core/store/postgres"
|
||||||
sqlite "chat-switchboard/store/sqlite"
|
sqlite "switchboard-core/store/sqlite"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Model Prefs Test Harness ──────────────
|
// ── Model Prefs Test Harness ──────────────
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/providers"
|
"switchboard-core/providers"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// providerSyncTimeout is the maximum time allowed for an outbound provider
|
// providerSyncTimeout is the maximum time allowed for an outbound provider
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/notelinks"
|
"switchboard-core/notelinks"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Request / Response Types ────────────────
|
// ── Request / Response Types ────────────────
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/config"
|
"switchboard-core/config"
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/middleware"
|
"switchboard-core/middleware"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/notifications"
|
"switchboard-core/notifications"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
postgres "chat-switchboard/store/postgres"
|
postgres "switchboard-core/store/postgres"
|
||||||
sqlite "chat-switchboard/store/sqlite"
|
sqlite "switchboard-core/store/sqlite"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Notification Test Harness ──────────────
|
// ── Notification Test Harness ──────────────
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/events"
|
"switchboard-core/events"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/notifications"
|
"switchboard-core/notifications"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Handler ─────────────────────────────────
|
// ── Handler ─────────────────────────────────
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PackageExportHandler handles package export operations.
|
// PackageExportHandler handles package export operations.
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ import (
|
|||||||
|
|
||||||
"go.starlark.net/starlark"
|
"go.starlark.net/starlark"
|
||||||
|
|
||||||
"chat-switchboard/sandbox"
|
"switchboard-core/sandbox"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ParseSchemaVersion extracts the "schema_version" integer from a manifest.
|
// ParseSchemaVersion extracts the "schema_version" integer from a manifest.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RegistryEntry represents a single package in the registry.
|
// RegistryEntry represents a single package in the registry.
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"go.starlark.net/starlark"
|
"go.starlark.net/starlark"
|
||||||
|
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/sandbox"
|
"switchboard-core/sandbox"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// validPackageID matches lowercase alphanumeric slugs with optional hyphens.
|
// validPackageID matches lowercase alphanumeric slugs with optional hyphens.
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Channel Participants Handler ──────────────
|
// ── Channel Participants Handler ──────────────
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Helpers ─────────────────────────────────
|
// ── Helpers ─────────────────────────────────
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PersonaGroupHandler struct {
|
type PersonaGroupHandler struct {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PersonaHandler handles persona endpoints.
|
// PersonaHandler handles persona endpoints.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
const presenceOnlineThreshold = 90 * time.Second
|
const presenceOnlineThreshold = 90 * time.Second
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/auth"
|
"switchboard-core/auth"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ProfileBootstrapHandler serves the combined boot payload.
|
// ProfileBootstrapHandler serves the combined boot payload.
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/auth"
|
"switchboard-core/auth"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ProfilePermissionsHandler exposes the current user's resolved permissions.
|
// ProfilePermissionsHandler exposes the current user's resolved permissions.
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
|
|
||||||
"chat-switchboard/config"
|
"switchboard-core/config"
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/middleware"
|
"switchboard-core/middleware"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
postgres "chat-switchboard/store/postgres"
|
postgres "switchboard-core/store/postgres"
|
||||||
sqlite "chat-switchboard/store/sqlite"
|
sqlite "switchboard-core/store/sqlite"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Profile Test Harness ──────────────────
|
// ── Profile Test Harness ──────────────────
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Request / Response Types ────────────────
|
// ── Request / Response Types ────────────────
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/config"
|
"switchboard-core/config"
|
||||||
"chat-switchboard/database"
|
"switchboard-core/database"
|
||||||
"chat-switchboard/middleware"
|
"switchboard-core/middleware"
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
postgres "chat-switchboard/store/postgres"
|
postgres "switchboard-core/store/postgres"
|
||||||
sqlite "chat-switchboard/store/sqlite"
|
sqlite "switchboard-core/store/sqlite"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Project Test Harness ──────────────────
|
// ── Project Test Harness ──────────────────
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"chat-switchboard/crypto"
|
"switchboard-core/crypto"
|
||||||
"chat-switchboard/providers"
|
"switchboard-core/providers"
|
||||||
"chat-switchboard/sandbox"
|
"switchboard-core/sandbox"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ProviderResolverAdapter implements sandbox.ProviderResolver using
|
// ProviderResolverAdapter implements sandbox.ProviderResolver using
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"chat-switchboard/crypto"
|
"switchboard-core/crypto"
|
||||||
"chat-switchboard/providers"
|
"switchboard-core/providers"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
"chat-switchboard/tools"
|
"switchboard-core/tools"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── Provider Resolution ────────────────────────
|
// ── Provider Resolution ────────────────────────
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"chat-switchboard/models"
|
"switchboard-core/models"
|
||||||
"chat-switchboard/providers"
|
"switchboard-core/providers"
|
||||||
"chat-switchboard/roles"
|
"switchboard-core/roles"
|
||||||
"chat-switchboard/store"
|
"switchboard-core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RolesHandler manages model role configuration.
|
// RolesHandler manages model role configuration.
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user