@auxiora/dashboard 1.0.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/router.d.ts.map +1 -1
  2. package/dist/router.js +195 -49
  3. package/dist/router.js.map +1 -1
  4. package/dist/types.d.ts +66 -0
  5. package/dist/types.d.ts.map +1 -1
  6. package/dist/types.js.map +1 -1
  7. package/package.json +10 -4
  8. package/dist-ui/assets/index-BfY0i5jw.css +0 -1
  9. package/dist-ui/assets/index-CXpk9mvw.js +0 -60
  10. package/dist-ui/icon.svg +0 -59
  11. package/dist-ui/index.html +0 -20
  12. package/src/auth.ts +0 -83
  13. package/src/cloud-types.ts +0 -63
  14. package/src/index.ts +0 -5
  15. package/src/router.ts +0 -2494
  16. package/src/types.ts +0 -269
  17. package/tests/auth.test.ts +0 -51
  18. package/tests/cloud-router.test.ts +0 -249
  19. package/tests/desktop-router.test.ts +0 -151
  20. package/tests/router.test.ts +0 -388
  21. package/tests/trust-router.test.ts +0 -170
  22. package/tsconfig.json +0 -12
  23. package/tsconfig.tsbuildinfo +0 -1
  24. package/ui/index.html +0 -19
  25. package/ui/node_modules/.bin/browserslist +0 -17
  26. package/ui/node_modules/.bin/tsc +0 -17
  27. package/ui/node_modules/.bin/tsserver +0 -17
  28. package/ui/node_modules/.bin/vite +0 -17
  29. package/ui/package.json +0 -23
  30. package/ui/public/icon.svg +0 -59
  31. package/ui/src/App.tsx +0 -63
  32. package/ui/src/api.ts +0 -238
  33. package/ui/src/components/ActivityFeed.tsx +0 -123
  34. package/ui/src/components/BehaviorHealth.tsx +0 -105
  35. package/ui/src/components/DataTable.tsx +0 -39
  36. package/ui/src/components/Layout.tsx +0 -160
  37. package/ui/src/components/PasswordStrength.tsx +0 -31
  38. package/ui/src/components/SetupProgress.tsx +0 -26
  39. package/ui/src/components/StatusBadge.tsx +0 -12
  40. package/ui/src/components/ThemeSelector.tsx +0 -39
  41. package/ui/src/contexts/ThemeContext.tsx +0 -58
  42. package/ui/src/hooks/useApi.ts +0 -19
  43. package/ui/src/hooks/usePolling.ts +0 -8
  44. package/ui/src/main.tsx +0 -16
  45. package/ui/src/pages/AuditLog.tsx +0 -36
  46. package/ui/src/pages/Behaviors.tsx +0 -426
  47. package/ui/src/pages/Chat.tsx +0 -688
  48. package/ui/src/pages/Login.tsx +0 -64
  49. package/ui/src/pages/Overview.tsx +0 -56
  50. package/ui/src/pages/Sessions.tsx +0 -26
  51. package/ui/src/pages/SettingsAmbient.tsx +0 -185
  52. package/ui/src/pages/SettingsConnections.tsx +0 -201
  53. package/ui/src/pages/SettingsNotifications.tsx +0 -241
  54. package/ui/src/pages/SetupAppearance.tsx +0 -45
  55. package/ui/src/pages/SetupChannels.tsx +0 -143
  56. package/ui/src/pages/SetupComplete.tsx +0 -31
  57. package/ui/src/pages/SetupConnections.tsx +0 -80
  58. package/ui/src/pages/SetupDashboardPassword.tsx +0 -50
  59. package/ui/src/pages/SetupIdentity.tsx +0 -68
  60. package/ui/src/pages/SetupPersonality.tsx +0 -78
  61. package/ui/src/pages/SetupProvider.tsx +0 -65
  62. package/ui/src/pages/SetupVault.tsx +0 -50
  63. package/ui/src/pages/SetupWelcome.tsx +0 -19
  64. package/ui/src/pages/UnlockVault.tsx +0 -56
  65. package/ui/src/pages/Webhooks.tsx +0 -158
  66. package/ui/src/pages/settings/Appearance.tsx +0 -63
  67. package/ui/src/pages/settings/Channels.tsx +0 -138
  68. package/ui/src/pages/settings/Identity.tsx +0 -61
  69. package/ui/src/pages/settings/Personality.tsx +0 -54
  70. package/ui/src/pages/settings/PersonalityEditor.tsx +0 -577
  71. package/ui/src/pages/settings/Provider.tsx +0 -537
  72. package/ui/src/pages/settings/Security.tsx +0 -111
  73. package/ui/src/styles/global.css +0 -2308
  74. package/ui/src/styles/themes/index.css +0 -7
  75. package/ui/src/styles/themes/monolith.css +0 -125
  76. package/ui/src/styles/themes/nebula.css +0 -90
  77. package/ui/src/styles/themes/neon.css +0 -149
  78. package/ui/src/styles/themes/polar.css +0 -151
  79. package/ui/src/styles/themes/signal.css +0 -163
  80. package/ui/src/styles/themes/terra.css +0 -146
  81. package/ui/tsconfig.json +0 -14
  82. package/ui/vite.config.ts +0 -20
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAkD,MAAM,SAAS,CAAC;AAGjF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAa,MAAM,YAAY,CAAC;AAO5E,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC;IACxB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;CAC5C;AAYD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,aAAa,CAAA;CAAE,CAi6E9G"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAkD,MAAM,SAAS,CAAC;AAGjF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAa,MAAM,YAAY,CAAC;AAO5E,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC;IACxB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;CAC5C;AAYD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,aAAa,CAAA;CAAE,CA8jF9G"}
package/dist/router.js CHANGED
@@ -20,6 +20,16 @@ export function createDashboardRouter(options) {
20
20
  const { deps, config, verifyPassword } = options;
21
21
  const router = Router();
22
22
  const auth = new DashboardAuth(config.sessionTtlMs);
23
+ const PROVIDER_VAULT_KEYS = {
24
+ anthropic: 'ANTHROPIC_API_KEY',
25
+ openai: 'OPENAI_API_KEY',
26
+ google: 'GOOGLE_API_KEY',
27
+ groq: 'GROQ_API_KEY',
28
+ deepseek: 'DEEPSEEK_API_KEY',
29
+ cohere: 'COHERE_API_KEY',
30
+ xai: 'XAI_API_KEY',
31
+ replicate: 'REPLICATE_API_TOKEN',
32
+ };
23
33
  // --- Auth middleware ---
24
34
  function requireAuth(req, res, next) {
25
35
  // OAuth callbacks are public — Google redirects here without a session cookie
@@ -181,6 +191,25 @@ export function createDashboardRouter(options) {
181
191
  ...(vibe && typeof vibe === 'string' ? { vibe } : {}),
182
192
  },
183
193
  });
194
+ // Sync name/pronouns into SOUL.md frontmatter so the personality files
195
+ // don't contradict the config (the AI reads both).
196
+ if (setup.getSoulContent && setup.saveSoulContent) {
197
+ try {
198
+ const soul = await setup.getSoulContent();
199
+ if (soul) {
200
+ let updated = soul.replace(/^(name:\s*).+$/m, `$1${name}`);
201
+ if (pronouns) {
202
+ updated = updated.replace(/^(pronouns:\s*).+$/m, `$1${pronouns}`);
203
+ }
204
+ if (updated !== soul) {
205
+ await setup.saveSoulContent(updated);
206
+ }
207
+ }
208
+ }
209
+ catch {
210
+ // SOUL.md not available yet — will be created during personality step
211
+ }
212
+ }
184
213
  void audit('setup.identity', { name, pronouns, vibe });
185
214
  res.json({ success: true, name });
186
215
  });
@@ -211,47 +240,52 @@ export function createDashboardRouter(options) {
211
240
  }
212
241
  });
213
242
  router.post('/setup/provider', async (req, res) => {
214
- const { provider, apiKey } = req.body;
215
- if (!provider) {
216
- res.status(400).json({ error: 'Provider is required' });
217
- return;
218
- }
219
- if (provider !== 'anthropic' && provider !== 'openai' && provider !== 'ollama') {
220
- res.status(400).json({ error: 'Provider must be "anthropic", "openai", or "ollama"' });
221
- return;
222
- }
223
- if (provider === 'ollama') {
224
- const endpoint = req.body.endpoint;
225
- if (setup?.saveConfig) {
226
- await setup.saveConfig({
227
- provider: {
228
- primary: 'ollama',
229
- ollama: { baseUrl: endpoint || 'http://localhost:11434' },
230
- },
231
- });
243
+ const { providers: providerList, provider, apiKey } = req.body;
244
+ // Support both legacy single-provider and new multi-provider format
245
+ const entries = providerList ?? (provider ? [{ name: provider, apiKey, endpoint: req.body.endpoint }] : []);
246
+ if (entries.length === 0) {
247
+ res.status(400).json({ error: 'At least one provider is required' });
248
+ return;
249
+ }
250
+ let primary;
251
+ const configured = [];
252
+ for (const entry of entries) {
253
+ if (entry.name === 'ollama') {
254
+ if (setup?.saveConfig) {
255
+ await setup.saveConfig({
256
+ provider: { ollama: { baseUrl: entry.endpoint || 'http://localhost:11434' } },
257
+ });
258
+ }
259
+ configured.push('ollama');
260
+ if (!primary)
261
+ primary = 'ollama';
262
+ continue;
232
263
  }
233
- void audit('setup.provider', { provider });
234
- res.json({ success: true, provider });
235
- return;
236
- }
237
- if (!apiKey) {
238
- res.status(400).json({ error: 'API key is required for this provider' });
239
- return;
240
- }
241
- const vaultKey = provider === 'anthropic' ? 'ANTHROPIC_API_KEY' : 'OPENAI_API_KEY';
242
- try {
243
- await deps.vault.add(vaultKey, apiKey);
264
+ const vaultKey = PROVIDER_VAULT_KEYS[entry.name];
265
+ if (!vaultKey) {
266
+ res.status(400).json({ error: `Unknown provider: ${entry.name}` });
267
+ return;
268
+ }
269
+ if (!entry.apiKey) {
270
+ continue; // skip providers with no key provided
271
+ }
272
+ try {
273
+ await deps.vault.add(vaultKey, entry.apiKey);
274
+ }
275
+ catch (error) {
276
+ const msg = error instanceof Error ? error.message : 'Failed to store API key';
277
+ res.status(400).json({ error: `Vault error for ${entry.name}: ${msg}` });
278
+ return;
279
+ }
280
+ configured.push(entry.name);
281
+ if (!primary)
282
+ primary = entry.name;
244
283
  }
245
- catch (error) {
246
- const msg = error instanceof Error ? error.message : 'Failed to store API key';
247
- res.status(400).json({ error: `Vault is not initialized. Complete the vault setup step first. (${msg})` });
248
- return;
284
+ if (primary && setup?.saveConfig) {
285
+ await setup.saveConfig({ provider: { primary } });
249
286
  }
250
- if (setup?.saveConfig) {
251
- await setup.saveConfig({ provider: { primary: provider } });
252
- }
253
- void audit('setup.provider', { provider });
254
- res.json({ success: true, provider });
287
+ void audit('setup.provider', { providers: configured });
288
+ res.json({ success: true, providers: configured, primary });
255
289
  });
256
290
  router.post('/setup/channels', async (req, res) => {
257
291
  if (!setup?.saveConfig) {
@@ -566,13 +600,21 @@ export function createDashboardRouter(options) {
566
600
  return;
567
601
  }
568
602
  const chatId = String(req.params.id);
569
- const { title, archived } = req.body;
603
+ const { title, archived, personality } = req.body;
570
604
  if (title !== undefined && deps.sessions.renameChat) {
571
605
  deps.sessions.renameChat(chatId, title);
572
606
  }
573
607
  if (archived === true && deps.sessions.archiveChat) {
574
608
  deps.sessions.archiveChat(chatId);
575
609
  }
610
+ if (personality !== undefined && deps.sessions.updateChatMetadata) {
611
+ const validPersonalities = ['standard', 'the-architect'];
612
+ if (!validPersonalities.includes(personality)) {
613
+ res.status(400).json({ error: `Invalid personality: must be one of ${validPersonalities.join(', ')}` });
614
+ return;
615
+ }
616
+ deps.sessions.updateChatMetadata(chatId, { personality });
617
+ }
576
618
  res.json({ data: { ok: true } });
577
619
  });
578
620
  router.delete('/chats/:id', (req, res) => {
@@ -612,6 +654,16 @@ export function createDashboardRouter(options) {
612
654
  },
613
655
  });
614
656
  });
657
+ // --- Active agents snapshot ---
658
+ router.get('/status/agents', (_req, res) => {
659
+ res.json({ data: deps.getActiveAgents?.() ?? [] });
660
+ });
661
+ router.get('/status/health', (_req, res) => {
662
+ res.json({ data: deps.getHealthState?.() ?? { overall: 'unknown', subsystems: [], issues: [], lastCheck: '' } });
663
+ });
664
+ router.get('/status/capabilities', (_req, res) => {
665
+ res.json({ data: deps.getCapabilities?.() ?? null });
666
+ });
615
667
  // --- Settings routes (authenticated) ---
616
668
  // Identity
617
669
  router.get('/identity', (req, res) => {
@@ -789,16 +841,6 @@ export function createDashboardRouter(options) {
789
841
  res.json({ success: true });
790
842
  });
791
843
  // Provider: configure a specific provider's credentials (does NOT change primary/fallback)
792
- const PROVIDER_VAULT_KEYS = {
793
- anthropic: 'ANTHROPIC_API_KEY',
794
- openai: 'OPENAI_API_KEY',
795
- google: 'GOOGLE_API_KEY',
796
- groq: 'GROQ_API_KEY',
797
- deepseek: 'DEEPSEEK_API_KEY',
798
- cohere: 'COHERE_API_KEY',
799
- xai: 'XAI_API_KEY',
800
- replicate: 'REPLICATE_API_TOKEN',
801
- };
802
844
  const VALID_PROVIDERS = ['anthropic', 'openai', 'google', 'ollama', 'groq', 'deepseek', 'cohere', 'xai', 'openaiCompatible', 'claudeOAuth'];
803
845
  // --- Claude OAuth PKCE flow ---
804
846
  const pkceStates = new Map();
@@ -2097,6 +2139,110 @@ export function createDashboardRouter(options) {
2097
2139
  res.status(500).json({ error: 'Failed to save appearance config' });
2098
2140
  }
2099
2141
  });
2142
+ // --- Global personality engine toggle ---
2143
+ router.get('/personality/engine', (_req, res) => {
2144
+ const engine = deps.getPersonalityEngine ? deps.getPersonalityEngine() : 'standard';
2145
+ res.json({ data: { engine } });
2146
+ });
2147
+ router.put('/personality/engine', async (req, res) => {
2148
+ const { engine } = req.body;
2149
+ const validEngines = ['standard', 'the-architect'];
2150
+ if (!engine || !validEngines.includes(engine)) {
2151
+ res.status(400).json({ error: `Invalid engine: must be one of ${validEngines.join(', ')}` });
2152
+ return;
2153
+ }
2154
+ // Update in-memory
2155
+ if (deps.setPersonalityEngine) {
2156
+ deps.setPersonalityEngine(engine);
2157
+ }
2158
+ // Persist to config file
2159
+ if (setup?.saveConfig) {
2160
+ await setup.saveConfig({ agent: { personality: engine } });
2161
+ }
2162
+ void audit('settings.personality', { engine });
2163
+ res.json({ success: true });
2164
+ });
2165
+ // --- Architect personality engine routes ---
2166
+ const ARCHITECT_DOMAINS = [
2167
+ 'security_review', 'code_engineering', 'architecture_design', 'debugging',
2168
+ 'team_leadership', 'one_on_one', 'sales_pitch', 'negotiation',
2169
+ 'marketing_content', 'strategic_planning', 'crisis_management',
2170
+ 'creative_work', 'writing_content', 'decision_making',
2171
+ 'learning_research', 'personal_development', 'general',
2172
+ ];
2173
+ function architectDefaults() {
2174
+ const now = Date.now();
2175
+ const history = {};
2176
+ for (const d of ARCHITECT_DOMAINS)
2177
+ history[d] = 0;
2178
+ return {
2179
+ corrections: '{"corrections":[]}',
2180
+ showContextIndicator: true,
2181
+ showSourcesButton: true,
2182
+ autoDetectContext: true,
2183
+ defaultContext: null,
2184
+ contextUsageHistory: history,
2185
+ totalInteractions: 0,
2186
+ firstUsed: now,
2187
+ lastUsed: now,
2188
+ version: 1,
2189
+ };
2190
+ }
2191
+ function loadArchitectPrefs() {
2192
+ const raw = deps.vault.get('architect_preferences');
2193
+ if (!raw)
2194
+ return architectDefaults();
2195
+ try {
2196
+ return { ...architectDefaults(), ...JSON.parse(raw) };
2197
+ }
2198
+ catch {
2199
+ return architectDefaults();
2200
+ }
2201
+ }
2202
+ router.get('/architect/preferences', (_req, res) => {
2203
+ res.json({ data: loadArchitectPrefs() });
2204
+ });
2205
+ router.patch('/architect/preferences', async (req, res) => {
2206
+ try {
2207
+ const { key, value } = req.body;
2208
+ if (!key) {
2209
+ res.status(400).json({ error: 'Missing preference key' });
2210
+ return;
2211
+ }
2212
+ const prefs = loadArchitectPrefs();
2213
+ prefs[key] = value;
2214
+ await deps.vault.add('architect_preferences', JSON.stringify(prefs));
2215
+ res.json({ success: true });
2216
+ }
2217
+ catch {
2218
+ res.status(500).json({ error: 'Failed to update architect preference' });
2219
+ }
2220
+ });
2221
+ router.delete('/architect/data', async (_req, res) => {
2222
+ try {
2223
+ await deps.vault.add('architect_preferences', JSON.stringify(architectDefaults()));
2224
+ await deps.vault.add('architect.learning', JSON.stringify({}));
2225
+ res.json({ success: true });
2226
+ }
2227
+ catch {
2228
+ res.status(500).json({ error: 'Failed to clear architect data' });
2229
+ }
2230
+ });
2231
+ router.get('/architect/data/export', (_req, res) => {
2232
+ try {
2233
+ const prefs = deps.vault.get('architect_preferences') || '{}';
2234
+ const learning = deps.vault.get('architect.learning') || '{}';
2235
+ const exportData = JSON.stringify({
2236
+ preferences: JSON.parse(prefs),
2237
+ learning: JSON.parse(learning),
2238
+ exportedAt: new Date().toISOString(),
2239
+ }, null, 2);
2240
+ res.json({ data: exportData });
2241
+ }
2242
+ catch {
2243
+ res.status(500).json({ error: 'Failed to export architect data' });
2244
+ }
2245
+ });
2100
2246
  // --- Notification routes ---
2101
2247
  router.get('/notifications', (_req, res) => {
2102
2248
  const raw = deps.vault.get('notifications.recent');