@restregular/dsh-powerup 0.12.0 → 0.14.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/README.md +32 -1
- package/client.js +908 -45
- package/index.js +250 -7
- package/lib/direct-ask.js +126 -0
- package/lib/progress-manager.js +49 -7
- package/lib/progress-tool.js +13 -4
- package/lib/task-resume.js +20 -5
- package/package.json +3 -2
package/lib/task-resume.js
CHANGED
|
@@ -43,12 +43,13 @@ export function cleanText(value, limit = TITLE_LIMIT) {
|
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Collect unfinished work from live Host services.
|
|
46
|
-
* @param {{agents?: any, jobs?: any}} services
|
|
46
|
+
* @param {{agents?: any, jobs?: any, sessionTitle?: any}} services
|
|
47
47
|
* @returns {Array<{id: string, title: string, kind: 'agent'|'job', running: boolean}>}
|
|
48
48
|
*/
|
|
49
49
|
export function collectRunningTasks(services = {}) {
|
|
50
50
|
const tasks = [];
|
|
51
51
|
const agents = services.agents;
|
|
52
|
+
const sessionTitle = services.sessionTitle;
|
|
52
53
|
try {
|
|
53
54
|
const list = typeof agents?.list === 'function' ? agents.list() : [];
|
|
54
55
|
for (const agent of Array.isArray(list) ? list : []) {
|
|
@@ -59,7 +60,7 @@ export function collectRunningTasks(services = {}) {
|
|
|
59
60
|
if (typeof id !== 'string' || id === '') continue;
|
|
60
61
|
tasks.push({
|
|
61
62
|
id,
|
|
62
|
-
title: taskTitle(agent),
|
|
63
|
+
title: taskTitle(agent, sessionTitle),
|
|
63
64
|
kind: 'agent',
|
|
64
65
|
running: true,
|
|
65
66
|
});
|
|
@@ -91,10 +92,24 @@ export function collectRunningTasks(services = {}) {
|
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
/** Best-effort human label for one live Agent. */
|
|
94
|
-
function taskTitle(agent) {
|
|
95
|
+
function taskTitle(agent, sessionTitle) {
|
|
96
|
+
// The canonical title lives on the `sessionTitle` service, not on Session.
|
|
97
|
+
// `agent.session.title()` does not exist — using it silently yields 'session'.
|
|
98
|
+
if (sessionTitle !== null && typeof sessionTitle?.get === 'function' && agent.session !== undefined) {
|
|
99
|
+
try {
|
|
100
|
+
const snapshot = sessionTitle.get(agent.session);
|
|
101
|
+
const value = typeof snapshot === 'string'
|
|
102
|
+
? snapshot
|
|
103
|
+
: snapshot?.title ?? snapshot?.text;
|
|
104
|
+
if (typeof value === 'string' && value.trim() !== '') return cleanText(value);
|
|
105
|
+
} catch {
|
|
106
|
+
/* fall through */
|
|
107
|
+
}
|
|
108
|
+
}
|
|
95
109
|
try {
|
|
96
|
-
const
|
|
97
|
-
|
|
110
|
+
const header = agent.session?.header?.();
|
|
111
|
+
const value = typeof header === 'string' ? header : header?.title;
|
|
112
|
+
if (typeof value === 'string' && value.trim() !== '') return cleanText(value);
|
|
98
113
|
} catch {
|
|
99
114
|
/* fall through */
|
|
100
115
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@restregular/dsh-powerup",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "为 DeepSeek Harness 提供一组可选的小型增强:轨迹右键菜单与步骤引用、后台任务停止原因、插件一键安装、侧边栏图标网格、会话切换、定位当前会话、工作区提示词、旁路模型生成的结构化任务进度;所有功能均可在 Power-Up 页面独立开关。 · Opt-in upgrades for DeepSeek Harness: Trajectory context menu and step references, job stop reasons, one-click plugin install, an adaptive sidebar launcher, session switching, locating the current session, workspace prompts, and non-blocking model-generated structured task progress — each toggled independently on the Power-Up page.",
|
|
5
5
|
"icon": "./icon.svg",
|
|
6
6
|
"type": "module",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"lib/progress-tool.js",
|
|
25
25
|
"lib/progress-manager.js",
|
|
26
26
|
"lib/task-resume.js",
|
|
27
|
+
"lib/direct-ask.js",
|
|
27
28
|
"locale/*.json",
|
|
28
29
|
"icon.svg",
|
|
29
30
|
"README.md",
|
|
@@ -97,7 +98,7 @@
|
|
|
97
98
|
"node": ">=22.13.0"
|
|
98
99
|
},
|
|
99
100
|
"scripts": {
|
|
100
|
-
"test": "node test/smoke.mjs && node test/host.mjs && node test/progress.mjs && node test/task-resume.mjs"
|
|
101
|
+
"test": "node test/smoke.mjs && node test/host.mjs && node test/progress.mjs && node test/task-resume.mjs && node test/direct-ask.mjs"
|
|
101
102
|
},
|
|
102
103
|
"license": "MIT",
|
|
103
104
|
"author": "RestRegular"
|