anentrypoint-design 0.0.121 → 0.0.124

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 (202) hide show
  1. package/README.md +253 -253
  2. package/app-shell.css +931 -594
  3. package/colors_and_type.css +226 -226
  4. package/community.css +817 -1222
  5. package/dist/247420.css +2202 -2084
  6. package/dist/247420.js +13 -13
  7. package/package.json +80 -80
  8. package/src/bootstrap.js +25 -25
  9. package/src/components/chat.js +199 -199
  10. package/src/components/community.js +190 -208
  11. package/src/components/content.js +269 -269
  12. package/src/components/editor-primitives.js +100 -0
  13. package/src/components/files-modals.js +107 -107
  14. package/src/components/files.js +118 -118
  15. package/src/components/freddie/helpers.js +50 -50
  16. package/src/components/freddie.js +33 -33
  17. package/src/components/shell.js +117 -117
  18. package/src/components/theme-toggle.js +70 -70
  19. package/src/components.js +59 -57
  20. package/src/debug.js +30 -30
  21. package/src/deck-stage.js +21 -21
  22. package/src/highlight.js +65 -32
  23. package/src/index.js +86 -86
  24. package/src/kits/os/about-app.js +52 -52
  25. package/src/kits/os/app-panes.css +152 -152
  26. package/src/kits/os/browser-app.js +58 -58
  27. package/src/kits/os/files-app.js +44 -44
  28. package/src/kits/os/freddie/helpers.js +59 -59
  29. package/src/kits/os/freddie/pages-chat.js +143 -143
  30. package/src/kits/os/freddie/pages-core.js +101 -101
  31. package/src/kits/os/freddie/pages-os.js +51 -51
  32. package/src/kits/os/freddie/pages-tools.js +183 -183
  33. package/src/kits/os/freddie/routes.js +24 -24
  34. package/src/kits/os/freddie-dashboard.css +51 -51
  35. package/src/kits/os/freddie-dashboard.js +101 -101
  36. package/src/kits/os/icons.js +17 -17
  37. package/src/kits/os/index.js +17 -17
  38. package/src/kits/os/launcher.css +61 -61
  39. package/src/kits/os/launcher.js +79 -79
  40. package/src/kits/os/monitor-app.js +34 -34
  41. package/src/kits/os/shell.js +214 -214
  42. package/src/kits/os/terminal-app.js +45 -45
  43. package/src/kits/os/theme.css +450 -450
  44. package/src/kits/os/validate.css +19 -19
  45. package/src/kits/os/validator-app.js +55 -55
  46. package/src/kits/os/wm.css +115 -115
  47. package/src/kits/os/wm.js +111 -111
  48. package/src/markdown.js +39 -39
  49. package/src/motion.js +35 -35
  50. package/src/page-html.js +196 -196
  51. package/src/styles.js +25 -25
  52. package/src/theme.js +99 -99
  53. package/src/web-components/ds-chat.js +116 -116
  54. package/dist/.nojekyll +0 -0
  55. package/dist/app-shell.css +0 -594
  56. package/dist/colors_and_type.css +0 -197
  57. package/dist/favicon.svg +0 -1
  58. package/dist/index.html +0 -308
  59. package/dist/preview/buttons.html +0 -28
  60. package/dist/preview/colors-core.html +0 -45
  61. package/dist/preview/colors-lore.html +0 -28
  62. package/dist/preview/colors-semantic.html +0 -34
  63. package/dist/preview/dateline.html +0 -19
  64. package/dist/preview/dropzone.html +0 -30
  65. package/dist/preview/file-grid.html +0 -19
  66. package/dist/preview/file-row.html +0 -20
  67. package/dist/preview/file-toolbar.html +0 -40
  68. package/dist/preview/file-viewer.html +0 -31
  69. package/dist/preview/header.html +0 -24
  70. package/dist/preview/icons-unicode.html +0 -26
  71. package/dist/preview/index-row.html +0 -25
  72. package/dist/preview/inputs.html +0 -22
  73. package/dist/preview/manifesto.html +0 -52
  74. package/dist/preview/motion-default.js +0 -106
  75. package/dist/preview/rules.html +0 -16
  76. package/dist/preview/spacing.html +0 -18
  77. package/dist/preview/stamps-lore.html +0 -20
  78. package/dist/preview/stamps.html +0 -14
  79. package/dist/preview/theme-ink.html +0 -15
  80. package/dist/preview/type-display.html +0 -16
  81. package/dist/preview/type-mono.html +0 -15
  82. package/dist/preview/type-prose.html +0 -11
  83. package/dist/preview/type-scale.html +0 -20
  84. package/dist/preview/wordmarks.html +0 -28
  85. package/dist/robots.txt +0 -8
  86. package/dist/site/content/globals/navigation.yaml +0 -5
  87. package/dist/site/content/globals/site.yaml +0 -16
  88. package/dist/site/content/pages/freddie.yaml +0 -88
  89. package/dist/site/content/pages/home.yaml +0 -190
  90. package/dist/site/theme.mjs +0 -368
  91. package/dist/sitemap.xml +0 -31
  92. package/dist/slides/deck-stage-overlay.js +0 -63
  93. package/dist/slides/deck-stage-state.js +0 -81
  94. package/dist/slides/deck-stage-style.js +0 -117
  95. package/dist/slides/deck-stage.js +0 -159
  96. package/dist/slides/index.html +0 -276
  97. package/dist/src/bootstrap.js +0 -25
  98. package/dist/src/components/chat.js +0 -199
  99. package/dist/src/components/community.js +0 -167
  100. package/dist/src/components/content.js +0 -213
  101. package/dist/src/components/files-modals.js +0 -107
  102. package/dist/src/components/files.js +0 -118
  103. package/dist/src/components/freddie/helpers.js +0 -50
  104. package/dist/src/components/freddie.js +0 -33
  105. package/dist/src/components/shell.js +0 -117
  106. package/dist/src/components/theme-toggle.js +0 -70
  107. package/dist/src/components.js +0 -52
  108. package/dist/src/debug.js +0 -30
  109. package/dist/src/deck-stage.js +0 -21
  110. package/dist/src/highlight.js +0 -32
  111. package/dist/src/index.js +0 -86
  112. package/dist/src/kits/os/about-app.js +0 -52
  113. package/dist/src/kits/os/app-panes.css +0 -152
  114. package/dist/src/kits/os/browser-app.js +0 -58
  115. package/dist/src/kits/os/files-app.js +0 -44
  116. package/dist/src/kits/os/freddie/helpers.js +0 -59
  117. package/dist/src/kits/os/freddie/pages-chat.js +0 -143
  118. package/dist/src/kits/os/freddie/pages-core.js +0 -101
  119. package/dist/src/kits/os/freddie/pages-os.js +0 -51
  120. package/dist/src/kits/os/freddie/pages-tools.js +0 -183
  121. package/dist/src/kits/os/freddie/routes.js +0 -24
  122. package/dist/src/kits/os/freddie-dashboard.css +0 -51
  123. package/dist/src/kits/os/freddie-dashboard.js +0 -101
  124. package/dist/src/kits/os/icons.js +0 -17
  125. package/dist/src/kits/os/index.js +0 -5
  126. package/dist/src/kits/os/launcher.css +0 -61
  127. package/dist/src/kits/os/launcher.js +0 -79
  128. package/dist/src/kits/os/monitor-app.js +0 -34
  129. package/dist/src/kits/os/shell.js +0 -214
  130. package/dist/src/kits/os/terminal-app.js +0 -45
  131. package/dist/src/kits/os/theme.css +0 -412
  132. package/dist/src/kits/os/validate.css +0 -19
  133. package/dist/src/kits/os/validator-app.js +0 -55
  134. package/dist/src/kits/os/wm.css +0 -115
  135. package/dist/src/kits/os/wm.js +0 -111
  136. package/dist/src/markdown.js +0 -39
  137. package/dist/src/motion.js +0 -35
  138. package/dist/src/page-html.js +0 -196
  139. package/dist/src/styles.js +0 -25
  140. package/dist/src/theme.js +0 -99
  141. package/dist/src/web-components/ds-chat.js +0 -45
  142. package/dist/ui_kits/aicat/README.md +0 -7
  143. package/dist/ui_kits/aicat/app.js +0 -156
  144. package/dist/ui_kits/aicat/index.html +0 -26
  145. package/dist/ui_kits/aicat/sample-square.png +0 -0
  146. package/dist/ui_kits/aicat/sample-svg.svg +0 -1
  147. package/dist/ui_kits/aicat/sample.pdf +0 -32
  148. package/dist/ui_kits/blog/README.md +0 -3
  149. package/dist/ui_kits/blog/index.html +0 -90
  150. package/dist/ui_kits/chat/README.md +0 -5
  151. package/dist/ui_kits/chat/app.js +0 -110
  152. package/dist/ui_kits/chat/index.html +0 -26
  153. package/dist/ui_kits/chat/sample-square.png +0 -0
  154. package/dist/ui_kits/chat/sample-svg.svg +0 -1
  155. package/dist/ui_kits/chat/sample.pdf +0 -32
  156. package/dist/ui_kits/community/app.js +0 -134
  157. package/dist/ui_kits/community/index.html +0 -24
  158. package/dist/ui_kits/dashboard/app.js +0 -92
  159. package/dist/ui_kits/dashboard/index.html +0 -26
  160. package/dist/ui_kits/docs/README.md +0 -3
  161. package/dist/ui_kits/docs/index.html +0 -123
  162. package/dist/ui_kits/error_404/app.js +0 -56
  163. package/dist/ui_kits/error_404/index.html +0 -26
  164. package/dist/ui_kits/file_browser/README.md +0 -48
  165. package/dist/ui_kits/file_browser/app.js +0 -231
  166. package/dist/ui_kits/file_browser/index.html +0 -33
  167. package/dist/ui_kits/gallery/app.js +0 -121
  168. package/dist/ui_kits/gallery/index.html +0 -26
  169. package/dist/ui_kits/homepage/README.md +0 -7
  170. package/dist/ui_kits/homepage/app.js +0 -167
  171. package/dist/ui_kits/homepage/index.html +0 -46
  172. package/dist/ui_kits/project_page/README.md +0 -3
  173. package/dist/ui_kits/project_page/app.js +0 -154
  174. package/dist/ui_kits/project_page/index.html +0 -45
  175. package/dist/ui_kits/search/app.js +0 -107
  176. package/dist/ui_kits/search/index.html +0 -26
  177. package/dist/ui_kits/settings/app.js +0 -133
  178. package/dist/ui_kits/settings/index.html +0 -26
  179. package/dist/ui_kits/signin/app.js +0 -115
  180. package/dist/ui_kits/signin/index.html +0 -26
  181. package/dist/ui_kits/slide_deck/app.js +0 -174
  182. package/dist/ui_kits/slide_deck/index.html +0 -26
  183. package/dist/ui_kits/system_primer/app.js +0 -152
  184. package/dist/ui_kits/system_primer/index.html +0 -26
  185. package/dist/ui_kits/terminal/app.js +0 -150
  186. package/dist/ui_kits/terminal/index.html +0 -26
  187. package/dist/vendor/webjsx/applyDiff.js +0 -182
  188. package/dist/vendor/webjsx/attributes.js +0 -154
  189. package/dist/vendor/webjsx/constants.js +0 -4
  190. package/dist/vendor/webjsx/createDOMElement.js +0 -52
  191. package/dist/vendor/webjsx/createElement.js +0 -75
  192. package/dist/vendor/webjsx/elementTags.js +0 -115
  193. package/dist/vendor/webjsx/factory.js +0 -6
  194. package/dist/vendor/webjsx/index.js +0 -6
  195. package/dist/vendor/webjsx/jsx-dev-runtime.js +0 -2
  196. package/dist/vendor/webjsx/jsx-runtime.js +0 -30
  197. package/dist/vendor/webjsx/jsx.js +0 -2
  198. package/dist/vendor/webjsx/package.json +0 -39
  199. package/dist/vendor/webjsx/renderSuspension.js +0 -25
  200. package/dist/vendor/webjsx/types.js +0 -5
  201. package/dist/vendor/webjsx/utils.js +0 -84
  202. package/src/components/overlays.js +0 -151
@@ -1,24 +0,0 @@
1
- export const ROUTES = [
2
- { path: 'projects', label: 'projects', glyph: '◆' },
3
- { path: 'home', label: 'home', glyph: '⌂' },
4
- { path: 'chat', label: 'chat', glyph: '⌨' },
5
- { path: 'sessions', label: 'sessions', glyph: '✉' },
6
- { path: 'agents', label: 'agents', glyph: '◈' },
7
- { path: 'analytics', label: 'analytics', glyph: '◉' },
8
- { path: 'models', label: 'models', glyph: '◎' },
9
- { path: 'logs', label: 'logs', glyph: '☰' },
10
- { path: 'cron', label: 'cron', glyph: '◷' },
11
- { path: 'skills', label: 'skills', glyph: '◈' },
12
- { path: 'config', label: 'config', glyph: '⚙' },
13
- { path: 'env', label: 'keys', glyph: '⚿' },
14
- { path: 'tools', label: 'tools', glyph: '⚒' },
15
- { path: 'batch', label: 'batch', glyph: '⊞' },
16
- { path: 'gateway', label: 'gateway', glyph: '⇌' },
17
- ];
18
-
19
- export const OS_ROUTE_DEFS = [
20
- { path: 'os-instances', label: 'instances', glyph: '◫' },
21
- { path: 'os-windows', label: 'windows', glyph: '▭' },
22
- { path: 'os-x', label: 'x-server', glyph: '✕' },
23
- { path: 'os-fs', label: 'fs', glyph: '📁' },
24
- ];
@@ -1,51 +0,0 @@
1
- /* freddie-dashboard.css — supplemental rules for the freddie dashboard surfaces.
2
- Most of the dashboard renders through bible components (AppShell/Panel/Kpi/
3
- Table/Receipt/Hero/Row/EmptyState/Chip) that ship their own classes via
4
- 247420.css. This file holds the freddie-specific chrome that AGENTS.md's
5
- inline-styles ban pushed out of freddie-dashboard.js and the freddie/* page
6
- modules. */
7
-
8
- .app-fd .fd-pre {
9
- font-family: var(--ff-mono, JetBrains Mono, monospace);
10
- font-size: 12px;
11
- white-space: pre-wrap;
12
- word-break: break-all;
13
- margin: 0;
14
- max-height: 320px;
15
- overflow: auto;
16
- background: var(--panel-2, #DDD3BC);
17
- padding: 8px 10px;
18
- border-radius: var(--r-1, 6px);
19
- }
20
-
21
- .fd-root { height: 100%; overflow: hidden; display: flex; flex-direction: column; }
22
-
23
- .fd-btn-mini { padding: 2px 10px; font-size: 0.8em; }
24
-
25
- /* chat composer fields */
26
- .fd-chat-form { display: flex; flex-direction: column; gap: var(--tool-gutter, 16px); }
27
- .fd-chat-row { display: flex; gap: var(--tool-gutter, 16px); flex-wrap: wrap; }
28
- .fd-chat-field { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
29
- .fd-chat-field-grow { flex: 2; min-width: 140px; }
30
- .fd-chat-field > label { font-size: 0.75em; opacity: 0.7; letter-spacing: 0.05em; }
31
- .fd-chat-field > input { width: 100%; box-sizing: border-box; }
32
- .fd-chat-submit { display: flex; gap: var(--tool-gutter, 16px); align-items: flex-end; }
33
- .fd-chat-submit textarea { flex: 1; resize: none; min-height: 80px; }
34
- .fd-chat-submit > button { align-self: flex-end; }
35
-
36
- /* chatlog (legacy fd-chat-msgs container) */
37
- .fd-chatlog {
38
- max-height: 420px; overflow-y: auto;
39
- background: rgba(0,0,0,0.12);
40
- border-radius: 4px; padding: 4px; margin-top: 8px;
41
- }
42
- .fd-chatlog-msg { padding: 6px 10px; border-bottom: 1px solid rgba(128,128,128,0.15); white-space: pre-wrap; word-break: break-word; }
43
- .fd-chatlog-assistant { color: var(--color-accent, #7c9); }
44
- .fd-chatlog-tool { margin: 4px 0; padding: 4px 8px; background: rgba(0,0,0,0.18); border-radius: 4px; font-family: monospace; font-size: 0.85em; }
45
- .fd-chatlog-tool-sum { cursor: pointer; color: var(--color-warn, #fc9); padding: 2px 0; }
46
- .fd-chatlog-tool-body { margin: 4px 0 0; white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow-y: auto; }
47
-
48
- /* chip wraps (providers, env) */
49
- .fd-chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
50
- .fd-chip-wrap-padded { padding: 8px 4px; }
51
- .fd-env-chip { cursor: pointer; }
@@ -1,101 +0,0 @@
1
- import * as webjsx from '../../../vendor/webjsx/index.js';
2
- import * as components from '../../components.js';
3
- import { ROUTES, OS_ROUTE_DEFS } from './freddie/routes.js';
4
- import { makeCorePages } from './freddie/pages-core.js';
5
- import { makeChatPage } from './freddie/pages-chat.js';
6
- import { makeToolsPages } from './freddie/pages-tools.js';
7
- import { makeOsPages } from './freddie/pages-os.js';
8
-
9
- const { AppShell, Topbar, Side, Crumb, Status, Panel, Chip, EmptyState } = components;
10
-
11
- function pre(obj) {
12
- return webjsx.createElement('pre', { class: 'fd-pre' }, typeof obj === 'string' ? obj : JSON.stringify(obj, null, 2));
13
- }
14
-
15
- export function createFreddieDashboard({ instance, bootHost, osSurfaces }) {
16
- const root = document.createElement('div');
17
- root.className = 'app-fd ds-247420 fd-root';
18
-
19
- const state = { active: 'home', ts: new Date().toLocaleTimeString(), body: null, error: null };
20
- let host = instance.host || null;
21
- const allRoutes = osSurfaces ? [...ROUTES, ...OS_ROUTE_DEFS] : ROUTES;
22
-
23
- async function ensureHost() {
24
- if (host) return host;
25
- if (typeof bootHost !== 'function') throw new Error('createFreddieDashboard: instance.host or bootHost required');
26
- host = instance.host = await bootHost({ fs: instance.fs });
27
- return host;
28
- }
29
-
30
- function setActive(p) { state.active = p; rerender(); }
31
- if (typeof window !== 'undefined') window.__fd_nav = setActive;
32
-
33
- function rerender() { webjsx.applyDiff(root, view()); loadActive(); }
34
-
35
- const ctx = { instance, osSurfaces, root, state, rerender, get host() { return host; } };
36
- const PAGES = {
37
- ...makeCorePages(ctx),
38
- chat: makeChatPage(ctx),
39
- ...makeToolsPages(ctx),
40
- ...(osSurfaces ? makeOsPages(ctx) : {}),
41
- };
42
-
43
- function buildSide() {
44
- const sections = [{
45
- group: 'FREDDIE',
46
- items: ROUTES.map(r => ({
47
- glyph: r.glyph, label: r.label, href: '#fd-' + r.path,
48
- active: state.active === r.path,
49
- onClick: (ev) => { ev.preventDefault(); setActive(r.path); },
50
- })),
51
- }];
52
- if (osSurfaces) sections.push({
53
- group: 'OS',
54
- items: OS_ROUTE_DEFS.map(r => ({
55
- glyph: r.glyph, label: r.label, href: '#fd-' + r.path,
56
- active: state.active === r.path,
57
- onClick: (ev) => { ev.preventDefault(); setActive(r.path); },
58
- })),
59
- });
60
- return Side({ sections });
61
- }
62
-
63
- function view() {
64
- const route = allRoutes.find(r => r.path === state.active) || ROUTES[1];
65
- return AppShell({
66
- topbar: Topbar({ brand: 'freddie', leaf: 'dashboard', items: [], active: '' }),
67
- crumb: Crumb({ trail: ['freddie', instance.id], leaf: route.path, right: state.error ? Chip({ tone: 'miss', children: 'error' }) : Chip({ tone: 'ok', children: 'live' }) }),
68
- side: buildSide(),
69
- main: state.body || EmptyState({ text: 'loading…', glyph: '◌' }),
70
- status: Status({ left: ['ds-247420 · webjsx · ' + allRoutes.length + ' routes', 'instance=' + instance.id], right: [state.ts] }),
71
- });
72
- }
73
-
74
- async function loadActive() {
75
- try {
76
- const h0 = await ensureHost();
77
- const page = PAGES[state.active] || PAGES.home;
78
- state.body = await page(h0, instance);
79
- state.error = null;
80
- } catch (e) {
81
- state.error = String(e && e.stack || e);
82
- state.body = Panel({ title: 'error', children: pre(state.error) });
83
- }
84
- state.ts = new Date().toLocaleTimeString();
85
- webjsx.applyDiff(root, view());
86
- }
87
-
88
- rerender();
89
-
90
- if (typeof window !== 'undefined') {
91
- window.__debug = window.__debug || {};
92
- window.__debug.instances = window.__debug.instances || {};
93
- window.__debug.instances[instance.id] = window.__debug.instances[instance.id] || {};
94
- window.__debug.instances[instance.id].dashboard = {
95
- root, routes: allRoutes.map(r => r.path), setActive,
96
- get active() { return state.active; },
97
- };
98
- }
99
-
100
- return { node: root, dispose() {} };
101
- }
@@ -1,17 +0,0 @@
1
- export const icons = {
2
- terminal: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M7 9l3 3-3 3M13 15h4"/></svg>',
3
- browser: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 010 18M12 3a14 14 0 000 18"/></svg>',
4
- canvas: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="14" rx="2"/><path d="M3 17l6-5 4 3 5-4 3 2"/></svg>',
5
- files: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2z"/></svg>',
6
- monitor: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12l4-8 4 14 4-10 4 8 2-3"/></svg>',
7
- validator: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12l4 4L19 6"/></svg>',
8
- about: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 8v.01M11 12h1v5h1"/></svg>',
9
- apps: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/></svg>',
10
- plus: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5v14M5 12h14"/></svg>',
11
- home: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h16M4 12h16M4 18h16"/></svg>',
12
- xdisplay: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="13" rx="1.5"/><path d="M8 21h8M12 17v4M9 9l6 4M15 9l-6 4"/></svg>',
13
- close: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M6 6l12 12M18 6l-12 12"/></svg>',
14
- chat: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 5h16v11H8l-4 4z"/><path d="M8 9h8M8 12h6"/></svg>',
15
- tools: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M14 7l3-3 3 3-3 3-3-3zM7 14l3 3-7 7-3-3 7-7zM5 7l3-3M14 14l6 6"/></svg>',
16
- freddie: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2M8 12a4 4 0 008 0"/></svg>',
17
- };
@@ -1,5 +0,0 @@
1
- export { icons } from './icons.js';
2
- export { createDesktopShell } from './shell.js';
3
- export { renderWindow } from './wm.js';
4
- export { renderDock } from './launcher.js';
5
- export const themeUrl = new URL('./theme.css', import.meta.url).href;
@@ -1,61 +0,0 @@
1
- /* ============================================================
2
- Launcher dock — paired with createLauncher() (validation harness path)
3
- Bible: tonal step from canvas, no borders, pill controls, lowercase.
4
- ============================================================ */
5
-
6
- .launcher-dock {
7
- position: fixed;
8
- left: 0; top: 0; bottom: 0;
9
- width: 56px;
10
- background: var(--os-bg-2);
11
- border: none;
12
- display: flex;
13
- flex-direction: column;
14
- align-items: center;
15
- padding: 8px 0;
16
- gap: 8px;
17
- z-index: 10000;
18
- pointer-events: auto;
19
- font: 11px var(--os-mono);
20
- color: var(--os-fg);
21
- }
22
-
23
- .launcher-btn {
24
- width: 40px; height: 40px;
25
- background: transparent;
26
- color: inherit;
27
- cursor: pointer;
28
- border-radius: var(--os-radius-sm);
29
- display: flex;
30
- align-items: center;
31
- justify-content: center;
32
- padding: 0;
33
- font: inherit;
34
- transition: background 80ms ease, color 80ms ease, box-shadow 80ms ease;
35
- }
36
- .launcher-btn:hover { background: var(--panel-hover, var(--os-bg-1)); color: var(--os-fg); }
37
- .launcher-btn.active {
38
- background: var(--panel-select, var(--os-accent-soft));
39
- color: var(--os-fg);
40
- box-shadow: inset 4px 0 0 var(--os-accent);
41
- }
42
- .launcher-add { font-size: 20px; }
43
-
44
- .launcher-instances {
45
- display: flex;
46
- flex-direction: column;
47
- align-items: center;
48
- gap: 8px;
49
- }
50
-
51
- .launcher-row {
52
- display: flex;
53
- flex-direction: column;
54
- align-items: center;
55
- gap: 2px;
56
- }
57
-
58
- .launcher-close { font-size: 11px; opacity: 0.7; width: 20px; height: 20px; }
59
- .launcher-close:hover { opacity: 1; }
60
-
61
- .launcher-dock + .wm-root { left: 56px !important; }
@@ -1,79 +0,0 @@
1
- // Launcher dock paint surface — pure DOM rendering, no lifecycle.
2
- // Consumer (thebird) owns instance creation, fs/worker/shell wiring, teardown.
3
- // renderDock returns a handle whose setInstances/setActive are called from
4
- // lifecycle code. Visuals are bible-aligned: panel-select bg + accent inset
5
- // rail for active, tonal hover, lowercase mono labels.
6
-
7
- export function renderDock(opts = {}) {
8
- const { root = document.body, callbacks = {} } = opts;
9
-
10
- const el = document.createElement('div');
11
- el.className = 'launcher-dock';
12
-
13
- const addBtn = document.createElement('button');
14
- addBtn.className = 'launcher-btn launcher-add';
15
- addBtn.textContent = '+';
16
- addBtn.title = 'new instance';
17
- addBtn.addEventListener('click', () => callbacks.onNewInstance && callbacks.onNewInstance());
18
- el.appendChild(addBtn);
19
-
20
- const instancesHost = document.createElement('div');
21
- instancesHost.className = 'launcher-instances';
22
- el.appendChild(instancesHost);
23
-
24
- root.appendChild(el);
25
-
26
- let activeId = null;
27
- const buttons = new Map();
28
-
29
- function clear() {
30
- while (instancesHost.firstChild) instancesHost.removeChild(instancesHost.firstChild);
31
- buttons.clear();
32
- }
33
-
34
- function setInstances(list) {
35
- clear();
36
- for (const inst of list) {
37
- const row = document.createElement('div');
38
- row.className = 'launcher-row';
39
- row.dataset.instanceId = inst.id;
40
-
41
- const selBtn = document.createElement('button');
42
- selBtn.className = 'launcher-btn';
43
- selBtn.textContent = inst.label || inst.id;
44
- selBtn.title = 'instance ' + inst.id;
45
- selBtn.dataset.role = 'select';
46
- selBtn.dataset.instanceId = inst.id;
47
- if (inst.active || inst.id === activeId) selBtn.classList.add('active');
48
- selBtn.addEventListener('click', () => callbacks.onSelectInstance && callbacks.onSelectInstance(inst.id));
49
-
50
- const closeBtn = document.createElement('button');
51
- closeBtn.className = 'launcher-btn launcher-close';
52
- closeBtn.textContent = 'x';
53
- closeBtn.title = 'close ' + inst.id;
54
- closeBtn.dataset.role = 'close';
55
- closeBtn.dataset.instanceId = inst.id;
56
- closeBtn.addEventListener('click', e => {
57
- e.stopPropagation();
58
- callbacks.onCloseInstance && callbacks.onCloseInstance(inst.id);
59
- });
60
-
61
- row.append(selBtn, closeBtn);
62
- instancesHost.appendChild(row);
63
- buttons.set(inst.id, { selBtn, closeBtn, row });
64
- }
65
- if (activeId && !buttons.has(activeId)) activeId = null;
66
- }
67
-
68
- function setActive(id) {
69
- activeId = id;
70
- for (const [iid, b] of buttons) b.selBtn.classList.toggle('active', iid === id);
71
- }
72
-
73
- function dispose() {
74
- el.remove();
75
- buttons.clear();
76
- }
77
-
78
- return { el, setInstances, setActive, dispose };
79
- }
@@ -1,34 +0,0 @@
1
- // Monitor-app paint surface — bible classes, pure DOM. Consumer supplies getStats().
2
- // getStats() -> Promise<{instanceId, frames, shells, windows, appsRegistered, jsHeapMb, jsHeapLimitMb, time}>.
3
- // Field names map directly to displayed lines so consumer controls labels by value, not template.
4
-
5
- export function renderMonitorApp(opts = {}) {
6
- const { getStats, pollMs = 1000 } = opts;
7
- const node = document.createElement('div');
8
- node.className = 'app-pane mono';
9
- node.dataset.component = 'monitor-app';
10
-
11
- async function tick() {
12
- const s = (await Promise.resolve(getStats())) || {};
13
- const heap = (s.jsHeapMb != null && s.jsHeapLimitMb != null)
14
- ? `js heap: ${Number(s.jsHeapMb).toFixed(1)} MB / ${Number(s.jsHeapLimitMb).toFixed(0)} MB`
15
- : 'js heap: n/a';
16
- node.textContent = [
17
- `instance: ${s.instanceId ?? ''}`,
18
- `worker frames: ${s.frames ?? 0}`,
19
- `shells: ${s.shells ?? 0}`,
20
- `windows: ${s.windows ?? 0}`,
21
- `apps registered: ${s.appsRegistered ?? 0}`,
22
- heap,
23
- `now: ${s.time ?? new Date().toLocaleTimeString()}`,
24
- ].join('\n');
25
- }
26
-
27
- tick().catch(() => {});
28
- const timer = setInterval(() => tick().catch(() => {}), pollMs);
29
- return {
30
- node,
31
- tick,
32
- dispose() { clearInterval(timer); },
33
- };
34
- }
@@ -1,214 +0,0 @@
1
- import { icons } from './icons.js';
2
-
3
- const THEME_CSS_URL = new URL('./theme.css', import.meta.url).href;
4
-
5
- function ensureCss(href) {
6
- if (document.querySelector('link[data-os-theme]')) return;
7
- const l = document.createElement('link');
8
- l.rel = 'stylesheet';
9
- l.href = href || THEME_CSS_URL;
10
- l.dataset.osTheme = '1';
11
- document.head.appendChild(l);
12
- }
13
-
14
- function ic(svg) {
15
- const s = document.createElement('span');
16
- s.className = 'ic';
17
- s.innerHTML = svg;
18
- return s;
19
- }
20
-
21
- function makeBtn(svg, label, role) {
22
- const b = document.createElement('button');
23
- b.className = 'os-btn';
24
- b.type = 'button';
25
- if (role) b.dataset.role = role;
26
- if (svg) b.append(ic(svg));
27
- if (label) b.append(Object.assign(document.createElement('span'), { textContent: label }));
28
- return b;
29
- }
30
-
31
- export function createDesktopShell({ root = document.body, wm, registry, brand = 'desktop', themeUrl, onNewInstance, autoBoot = false } = {}) {
32
- if (!wm) throw new Error('createDesktopShell: wm is required');
33
- if (!registry) throw new Error('createDesktopShell: registry is required');
34
- ensureCss(themeUrl);
35
-
36
- const osRoot = document.createElement('div');
37
- osRoot.className = 'os-root';
38
- root.appendChild(osRoot);
39
-
40
- const menubar = document.createElement('div');
41
- menubar.className = 'os-menubar';
42
-
43
- const homeBtn = makeBtn(icons.home, '', 'home');
44
- homeBtn.title = 'apps';
45
-
46
- const brandEl = document.createElement('span');
47
- brandEl.className = 'os-brand';
48
- brandEl.textContent = brand;
49
-
50
- const appsBtn = makeBtn(icons.apps, 'apps', 'apps');
51
- const newInstBtn = onNewInstance ? makeBtn(icons.plus, 'instance', 'add') : null;
52
-
53
- const instSwitch = document.createElement('div');
54
- instSwitch.className = 'os-instances';
55
-
56
- const spacer = document.createElement('div');
57
- spacer.className = 'os-spacer';
58
-
59
- const tray = document.createElement('div');
60
- tray.className = 'os-tray';
61
- const clock = document.createElement('span');
62
- clock.className = 'os-clock';
63
- tray.appendChild(clock);
64
-
65
- menubar.append(homeBtn, brandEl, appsBtn);
66
- if (newInstBtn) menubar.append(newInstBtn);
67
- menubar.append(instSwitch, spacer, tray);
68
-
69
- const appsMenu = document.createElement('div');
70
- appsMenu.className = 'os-menu';
71
-
72
- const sideRail = document.createElement('div');
73
- sideRail.className = 'os-side-rail';
74
-
75
- const drawer = document.createElement('div');
76
- drawer.className = 'os-drawer';
77
- drawer.setAttribute('aria-hidden', 'true');
78
- const drawerHeader = document.createElement('div');
79
- drawerHeader.className = 'os-drawer-head';
80
- const drawerTitle = document.createElement('span');
81
- drawerTitle.className = 'os-drawer-title';
82
- drawerTitle.textContent = 'apps';
83
- const drawerClose = document.createElement('button');
84
- drawerClose.className = 'os-drawer-close';
85
- drawerClose.type = 'button';
86
- drawerClose.append(ic(icons.close));
87
- drawerHeader.append(drawerTitle, drawerClose);
88
- const drawerGrid = document.createElement('div');
89
- drawerGrid.className = 'os-drawer-grid';
90
- drawer.append(drawerHeader, drawerGrid);
91
-
92
- const apps = typeof registry.list === 'function' ? registry.list() : [...registry.values()];
93
-
94
- for (const app of apps) {
95
- const iconSvg = app.icon || icons[app.id] || '';
96
- const menuBtn = makeBtn(iconSvg, app.name);
97
- menuBtn.addEventListener('click', () => { closeMenu(); openApp(app.id); });
98
- appsMenu.appendChild(menuBtn);
99
-
100
- const railBtn = document.createElement('button');
101
- railBtn.className = 'os-rail-btn';
102
- railBtn.type = 'button';
103
- railBtn.title = app.name;
104
- railBtn.append(ic(iconSvg));
105
- railBtn.addEventListener('click', () => openApp(app.id));
106
- sideRail.appendChild(railBtn);
107
-
108
- const tile = document.createElement('button');
109
- tile.className = 'os-drawer-tile';
110
- tile.type = 'button';
111
- tile.append(ic(iconSvg), Object.assign(document.createElement('span'), { className: 'lbl', textContent: app.name }));
112
- tile.addEventListener('click', () => { closeDrawer(); openApp(app.id); });
113
- drawerGrid.appendChild(tile);
114
- }
115
-
116
- const taskbar = document.createElement('div');
117
- taskbar.className = 'os-taskbar';
118
-
119
- osRoot.append(menubar, appsMenu, taskbar);
120
- document.body.append(sideRail, drawer);
121
-
122
- function openMenu() { appsMenu.classList.add('open'); }
123
- function closeMenu() { appsMenu.classList.remove('open'); }
124
- function openDrawer() { drawer.classList.add('open'); drawer.setAttribute('aria-hidden', 'false'); }
125
- function closeDrawer() { drawer.classList.remove('open'); drawer.setAttribute('aria-hidden', 'true'); }
126
-
127
- appsBtn.addEventListener('click', e => { e.stopPropagation(); appsMenu.classList.toggle('open'); });
128
- homeBtn.addEventListener('click', e => { e.stopPropagation(); drawer.classList.contains('open') ? closeDrawer() : openDrawer(); });
129
- drawerClose.addEventListener('click', closeDrawer);
130
- drawer.addEventListener('click', e => { if (e.target === drawer) closeDrawer(); });
131
- document.addEventListener('click', e => {
132
- if (!appsMenu.contains(e.target) && !appsBtn.contains(e.target)) closeMenu();
133
- });
134
- document.addEventListener('keydown', e => {
135
- if (e.key === 'Escape') { closeMenu(); closeDrawer(); }
136
- });
137
-
138
- function tickClock() { clock.textContent = new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); }
139
- tickClock();
140
- const clockTimer = setInterval(tickClock, 30000);
141
-
142
- let activeContext = null;
143
- let activeInstanceId = null;
144
- function setContext(ctx) { activeContext = ctx; }
145
-
146
- function applyInstanceFilter() {
147
- if (!activeInstanceId) return;
148
- for (const wEl of document.querySelectorAll('.wm-win[data-instance-id]')) {
149
- const wInst = wEl.dataset.instanceId;
150
- wEl.style.display = (wInst === activeInstanceId) ? '' : 'none';
151
- }
152
- }
153
-
154
- function refreshTaskbar() {
155
- taskbar.innerHTML = '';
156
- for (const w of wm.list()) {
157
- const wEl = document.querySelector('.wm-win[data-id="' + w.id + '"]');
158
- const wInst = wEl && wEl.dataset.instanceId;
159
- if (activeInstanceId && wInst && wInst !== activeInstanceId) continue;
160
- const t = document.createElement('button');
161
- t.className = 'os-task' + (w.focused ? ' focused' : '');
162
- t.type = 'button';
163
- t.textContent = w.title;
164
- t.dataset.winId = w.id;
165
- t.addEventListener('click', () => wm.focus(w.id));
166
- taskbar.appendChild(t);
167
- }
168
- }
169
-
170
- function setActiveInstance(id) {
171
- activeInstanceId = id;
172
- for (const btn of instSwitch.querySelectorAll('.os-btn')) {
173
- btn.classList.toggle('active', btn.dataset.instanceId === id);
174
- }
175
- applyInstanceFilter();
176
- refreshTaskbar();
177
- }
178
-
179
- function openApp(appId) {
180
- const app = (typeof registry.get === 'function') ? registry.get(appId) : registry[appId];
181
- if (!app) throw new Error('unknown app: ' + appId);
182
- const ctx = { ...(activeContext || {}), registry, openApp, wm };
183
- const result = app.factory(ctx);
184
- const finish = (r) => {
185
- const sz = app.defaultSize || { w: 520, h: 360 };
186
- const titlePrefix = (activeContext && activeContext.titlePrefix) ? activeContext.titlePrefix + ' · ' : '';
187
- const win = wm.open({ title: titlePrefix + app.name, body: r.node, kind: appId, width: sz.w, height: sz.h, x: 100 + (wm.count * 28) % 240, y: 80 + (wm.count * 22) % 180 });
188
- win._app = { id: appId, dispose: r.dispose };
189
- if (activeInstanceId && win.el) {
190
- win.el.dataset.instanceId = activeInstanceId;
191
- win.instanceId = activeInstanceId;
192
- }
193
- win.appId = appId;
194
- refreshTaskbar();
195
- return win;
196
- };
197
- return (result && typeof result.then === 'function') ? result.then(finish) : finish(result);
198
- }
199
-
200
- if (newInstBtn) newInstBtn.addEventListener('click', () => onNewInstance && onNewInstance({ instSwitch, setContext, openApp }));
201
-
202
- const taskTimer = setInterval(refreshTaskbar, 500);
203
-
204
- const api = {
205
- wm, registry, openApp, setContext, refreshTaskbar, setActiveInstance,
206
- openDrawer, closeDrawer, openMenu, closeMenu,
207
- get activeInstanceId() { return activeInstanceId; },
208
- elements: { osRoot, menubar, taskbar, appsMenu, sideRail, drawer, instSwitch, homeBtn, appsBtn },
209
- dispose() { clearInterval(clockTimer); clearInterval(taskTimer); osRoot.remove(); sideRail.remove(); drawer.remove(); },
210
- };
211
-
212
- if (autoBoot && typeof autoBoot === 'string') openApp(autoBoot);
213
- return api;
214
- }
@@ -1,45 +0,0 @@
1
- // Terminal-app paint surface — bible classes, pure DOM. Consumer attaches xterm to mount slot.
2
- // renderTerminal({title, statusText, theme}) -> {node, mount, setTitle, setStatus, dispose}.
3
- // mount(termInstance) calls termInstance.open(slot) and fit when available; consumer owns xterm lifecycle.
4
-
5
- export function renderTerminal(opts = {}) {
6
- const { title = 'terminal', statusText = '', theme = 'dark' } = opts;
7
- const node = document.createElement('div');
8
- node.className = 'app-pane terminal-app';
9
- node.dataset.component = 'terminal-app';
10
- node.dataset.theme = theme;
11
-
12
- const head = document.createElement('div');
13
- head.className = 'terminal-app-head';
14
- const titleEl = document.createElement('span');
15
- titleEl.className = 'terminal-app-title';
16
- titleEl.textContent = title;
17
- const statusEl = document.createElement('span');
18
- statusEl.className = 'terminal-app-status';
19
- statusEl.textContent = statusText;
20
- head.append(titleEl, statusEl);
21
-
22
- const slot = document.createElement('div');
23
- slot.className = 'terminal-app-slot';
24
- slot.dataset.role = 'xterm-mount';
25
-
26
- node.append(head, slot);
27
-
28
- function mount(term) {
29
- if (!term || typeof term.open !== 'function') return;
30
- term.open(slot);
31
- if (term._addonManager) {
32
- const addons = term._addonManager._addons || [];
33
- for (const a of addons) { try { a.instance && a.instance.fit && a.instance.fit(); } catch (_) {} }
34
- }
35
- }
36
-
37
- return {
38
- node,
39
- mount,
40
- setTitle(t) { titleEl.textContent = t; },
41
- setStatus(s) { statusEl.textContent = s; },
42
- get slot() { return slot; },
43
- dispose() {},
44
- };
45
- }