rebrand: sweep remaining switchboard refs + rename cookies/storage keys
All checks were successful
CI/CD / detect-changes (pull_request) Successful in 3s
CI/CD / test-frontend (pull_request) Successful in 5s
CI/CD / test-go-pg (pull_request) Successful in 2m40s
CI/CD / test-sqlite (pull_request) Successful in 2m45s
CI/CD / build-and-deploy (pull_request) Successful in 25s
All checks were successful
CI/CD / detect-changes (pull_request) Successful in 3s
CI/CD / test-frontend (pull_request) Successful in 5s
CI/CD / test-go-pg (pull_request) Successful in 2m40s
CI/CD / test-sqlite (pull_request) Successful in 2m45s
CI/CD / build-and-deploy (pull_request) Successful in 25s
- CSS headers (4 files): Switchboard Core → Armature - Editor .mjs headers (8 files): Chat Switchboard → Armature - SQL migration comments + seed data (20 files): Switchboard Core → Armature - Webhook header: X-Switchboard-Event → X-Armature-Event - Cookie: sb_token → arm_token (3 Go files + auth.js) - localStorage: sb_auth → arm_auth (auth.js + 2 test runners) - localStorage: switchboard_theme → armature_theme (theme.js + base.html) - Debug engine filter: chatSwitchboard/switchboard/sb_ → armatureChat/armature/arm_ - JS export: switchboardTheme → armatureTheme (theme.mjs + code-editor.mjs) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/* ==========================================
|
/* ==========================================
|
||||||
Switchboard Core — Editor Surface (v0.25.0)
|
Armature — Editor Surface (v0.25.0)
|
||||||
==========================================
|
==========================================
|
||||||
Replaces editor-mode.css for the pane-based editor.
|
Replaces editor-mode.css for the pane-based editor.
|
||||||
Covers: topbar, bootstrap, and component-specific
|
Covers: topbar, bootstrap, and component-specific
|
||||||
|
|||||||
@@ -270,7 +270,7 @@
|
|||||||
|
|
||||||
function getAuthTokenFromStorage() {
|
function getAuthTokenFromStorage() {
|
||||||
var env = (T.base || '').replace(/^\//, '') || 'default';
|
var env = (T.base || '').replace(/^\//, '') || 'default';
|
||||||
var keys = ['sb_auth_' + env, 'sb_auth', 'sb_token'];
|
var keys = ['arm_auth_' + env, 'arm_auth', 'arm_token'];
|
||||||
for (var i = 0; i < keys.length; i++) {
|
for (var i = 0; i < keys.length; i++) {
|
||||||
try {
|
try {
|
||||||
var raw = localStorage.getItem(keys[i]);
|
var raw = localStorage.getItem(keys[i]);
|
||||||
|
|||||||
@@ -141,7 +141,7 @@
|
|||||||
|
|
||||||
function _readToken() {
|
function _readToken() {
|
||||||
var env = (T.base || '').replace(/^\//, '') || 'default';
|
var env = (T.base || '').replace(/^\//, '') || 'default';
|
||||||
var keys = ['sb_auth_' + env, 'sb_auth', 'sb_token'];
|
var keys = ['arm_auth_' + env, 'arm_auth', 'arm_token'];
|
||||||
for (var i = 0; i < keys.length; i++) {
|
for (var i = 0; i < keys.length; i++) {
|
||||||
try {
|
try {
|
||||||
var raw = localStorage.getItem(keys[i]);
|
var raw = localStorage.getItem(keys[i]);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ def on_fire(ctx):
|
|||||||
|
|
||||||
resp = http.post(url, body=payload, headers={
|
resp = http.post(url, body=payload, headers={
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"X-Switchboard-Event": data.get("event_name", "workflow.notify"),
|
"X-Armature-Event": data.get("event_name", "workflow.notify"),
|
||||||
})
|
})
|
||||||
|
|
||||||
# Log the delivery
|
# Log the delivery
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 001 Core
|
-- Armature — 001 Core
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Users, auth, platform policies, global settings, presence, OIDC.
|
-- Users, auth, platform policies, global settings, presence, OIDC.
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
@@ -89,7 +89,7 @@ CREATE TABLE IF NOT EXISTS global_settings (
|
|||||||
|
|
||||||
INSERT INTO global_settings (key, value) VALUES
|
INSERT INTO global_settings (key, value) VALUES
|
||||||
('registration', '{"enabled": true}'::jsonb),
|
('registration', '{"enabled": true}'::jsonb),
|
||||||
('site', '{"name": "Switchboard Core", "tagline": "Extension Platform"}'::jsonb),
|
('site', '{"name": "Armature", "tagline": "Extension Platform"}'::jsonb),
|
||||||
('banner', '{"enabled": false, "text": "", "bg": "#007a33", "fg": "#ffffff"}'::jsonb)
|
('banner', '{"enabled": false, "text": "", "bg": "#007a33", "fg": "#ffffff"}'::jsonb)
|
||||||
ON CONFLICT (key) DO NOTHING;
|
ON CONFLICT (key) DO NOTHING;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 002 Teams & Access Control
|
-- Armature — 002 Teams & Access Control
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS teams (
|
CREATE TABLE IF NOT EXISTS teams (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 003 Packages & Extensions
|
-- Armature — 003 Packages & Extensions
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS packages (
|
CREATE TABLE IF NOT EXISTS packages (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 004 Connections & Dependencies
|
-- Armature — 004 Connections & Dependencies
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS ext_connections (
|
CREATE TABLE IF NOT EXISTS ext_connections (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 005 Notifications
|
-- Armature — 005 Notifications
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS notifications (
|
CREATE TABLE IF NOT EXISTS notifications (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 006 Audit
|
-- Armature — 006 Audit
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS audit_log (
|
CREATE TABLE IF NOT EXISTS audit_log (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 007 Workflows
|
-- Armature — 007 Workflows
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Workflow definitions, stages, version snapshots.
|
-- Workflow definitions, stages, version snapshots.
|
||||||
-- v0.3.0: persona_id + history_mode dropped (chat vestiges).
|
-- v0.3.0: persona_id + history_mode dropped (chat vestiges).
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 009 Multi-Replica HA
|
-- Armature — 009 Multi-Replica HA
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS ws_tickets (
|
CREATE TABLE IF NOT EXISTS ws_tickets (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 011 Triggers & Scheduled Tasks
|
-- Armature — 011 Triggers & Scheduled Tasks
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
-- ── Extension Triggers (event + webhook) ──────
|
-- ── Extension Triggers (event + webhook) ──────
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 001 Core (SQLite)
|
-- Armature — 001 Core (SQLite)
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
PRAGMA journal_mode = WAL;
|
PRAGMA journal_mode = WAL;
|
||||||
@@ -69,7 +69,7 @@ CREATE TABLE IF NOT EXISTS global_settings (
|
|||||||
|
|
||||||
INSERT OR IGNORE INTO global_settings (key, value) VALUES
|
INSERT OR IGNORE INTO global_settings (key, value) VALUES
|
||||||
('registration', '{"enabled": true}'),
|
('registration', '{"enabled": true}'),
|
||||||
('site', '{"name": "Switchboard Core", "tagline": "Extension Platform"}'),
|
('site', '{"name": "Armature", "tagline": "Extension Platform"}'),
|
||||||
('banner', '{"enabled": false, "text": "", "bg": "#007a33", "fg": "#ffffff"}');
|
('banner', '{"enabled": false, "text": "", "bg": "#007a33", "fg": "#ffffff"}');
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS user_presence (
|
CREATE TABLE IF NOT EXISTS user_presence (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 002 Teams & Access Control (SQLite)
|
-- Armature — 002 Teams & Access Control (SQLite)
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS teams (
|
CREATE TABLE IF NOT EXISTS teams (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 003 Packages & Extensions (SQLite)
|
-- Armature — 003 Packages & Extensions (SQLite)
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS packages (
|
CREATE TABLE IF NOT EXISTS packages (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 004 Connections & Dependencies (SQLite)
|
-- Armature — 004 Connections & Dependencies (SQLite)
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS ext_connections (
|
CREATE TABLE IF NOT EXISTS ext_connections (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 005 Notifications (SQLite)
|
-- Armature — 005 Notifications (SQLite)
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS notifications (
|
CREATE TABLE IF NOT EXISTS notifications (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 006 Audit (SQLite)
|
-- Armature — 006 Audit (SQLite)
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS audit_log (
|
CREATE TABLE IF NOT EXISTS audit_log (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 007 Workflows (SQLite)
|
-- Armature — 007 Workflows (SQLite)
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- v0.3.0: persona_id + history_mode dropped (chat vestiges).
|
-- v0.3.0: persona_id + history_mode dropped (chat vestiges).
|
||||||
-- transition_rules → stage_config, stage_mode modernized.
|
-- transition_rules → stage_config, stage_mode modernized.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 009 Multi-Replica HA (SQLite)
|
-- Armature — 009 Multi-Replica HA (SQLite)
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS ws_tickets (
|
CREATE TABLE IF NOT EXISTS ws_tickets (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- ==========================================
|
-- ==========================================
|
||||||
-- Switchboard Core — 011 Triggers & Scheduled Tasks (SQLite)
|
-- Armature — 011 Triggers & Scheduled Tasks (SQLite)
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|
||||||
-- ── Extension Triggers (event + webhook) ──────
|
-- ── Extension Triggers (event + webhook) ──────
|
||||||
|
|||||||
@@ -153,8 +153,8 @@ func (h *AuthHandler) Logout(c *gin.Context) {
|
|||||||
h.uekCache.Evict(userID.(string))
|
h.uekCache.Evict(userID.(string))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear the sb_token cookie so SSR middleware doesn't trust a stale token
|
// Clear the arm_token cookie so SSR middleware doesn't trust a stale token
|
||||||
c.SetCookie("sb_token", "", -1, "/", "", false, false)
|
c.SetCookie("arm_token", "", -1, "/", "", false, false)
|
||||||
|
|
||||||
c.JSON(http.StatusOK, gin.H{"message": "logged out"})
|
c.JSON(http.StatusOK, gin.H{"message": "logged out"})
|
||||||
}
|
}
|
||||||
@@ -287,7 +287,7 @@ func (h *AuthHandler) OIDCCallback(c *gin.Context) {
|
|||||||
userJSON, _ := json.Marshal(tokens["user"])
|
userJSON, _ := json.Marshal(tokens["user"])
|
||||||
|
|
||||||
// Set page-auth cookie too (for SSR middleware)
|
// Set page-auth cookie too (for SSR middleware)
|
||||||
c.SetCookie("sb_token", accessToken, 900, "/", "", false, false)
|
c.SetCookie("arm_token", accessToken, 900, "/", "", false, false)
|
||||||
|
|
||||||
// Base64-encode the token payload for the fragment
|
// Base64-encode the token payload for the fragment
|
||||||
payload := fmt.Sprintf(`{"access_token":"%s","refresh_token":"%s","user":%s}`,
|
payload := fmt.Sprintf(`{"access_token":"%s","refresh_token":"%s","user":%s}`,
|
||||||
|
|||||||
@@ -142,11 +142,11 @@ func parseAndValidateJWT(tokenString string, jwtSecret string) (*Claims, bool) {
|
|||||||
return claims, true
|
return claims, true
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserIDFromCookie extracts the user ID from the sb_token cookie without
|
// UserIDFromCookie extracts the user ID from the arm_token cookie without
|
||||||
// requiring authentication. Returns "" if no valid token is found.
|
// requiring authentication. Returns "" if no valid token is found.
|
||||||
// Used by unauthenticated routes that want optional user context.
|
// Used by unauthenticated routes that want optional user context.
|
||||||
func UserIDFromCookie(c *gin.Context, jwtSecret string) string {
|
func UserIDFromCookie(c *gin.Context, jwtSecret string) string {
|
||||||
cookie, err := c.Cookie("sb_token")
|
cookie, err := c.Cookie("arm_token")
|
||||||
if err != nil || cookie == "" {
|
if err != nil || cookie == "" {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import (
|
|||||||
// Unlike Auth() which returns 401 JSON for API calls, this redirects
|
// Unlike Auth() which returns 401 JSON for API calls, this redirects
|
||||||
// to the login page — appropriate for browser navigation.
|
// to the login page — appropriate for browser navigation.
|
||||||
//
|
//
|
||||||
// Token is read from the "sb_token" cookie (set by the login page JS)
|
// Token is read from the "arm_token" cookie (set by the login page JS)
|
||||||
// since page requests don't have Authorization headers.
|
// since page requests don't have Authorization headers.
|
||||||
func AuthOrRedirect(cfg *config.Config, users store.UserStore, cache *UserStatusCache) gin.HandlerFunc {
|
func AuthOrRedirect(cfg *config.Config, users store.UserStore, cache *UserStatusCache) gin.HandlerFunc {
|
||||||
loginPath := cfg.BasePath + "/login"
|
loginPath := cfg.BasePath + "/login"
|
||||||
@@ -32,7 +32,7 @@ func AuthOrRedirect(cfg *config.Config, users store.UserStore, cache *UserStatus
|
|||||||
// Try cookie first (set by login page), then Authorization header,
|
// Try cookie first (set by login page), then Authorization header,
|
||||||
// then query param (for edge cases)
|
// then query param (for edge cases)
|
||||||
tokenString := ""
|
tokenString := ""
|
||||||
if cookie, err := c.Cookie("sb_token"); err == nil && cookie != "" {
|
if cookie, err := c.Cookie("arm_token"); err == nil && cookie != "" {
|
||||||
tokenString = cookie
|
tokenString = cookie
|
||||||
}
|
}
|
||||||
if tokenString == "" {
|
if tokenString == "" {
|
||||||
@@ -109,7 +109,7 @@ func OptionalAuth(cfg *config.Config, users store.UserStore, cache *UserStatusCa
|
|||||||
}
|
}
|
||||||
|
|
||||||
tokenString := ""
|
tokenString := ""
|
||||||
if cookie, err := c.Cookie("sb_token"); err == nil && cookie != "" {
|
if cookie, err := c.Cookie("arm_token"); err == nil && cookie != "" {
|
||||||
tokenString = cookie
|
tokenString = cookie
|
||||||
}
|
}
|
||||||
if tokenString == "" {
|
if tokenString == "" {
|
||||||
|
|||||||
@@ -38,10 +38,10 @@
|
|||||||
<meta name="theme-color" content="#0e0e10" id="metaThemeColor">
|
<meta name="theme-color" content="#0e0e10" id="metaThemeColor">
|
||||||
<script>
|
<script>
|
||||||
// Early theme application — prevents flash of wrong theme on all surfaces.
|
// Early theme application — prevents flash of wrong theme on all surfaces.
|
||||||
// Read from Theme API key (switchboard_theme) as authoritative source.
|
// Read from Theme API key (armature_theme) as authoritative source.
|
||||||
(function() {
|
(function() {
|
||||||
try {
|
try {
|
||||||
var mode = localStorage.getItem('switchboard_theme') || 'system';
|
var mode = localStorage.getItem('armature_theme') || 'system';
|
||||||
var resolved = mode;
|
var resolved = mode;
|
||||||
if (mode === 'system') resolved = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
if (mode === 'system') resolved = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||||
document.documentElement.setAttribute('data-theme', resolved);
|
document.documentElement.setAttribute('data-theme', resolved);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* ==========================================
|
/* ==========================================
|
||||||
Switchboard Core — Admin Surfaces
|
Armature — Admin Surfaces
|
||||||
==========================================
|
==========================================
|
||||||
v0.25.0: Surface lifecycle management UI.
|
v0.25.0: Surface lifecycle management UI.
|
||||||
========================================== */
|
========================================== */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* ==========================================
|
/* ==========================================
|
||||||
Switchboard Core — UserMenu Component CSS
|
Armature — UserMenu Component CSS
|
||||||
==========================================
|
==========================================
|
||||||
v0.31.1: Flyout container + item styles moved to primitives.css
|
v0.31.1: Flyout container + item styles moved to primitives.css
|
||||||
(.sw-menu-flyout). This file keeps only the trigger button,
|
(.sw-menu-flyout). This file keeps only the trigger button,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500&display=swap');
|
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500&display=swap');
|
||||||
|
|
||||||
/* ==========================================
|
/* ==========================================
|
||||||
Switchboard Core
|
Armature
|
||||||
Clean utility layout · Open WebUI inspired
|
Clean utility layout · Open WebUI inspired
|
||||||
========================================== */
|
========================================== */
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* ==========================================
|
/* ==========================================
|
||||||
* Switchboard Core — Workflow Components CSS
|
* Armature — Workflow Components CSS
|
||||||
* ========================================== */
|
* ========================================== */
|
||||||
|
|
||||||
/* ── Stage list (admin builder) ────────── */
|
/* ── Stage list (admin builder) ────────── */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// ==========================================
|
// ==========================================
|
||||||
// Chat Switchboard — CM6 Build Script
|
// Armature — CM6 Build Script
|
||||||
// ==========================================
|
// ==========================================
|
||||||
// Bundles CodeMirror 6 into a single IIFE that
|
// Bundles CodeMirror 6 into a single IIFE that
|
||||||
// exposes window.CM. Run via scripts/build-editor.sh
|
// exposes window.CM. Run via scripts/build-editor.sh
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// ==========================================
|
// ==========================================
|
||||||
// Chat Switchboard — CM6 Chat Input Factory
|
// Armature — CM6 Chat Input Factory
|
||||||
// ==========================================
|
// ==========================================
|
||||||
// Minimal markdown editor for the chat message
|
// Minimal markdown editor for the chat message
|
||||||
// input. No line numbers, no gutter. Enter sends,
|
// input. No line numbers, no gutter. Enter sends,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// ==========================================
|
// ==========================================
|
||||||
// Chat Switchboard — CM6 Code Editor Factory
|
// Armature — CM6 Code Editor Factory
|
||||||
// ==========================================
|
// ==========================================
|
||||||
// Full-featured code editor: line numbers, bracket
|
// Full-featured code editor: line numbers, bracket
|
||||||
// matching, search/replace, auto-indent, syntax
|
// matching, search/replace, auto-indent, syntax
|
||||||
@@ -52,7 +52,7 @@ import { rust } from '@codemirror/lang-rust';
|
|||||||
import { vim } from '@replit/codemirror-vim';
|
import { vim } from '@replit/codemirror-vim';
|
||||||
import { emacs } from '@replit/codemirror-emacs';
|
import { emacs } from '@replit/codemirror-emacs';
|
||||||
|
|
||||||
import { switchboardTheme } from './theme.mjs';
|
import { armatureTheme } from './theme.mjs';
|
||||||
|
|
||||||
// ── Language Registry ────────────────────────
|
// ── Language Registry ────────────────────────
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ export function codeEditor(target, opts = {}) {
|
|||||||
]),
|
]),
|
||||||
|
|
||||||
// Theme
|
// Theme
|
||||||
switchboardTheme,
|
armatureTheme,
|
||||||
themeCompartment.of(darkMode ? [oneDark] : []),
|
themeCompartment.of(darkMode ? [oneDark] : []),
|
||||||
|
|
||||||
// Configurable compartments
|
// Configurable compartments
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// ==========================================
|
// ==========================================
|
||||||
// Chat Switchboard — CM6 Bundle Entrypoint
|
// Armature — CM6 Bundle Entrypoint
|
||||||
// ==========================================
|
// ==========================================
|
||||||
// esbuild compiles this into an IIFE that sets
|
// esbuild compiles this into an IIFE that sets
|
||||||
// window.CM with factory functions and utilities.
|
// window.CM with factory functions and utilities.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// ==========================================
|
// ==========================================
|
||||||
// Chat Switchboard — CM6 @Mention Extension
|
// Armature — CM6 @Mention Extension
|
||||||
// ==========================================
|
// ==========================================
|
||||||
// Provides:
|
// Provides:
|
||||||
// 1. Autocomplete triggered by @ for personas/users
|
// 1. Autocomplete triggered by @ for personas/users
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// ==========================================
|
// ==========================================
|
||||||
// Chat Switchboard — CM6 Note Editor Factory
|
// Armature — CM6 Note Editor Factory
|
||||||
// ==========================================
|
// ==========================================
|
||||||
// Rich markdown editor for the notes panel.
|
// Rich markdown editor for the notes panel.
|
||||||
// Decorates headings, bold, italic, code blocks inline.
|
// Decorates headings, bold, italic, code blocks inline.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// ==========================================
|
// ==========================================
|
||||||
// Chat Switchboard — CM6 Theme
|
// Armature — CM6 Theme
|
||||||
// ==========================================
|
// ==========================================
|
||||||
// Maps the app's CSS custom properties to CM6
|
// Maps the app's CSS custom properties to CM6
|
||||||
// theme slots. Works in both light and dark mode.
|
// theme slots. Works in both light and dark mode.
|
||||||
@@ -12,10 +12,10 @@
|
|||||||
import { EditorView } from '@codemirror/view';
|
import { EditorView } from '@codemirror/view';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Switchboard base theme — uses CSS variables so it
|
* Armature base theme — uses CSS variables so it
|
||||||
* adapts automatically when the theme toggle fires.
|
* adapts automatically when the theme toggle fires.
|
||||||
*/
|
*/
|
||||||
export const switchboardTheme = EditorView.theme({
|
export const armatureTheme = EditorView.theme({
|
||||||
'&': {
|
'&': {
|
||||||
backgroundColor: 'var(--bg-surface, var(--bg))',
|
backgroundColor: 'var(--bg-surface, var(--bg))',
|
||||||
color: 'var(--text)',
|
color: 'var(--text)',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// ==========================================
|
// ==========================================
|
||||||
// Chat Switchboard — CM6 Wikilink Extension
|
// Armature — CM6 Wikilink Extension
|
||||||
// ==========================================
|
// ==========================================
|
||||||
// Provides:
|
// Provides:
|
||||||
// 1. ViewPlugin that decorates [[Title]] as clickable chips
|
// 1. ViewPlugin that decorates [[Title]] as clickable chips
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ export const debugEngine = {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
snap.storageKeys = Object.keys(localStorage).filter(k =>
|
snap.storageKeys = Object.keys(localStorage).filter(k =>
|
||||||
k.startsWith('chatSwitchboard') || k.startsWith('switchboard') || k.startsWith('sb_')
|
k.startsWith('armatureChat') || k.startsWith('armature') || k.startsWith('arm_')
|
||||||
);
|
);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
snap.storageKeys = '(error reading)';
|
snap.storageKeys = '(error reading)';
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
// ==========================================
|
// ==========================================
|
||||||
|
|
||||||
const BASE = window.__BASE__ || '';
|
const BASE = window.__BASE__ || '';
|
||||||
const _storageKey = BASE ? `sb_auth_${BASE.replace(/\//g, '')}` : 'sb_auth';
|
const _storageKey = BASE ? `arm_auth_${BASE.replace(/\//g, '')}` : 'arm_auth';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the auth module.
|
* Create the auth module.
|
||||||
@@ -44,9 +44,9 @@ export function createAuth() {
|
|||||||
}));
|
}));
|
||||||
// Cookie sync for Go template page auth
|
// Cookie sync for Go template page auth
|
||||||
if (_accessToken) {
|
if (_accessToken) {
|
||||||
document.cookie = `sb_token=${_accessToken}; path=/; max-age=900; SameSite=Strict`;
|
document.cookie = `arm_token=${_accessToken}; path=/; max-age=900; SameSite=Strict`;
|
||||||
} else {
|
} else {
|
||||||
document.cookie = 'sb_token=; path=/; max-age=0';
|
document.cookie = 'arm_token=; path=/; max-age=0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ export function createAuth() {
|
|||||||
_policies = {};
|
_policies = {};
|
||||||
localStorage.removeItem(_storageKey);
|
localStorage.removeItem(_storageKey);
|
||||||
sessionStorage.removeItem('sw-chat-active');
|
sessionStorage.removeItem('sw-chat-active');
|
||||||
document.cookie = 'sb_token=; path=/; max-age=0';
|
document.cookie = 'arm_token=; path=/; max-age=0';
|
||||||
if (_refreshTimer) { clearTimeout(_refreshTimer); _refreshTimer = null; }
|
if (_refreshTimer) { clearTimeout(_refreshTimer); _refreshTimer = null; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,9 +197,9 @@ export function createAuth() {
|
|||||||
async boot() {
|
async boot() {
|
||||||
_loadTokens();
|
_loadTokens();
|
||||||
if (!_refreshToken) {
|
if (!_refreshToken) {
|
||||||
// No tokens in localStorage — clear any stale sb_token cookie
|
// No tokens in localStorage — clear any stale arm_token cookie
|
||||||
// so Go SSR middleware doesn't trust a leftover cookie.
|
// so Go SSR middleware doesn't trust a leftover cookie.
|
||||||
document.cookie = 'sb_token=; path=/; max-age=0';
|
document.cookie = 'arm_token=; path=/; max-age=0';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Factory: createTheme(emitFn)
|
// Factory: createTheme(emitFn)
|
||||||
// ==========================================
|
// ==========================================
|
||||||
|
|
||||||
const _key = 'switchboard_theme';
|
const _key = 'armature_theme';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the theme module.
|
* Create the theme module.
|
||||||
|
|||||||
Reference in New Issue
Block a user