agentgui 1.0.970 → 1.0.972

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/site/theme.mjs CHANGED
@@ -15,6 +15,10 @@ const escapeJson = (obj) => JSON.stringify(obj)
15
15
  .replace(new RegExp('\\u2028', 'g'), '\\u2028').replace(new RegExp('\\u2029', 'g'), '\\u2029');
16
16
 
17
17
  const SDK_URL = 'https://unpkg.com/anentrypoint-design@latest/dist/247420.js';
18
+ // Render-blocking CSS counterpart of SDK_URL so the kit base surface + .site-*
19
+ // classes paint BEFORE the module's installStyles() runs (no FOUC). All design
20
+ // content lives in the kit; this template carries no inline <style>.
21
+ const CSS_URL = 'https://unpkg.com/anentrypoint-design@latest/dist/247420.css';
18
22
  const THIS_DIR = dirname(fileURLToPath(import.meta.url));
19
23
 
20
24
  const landingClient = `
@@ -27,16 +31,16 @@ const { site, nav, page } = data;
27
31
  function Hero() {
28
32
  if (!page || !page.hero) return null;
29
33
  return C.Panel({
30
- style: 'margin:8px',
31
- children: h('div', { style: 'padding:24px 22px' },
32
- C.Heading({ level: 1, style: 'margin:0 0 8px 0', children: page.hero.heading || site.title }),
34
+ class: 'site-panel',
35
+ children: h('div', { class: 'site-hero' },
36
+ C.Heading({ level: 1, class: 'site-hero-h', children: page.hero.heading || site.title }),
33
37
  page.hero.subheading ? C.Lede({ children: page.hero.subheading }) : null,
34
- page.hero.body ? h('p', { style: 'margin:8px 0 16px 0;color:var(--panel-text-2);max-width:64ch' }, page.hero.body) : null,
35
- (page.hero.badges && page.hero.badges.length) ? h('div', { style: 'display:flex;gap:6px;flex-wrap:wrap;margin:0 0 12px 0' },
38
+ page.hero.body ? h('p', { class: 'site-hero-body' }, page.hero.body) : null,
39
+ (page.hero.badges && page.hero.badges.length) ? h('div', { class: 'site-chip-row' },
36
40
  ...page.hero.badges.map((b, i) => C.Chip({ key: 'b' + i, children: b.label }))
37
41
  ) : null,
38
- (page.hero.ctas && page.hero.ctas.length) ? h('div', { style: 'display:flex;gap:8px;flex-wrap:wrap' },
39
- ...page.hero.ctas.map((c, i) => C.Btn({ key: 'c' + i, href: c.href, primary: c.primary, children: c.label }))
42
+ (page.hero.ctas && page.hero.ctas.length) ? h('div', { class: 'site-cta-row' },
43
+ ...page.hero.ctas.map((c, i) => C.Btn({ key: 'c' + i, href: c.href, variant: c.primary ? 'primary' : 'default', children: c.label }))
40
44
  ) : null
41
45
  )
42
46
  });
@@ -54,7 +58,7 @@ function Features() {
54
58
  }));
55
59
  return C.Panel({
56
60
  title: page.features.heading || 'features',
57
- style: 'margin:8px',
61
+ class: 'site-panel',
58
62
  children: rows
59
63
  });
60
64
  }
@@ -70,8 +74,8 @@ function Quickstart() {
70
74
  });
71
75
  return C.Panel({
72
76
  title: page.quickstart.heading || 'quick start',
73
- style: 'margin:8px',
74
- children: h('div', { style: 'padding:16px 22px' }, ...lineNodes)
77
+ class: 'site-panel',
78
+ children: h('div', { class: 'site-cli' }, ...lineNodes)
75
79
  });
76
80
  }
77
81
 
@@ -82,7 +86,7 @@ function Footer() {
82
86
  h('span', { class: 'item' }, '·'),
83
87
  h('a', { class: 'item', href: 'https://247420.xyz' }, '247420.xyz'),
84
88
  h('span', { class: 'spread' }),
85
- site.repo ? h('a', { class: 'item', href: site.repo }, 'source ') : null
89
+ site.repo ? h('a', { class: 'item', href: site.repo }, 'source ->') : null
86
90
  );
87
91
  }
88
92
 
@@ -112,7 +116,7 @@ function Footer() {
112
116
  h('span', { class: 'item' }, '·'),
113
117
  h('a', { class: 'item', href: 'https://247420.xyz' }, '247420.xyz'),
114
118
  h('span', { class: 'spread' }),
115
- site.repo ? h('a', { class: 'item', href: site.repo }, 'source ') : null
119
+ site.repo ? h('a', { class: 'item', href: site.repo }, 'source ->') : null
116
120
  );
117
121
  }
118
122
 
@@ -120,10 +124,10 @@ const App = C.AppShell({
120
124
  topbar: C.Topbar({ brand: '247420', leaf: site.title || '', items: navItems }),
121
125
  crumb: C.Crumb({ trail: ['247420', site.title || ''], leaf: page.title || '' }),
122
126
  main: C.Panel({
123
- style: 'margin:8px',
127
+ class: 'site-panel',
124
128
  children: h('iframe', {
125
129
  src: page.embedSrc,
126
- style: 'width:100%;height:calc(100vh - 180px);min-height:520px;border:0;border-radius:6px;background:var(--panel-1);display:block',
130
+ class: 'site-embed',
127
131
  title: page.title || ''
128
132
  })
129
133
  }),
@@ -140,7 +144,7 @@ const renderHtml = ({ site, nav, page, clientScript }) => `<!DOCTYPE html>
140
144
  <title>${escapeHtml(page.title || site.title)}${site.tagline ? ' - ' + escapeHtml(site.tagline) : ''}</title>
141
145
  <meta name="description" content="${escapeHtml(page.description || site.description || site.tagline || site.title)}" />
142
146
  <script type="importmap">{"imports":{"anentrypoint-design":"${SDK_URL}"}}</script>
143
- <style>html,body{margin:0;padding:0}body{background:var(--app-bg,#FBF6EB);color:var(--ink,#1F1B16);font-family:var(--ff-ui,'Nunito',system-ui,sans-serif)}</style>
147
+ <link rel="stylesheet" href="${CSS_URL}" />
144
148
  </head>
145
149
  <body>
146
150
  <div id="app"></div>
@@ -1,84 +0,0 @@
1
- #!/usr/bin/env node
2
- // One-time build: produces static/vendor/rippleui.css from the rippleui npm package.
3
- // Buildless at runtime - commit the output so `npm install` is enough to serve.
4
- //
5
- // Source files (from node_modules/rippleui/dist/css/):
6
- // base.css - Tailwind preflight/reset (~2KB)
7
- // components.css - RippleUI components (.btn etc.) (~143KB)
8
- // utilities.css - RippleUI extra utilities (~0.05KB)
9
- // styles.css - full TW + RippleUI monolith (~4.7MB) - we only mine token defs
10
- //
11
- // Output: static/vendor/rippleui.css containing
12
- // 1. :root / html.dark token blocks extracted from styles.css (so components.css works)
13
- // 2. base.css
14
- // 3. components.css
15
- // 4. utilities.css
16
-
17
- import fs from 'fs';
18
- import path from 'path';
19
- import { fileURLToPath } from 'url';
20
-
21
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
22
- const ROOT = path.resolve(__dirname, '..');
23
- const RUI = path.join(ROOT, 'node_modules/rippleui/dist/css');
24
- const OUT = path.join(ROOT, 'static/vendor/rippleui.css');
25
-
26
- if (!fs.existsSync(RUI)) {
27
- console.error('rippleui not installed. Run: bun add --dev rippleui');
28
- process.exit(1);
29
- }
30
-
31
- const base = fs.readFileSync(path.join(RUI, 'base.css'), 'utf8');
32
- const components = fs.readFileSync(path.join(RUI, 'components.css'), 'utf8');
33
- const utilities = fs.readFileSync(path.join(RUI, 'utilities.css'), 'utf8');
34
- const styles = fs.readFileSync(path.join(RUI, 'styles.css'), 'utf8');
35
-
36
- // Extract token blocks. RippleUI defines its design tokens in :root { ... } and html.dark { ... }
37
- // Find every block that contains a RippleUI-signature token like --backgroundPrimary or --gray-3.
38
- const tokenBlocks = [];
39
- const blockRe = /([:a-z.][^{}]*\{[^{}]*\})/gi;
40
- let m;
41
- while ((m = blockRe.exec(styles))) {
42
- const block = m[1];
43
- if (/--backgroundPrimary|--gray-\d|--content1|--primary:\s*\d/.test(block)) {
44
- tokenBlocks.push(block);
45
- if (tokenBlocks.length > 20) break;
46
- }
47
- }
48
-
49
- if (tokenBlocks.length === 0) {
50
- console.error('Could not find token blocks in styles.css - rippleui shape changed?');
51
- process.exit(1);
52
- }
53
-
54
- const header = `/* RippleUI v${readPkgVersion()} - localized for AgentGUI.\n` +
55
- ` * Generated by scripts/build-rippleui.mjs - do not edit by hand.\n` +
56
- ` * Regenerate: bun run scripts/build-rippleui.mjs\n` +
57
- ` */\n`;
58
-
59
- // RippleUI targets [data-theme=dark] for dark mode; AgentGUI uses `html.dark`.
60
- // Duplicate every `[data-theme=dark]` selector with `html.dark` so both work.
61
- function mirrorDarkSelector(css) {
62
- return css.replace(/\[data-theme=dark\]/g, 'html.dark, [data-theme=dark]');
63
- }
64
-
65
- const bundled = header +
66
- '/* --- rippleui design tokens (extracted from styles.css) --- */\n' +
67
- mirrorDarkSelector(tokenBlocks.join('\n')) + '\n\n' +
68
- '/* --- base.css (tailwind preflight) --- */\n' +
69
- base + '\n\n' +
70
- '/* --- components.css --- */\n' +
71
- mirrorDarkSelector(components) + '\n\n' +
72
- '/* --- utilities.css --- */\n' +
73
- mirrorDarkSelector(utilities) + '\n';
74
-
75
- fs.mkdirSync(path.dirname(OUT), { recursive: true });
76
- fs.writeFileSync(OUT, bundled);
77
- const kb = (bundled.length / 1024).toFixed(1);
78
- console.log(`wrote ${OUT} (${kb}KB, ${tokenBlocks.length} token blocks)`);
79
-
80
- function readPkgVersion() {
81
- try {
82
- return JSON.parse(fs.readFileSync(path.join(ROOT, 'node_modules/rippleui/package.json'), 'utf8')).version;
83
- } catch { return 'unknown'; }
84
- }
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env node
2
- import fs from 'fs';
3
- import path from 'path';
4
- import { fileURLToPath } from 'url';
5
-
6
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
- const root = path.join(__dirname, '..');
8
-
9
- const copies = [
10
- ['node_modules/xstate/dist/xstate.umd.min.js', 'static/lib/xstate.umd.min.js'],
11
- ];
12
-
13
- for (const [src, dest] of copies) {
14
- const srcPath = path.join(root, src);
15
- const destPath = path.join(root, dest);
16
- if (!fs.existsSync(srcPath)) { console.warn('[copy-vendor] not found:', src); continue; }
17
- fs.mkdirSync(path.dirname(destPath), { recursive: true });
18
- fs.copyFileSync(srcPath, destPath);
19
- console.log('[copy-vendor] copied', src, '->', dest);
20
- }
21
-
22
- // Build webjsx IIFE bundle from ESM dist files
23
- const webjsxDist = path.join(root, 'node_modules/webjsx/dist');
24
- if (fs.existsSync(webjsxDist)) {
25
- const ORDER = ['constants', 'elementTags', 'utils', 'renderSuspension', 'attributes', 'createDOMElement', 'createElement', 'applyDiff', 'types'];
26
-
27
- function stripModule(src) {
28
- return src
29
- .replace(/^import\s+.*?from\s+['"][^'"]+['"];?\s*$/gm, '')
30
- .replace(/^export\s+(const|function|class|async\s+function)\s+/gm, '$1 ')
31
- .replace(/^export\s+\{[^}]*\}(\s+from\s+['"][^'"]+['"])?\s*;?\s*$/gm, '')
32
- .replace(/^export\s+\*\s+from\s+['"][^'"]+['"];?\s*$/gm, '')
33
- .replace(/^\/\/#\s+sourceMappingURL=.*$/gm, '')
34
- .trim();
35
- }
36
-
37
- const stripped = ORDER.map(name => {
38
- const src = fs.readFileSync(path.join(webjsxDist, `${name}.js`), 'utf8');
39
- return `// === ${name}.js ===\n${stripModule(src)}`;
40
- });
41
-
42
- const iife = `(function(window) {\n"use strict";\n\n${stripped.join('\n\n')}\n\nwindow.webjsx = { createElement, applyDiff, createDOMElement, Fragment };\n})(typeof window !== 'undefined' ? window : globalThis);\n`;
43
-
44
- const dest = path.join(root, 'static/lib/webjsx.js');
45
- fs.mkdirSync(path.dirname(dest), { recursive: true });
46
- fs.writeFileSync(dest, iife);
47
- console.log('[copy-vendor] built webjsx IIFE ->', 'static/lib/webjsx.js', `(${iife.split('\n').length} lines)`);
48
- } else {
49
- console.warn('[copy-vendor] webjsx not found in node_modules - run npm install');
50
- }