dsh-oh-my-terminal 0.2.7 → 0.3.0

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/CLAUDE.md CHANGED
@@ -65,6 +65,9 @@ src/
65
65
  │ ├── dropdown.tsx # +号旁下拉菜单组件(新建/拆分/按种类新建)
66
66
  │ ├── side-list.tsx # 右侧终端列表面板(树形前缀 + 右键重命名 + useMemo 缓存)
67
67
  │ ├── shortcut-bridge.ts # shortcuts 服务接入信号桥(命令注册状态 + 面板切换回调,软探测兼容旧宿主)
68
+ │ ├── compat.ts # DSH-better-sidebar 兼容模式检测(软探测 ctx.betterSidebar + 服务最小接口声明)
69
+ │ ├── sidebar-tab.tsx # 侧边栏终端 tab 组件(兼容模式:嵌入 DSH-better-sidebar 底部工作台,不绑定 DSH sessionId)
70
+ │ ├── terminal-render.tsx # 终端组渲染共享函数(renderTerminalGroups + findProfile + findActiveInstance/Group,独立模式与兼容模式共用)
68
71
  │ ├── terminal/
69
72
  │ │ ├── reducer.ts # 终端状态 reducer(terminalReducer 纯函数 + createInitialState)
70
73
  │ │ ├── use-terminal-state.ts # 终端状态管理 Hook(useTerminalState:useReducer 封装 + 启动恢复)
@@ -74,7 +77,9 @@ src/
74
77
  │ │ ├── types.ts # 设置页面类型定义(SettingsPageProps、ConfigWithProfiles)
75
78
  │ │ ├── store.ts # 设置页面状态管理(useSettingsState Hook)
76
79
  │ │ ├── card.tsx # 设置卡片组件(SettingsCard)
77
- │ │ ├── profile-table.tsx # 终端配置表格组件(TerminalProfile[] CRUD UI:inline 编辑/新增/删除/origin 约束)
80
+ │ │ ├── profile-table.tsx # 终端配置表格容器组件(ProfileTable:表头 + 行列表 + 新增表单入口)
81
+ │ │ ├── profile-row.tsx # 终端配置表格行组件(ProfileRow:inline 编辑 name/path + 删除按钮)
82
+ │ │ ├── profile-add-form.tsx # 新增终端配置表单组件(AddProfileForm:type/name/path 输入 + 添加/取消)
78
83
  │ │ ├── api.ts # Settings Bridge HTTP 客户端(封装与宿主半 Settings Bridge 的 HTTP 交互)
79
84
  │ │ └── styles.ts # 配置表单样式模块(injectSettingsStyles + CSS 自定义属性主题自适应)
80
85
  │ ├── icons.tsx # SVG 图标组件集合(10 个纯函数)
@@ -117,16 +122,22 @@ src/
117
122
  client.tsx → client/types.ts, client/icons.tsx, client/clipboard.ts,
118
123
  client/dropdown.tsx, client/side-list.tsx, client/hooks.ts,
119
124
  client/styles.ts, client/term-pane.tsx, client/settings/,
120
- client/shortcut-bridge.ts, logger.ts
125
+ client/shortcut-bridge.ts, client/compat.ts, client/sidebar-tab.tsx,
126
+ logger.ts
121
127
  client/hooks.ts → client/terminal/*(re-export 兼容壳:reducer/use-terminal-state/use-panel-geometry/use-tabs)
122
128
  client/shortcut-bridge.ts → client/types.ts, constants.ts, logger.ts
129
+ client/compat.ts → logger.ts(软探测 ctx.betterSidebar,声明服务最小接口)
130
+ client/sidebar-tab.tsx → client/hooks.ts, client/term-pane.tsx, client/dropdown.tsx,
131
+ client/side-list.tsx, client/icons.tsx, client/compat.ts, logger.ts
123
132
  client/terminal/reducer.ts → client/types.ts, logger.ts
124
133
  client/terminal/use-terminal-state.ts → client/terminal/reducer.ts, client/types.ts, logger.ts
125
134
  client/terminal/use-panel-geometry.ts → client/types.ts, constants.ts, logger.ts
126
135
  client/terminal/use-tabs.ts → client/types.ts, shortcut.ts, client/shortcut-bridge.ts, constants.ts, logger.ts
127
136
  client/settings/card.tsx → client/settings/types.ts, client/settings/api.ts, client/settings/store.ts, client/settings/profile-table.tsx, client/icons.tsx
128
137
  client/settings/store.ts → client/settings/types.ts
129
- client/settings/profile-table.tsx → client/settings/types.ts, client/settings/api.ts
138
+ client/settings/profile-table.tsx → client/settings/types.ts, client/settings/api.ts, client/settings/profile-row.tsx, client/settings/profile-add-form.tsx
139
+ client/settings/profile-row.tsx → client/settings/types.ts
140
+ client/settings/profile-add-form.tsx → client/settings/types.ts
130
141
  client/settings/api.ts → client/settings/types.ts
131
142
  client/dropdown.tsx → client/types.ts, client/icons.tsx
132
143
  client/side-list.tsx → client/types.ts, client/icons.tsx
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # dsh-oh-my-terminal
2
2
 
3
- [![version](https://img.shields.io/badge/version-0.2.7-blue)](package.json)
3
+ [![version](https://img.shields.io/badge/version-0.3.0-blue)](package.json)
4
4
  [![license](https://img.shields.io/badge/license-Apache--2.0-green)](LICENSE)
5
5
  [![node](https://img.shields.io/badge/node-%5E20.19.0%20%7C%7C%20%3E%3D22.0.0-brightgreen)](package.json)
6
6
 
@@ -18,6 +18,7 @@ A bottom terminal panel plugin for DSH Web GUI. Powered by `@lydell/node-pty`, i
18
18
  - **Cross-platform**: Windows ConPTY and POSIX openpty are selected automatically by `@lydell/node-pty`; pre-compiled binaries ship with the package, nothing to compile
19
19
  - **Profile-driven terminals**: a configurable terminal profile table (type / name / path) drives new-terminal creation; profiles are auto-detected at startup and can be added, renamed, and edited in the settings UI
20
20
  - **Configurable fonts**: font family, size, and line height are adjustable and hot-reload on open terminals
21
+ - **DSH-better-sidebar compatibility**: auto-detects [DSH-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar) at runtime and switches to compat mode — registers a "Terminal" tab in its bottom workbench instead of the standalone dock; PTY sessions are not bound to the DSH session write handle, eliminating conflicts with DSH-better-sidebar's own terminal. When the host supports `TabDescriptor.rightActions` (v0.25.0+), the terminal's action buttons (new / split / restart) are injected into the tab strip's right end, VSCode-style; otherwise it falls back to a header row inside the tab content area
21
22
 
22
23
  ## Installation
23
24
 
@@ -96,6 +97,8 @@ src/
96
97
  │ ├── icons.tsx # SVG icon components
97
98
  │ ├── clipboard.ts # Clipboard utility functions
98
99
  │ ├── shortcut-bridge.ts # Shortcuts service integration (command registration + toggle bridge)
100
+ │ ├── compat.ts # DSH-better-sidebar compat mode detection (soft-probe ctx.betterSidebar + service interface)
101
+ │ ├── sidebar-tab.tsx # Sidebar terminal tab (compat mode: embed in DSH-better-sidebar bottom workbench, no DSH session binding)
99
102
  │ ├── settings/ # Settings UI (types / store / card / profile-table / api / styles)
100
103
  │ └── terminal/ # Terminal tab state (use-tabs / reducer / use-terminal-state / geometry)
101
104
  ├── persistence.ts # Session persistence (log storage, metadata, startup restore)
package/README.zh.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # dsh-oh-my-terminal
2
2
 
3
- [![version](https://img.shields.io/badge/version-0.2.7-blue)](package.json)
3
+ [![version](https://img.shields.io/badge/version-0.3.0-blue)](package.json)
4
4
  [![license](https://img.shields.io/badge/license-Apache--2.0-green)](LICENSE)
5
5
  [![node](https://img.shields.io/badge/node-%5E20.19.0%20%7C%7C%20%3E%3D22.0.0-brightgreen)](package.json)
6
6
 
@@ -16,6 +16,7 @@ DSH Web GUI 的底部终端面板插件,基于 `@lydell/node-pty` 提供多终
16
16
  - **跨平台**:Windows ConPTY / POSIX openpty,由 `@lydell/node-pty` 自动选择,二进制随 tarball 分发,安装即用
17
17
  - **配置表驱动终端**:终端配置表(type / name / path)驱动新建终端;启动时自动探测 $PATH 中的终端,可在设置界面新增、改名、编辑路径
18
18
  - **字体可配置**:字体族、字号、行高可配置,配置变更对已打开终端即时生效
19
+ - **DSH-better-sidebar 兼容**:运行时自动检测 [DSH-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar),检测到时切换为兼容模式——通过 `ctx.betterSidebar.registerTab()` 注册"终端"tab 嵌入其底部工作台,替代独立底部面板;PTY 会话不绑定 DSH session 的 write handle,从根源消除与 DSH-better-sidebar 自带终端的冲突。当宿主支持 `TabDescriptor.rightActions`(v0.25.0+)时,终端操作按钮(新建 / 拆分 / 重启)注入 tab 标签条右端,VSCode 风格单层栏;不支持时回退为 tab 内容区顶部头部栏(两层显示)
19
20
 
20
21
  ## 安装
21
22
 
@@ -94,6 +95,8 @@ src/
94
95
  │ ├── icons.tsx # SVG 图标组件
95
96
  │ ├── clipboard.ts # 剪贴板工具函数
96
97
  │ ├── shortcut-bridge.ts # shortcuts 服务接入桥(命令注册 + 面板切换回调)
98
+ │ ├── compat.ts # DSH-better-sidebar 兼容模式检测(软探测 ctx.betterSidebar + 服务最小接口声明)
99
+ │ ├── sidebar-tab.tsx # 侧边栏终端 tab 组件(兼容模式:嵌入 DSH-better-sidebar 底部工作台,不绑定 DSH sessionId)
97
100
  │ ├── settings/ # 设置界面(types / store / card / profile-table / api / styles)
98
101
  │ └── terminal/ # 终端标签页状态(use-tabs / reducer / use-terminal-state / geometry)
99
102
  ├── persistence.ts # 会话持久化层(日志落盘 / 元数据 / 启动恢复)
@@ -48,6 +48,8 @@
48
48
  3. merge 后立即删除本地特性分支
49
49
  4. 特性分支**不直接 merge 到 master**
50
50
  5. 特性分支之间**不互相 merge**——如有依赖,先合并上游分支到 develop,再从 develop rebase
51
+ 6. **所有日常操作从 `develop` 分支发起**——创建特性分支、pull 最新代码、日常提交均在 `develop` 或特性分支上进行,**不要在 `master` 上直接创建分支或提交**
52
+ 7. develop 合并到 master 后,**立即切回 `develop` 分支**继续工作,不要停留在 `master` 分支上
51
53
 
52
54
  ### 1.3 AI Agent 分支约定
53
55
 
@@ -70,6 +72,7 @@ develop (稳定) ──merge──→ master ──tag──→ v0.x.y
70
72
  3. 如需版本号变更,在 master 上修改 `package.json` 并提交
71
73
  4. `git tag -a v0.x.y -m "v0.x.y: <发布摘要>"`
72
74
  5. push master 和 tag
75
+ 6. **发布完成后立即 `git checkout develop` 回到日常开发分支**——master 仅用于发布合并,不要在 master 上停留或创建特性分支
73
76
 
74
77
  ---
75
78
 
@@ -193,7 +196,7 @@ AI agent 在本仓库执行代码变更时,按以下清单自检:
193
196
  ### 开始前
194
197
 
195
198
  - [ ] 确认当前在正确的特性分支上(不在 master/develop 上直接改)
196
- - [ ] 确认特性分支从 develop 最新 HEAD 创建
199
+ - [ ] 确认特性分支从 develop 最新 HEAD 创建(不从 master 建分支)
197
200
  - [ ] 确认 Lead 分配的写作用户与其他 agent 不重叠
198
201
 
199
202
  ### 工作中
@@ -218,6 +221,8 @@ AI agent 在本仓库执行代码变更时,按以下清单自检:
218
221
  | 禁止操作 | 原因 |
219
222
  |---------|------|
220
223
  | 直接在 master/develop 上 commit | 所有改动必须经特性分支 |
224
+ | 从 master 创建特性分支 | 特性分支只能从 develop 创建;master 仅用于发布合并 |
225
+ | merge 到 master 后停留在 master 分支 | 发布完成后应立即切回 develop 继续开发 |
221
226
  | master → develop 的 merge | 破坏单向合并规则,产生混乱历史 |
222
227
  | 特性分支之间互相 merge | 应通过 develop 中转 |
223
228
  | force push 已推送的分支 | 除非 Lead 明确要求重写历史 |