@suifei/dsh-ai-team 0.4.105 → 0.4.108
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 +32 -0
- package/client.js +88 -2
- package/index.js +23 -5
- package/lib/runtime/deferral-guard.js +20 -2
- package/lib/skillopt/handoff-answerer.js +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.108 - 2026-11-16
|
|
4
|
+
|
|
5
|
+
**handoff 作答题面原样转交**
|
|
6
|
+
|
|
7
|
+
- 0.4.105 在每道 handoff 题前加了一句「只输出这道题的答案原文:不要调用工具、不要解释、不要代码围栏」。
|
|
8
|
+
il2c night 7 实测(首个跑完的 dsh 来源夜间环,9 个挖出任务):回放题转去复述这句要求而不是完成任务,
|
|
9
|
+
判分题在 JSON 前夹带说明(`judge-parse-failed`),留出集 0.000 → 0.000,反思环节也被这句话带偏;
|
|
10
|
+
- 引擎题面自带输出格式要求,现在原样转交,不加任何前言;
|
|
11
|
+
|
|
12
|
+
## 0.4.107 - 2026-11-16
|
|
13
|
+
|
|
14
|
+
**主对话打开即在最新消息(#33)**
|
|
15
|
+
|
|
16
|
+
- 主对话的滚动容器此前没有任何滚动管理:每次打开、切项目、切标签重新挂载都停在顶部最早的消息,
|
|
17
|
+
和主理人对话要先手动拖到底;
|
|
18
|
+
- 新增跟随算法 `createStreamFollower`:打开或切换后贴底,内容晚到/变高(卡片展开、字体加载)继续贴底;
|
|
19
|
+
停在底部附近(≤48px)即跟随,新消息到达自动贴底;上翻阅读时数据刷新不改变滚动位置,只累计未读,
|
|
20
|
+
底部浮出「↓ N 条新消息」按钮一键回到最新(零高度锚点 + 绝对定位,不进文档流);
|
|
21
|
+
- 测试:`test/client-stream-follow.test.js` 4 例(按 `<stream-follow>` 标记取出 client.js 中的同一份算法单测);
|
|
22
|
+
|
|
23
|
+
## 0.4.106 - 2026-11-16
|
|
24
|
+
|
|
25
|
+
**handoff 自动作答实机两处缺陷**
|
|
26
|
+
|
|
27
|
+
- **推进纪律误伤一次性子代理**:作答子代理是 PMO 宿主的子会话,0.4.101 的纪律段与纠偏按父会话认它为团队会话。
|
|
28
|
+
il2c 实机:题面引用会话原文「tonight or tomorrow」,纠偏插入后子代理转去调 `skillopt_status`,答案作废。
|
|
29
|
+
现在按 `subagent/descriptor` 的 label(`skillopt-*`:判官、生成、handoff 作答)排除,宿主启动时也直接登记;
|
|
30
|
+
- **已结束的子代理一直判「在跑」**:回合 16:39:59 已结束,`observeChild` 在 agents/sessions 里都查不到它,
|
|
31
|
+
兜底返回 running。作答改走评审子代理实测可用的 `activation.result`(`awaitActivationText`),文本按 childId
|
|
32
|
+
收在内存;插件重启丢失的按 15 分钟 TTL 重问;
|
|
33
|
+
- 测试:`test/team-discipline.test.js` 新增 1 例(去掉修复即失败);
|
|
34
|
+
|
|
3
35
|
## 0.4.105 - 2026-11-16
|
|
4
36
|
|
|
5
37
|
**夜间 SkillOpt 环(handoff 后端)由评审官自动作答,不再停在「有待回答」**
|
package/client.js
CHANGED
|
@@ -244,6 +244,7 @@ window.__ModuleLoader__.load({
|
|
|
244
244
|
notifyInbox: '新的待办已进入收件箱',
|
|
245
245
|
notifyWake: 'Agent 已唤醒',
|
|
246
246
|
notifyStream: '主对话有新消息',
|
|
247
|
+
streamUnseen: '{count} 条新消息',
|
|
247
248
|
notifyClose: '关闭通知',
|
|
248
249
|
workspaceRequired: '请先设置项目工作目录。',
|
|
249
250
|
workspaceSaved: '项目工作目录已保存。',
|
|
@@ -662,6 +663,7 @@ window.__ModuleLoader__.load({
|
|
|
662
663
|
notifyInbox: 'New inbox item',
|
|
663
664
|
notifyWake: 'Agent woken',
|
|
664
665
|
notifyStream: 'New main-stream message',
|
|
666
|
+
streamUnseen: '{count} new messages',
|
|
665
667
|
notifyClose: 'Dismiss notification',
|
|
666
668
|
workspaceRequired: 'Set the Project workspace first.',
|
|
667
669
|
workspaceSaved: 'Project workspace saved.',
|
|
@@ -1120,6 +1122,9 @@ window.__ModuleLoader__.load({
|
|
|
1120
1122
|
.at-banner b { color: var(--dsw-alias-state-warn-label); font-weight: 500; }
|
|
1121
1123
|
.at-stream { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 18px 8px; scrollbar-width: thin; scrollbar-color: var(--dsw-alias-scrollbar-bg-l1) transparent; }
|
|
1122
1124
|
.at-streaminner { width: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
|
|
1125
|
+
.at-streamjumpanchor { position: relative; height: 0; }
|
|
1126
|
+
.at-streamjump { position: absolute; left: 50%; bottom: 8px; z-index: 5; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 999px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-secondary); font: inherit; font-size: 12px; line-height: 18px; white-space: nowrap; cursor: pointer; box-shadow: var(--dsw-elevation-panel, 0 4px 12px var(--dsw-alias-bg-mask-2)); }
|
|
1127
|
+
.at-streamjump:hover { color: var(--dsw-alias-label-primary); }
|
|
1123
1128
|
.at-msg { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
|
|
1124
1129
|
.at-avatar { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--dsw-alias-border-l2); border-radius: 999px; background: var(--dsw-alias-bg-layer-3); color: var(--dsw-alias-label-secondary); font-size: 10px; font-weight: 500; }
|
|
1125
1130
|
.at-avatar-human { border-color: transparent; background: var(--dsw-alias-button-primary-fill); color: var(--dsw-alias-label-primary-inverted); }
|
|
@@ -1428,6 +1433,7 @@ window.__ModuleLoader__.load({
|
|
|
1428
1433
|
if (name === 'dot') return h('svg', common, h('circle', { cx: 8, cy: 8, r: 3.5, fill: 'currentColor', stroke: 'none' }));
|
|
1429
1434
|
if (name === 'layers') return h('svg', common, h('path', { d: 'M8 2.5 14 6 8 9.5 2 6Z' }), h('path', { d: 'M2 9.5 8 13l6-3.5' }));
|
|
1430
1435
|
if (name === 'chevron') return h('svg', common, h('path', { d: 'M6 3.5 10.5 8 6 12.5' }));
|
|
1436
|
+
if (name === 'down') return h('svg', common, h('path', { d: 'M8 3v10M3.5 8.5 8 13l4.5-4.5' }));
|
|
1431
1437
|
if (name === 'loop') return h('svg', { width: 18, height: 18, viewBox: '0 0 32 32', fill: 'none', 'aria-hidden': 'true', focusable: 'false' }, h('rect', { x: 2.5, y: 5.5, width: 21, height: 21, rx: 6.5, stroke: 'currentColor', strokeWidth: 2.6 }), h('circle', { cx: 23.5, cy: 16, r: 4.8, fill: 'var(--dsw-alias-state-business-primary)' }));
|
|
1432
1438
|
return null;
|
|
1433
1439
|
}
|
|
@@ -2622,6 +2628,44 @@ window.__ModuleLoader__.load({
|
|
|
2622
2628
|
effortHint ? h('div', { className: 'at-fieldhint' }, effortHint) : null);
|
|
2623
2629
|
}
|
|
2624
2630
|
|
|
2631
|
+
// <stream-follow>
|
|
2632
|
+
/**
|
|
2633
|
+
* 主对话的「跟随最新」判定(#33:打开主对话总停在最早的消息,要手动拖到底)。
|
|
2634
|
+
* 只读写传入元素的 scrollTop/scrollHeight/clientHeight,不碰 DOM 结构,便于单测。
|
|
2635
|
+
* - 打开主对话 / 切项目(reset)后贴底,内容晚到或变高时继续贴底;
|
|
2636
|
+
* - 用户停在底部附近(≤ threshold)即视为跟随,新消息到达自动贴底;
|
|
2637
|
+
* - 用户上翻后不动其位置(数据刷新不得改变用户滚动位置),只累计未读数,
|
|
2638
|
+
* 由「↓ N 条新消息」按钮(jump)回到底部。
|
|
2639
|
+
*/
|
|
2640
|
+
function createStreamFollower({ threshold = 48 } = {}) {
|
|
2641
|
+
let pinned = true;
|
|
2642
|
+
let unseen = 0;
|
|
2643
|
+
let count = null;
|
|
2644
|
+
const distance = (el) => el.scrollHeight - el.scrollTop - el.clientHeight;
|
|
2645
|
+
const bottom = (el) => Math.max(0, el.scrollHeight - el.clientHeight);
|
|
2646
|
+
return {
|
|
2647
|
+
reset() { pinned = true; unseen = 0; count = null; },
|
|
2648
|
+
onScroll(el) {
|
|
2649
|
+
pinned = distance(el) <= threshold;
|
|
2650
|
+
if (pinned) unseen = 0;
|
|
2651
|
+
return unseen;
|
|
2652
|
+
},
|
|
2653
|
+
/** 消息数或内容变化后调用;返回 { scrollTo: number|null, unseen }。 */
|
|
2654
|
+
onContent(el, nextCount) {
|
|
2655
|
+
const grown = count === null ? 0 : Math.max(0, nextCount - count);
|
|
2656
|
+
count = nextCount;
|
|
2657
|
+
if (pinned) { unseen = 0; return { scrollTo: bottom(el), unseen }; }
|
|
2658
|
+
unseen += grown;
|
|
2659
|
+
return { scrollTo: null, unseen };
|
|
2660
|
+
},
|
|
2661
|
+
/** 布局变高(卡片展开、字体晚到)时调用:跟随中才贴底。 */
|
|
2662
|
+
onResize(el) { return pinned ? bottom(el) : null; },
|
|
2663
|
+
jump(el) { pinned = true; unseen = 0; return bottom(el); },
|
|
2664
|
+
get pinned() { return pinned; },
|
|
2665
|
+
};
|
|
2666
|
+
}
|
|
2667
|
+
// </stream-follow>
|
|
2668
|
+
|
|
2625
2669
|
function Workbench({ t, ctx }) {
|
|
2626
2670
|
const [phase, setPhase] = React.useState('loading');
|
|
2627
2671
|
const [data, setData] = React.useState(null);
|
|
@@ -2776,6 +2820,42 @@ window.__ModuleLoader__.load({
|
|
|
2776
2820
|
const replyRef = React.useRef(null);
|
|
2777
2821
|
const triggerRef = React.useRef(null);
|
|
2778
2822
|
const mobileRef = React.useRef(null);
|
|
2823
|
+
// #33 主对话跟随最新(算法见 createStreamFollower)。
|
|
2824
|
+
const streamRef = React.useRef(null);
|
|
2825
|
+
const followerRef = React.useRef(null);
|
|
2826
|
+
if (followerRef.current === null) followerRef.current = createStreamFollower();
|
|
2827
|
+
const [streamUnseen, setStreamUnseen] = React.useState(0);
|
|
2828
|
+
const streamItems = Array.isArray(data?.stream) ? data.stream : [];
|
|
2829
|
+
const streamTail = streamItems.length > 0 ? streamItems[streamItems.length - 1]?.id ?? '' : '';
|
|
2830
|
+
const streamShown = scope === 'project' && tab === 'main';
|
|
2831
|
+
React.useLayoutEffect(() => {
|
|
2832
|
+
followerRef.current.reset();
|
|
2833
|
+
setStreamUnseen(0);
|
|
2834
|
+
}, [projectId, scope, tab]);
|
|
2835
|
+
React.useLayoutEffect(() => {
|
|
2836
|
+
const el = streamRef.current;
|
|
2837
|
+
if (!streamShown || el === null || el === undefined) return;
|
|
2838
|
+
const step = followerRef.current.onContent(el, streamItems.length);
|
|
2839
|
+
if (step.scrollTo !== null) el.scrollTop = step.scrollTo;
|
|
2840
|
+
setStreamUnseen(step.unseen);
|
|
2841
|
+
}, [projectId, streamShown, streamItems.length, streamTail]);
|
|
2842
|
+
React.useLayoutEffect(() => {
|
|
2843
|
+
const el = streamRef.current;
|
|
2844
|
+
const inner = el?.firstElementChild;
|
|
2845
|
+
if (!streamShown || inner === null || inner === undefined || typeof ResizeObserver !== 'function') return undefined;
|
|
2846
|
+
const observer = new ResizeObserver(() => {
|
|
2847
|
+
const to = followerRef.current.onResize(el);
|
|
2848
|
+
if (to !== null) el.scrollTop = to;
|
|
2849
|
+
});
|
|
2850
|
+
observer.observe(inner);
|
|
2851
|
+
return () => observer.disconnect();
|
|
2852
|
+
}, [projectId, streamShown, data !== null]);
|
|
2853
|
+
const onStreamScroll = (event) => setStreamUnseen(followerRef.current.onScroll(event.currentTarget));
|
|
2854
|
+
const jumpToLatest = () => {
|
|
2855
|
+
const el = streamRef.current;
|
|
2856
|
+
if (el !== null && el !== undefined) el.scrollTop = followerRef.current.jump(el);
|
|
2857
|
+
setStreamUnseen(0);
|
|
2858
|
+
};
|
|
2779
2859
|
// R-08 快捷键:composer 聚焦句柄 + `?` 帮助浮层开关。
|
|
2780
2860
|
const composerInputRef = React.useRef(null);
|
|
2781
2861
|
const [shortcutsOpen, setShortcutsOpen] = React.useState(false);
|
|
@@ -4209,7 +4289,7 @@ window.__ModuleLoader__.load({
|
|
|
4209
4289
|
})
|
|
4210
4290
|
: tab === 'situation'
|
|
4211
4291
|
? h(Situation, { t, quadrants, tasks, onItem: openQuadrantItem, onViewAll: viewQuadrant })
|
|
4212
|
-
: h('div', { className: 'at-stream', role: 'tabpanel', id: 'at-panel-main', 'aria-labelledby': 'at-tab-main' },
|
|
4292
|
+
: h(React.Fragment, null, h('div', { className: 'at-stream', role: 'tabpanel', id: 'at-panel-main', 'aria-labelledby': 'at-tab-main', ref: streamRef, onScroll: onStreamScroll },
|
|
4213
4293
|
h('div', { className: 'at-streaminner', role: 'log', 'aria-live': 'polite', 'aria-label': t('streamAria') },
|
|
4214
4294
|
h(TeamPulse, { t, agents: data.agents, tasks, onOpen: openTask, onCancelAllPending: cancelAllPending, cancelBusy: cancelAllBusy }),
|
|
4215
4295
|
data.stream.length
|
|
@@ -4233,7 +4313,13 @@ window.__ModuleLoader__.load({
|
|
|
4233
4313
|
agents: data.agents,
|
|
4234
4314
|
onSetWorkspace: openWorkspaceEditor,
|
|
4235
4315
|
onExample: () => setDraft(t('emptyStreamExample')),
|
|
4236
|
-
})))
|
|
4316
|
+
}))),
|
|
4317
|
+
// 零高度锚点 + 绝对定位按钮:不进文档流,不改变任何滚动位置。
|
|
4318
|
+
streamUnseen > 0
|
|
4319
|
+
? h('div', { className: 'at-streamjumpanchor' },
|
|
4320
|
+
h('button', { className: 'at-streamjump', type: 'button', onClick: jumpToLatest },
|
|
4321
|
+
h(Ico, { name: 'down', size: 12 }), tf(t, 'streamUnseen', { count: streamUnseen })))
|
|
4322
|
+
: null);
|
|
4237
4323
|
|
|
4238
4324
|
return h('div', { className: 'at-root', role: 'region', 'aria-label': t('panel') },
|
|
4239
4325
|
h('div', { className: 'at-top' },
|
package/index.js
CHANGED
|
@@ -44,7 +44,8 @@ import { isJobExpired, listJobs, readJob, writeJob } from './lib/skillopt/jobs.j
|
|
|
44
44
|
|
|
45
45
|
/** 评审通道 job 的兜底 TTL:与子代理通道(jobs.js JOB_TTL_MS)保持一致。 */
|
|
46
46
|
const REVIEW_JOB_TTL_MS = 30 * 60 * 1000;
|
|
47
|
-
import {
|
|
47
|
+
import { reconcileJobs } from './lib/skillopt/job-runner.js';
|
|
48
|
+
import { awaitActivationText } from './lib/skillopt/subagent-text.js';
|
|
48
49
|
import { HANDOFF_DIR, stepHandoff } from './lib/skillopt/handoff-answerer.js';
|
|
49
50
|
import { execFile } from 'node:child_process';
|
|
50
51
|
import { collectReview, startReview } from './lib/skillopt/review-runner.js';
|
|
@@ -690,7 +691,7 @@ export function apply(ctx, config = {}) {
|
|
|
690
691
|
// il2c 2997 次唤醒里 pmo_dispatch 为 0)。进程内状态,重启即清空——重启时本就没有回合在跑。
|
|
691
692
|
const turnsInFlight = new Set();
|
|
692
693
|
// 团队推进纪律:系统提示词段 + 回合收尾时纠偏「把行动挂在钟点上」(il2c:「今夜 03:17 自然相裁决点」)。
|
|
693
|
-
let teamDiscipline = { observe: () => {}, dispose: () => {} };
|
|
694
|
+
let teamDiscipline = { observe: () => {}, exempt: () => {}, dispose: () => {} };
|
|
694
695
|
try {
|
|
695
696
|
teamDiscipline = registerTeamDiscipline({
|
|
696
697
|
systemPrompt: serviceOf(ctx, 'systemPrompt'),
|
|
@@ -1144,6 +1145,10 @@ export function apply(ctx, config = {}) {
|
|
|
1144
1145
|
// 一样不受 pmoAuto/停止门约束:夜间环是 Human 排的,与 PMO 派发无关。
|
|
1145
1146
|
// 不 await:重跑引擎可能耗时,不能拖住 tick;同一工作区同时只推进一步。
|
|
1146
1147
|
const handoffBusy = new Set();
|
|
1148
|
+
// 作答子代理的最终文本按 childId 收在内存里:activation.result 是评审子代理实测可用的
|
|
1149
|
+
// 取数路径;已结束的子代理在 agents/sessions 里查不到,observeChild 会一直报 running
|
|
1150
|
+
// (il2c 实机:16:39:59 回合已结束,15 分钟仍判在跑)。插件重启后内存丢失,按 TTL 重问。
|
|
1151
|
+
const handoffAnswers = new Map();
|
|
1147
1152
|
const answerHandoff = (projectRuntime) => {
|
|
1148
1153
|
const workspace = String(projectRuntime?.service?.state?.projects?.[projectRuntime.id]?.workspacePath ?? '').trim();
|
|
1149
1154
|
if (workspace === '' || handoffBusy.has(workspace) || !existsSync(join(workspace, HANDOFF_DIR, 'pending.json'))) return;
|
|
@@ -1155,16 +1160,29 @@ export function apply(ctx, config = {}) {
|
|
|
1155
1160
|
diag: (row) => diag.append(row),
|
|
1156
1161
|
startChild: async (label, request) => {
|
|
1157
1162
|
const parentInfo = await ensureParent(projectRuntime);
|
|
1158
|
-
const
|
|
1163
|
+
const activation = await serviceOf(ctx, 'subagents').startActivation(activationSpec({
|
|
1159
1164
|
provider: resolveSubagentProviderName(serviceOf(ctx, 'subagents'), config?.subagentProviderName),
|
|
1160
1165
|
label,
|
|
1161
1166
|
request: { cwd: request.cwd, prompt: [{ type: 'text', text: request.prompt }], parent: parentInfo?.agent },
|
|
1162
1167
|
delivery: 'parent',
|
|
1163
1168
|
signal: new AbortController().signal,
|
|
1164
1169
|
}));
|
|
1165
|
-
|
|
1170
|
+
const childId = activation.childId;
|
|
1171
|
+
teamDiscipline.exempt(childId);
|
|
1172
|
+
awaitActivationText(activation, { timeoutMs: 14 * 60 * 1000 })
|
|
1173
|
+
.catch(() => '')
|
|
1174
|
+
.then(async (text) => {
|
|
1175
|
+
handoffAnswers.set(childId, typeof text === 'string' ? text : '');
|
|
1176
|
+
try { await activation?.dispose?.(); } catch { /* already gone */ }
|
|
1177
|
+
});
|
|
1178
|
+
return { childId, outputStart: activation.outputStart ?? null };
|
|
1179
|
+
},
|
|
1180
|
+
observe: (childId) => {
|
|
1181
|
+
if (!handoffAnswers.has(childId)) return { status: 'running', events: [] };
|
|
1182
|
+
const text = handoffAnswers.get(childId);
|
|
1183
|
+
handoffAnswers.delete(childId);
|
|
1184
|
+
return { status: 'idle', events: [], text };
|
|
1166
1185
|
},
|
|
1167
|
-
observe: (childId, outputStart) => observeChild(ctx, childId, outputStart),
|
|
1168
1186
|
rerun: (runScript) => new Promise((resolve) => {
|
|
1169
1187
|
execFile('powershell.exe', ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', runScript], { windowsHide: true, timeout: 30 * 60 * 1000 }, (error) => {
|
|
1170
1188
|
resolve({ exitCode: error ? (typeof error.code === 'number' ? error.code : null) : 0 });
|
|
@@ -79,15 +79,20 @@ export const TEAM_DISCIPLINE_TEXT = [
|
|
|
79
79
|
* diag?: { append?: (row: object) => void },
|
|
80
80
|
* newId: () => string,
|
|
81
81
|
* }} options
|
|
82
|
-
* @returns {{ observe: (session: any, event: any) => void, stopping: (payload: any) => Promise<void>, dispose: () => void }}
|
|
82
|
+
* @returns {{ observe: (session: any, event: any) => void, stopping: (payload: any) => Promise<void>, exempt: (sessionId: string) => void, dispose: () => void }}
|
|
83
83
|
*/
|
|
84
84
|
export function registerTeamDiscipline({ systemPrompt, on, teamProjectOf, diag, newId }) {
|
|
85
85
|
const disposers = [];
|
|
86
86
|
// 团队会话 = 自己在账本里(PMO 宿主 / 已绑定成员),或父会话在账本里。后者覆盖两种情况:
|
|
87
87
|
// 成员激活时的第一个回合(提示词组装早于账本记下 sessionId,r36 实测成员首窗缺纪律段),
|
|
88
88
|
// 以及 PMO / 成员派生的临时子智能体(il2c:PMO 派生的 moyuan-tail267 承担了整个波尾)。
|
|
89
|
+
// SkillOpt 的一次性子代理(判官、handoff 作答)不是团队会话:纪律段与纠偏会进入它们的
|
|
90
|
+
// 上下文,污染判分与留出验证门(il2c 实机:作答题里引用了会话原文「tonight or tomorrow」,
|
|
91
|
+
// 纠偏一插,子代理转去调 skillopt_status,答案作废)。按 subagent/descriptor 的 label
|
|
92
|
+
// 认出它们,宿主侧启动时也可直接登记(exempt)。
|
|
93
|
+
const oneShot = new Set();
|
|
89
94
|
const projectFor = (sessionId, parentId) => {
|
|
90
|
-
if (typeof sessionId !== 'string') return null;
|
|
95
|
+
if (typeof sessionId !== 'string' || oneShot.has(sessionId)) return null;
|
|
91
96
|
return teamProjectOf(sessionId) ?? (typeof parentId === 'string' && parentId !== '' ? teamProjectOf(parentId) : null);
|
|
92
97
|
};
|
|
93
98
|
const parentOf = (holder) => holder?.session?.header?.parentSession ?? holder?.header?.parentSession;
|
|
@@ -111,6 +116,10 @@ export function registerTeamDiscipline({ systemPrompt, on, teamProjectOf, diag,
|
|
|
111
116
|
const observe = (session, event) => {
|
|
112
117
|
const sessionId = session?.id;
|
|
113
118
|
if (typeof sessionId !== 'string') return;
|
|
119
|
+
if (event?.type === 'subagent/descriptor' && isOneShotLabel(event?.data?.label)) {
|
|
120
|
+
oneShot.add(sessionId);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
114
123
|
if (event?.type === 'turn/start') {
|
|
115
124
|
lastText.delete(sessionId);
|
|
116
125
|
return;
|
|
@@ -149,16 +158,25 @@ export function registerTeamDiscipline({ systemPrompt, on, teamProjectOf, diag,
|
|
|
149
158
|
return {
|
|
150
159
|
observe,
|
|
151
160
|
stopping,
|
|
161
|
+
exempt: (sessionId) => {
|
|
162
|
+
if (typeof sessionId === 'string' && sessionId !== '') oneShot.add(sessionId);
|
|
163
|
+
},
|
|
152
164
|
dispose: () => {
|
|
153
165
|
for (const dispose of disposers.splice(0)) {
|
|
154
166
|
try { dispose?.(); } catch { /* already disposed */ }
|
|
155
167
|
}
|
|
156
168
|
lastText.clear();
|
|
157
169
|
steered.clear();
|
|
170
|
+
oneShot.clear();
|
|
158
171
|
},
|
|
159
172
|
};
|
|
160
173
|
}
|
|
161
174
|
|
|
175
|
+
/** SkillOpt 一次性子代理的 label(判官 skillopt-judge-*、生成 skillopt-optimize-*、作答 skillopt-reviewer-handoff-*)。 */
|
|
176
|
+
export function isOneShotLabel(label) {
|
|
177
|
+
return typeof label === 'string' && label.startsWith('skillopt-');
|
|
178
|
+
}
|
|
179
|
+
|
|
162
180
|
/** 纠偏消息:同一回合最多一次,给出明确的「例外」出口,防止与真实钟点任务死磕。 */
|
|
163
181
|
export function deferralCorrection(phrase) {
|
|
164
182
|
return [
|
|
@@ -24,7 +24,6 @@ const STATE_FILE = 'answerer.json';
|
|
|
24
24
|
const DEFAULT_CONCURRENCY = 3;
|
|
25
25
|
const DEFAULT_TTL_MS = 15 * 60 * 1000;
|
|
26
26
|
const DEFAULT_MAX_ATTEMPTS = 2;
|
|
27
|
-
const ANSWER_RULE = '只输出这道题的答案原文:不要调用工具、不要解释、不要代码围栏。';
|
|
28
27
|
|
|
29
28
|
/** 读 pending.json,归一成 [{id, prompt, answerFile}];没有或读不了返回 null。 */
|
|
30
29
|
export function readPendingCalls(workspace) {
|
|
@@ -136,7 +135,10 @@ export async function stepHandoff({ workspace, deps }) {
|
|
|
136
135
|
try {
|
|
137
136
|
const child = await deps.startChild(`skillopt-reviewer-handoff-${call.id}`, {
|
|
138
137
|
cwd: workspace,
|
|
139
|
-
|
|
138
|
+
// 题面原样转交,不加任何前言:引擎的题面自带输出格式要求。il2c night 7 实测,
|
|
139
|
+
// 一句「只输出这道题的答案原文」让回放题转去复述这句要求、判分题在 JSON 前
|
|
140
|
+
// 夹带说明(judge-parse-failed),留出集 0.000 → 0.000。
|
|
141
|
+
prompt: call.prompt,
|
|
140
142
|
});
|
|
141
143
|
entry.childId = child.childId;
|
|
142
144
|
entry.outputStart = child.outputStart ?? null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suifei/dsh-ai-team",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.108",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "文渊阁 (Wenyuan Pavilion) — AI Team mode for DeepSeek Harness: concurrent projects, owned tasks, threads, inbox and an append-only team ledger",
|
|
6
6
|
"license": "MIT",
|