anentrypoint-design 0.0.412 → 0.0.413

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anentrypoint-design",
3
- "version": "0.0.412",
3
+ "version": "0.0.413",
4
4
  "description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
5
5
  "type": "module",
6
6
  "main": "./dist/247420.js",
@@ -0,0 +1,159 @@
1
+ // Freddie pages for sidebar routes that don't yet have dedicated page modules.
2
+ // Each page is a minimal but functional renderer over the existing /api/* endpoints.
3
+ // These fill the gap between sidebar links and the FREDDIE_PAGES registry.
4
+
5
+ import { makePage, api, loadingState, errorState, emptyState } from './runtime.js';
6
+ import { Table, PageHeader, Kpi } from '../content.js';
7
+ import { section, truncSpan, TRUNC_TITLE } from './shared.js';
8
+
9
+ // ---- terminal ---------------------------------------------------------------
10
+ // Backend: GET /api/terminal (if available) — shows terminal sessions list
11
+
12
+ export const terminal = makePage((ctx) => {
13
+ async function load() { try { ctx.set({ loading: false, data: await api('/api/terminal').catch(() => null), error: null }); } catch (e) { ctx.set({ loading: false, error: e }); } }
14
+ load();
15
+ return () => {
16
+ const s = ctx.state;
17
+ if (s.loading) return loadingState('loading terminal…');
18
+ if (s.error && !s.data) return errorState(s.error, load);
19
+ return [
20
+ PageHeader({ title: 'terminal', lede: 'terminal sessions' }),
21
+ s.data ? section('sessions', Table({ headers: ['id', 'status'], rows: (Array.isArray(s.data) ? s.data : []).map(t => [t.id || '—', t.status || '—']) }))
22
+ : emptyState('terminal endpoint not available'),
23
+ ];
24
+ };
25
+ });
26
+
27
+ // ---- files ----------------------------------------------------------------
28
+ // Backend: GET /api/files?path=... — file browser
29
+
30
+ export const files = makePage((ctx) => {
31
+ async function load() { try { ctx.set({ loading: false, data: await api('/api/files').catch(() => null), error: null }); } catch (e) { ctx.set({ loading: false, error: e }); } }
32
+ load();
33
+ return () => {
34
+ const s = ctx.state;
35
+ if (s.loading) return loadingState('loading files…');
36
+ if (s.error && !s.data) return errorState(s.error, load);
37
+ return [
38
+ PageHeader({ title: 'files', lede: 'file browser' }),
39
+ s.data ? section('files', Table({ headers: ['path', 'size', 'type'], rows: (Array.isArray(s.data) ? s.data : []).map(f => [f.path || '—', f.size ?? '—', f.type || '—']) }))
40
+ : emptyState('files endpoint not available'),
41
+ ];
42
+ };
43
+ });
44
+
45
+ // ---- auth -----------------------------------------------------------------
46
+ // Backend: GET /api/auth — per-provider key status
47
+
48
+ export const auth = makePage((ctx) => {
49
+ async function load() { try { ctx.set({ loading: false, data: await api('/api/auth').catch(() => null), error: null }); } catch (e) { ctx.set({ loading: false, error: e }); } }
50
+ load();
51
+ return () => {
52
+ const s = ctx.state;
53
+ if (s.loading) return loadingState('loading auth…');
54
+ if (s.error && !s.data) return errorState(s.error, load);
55
+ const providers = s.data || [];
56
+ return [
57
+ PageHeader({ title: 'auth', lede: 'API keys & credentials' }),
58
+ providers.length
59
+ ? section('providers', Table({ headers: ['provider', 'status'], rows: providers.map(p => [p.provider || p.key || '—', p.set ? 'configured' : 'not set']) }))
60
+ : emptyState('no providers configured'),
61
+ ];
62
+ };
63
+ });
64
+
65
+ // ---- settings --------------------------------------------------------------
66
+ // Backend: GET /api/config — configuration values
67
+
68
+ export const settings = makePage((ctx) => {
69
+ async function load() { try { ctx.set({ loading: false, data: await api('/api/config').catch(() => null), error: null }); } catch (e) { ctx.set({ loading: false, error: e }); } }
70
+ load();
71
+ return () => {
72
+ const s = ctx.state;
73
+ if (s.loading) return loadingState('loading settings…');
74
+ if (s.error && !s.data) return errorState(s.error, load);
75
+ const entries = s.data ? Object.entries(s.data) : [];
76
+ return [
77
+ PageHeader({ title: 'settings', lede: 'configuration' }),
78
+ entries.length
79
+ ? section('config', Table({ headers: ['key', 'value'], rows: entries.map(([k, v]) => [k, typeof v === 'object' ? JSON.stringify(v) : String(v)]) }))
80
+ : emptyState('no config values'),
81
+ ];
82
+ };
83
+ });
84
+
85
+ // ---- theme ----------------------------------------------------------------
86
+ // Client-side only: theme preference selector
87
+
88
+ export const themePage = makePage((ctx) => {
89
+ return () => {
90
+ return [
91
+ PageHeader({ title: 'theme', lede: 'theme preference' }),
92
+ section('current', Table({ headers: ['setting', 'value'], rows: [
93
+ ['theme', (typeof window !== 'undefined' && document.documentElement.getAttribute('data-theme')) || 'github-dark'],
94
+ ['density', (typeof window !== 'undefined' && document.documentElement.getAttribute('data-density')) || 'compact'],
95
+ ['accent', (typeof window !== 'undefined' && document.documentElement.getAttribute('data-accent')) || 'default'],
96
+ ] })),
97
+ ];
98
+ };
99
+ });
100
+
101
+ // ---- worktree --------------------------------------------------------------
102
+ // Backend: GET /api/worktree — git worktrees
103
+
104
+ export const worktree = makePage((ctx) => {
105
+ async function load() { try { ctx.set({ loading: false, data: await api('/api/worktree').catch(() => null), error: null }); } catch (e) { ctx.set({ loading: false, error: e }); } }
106
+ load();
107
+ return () => {
108
+ const s = ctx.state;
109
+ if (s.loading) return loadingState('loading worktrees…');
110
+ if (s.error && !s.data) return errorState(s.error, load);
111
+ const trees = Array.isArray(s.data) ? s.data : [];
112
+ return [
113
+ PageHeader({ title: 'worktrees', lede: 'git worktrees' }),
114
+ trees.length
115
+ ? section('worktrees', Table({ headers: ['path', 'branch', 'hash'], rows: trees.map(t => [t.path || '—', t.branch || '—', t.hash || '—']) }))
116
+ : emptyState('no worktrees'),
117
+ ];
118
+ };
119
+ });
120
+
121
+ // ---- session-tree ----------------------------------------------------------
122
+ // Backend: GET /api/sessions?tree=1 — session tree
123
+
124
+ export const sessionTree = makePage((ctx) => {
125
+ async function load() { try { ctx.set({ loading: false, data: await api('/api/sessions?tree=1').catch(() => null), error: null }); } catch (e) { ctx.set({ loading: false, error: e }); } }
126
+ load();
127
+ return () => {
128
+ const s = ctx.state;
129
+ if (s.loading) return loadingState('loading session tree…');
130
+ if (s.error && !s.data) return errorState(s.error, load);
131
+ const sessions = Array.isArray(s.data) ? s.data : [];
132
+ return [
133
+ PageHeader({ title: 'session tree', lede: 'session hierarchy' }),
134
+ sessions.length
135
+ ? section('sessions', Table({ headers: ['id', 'title', 'parent'], rows: sessions.slice(0, 20).map(x => [x.id || '—', truncSpan(x.title || x.id, TRUNC_TITLE), x.parent_id || '—']) }))
136
+ : emptyState('no sessions'),
137
+ ];
138
+ };
139
+ });
140
+
141
+ // ---- notifications ---------------------------------------------------------
142
+ // Backend: GET /api/notifications — notification list
143
+
144
+ export const notifications = makePage((ctx) => {
145
+ async function load() { try { ctx.set({ loading: false, data: await api('/api/notifications').catch(() => null), error: null }); } catch (e) { ctx.set({ loading: false, error: e }); } }
146
+ load();
147
+ return () => {
148
+ const s = ctx.state;
149
+ if (s.loading) return loadingState('loading notifications…');
150
+ if (s.error && !s.data) return errorState(s.error, load);
151
+ const items = Array.isArray(s.data) ? s.data : [];
152
+ return [
153
+ PageHeader({ title: 'notifications', lede: 'alerts & notices' }),
154
+ items.length
155
+ ? section('notifications', Table({ headers: ['type', 'message', 'time'], rows: items.map(n => [n.type || '—', truncSpan(n.message || '', 100), n.time || '—']) }))
156
+ : emptyState('no notifications'),
157
+ ];
158
+ };
159
+ });
@@ -17,6 +17,7 @@ import { config, env } from './freddie/pages-config.js';
17
17
  import { cron, tools, batch } from './freddie/pages-runners.js';
18
18
  import { gateway, chains, machines, health } from './freddie/pages-infra.js';
19
19
  import { logs, debug } from './freddie/pages-telemetry.js';
20
+ import { terminal, files, auth, settings, themePage as theme, worktree, sessionTree, notifications } from './freddie/pages-missing.js';
20
21
 
21
22
  // ---- registry --------------------------------------------------------------
22
23
 
@@ -24,6 +25,9 @@ export const FREDDIE_PAGES = {
24
25
  home, chat, voice, sessions, projects, agents, analytics,
25
26
  models, cron, skills, plugins, config, env, tools, batch, gateway, chains,
26
27
  machines, health, debug, logs, git,
28
+ terminal, files, auth, settings, theme, worktree,
29
+ 'session-tree': sessionTree,
30
+ notifications,
27
31
  };
28
32
 
29
33
  export {