dsh-session-actively 0.0.0-stage → 1.0.1
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/LICENSE +21 -0
- package/README.md +81 -2
- package/README_zh.md +82 -0
- package/assets/icon-180.png +0 -0
- package/assets/screenshot-1.png +0 -0
- package/client.js +527 -0
- package/cordis.patch.yml +3 -0
- package/docs/DETAIL.md +1 -0
- package/docs/DETAIL.zh.md +1 -0
- package/docs/preview.svg +29 -0
- package/icon.svg +6 -0
- package/index.js +11 -0
- package/locale/en.json +35 -0
- package/locale/zh.json +35 -0
- package/package.json +55 -4
- package/screenshots.json +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 RabbitWaKuWaKu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,82 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Session activity
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A left-sidebar page for **DeepSeek Harness (DSH)**: running sessions on top, every other session ordered by its last activity below, each with its last-active time. Click a row to switch to that session.
|
|
4
|
+
|
|
5
|
+
English | [Chinese](README_zh.md)
|
|
6
|
+
|
|
7
|
+
## Screenshot
|
|
8
|
+
|
|
9
|
+
<img src="assets/screenshot-1.png" width="900" alt="The Session activity page: running sessions on top, other sessions ordered by last activity below, and the sidebar entry highlighted.">
|
|
10
|
+
|
|
11
|
+
## What it does
|
|
12
|
+
|
|
13
|
+
- **Running first.** Sessions with an active turn appear in the top section, newest activity first, with a live status pill and their last-active time.
|
|
14
|
+
- **Recently active below.** Every other session follows, sorted by `updatedAt` (newest first), with its last-active time. The first 20 show by default; **Show all N** expands the rest and **Show less** collapses it again.
|
|
15
|
+
- **One click to switch.** Clicking a row opens that session through the app's own navigation (`ctx.uiWorkspace.openSession`).
|
|
16
|
+
- **Live, no polling loop.** Both lists follow the existing Client session snapshot; the only timer is a 30-second tick that keeps relative times ("3 min ago") truthful.
|
|
17
|
+
- **Clean lists.** Draft sessions (never sent a message) and archived sessions stay out, matching the sidebar's own session navigation.
|
|
18
|
+
- **Bilingual UI.** English and Simplified Chinese dictionaries; follows the app locale.
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
**From the app (Desktop, recommended):** open **Plugins → Add plugin**, enter `dsh-session-actively`, and install. Then enable **Session activity** in the plugin list if it is not enabled automatically.
|
|
23
|
+
|
|
24
|
+
**From npm (Web and CLI):**
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
dsh plugin --profile web add dsh-session-actively
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Use the profile that serves your DSH GUI (`web` for a plain web profile). The Desktop app manages its own `desktop` profile, so install there with the in-app **Add plugin** button instead of `dsh plugin`.
|
|
31
|
+
|
|
32
|
+
**From dsh-market:** open **Plugins → Discover**, search for *Session activity*, and click Install.
|
|
33
|
+
|
|
34
|
+
The package ships prebuilt client code, so no build step runs on install.
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
After enabling, the left sidebar gets an entry **Recently active** (a list glyph with a green live dot).
|
|
39
|
+
|
|
40
|
+
- Top section **Running**: sessions currently running a turn.
|
|
41
|
+
- Bottom section **Recently active**: everything else, newest activity first.
|
|
42
|
+
- Click any row to switch to that session; the app navigates to it as if you picked it in the sidebar.
|
|
43
|
+
- When more than 20 sessions are in the recent list, use **Show all N** below it.
|
|
44
|
+
|
|
45
|
+
## Data and privacy
|
|
46
|
+
|
|
47
|
+
| What is shown | Where it comes from |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| Session list, title, running state, last activity | `ctx.sessions.list` — the Host-pushed Client snapshot |
|
|
50
|
+
| Workspace name | `ctx.workspaces.list` (`sessionIds` membership), falling back to the `cwd` folder name |
|
|
51
|
+
| Switching sessions | `ctx.uiWorkspace.openSession(sessionId)` — DSH's own navigation |
|
|
52
|
+
|
|
53
|
+
The plugin adds no Host service, projection, RPC, tool, network request, or storage. It never sends session data anywhere. Turning the bundle off removes both the sidebar entry and the page; the layout falls back to the Conversation view.
|
|
54
|
+
|
|
55
|
+
## Security
|
|
56
|
+
|
|
57
|
+
This is a client-only bundle with no Host half. It reads the two Client snapshots above and calls the app's own `openSession`; it makes no network requests, reads no files, runs no shell commands, and stores nothing. A static capability scan therefore reports no shell, file, network, credential, environment, or host-runtime capability, which is the expected result for a UI-only plugin.
|
|
58
|
+
|
|
59
|
+
## Compatibility
|
|
60
|
+
|
|
61
|
+
- Built and tested against **DSH 0.2.2-rc.5** (Web/Desktop client). Targets DSH 0.2.x.
|
|
62
|
+
- Node.js **>= 22**.
|
|
63
|
+
- Client-only bundle: no host dependencies, no peer `@deepseek-ai/*` packages.
|
|
64
|
+
|
|
65
|
+
## Limitations
|
|
66
|
+
|
|
67
|
+
- "Running" means the session has an active agent turn, as DSH reports it — not merely that a chat window is open.
|
|
68
|
+
- The recent list is capped at 20 rows until you press **Show all**; the list itself still holds every non-archived session.
|
|
69
|
+
- Draft sessions and archived sessions are intentionally hidden.
|
|
70
|
+
- The page reads the live Client snapshot only; nothing is persisted, so a fresh install starts from the current session list.
|
|
71
|
+
|
|
72
|
+
## Development
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
npm run check # validates locale key parity, manifest files and client registration
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The client half is plain browser code loaded through DSH's `window.__ModuleLoader__`; it requires no bundler. A local directory can be linked into a profile for development, and the Client module system reloads an edited `client.js` through DSH's HMR transport.
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
[MIT](LICENSE) © 2026 RabbitWaKuWaKu
|
package/README_zh.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# 会话活跃度
|
|
2
|
+
|
|
3
|
+
一个给 **DeepSeek Harness (DSH)** 用的左侧栏页面:上方列出正在运行的会话,下方按最近活跃时间排列其他会话,并显示最近活跃时间;点击任意一行即可切换。
|
|
4
|
+
|
|
5
|
+
[English](README.md) | 中文
|
|
6
|
+
|
|
7
|
+
## 截图
|
|
8
|
+
|
|
9
|
+
<img src="assets/screenshot-1.png" width="900" alt="会话活跃度页面:上方是运行中的会话,下方按最近活跃时间排列其他会话,左侧栏入口高亮。">
|
|
10
|
+
|
|
11
|
+
## 它会做什么
|
|
12
|
+
|
|
13
|
+
- **运行中优先**:有活跃轮次的会话排在上方,按最近活动排序,带运行状态胶囊和最近活跃时间。
|
|
14
|
+
- **下方是最近活跃**:其余会话按 `updatedAt` 从新到旧排列,并显示最近活跃时间。默认显示 20 条;点 **显示全部 N 个** 展开其余,点 **收起** 恢复。
|
|
15
|
+
- **点击即切换**:点击任意一行,通过应用自身的导航(`ctx.uiWorkspace.openSession`)打开该会话。
|
|
16
|
+
- **实时、无轮询循环**:两个列表都跟随现有的客户端会话快照;唯一的计时器是 30 秒一次的刷新,用来保持「3 分钟前」这类相对时间准确。
|
|
17
|
+
- **列表干净**:草稿会话(从未发过消息)和已归档会话不会出现,与侧边栏自身的会话导航一致。
|
|
18
|
+
- **中英双语界面**:提供英文和简体中文字典,跟随应用语言。
|
|
19
|
+
|
|
20
|
+
## 安装
|
|
21
|
+
|
|
22
|
+
**应用内安装(Desktop,推荐):** 打开 **插件 → 添加插件**,输入 `dsh-session-actively` 安装;如果没有自动启用,在插件列表里启用 **会话活跃度**。
|
|
23
|
+
|
|
24
|
+
**从 npm 安装(Web 与 CLI):**
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
dsh plugin --profile web add dsh-session-actively
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`<profile>` 用实际为 DSH 界面提供服务的 profile(普通 Web 版是 `web`)。Desktop 版由应用管理自己的 `desktop` profile,请改用应用内的 **添加插件** 按钮,不要用 `dsh plugin`。
|
|
31
|
+
|
|
32
|
+
**从 dsh-market 安装:** 打开 **插件 → 发现**,搜索 *会话活跃度* 或 `dsh-session-actively`,点安装。
|
|
33
|
+
|
|
34
|
+
包内已经包含预构建的客户端代码,安装时不需要执行构建。
|
|
35
|
+
|
|
36
|
+
## 使用
|
|
37
|
+
|
|
38
|
+
启用后,左侧栏会出现 **最近活跃的会话** 入口(一个带绿色圆点的列表图标)。
|
|
39
|
+
|
|
40
|
+
- 上方 **运行中**:当前正在跑一轮任务的会话。
|
|
41
|
+
- 下方 **最近活跃**:其余会话,按最近活跃时间从新到旧。
|
|
42
|
+
- 点击任意一行即可切换;应用会像你在侧边栏里选中它一样导航过去。
|
|
43
|
+
- 最近活跃超过 20 条时,列表下方会出现 **显示全部 N 个**。
|
|
44
|
+
|
|
45
|
+
## 数据与隐私
|
|
46
|
+
|
|
47
|
+
| 展示内容 | 来源 |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| 会话列表、标题、运行状态、最近活动 | `ctx.sessions.list`,Host 推送的客户端快照 |
|
|
50
|
+
| 工作区名称 | `ctx.workspaces.list`(按 `sessionIds` 归属反查),查不到时回退为 `cwd` 目录名 |
|
|
51
|
+
| 切换会话 | `ctx.uiWorkspace.openSession(sessionId)`,DSH 自身的导航 |
|
|
52
|
+
|
|
53
|
+
插件不新增 Host 服务、projection、RPC、工具、网络请求或存储,也不会把会话数据发到任何地方。禁用插件后,侧边栏入口和页面都会移除,布局回落到会话视图。
|
|
54
|
+
|
|
55
|
+
## 安全说明
|
|
56
|
+
|
|
57
|
+
这是一个纯客户端 bundle,没有 Host 端代码。它只读取上面两个客户端快照,并调用应用自身的 `openSession`;不联网、不读写文件、不执行命令、不保存任何数据。因此静态能力扫描不会报出 shell、文件、网络、凭据、环境变量或宿主运行时能力,这对纯 UI 插件是预期结果。
|
|
58
|
+
|
|
59
|
+
## 兼容性
|
|
60
|
+
|
|
61
|
+
- 在 **DSH 0.2.2-rc.5**(Web/Desktop 客户端)上构建和测试,面向 DSH 0.2.x。
|
|
62
|
+
- Node.js **>= 22**。
|
|
63
|
+
- 纯客户端 bundle:没有 Host 依赖,也没有 `@deepseek-ai/*` peer 依赖。
|
|
64
|
+
|
|
65
|
+
## 限制
|
|
66
|
+
|
|
67
|
+
- 「运行中」指会话当前有活跃的 agent 轮次,由 DSH 上报,而不是聊天窗口开着。
|
|
68
|
+
- 最近活跃默认只显示 20 行,点 **显示全部** 才会展开其余;列表本身仍包含所有未归档会话。
|
|
69
|
+
- 草稿会话和已归档会话会被有意隐藏。
|
|
70
|
+
- 页面只读实时客户端快照,不做持久化,所以新装后从当前会话列表开始。
|
|
71
|
+
|
|
72
|
+
## 开发
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
npm run check # 校验中英文字典键集、清单文件与客户端注册
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
客户端部分是普通浏览器代码,通过 DSH 的 `window.__ModuleLoader__` 加载,不需要打包器。本地目录可以 link 进 profile 开发;客户端模块系统会通过 DSH 的 HMR 传输自动重载修改后的 `client.js`。
|
|
79
|
+
|
|
80
|
+
## 许可证
|
|
81
|
+
|
|
82
|
+
[MIT](LICENSE) © 2026 RabbitWaKuWaKu
|
|
Binary file
|
|
Binary file
|
package/client.js
ADDED
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client half of the recently-active sessions panel.
|
|
3
|
+
*
|
|
4
|
+
* One surface: a left-sidebar entry ("最近活跃的会话") whose main panel shows the
|
|
5
|
+
* Sessions this DSH is running right now on top, and every other Session below
|
|
6
|
+
* ordered by its last activity, each row carrying its last-active time.
|
|
7
|
+
* Clicking a row opens that Session. Everything is read from the existing
|
|
8
|
+
* Client controllers (`ctx.sessions.list`, `ctx.workspaces.list`) as snapshot
|
|
9
|
+
* stores, so both lists follow session state pushes without polling, without a
|
|
10
|
+
* host projection and without any new data source. The only timer is a 30 s
|
|
11
|
+
* relative-time tick that re-renders "3 minutes ago" wording; it is created on
|
|
12
|
+
* mount and cleared on unmount.
|
|
13
|
+
*/
|
|
14
|
+
window.__ModuleLoader__.load({
|
|
15
|
+
id: 'dsh-session-actively',
|
|
16
|
+
factory(require) {
|
|
17
|
+
const React = require('react')
|
|
18
|
+
const h = React.createElement
|
|
19
|
+
const { useCallback, useEffect, useMemo, useState } = React
|
|
20
|
+
|
|
21
|
+
/** Locale namespace owned by this package (sidebars resolve labels from it). */
|
|
22
|
+
const NS = 'dsh-session-actively'
|
|
23
|
+
/** Sidebar list id; the same value is the `main` slot key it opens. */
|
|
24
|
+
const PANEL_ID = 'dsh-session-actively'
|
|
25
|
+
const ROOT_CLASS = 'dsh-session-actively'
|
|
26
|
+
const TICK_MS = 30_000
|
|
27
|
+
/** The running list is never capped; this caps only the "recent" list. */
|
|
28
|
+
const RECENT_LIMIT = 20
|
|
29
|
+
|
|
30
|
+
const inject = ['slots', 'locale', 'sessions', 'workspaces', 'uiWorkspace']
|
|
31
|
+
|
|
32
|
+
const cls = (name) => ROOT_CLASS + '__' + name
|
|
33
|
+
|
|
34
|
+
/* ------------------------------------------------------------------ */
|
|
35
|
+
/* Text */
|
|
36
|
+
/* ------------------------------------------------------------------ */
|
|
37
|
+
|
|
38
|
+
/*
|
|
39
|
+
* Dictionaries are inlined instead of requiring './locale/*.json': the
|
|
40
|
+
* Client module loader resolves specifiers from the platform module table,
|
|
41
|
+
* not from this package's own files. The JSON copies exist so the plugin
|
|
42
|
+
* detail page can read meta.title / meta.description.
|
|
43
|
+
*/
|
|
44
|
+
const zh = {
|
|
45
|
+
'panel': '最近活跃的会话',
|
|
46
|
+
'page.title': '最近活跃的会话',
|
|
47
|
+
'page.description': '上方实时列出正在运行的会话,下方按最近活跃时间排列其他会话;点击任意一行即可切换。',
|
|
48
|
+
'list.summary': '{running} 个运行中 · {recent} 个最近活跃',
|
|
49
|
+
'list.running': '运行中',
|
|
50
|
+
'list.recent': '最近活跃',
|
|
51
|
+
'list.runningCount': '{count} 个',
|
|
52
|
+
'list.recentCount': '{count} 个',
|
|
53
|
+
'list.recentMore': '显示全部 {count} 个',
|
|
54
|
+
'list.recentLess': '收起',
|
|
55
|
+
'list.runningEmpty': '当前没有运行中的会话',
|
|
56
|
+
'list.recentEmpty': '还没有最近活跃的会话',
|
|
57
|
+
'list.empty': '还没有会话记录',
|
|
58
|
+
'list.emptyHint': '开始一个会话后,它会按最近活跃时间出现在这里,无需手动刷新。',
|
|
59
|
+
'list.pending': '正在加载会话列表…',
|
|
60
|
+
'list.pendingHint': '首次连接会话数据时可能需要几秒钟。',
|
|
61
|
+
'list.column.session': '会话',
|
|
62
|
+
'list.column.workspace': '工作区',
|
|
63
|
+
'list.column.status': '状态',
|
|
64
|
+
'list.column.activity': '最近活跃',
|
|
65
|
+
'row.open': '切换到会话:{title}',
|
|
66
|
+
'status.running': '运行中',
|
|
67
|
+
'workspace.none': '未归入工作区',
|
|
68
|
+
'time.justNow': '刚刚',
|
|
69
|
+
'time.minutes': '{count} 分钟前',
|
|
70
|
+
'time.hours': '{count} 小时前',
|
|
71
|
+
'time.days': '{count} 天前',
|
|
72
|
+
'time.unknown': '—',
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const en = {
|
|
76
|
+
'panel': 'Recently active',
|
|
77
|
+
'page.title': 'Recently active sessions',
|
|
78
|
+
'page.description': 'Sessions running right now are listed on top; every other session follows, newest activity first. Click any row to switch.',
|
|
79
|
+
'list.summary': '{running} running · {recent} recent',
|
|
80
|
+
'list.running': 'Running',
|
|
81
|
+
'list.recent': 'Recently active',
|
|
82
|
+
'list.runningCount': '{count}',
|
|
83
|
+
'list.recentCount': '{count}',
|
|
84
|
+
'list.recentMore': 'Show all {count}',
|
|
85
|
+
'list.recentLess': 'Show less',
|
|
86
|
+
'list.runningEmpty': 'No session is running right now',
|
|
87
|
+
'list.recentEmpty': 'No other session yet',
|
|
88
|
+
'list.empty': 'No sessions yet',
|
|
89
|
+
'list.emptyHint': 'Once you start a session it appears here, newest activity first; nothing to refresh by hand.',
|
|
90
|
+
'list.pending': 'Loading sessions…',
|
|
91
|
+
'list.pendingHint': 'The first connection to session data can take a few seconds.',
|
|
92
|
+
'list.column.session': 'Session',
|
|
93
|
+
'list.column.workspace': 'Workspace',
|
|
94
|
+
'list.column.status': 'Status',
|
|
95
|
+
'list.column.activity': 'Last active',
|
|
96
|
+
'row.open': 'Switch to session: {title}',
|
|
97
|
+
'status.running': 'Running',
|
|
98
|
+
'workspace.none': 'No workspace',
|
|
99
|
+
'time.justNow': 'just now',
|
|
100
|
+
'time.minutes': '{count} min ago',
|
|
101
|
+
'time.hours': '{count} h ago',
|
|
102
|
+
'time.days': '{count} d ago',
|
|
103
|
+
'time.unknown': '—',
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* ------------------------------------------------------------------ */
|
|
107
|
+
/* Styles (component-owned, removed with the page) */
|
|
108
|
+
/* ------------------------------------------------------------------ */
|
|
109
|
+
|
|
110
|
+
const STYLE = `
|
|
111
|
+
.${ROOT_CLASS} {
|
|
112
|
+
box-sizing: border-box;
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
gap: 20px;
|
|
116
|
+
height: 100%;
|
|
117
|
+
min-height: 0;
|
|
118
|
+
padding: 28px 32px 32px;
|
|
119
|
+
overflow: auto;
|
|
120
|
+
background: var(--dsw-alias-bg-base);
|
|
121
|
+
color: var(--dsw-alias-label-primary);
|
|
122
|
+
font-size: 13px;
|
|
123
|
+
line-height: 20px;
|
|
124
|
+
}
|
|
125
|
+
.${ROOT_CLASS} *,
|
|
126
|
+
.${ROOT_CLASS} *::before,
|
|
127
|
+
.${ROOT_CLASS} *::after { box-sizing: border-box; }
|
|
128
|
+
.${cls('header')} { display: flex; flex-direction: column; gap: 6px; }
|
|
129
|
+
.${cls('heading')} { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
|
|
130
|
+
.${cls('title')} { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; color: var(--dsw-alias-label-primary); }
|
|
131
|
+
.${cls('count')} { font-size: 12px; color: var(--dsw-alias-label-tertiary); }
|
|
132
|
+
.${cls('hint')} { margin: 0; max-width: 72ch; font-size: 12.5px; color: var(--dsw-alias-label-secondary); }
|
|
133
|
+
.${cls('section')} { display: flex; flex-direction: column; gap: 8px; }
|
|
134
|
+
.${cls('sectionHead')} { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
|
|
135
|
+
.${cls('sectionTitle')} { margin: 0; font-size: 14px; line-height: 22px; font-weight: 600; color: var(--dsw-alias-label-primary); }
|
|
136
|
+
.${cls('sectionCount')}, .${cls('sectionNote')} { font-size: 12px; color: var(--dsw-alias-label-tertiary); }
|
|
137
|
+
.${cls('table')} {
|
|
138
|
+
display: flex;
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
overflow: hidden;
|
|
141
|
+
border: 1px solid var(--dsw-alias-border-l1);
|
|
142
|
+
border-radius: var(--dsw-radius-lg);
|
|
143
|
+
background: var(--dsw-alias-bg-layer-1);
|
|
144
|
+
}
|
|
145
|
+
.${cls('row')} {
|
|
146
|
+
display: grid;
|
|
147
|
+
grid-template-columns: minmax(160px, 1.6fr) minmax(120px, 1fr) 96px 116px;
|
|
148
|
+
align-items: center;
|
|
149
|
+
gap: 12px;
|
|
150
|
+
width: 100%;
|
|
151
|
+
padding: 10px 16px;
|
|
152
|
+
}
|
|
153
|
+
.${cls('rowRecent')} { grid-template-columns: minmax(160px, 1.6fr) minmax(120px, 1fr) 116px; }
|
|
154
|
+
.${cls('rowHeader')} {
|
|
155
|
+
border-bottom: 1px solid var(--dsw-alias-border-l1);
|
|
156
|
+
background: var(--dsw-alias-bg-layer-2);
|
|
157
|
+
color: var(--dsw-alias-label-tertiary);
|
|
158
|
+
font-size: 11.5px;
|
|
159
|
+
letter-spacing: 0.02em;
|
|
160
|
+
}
|
|
161
|
+
.${cls('rows')} { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
|
|
162
|
+
.${cls('item')} + .${cls('item')} { border-top: 1px solid var(--dsw-alias-border-l1); }
|
|
163
|
+
.${cls('rowButton')} {
|
|
164
|
+
border: 0;
|
|
165
|
+
border-radius: 0;
|
|
166
|
+
background: transparent;
|
|
167
|
+
color: inherit;
|
|
168
|
+
font: inherit;
|
|
169
|
+
text-align: left;
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
transition: background-color 0.12s ease;
|
|
172
|
+
}
|
|
173
|
+
.${cls('rowButton')}:hover { background: var(--dsw-alias-interactive-bg-hover); }
|
|
174
|
+
.${cls('rowButton')}:active { background: var(--dsw-alias-interactive-bg-active); }
|
|
175
|
+
.${cls('rowButton')}:focus-visible {
|
|
176
|
+
outline: var(--dsw-focus-ring-width, 2px) solid var(--dsw-focus-ring-color, var(--dsw-alias-brand-primary));
|
|
177
|
+
outline-offset: -2px;
|
|
178
|
+
}
|
|
179
|
+
.${cls('cell')} { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
180
|
+
.${cls('cellTitle')} { font-weight: 500; }
|
|
181
|
+
.${cls('cellWorkspace')}, .${cls('cellActivity')} { color: var(--dsw-alias-label-secondary); }
|
|
182
|
+
.${cls('cellActivity')} { font-variant-numeric: tabular-nums; }
|
|
183
|
+
.${cls('pill')} {
|
|
184
|
+
display: inline-flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
gap: 6px;
|
|
187
|
+
padding: 1px 8px;
|
|
188
|
+
border: 1px solid var(--dsw-alias-border-l2);
|
|
189
|
+
border-radius: 999px;
|
|
190
|
+
background: var(--dsw-alias-bg-layer-2);
|
|
191
|
+
color: var(--dsw-alias-state-success-primary);
|
|
192
|
+
font-size: 11.5px;
|
|
193
|
+
line-height: 18px;
|
|
194
|
+
}
|
|
195
|
+
.${cls('dot')} { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
|
|
196
|
+
.${cls('sectionEmpty')} {
|
|
197
|
+
margin: 0;
|
|
198
|
+
padding: 16px;
|
|
199
|
+
border: 1px dashed var(--dsw-alias-border-l2);
|
|
200
|
+
border-radius: var(--dsw-radius-lg);
|
|
201
|
+
background: var(--dsw-alias-bg-layer-1);
|
|
202
|
+
color: var(--dsw-alias-label-tertiary);
|
|
203
|
+
font-size: 12.5px;
|
|
204
|
+
}
|
|
205
|
+
.${cls('more')} {
|
|
206
|
+
align-self: flex-start;
|
|
207
|
+
margin-top: 2px;
|
|
208
|
+
padding: 4px 10px;
|
|
209
|
+
border: 1px solid var(--dsw-alias-border-l2);
|
|
210
|
+
border-radius: var(--dsw-radius-md);
|
|
211
|
+
background: transparent;
|
|
212
|
+
color: var(--dsw-alias-brand-primary);
|
|
213
|
+
font: inherit;
|
|
214
|
+
font-size: 12px;
|
|
215
|
+
cursor: pointer;
|
|
216
|
+
}
|
|
217
|
+
.${cls('more')}:hover { background: var(--dsw-alias-interactive-bg-hover); }
|
|
218
|
+
.${cls('more')}:focus-visible {
|
|
219
|
+
outline: var(--dsw-focus-ring-width, 2px) solid var(--dsw-focus-ring-color, var(--dsw-alias-brand-primary));
|
|
220
|
+
outline-offset: 1px;
|
|
221
|
+
}
|
|
222
|
+
.${cls('empty')} {
|
|
223
|
+
display: flex;
|
|
224
|
+
flex-direction: column;
|
|
225
|
+
align-items: center;
|
|
226
|
+
gap: 6px;
|
|
227
|
+
padding: 40px 24px;
|
|
228
|
+
text-align: center;
|
|
229
|
+
border: 1px dashed var(--dsw-alias-border-l2);
|
|
230
|
+
border-radius: var(--dsw-radius-lg);
|
|
231
|
+
background: var(--dsw-alias-bg-layer-1);
|
|
232
|
+
}
|
|
233
|
+
.${cls('emptyTitle')} { margin: 0; font-size: 14px; color: var(--dsw-alias-label-primary); }
|
|
234
|
+
.${cls('emptyHint')} { margin: 0; max-width: 46ch; font-size: 12.5px; color: var(--dsw-alias-label-tertiary); }
|
|
235
|
+
@media (max-width: 720px) {
|
|
236
|
+
.${ROOT_CLASS} { padding: 20px 16px 24px; }
|
|
237
|
+
.${cls('row')} { grid-template-columns: minmax(0, 1fr) 88px 96px; }
|
|
238
|
+
.${cls('rowRecent')} { grid-template-columns: minmax(0, 1fr) 96px; }
|
|
239
|
+
.${cls('cellWorkspace')}, .${cls('rowHeader')} > span:nth-child(2) { display: none; }
|
|
240
|
+
}
|
|
241
|
+
`
|
|
242
|
+
|
|
243
|
+
/* ------------------------------------------------------------------ */
|
|
244
|
+
/* Helpers */
|
|
245
|
+
/* ------------------------------------------------------------------ */
|
|
246
|
+
|
|
247
|
+
/** Stand-in store for a controller that is not provided yet. */
|
|
248
|
+
const NO_STORE = { getSnapshot: () => null, subscribe: () => () => {} }
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Read a snapshot store as a React store. `useSyncExternalStore` is
|
|
252
|
+
* baseline in this app's React; the fallback keeps the page working if a
|
|
253
|
+
* different React build is mounted.
|
|
254
|
+
*/
|
|
255
|
+
const useStore = typeof React.useSyncExternalStore === 'function'
|
|
256
|
+
? function useStore(source) {
|
|
257
|
+
const subscribe = useCallback((notify) => source.subscribe(notify), [source])
|
|
258
|
+
const read = useCallback(() => source.getSnapshot(), [source])
|
|
259
|
+
return React.useSyncExternalStore(subscribe, read, read)
|
|
260
|
+
}
|
|
261
|
+
: function useStoreFallback(source) {
|
|
262
|
+
const [snapshot, setSnapshot] = useState(() => source.getSnapshot())
|
|
263
|
+
useEffect(() => {
|
|
264
|
+
const sync = () => setSnapshot(source.getSnapshot())
|
|
265
|
+
sync()
|
|
266
|
+
return source.subscribe(sync)
|
|
267
|
+
}, [source])
|
|
268
|
+
return snapshot
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** Re-render on a fixed interval so relative times stay truthful. */
|
|
272
|
+
function useNow(intervalMs) {
|
|
273
|
+
const [now, setNow] = useState(() => Date.now())
|
|
274
|
+
useEffect(() => {
|
|
275
|
+
const timer = setInterval(() => setNow(Date.now()), intervalMs)
|
|
276
|
+
return () => clearInterval(timer)
|
|
277
|
+
}, [intervalMs])
|
|
278
|
+
return now
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/** Map SessionId → owning workspace by scanning workspace membership. */
|
|
282
|
+
function indexWorkspaces(snapshot) {
|
|
283
|
+
const index = new Map()
|
|
284
|
+
const items = snapshot && Array.isArray(snapshot.items) ? snapshot.items : []
|
|
285
|
+
for (const item of items) {
|
|
286
|
+
if (!item || !Array.isArray(item.sessionIds)) continue
|
|
287
|
+
for (const sessionId of item.sessionIds) {
|
|
288
|
+
if (!index.has(sessionId)) index.set(sessionId, item)
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return index
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/** Last path segment of a host directory, for the no-workspace fallback. */
|
|
295
|
+
function basename(directory) {
|
|
296
|
+
if (typeof directory !== 'string' || directory === '') return ''
|
|
297
|
+
const parts = directory.split(/[\\/]+/).filter((part) => part !== '')
|
|
298
|
+
return parts.length > 0 ? parts[parts.length - 1] : ''
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/** Relative "last activity" wording for one Session. */
|
|
302
|
+
function formatActivity(t, now, updatedAt) {
|
|
303
|
+
if (typeof updatedAt !== 'number' || !Number.isFinite(updatedAt)) return t('time.unknown')
|
|
304
|
+
const elapsed = Math.max(0, now - updatedAt)
|
|
305
|
+
if (elapsed < 60_000) return t('time.justNow')
|
|
306
|
+
const minutes = Math.floor(elapsed / 60_000)
|
|
307
|
+
if (minutes < 60) return t('time.minutes', { count: minutes })
|
|
308
|
+
const hours = Math.floor(minutes / 60)
|
|
309
|
+
if (hours < 24) return t('time.hours', { count: hours })
|
|
310
|
+
return t('time.days', { count: Math.floor(hours / 24) })
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/* ------------------------------------------------------------------ */
|
|
314
|
+
/* Page */
|
|
315
|
+
/* ------------------------------------------------------------------ */
|
|
316
|
+
|
|
317
|
+
function RunningSessionsPage(props) {
|
|
318
|
+
const { ctx, t } = props
|
|
319
|
+
const sessions = useStore(ctx.sessions.list || NO_STORE)
|
|
320
|
+
const workspaces = useStore(ctx.workspaces.list || NO_STORE)
|
|
321
|
+
const now = useNow(TICK_MS)
|
|
322
|
+
const [showAllRecent, setShowAllRecent] = useState(false)
|
|
323
|
+
|
|
324
|
+
/* Running first; everything else by last activity, newest first.
|
|
325
|
+
* Draft (blank) rows and archived Sessions stay out: they are not part of
|
|
326
|
+
* "recently active" in the sidebar's own navigation either. */
|
|
327
|
+
const groups = useMemo(() => {
|
|
328
|
+
if (!sessions) return { running: [], others: [], recentTotal: 0, total: 0 }
|
|
329
|
+
const archived = new Set(
|
|
330
|
+
workspaces && Array.isArray(workspaces.archivedSessionIds) ? workspaces.archivedSessionIds : [],
|
|
331
|
+
)
|
|
332
|
+
const all = []
|
|
333
|
+
for (const id of sessions.ids || []) {
|
|
334
|
+
const summary = sessions.byId ? sessions.byId[id] : undefined
|
|
335
|
+
if (!summary || summary.blank === true || archived.has(summary.id)) continue
|
|
336
|
+
all.push(summary)
|
|
337
|
+
}
|
|
338
|
+
all.sort((left, right) => (right.updatedAt || 0) - (left.updatedAt || 0))
|
|
339
|
+
const running = all.filter((summary) => summary.running === true)
|
|
340
|
+
const others = all.filter((summary) => summary.running !== true)
|
|
341
|
+
return {
|
|
342
|
+
running,
|
|
343
|
+
others,
|
|
344
|
+
recentTotal: others.length,
|
|
345
|
+
total: all.length,
|
|
346
|
+
}
|
|
347
|
+
}, [sessions, workspaces])
|
|
348
|
+
|
|
349
|
+
const recentRows = showAllRecent ? groups.others : groups.others.slice(0, RECENT_LIMIT)
|
|
350
|
+
|
|
351
|
+
const ownedBy = useMemo(() => indexWorkspaces(workspaces), [workspaces])
|
|
352
|
+
|
|
353
|
+
/* Opening a Session is the app's own navigation: select + reveal it. */
|
|
354
|
+
const openSession = useCallback((sessionId) => {
|
|
355
|
+
const navigation = ctx.uiWorkspace.openSession(sessionId)
|
|
356
|
+
if (navigation && typeof navigation.catch === 'function') {
|
|
357
|
+
navigation.catch((error) => {
|
|
358
|
+
console.error('[dsh-session-actively] open session failed', error)
|
|
359
|
+
})
|
|
360
|
+
}
|
|
361
|
+
}, [ctx])
|
|
362
|
+
|
|
363
|
+
const pending = !sessions || sessions.phase === 'pending'
|
|
364
|
+
|
|
365
|
+
const titleOf = (summary) => summary.displayTitle || summary.id
|
|
366
|
+
const workspaceOf = (summary) => {
|
|
367
|
+
const workspace = ownedBy.get(summary.id)
|
|
368
|
+
if (workspace && workspace.title) return workspace.title
|
|
369
|
+
return basename(summary.cwd) || t('workspace.none')
|
|
370
|
+
}
|
|
371
|
+
const exactTimeOf = (updatedAt) => {
|
|
372
|
+
if (typeof updatedAt !== 'number' || !Number.isFinite(updatedAt)) return undefined
|
|
373
|
+
return new Date(updatedAt).toLocaleString()
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
const renderRow = (summary, recent) => {
|
|
377
|
+
const title = titleOf(summary)
|
|
378
|
+
return h('li', { key: summary.id, className: cls('item') },
|
|
379
|
+
h('button', {
|
|
380
|
+
type: 'button',
|
|
381
|
+
className: cls('row') + (recent ? ' ' + cls('rowRecent') : '') + ' ' + cls('rowButton'),
|
|
382
|
+
title: t('row.open', { title }),
|
|
383
|
+
onClick: () => openSession(summary.id),
|
|
384
|
+
},
|
|
385
|
+
h('span', { className: cls('cell') + ' ' + cls('cellTitle') }, title),
|
|
386
|
+
h('span', { className: cls('cell') + ' ' + cls('cellWorkspace') }, workspaceOf(summary)),
|
|
387
|
+
recent
|
|
388
|
+
? null
|
|
389
|
+
: h('span', { className: cls('cell') },
|
|
390
|
+
h('span', { className: cls('pill') },
|
|
391
|
+
h('span', { className: cls('dot'), 'aria-hidden': 'true' }),
|
|
392
|
+
t('status.running'))),
|
|
393
|
+
h('span', {
|
|
394
|
+
className: cls('cell') + ' ' + cls('cellActivity'),
|
|
395
|
+
title: exactTimeOf(summary.updatedAt),
|
|
396
|
+
}, formatActivity(t, now, summary.updatedAt)),
|
|
397
|
+
))
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const renderSection = (options) => h('section', {
|
|
401
|
+
className: cls('section'),
|
|
402
|
+
'aria-label': options.heading,
|
|
403
|
+
},
|
|
404
|
+
h('div', { className: cls('sectionHead') },
|
|
405
|
+
h('h2', { className: cls('sectionTitle') }, options.heading),
|
|
406
|
+
h('span', { className: cls('sectionCount') }, options.count),
|
|
407
|
+
options.note ? h('span', { className: cls('sectionNote') }, options.note) : null),
|
|
408
|
+
options.rows.length > 0
|
|
409
|
+
? h(React.Fragment, null,
|
|
410
|
+
h('div', { className: cls('table') },
|
|
411
|
+
h('div', {
|
|
412
|
+
className: cls('row') + ' ' + cls('rowHeader') + (options.recent ? ' ' + cls('rowRecent') : ''),
|
|
413
|
+
'aria-hidden': 'true',
|
|
414
|
+
},
|
|
415
|
+
options.columns.map((label, index) => h('span', { key: index, className: cls('cell') }, label))),
|
|
416
|
+
h('ul', { className: cls('rows') }, options.rows.map((summary) => renderRow(summary, options.recent)))),
|
|
417
|
+
options.footer || null)
|
|
418
|
+
: h('p', { className: cls('sectionEmpty') }, options.empty))
|
|
419
|
+
|
|
420
|
+
const runningSection = renderSection({
|
|
421
|
+
heading: t('list.running'),
|
|
422
|
+
count: t('list.runningCount', { count: groups.running.length }),
|
|
423
|
+
rows: groups.running,
|
|
424
|
+
recent: false,
|
|
425
|
+
empty: t('list.runningEmpty'),
|
|
426
|
+
columns: [t('list.column.session'), t('list.column.workspace'), t('list.column.status'), t('list.column.activity')],
|
|
427
|
+
})
|
|
428
|
+
|
|
429
|
+
const recentSection = renderSection({
|
|
430
|
+
heading: t('list.recent'),
|
|
431
|
+
count: t('list.recentCount', { count: groups.recentTotal }),
|
|
432
|
+
rows: recentRows,
|
|
433
|
+
recent: true,
|
|
434
|
+
empty: t('list.recentEmpty'),
|
|
435
|
+
columns: [t('list.column.session'), t('list.column.workspace'), t('list.column.activity')],
|
|
436
|
+
footer: groups.recentTotal > RECENT_LIMIT
|
|
437
|
+
? h('button', {
|
|
438
|
+
type: 'button',
|
|
439
|
+
className: cls('more'),
|
|
440
|
+
onClick: () => setShowAllRecent((value) => !value),
|
|
441
|
+
}, showAllRecent
|
|
442
|
+
? t('list.recentLess')
|
|
443
|
+
: t('list.recentMore', { count: groups.recentTotal }))
|
|
444
|
+
: null,
|
|
445
|
+
})
|
|
446
|
+
|
|
447
|
+
return h('section', { className: ROOT_CLASS, 'data-dsh-session-actively': '' },
|
|
448
|
+
h('style', null, STYLE),
|
|
449
|
+
h('header', { className: cls('header') },
|
|
450
|
+
h('div', { className: cls('heading') },
|
|
451
|
+
h('h1', { className: cls('title') }, t('page.title')),
|
|
452
|
+
h('span', { className: cls('count') },
|
|
453
|
+
t('list.summary', { running: groups.running.length, recent: groups.recentTotal }))),
|
|
454
|
+
h('p', { className: cls('hint') }, t('page.description'))),
|
|
455
|
+
pending
|
|
456
|
+
? h('div', { className: cls('empty') },
|
|
457
|
+
h('p', { className: cls('emptyTitle') }, t('list.pending')),
|
|
458
|
+
h('p', { className: cls('emptyHint') }, t('list.pendingHint')))
|
|
459
|
+
: groups.total === 0
|
|
460
|
+
? h('div', { className: cls('empty') },
|
|
461
|
+
h('p', { className: cls('emptyTitle') }, t('list.empty')),
|
|
462
|
+
h('p', { className: cls('emptyHint') }, t('list.emptyHint')))
|
|
463
|
+
: h(React.Fragment, null, runningSection, recentSection),
|
|
464
|
+
)
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/* ------------------------------------------------------------------ */
|
|
468
|
+
/* Sidebar glyph */
|
|
469
|
+
/* ------------------------------------------------------------------ */
|
|
470
|
+
|
|
471
|
+
/** The sidebar entry glyph: a panel with list rows and a live dot. */
|
|
472
|
+
function RunningSessionsIcon(props) {
|
|
473
|
+
const size = props && typeof props.size === 'number' ? props.size : 20
|
|
474
|
+
return h('svg', {
|
|
475
|
+
width: size,
|
|
476
|
+
height: size,
|
|
477
|
+
viewBox: '0 0 20 20',
|
|
478
|
+
fill: 'none',
|
|
479
|
+
stroke: 'currentColor',
|
|
480
|
+
strokeWidth: 1.6,
|
|
481
|
+
strokeLinecap: 'round',
|
|
482
|
+
strokeLinejoin: 'round',
|
|
483
|
+
'aria-hidden': 'true',
|
|
484
|
+
focusable: 'false',
|
|
485
|
+
},
|
|
486
|
+
h('rect', { x: 2.75, y: 3.75, width: 14.5, height: 12.5, rx: 3.25 }),
|
|
487
|
+
h('path', { d: 'M6.25 8.25h7.5' }),
|
|
488
|
+
h('path', { d: 'M6.25 11.5h4' }),
|
|
489
|
+
h('circle', { cx: 13.4, cy: 11.5, r: 1.15, fill: 'currentColor', stroke: 'none' }),
|
|
490
|
+
)
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/* ------------------------------------------------------------------ */
|
|
494
|
+
/* Activation */
|
|
495
|
+
/* ------------------------------------------------------------------ */
|
|
496
|
+
|
|
497
|
+
function apply(ctx) {
|
|
498
|
+
/* Dictionaries first: the sidebar resolves `label` lazily through them. */
|
|
499
|
+
ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'dsh-session-actively: dictionaries')
|
|
500
|
+
const t = ctx.locale.bind(NS)
|
|
501
|
+
|
|
502
|
+
/* The page closes over its own context instead of relying on a ctx prop. */
|
|
503
|
+
const Page = (props) => h(RunningSessionsPage, Object.assign({}, props, { ctx, t }))
|
|
504
|
+
|
|
505
|
+
/* Launcher and target share one id, so the entry's selected state is the
|
|
506
|
+
* layout's real main-panel selection. ctx.slots.inject owns each
|
|
507
|
+
* registration for this plugin's lifetime, so disabling the bundle
|
|
508
|
+
* removes exactly these two entries and the layout then falls back to the
|
|
509
|
+
* Conversation on its own. */
|
|
510
|
+
ctx.slots.inject('main', () => ctx.slots.register({
|
|
511
|
+
name: 'main',
|
|
512
|
+
key: PANEL_ID,
|
|
513
|
+
locale: NS,
|
|
514
|
+
}, Page))
|
|
515
|
+
|
|
516
|
+
ctx.slots.inject('sidebar.panellist', () => ctx.slots.register({
|
|
517
|
+
name: 'sidebar.panellist',
|
|
518
|
+
id: PANEL_ID,
|
|
519
|
+
order: 40,
|
|
520
|
+
locale: NS,
|
|
521
|
+
label: () => t('panel'),
|
|
522
|
+
}, RunningSessionsIcon))
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
return { inject, apply }
|
|
526
|
+
},
|
|
527
|
+
})
|
package/cordis.patch.yml
ADDED
package/docs/DETAIL.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+

|
|
@@ -0,0 +1 @@
|
|
|
1
|
+

|
package/docs/preview.svg
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300" fill="none">
|
|
2
|
+
<rect x="48" y="32" width="544" height="236" rx="18" fill="#64748b" opacity="0.08"/>
|
|
3
|
+
<rect x="72" y="56" width="496" height="188" rx="12" fill="#64748b" opacity="0.06"/>
|
|
4
|
+
|
|
5
|
+
<rect x="72" y="56" width="132" height="188" rx="12" fill="#64748b" opacity="0.12"/>
|
|
6
|
+
<rect x="86" y="74" width="76" height="10" rx="5" fill="#94a3b8" opacity="0.55"/>
|
|
7
|
+
<rect x="86" y="96" width="104" height="10" rx="5" fill="#6366f1" opacity="0.85"/>
|
|
8
|
+
<rect x="86" y="116" width="88" height="10" rx="5" fill="#94a3b8" opacity="0.4"/>
|
|
9
|
+
<rect x="86" y="136" width="96" height="10" rx="5" fill="#94a3b8" opacity="0.4"/>
|
|
10
|
+
<rect x="86" y="156" width="72" height="10" rx="5" fill="#94a3b8" opacity="0.4"/>
|
|
11
|
+
<circle cx="188" cy="101" r="4" fill="#22c55e"/>
|
|
12
|
+
|
|
13
|
+
<rect x="224" y="56" width="344" height="14" rx="7" fill="#94a3b8" opacity="0.5"/>
|
|
14
|
+
<rect x="224" y="80" width="236" height="9" rx="4.5" fill="#94a3b8" opacity="0.32"/>
|
|
15
|
+
|
|
16
|
+
<rect x="224" y="106" width="344" height="58" rx="10" fill="#64748b" opacity="0.08"/>
|
|
17
|
+
<circle cx="246" cy="126" r="5" fill="#22c55e"/>
|
|
18
|
+
<rect x="262" y="120" width="150" height="10" rx="5" fill="#94a3b8" opacity="0.55"/>
|
|
19
|
+
<rect x="262" y="138" width="96" height="8" rx="4" fill="#94a3b8" opacity="0.32"/>
|
|
20
|
+
<rect x="500" y="122" width="46" height="8" rx="4" fill="#94a3b8" opacity="0.32"/>
|
|
21
|
+
|
|
22
|
+
<rect x="224" y="180" width="344" height="58" rx="10" fill="#64748b" opacity="0.06"/>
|
|
23
|
+
<circle cx="246" cy="200" r="5" fill="#94a3b8" opacity="0.5"/>
|
|
24
|
+
<rect x="262" y="194" width="120" height="10" rx="5" fill="#94a3b8" opacity="0.45"/>
|
|
25
|
+
<rect x="262" y="212" width="84" height="8" rx="4" fill="#94a3b8" opacity="0.28"/>
|
|
26
|
+
<rect x="500" y="196" width="46" height="8" rx="4" fill="#94a3b8" opacity="0.28"/>
|
|
27
|
+
|
|
28
|
+
<rect x="224" y="252" width="56" height="9" rx="4.5" fill="#6366f1" opacity="0.7"/>
|
|
29
|
+
</svg>
|
package/icon.svg
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36" fill="none">
|
|
2
|
+
<rect x="5.5" y="7.5" width="17" height="4" rx="2" fill="#4f6bed"/>
|
|
3
|
+
<rect x="5.5" y="15" width="13" height="4" rx="2" fill="#4f6bed" opacity="0.82"/>
|
|
4
|
+
<rect x="5.5" y="22.5" width="9" height="4" rx="2" fill="#4f6bed" opacity="0.6"/>
|
|
5
|
+
<circle cx="27" cy="9.5" r="3.6" fill="#22c55e"/>
|
|
6
|
+
</svg>
|
package/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host half of the active-sessions bundle.
|
|
3
|
+
*
|
|
4
|
+
* The bundle adds one Client surface only: a left-sidebar page that lists the
|
|
5
|
+
* Sessions this DSH is running right now on top, and every other Session below
|
|
6
|
+
* ordered by its last activity, opening one on click. All of its data is read
|
|
7
|
+
* from the existing Client Session and Workspace controllers, so the Host half
|
|
8
|
+
* registers no service, projection, RPC, tool, or model-facing surface and has
|
|
9
|
+
* nothing to apply.
|
|
10
|
+
*/
|
|
11
|
+
export function apply() {}
|
package/locale/en.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Session activity",
|
|
4
|
+
"description": "Adds a left-sidebar page that lists running sessions on top and other sessions by last activity below, each with its last-active time; click any row to switch to it. Data is read locally from the running Harness; up to 20 recent rows show by default, with a Show all button.",
|
|
5
|
+
"detail": "docs/DETAIL.md"
|
|
6
|
+
},
|
|
7
|
+
"panel": "Recently active",
|
|
8
|
+
"page.title": "Recently active sessions",
|
|
9
|
+
"page.description": "Sessions running right now are listed on top; every other session follows, newest activity first. Click any row to switch.",
|
|
10
|
+
"list.summary": "{running} running · {recent} recent",
|
|
11
|
+
"list.running": "Running",
|
|
12
|
+
"list.recent": "Recently active",
|
|
13
|
+
"list.runningCount": "{count}",
|
|
14
|
+
"list.recentCount": "{count}",
|
|
15
|
+
"list.recentMore": "Show all {count}",
|
|
16
|
+
"list.recentLess": "Show less",
|
|
17
|
+
"list.runningEmpty": "No session is running right now",
|
|
18
|
+
"list.recentEmpty": "No other session yet",
|
|
19
|
+
"list.empty": "No sessions yet",
|
|
20
|
+
"list.emptyHint": "Once you start a session it appears here, newest activity first; nothing to refresh by hand.",
|
|
21
|
+
"list.pending": "Loading sessions…",
|
|
22
|
+
"list.pendingHint": "The first connection to session data can take a few seconds.",
|
|
23
|
+
"list.column.session": "Session",
|
|
24
|
+
"list.column.workspace": "Workspace",
|
|
25
|
+
"list.column.status": "Status",
|
|
26
|
+
"list.column.activity": "Last active",
|
|
27
|
+
"row.open": "Switch to session: {title}",
|
|
28
|
+
"status.running": "Running",
|
|
29
|
+
"workspace.none": "No workspace",
|
|
30
|
+
"time.justNow": "just now",
|
|
31
|
+
"time.minutes": "{count} min ago",
|
|
32
|
+
"time.hours": "{count} h ago",
|
|
33
|
+
"time.days": "{count} d ago",
|
|
34
|
+
"time.unknown": "—"
|
|
35
|
+
}
|
package/locale/zh.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "会话活跃度",
|
|
4
|
+
"description": "在左侧边栏新增「最近活跃的会话」页面:上方列出正在运行的会话,下方按最近活跃时间排列其他会话,并显示最近活跃时间;点击任意一行即可切换。数据仅从本机运行的 Harness 读取;默认展示 20 条最近会话,可点「显示全部」展开。",
|
|
5
|
+
"detail": "docs/DETAIL.zh.md"
|
|
6
|
+
},
|
|
7
|
+
"panel": "最近活跃的会话",
|
|
8
|
+
"page.title": "最近活跃的会话",
|
|
9
|
+
"page.description": "上方实时列出正在运行的会话,下方按最近活跃时间排列其他会话;点击任意一行即可切换。",
|
|
10
|
+
"list.summary": "{running} 个运行中 · {recent} 个最近活跃",
|
|
11
|
+
"list.running": "运行中",
|
|
12
|
+
"list.recent": "最近活跃",
|
|
13
|
+
"list.runningCount": "{count} 个",
|
|
14
|
+
"list.recentCount": "{count} 个",
|
|
15
|
+
"list.recentMore": "显示全部 {count} 个",
|
|
16
|
+
"list.recentLess": "收起",
|
|
17
|
+
"list.runningEmpty": "当前没有运行中的会话",
|
|
18
|
+
"list.recentEmpty": "还没有最近活跃的会话",
|
|
19
|
+
"list.empty": "还没有会话记录",
|
|
20
|
+
"list.emptyHint": "开始一个会话后,它会按最近活跃时间出现在这里,无需手动刷新。",
|
|
21
|
+
"list.pending": "正在加载会话列表…",
|
|
22
|
+
"list.pendingHint": "首次连接会话数据时可能需要几秒钟。",
|
|
23
|
+
"list.column.session": "会话",
|
|
24
|
+
"list.column.workspace": "工作区",
|
|
25
|
+
"list.column.status": "状态",
|
|
26
|
+
"list.column.activity": "最近活跃",
|
|
27
|
+
"row.open": "切换到会话:{title}",
|
|
28
|
+
"status.running": "运行中",
|
|
29
|
+
"workspace.none": "未归入工作区",
|
|
30
|
+
"time.justNow": "刚刚",
|
|
31
|
+
"time.minutes": "{count} 分钟前",
|
|
32
|
+
"time.hours": "{count} 小时前",
|
|
33
|
+
"time.days": "{count} 天前",
|
|
34
|
+
"time.unknown": "—"
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-actively",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Left sidebar page for DeepSeek Harness: running sessions on top, other sessions by last activity below, one click to switch.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "RabbitWaKuWaKu",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/RabbitWaKuWaKu/dsh-session-actively.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/RabbitWaKuWaKu/dsh-session-actively#readme",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"dsh",
|
|
15
|
+
"dsh-plugin",
|
|
16
|
+
"deepseek-harness",
|
|
17
|
+
"sessions",
|
|
18
|
+
"sidebar",
|
|
19
|
+
"recent-sessions",
|
|
20
|
+
"productivity"
|
|
21
|
+
],
|
|
22
|
+
"exports": {
|
|
23
|
+
".": "./index.js",
|
|
24
|
+
"./client": "./client.js",
|
|
25
|
+
"./locale/*.json": "./locale/*.json",
|
|
26
|
+
"./icon": "./icon.svg",
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"index.js",
|
|
31
|
+
"client.js",
|
|
32
|
+
"cordis.patch.yml",
|
|
33
|
+
"locale",
|
|
34
|
+
"docs",
|
|
35
|
+
"assets",
|
|
36
|
+
"screenshots.json",
|
|
37
|
+
"icon.svg",
|
|
38
|
+
"README.md",
|
|
39
|
+
"README_zh.md",
|
|
40
|
+
"LICENSE"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"check": "node scripts/check.mjs"
|
|
44
|
+
},
|
|
45
|
+
"dsh": {
|
|
46
|
+
"bundle": {
|
|
47
|
+
"patch": "./cordis.patch.yml"
|
|
48
|
+
},
|
|
49
|
+
"client": {
|
|
50
|
+
"platform": "web",
|
|
51
|
+
"immediately": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=22"
|
|
56
|
+
}
|
|
57
|
+
}
|
package/screenshots.json
ADDED