dsh-progress-union 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dsh.plugin.json +1 -1
- package/index.js +51 -0
- package/package.json +1 -1
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-external/dsh-progress-union",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"description": "进度结合原型:board 槽位真相源(用户可编辑、diff+ack 增量同步、staleness nudge)× 鲸程时间引擎(step 计数、ETA 三档 board>todo>local>prior、悬浮迷你条),并向压缩插件暴露只读三层进度锚点 progressAnchor(board 语义锚 + time 时间锚 + userEdits 未确认改动,service 与 HTTP 双平面)。",
|
|
6
6
|
"engines": {
|
package/index.js
CHANGED
|
@@ -2660,6 +2660,57 @@ ${reason}。本回合开始前先用 progress_update 处理进度板:用户这
|
|
|
2660
2660
|
'progress-union: progress_goal_report tool',
|
|
2661
2661
|
)
|
|
2662
2662
|
|
|
2663
|
+
if (commands) {
|
|
2664
|
+
ctx.effect(
|
|
2665
|
+
() =>
|
|
2666
|
+
commands.register({
|
|
2667
|
+
name: 'progress-goal',
|
|
2668
|
+
description: '设置一个长程目标,自动续轮推进(预算/检查/重试),替代 /goal',
|
|
2669
|
+
input: { hint: '[<objective>|status|budget <n>|edit <objective>|pause|resume|clear]' },
|
|
2670
|
+
handler: async ({ agent, rawInput }) => {
|
|
2671
|
+
const sessionId = sessionOfAgent(agent)
|
|
2672
|
+
const raw = String(rawInput || '').trim()
|
|
2673
|
+
const lower = raw.toLowerCase()
|
|
2674
|
+
try {
|
|
2675
|
+
if (lower === 'status' || raw === '') {
|
|
2676
|
+
const view = goalView(sessionId)
|
|
2677
|
+
return { kind: 'success', text: view.phase === 'idle' ? '没有目标。用法:/progress-goal <objective>' : renderGoalViewText(view) }
|
|
2678
|
+
}
|
|
2679
|
+
if (lower === 'clear') {
|
|
2680
|
+
const current = goalView(sessionId)
|
|
2681
|
+
if (current.phase === 'idle') return { kind: 'success', text: '没有目标可清除。' }
|
|
2682
|
+
await clearGoal(sessionId)
|
|
2683
|
+
return { kind: 'success', text: '目标已清除。' }
|
|
2684
|
+
}
|
|
2685
|
+
if (lower === 'pause') {
|
|
2686
|
+
const view = await pauseGoal(sessionId)
|
|
2687
|
+
return { kind: 'success', text: `目标已暂停\n${renderGoalViewText(view)}` }
|
|
2688
|
+
}
|
|
2689
|
+
if (lower === 'resume') {
|
|
2690
|
+
const view = await resumeGoal(sessionId)
|
|
2691
|
+
return { kind: 'success', text: `目标已恢复\n${renderGoalViewText(view)}` }
|
|
2692
|
+
}
|
|
2693
|
+
if (/^budget(?=\s)/i.test(raw)) {
|
|
2694
|
+
const value = raw.slice(6).trim()
|
|
2695
|
+
const view = await setGoalBudget(sessionId, Number(value))
|
|
2696
|
+
return { kind: 'success', text: `预算已更新\n${renderGoalViewText(view)}` }
|
|
2697
|
+
}
|
|
2698
|
+
if (/^edit(?=\s)/i.test(raw)) {
|
|
2699
|
+
const view = await editGoal(sessionId, raw.slice(4).trim())
|
|
2700
|
+
return { kind: 'success', text: `目标已更新\n${renderGoalViewText(view)}` }
|
|
2701
|
+
}
|
|
2702
|
+
// 其余一律当作新目标 objective
|
|
2703
|
+
const view = await createGoal(sessionId, raw)
|
|
2704
|
+
return { kind: 'success', text: `目标已创建\n${renderGoalViewText(view)}` }
|
|
2705
|
+
} catch (err) {
|
|
2706
|
+
return { kind: 'error', text: err instanceof Error ? err.message : String(err) }
|
|
2707
|
+
}
|
|
2708
|
+
},
|
|
2709
|
+
}),
|
|
2710
|
+
'progress-union: /progress-goal command',
|
|
2711
|
+
)
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2663
2714
|
const agentDisposers = new Map()
|
|
2664
2715
|
function bindAgentContext(agent) {
|
|
2665
2716
|
const sessionId = sessionOfAgent(agent)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-progress-union",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "进度结合原型:dsh-progress-board 槽位真相源 × 鲸程 widget 时间/ETA 引擎,另向压缩插件暴露只读三层进度锚点(service + HTTP 双平面)。基于 l3j3y3/dsh-progress-board (MIT) 与 uuhihj/task-progress-bar dsh-progress-widget (MIT)。",
|
|
6
6
|
"license": "MIT",
|