Feat rebrand armature #43
@@ -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.
|
||||
Covers: topbar, bootstrap, and component-specific
|
||||
|
||||
@@ -270,7 +270,7 @@
|
||||
|
||||
function getAuthTokenFromStorage() {
|
||||
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++) {
|
||||
try {
|
||||
var raw = localStorage.getItem(keys[i]);
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
|
||||
function _readToken() {
|
||||
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++) {
|
||||
try {
|
||||
var raw = localStorage.getItem(keys[i]);
|
||||
|
||||
@@ -21,7 +21,7 @@ def on_fire(ctx):
|
||||
|
||||
resp = http.post(url, body=payload, headers={
|
||||
"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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- ==========================================
|
||||
-- Switchboard Core — 001 Core
|
||||
-- Armature — 001 Core
|
||||
-- ==========================================
|
||||
-- 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
|
||||
('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)
|
||||
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 (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- ==========================================
|
||||
-- Switchboard Core — 003 Packages & Extensions
|
||||
-- Armature — 003 Packages & Extensions
|
||||
-- ==========================================
|
||||
|
||||
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 (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- ==========================================
|
||||
-- Switchboard Core — 005 Notifications
|
||||
-- Armature — 005 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 (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- ==========================================
|
||||
-- Switchboard Core — 007 Workflows
|
||||
-- Armature — 007 Workflows
|
||||
-- ==========================================
|
||||
-- Workflow definitions, stages, version snapshots.
|
||||
-- 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 (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- ==========================================
|
||||
-- Switchboard Core — 011 Triggers & Scheduled Tasks
|
||||
-- Armature — 011 Triggers & Scheduled Tasks
|
||||
-- ==========================================
|
||||
|
||||
-- ── Extension Triggers (event + webhook) ──────
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- ==========================================
|
||||
-- Switchboard Core — 001 Core (SQLite)
|
||||
-- Armature — 001 Core (SQLite)
|
||||
-- ==========================================
|
||||
|
||||
PRAGMA journal_mode = WAL;
|
||||
@@ -69,7 +69,7 @@ CREATE TABLE IF NOT EXISTS global_settings (
|
||||
|
||||
INSERT OR IGNORE INTO global_settings (key, value) VALUES
|
||||
('registration', '{"enabled": true}'),
|
||||
('site', '{"name": "Switchboard Core", "tagline": "Extension Platform"}'),
|
||||
('site', '{"name": "Armature", "tagline": "Extension Platform"}'),
|
||||
('banner', '{"enabled": false, "text": "", "bg": "#007a33", "fg": "#ffffff"}');
|
||||
|
||||
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 (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- ==========================================
|
||||
-- Switchboard Core — 003 Packages & Extensions (SQLite)
|
||||
-- Armature — 003 Packages & Extensions (SQLite)
|
||||
-- ==========================================
|
||||
|
||||
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 (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- ==========================================
|
||||
-- Switchboard Core — 005 Notifications (SQLite)
|
||||
-- Armature — 005 Notifications (SQLite)
|
||||
-- ==========================================
|
||||
|
||||
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 (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- ==========================================
|
||||
-- Switchboard Core — 007 Workflows (SQLite)
|
||||
-- Armature — 007 Workflows (SQLite)
|
||||
-- ==========================================
|
||||
-- v0.3.0: persona_id + history_mode dropped (chat vestiges).
|
||||
-- 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 (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- ==========================================
|
||||
-- Switchboard Core — 011 Triggers & Scheduled Tasks (SQLite)
|
||||
-- Armature — 011 Triggers & Scheduled Tasks (SQLite)
|
||||
-- ==========================================
|
||||
|
||||
-- ── Extension Triggers (event + webhook) ──────
|
||||
|
||||
@@ -153,8 +153,8 @@ func (h *AuthHandler) Logout(c *gin.Context) {
|
||||
h.uekCache.Evict(userID.(string))
|
||||
}
|
||||
|
||||
// Clear the sb_token cookie so SSR middleware doesn't trust a stale token
|
||||
c.SetCookie("sb_token", "", -1, "/", "", false, false)
|
||||
// Clear the arm_token cookie so SSR middleware doesn't trust a stale token
|
||||
c.SetCookie("arm_token", "", -1, "/", "", false, false)
|
||||
|
||||
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"])
|
||||
|
||||
// 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
|
||||
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
|
||||
}
|
||||
|
||||
// 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.
|
||||
// Used by unauthenticated routes that want optional user context.
|
||||
func UserIDFromCookie(c *gin.Context, jwtSecret string) string {
|
||||
cookie, err := c.Cookie("sb_token")
|
||||
cookie, err := c.Cookie("arm_token")
|
||||
if err != nil || cookie == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
// Unlike Auth() which returns 401 JSON for API calls, this redirects
|
||||
// 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.
|
||||
func AuthOrRedirect(cfg *config.Config, users store.UserStore, cache *UserStatusCache) gin.HandlerFunc {
|
||||
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,
|
||||
// then query param (for edge cases)
|
||||
tokenString := ""
|
||||
if cookie, err := c.Cookie("sb_token"); err == nil && cookie != "" {
|
||||
if cookie, err := c.Cookie("arm_token"); err == nil && cookie != "" {
|
||||
tokenString = cookie
|
||||
}
|
||||
if tokenString == "" {
|
||||
@@ -109,7 +109,7 @@ func OptionalAuth(cfg *config.Config, users store.UserStore, cache *UserStatusCa
|
||||
}
|
||||
|
||||
tokenString := ""
|
||||
if cookie, err := c.Cookie("sb_token"); err == nil && cookie != "" {
|
||||
if cookie, err := c.Cookie("arm_token"); err == nil && cookie != "" {
|
||||
tokenString = cookie
|
||||
}
|
||||
if tokenString == "" {
|
||||
|
||||
@@ -38,10 +38,10 @@
|
||||
<meta name="theme-color" content="#0e0e10" id="metaThemeColor">
|
||||
<script>
|
||||
// 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() {
|
||||
try {
|
||||
var mode = localStorage.getItem('switchboard_theme') || 'system';
|
||||
var mode = localStorage.getItem('armature_theme') || 'system';
|
||||
var resolved = mode;
|
||||
if (mode === 'system') resolved = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
document.documentElement.setAttribute('data-theme', resolved);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* ==========================================
|
||||
Switchboard Core — Admin Surfaces
|
||||
Armature — Admin Surfaces
|
||||
==========================================
|
||||
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
|
||||
(.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');
|
||||
|
||||
/* ==========================================
|
||||
Switchboard Core
|
||||
Armature
|
||||
Clean utility layout · Open WebUI inspired
|
||||
========================================== */
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* ==========================================
|
||||
* Switchboard Core — Workflow Components CSS
|
||||
* Armature — Workflow Components CSS
|
||||
* ========================================== */
|
||||
|
||||
/* ── 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
|
||||
// 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
|
||||
// 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
|
||||
// matching, search/replace, auto-indent, syntax
|
||||
@@ -52,7 +52,7 @@ import { rust } from '@codemirror/lang-rust';
|
||||
import { vim } from '@replit/codemirror-vim';
|
||||
import { emacs } from '@replit/codemirror-emacs';
|
||||
|
||||
import { switchboardTheme } from './theme.mjs';
|
||||
import { armatureTheme } from './theme.mjs';
|
||||
|
||||
// ── Language Registry ────────────────────────
|
||||
|
||||
@@ -144,7 +144,7 @@ export function codeEditor(target, opts = {}) {
|
||||
]),
|
||||
|
||||
// Theme
|
||||
switchboardTheme,
|
||||
armatureTheme,
|
||||
themeCompartment.of(darkMode ? [oneDark] : []),
|
||||
|
||||
// Configurable compartments
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ==========================================
|
||||
// Chat Switchboard — CM6 Bundle Entrypoint
|
||||
// Armature — CM6 Bundle Entrypoint
|
||||
// ==========================================
|
||||
// esbuild compiles this into an IIFE that sets
|
||||
// window.CM with factory functions and utilities.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ==========================================
|
||||
// Chat Switchboard — CM6 @Mention Extension
|
||||
// Armature — CM6 @Mention Extension
|
||||
// ==========================================
|
||||
// Provides:
|
||||
// 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.
|
||||
// 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
|
||||
// theme slots. Works in both light and dark mode.
|
||||
@@ -12,10 +12,10 @@
|
||||
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.
|
||||
*/
|
||||
export const switchboardTheme = EditorView.theme({
|
||||
export const armatureTheme = EditorView.theme({
|
||||
'&': {
|
||||
backgroundColor: 'var(--bg-surface, var(--bg))',
|
||||
color: 'var(--text)',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ==========================================
|
||||
// Chat Switchboard — CM6 Wikilink Extension
|
||||
// Armature — CM6 Wikilink Extension
|
||||
// ==========================================
|
||||
// Provides:
|
||||
// 1. ViewPlugin that decorates [[Title]] as clickable chips
|
||||
|
||||
@@ -238,7 +238,7 @@ export const debugEngine = {
|
||||
|
||||
try {
|
||||
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 (_) {
|
||||
snap.storageKeys = '(error reading)';
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// ==========================================
|
||||
|
||||
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.
|
||||
@@ -44,9 +44,9 @@ export function createAuth() {
|
||||
}));
|
||||
// Cookie sync for Go template page auth
|
||||
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 {
|
||||
document.cookie = 'sb_token=; path=/; max-age=0';
|
||||
document.cookie = 'arm_token=; path=/; max-age=0';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ export function createAuth() {
|
||||
_policies = {};
|
||||
localStorage.removeItem(_storageKey);
|
||||
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; }
|
||||
}
|
||||
|
||||
@@ -197,9 +197,9 @@ export function createAuth() {
|
||||
async boot() {
|
||||
_loadTokens();
|
||||
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.
|
||||
document.cookie = 'sb_token=; path=/; max-age=0';
|
||||
document.cookie = 'arm_token=; path=/; max-age=0';
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// Factory: createTheme(emitFn)
|
||||
// ==========================================
|
||||
|
||||
const _key = 'switchboard_theme';
|
||||
const _key = 'armature_theme';
|
||||
|
||||
/**
|
||||
* Create the theme module.
|
||||
|
||||
Reference in New Issue
Block a user