minecodex 2.0.7 → 2.0.9

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 (61) hide show
  1. package/README.md +18 -5
  2. package/apps/dashboard/app.js +61 -10
  3. package/apps/dashboard/assets/diagnostics.js +18 -0
  4. package/apps/dashboard/index.html +5 -0
  5. package/apps/dashboard/styles.css +5 -1
  6. package/assets/brand/README.md +2 -2
  7. package/features/hide-upsell-banner/src/hide-upsell-banner.mjs +2 -0
  8. package/features/images/src/adapters/codex/image-sources.mjs +8 -1
  9. package/features/images/src/adapters/codex/native-image-source.mjs +2 -2
  10. package/features/images/src/frontend/local-image-source.mjs +7 -0
  11. package/features/images/src/library-prompt-page.mjs +9 -0
  12. package/features/model-slider/src/adapters/codex/controller.mjs +14 -1
  13. package/features/model-slider/src/frontend/install.mjs +4 -1
  14. package/features/notes/src/frontend/entry.mjs +10 -0
  15. package/features/session-status/src/session-status.mjs +11 -0
  16. package/features/sidebar-focus/src/sidebar-focus.mjs +8 -0
  17. package/features/sites/src/frontend/entry.mjs +8 -0
  18. package/features/usage-meter/src/adapters/codex/renderer.mjs +2 -1
  19. package/features/usage-meter/src/usage-meter.mjs +8 -0
  20. package/package.json +1 -14
  21. package/packages/cli/src/commands.mjs +6 -1
  22. package/packages/cli/src/config.mjs +8 -6
  23. package/packages/cli/src/control-server.mjs +8 -1
  24. package/packages/cli/src/platform.mjs +10 -0
  25. package/packages/cli/src/runtime-manager.mjs +11 -3
  26. package/packages/codex-adapter/src/renderer/environment.mjs +6 -1
  27. package/packages/runtime-host/src/codex-injection.mjs +49 -16
  28. package/packages/runtime-host/src/codex-runtime.mjs +51 -0
  29. package/packages/runtime-host/src/feature-registry.mjs +3 -3
  30. package/packages/runtime-host/src/main.mjs +8 -4
  31. package/packages/runtime-host/src/renderer-self-check.mjs +56 -0
  32. package/packages/ui/src/components/composer-menu.mjs +7 -2
  33. package/packages/ui/src/foundation/layers.mjs +1 -1
  34. package/packages/ui/src/native/theme.mjs +16 -1
  35. package/DESIGN.md +0 -192
  36. package/apps/dashboard/DESIGN.md +0 -67
  37. package/features/hide-upsell-banner/README.md +0 -30
  38. package/features/images/DESIGN.md +0 -151
  39. package/features/images/README.md +0 -37
  40. package/features/model-slider/DESIGN.md +0 -36
  41. package/features/model-slider/README.md +0 -45
  42. package/features/notes/DESIGN.md +0 -74
  43. package/features/notes/README.md +0 -33
  44. package/features/session-status/DESIGN.md +0 -45
  45. package/features/session-status/README.md +0 -43
  46. package/features/sidebar-focus/DESIGN.md +0 -17
  47. package/features/sites/DESIGN.md +0 -82
  48. package/features/sites/README.md +0 -31
  49. package/features/unread-inbox/DESIGN.md +0 -39
  50. package/features/unread-inbox/codex-feature.json +0 -22
  51. package/features/unread-inbox/src/adapters/codex/modules.mjs +0 -52
  52. package/features/unread-inbox/src/adapters/codex/renderer.mjs +0 -156
  53. package/features/unread-inbox/src/domain/notifications.mjs +0 -21
  54. package/features/unread-inbox/src/injection-source.mjs +0 -9
  55. package/features/unread-inbox/src/unread-inbox.mjs +0 -306
  56. package/features/usage-meter/DESIGN.md +0 -49
  57. package/features/usage-meter/README.md +0 -19
  58. package/packages/cli/native/README.md +0 -49
  59. package/packages/codex-adapter/README.md +0 -16
  60. package/packages/runtime-host/README.md +0 -209
  61. package/packages/ui/DESIGN.md +0 -38
package/DESIGN.md DELETED
@@ -1,192 +0,0 @@
1
- # MineCodex 通用设计规范
2
-
3
- 本文件是全项目通用设计规范的权威入口,由 MineCodex 组件库维护。按原生组件类型和明确分支适配;不要把一个页面中的视觉样式推断成所有组件的统一样式。组件库及插件的 DESIGN.md 只记录本级特殊组件、选型和功能差异,不复制此处的通用规则。
4
-
5
- 依据:2026-10-01,Codex **26.928.21956** 安装包源码,以及隔离窗口的原生 DOM、React 参数和计算样式。浅色 Dialog、菜单、页面与 sidebar 已实测;深色相关遮罩来自源码定义,未据此宣称深色视觉验收完成。
6
-
7
- ## 原生规则与 MineCodex 选择
8
-
9
- 原生组件分类是事实,插件采用哪个分支是产品选择,两者分别记录。例如 Prompts 和 MineCodex Sites 的管理弹窗采用用户指定的 Sites Share 分支;这不意味着原生默认透明 Dialog 被淘汰。按钮外形也不决定容器材质。
10
-
11
- Token 名称是实现依据;括号内数值是本版本观测值。读取实际生效作用域,不仅仅读 documentElement;原生窗口、主题、局部组件均可能覆盖 token。iframe 需要宿主传递 token,不能假设自动继承 Renderer CSS。
12
-
13
- ## 基础视觉与交互
14
-
15
- - 字体与字号引用原生 `--font-sans-default`、`--text-base`、`--text-sm`、`--text-xs`;标题按实际角色使用 `--text-heading-lg`、`--text-heading-md`。字重使用 `--font-weight-normal`、`--font-weight-medium`、`--font-weight-semibold`。功能特殊的信息密度与尺寸在本级文档记录。
16
- - 标题和主要内容使用 `--color-text-primary`,说明使用 `--color-text-secondary`,辅助信息使用 `--color-text-tertiary`。旧前景名称仅由公共token适配器处理必要别名,插件不维护自己的兼容表。
17
- - 交互反馈引用 `--color-background-primary-ghost-hover` 与 `--color-ring`;输入边缘使用 `--color-border-primary-outline`,普通边缘使用 `--color-border` / `--color-border-subtle`。保留所选原生控件实际的focus规则,不把所有输入强制改成同一种外圈。
18
- - 图标优先复用项目已有库或原生真实SVG,随所在控件继承颜色与状态;不按视觉猜测重画,不匹配构建哈希。特殊数据图、品牌图与功能比例在插件文档说明。
19
- - 保留原生主题、locale、zoom、reduced-motion与键盘反馈。用户内容不被翻译;通用控件文字、无障碍标签与功能文案随宿主语言显示。
20
- - 声明功能时优先复用共享容器和控件;功能只填内容、状态与业务回调。项目本地Web界面遵循同一语义视觉契约,但通过主题桥或自身入口获取token,不假设可访问Codex原生DOM。
21
-
22
- ## Dialog 与遮罩
23
-
24
- | 原生分支 | 容器 | 遮罩与使用依据 |
25
- | --- | --- | --- |
26
- | `default` | `--color-surface-elevated-secondary` 90%,`--blur-xl`(24px),0.5px `--color-border` 边缘、`--shadow-lg`,通常 `--radius-3xl`(25px) | `--color-dialog-overlay`;当前普通 Electron 浅色为 `#0002`,无模糊。Images Rename 实测 `variant=default` |
27
- | `opaque` | 不透明 `--color-surface-elevated-secondary`,无容器模糊,0.5px 边缘、`--shadow-lg`,通常 `--radius-3xl` | 原生 `dimmedOverlay`:浅色 `#e3e3e380`、深色 `#00000080`,`--dialog-backdrop-fade-filter`(1px模糊)。Sites Share 实测 `variant=opaque` |
28
- | `form` | 不透明 elevated-secondary,`--radius-form-dialog`,原生 `shadow-form-dialog` utility class | `dimmedOverlay`。不是默认 Dialog 的透明配方;`shadow-form-dialog` 是 class,不能虚构同名 CSS token |
29
- | `confirmation` / `catalog` / `centeredText` | 不透明 elevated-secondary,专用 catalog surface、尺寸与阴影 | `dimmedOverlay`;不将默认 Dialog 的所有尺寸、阴影套入 |
30
- | `beaconModal` / `expressiveBeacon` | 另有容器和主题分支 | `--dialog-backdrop-fade-background`、`--dialog-backdrop-fade-filter`;浅色 fade 当前为 `#f2f2f280`,与 dimmedOverlay 不同 |
31
-
32
- 默认容器与遮罩按原生分支成对选择。dimmedOverlay 的浅灰/黑色配方是原生 CSS 的主题分支,不是某个已命名的遮罩颜色 token;不要把 `--modal-backdrop-background` 当成它的同义名。
33
-
34
- 共有文字与结构 token:`--font-sans-default`、`--text-heading-md`(20px)、`--font-weight-semibold`、`--text-base`、`--color-text-primary`、`--color-text-secondary`、`--color-text-tertiary`、`--modal-container-inner-padding`。当前共享外壳内容 padding 为20px,标题行高28px;Close 采用原生 Sites SVG及24px热区、top/right 16px。具体内容尺寸由功能决定。
35
-
36
- `--shadow-lg` 当前浅色为 `0 4px 8px -2px / 10%黑色`。边缘和投影是两部分;按所选原生组件保留ring与shadow组合,不再额外加一层CSS border。表单、确认等专用分支应按所选原生组件保留差异。
37
-
38
- ## 操作按钮
39
-
40
- 当前 MineCodex 管理弹窗采用 Sites Share 的 `data-size=xl`、`data-pill` 设计,语义与材质分开维护。
41
-
42
- | 操作角色 | 填充/边缘 | 原生 token |
43
- | --- | --- | --- |
44
- | Cancel 等取消操作(`ghost`) | 透明、无描边;hover 才出现底色 | `--color-text-secondary`、`--color-background-primary-ghost-hover` |
45
- | 有实际功能的次级操作(outline,现有API tone为`secondary`) | 透明底、内描边 | `--color-text-primary`、`--color-border-primary-outline`、`--color-background-primary-outline-hover` |
46
- | 主操作(solid,现有API tone为`primary`) | 实色底与配对文字色 | `--color-background-primary-solid`、`--color-text-primary-solid`、`--color-background-primary-solid-hover` |
47
- | 轻量警戒操作(现有`danger`) | 警戒色,独立于主操作;插件负责确认业务 | `--color-background-danger-soft-alpha`、`--color-background-danger-soft-alpha-hover`、`--color-text-danger` |
48
- | 实色警戒操作(`danger-solid`;原生 React 为 `dangerSolid`) | 用于明确的删除/移除动作,实色警戒底与配对文字;操作范围和二次确认由业务决定 | `--color-background-danger-solid`、`--color-text-danger-solid`;Library 动作条 hover 为 solid 90% alpha |
49
-
50
- 尺寸:`--control-size-lg`(36px)、`--control-font-size-md`(13px)、`--font-weight-normal`(原生按钮400)、`--radius-full`。水平 gutter 为 `--control-gutter-md × --control-gutter-pill-scaling`(15.96px),图文 gap 为 `--button-gap-lg`。焦点使用 `--color-ring`;禁用保留语义并阻止 hover 反馈。
51
-
52
- 不要将所有原生按钮改为同一尺寸:Share xl 胶囊是这里选定的弹窗操作规范,页面入口、Composer 控件及其他原生组件仍按各自类型处理。
53
-
54
- ## Dropdown、Popover 与 Composer 建议列表
55
-
56
- | 类型 | 默认材质与 token | 约束 |
57
- | --- | --- | --- |
58
- | Dropdown `surface=menu` | elevated-secondary 90%,`--blur-sm`(8px)、`--color-border-overlay`、`--dropdown-overlay-ring-width`、`--shadow-dropdown-overlay` | Images动作菜单实测。通常rounded-2xl;不要用Popover参数代替 |
59
- | Dropdown `surface=opaque` | 不透明 elevated-secondary、dropdown专用阴影 | 保留明确的不透明分支 |
60
- | Dropdown `surface=panel` | 菜单材质基础上增大padding与阴影,使用blur-lg | 只在存在对应panel需求时采用 |
61
- | Popover | 原生 `opaque` 省略时为true,不透明;false改为90%填充,源码不统一添加模糊 | `--color-border-overlay`、`--popover-overlay-ring-width`、`--shadow-popover-overlay`;`variant=menu`复用opaque菜单,comment有独立样式 |
62
- | Composer SuggestionMenu | 当前Add列表不透明 elevated-secondary、无模糊;边框与阴影受建议列表token控制,当前无投影 | `--radius-suggestion-menu`、`--suggestion-menu-border-width`、`--suggestion-menu-shadow`,不存在时沿用原生fallback;列表文字`--text-sm` |
63
- | Composer expanded top tray | 专用背景与边缘,无blur;embedded分支透明无边框 | `--composer-top-tray-background`、`--composer-top-tray-border`;背景fallback为surface-secondary 94%。不要与独立悬浮菜单混用 |
64
-
65
- Dropdown 的 `--shadow-dropdown-overlay` 当前指向 `--shadow-xl-spread`,该 token 自身含0.5px边缘。普通Popover的 `--shadow-popover-overlay` 当前指向 `--shadow-lg`。不要给所有浮层固定附加4px blur或同一个shadow。
66
-
67
- Composer菜单的锚点是实际输入框主体(当前语义标记 `data-composer-body`),不是包含diff和请求队列的外层Root。挂载位置、可用高度、zoom与碰撞行为沿用对应原生组件,不为修复坐标问题盲目提高z-index。
68
-
69
- ## Viewer 附属信息面板
70
-
71
- Codex 26.930.21537(2026-10-02 原生 File info DOM 与计算样式实测):viewer 右侧附属信息面板使用不透明 `bg-surface-elevated-secondary`、`rounded-2xl`(20px)和 Electron `elevation-prominent`;没有容器模糊,也不额外叠加 CSS border 或 `shadow-lg`。该 elevation 自带 0.5px 边缘及两层柔和投影,应直接沿用原生 utility。此分支不同于 Dialog、Dropdown 和页面内容面。
72
-
73
- 标题栏使用固定高度、原生 text-base/semibold 标题及圆形 `button-toolbar` 的 `bg-text/5` 按钮分支,hover 为 `bg-text/10`。面板宽度、viewer 工具栏避让及正文间距由所选原生信息面板的业务布局确定,在功能 DESIGN.md 记录。Images Prompt 采用当前 File info 分支。
74
-
75
- ## Page 与 sidebar
76
-
77
- 页面内容面使用 `--color-surface`,当前不透明、无模糊,`--radius-xl-base`(12px);外部PageSurface使用 `--app-shell-page-surface-shadow`,当前由 `--elevation-stroke-subtle` 与 `--shadow-card` 组成。区分内容面和窗口外壳,不重复施加阴影。
78
-
79
- sidebar规则分状态:
80
-
81
- | 状态 | 原生规则/token |
82
- | --- | --- |
83
- | 非peeking sidebar-navigation | `--color-surface` 65%(oklab混合),无CSS模糊、无浮窗阴影;可见桌面程度还取决于窗口材质 |
84
- | `data-slate-sidebar-peeking=true` | `--app-shell-sidebar-popover-background`强制alpha=1;`--app-shell-sidebar-popover-radius`当前为radius-xl-base减spacing(8px);`--hairline`、`--app-shell-sidebar-popover-border`内边缘与`--shadow-card` |
85
-
86
- ### 全页面功能的页面壳选择
87
-
88
- 后续功能开发独立全页面时,先按页面自身的导航需求选择页面壳。没有专属二级导航的页面默认使用无二级侧栏的 Page 分支,以原生 Projects 为行为参照;只有任务确实需要常驻二级导航时才选择带侧栏的布局。不能因入口来自 Home、Space、Scheduled 就继承它们的常驻二级侧栏。
89
-
90
- 页面是否带常驻二级侧栏,与用户的侧栏展开/收起偏好是两个独立语义。无二级侧栏页面只保留 Navbar,内容从 Navbar 右侧开始,不调用侧栏收起动作,也不修改用户的展开偏好。悬浮 Home、Space、Scheduled 等入口时,原生二级侧栏仍叠加在页面上,页面内容不移位;鼠标可进入操作,离开后沿用原生退出行为。
91
-
92
- 页面壳、原生导航适配与恢复由共享 UI 维护,功能只声明所需分支并负责自己的内容。新功能不得复制侧栏状态机、直接切换原生侧栏按钮,或另写隐藏侧栏的 CSS。退出页面时区分返回原页面与用户主动选择原生导航;卸载/禁用时释放页面壳并恢复所属状态。
93
-
94
- 验收至少覆盖:从 Home、Space、Scheduled 进入时无常驻二级侧栏;原有展开偏好不变;三个入口的悬浮侧栏覆盖页面且可操作,内容不移位;退出、原生导航与卸载恢复正确。
95
-
96
- 原生依据与当前实现:Codex 26.930.21537 的源码与隔离窗口确认该布局由路由决定。当前注入 Page 借用 `/projects` 作为原生页面壳,关闭时恢复原位置,用户主动选择原生导航时交还路由;这是版本相关的适配实现,不是功能的业务路由规范。后续原生接口变化只更新共享 Adapter,不改变上述页面语义。
97
-
98
- 保留原生的固定展开、收起与hover状态。hover sidebar应能覆盖注入页面,鼠标能进入操作,移回页面后可正常收起;不要通过页面层级、pointer-events或额外遮罩挡住它。原生overflow和contain切换负责浮出与裁切,插件不复制一套侧栏状态机。
99
-
100
- ## 左侧 Navbar
101
-
102
- 导航入口复用原生按钮容器,三种状态分别维护:
103
-
104
- | 状态 | 图标 | 容器 |
105
- | --- | --- | --- |
106
- | 未选中 | outline/default 资源 | 原生未选中色与透明底 |
107
- | 悬浮 | 保持 default 图标 | 原生 hover 底色;保留 sidebar peeking 行为 |
108
- | 当前页面选中 | 独立 filled/selected 资源 | `data-selected` 与 `aria-current="page"`,原生选中色与底色 |
109
-
110
- 原生 `railIcons.default/selected` 根据 `isCurrentDestination` 选择资源。不能给 outline SVG 简单设置 fill 代替 selected 资源,也不能仅移除 DOM 选中属性就认为图标已还原。注入页面打开时取消原生视觉选中,关闭、导航或卸载时恢复;不更改原生路由,不破坏 Home hover sidebar。
111
-
112
- 通用入口为 `ui.navigationRail(button, { defaultIcon, selectedIcon })`,返回 `select(boolean)` 与 `restore()`。组件负责展示状态与清理,`packages/ui/src/native/navigation-rail.mjs` 负责原生资源读取。原生图标优先调用资源显式提供的 `createElement(document, className)` DOM API(包含 optical 与主题处理);单色 IconAsset 读取 default 的真实 SVG;其他组件形式使用已记录的未选中 SVG。default/selected 本就相同的自定义资源保持原图。不要调用带 Hooks 的函数或替换 React 所有的 SVG 子节点;未知资源契约需核对原生来源,不能伪造轮廓。原生重渲染更换 SVG 后重新应用展示状态。
113
-
114
- ## 层级、Portal 与生命周期
115
-
116
- 层级数字是本版本实现值,不是原生CSS设计token;共同约束应集中维护语义角色与挂载点。
117
-
118
- - 内容页面位于原生sidebar悬浮层下方;MineCodex当前Page使用20,原生左侧栏40。
119
- - 通知使用共享 `notification` 挂载角色(当前30),位于内容页面之上、原生sidebar与模态浮层之下;通知业务负责在原生侧栏 peeking 时暂停呈现,不抢占原生导航。
120
- - 原生Dialog、Dropdown、Popover和Composer Floating父容器通常为50;同数值不保证相同层级,仍受挂载顺序与stacking context影响。
121
- - 模态层挂在窗口根容器/原生Portal,遮罩覆盖整个窗口;不要嵌在Page的低层级容器内。原生`dialog.showModal()`使用top layer,不能仅用z-index推断。
122
- - Tooltip使用专用角色与层级;现有MineCodex实现值不是原生标准,不传播为通用token。
123
- - 组件维护通用焦点、Escape、关闭与清理契约;插件传业务回调和恢复焦点目标。原生已提供的生命周期优先复用,迁移时避免重复处理。
124
-
125
- ## Tooltip
126
-
127
- 共享Tooltip处理MineCodex标记,不接管原生Tooltip。当前声明入口为 `data-minecodex-tooltip`,删除克隆节点上过时的 `title` / `aria-describedby`,避免双重气泡。
128
-
129
- Token:`--color-background-tooltip`、`--color-text-tooltip`、`--color-border-tooltip`、`--shadow-tooltip`、`--radius-2xl`、`--font-sans-default`、`--text-sm`、`--tooltip-compact-font-weight`、`--tracking-tooltip`。原生默认 Tooltip 使用 `rounded-2xl`,同时应用 `corner-shape: var(--codex-corner-shape)`;支持该属性的桌面版本通过 `--codex-corner-radius-scale` 放大半径并采用 superellipse,不能只复制半径而漏掉轮廓。共享实现保持此规则,padding 为 `--spacing × 1.25 / × 3`、行高18px,Portal 从触发器继承相关主题 token。
130
-
131
- Navbar 在入口右侧居中,使用 `data-minecodex-tooltip-side="right"`;普通控件读取原生 `--side-tooltip`(默认top),也可显式声明top/bottom/left/right。默认间距2px,碰撞时翻转并保留8px窗口边距,计算考虑window zoom。共享hover延迟200ms,已打开提示之间300ms内切换免等待;键盘focus立即显示,离开/点击/Escape/窗口失焦关闭。时序依据新版自定义 Tooltip provider,不套用包内另一套 Radix 的700ms默认值。共享提示之间维护自己的handoff,不接管原生provider。支持aria关联及卸载清理。额度、上下文等特有内容通过 `tooltipSurface` 复用材质,功能维护自身内容与定位。
132
-
133
- ## 主题、窗口材质与系统玻璃
134
-
135
- 以下机制独立,不能以“玻璃效果”混称后套到所有组件:
136
-
137
- 1. CSS半透明填充与backdrop-filter:用于部分Dialog、Dropdown等组件,模糊其后的网页内容。
138
- 2. 窗口vibrancy:macOS部分窗口在允许透明时使用menu材质;不透明设置、焦点、窗口尺寸、屏幕scale及支持状态会影响窗口底层。Windows另有mica路径。`electron-opaque`窗口状态与Dialog的`variant=opaque`不是同一个概念。
139
- 3. Owl native glass:仅匹配明确选择glass的原生组件,并遵循宿主能力状态。CSS声明`-owl-native-material:glass`、`--owl-native-glass-adaptive-appearance:off`、`--owl-native-glass-variant:regular`;root `data-owl-native-glass=active`时去掉CSS模糊/阴影并使用round corner;`data-owl-native-source-underlay`分支使用16% surface填充。
140
-
141
- 本次普通隔离窗口没有Owl glass active属性。安装包中显式`surface:glass`菜单调用位于avatar-overlay-native-page;主进程显式`hasNativeGlass`条件为darwin且appearance为avatarOverlay。不得因为存在glass CSS就为所有插件浮层申请系统玻璃。
142
-
143
- 主题读取 `data-theme` 与实际token;尺寸和圆角跟随原生scale,位置考虑 `--codex-window-zoom`。沿用原生reduced-motion与焦点状态;不为适配擅自改变应用主题、窗口透明设置或系统辅助设置。
144
-
145
- ## 当前实现与规范的差异
146
-
147
- 共享组件已迁入 `packages/ui`:Dialog 支持 default/opaque,Dropdown 支持 menu/opaque,Popover 支持 opaque/translucent,ComposerMenu 使用原生浮动列表材质,Page 使用原生内容面。现有插件显式选择相应类型,不再统一套90%/4px浮层配方。未提供通用系统glass开关;没有明确原生分支与能力证据时,使用所选组件的CSS材质。form/catalog等尚无实际调用需求的分支仅记录原生事实。
148
-
149
- 现有token注册表供宿主主题桥使用,不代表本文所有组件token已注册。新增iframe消费时核对并补齐所用token;直接注入组件读取原生CSS作用域。按实际需求维护必要别名,删除已失效的兼容代码。
150
-
151
- ## 维护依据
152
-
153
- - `app-shared-eececb2d2eb0.js`:Dialog variant、遮罩配对、Dropdown surface、Popover opaque默认值。
154
- - `app-shared-342447930c78.css`:材质、glassSurface、遮罩、token及按钮规则。
155
- - `app-initial-e55cd978d577.css`:Page、sidebar peeking、Composer top tray及rounded类的corner-shape规则。
156
- - `app-initial-135a4ef2552c.js`:Navbar railIcons状态切换、Tooltip右侧位置;shared JS 自定义Tooltip默认200ms、skip 300ms、offset 2px。
157
- - `main-BbeJ4AAR.js`:窗口opaque/vibrancy及native glass创建条件。
158
- - `avatar-overlay-native-page-caa507f161db.js`:明确的glass菜单使用位置。
159
-
160
- 这些文件名仅标识本次原生证据,含构建哈希,不能成为运行时选择器。更新Codex后,优先重查语义组件和实际状态;将新的事实回写本规范及相应实现,不凭截图推断所有组件已换代。
161
-
162
-
163
- ## 项目 token 与原生名称的边界
164
-
165
- 上文表格记录 Codex 原生 token 名称与取证规则。实现由 `packages/ui/src/native/tokens.mjs` 的规范名称、已知别名和 `MINECODEX_THEME_BINDINGS` 映射至项目 `--mcx-*` 命名空间,插件样式消费项目变量。例如原生 `--color-text-primary` → 项目 `--mcx-color-text-primary`,`--shadow-lg` → `--mcx-shadow-lg`,`--radius-3xl` → `--mcx-radius-3xl`。
166
-
167
- 这里的规范名称是稳定的项目映射键。Codex 更新名称时补充原生别名,不能跟着重命名插件消费的项目 token。新增实际使用的语义才增加映射;不预建完整的第三方 token 系统。`native/theme.mjs` 为直接注入容器写入同一快照,Runtime Host 将它传给 iframe;卸载恢复原值。主题变化丢失某个 token 时清除旧项目值,继续使用该组件既有的明确默认值或不可用状态,不复用上一主题颜色。
168
-
169
- 这些映射不改变原生组件分类、材质分支和 hover sidebar 层级,也不重写原生 Tailwind utility class。插件复用 native Adapter 返回的原生模板;特殊样式使用项目 token,Dialog、Button、Tooltip 等通用表现继续由组件库维护。
170
-
171
-
172
- ### Library 多选动作条的实色警戒按钮
173
-
174
- Codex 26.930.21537(2026-10-02 原生源码与隔离窗口):Library 选中动作条的 Delete 使用 `dangerSolid`、full radius、toolbar size,图标 16px,警戒底与白色配对文字;hover 使用 danger solid 90% alpha,禁用保留原生 40% opacity 与禁止交互。确认弹窗也使用实色警戒提交按钮。共享 DOM 入口为 `ui.action(button, "danger-solid")`,和既有 soft `danger` 分支并存,不迁移原有功能的语义。通用组件只提供视觉和交互状态,删除确认、隐藏/回收站/永久删除的范围由所属功能明确告知。
175
-
176
- ## MineCodex 项目品牌图标
177
-
178
- 项目标识采用实心镐子与 Codex 原生六瓣外圈,唯一可编辑源为 `assets/brand/minecodex-icon.svg`。内部镐子使用 `translate(6.24 6.24) scale(.48)`,纯填充、无描边;保留已确认的留白比例。此标识代表 MineCodex,不替换插件功能图标、模型厂商图标或 Codex 原生应用图标。
179
-
180
- 内联使用 `currentColor` 跟随所在表面的语义文字色;外链明暗版本分别使用 `#0d0d0d` / `#fafafa`,透明背景。favicon 在 SVG 内通过 `prefers-color-scheme` 适配系统主题,Dashboard 标题通过 CSS mask 跟随页面 `--ink`。明暗版本、favicon 和 README 标识由 `npm run build:icons` 从同一源文件生成,修改几何后运行该命令。
181
-
182
- macOS 后台服务 App 在明确的原生资源修订 1.0.1 中接入实心图标,采用浅色圆角底板,保证在明暗系统表面均可辨认。ICNS 来自同一项目几何。安装器先注销旧后台项,再验证并替换 bundle,最后重新注册;不能直接修改已安装的签名资源。后续普通 JavaScript 发布保留此原生 bundle 的签名身份,升级流程与验收边界见 `packages/cli/native/README.md`。
183
-
184
- ### 账号菜单中的 MineCodex 入口
185
-
186
- Codex 26.930.21537(2026-10-03 安装包源码与隔离 DOM):`profile-dropdown-items` 的 Settings 使用原生菜单行,紧接 Help 前的 Separator;`onOpenSettings` / `settingsShortcut` 标识其行为,外层 `onClose` 关闭账号面板。MineCodex 行插在 Settings 与 Separator 之间,复制脱离 React 的原生行,保留原始 Settings 及其所属层级。左侧使用实心项目标识,右侧使用 Lucide ArrowUpRight;右侧沿用快捷键区域的间距,图标使用原生 Help 右侧箭头的 `text-tertiary` 色与 opacity 1(当前浅色为 rgba(13,13,13,0.482)),不套左侧图标的 0.75 / hover、focus 时 1 的透明度。隔离 DOM 确认左侧普通态与 Settings 同为 rgb(13,13,13)、opacity 0.75,hover / focus 时为 1。
187
-
188
- 左侧保留原生 CompactSource / LeadingSource 两套结构,只替换其中 SVG;分别继承原生 SVG 的 width、height、class 和 style。菜单标识复用当前 `codex-light-16` / `codex-light-20` 的真实填充外圈路径,引用存于 `assets/brand/references/codex-menu-16.svg` / `codex-menu-20.svg`;内部镐子仍从品牌源生成,由 `npm run build:icons` 输出两套 `packages/ui/assets/minecodex-menu-*.svg`。不能将 24px 品牌外圈缩小代替原生菜单的路径粗细。账号图标沿用原生 `currentColor` 与 `--profile-menu-icon-opacity`(桌面默认 0.75,行 hover / focus 时为 1),不另设固定灰色。此项为安装包源码核对,实际窗口视觉仍待手动验收。
189
-
190
- 右侧箭头的两段几何合并在单个 SVG path 中一次描边,避免 `currentColor` 自带 alpha 时,两个独立 path 在交叉点重复叠色。保留原资源的形状与端点规则;24px viewBox 中 stroke-width 为 1.575,在 16px 显示时实际线宽 1.05px,与原生 Help 箭头的线条粗细对齐。
191
-
192
- 入口随账号菜单重建恢复且只出现一次;补齐 Settings → MineCodex → Help 的上下键导航与 Enter/Space,保留原生 Escape 关闭行为。点击经已认证 Host bridge 调用 `mcx gui`;成功后关闭菜单,失败时显示实际错误。原生 UI 手动验收本次因 Computer Use 拒绝操作应用而未完成;隔离 DOM 契约页验证了位置、明暗颜色、点击、键盘、重建去重与清理。
@@ -1,67 +0,0 @@
1
- # MineCodex Dashboard Design System
2
-
3
- The standalone control panel follows the root DESIGN.md semantic color and interaction
4
- contract. It uses local light/dark tokens because no Codex renderer theme bridge exists here.
5
-
6
- ## Layout and reference
7
-
8
- Reference: VPN Dashboard settings source, inspected 2026-10-03. Its card grid uses a 16px
9
- radius/gap, top icon and trailing arrow, followed by a title and description. The live URL
10
- required login; this reference is source-based, not a live visual match.
11
-
12
- MineCodex uses one centered 1064px column without a sidebar or category groups. The header
13
- holds the shared brand and appearance control; a runtime notice appears below only when the service needs attention.
14
- There is no tagline or visible section introduction. Save feedback remains available to screen readers.
15
- Nine independent cards form a three-column grid, two columns at 960px and one at 600px.
16
- Each card has an icon and switch at the top, name and purpose below, and a readable actual-state line
17
- at the bottom of every card. Enabled switches and runtime state remain distinct information. A card is not itself clickable. The footer shows only the MineCodex version
18
- and adjacent update check (16px gap, regular weight, refresh icon), with persistent update feedback below it. No install path or plugin versions.
19
-
20
- ## Tokens and components
21
-
22
- - Canvas: cool #edf1f7 / deep blue #101722, with a decorative ASCII voxel world.
23
- - Surface: white / #1b2533, with a hard 3px lower edge for a block-like silhouette; no blur.
24
- - Border: #d7dfe9 / #334359; blue #3478d4 / #71a8f3 switches and active state accents.
25
- - Ink, secondary ink, accent, success, warning and danger use the local semantic CSS tokens.
26
- - `--card-radius`: 8px; `--grid-gap`: 16px; `--card-padding`: 24px.
27
- - Card minimum height: 216px desktop, 204px mobile; content can grow without clipping.
28
- - System sans family; pixel brand title 36–64px/700, feature name 16px/600, description 14px/1.65,
29
- state metadata 13px/1.5. Each description is one short statement of purpose; remove promotional filler while preserving each feature’s actual state.
30
- - Feature icons: 24px display size, uniform 2.1-unit stroke in a 24×24 viewBox, matching Prompts. The control-server normalizes only dashboard output; original injected assets stay unchanged.
31
- - Icons: existing manifest assets, with official Lucide bell, panel-left and globe for
32
- Task Switcher, Sidebar Focus and Sites. Lucide ISC license is retained in
33
- `packages/ui/assets/lucide-LICENSE.txt`.
34
- - Checkbox switches expose switch semantics, feature labels, descriptions and state text.
35
- Track is 36×21px with a 32px-high label hit area. Pending requests disable only their switch;
36
- failures restore the previous value and focus. Enabled and active remain distinct facts.
37
- - Appearance uses the VPN reference’s two-segment sun/moon capsule (32px segments, 4px gap and padding). A sliding selected circle and aria-pressed expose selection. It initially follows the system; manual choices persist locally.
38
- - Restart and error notices use a neutral card, colored left edge, status icon, compact copy and trailing action; toast errors share that material. Restart notice appears only for a pending restart. No automatic restart.
39
- - Update checks retain loading, result and retryable failure states; installation stays with
40
- the existing `mcx update` flow.
41
-
42
- ## Motion
43
-
44
- `--ease-out: cubic-bezier(0.23, 1, 0.32, 1)`. Switch thumb: 180ms transform;
45
- button press: 140ms transform to scale(0.97). No stagger, card lift, layout motion or continuous
46
- loading shimmer. Hover is limited to fine pointers. Keyboard actions disable transitions;
47
- reduced-motion preferences disable movement. Focus rings remain visible in both themes.
48
-
49
- ## Project identity
50
-
51
- The masthead uses self-hosted Silkscreen Bold (SIL OFL, bundled license in assets/OFL.txt),
52
- with a stone-colored face, dark outline and stepped text shadow inspired by Minecraft lettering.
53
- The shared pickaxe mark is 76px desktop / 48px mobile. Body and state text retain the legible
54
- project sans-serif contract. This is a dashboard-specific visual treatment; the brand geometry
55
- and other injected plugin UI remain governed by root DESIGN.md.
56
-
57
- Dashboard icons are official Lucide SVGs, covered by packages/ui/assets/lucide-LICENSE.txt.
58
- All font and icon assets are served locally and included in the npm package.
59
-
60
- ## ASCII agent world
61
-
62
- A fixed, pointer-transparent and aria-hidden canvas renders deterministic terraced terrain,
63
- ASCII water, paths and coding nodes (>_, {}, git, </>, [AI], $). It rotates around its vertical
64
- axis once every 240 seconds, rendered at at most 20 fps and device pixel ratio capped at 2.
65
- The world stays behind opaque cards; text and controls never rotate. Reduced motion freezes
66
- the view, hidden tabs pause the animation. The terrain module has no external dependency
67
- or network request and does not consume user or session data.
@@ -1,30 +0,0 @@
1
- # Hide Upsell Banner
2
-
3
- 隐藏 Codex 桌面应用在输入区上方渲染的
4
- “You're out of Codex and Work usage”用量耗尽横幅(upsell banner)。
5
-
6
- 这是一个 `page-script` 类型的轻量功能:不启动 HTTP 服务、没有 Sidebar 或
7
- Toolbar 入口,由 `CodexRuntimeHost` 在渲染进程内注入一段脚本。
8
-
9
- 功能范围:
10
-
11
- - 仅隐藏横幅的 GUI 显示(`aside` 卡片,`display: none`);
12
- - 以 `aside` 和中英文 Codex 额度耗尽标题识别;通用标题 `You’re out of usage`(也支持直引号)还须带原生用量横幅关闭按钮,避免误隐藏普通通知;不依赖卡片 class 或购买按钮文案;
13
- - 不拦截、不篡改额度查询接口(`account/rateLimits/read` 与 app-server
14
- JSON-RPC 流量保持原样);
15
- - 横幅样式被重新渲染覆盖后,由 `MutationObserver` 重新隐藏;只在样式变化时写入,避免观察器循环。节点改作普通通知或离开文档时释放隐藏状态;
16
- - 注入运行时随 RuntimeHost 卸载自动清理(恢复元素样式、断开 observer)。
17
-
18
- ## 验证
19
-
20
- ```bash
21
- npm test
22
- ```
23
-
24
- ## 适配说明
25
-
26
- 这是非官方 CDP / DOM 适配。横幅识别与隐藏逻辑由本功能的 page-script 维护,Runtime Host 负责注入和卸载。
27
-
28
- Codex 26.930.21537(2026-10-02 原生源码核对):默认横幅和 recovery 分支均使用 `aside` / `h3`,标题来自后端 `banner.title`。通用标题目前仅在同时具有 `Dismiss usage banner`、`不再显示用量横幅`、`關閉用量橫幅` 或 `關閉用量橫額` 关闭语义时隐藏;没有该控件或其他未知标题时保守保留。
29
-
30
- 行为测试覆盖标题边界、动态内容、重复隐藏、节点复用及卸载后的排队扫描。隔离浏览器 DOM 已验证隐藏和样式覆盖后的恢复;真实账户额度耗尽横幅尚未做端到端验收。
@@ -1,151 +0,0 @@
1
- # Images: native Library prompt contract
2
-
3
- 通用视觉、材质、按钮、Tooltip 与原生 sidebar 层级遵循根 [DESIGN.md](../../DESIGN.md)。本文件只记录功能特有组件、布局、数据语义与通用组件选型。
4
-
5
- ## Scope
6
-
7
- Images enhances Codex's native Library image viewer, reached through Space → Images.
8
- It also appends **Image Gen** after Your creations and Uploads in the native Image sources tablist.
9
- This tab contains images generated locally by Codex or local Work. Browsing does not upload them; explicit Favorites/folder actions persist the selected image in native cloud Library.
10
- The native tabs, content nodes and routes are retained. Leaving Image Gen restores native selection and content;
11
- hover sidebars and the native full-page shell remain owned by Codex.
12
-
13
- ## Image Gen
14
-
15
- 全屏图片查看器使用原生 Canvas 的 `presentation:"overlay"`,由外层 CanvasLayout 的 `bg-surface` 提供背景。Codex 26.930.21537(2026-10-03 源码与 live DOM):`dialog` / `panel` 分支会在内部画布叠加 `bg-surface-secondary`(当前浅色 #f7f7f7),不能用于这里的全屏画布。保留 standalone、原生 viewer header、底部编辑工具栏和 Composer 接入。
16
-
17
- Codex 26.930.21537(2026-10-02 隔离实测):通过原生 `variant="browse"` 的 Image sources 契约接入。保留原生标签节点及路由,在插件拥有的 React root 中复用同一个原生 Tabs 组件,追加 Image Gen;退出时恢复原节点。原生上下文由 Adapter 从当前已提交的组件祖先读取,业务层不遍历 Fiber。
18
-
19
- 本地来源复用 ImageLibrary、ThreadMetadataIndex 及文件监听,索引存放在当前 runtime profile;按生成时间倒序,每页 36 张,滚动增量加载,搜索复用原生输入框。稳定身份为 threadId + imageGenerationItemId,不猜测云端 ID 与本地文件的关系。
20
-
21
- 加载使用原生 Library Skeleton,排布使用原生 Masonry,悬浮效果使用原生 Library Card,菜单使用原生 Dropdown、Button 与 Menu。图库本地文件通过原生生成图片 resolver 读取;浏览时 Backend 提供索引中的来源路径,图片由原生 resolver 读取;显式云端登记才读取该索引 ID 对应的完整字节并校验内容指纹,不接受 Renderer 任意路径读取,不维护第二套图库加载协议。
22
-
23
- 点击图片进入原生 Library 主内容 viewport 内的图片画布,保留 navbar、Space 二级侧栏和窗口栏;不打开 side panel,也不使用覆盖整窗的 Dialog。画布、缩放、下载、打开、Markup、Comment、Remove BG、Erase、Resize 和底部 “Ask about this file” 输入框复用原生组件。底部直接使用画布的原生 `renderComposer` / overlay 承载,沿用底部留白、居中、避让和工具状态显隐;不得另建 absolute 底部输入框。进入 Comment 时隐藏大输入框,退出时恢复;原生拖拽工具栏保留位置记忆及 Home 居中重置。初始缩放与每张图的 Zoom to fit 使用原生 `zoom` 契约,`manualZoomPercent` 初始为 `null`,不自算比例,也不继承上一张图的手动缩放。关闭回到原列表并恢复交互,标注中的关闭交由原生编辑器处理。
24
-
25
- 2026-10-03 跟进原生文件预览:底部复用当前 File Composer 的本地任务分支,宽度 `min(48rem, calc(100vw - 2rem))`、`auto-single-line`、`surfaceVariant:"inline"`、隐藏 utility bar 和运行位置控件,输入布局、模型控件、权限、语音及发送按钮均由原生组件决定,不再固定旧 Chat 的单行组件。画布在主内容 viewport 内,因此只在此画布范围内去掉原生 overlay header 容器的窗口交通灯左右避让,保留原生 header 自身 8px inset。背景、缩放、Open、下载、关闭、菜单及编辑状态使用原生 Canvas;按当前产品要求保留黑色编辑行动条。底部预留区通过 ResizeObserver 读取实际 File Composer 高度,加原生 `spacing × 4` 底部 inset;不沿用原生旧输入框的 118px 最小预留。行动条默认位置与拖拽下边界共用此画布尺寸,输入框展开、收起或隐藏时同步更新;默认紧凑输入框 44px 时预留为 60px,行动条与输入框间距为 16px。
26
-
27
- 本地来源以真实路径、来源 thread 和生成项 ID 接入;底部输入框首次发送时通过原生文件服务准备本地临时附件,不上传云端、不伪造 Library 身份。关闭或切换账号后晚到的附件会释放;提交接受后沿用原生本地会话导航。黑色行动条的生成编辑仍在明确提交编辑时通过原生上传准备临时附件,同一画布复用编辑附件,查看不上传到 Library。附件使用原生返回的 `id`;不得把本地 ID 伪装为 cloud file ID。生成编辑调用原生提交能力,接受后沿用原生会话导航。View prompts 通过原生菜单扩展进入已有的 File info 风格面板。以上组件契约已按 Codex 26.930.21537 的产物与隔离窗口检查;实际云端生成结果须单独验证。
28
-
29
- 发送准备只在用户点击发送后进行,不在开始输入时预准备;本地字节转换直接填充 typed array,避免大图片经字符串迭代器生成中间数组。该优化只减少本地准备成本,不代表上传或原生提交网络等待已经缩短。
30
-
31
- 图库菜单复用原生 mediaOverlay More Button、Dropdown、Menu.Item 与原生图标,按 Chat about this、View prompts、Add to Favorites/Remove from Favorites、Download、Add to folder、Delete 排列。View prompts 的图标约束为菜单使用的 16px,不继承导航栏尺寸。项目现有 Lucide book-open 的合并路径图形随 Images 注入,资源位于 `src/assets/prompts-menu.svg`;图库 More、大图菜单和云端菜单共用此资源,不从 Prompts 导航节点临时取图,也不依赖 Notes 功能启用。
32
-
33
- 只有用户点击收藏或文件夹操作时,通过原生 Library upload(required persistence)上传所选 PNG;取得真实 Library ID 后保存账号、用户、本地图片 ID、SHA-256 内容指纹对应关系。收藏调用原生 setLibraryFavorite 并以服务器状态切换,文件夹使用原生 MoveLibraryItemsDialog;不在本地保存收藏或文件夹关系。云端节点读取采用原生 `/files/library/files/{library_file_id}/node` 契约,不能把上传返回的 Library ID 当普通内容 file ID。
34
-
35
- 取消选择通过原生 toast 服务反馈。该操作首次上传后取消显示“Image saved to Library, but not added to a folder.”;已有云端身份则显示“No folder selected.”。取消不删除云端图片、不移动文件;移动成功后的关闭不误报取消。浏览与打开菜单不上传,收藏状态查询不创建记录。
36
-
37
- 登记工作流位于 `src/frontend/cloud-image-actions.mjs`。同时操作同一图片复用在途任务,Backend 原子预留避免不同窗口重复上传。已确认的身份跨 Runtime 重启保留;内容变化或账号变化不复用。上传结果不确定时保留预留状态并用原生错误 toast 提醒检查 Library,禁止盲目重新上传;自动恢复不确定记录尚未实现。云端条目删除或访问失效时报告操作失败,不自动重新上传。
38
-
39
- 原生构建产物和组件导出契约集中在 `src/adapters/codex/native-image-source.mjs`。按实际模块引用发现构建文件,不固定哈希;契约不匹配时保留原生页面并报告能力缺失。`src/frontend/local-image-source.mjs` 仅负责来源选择、分页、搜索与清理,Runtime Host 只鉴权和转发 `local-image-source` 的 list / prompt 与身份登记操作。
40
-
41
- ## Entry and identity
42
-
43
- The native `data-testid="viewer-header"` is the entry anchor. The current React
44
- ancestor's Library image record supplies the Library ID, file ID, version and
45
- originating conversation/message IDs. Non-Library viewers and non-image files
46
- are excluded. No title, filename, image position or minified component name is
47
- used as identity. Missing native anchors fail closed.
48
-
49
- Codex 26.930.21537(2026-10-02 隔离实测):Space 图片详情使用嵌入式视口,Adapter 从其原生 `relative flex h-full min-w-0 flex-1` 容器取得面板承载;浮层分支沿用 presentation 容器。缩放按钮包含隐藏的测量百分比,识别时读取 `innerText`,不读取包含这些测量文字的 `textContent`。
50
-
51
- Prepare the Prompt panel as soon as the native image has both originating conversation
52
- and message IDs and its viewer controls are ready; start source-conversation extraction in
53
- parallel. This is eligibility to look up a prompt, not proof that prompt text exists.
54
- Images without these source IDs have no View prompts entry. Exact generated-asset
55
- validation remains part of extraction, so uploaded references never supply prompt text.
56
-
57
- Opening while extraction is pending shows the complete File info-style header,
58
- a disabled Copy button, and four static rounded skeleton lines in the body.
59
- `aria-busy` marks the body; decorative lines are hidden from assistive technology.
60
- Closing does not cancel prefetch. Success replaces skeletons with selectable text
61
- and enables Copy. Missing generation text falls back to a traceable original request when available:
62
- first disclose that the generation prompt is unavailable, label the body “Original
63
- request”, and enable Copy with the accessible label “Copy original request”. If
64
- neither kind exists, show the unavailable message and leave Copy disabled. Failure ends with
65
- a localized message and Retry action. There is no perpetual loading placeholder.
66
- Changing images or disabling the feature aborts the old request; late results
67
- cannot change the new panel. Skeletons are static and respect reduced-motion.
68
-
69
- The entry is a native-style “View prompts” / “查看提示词” menu item in the image
70
- header's File actions dropdown, immediately before View original chat. There is
71
- no dedicated right-toolbar button. Adapter validates the menu's current Library
72
- file and the original-chat link's conversation/message IDs before inserting.
73
- The item uses the native row classes and existing Prompts glyph; native React
74
- nodes remain intact. It is recreated when the native menu remounts, without
75
- refetching prompt content. Arrow navigation includes the injected item; Enter /
76
- Space activate it. Opening dismisses the native menu, then focuses panel Close.
77
- Panel Close / Escape return focus to the Image dropdown trigger.
78
-
79
- ## Prompt panel
80
-
81
- The panel adopts the native File info accessory-panel branch, inspected in Codex
82
- 26.930.21537 on 2026-10-02. General material rules are maintained in the root
83
- DESIGN.md; this feature uses the following native layout:
84
-
85
- - Right and bottom gutters: two spacing units (8px). Top: `pt-13` plus the
86
- native wrapper's `pt-px` (53px from the viewer viewport top).
87
- - Width: 74 spacing units (296px), constrained to the viewport minus both gutters.
88
- - Header: `flex h-11 shrink-0 items-center justify-between gap-2 py-1 ps-4 pe-2`
89
- (44px); `h2` contains a `text-base font-semibold` title.
90
- - Body: `min-h-0 flex-1 overflow-y-auto px-3 py-4` (12px horizontal,
91
- 16px vertical padding). Prompt paragraph retains `px-1 text-sm leading-5
92
- text-default whitespace-pre-wrap break-words select-text` for long text.
93
- - Header controls use the native File info circular `button-toolbar` filled
94
- ghost branch, with a 28px hit area. The close SVG is cloned from the native viewer.
95
-
96
- Long text scrolls inside the panel, remains selectable, and is rendered with
97
- textContent. The header Copy icon button reuses the existing Images Lucide copy/check glyphs
98
- at 16px, with a 28px hit area and an accessible label/tooltip. It writes only the
99
- generation prompt or original-request body to the clipboard and briefly confirms success. A generation prompt needs no source label; an original-request fallback must
100
- include the missing-generation disclosure and its distinct label. Close and Escape return focus to
101
- the Image dropdown trigger; Escape does not close the underlying viewer on the same press.
102
-
103
- ## Data and lifecycle
104
-
105
- Read the source conversation through the running renderer's native authenticated
106
- API; discover the API export through Library metadata's actual module imports,
107
- without fixed build hashes. Prompt extraction does not copy credentials or signed download URLs. Explicit Favorites/folder actions upload the selected indexed image bytes through native Library; no third-party service receives them.
108
-
109
- Match both the originating message and exact image asset pointer, and require
110
- assistant/tool generation metadata. The Prompt viewer prefers a recorded
111
- generator prompt: the exact asset's `dalle.prompt`, the exact result message's
112
- `async_task_prompt`, or structured `prompt`/single `prompts` arguments from the
113
- nearest image-generation tool call in its ancestor chain. Tool text is parsed as
114
- JSON and never executed. Multi-image tool results do not infer per-image argument
115
- ownership; unrelated tools, older generation calls and other branches are excluded. A traceable original user request is a different fact and is
116
- shown only after an explicit missing-generation disclosure and “Original request” label. Unrelated branches are never used.
117
-
118
- Changing images or leaving the viewer aborts the pending lookup and removes the
119
- old UI. 等缩放工具栏和视口就绪后再开始解析,避免先到的提示词结果把稍后出现的原生锚点短路;同图的缩放节点或承载改变时重新挂载。 Late results cannot mount against a different image. Disabling the feature
120
- removes the observer, keyboard handler, button and panel. Prompt data is retained
121
- only for the current viewer; there is no persistent conversation cache.
122
-
123
- The viewer and retained cloud import utility share `src/domain/library-prompt.mjs`. The source factory serializes that pure rule into the viewer script; the cloud adapter serializes the same function into its evaluator call. The shared resolver distinguishes generation from request provenance; the viewer
124
- preserves that distinction in fallback disclosure and labels. The historical import utility can retain a
125
- traceable request with its distinct provenance. A valid generated image without prompt text can still be imported by the historical utility, while the viewer shows no prompt control.
126
-
127
- ### 本地提示词
128
-
129
- Image Gen 按已索引的精确图片 ID 提取对应 thread 的生成记录。已完成 `image_gen.generation` 的 revisedPrompt 优先于可静态解析的工具请求参数。没有真实生成提示词则明确显示不可用。云端图片保留 generation → 已标明来源的 Original request 回退;已移除没有实测命中的云端 gen_id → 本地文件猜测补充链路。
130
-
131
- 2026-10-02 菜单核对:网格 More 使用原生 Library 的 mediaOverlay 分支,操作通过 leftIcon 传入真实原生图标。菜单按 Chat about this、View prompts、Add to Favorites/Remove from Favorites、Download、Add to folder、Delete 排列。收藏和文件夹使用真实云端 Library 身份;Delete 仅持久隐藏 Image Gen 条目。Chat about this 组合原生模式切换、新 Chat 草稿导航与图片面板链路,不发送消息;图片随消息提交的实际链路未进行发送验收。生成图片通用菜单中的重复查看、新标签、复制和 Finder 不混入图库菜单。Image Gen 不提供 Rename 与 Share。
132
-
133
-
134
- ## Image Gen 多选与隐藏
135
-
136
- Codex 26.930.21537(2026-10-02):卡片通过原生 Card 的 selection、selected、selectionActive 与 onSelect 契约接入;圆形 Checkbox 使用原生 overlay 分支。选中后显示原生边框,支持 Checkbox、选择状态下点击卡片、Shift 区间选择、动作条 Clear selection 与 Escape。查询变化、切换来源、离开页面释放选中状态;分页加载保留已选条目,不污染原生 Your creations/Uploads 的 selection atoms。
137
-
138
- 缩略卡片沿用已核对的 Library 比例边界,宽高比限制在 1/2 至 20/13。卡片与图片比例分开处理:比例范围内按原比例展示;超出范围使用 object-contain 完整缩放并居中,极宽图上下留白,极窄图左右留白,不裁切图片内容。此显示策略按用户截图与验收要求实现,不将 Library 通用 object-cover 分支视为完整的 Images 展示规范。原图详情不改变比例。不能直接用原始极宽/极窄比例承载 Card,避免 More 与右下 Checkbox 重叠或单张卡片过高。
139
-
140
- 动作条复用原生 Button、Dropdown、Menu、图标与 Library 布局分支,固定在底部,dark 材质,包含数量、Start chat、Download、Delete、More→Move 和 Clear selection。Start chat 调用原生 Chat 附件上传和草稿导航,不发送消息;Download 使用原生保存流程逐项处理;Move 在明确点击后登记所选图片并使用原生文件夹选择器,选择本身不上传。权限/忙状态属于当前操作,不伪造云端图片身份。
141
-
142
- Delete 在单张 More 与批量动作条共用一条隐藏流程,复用原生 Dialog、LibraryItemConfirmationContent 和实色警戒确认按钮。确认标题明确限定 Image Gen,正文明确“仅隐藏,本地原图和云端副本保留”。取消不改变任何条目;确认成功后立即移除当前条目、更新选中数、列表总数和分页偏移,并显示原生 toast。隐藏 ID 存于当前 Runtime profile 的 `hidden-image-ids.json`,本地源文件、原始生成提示词及已登记云端身份不修改;刷新和重启后继续隐藏。
143
-
144
-
145
- ## 维护接口(2026-10-02)
146
-
147
- `adapters/codex/native-image-modules.mjs` 拥有构建产物读取、import 引用与组件发现。导航、图库、画布分别连接,画布与 Composer 在用户打开图片时加载;画布契约失效通过操作反馈报告,不移除仍可用的图库。Composer 角色按文件预览实际调用关系解析,不固定压缩变量名。
148
-
149
- `adapters/codex/native-image-source.mjs` 拥有 React 呈现、上下文、原生动作与 UI 生命周期。异步结果进入对话框、收藏状态或原生修改动作前核对挂载实例及账号;成功上传的云端身份仍须登记,不能因页面关闭丢失已完成上传。普通 workflow 只接收/返回 `libraryFileId` 与 `created`,原生文件节点和 MoveDialog entries 由 Adapter 构建。
150
-
151
- `library-prompt-source.mjs` 只序列化显式依赖;`library-prompt-page.mjs` 直接安装本地来源并组合清理,不通过普通语句的文本替换接线。清理为幂等操作,手动卸载与 signal abort 不重复释放。
@@ -1,37 +0,0 @@
1
- # Images · Image Gen 与图片提示词
2
-
3
- Images 在 Codex 原生 **Space → Images** 中增加 **Image Gen**,集中浏览本机 Codex 或本地 Work 生成的图片。
4
-
5
- - Image Gen 位于 Your creations、Uploads 后,图片按生成时间倒序显示,支持搜索和滚动加载。
6
- - 标签、加载骨架、图片排布、悬浮卡片和菜单复用原生组件。
7
- - 点击图片进入原生详情,复用缩放、打开、下载以及可用的 Remove BG、Erase、Resize 编辑入口。
8
- - 本地图库菜单支持 Chat about this、Add to Favorites、Download、Add to folder、Delete 和 View prompts。仅点击收藏/文件夹操作才上传所选图片到原生 Library,浏览不上传;云端收藏和文件夹关系由服务器管理。
9
- - 图片菜单中的 **View prompts / 查看提示词** 打开与原生 File info 一致的右侧面板;加载时显示骨架并禁用复制。
10
- - 本地图片按精确生成记录读取提示词。云端图片优先显示真实生成提示词;只有原始用户请求时,明确告知差异并标注 Original request,再提供复制。
11
- - 切换图片会移除旧提示词;Escape 先关闭提示词面板。
12
-
13
- 索引在当前 Runtime profile 中维护,读取本机生成目录与会话日志,不迁移或删除源文件。原生组件和 API 契约不匹配时保留原生页面;Codex 更新后的可用性需要重新核验。
14
-
15
- ## 开发
16
-
17
- 统一宿主通过 `codex-feature.json` 与 `src/library-prompt-source.mjs` 组装页面脚本。
18
-
19
- - `src/backend/local-image-source.mjs`:本地索引、提示词与云端身份映射/上传预留。
20
- - `src/frontend/cloud-image-actions.mjs`:首次云端登记、去重与收藏工作流;只返回云端身份,不解释原生文件节点。
21
- - `src/adapters/codex/native-image-modules.mjs`:原生构建产物发现,按导航/图库/画布能力分别连接。
22
- - `src/adapters/codex/native-image-source.mjs`:原生呈现、上下文及异步动作归属。其余 Adapter 维护 Library API、图片来源与提示词协议。
23
- - `src/frontend/local-image-source.mjs`:来源选择、搜索、分页和生命周期。
24
- - Runtime Host:鉴权、功能声明校验与转发。
25
-
26
- 视觉与能力边界见 [DESIGN.md](DESIGN.md)。
27
-
28
- ```bash
29
- node --test features/images/test/*.test.mjs
30
- ```
31
-
32
- 独立 `web/` 与旧服务入口保留为已有历史工具,不由当前 manifest 启动;ImageLibrary 与日志索引已由当前本地来源复用。历史图库交接见 [research/images](../../docs/research/images/2026-08-07-gallery-handoff.md)。
33
-
34
- 2026-10-02 菜单核对:网格 More 明确使用原生 Library 的 mediaOverlay 分支,操作通过 leftIcon 传入真实原生图标。图库菜单按 Chat about this、View prompts、Add to Favorites/Remove from Favorites、Download、Add to folder、Delete 排列。Chat about this 组合原生模式切换、新 Chat 草稿导航与图片面板链路,不发送消息;导航与面板已隔离验证,图片随消息提交的实际链路未进行发送验收。生成图片通用菜单中的重复查看、新标签、复制和 Finder 不再混入图库菜单。Add to Favorites/Remove from Favorites 和 Add to folder 已接入原生云端 Library。首次操作上传所选图片,之后复用账号与内容指纹对应的云端身份;收藏与文件夹归属保存在服务器。取消文件夹选择会显示原生 toast,已上传的图片仍留在 Library。上传结果不确定时不盲目重试;Image Gen 不提供分享与重命名;Delete 的隐藏范围见下文。
35
-
36
-
37
- Image Gen 支持原生圆形多选框、Shift 区间选择和底部动作条。Delete 会先二次确认,仅从 Image Gen 隐藏;本地原图和云端副本保留。隐藏状态由 MineCodex 当前 Runtime profile 持久维护,确认后立即生效,刷新/重启不再显示。缩略卡片沿用 Library 的 1:2 至 20:13 比例范围;极宽和极窄图片在卡片内完整缩放、居中留白,不裁切内容。
@@ -1,36 +0,0 @@
1
- # Design System: Codex Model Slider
2
-
3
- 通用视觉、材质、按钮、Tooltip 与原生 sidebar 层级遵循根 [DESIGN.md](../../DESIGN.md)。本文件只记录功能特有组件、布局、数据语义与通用组件选型。
4
-
5
- ## 1. Visual Theme & Atmosphere
6
-
7
- Model Slider 延续 Codex 原生的克制、紧凑和功能优先。增强层只改善模型识别与选择效率,不创建独立视觉语言。
8
-
9
- ## 2. Color Palette & Roles
10
-
11
- - **Reasoning Accent Blue** (`var(--color-chart-blue)`): Slider 打开时的普通推理强度,沿用 Codex 原生 active effort 语义。
12
- - **Maximum Effort Purple** (`var(--color-chart-purple)`): 仅用于 Ultra 推理强度及其相关状态。
13
-
14
- 模型名为主要内容,Provider 为辅助信息;通用文字与交互角色遵循根规范。
15
-
16
- ## 3. Typography Rules
17
-
18
- Composer 触发器区分两种状态:占位态("Select model" / "Select effort")沿用原生 160px Content 宽度;真实模型态让芯片 HUG 完整模型名,长名称不被截断,reasoning effort 始终完整可见。Slider 顶部的模型名最多显示两行。
19
-
20
- ## 4. Component Stylings
21
-
22
- - **Composer Trigger:** 占位态恢复原生 160px Content 宽度;真实模型态 HUG 完整名称,头部保留原生可点击 chevron。
23
- - **Slider Header:** 模型名最多两行,容器高度随内容自然撑开;effort 与 chevron 不收缩。无 Fast 时移除原生 12px 预留占位,让按钮与面板严格居中。
24
- - **Model List:** 保持 264px 原生宽度、Provider 副文本、收藏与最多六项可视高度;收藏与未收藏之间保留分隔线,弹窗内容四周保留约 6px 内边距;模型弹窗与原生 Slider 一致地水平居中于触发器。列表打开期间,Composer 占位文案从 `Select effort` 切为原生语义 `Select model`,关闭后恢复。
25
- - 模型列表使用共享 Dropdown 的 `opaque` 分支:不透明主题填充、无背景模糊,保留 Dropdown 圆角、边缘和阴影,避免后方聊天文字透入列表。此选择仅适用于模型列表。
26
- - Slider 与模型列表切换沿用 Codex 26.930.21537 的动效节奏:底边锚定,高度 320ms(`cubic-bezier(.19,1,.22,1)`);列表内容 200ms 淡变与 10px 位移(`cubic-bezier(.23,1,.32,1)`),进入延迟 40ms。返回时收缩并淡出,Escape 先返回 Slider;减少动态效果时立即切换。切换与卸载会取消旧动画和清理定时器,不改原生 React 节点。
27
- - OCX 自动发现的 GPT 路由若与原生模型同名且没有独立推理档位,列表只显示原生项;当前已选中的路由仍显示,避免失去切换入口。有独立档位的 Provider 路由继续显示并标注 Provider。
28
- - Slider 预览档位时同步 effort 标签与 Fast 控件的 Ultra 状态;离开 Ultra 后立即恢复普通档位颜色。
29
-
30
- ## 5. Layout Principles
31
-
32
- 宽度遵循原生菜单,垂直方向允许内容自然增长。长名称优先换行而不是扩大面板;Composer 的紧凑触发器优先保留 effort 可读性。
33
-
34
- ## 代码归属
35
-
36
- 模型身份、品牌与别名、目录匹配、路由去重及档位交集由 `src/domain/model-rules.mjs` 维护,不读取 DOM 或收藏存储。`src/frontend/install.mjs` 维护原生控制器适配、收藏存储、菜单、滑条与节点恢复,使用共享 Dropdown 材质。`src/injection-source.mjs` 将两者组装为自包含 Renderer 安装函数;宿主只提供配置、locale、共享 UI、图标工厂与刷新调度,调用 ensure/dispose。
@@ -1,45 +0,0 @@
1
- # CodexModelSlider
2
-
3
- Codex Composer 原生模型选择器的轻量增强功能。它通过同级
4
- `CodexRuntimeHost` 注册,不启动 HTTP 服务,也不修改 Codex 模型目录。
5
-
6
- 功能范围:
7
-
8
- - Codex 普通任务与 Work 沿用原生面板布局:上方思考强度、下方模型名,点击进入模型菜单;
9
- - 为第三方模型显示厂商图标、格式化模型名和 Provider 副文本;
10
- - 收藏常用 `provider/model`,保持原目录顺序;
11
- - 较长的模型列表保持紧凑、可滚动;
12
- - 所有模型共用 Slider,动态读取模型支持的思考档位;
13
- - 同时兼容旧版 reasoning 回调与新版 power selection 控制器契约;
14
- - 沿用原生面板的间距、重置入口;仅实际支持 Fast 时显示闪电按钮;
15
- - Chat/Temporary Chat 完全使用原生模型选择器,不注入增强面板或拦截模型菜单。
16
-
17
- ## 验证
18
-
19
- ```bash
20
- npm test
21
- ```
22
-
23
- 真实 UI 仅在隔离 profile 中验证。先显式启动独立 Codex 实例:
24
-
25
- ```bash
26
- open -na /Applications/ChatGPT.app --args \
27
- --user-data-dir="$HOME/.codex-model-slider/codex-profile" \
28
- --remote-debugging-address=127.0.0.1 \
29
- --remote-debugging-port=9233 \
30
- --remote-allow-origins=http://127.0.0.1:9233 \
31
- --no-first-run
32
- ```
33
-
34
- 再启动只加载 Model Slider 的 RuntimeHost:
35
-
36
- ```bash
37
- CODEX_FEATURES_ROOT="$PWD/features" \
38
- MINECODEX_ENABLED_FEATURES=model-slider \
39
- CODEX_RUNTIME_PROFILE_DIR="$HOME/.codex-model-slider/codex-profile" \
40
- CODEX_RUNTIME_CDP_PORT=9233 \
41
- node packages/runtime-host/src/main.mjs
42
- ```
43
-
44
- 这是非官方 CDP / DOM Adapter 的功能声明。Codex 私有 DOM 的适配实现统一留在
45
- `CodexRuntimeHost`。