dsh-session-superagent 0.9.258 → 0.9.259
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/CHANGELOG.md +38 -0
- package/README.md +3 -3
- package/client.js +9 -1
- package/lib/index.js +46 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,44 @@
|
|
|
2
2
|
|
|
3
3
|
格式参照 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## [0.9.259] - 2026-11-05 —— 工具不再只能「暂停」,优先级也不再只有面板能调
|
|
6
|
+
|
|
7
|
+
### ① `watch_stop` 可以真正删除,但默认行为不变
|
|
8
|
+
|
|
9
|
+
新增 `delete: true`:
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
watch_stop({ repo: 'owner/name', delete: true })
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- 默认仍然只暂停,文本与 JSON 返回形状完全不变;
|
|
16
|
+
- 显式删除时先清轮询 timer 与 `bootTimers`,再删状态并写 ISO 墓碑,防止迟到快照复活;
|
|
17
|
+
- 回执明确 `deleted:true`;Gitee 前缀同样支持;
|
|
18
|
+
- 显式 `watch_start` 可重建同一仓库,只解除该 id 的墓碑,不影响其他 session。
|
|
19
|
+
|
|
20
|
+
### ② `watch_start` 支持五个优先级开关
|
|
21
|
+
|
|
22
|
+
`priority` 对象支持 `reopened / comments / labels / unassigned / stale`。
|
|
23
|
+
只覆盖显式传入的布尔键,其他已有设置保留;**只改标签不会重置优先级**。
|
|
24
|
+
|
|
25
|
+
### ③ doctor 不再写死 `/6`
|
|
26
|
+
|
|
27
|
+
部分挂载失败按实际的 `routes / (routes + failed.length)` 报告;旧状态没有路由数时显示「未知」,
|
|
28
|
+
不编造一个看似精确的分母。
|
|
29
|
+
|
|
30
|
+
### ④ ack 标签从「隐藏配置」变成可见、可改
|
|
31
|
+
|
|
32
|
+
`/state` 回传真实 `ackLabel`(GitHub/Gitee 各自默认值正确)。
|
|
33
|
+
面板列表显示作者白名单与回执标签,编辑器可修改「已处理标签」。
|
|
34
|
+
|
|
35
|
+
### 证据
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
npm test → 420/420(新增 12 条:删除/重建 4、priority 3、doctor/state 4、面板 ack 1)
|
|
39
|
+
node scripts/contract.mjs --update → 登记 watch_start.priority 与 watch_stop.delete
|
|
40
|
+
node scripts/measure-state.mjs → 20 条守 43.8 KB ≤ 50 KB
|
|
41
|
+
```
|
|
42
|
+
|
|
5
43
|
## [0.9.258] - 2026-11-05 —— 新建能一次设好,模型也能看见自己写了什么
|
|
6
44
|
|
|
7
45
|
继续收 T40「两个入口能力不对等」的尾项,并用**真实点击 + 请求体断言**验收,而不是只查字段出现在源码里。
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<img src="assets/icon-180.png" width="88" height="88" alt="">
|
|
4
4
|
|
|
5
5
|
[](LICENSE)
|
|
6
|
-
[](https://github.com/MYCF711/dsh-session-superagent/releases)
|
|
7
7
|
[](https://www.npmjs.com/package/dsh-session-superagent)
|
|
8
8
|
[](https://github.com/topics/dsh-plugin)
|
|
9
9
|
[](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
|
|
@@ -146,7 +146,7 @@ Gitee 私有仓库要在「设置 → 凭证」填私人令牌;公开仓库不
|
|
|
146
146
|
## 开发
|
|
147
147
|
|
|
148
148
|
```sh
|
|
149
|
-
npm test #
|
|
149
|
+
npm test # 420 项单测(带离线开关;裸 node --test 会真去 spawn gh,两分半)
|
|
150
150
|
```
|
|
151
151
|
|
|
152
152
|
### 工具输出:文本给人和 agent,JSON 给程序
|
|
@@ -206,7 +206,7 @@ dsh plugin --profile <profile> add dsh-session-superagent@latest
|
|
|
206
206
|
|
|
207
207
|
|
|
208
208
|
```bash
|
|
209
|
-
npm test #
|
|
209
|
+
npm test # 420 项单测(带离线开关,约 1.6 秒)
|
|
210
210
|
node scripts/ui-audit.mjs # 11 项 UI 指标(写死颜色 / 自造 token / 官方结构采用 …)
|
|
211
211
|
node scripts/preflight.mjs # 41 项门禁(含上面两条,外加 profile 一致性、路由面、包内容)
|
|
212
212
|
node scripts/render-preview.mjs preview.html # 双主题静态预览,直接浏览器打开
|
package/client.js
CHANGED
|
@@ -14,7 +14,7 @@ window.__ModuleLoader__.load({
|
|
|
14
14
|
const { useCallback, useEffect, useRef, useState } = React
|
|
15
15
|
|
|
16
16
|
// 客户端版本探针:每次模块加载写一次,用来确认浏览器里跑的是哪一版
|
|
17
|
-
const CLIENT_VERSION = '0.9.
|
|
17
|
+
const CLIENT_VERSION = '0.9.259'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
|
@@ -629,6 +629,8 @@ window.__ModuleLoader__.load({
|
|
|
629
629
|
if (f.labels && f.labels.length) parts.push('标签: ' + f.labels.join(','))
|
|
630
630
|
if (f.ignoreLabels && f.ignoreLabels.length) parts.push('排除: ' + f.ignoreLabels.join(','))
|
|
631
631
|
if (f.onlyAssigned) parts.push(f.assignee ? '只看指派给 @' + f.assignee : '只看已指派')
|
|
632
|
+
// 设了作者白名单就要能自查;只在编辑器里出现,列表上看不出「到底生效的是谁」。
|
|
633
|
+
if (f.allowAuthors && f.allowAuthors.length) parts.push('作者: ' + f.allowAuthors.join(','))
|
|
632
634
|
return parts.join(' · ')
|
|
633
635
|
}
|
|
634
636
|
|
|
@@ -1118,6 +1120,8 @@ window.__ModuleLoader__.load({
|
|
|
1118
1120
|
},
|
|
1119
1121
|
activeHours: draft.activeHours || '',
|
|
1120
1122
|
goal: draft.goal || '',
|
|
1123
|
+
// 自定义 ack 标签是可写配置;未传时服务端保持原值。
|
|
1124
|
+
ackLabel: String(draft.ackLabel || '').trim() || undefined,
|
|
1121
1125
|
isolated: !!draft.isolated,
|
|
1122
1126
|
workdir: draft.workdir || '',
|
|
1123
1127
|
observe: !!draft.observe,
|
|
@@ -1297,6 +1301,7 @@ window.__ModuleLoader__.load({
|
|
|
1297
1301
|
// 审核 T26 M2:`watcher.goal` 是**对象**(goalView),当字符串塞进输入框会显示
|
|
1298
1302
|
// [object Object];保存时后端只收 string,于是静默无效而 Toast 说「已保存」。
|
|
1299
1303
|
goal: watcher.note || (typeof watcher.goal === 'string' ? watcher.goal : (watcher.goal && watcher.goal.objective) || ''),
|
|
1304
|
+
ackLabel: watcher.ackLabel || (watcher.provider === 'gitee' ? '主理鱼-已处理' : '主理鱼:已处理'),
|
|
1300
1305
|
onlyAssigned: !!(watcher.filters && watcher.filters.onlyAssigned),
|
|
1301
1306
|
allowAuthors: (watcher.filters && watcher.filters.allowAuthors ? watcher.filters.allowAuthors : []).join(', '),
|
|
1302
1307
|
// 下面这些以前没填 —— 打开一条隔离执行的守再直接保存,会把 isolated 写回 false
|
|
@@ -1328,6 +1333,8 @@ window.__ModuleLoader__.load({
|
|
|
1328
1333
|
watcher.activeHours ? h(Tag, null, '时段 ' + watcher.activeHours) : null,
|
|
1329
1334
|
watcher.isolated ? h(Tag, null, isolationText(watcher)) : null,
|
|
1330
1335
|
filterText(watcher.filters) ? h(Tag, null, filterText(watcher.filters)) : null,
|
|
1336
|
+
// ack 标签决定这条是否还会被叫醒,不能只在工具参数里出现。
|
|
1337
|
+
h(Tag, { tone: 'quiet' }, '回执 ' + (watcher.ackLabel || (watcher.provider === 'gitee' ? '主理鱼-已处理' : '主理鱼:已处理'))),
|
|
1331
1338
|
backoffText(watcher) ? h(Tag, { tone: 'warning' }, backoffText(watcher)) : null),
|
|
1332
1339
|
// 三行,各管一件事:① 是谁 ② 节律与最近结果 ③ 目标
|
|
1333
1340
|
// 原来六段用 ' · ' 串成一行(会话 · 每 60s · 轮询 · 唤醒 · 上次唤醒 · 目标),
|
|
@@ -1407,6 +1414,7 @@ window.__ModuleLoader__.load({
|
|
|
1407
1414
|
// 官方原型的 Policy 第一件事是「谁可以给你派活」。单人场景也要:别人随手提的 issue 不该叫醒你。
|
|
1408
1415
|
field('只理这些人提的', h(Input, { value: draft.allowAuthors || '', placeholder: AUTHOR_LIST_PLACEHOLDER, onChange: (e) => setField({ ...draft, allowAuthors: e.target.value }) }), '不在名单里的人提的 issue/PR 不会叫醒你(Gitee 也可以填)'),
|
|
1409
1416
|
field('目标/规则', h(Input, { value: draft.goal || '', placeholder: '可选,会附在唤醒消息里', onChange: (e) => setField({ ...draft, goal: e.target.value }) })),
|
|
1417
|
+
field('已处理标签', h(Input, { value: draft.ackLabel || '', placeholder: '主理鱼:已处理', onChange: (e) => setField({ ...draft, ackLabel: e.target.value }) }), 'watch_ack 会把同名标签打到 issue/PR 上;改名字等于换一套已处理标记'),
|
|
1410
1418
|
h('label', { className: 'dt-switch-row' }, h(Toggle, { checked: !!draft.onlyAssigned, onChange: (v) => setField({ ...draft, onlyAssigned: v }), label: '只看已指派' }), '只处理已指派给人的条目'),
|
|
1411
1419
|
draft.onlyAssigned ? field('只看指派给谁', h(Input, { value: draft.assignee || '', placeholder: 'GitHub 登录名,留空 = 只要有指派就行', onChange: (e) => setField({ ...draft, assignee: e.target.value }) })) : null,
|
|
1412
1420
|
field('单次最多唤醒条数', h(Input, { value: draft.batchLimit || '', placeholder: String(DEFAULTS.batchLimit || 5) + '(1-20)', onChange: (e) => setField({ ...draft, batchLimit: e.target.value }) })),
|
package/lib/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import { decodeBody, truncateUtf8 } from './body.js'
|
|
|
26
26
|
import { quotaDeferText, isOfflineMode } from './gh-format.js'
|
|
27
27
|
import { listGiteeItems, fetchGiteeLastComment, addGiteeLabel, ensureGiteeLabel, giteeWhoami, giteeRepo, mapGiteeRepoAccess, DEFAULT_ACK_LABEL_GITEE, giteeLabels, giteeHasLabel, isValidGiteeLabel, suggestGiteeLabel } from './gitee.js'
|
|
28
28
|
import {
|
|
29
|
-
effectiveIntervalMs, planWakeSettlement, advanceSeen, applyWatcherAction, batchFresh, decideWake, DEFAULT_ACK_LABEL, formatWatchText,
|
|
29
|
+
effectiveIntervalMs, planWakeSettlement, advanceSeen, applyWatcherAction, batchFresh, decideWake, DEFAULT_ACK_LABEL, DEFAULT_PRIORITY, formatWatchText,
|
|
30
30
|
recordPendingWake, clearPending, pendingRetry,
|
|
31
31
|
wakeQuality,
|
|
32
32
|
parseRepoSpec, markGiteeReopened,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
|
|
47
47
|
export const name = 'dsh-session-superagent'
|
|
48
48
|
/** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
|
|
49
|
-
export const SERVER_VERSION = '0.9.
|
|
49
|
+
export const SERVER_VERSION = '0.9.259'
|
|
50
50
|
export const inject = ['tools', 'agents', 'webServer']
|
|
51
51
|
/** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
|
|
52
52
|
// 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
|
|
@@ -70,6 +70,8 @@ const DEFAULT_BATCH_LIMIT = 5
|
|
|
70
70
|
// 出处:https://json-schema.org/understanding-json-schema/reference/annotations
|
|
71
71
|
const DEFAULT_WAKES_PER_HOUR = 6
|
|
72
72
|
const DEFAULT_ISOLATE_KEEP_DAYS = 3
|
|
73
|
+
// watch.js 的 DEFAULT_PRIORITY 是排序规则的事实源;stale 是后加的扩展键,默认同样关闭。
|
|
74
|
+
const DEFAULT_TOOL_PRIORITY = Object.freeze({ ...DEFAULT_PRIORITY, stale: false })
|
|
73
75
|
// 一条会话最多挂多少守:再多轮询压力与上下文都会失控(20 条 × 每 60 秒已很密)
|
|
74
76
|
const MAX_WATCHERS_PER_SESSION = 20
|
|
75
77
|
|
|
@@ -243,7 +245,7 @@ function mergeWatermark(diskEntry, memEntry) {
|
|
|
243
245
|
return out
|
|
244
246
|
}
|
|
245
247
|
|
|
246
|
-
function writeState(state) {
|
|
248
|
+
function writeState(state, options = {}) {
|
|
247
249
|
try {
|
|
248
250
|
mkdirSync(stateDir(), { recursive: true })
|
|
249
251
|
// 合并写:调用方手里的 state 可能是很久以前读的快照(宿主重载、两个实例交替写),
|
|
@@ -251,6 +253,9 @@ function writeState(state) {
|
|
|
251
253
|
// 规则:盘上有、内存里没有的条目一律保留;只有墓碑里的 id 才允许消失。
|
|
252
254
|
const disk = readState()
|
|
253
255
|
const tombstones = { ...(disk.deleted || {}), ...(state.deleted || {}) }
|
|
256
|
+
// 只有显式的 watch_start 才能解除墓碑(用户要求重建同 id 的守)。
|
|
257
|
+
// 普通旧快照写入没有这个选项,仍然不能绕过墓碑把已删守复活。
|
|
258
|
+
for (const id of (Array.isArray(options.revive) ? options.revive : [])) delete tombstones[id]
|
|
254
259
|
const merged = { ...disk, ...state }
|
|
255
260
|
merged.watchers = { ...(disk.watchers || {}) }
|
|
256
261
|
for (const [id, watcher] of Object.entries(state.watchers || {})) {
|
|
@@ -1754,6 +1759,7 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
|
|
|
1754
1759
|
repo: w.repo,
|
|
1755
1760
|
// 面板要能一眼分出 GitHub / Gitee:否则行内只能靠 id 前缀猜
|
|
1756
1761
|
provider: w.provider === 'gitee' ? 'gitee' : 'github',
|
|
1762
|
+
ackLabel: w.ackLabel || defaultAckLabel(w.provider),
|
|
1757
1763
|
sessionId: w.sessionId,
|
|
1758
1764
|
intervalSec: w.intervalSec,
|
|
1759
1765
|
enabled: isEnabled(w),
|
|
@@ -2582,12 +2588,21 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
|
|
|
2582
2588
|
// 0. 挂载状态:面板/HTTP 靠路由,路由注册失败时工具仍然可用 —— 这种「半死」状态
|
|
2583
2589
|
// 光看工具是发现不了的(2026-11-02 真机踩过:duplicate exact route 让六条接口全灭)
|
|
2584
2590
|
if (state.server) {
|
|
2585
|
-
const
|
|
2591
|
+
const routeCount = Number(state.server.routes)
|
|
2592
|
+
const hasRouteCount = state.server.routes !== undefined && state.server.routes !== null && state.server.routes !== ''
|
|
2593
|
+
&& Number.isInteger(routeCount) && routeCount >= 0
|
|
2594
|
+
const mounted = hasRouteCount ? routeCount : null
|
|
2586
2595
|
const failed = Array.isArray(state.server.failed) ? state.server.failed : []
|
|
2587
2596
|
if (state.server.error) {
|
|
2588
2597
|
lines.push(`FAIL 面板接口挂载:${state.server.error}(工具仍可用,但面板会空白;重载一次即可)`)
|
|
2589
2598
|
} else if (failed.length > 0) {
|
|
2590
|
-
|
|
2599
|
+
// routes 是成功的 disposer 数,failed 是实际注册失败数;总数来自这次挂载,不写死。
|
|
2600
|
+
const total = mounted === null ? null : mounted + failed.length
|
|
2601
|
+
lines.push(total === null
|
|
2602
|
+
? `WARN 面板接口部分失败(成功/总数未知):${failed.join(';')}`
|
|
2603
|
+
: `WARN 面板接口部分失败(${mounted}/${total} 成功):${failed.join(';')}`)
|
|
2604
|
+
} else if (mounted === null) {
|
|
2605
|
+
lines.push('WARN 面板接口挂载:路由数未知(旧版本没有记录 routes)')
|
|
2591
2606
|
} else {
|
|
2592
2607
|
lines.push(`OK 面板接口挂载:${mounted} 条,无失败`)
|
|
2593
2608
|
}
|
|
@@ -2801,6 +2816,7 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
|
|
|
2801
2816
|
maxIsolated: { type: 'number', description: 'With isolated: keep at most this many worktrees, oldest removed first (1-50, default 5).' },
|
|
2802
2817
|
goal: { type: 'string', description: 'Optional per-watcher goal appended to the wake message.' },
|
|
2803
2818
|
ackLabel: { type: 'string', description: 'Label used as the handled marker (default 主理鱼:已处理). Two sessions watching the same repo share it unless each sets its own.' },
|
|
2819
|
+
priority: { type: 'object', description: 'Priority switches; only explicitly supplied keys are changed. Boolean keys: reopened, comments, labels, unassigned, stale. Defaults: reopened/comments/labels=true; unassigned/stale=false. additionalProperties are unrestricted.' },
|
|
2804
2820
|
},
|
|
2805
2821
|
async execute(args) {
|
|
2806
2822
|
const toolAgents = agentsService(ctx)
|
|
@@ -2835,6 +2851,7 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
|
|
|
2835
2851
|
intervalSec: 60,
|
|
2836
2852
|
cooldownMs: DEFAULT_COOLDOWN_MS,
|
|
2837
2853
|
ackLabel: defaultAckLabel(provider),
|
|
2854
|
+
priority: { ...DEFAULT_TOOL_PRIORITY },
|
|
2838
2855
|
cursor: null,
|
|
2839
2856
|
seen: {},
|
|
2840
2857
|
lastReported: {},
|
|
@@ -2876,6 +2893,15 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
|
|
|
2876
2893
|
if (typeof args.isolateKeepDays === 'number') entry.isolateKeepDays = Math.max(1, Math.min(30, Math.round(args.isolateKeepDays)))
|
|
2877
2894
|
if (typeof args.maxIsolated === 'number') entry.maxIsolated = Math.max(1, Math.min(50, Math.round(args.maxIsolated)))
|
|
2878
2895
|
if (typeof args.ackLabel === 'string' && args.ackLabel.trim()) entry.ackLabel = args.ackLabel.trim().slice(0, 60)
|
|
2896
|
+
// 工具入口与面板一样可以调五个优先级键,但部分更新不能把已有开关重置。
|
|
2897
|
+
if (args.priority && typeof args.priority === 'object' && !Array.isArray(args.priority)) {
|
|
2898
|
+
const current = entry.priority && typeof entry.priority === 'object' && !Array.isArray(entry.priority) ? entry.priority : {}
|
|
2899
|
+
const next = { ...DEFAULT_TOOL_PRIORITY, ...current }
|
|
2900
|
+
for (const key of ['reopened', 'comments', 'labels', 'unassigned', 'stale']) {
|
|
2901
|
+
if (Object.hasOwn(args.priority, key) && typeof args.priority[key] === 'boolean') next[key] = args.priority[key]
|
|
2902
|
+
}
|
|
2903
|
+
entry.priority = next
|
|
2904
|
+
}
|
|
2879
2905
|
// 审核 T40 W12:`watch_start` 的语义是「开始看」,但**静默恢复**一条暂停的守是意外行为。
|
|
2880
2906
|
// 保留恢复语义(幂等),但两件事必须做到:
|
|
2881
2907
|
// ① 如果调用方显式传了 resume:false,就保持原暂停状态(只改配置);
|
|
@@ -2894,7 +2920,8 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
|
|
|
2894
2920
|
}
|
|
2895
2921
|
}
|
|
2896
2922
|
state.watchers[id] = entry
|
|
2897
|
-
|
|
2923
|
+
// 显式 start 同 repo/session 表示要重建;只解除这个 id 的墓碑,不影响其他已删守。
|
|
2924
|
+
writeState(state, { revive: [id] })
|
|
2898
2925
|
stopWatcher(id)
|
|
2899
2926
|
startWatcher(entry)
|
|
2900
2927
|
const flags = []
|
|
@@ -3008,9 +3035,10 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
|
|
|
3008
3035
|
|
|
3009
3036
|
ctx.tools.register(defineTool({
|
|
3010
3037
|
name: 'watch_stop',
|
|
3011
|
-
description: 'Stop watching a repository for the current session.',
|
|
3038
|
+
description: 'Stop watching a repository for the current session. By default this pauses it and keeps its state; pass delete:true to remove it and leave a tombstone.',
|
|
3012
3039
|
parameters: {
|
|
3013
3040
|
repo: { type: 'string', required: true, description: 'owner/name' },
|
|
3041
|
+
delete: { type: 'boolean', description: 'Delete the watcher and persist a tombstone instead of only pausing it (default false).' },
|
|
3014
3042
|
format: { type: 'string', description: "'text' (default) or 'json'." },
|
|
3015
3043
|
},
|
|
3016
3044
|
async execute(args) {
|
|
@@ -3032,13 +3060,19 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
|
|
|
3032
3060
|
const message = 'no watcher for ' + rawRepo + '(试过 ' + candidates.join(' / ') + ')'
|
|
3033
3061
|
return (args && args.format === 'json') ? JSON.stringify({ schemaVersion: 1, ok: false, id, error: message }) : '[error: ' + message + ']'
|
|
3034
3062
|
}
|
|
3063
|
+
// 审核 T36 W2:`stopWatcher()` 同时清 timers 与 bootTimers;删除时必须先停再抹状态,
|
|
3064
|
+
// 否则正在收尾的 tick 可能把刚删的守写回来。
|
|
3065
|
+
stopWatcher(id)
|
|
3066
|
+
if (args.delete === true) {
|
|
3067
|
+
delete state.watchers[id]
|
|
3068
|
+
state.deleted = { ...(state.deleted || {}), [id]: new Date().toISOString() }
|
|
3069
|
+
writeState(state)
|
|
3070
|
+
if (args && args.format === 'json') return JSON.stringify({ schemaVersion: 1, ok: true, id, repo: args.repo, deleted: true })
|
|
3071
|
+
return `deleted ${id}(deleted:true)`
|
|
3072
|
+
}
|
|
3035
3073
|
state.watchers[id].enabled = false
|
|
3036
3074
|
writeState(state)
|
|
3037
|
-
//
|
|
3038
|
-
// 刚建好还没开始轮询的守(首轮错峰等待中)被暂停后,那个 `setTimeout` 仍会 fire,
|
|
3039
|
-
// 于是**已经停掉的守还会再 tick 一次**(含 gh 请求、可能建 worktree)。
|
|
3040
|
-
// `stopWatcher()` 两者都清,直接用它。
|
|
3041
|
-
stopWatcher(id)
|
|
3075
|
+
// 默认 JSON / 文本保持旧形状:只是暂停,不新增 deleted/stopped 字段。
|
|
3042
3076
|
if (args && args.format === 'json') return JSON.stringify({ schemaVersion: 1, ok: true, id, repo: args.repo })
|
|
3043
3077
|
return `stopped ${id}`
|
|
3044
3078
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.259",
|
|
4
4
|
"description": "Session-level superagent for DeepSeek Harness: watch a GitHub repository and wake a session when something needs doing. Credentials never reach the model.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|