minecodex 2.0.4 → 2.0.6

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 (100) hide show
  1. package/DESIGN.md +40 -1
  2. package/README.md +9 -3
  3. package/apps/dashboard/DESIGN.md +53 -31
  4. package/apps/dashboard/app.js +55 -39
  5. package/apps/dashboard/assets/OFL.txt +93 -0
  6. package/apps/dashboard/assets/info.svg +15 -0
  7. package/apps/dashboard/assets/moon.svg +13 -0
  8. package/apps/dashboard/assets/refresh-cw.svg +16 -0
  9. package/apps/dashboard/assets/silkscreen.ttf +0 -0
  10. package/apps/dashboard/assets/sun.svg +21 -0
  11. package/apps/dashboard/assets/terrain.js +89 -0
  12. package/apps/dashboard/assets/triangle-alert.svg +15 -0
  13. package/apps/dashboard/favicon.svg +12 -17
  14. package/apps/dashboard/index.html +24 -18
  15. package/apps/dashboard/styles.css +147 -181
  16. package/assets/brand/README.md +19 -0
  17. package/assets/brand/minecodex-icon-dark.svg +9 -0
  18. package/assets/brand/minecodex-icon-light.svg +9 -0
  19. package/assets/brand/minecodex-icon.svg +8 -0
  20. package/assets/brand/references/lucide-LICENSE.txt +43 -0
  21. package/assets/readme/hero.svg +93 -0
  22. package/features/hide-upsell-banner/README.md +7 -5
  23. package/features/hide-upsell-banner/codex-feature.json +2 -2
  24. package/features/hide-upsell-banner/src/hide-upsell-banner.mjs +30 -12
  25. package/features/images/DESIGN.md +117 -41
  26. package/features/images/README.md +26 -16
  27. package/features/images/codex-feature.json +6 -3
  28. package/features/images/src/adapters/codex/image-prompt.mjs +24 -2
  29. package/features/images/src/adapters/codex/image-sources.mjs +19 -0
  30. package/features/images/src/adapters/codex/library-api.mjs +2 -0
  31. package/features/images/src/adapters/codex/library-viewer.mjs +26 -2
  32. package/features/images/src/adapters/codex/native-image-modules.mjs +211 -0
  33. package/features/images/src/adapters/codex/native-image-source.mjs +449 -0
  34. package/features/images/src/backend/local-image-source.mjs +138 -0
  35. package/features/images/src/frontend/cloud-image-actions.mjs +41 -0
  36. package/features/images/src/frontend/local-image-source.mjs +195 -0
  37. package/features/images/src/library-prompt-page.mjs +163 -53
  38. package/features/images/src/library-prompt-source.mjs +9 -3
  39. package/features/images/src/prompt-index.mjs +14 -2
  40. package/features/model-slider/DESIGN.md +2 -0
  41. package/features/model-slider/codex-feature.json +2 -2
  42. package/features/model-slider/src/frontend/install.mjs +78 -11
  43. package/features/notes/DESIGN.md +7 -3
  44. package/features/notes/codex-feature.json +2 -2
  45. package/features/notes/src/frontend/entry.mjs +26 -9
  46. package/features/session-status/DESIGN.md +4 -2
  47. package/features/session-status/codex-feature.json +2 -2
  48. package/features/session-status/src/adapters/codex/session-log.mjs +2 -1
  49. package/features/session-status/src/domain/session-stats.mjs +17 -9
  50. package/features/session-status/src/session-status.mjs +47 -11
  51. package/features/sidebar-focus/DESIGN.md +4 -4
  52. package/features/sidebar-focus/codex-feature.json +3 -2
  53. package/features/sidebar-focus/src/adapters/codex/renderer.mjs +1 -1
  54. package/features/sidebar-focus/src/sidebar-focus.mjs +9 -7
  55. package/features/sites/DESIGN.md +25 -3
  56. package/features/sites/README.md +6 -2
  57. package/features/sites/codex-feature.json +3 -2
  58. package/features/sites/src/adapters/codex/renderer.mjs +25 -4
  59. package/features/sites/src/backend/project-sites.mjs +18 -6
  60. package/features/sites/src/backend/sites-service.mjs +22 -10
  61. package/features/sites/src/domain/discovery-candidates.mjs +53 -0
  62. package/features/sites/src/frontend/entry.mjs +76 -38
  63. package/features/sites/src/frontend/styles.css +3 -3
  64. package/features/unread-inbox/DESIGN.md +24 -25
  65. package/features/unread-inbox/codex-feature.json +3 -2
  66. package/features/unread-inbox/src/adapters/codex/modules.mjs +52 -0
  67. package/features/unread-inbox/src/adapters/codex/renderer.mjs +90 -0
  68. package/features/unread-inbox/src/domain/notifications.mjs +21 -0
  69. package/features/unread-inbox/src/injection-source.mjs +5 -2
  70. package/features/unread-inbox/src/unread-inbox.mjs +212 -297
  71. package/features/usage-meter/codex-feature.json +2 -2
  72. package/package.json +11 -3
  73. package/packages/cli/native/MineCodex.app/Contents/Info.plist +4 -2
  74. package/packages/cli/native/MineCodex.app/Contents/MacOS/MineCodexServiceManager +0 -0
  75. package/packages/cli/native/MineCodex.app/Contents/Resources/MineCodex.icns +0 -0
  76. package/packages/cli/native/MineCodex.app/Contents/_CodeSignature/CodeResources +11 -0
  77. package/packages/cli/native/README.md +31 -0
  78. package/packages/cli/src/browser-control-panel.mjs +48 -0
  79. package/packages/cli/src/commands.mjs +3 -1
  80. package/packages/cli/src/control-server.mjs +6 -3
  81. package/packages/cli/src/platform.mjs +5 -0
  82. package/packages/codex-adapter/README.md +2 -1
  83. package/packages/codex-adapter/src/renderer/environment.mjs +24 -6
  84. package/packages/runtime-host/README.md +10 -5
  85. package/packages/runtime-host/src/codex-injection.mjs +13 -9
  86. package/packages/runtime-host/src/codex-runtime.mjs +26 -5
  87. package/packages/runtime-host/src/feature-registry.mjs +1 -0
  88. package/packages/ui/DESIGN.md +9 -2
  89. package/packages/ui/assets/arrow-up-right.svg +14 -0
  90. package/packages/ui/assets/lucide-LICENSE.txt +43 -0
  91. package/packages/ui/src/components/account-menu.mjs +74 -0
  92. package/packages/ui/src/components/button.mjs +2 -0
  93. package/packages/ui/src/components/navigation-rail.mjs +18 -10
  94. package/packages/ui/src/components/page.mjs +9 -2
  95. package/packages/ui/src/foundation/layers.mjs +1 -0
  96. package/packages/ui/src/install.mjs +6 -1
  97. package/packages/ui/src/native/account-menu.mjs +21 -0
  98. package/packages/ui/src/native/navigation-rail.mjs +6 -1
  99. package/packages/ui/src/native/page.mjs +38 -0
  100. package/packages/ui/src/native/tokens.mjs +4 -0
@@ -0,0 +1,89 @@
1
+ // 纯装饰字符地形;不读取会话数据,也不参与界面交互。
2
+ const canvas = document.querySelector('#agent-world');
3
+ const context = canvas.getContext('2d');
4
+ const reduced = matchMedia('(prefers-reduced-motion: reduce)');
5
+ const points = [];
6
+ const agents = [];
7
+ const heightAt = (x, z) => {
8
+ const ridge = Math.sin(x * .16 + Math.cos(z * .13)) * 2.4 + Math.cos(z * .21) * 1.8;
9
+ const island = Math.max(0, 1 - Math.hypot(x / 31, z / 26));
10
+ return Math.max(-1, Math.floor(island * 9 + ridge - 2));
11
+ };
12
+ for (let z = -28; z <= 28; z++) {
13
+ for (let x = -32; x <= 32; x++) {
14
+ const y = heightAt(x, z);
15
+ if (x * x / 1100 + z * z / 850 > 1.15) continue;
16
+ const path = Math.abs(z - Math.round(Math.sin(x * .12) * 9)) < 1;
17
+ points.push({ x, y, z, glyph: y < 0 ? '~' : path ? ':' : y > 5 ? '#' : '+', kind: path ? 'path' : 'land' });
18
+ // 用垂直字符层显示台阶断面,保留体素地形的厚度。
19
+ const bottom = Math.min(heightAt(x + 1, z), heightAt(x, z + 1));
20
+ for (let h = bottom + 1; h < y; h++) points.push({ x, y: h, z, glyph: '|', kind: 'side' });
21
+ }
22
+ }
23
+ for (const [x, z, label] of [[-20, -9, '>_'], [20, 9, '{ }'], [-8, 20, 'git'], [10, -20, '</>'], [-23, 15, '[AI]'], [24, -12, '$']]) {
24
+ const base = heightAt(x, z);
25
+ for (let y = base + 1; y <= base + 5; y++) points.push({ x, y, z, glyph: y === base + 5 ? '[]' : '|', kind: 'node' });
26
+ agents.push({ x, y: base + 7, z, glyph: label, kind: 'node' });
27
+ }
28
+ let width = 0, height = 0, frame = 0, angle = .65, last = 0;
29
+ let dark = false;
30
+ function resize() {
31
+ width = innerWidth;
32
+ height = innerHeight;
33
+ const ratio = Math.min(devicePixelRatio || 1, 2);
34
+ canvas.width = Math.round(width * ratio);
35
+ canvas.height = Math.round(height * ratio);
36
+ context.setTransform(ratio, 0, 0, ratio, 0, 0);
37
+ draw();
38
+ }
39
+ function draw() {
40
+ if (!context || !width) return;
41
+ context.clearRect(0, 0, width, height);
42
+ const scale = Math.max(width / 62, height / 42);
43
+ const sin = Math.sin(angle), cos = Math.cos(angle);
44
+ const project = (point) => {
45
+ const x = point.x * cos - point.z * sin;
46
+ const depth = point.x * sin + point.z * cos;
47
+ return { ...point, sx: width / 2 + x * scale, sy: height * .58 + (depth * .48 - point.y * .95) * scale, depth };
48
+ };
49
+ const visible = [...points, ...agents].map(project).sort((a, b) => a.depth - b.depth);
50
+ const fontSize = Math.max(10, Math.min(14, scale * .52));
51
+ context.font = `${fontSize}px ui-monospace, SFMono-Regular, Consolas, monospace`;
52
+ context.textAlign = 'center';
53
+ // 同一字符格只保留前景点,避免山体投影堆叠成杂乱笔画。
54
+ const cells = new Map();
55
+ for (const point of visible) cells.set(`${Math.round(point.sx / (fontSize * .7))}:${Math.round(point.sy / fontSize)}`, point);
56
+ for (const p of cells.values()) {
57
+ if (p.sx < -30 || p.sx > width + 30 || p.sy < -20 || p.sy > height + 20) continue;
58
+ const alpha = p.kind === 'node' ? .48 : p.kind === 'path' ? .34 : p.kind === 'side' ? .14 : .22;
59
+ context.fillStyle = dark ? `rgba(112,166,245,${alpha})` : `rgba(52,101,174,${alpha})`;
60
+ context.fillText(p.glyph, p.sx, p.sy);
61
+ }
62
+ }
63
+ function tick(time) {
64
+ if (time - last >= 50) {
65
+ if (last) angle = (angle + Math.min(time - last, 100) * Math.PI * 2 / 240000) % (Math.PI * 2);
66
+ last = time;
67
+ draw();
68
+ }
69
+ frame = requestAnimationFrame(tick);
70
+ }
71
+ function syncMotion() {
72
+ cancelAnimationFrame(frame);
73
+ last = 0;
74
+ if (!document.hidden && !reduced.matches) frame = requestAnimationFrame(tick);
75
+ else draw();
76
+ }
77
+ function syncTheme() {
78
+ dark = document.documentElement.dataset.theme === 'dark';
79
+ draw();
80
+ }
81
+ new MutationObserver(syncTheme).observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] });
82
+ addEventListener('resize', resize);
83
+ document.addEventListener('visibilitychange', syncMotion);
84
+ reduced.addEventListener('change', syncMotion);
85
+ addEventListener('pagehide', () => cancelAnimationFrame(frame));
86
+ addEventListener('pageshow', syncMotion);
87
+ syncTheme();
88
+ resize();
89
+ syncMotion();
@@ -0,0 +1,15 @@
1
+ <svg
2
+ xmlns="http://www.w3.org/2000/svg"
3
+ width="24"
4
+ height="24"
5
+ viewBox="0 0 24 24"
6
+ fill="none"
7
+ stroke="currentColor"
8
+ stroke-width="2"
9
+ stroke-linecap="round"
10
+ stroke-linejoin="round"
11
+ >
12
+ <path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" />
13
+ <path d="M12 9v4" />
14
+ <path d="M12 17h.01" />
15
+ </svg>
@@ -1,18 +1,13 @@
1
- <!-- @license lucide-static v1.30.0 - ISC -->
2
- <svg
3
- class="lucide lucide-sparkles"
4
- xmlns="http://www.w3.org/2000/svg"
5
- width="24"
6
- height="24"
7
- viewBox="0 0 24 24"
8
- fill="none"
9
- stroke="currentColor"
10
- stroke-width="2"
11
- stroke-linecap="round"
12
- stroke-linejoin="round"
13
- >
14
- <path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" />
15
- <path d="M20 2v4" />
16
- <path d="M22 4h-4" />
17
- <circle cx="4" cy="20" r="2" />
1
+ <!-- Generated by scripts/build-brand-icons.mjs from assets/brand/minecodex-icon.svg. -->
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" role="img" aria-labelledby="minecodex-title">
3
+ <style>
4
+ :root { color: #0d0d0d; }
5
+ @media (prefers-color-scheme: dark) { :root { color: #fafafa; } }
6
+ </style>
7
+ <title id="minecodex-title">MineCodex</title>
8
+ <desc>Codex 原生六瓣外圈与实心镐子,象征受 Minecraft 启发的 Codex 工具项目。</desc>
9
+ <path id="codex-outline" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M9.3316 2.03768C11.1644 1.54688 13.0268 2.04668 14.356 3.20174C16.0859 2.86512 17.9511 3.36418 19.2935 4.70663C20.6356 6.04882 21.1326 7.91288 20.7964 9.64217C21.9527 10.9716 22.4534 12.8349 21.9625 14.6685C21.4711 16.5025 20.1051 17.8657 18.439 18.439C17.8658 20.1047 16.503 21.47 14.6695 21.9615C12.8356 22.4528 10.9727 21.9519 9.64312 20.7955C7.91371 21.1319 6.04993 20.635 4.70757 19.2926C3.36558 17.9505 2.86659 16.0866 3.20269 14.357C2.04693 13.0273 1.54757 11.1638 2.03863 9.33065C2.52997 7.49759 3.89436 6.13282 5.56011 5.55917C6.13382 3.8935 7.49837 2.52891 9.3316 2.03768ZM13.2623 4.63534C12.3606 3.80149 11.067 3.4361 9.79742 3.77596C8.52745 4.11626 7.58924 5.0796 7.22515 6.25253C7.08145 6.71575 6.71753 7.07928 6.25445 7.22323C5.08133 7.58702 4.11844 8.52622 3.77789 9.79647C3.43759 11.0667 3.80148 12.3606 4.63531 13.2623C4.96467 13.6184 5.09776 14.1154 4.99078 14.5885C4.71939 15.7864 5.05109 17.0891 5.98101 18.0191C6.91085 18.949 8.21345 19.2801 9.41168 19.0084L9.58941 18.9791C9.94695 18.9432 10.3065 19.0397 10.5982 19.2496L10.7378 19.3639L10.9117 19.5142C11.8015 20.2407 13.0127 20.5413 14.2037 20.2223C15.4733 19.8818 16.4111 18.9191 16.775 17.7457C16.9189 17.2824 17.2832 16.9186 17.7466 16.775L17.9634 16.6998C19.0376 16.2923 19.9051 15.3936 20.2242 14.2027C20.5641 12.9328 20.1989 11.6385 19.3648 10.7369C19.0353 10.3806 18.9021 9.88399 19.0093 9.41073L19.0533 9.18514C19.2372 8.0514 18.8917 6.85176 18.0201 5.98006C17.0901 5.05003 15.7865 4.71826 14.5884 4.98983C14.1153 5.09712 13.6186 4.96467 13.2623 4.63534Z"/>
10
+ <g id="pickaxe" transform="translate(6.24 6.24) scale(.48)" fill="currentColor">
11
+ <path d="M15.686 4.314 16.3 3.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-.614.614a12.501 12.501 0 0 1 1.356 10.225 1 1 0 0 1-1.751-.119 22 22 0 0 0-3.393-6.319l-.198.199a1 1 0 0 1-1.4 0l-.219.169L6.619 20.38a1 1 0 1 1-3-3l7.912-7.912.169.232a1 1 0 0 1 0-1.4l.198-.197A22 22 0 0 0 5.58 4.71a1 1 0 0 1-.119-1.752 12.5 12.5 0 0 1 10.225 1.356Z"/>
12
+ </g>
18
13
  </svg>
@@ -5,25 +5,36 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <meta name="color-scheme" content="light dark">
7
7
  <title>MineCodex</title>
8
- <link rel="icon" href="/favicon.svg?v=0.1.0" type="image/svg+xml">
9
- <link rel="stylesheet" href="/styles.css?v=0.1.0">
10
- <script type="module" src="/app.js?v=0.1.0"></script>
8
+ <link rel="icon" href="/favicon.svg?v=minecodex-1" type="image/svg+xml">
9
+ <link rel="stylesheet" href="/styles.css?v=mcx-block-1">
10
+ <script type="module" src="/app.js?v=mcx-block-1"></script>
11
+ <script type="module" src="/assets/terrain.js"></script>
11
12
  </head>
12
13
  <body>
14
+ <canvas id="agent-world" aria-hidden="true"></canvas>
13
15
  <main class="shell">
14
16
  <header class="page-header">
15
17
  <div>
16
- <h1>MineCodex</h1>
17
- <p id="subtitle" class="subtitle">Personal plugins for Codex</p>
18
+ <h1><span class="brand-icon" aria-hidden="true"></span><span class="brand-name">MineCodex</span></h1>
18
19
  </div>
20
+ <div class="header-actions">
21
+ <div class="theme-toggle" role="group" aria-label="Appearance">
22
+ <span class="theme-selection" aria-hidden="true"></span>
23
+ <button data-theme-choice="light" type="button" aria-label="Light appearance" aria-pressed="false"><span class="ui-icon sun-icon" aria-hidden="true"></span></button>
24
+ <button data-theme-choice="dark" type="button" aria-label="Dark appearance" aria-pressed="false"><span class="ui-icon moon-icon" aria-hidden="true"></span></button>
25
+ </div>
26
+ </div>
27
+ </header>
28
+ <div class="overview">
19
29
  <div class="runtime-state" aria-live="polite">
20
30
  <span id="runtime-dot" class="status-dot" aria-hidden="true"></span>
21
31
  <span id="runtime-label">Connecting…</span>
22
32
  </div>
23
- </header>
33
+ </div>
24
34
 
25
35
  <section id="restart-notice" class="restart-notice" hidden aria-live="polite">
26
- <div>
36
+ <span class="notice-icon ui-icon info-icon" aria-hidden="true"></span>
37
+ <div class="notice-copy">
27
38
  <h2 id="restart-title">Restart Codex to apply changes</h2>
28
39
  <p id="restart-copy">Your plugin choices are saved. Restart when you are ready.</p>
29
40
  </div>
@@ -33,13 +44,8 @@
33
44
  </section>
34
45
 
35
46
  <section aria-labelledby="plugins-heading">
36
- <div class="section-heading">
37
- <div>
38
- <h2 id="plugins-heading">Plugins</h2>
39
- <p id="plugins-copy">Choose which enhancements appear in Codex.</p>
40
- </div>
41
- <span id="save-state" class="save-state" aria-live="polite"></span>
42
- </div>
47
+ <h2 id="plugins-heading" class="sr-only">Your extensions</h2>
48
+ <span id="save-state" class="sr-only" aria-live="polite"></span>
43
49
 
44
50
  <div id="plugin-list" class="plugin-list" aria-busy="true">
45
51
  <div class="plugin-skeleton"></div>
@@ -48,7 +54,8 @@
48
54
  </div>
49
55
 
50
56
  <div id="load-error" class="error-state" hidden role="alert">
51
- <div>
57
+ <span class="notice-icon ui-icon alert-icon" aria-hidden="true"></span>
58
+ <div class="notice-copy">
52
59
  <strong id="error-title">Couldn’t load MineCodex</strong>
53
60
  <p id="error-copy">Check that the background service is running.</p>
54
61
  </div>
@@ -59,11 +66,10 @@
59
66
  <footer class="diagnostics">
60
67
  <dl>
61
68
  <div><dt id="version-label">Version</dt><dd id="version-value">—</dd></div>
62
- <div><dt id="install-label">Installation</dt><dd>~/Library/Application Support/MineCodex</dd></div>
63
- <div><dt id="host-label">RuntimeHost</dt><dd id="host-value">—</dd></div>
64
69
  </dl>
65
- <button id="update-button" class="button quiet" type="button">Check for updates</button>
70
+ <button id="update-button" class="button quiet" type="button"><span class="ui-icon refresh-icon" aria-hidden="true"></span><span class="button-label">Check for updates</span></button>
66
71
  </footer>
72
+ <p id="update-result" class="update-result" role="status" hidden></p>
67
73
  </main>
68
74
  <div id="toast" class="toast" hidden role="status" aria-live="polite"></div>
69
75
  </body>