agent-things 1.3.1 → 1.3.2
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/mods/agent-things-ui/.claude-plugin/plugin.json +1 -1
- package/mods/agent-things-ui/hooks/register.js +1 -1
- package/outputs/antigravity-session-status.js +1 -1
- package/outputs/codex-session-status.js +1 -1
- package/package.json +1 -1
- package/src/analysis-assets/output.en.schema.json +6 -3
- package/src/analysis-assets/output.schema.json +6 -3
- package/src/analysis-assets/prompt.en.txt +1 -1
- package/src/analysis-assets/prompt.zh-CN.txt +1 -1
- package/src/analysis-history.cjs +27 -6
- package/src/analysis-service.cjs +1 -1
- package/src/harnesses/claude/claude-source.cjs +18 -5
- package/src/harnesses/codex/codex-card-bridge.js +1 -1
- package/src/session-status.js +1 -1
|
@@ -264,7 +264,7 @@ async function draw($, e, inPane) {
|
|
|
264
264
|
const unknownTaskLabel = taskLabels.unknown || t('taskLabels')?.unknown || (activeLang === 'en' ? 'Unknown status' : '状态未知');
|
|
265
265
|
const taskRow = task => Box({ key: `task-${task.id}`, position: 'relative', flexDirection: 'row', alignItems: 'center', width: '100%', gap: 1, children: [
|
|
266
266
|
text(task.status === 'done' ? '✓' : '○', { color: task.status === 'done' ? colors.completed : colors.unfinished }),
|
|
267
|
-
Box({ flexDirection: 'column', flexGrow: 1, minWidth: 0, children: [text(task.
|
|
267
|
+
Box({ flexDirection: 'column', flexGrow: 1, minWidth: 0, children: [text(task.title || task.summary), Svg({ source: svg(`<text x="0" y="11" font-size="10" fill="currentColor" opacity=".68">${taskLabels[task.status] || unknownTaskLabel}</text>`, taskLabelWidth, 15, 'xMinYMid meet'), alt: taskLabels[task.status] || unknownTaskLabel, width: taskLabelWidth, height: 15 })] }),
|
|
268
268
|
Box({ position: 'absolute', right: 0, top: 0, height: '100%', justifyContent: 'center', alignItems: 'flex-end', display: 'none', hover: { display: 'flex' }, children: [button(`source-${task.id}`, t('viewSource'), () => operate($, 'source', { taskId: task.id }), { plain: true })] }),
|
|
269
269
|
] });
|
|
270
270
|
const content = [];
|
|
@@ -2391,7 +2391,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
2391
2391
|
element('span', null, row, 'task-dot'); const content = element('div', null, row, 'task-content');
|
|
2392
2392
|
const title = element('div', null, content, 'task-title'); title.title = task.title;
|
|
2393
2393
|
const track = element('div', null, title, 'task-track');
|
|
2394
|
-
const text = task.
|
|
2394
|
+
const text = task.title || task.summary;
|
|
2395
2395
|
element('span', text, track, 'task-copy');
|
|
2396
2396
|
element('div', taskLabels[task.status] || S('taskUnknown'), content, 'task-meta');
|
|
2397
2397
|
const ref = task.evidenceRefs?.find(value => sources?.[value]?.turnId);
|
|
@@ -1709,7 +1709,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
1709
1709
|
element('span', null, row, 'task-dot'); const content = element('div', null, row, 'task-content');
|
|
1710
1710
|
const title = element('div', null, content, 'task-title'); title.title = task.title;
|
|
1711
1711
|
const track = element('div', null, title, 'task-track');
|
|
1712
|
-
const text = task.
|
|
1712
|
+
const text = task.title || task.summary;
|
|
1713
1713
|
element('span', text, track, 'task-copy');
|
|
1714
1714
|
element('div', taskLabels[task.status] || S('taskUnknown'), content, 'task-meta');
|
|
1715
1715
|
const ref = task.evidenceRefs?.find(value => sources?.[value]?.turnId);
|
package/package.json
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
"properties": {
|
|
4
4
|
"summary": {
|
|
5
5
|
"type": "string",
|
|
6
|
-
"maxLength": 120
|
|
6
|
+
"maxLength": 120,
|
|
7
|
+
"description": "Concise overall summary (at most 120 chars) stating the current goal and remaining work."
|
|
7
8
|
},
|
|
8
9
|
"gitPush": {
|
|
9
10
|
"type": "object",
|
|
@@ -41,7 +42,8 @@
|
|
|
41
42
|
]
|
|
42
43
|
},
|
|
43
44
|
"title": {
|
|
44
|
-
"type": "string"
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "Full task title (action + target) preserving full scope; do not put completion status, waiting reasons, or progress remarks here."
|
|
45
47
|
},
|
|
46
48
|
"status": {
|
|
47
49
|
"type": "string",
|
|
@@ -61,7 +63,8 @@
|
|
|
61
63
|
},
|
|
62
64
|
"summary": {
|
|
63
65
|
"type": "string",
|
|
64
|
-
"maxLength": 60
|
|
66
|
+
"maxLength": 60,
|
|
67
|
+
"description": "Short standalone task title (at most 60 chars, concise action + target). NEVER write status remarks or blocker notes such as 'merged to main', 'pending decision', 'waiting for test', or 'not scheduled yet'."
|
|
65
68
|
}
|
|
66
69
|
},
|
|
67
70
|
"required": [
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
"properties": {
|
|
4
4
|
"summary": {
|
|
5
5
|
"type": "string",
|
|
6
|
-
"maxLength": 40
|
|
6
|
+
"maxLength": 40,
|
|
7
|
+
"description": "不超过40个汉字的整体进展摘要,说明当前核心目标与剩余工作。"
|
|
7
8
|
},
|
|
8
9
|
"gitPush": {
|
|
9
10
|
"type": "object",
|
|
@@ -41,7 +42,8 @@
|
|
|
41
42
|
]
|
|
42
43
|
},
|
|
43
44
|
"title": {
|
|
44
|
-
"type": "string"
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "完整任务标题(动作 + 目标对象),保留完整范围;不要包含完成状态、等待原因或进度评论。"
|
|
45
47
|
},
|
|
46
48
|
"status": {
|
|
47
49
|
"type": "string",
|
|
@@ -61,7 +63,8 @@
|
|
|
61
63
|
},
|
|
62
64
|
"summary": {
|
|
63
65
|
"type": "string",
|
|
64
|
-
"maxLength": 20
|
|
66
|
+
"maxLength": 20,
|
|
67
|
+
"description": "不超过20个汉字的简短任务标题(精简版动作 + 对象),供独立识别任务。严禁写成“已合入”“待定”“待实测”“未做,待安排”等纯状态描述或进展批注。"
|
|
65
68
|
}
|
|
66
69
|
},
|
|
67
70
|
"required": [
|
|
@@ -14,4 +14,4 @@ Rules:
|
|
|
14
14
|
11. `projectGit` is the remote Git state detected by the program. `gitPush` reflects delivery push status: set `pushed` (with supporting `evidenceRefs`) when conversation explicitly reports a successful push or user confirmation of push; set `not_pushed` when explicitly unpushed; otherwise `unknown`. All tasks being done alone does not prove changes were pushed. If new modifications occur after a previous push without a new push, update to `not_pushed`; if uncertain relative to prior pushes, use `unknown`. Ignore non-text attachments such as images and rely on text messages/answers.
|
|
15
15
|
12. Output strictly according to the JSON Schema with no Markdown wrapper. Totals and percentages are computed by the program after merging the ledger—do not output counts yourself.
|
|
16
16
|
13. LANGUAGE REQUIREMENT: Write `summary`, every task's `title`, and every task's short `summary` in clear, concise **English** (even if the source conversation is in Chinese or mixed languages). If `previousLedger` contains non-English titles or summaries, rewrite all affected task titles, short `summary` strings, and top-level `summary` into English while keeping their existing `knownTaskId`.
|
|
17
|
-
14. For each output task, provide both a full `title` and a concise short `summary`:
|
|
17
|
+
14. For each output task, provide both a full `title` and a concise short `summary`: BOTH must name the task as "action + target", while progress state and blockers belong strictly in `status`. Keep the full scope in `title`; write task `summary` as a short standalone task title under 60 characters (at most 2 short clauses) capturing both action and target (e.g., "Verify full session analysis", "Export delivery checklist", "Fix Linux workspace guard"). NEVER write status notes or deferral phrases like "merged to main", "pending decision", "waiting for test", or "not scheduled" in `summary`; if `previousLedger` contains status-only `summary` text, keep its `knownTaskId` and rewrite `summary` into a proper action+target short title.
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
11. projectGit 是程序检测的项目远端配置。gitPush 描述当前交付内容的推送状态:对话明确报告推送成功、或用户确认已推送时为 pushed,并引用对应事件;明确尚未推送为 not_pushed,其余为 unknown。任务全部完成不能单独证明已经推送。之后出现的新改动尚未再次推送时,应更新为 not_pushed;当前工作与历史推送的关系不明确时用 unknown。可结合上一份账本的 gitPush 和本批事件进行增量更新。图片等非文本附件不纳入分析,依据对话文本和答复识别任务。
|
|
15
15
|
12. 严格按JSON Schema输出本批任务增量与当前摘要,不附Markdown。总数和比例由程序合并账本后计算,不自行输出计数。模型结果的生效顺序由程序根据用户操作序号决定。
|
|
16
16
|
|
|
17
|
-
13. 每个输出任务同时提供完整 title 与简短 summary
|
|
17
|
+
13. 每个输出任务同时提供完整 title 与简短 summary:两者都必须写成“动作+对象”的任务名称,状态与阻塞原因统一只通过 status 表达。title 保留完整任务范围;任务 summary 是不超过20个汉字(最多2个短句)的简短任务标题,必须让人不看上下文就能认出“要做什么事”(例如“验收完整会话分析”“导出交付清单”“修复Linux守卫报错”),严禁写成“已合入main”“等锚点再定”“待用户确认”“未做,待安排”等纯状态描述或进展批注;若 previousLedger 中已有任务的 summary 属于纯状态描述,请保留其 knownTaskId 并一并改写为规范的短任务标题。
|
|
18
18
|
14. 语言要求:顶层 summary、每项任务的 title 与短 summary 一律用简体中文书写(即使原对话是英文或中英混合);代码标识、命令、文件名和产品名保留原文。previousLedger 中的任务标题、短总结或顶层 summary 不是中文时,保留其 knownTaskId,将受影响任务的 title、短 summary 及顶层 summary 改写为中文后一并返回。
|
package/src/analysis-history.cjs
CHANGED
|
@@ -46,12 +46,28 @@ function dehydrateTerminalLogs(text) {
|
|
|
46
46
|
return compacted.join('\n');
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
const MACHINE_ENVELOPE_TAGS = [
|
|
50
|
+
'heartbeat',
|
|
51
|
+
'in-app-browser-context',
|
|
52
|
+
'send_user_message_question_reply',
|
|
53
|
+
'system-reminder',
|
|
54
|
+
'task-notification',
|
|
55
|
+
'side-sessions-event',
|
|
56
|
+
'local-command-caveat',
|
|
57
|
+
'command-name',
|
|
58
|
+
'command-message',
|
|
59
|
+
'command-args',
|
|
60
|
+
'local-command-stdout',
|
|
61
|
+
'tools-used-before-summary',
|
|
62
|
+
].join('|');
|
|
63
|
+
|
|
64
|
+
const LEADING_ENVELOPE_RE = new RegExp(`^<(${MACHINE_ENVELOPE_TAGS})\\b[^>]*>([\\s\\S]*?)<\\/\\1>`);
|
|
65
|
+
|
|
66
|
+
// Strip only recognized leading machine envelopes; quoted XML and ordinary human text remain data.
|
|
67
|
+
function stripLeadingEnvelopes(text) {
|
|
68
|
+
let value = String(text || '').trim();
|
|
53
69
|
let match;
|
|
54
|
-
while ((match = value.match(
|
|
70
|
+
while ((match = value.match(LEADING_ENVELOPE_RE))) {
|
|
55
71
|
let replacement = '';
|
|
56
72
|
if (match[1] === 'send_user_message_question_reply') {
|
|
57
73
|
try {
|
|
@@ -63,6 +79,11 @@ function cleanMessage(text) {
|
|
|
63
79
|
value = (replacement + '\n' + value.slice(match[0].length)).trim();
|
|
64
80
|
if (replacement) break;
|
|
65
81
|
}
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function cleanMessage(text) {
|
|
86
|
+
let value = stripLeadingEnvelopes(text);
|
|
66
87
|
// 仅应用规则 1 (代码块脱水) 与 规则 3 (终端日志脱水),智能体正文汇报完整保留
|
|
67
88
|
value = dehydrateCodeBlocks(value);
|
|
68
89
|
value = dehydrateTerminalLogs(value);
|
|
@@ -147,4 +168,4 @@ function commitCheckpoint(extracted, ledger, versions) {
|
|
|
147
168
|
versions: { prompt: versions.prompt, schema: versions.schema, ledger: versions.ledger },
|
|
148
169
|
turnHashes: extracted.turnHashes, ledger };
|
|
149
170
|
}
|
|
150
|
-
module.exports = { extractHistory, prepareIncremental, commitCheckpoint };
|
|
171
|
+
module.exports = { extractHistory, prepareIncremental, commitCheckpoint, stripLeadingEnvelopes, cleanMessage };
|
package/src/analysis-service.cjs
CHANGED
|
@@ -12,7 +12,7 @@ const { assertUpdateIdle } = require('./npm-updates.cjs');
|
|
|
12
12
|
const { nextBatch, measureRequest, splitAdaptiveBatches, FULL_PASS_MAX_BYTES, FULL_PASS_TOKEN_BUDGET, getAnalysisInstructions } = require('./analysis-budget.cjs');
|
|
13
13
|
const { errorDetails, progressError } = require('./progress-error.cjs');
|
|
14
14
|
const { readConfiguredLang } = require('./i18n.cjs');
|
|
15
|
-
const versions = { prompt: '
|
|
15
|
+
const versions = { prompt: '5', schema: '5', ledger: '3' };
|
|
16
16
|
class AnalysisService {
|
|
17
17
|
constructor({ store, onChange = () => {}, makeServer, run,
|
|
18
18
|
resources = path.join(__dirname, 'analysis-assets'), logFile = path.join(path.dirname(store.file), 'analysis.jsonl'),
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
const crypto = require('node:crypto');
|
|
3
|
+
const { stripLeadingEnvelopes } = require('../../analysis-history.cjs');
|
|
3
4
|
|
|
4
|
-
function textContent(content) {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
function textContent(content, { stripEnvelopes = false } = {}) {
|
|
6
|
+
const cleanPart = text => (stripEnvelopes ? stripLeadingEnvelopes(text) : String(text || ''));
|
|
7
|
+
if (typeof content === 'string') return cleanPart(content);
|
|
8
|
+
return Array.isArray(content)
|
|
9
|
+
? content.filter(part => part?.type === 'text').map(part => cleanPart(part.text || '')).filter(Boolean).join('\n')
|
|
10
|
+
: '';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function cleanCompactSummary(text) {
|
|
14
|
+
let value = String(text || '').trim();
|
|
15
|
+
value = value.replace(/^This session is being continued from a previous conversation[\s\S]*?(?=<system-reminder>|\bSummary:)/i, '');
|
|
16
|
+
value = stripLeadingEnvelopes(value);
|
|
17
|
+
value = value.replace(/\n+(?:If you need specific details from before compaction|Continue the conversation from where it left off|Please continue the conversation|If you are working with the user|The messages after this summary are the most recent messages from before compaction)[\s\S]*$/i, '').trim();
|
|
18
|
+
return value ? `[前情摘要]\n${value}` : '';
|
|
7
19
|
}
|
|
8
20
|
|
|
9
21
|
function transcriptTurns(result) {
|
|
@@ -21,9 +33,10 @@ function appendTranscriptEntry(turns, entry) {
|
|
|
21
33
|
function cleanTranscriptMessage(entry) {
|
|
22
34
|
const message = entry.message || entry;
|
|
23
35
|
const role = message.role || entry.type;
|
|
24
|
-
if (!['user', 'assistant'].includes(role) || entry.isSidechain) return null;
|
|
36
|
+
if (!['user', 'assistant'].includes(role) || entry.isSidechain || entry.isMeta) return null;
|
|
25
37
|
if (role === 'assistant' && message.stop_reason && message.stop_reason !== 'end_turn') return null;
|
|
26
|
-
|
|
38
|
+
let original = textContent(message.content, { stripEnvelopes: true });
|
|
39
|
+
if (role === 'user' && entry.isCompactSummary) original = cleanCompactSummary(original);
|
|
27
40
|
const text = original.length > 24000 ? `${original.slice(0, 12000)}\n[内容已精简]\n${original.slice(-12000)}` : original;
|
|
28
41
|
if (!text.trim()) return null;
|
|
29
42
|
const id = entry.uuid || entry.id;
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
-
request('ui/initialize', { appInfo: { name: 'agent-things', version: window.__agentThingsVersion || '1.3.
|
|
124
|
+
request('ui/initialize', { appInfo: { name: 'agent-things', version: window.__agentThingsVersion || '1.3.2' }, appCapabilities: {}, protocolVersion: '2026-01-26' }, 5000)
|
|
125
125
|
.then(result => {
|
|
126
126
|
theme = result?.hostContext?.theme;
|
|
127
127
|
if (theme === 'light' || theme === 'dark') {
|
package/src/session-status.js
CHANGED
|
@@ -823,7 +823,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
823
823
|
element('span', null, row, 'task-dot'); const content = element('div', null, row, 'task-content');
|
|
824
824
|
const title = element('div', null, content, 'task-title'); title.title = task.title;
|
|
825
825
|
const track = element('div', null, title, 'task-track');
|
|
826
|
-
const text = task.
|
|
826
|
+
const text = task.title || task.summary;
|
|
827
827
|
element('span', text, track, 'task-copy');
|
|
828
828
|
element('div', taskLabels[task.status] || S('taskUnknown'), content, 'task-meta');
|
|
829
829
|
const ref = task.evidenceRefs?.find(value => sources?.[value]?.turnId);
|