@sema-agent/client-core 0.70.2 → 0.71.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/CHANGELOG.md +25 -0
- package/README.md +5 -4
- package/dist/adapt/arms.js +110 -2
- package/dist/adapt/textStream.d.ts +15 -1
- package/dist/adapt/textStream.js +83 -12
- package/dist/adapter/downstream/eventToSdkMessage.d.ts +23 -19
- package/dist/adapter/downstream/eventToSdkMessage.js +186 -24
- package/dist/agentsWireCaps.d.ts +0 -7
- package/dist/agentsWireCaps.js +1 -7
- package/dist/cloudConfigWireCaps.js +1 -1
- package/dist/decideReceipt.d.ts +5 -5
- package/dist/decideReceipt.js +2 -4
- package/dist/engineErrorCodes.d.ts +6 -10
- package/dist/engineErrorCodes.js +8 -11
- package/dist/engineNoticeCodes.d.ts +3 -7
- package/dist/engineNoticeCodes.js +16 -4
- package/dist/hitl/toolApprovalWire.d.ts +11 -1
- package/dist/hitl/toolApprovalWire.js +2 -0
- package/dist/mcpPanel.d.ts +16 -3
- package/dist/mcpPanel.js +13 -0
- package/dist/mcpWireCaps.d.ts +1 -1
- package/dist/modelCapabilityProbe.d.ts +1 -1
- package/dist/modelCapabilityProbe.js +1 -1
- package/dist/seam.d.ts +98 -3
- package/dist/seam.js +23 -1
- package/dist/toolRoster.d.ts +21 -0
- package/dist/toolRoster.js +13 -8
- package/docs/INTEGRATION-CLIENTS.md +72 -11
- package/package.json +6 -6
|
@@ -2,6 +2,8 @@ import { stamp, } from '../types.js';
|
|
|
2
2
|
import { turnUsageToModelUsage } from './turnUsageToModelUsage.js';
|
|
3
3
|
// 0.60.0(engine ≥7.64.0 / sdk 8.4.0):`tool_end.gate` 的三端共用窄读器(判定归包,端不许自拼)。
|
|
4
4
|
import { gateOutcomeOf } from '../../gateOutcome.js';
|
|
5
|
+
// CC-08(0.71.0):名册与名册增量的窄读器归 toolRoster.ts(0.63.0 起在),本层只接线。
|
|
6
|
+
import { projectToolRoster, projectToolRosterDelta } from '../../toolRoster.js';
|
|
5
7
|
import { SEGMENT_END_IDENTITY_KEYS } from '../types.js';
|
|
6
8
|
// 0.65.0(core 7.12.0 CHANGELOG「Removed (BREAKING)」`WiringManifest.autoMode.breaker`):
|
|
7
9
|
// 熔断族整只退役 ⇒ 本臂此前对 `autoMode.breaker` 的窄读(`classifierBreakerOf`)与它的型位一并
|
|
@@ -37,6 +39,11 @@ const SUGGESTION_CHARS_CAP = 200;
|
|
|
37
39
|
* 即红。`turn_usage` 的铸点在 runStream.ts(usage 聚合腿),不在本文件的 switch 里,同属本表。
|
|
38
40
|
*/
|
|
39
41
|
export const INTERNAL_SDK_ARM_TYPES = new Set([
|
|
42
|
+
// CC-08(0.71.0,sdk 9.6.0):两条新帧 → 中性内部臂(print 车道按 text_end 同律吞/转;裸透传 = 越界帧)。
|
|
43
|
+
'tool_disclosure',
|
|
44
|
+
'tool_progress',
|
|
45
|
+
'tool_roster_delta',
|
|
46
|
+
'context_usage',
|
|
40
47
|
'workflow_complete',
|
|
41
48
|
'tool_end_result',
|
|
42
49
|
'retry_status',
|
|
@@ -174,8 +181,18 @@ export function eventToSdkMessage(ev, ctx) {
|
|
|
174
181
|
* 三段),名册增量没有可挂的基线 ⇒ **有痕 dropped**,与 0.65.0 前的 `approval_request` 同形(不静默、
|
|
175
182
|
* 不 not_in_slice);接上 `tools` 段的那一批把它一起接。
|
|
176
183
|
*/
|
|
177
|
-
case 'tool_roster_delta':
|
|
178
|
-
|
|
184
|
+
case 'tool_roster_delta': {
|
|
185
|
+
// CC-08 ①(0.71.0):L-315 收口 —— 名册增量接上(此前有痕 dropped)。`delta` 读不出 ⇒ malformed(server 判不出形整帧不发,
|
|
186
|
+
// 本层读不出就是坏帧);三键身份原样透传。宿主按 `fromDigest` 与手上名册比对(applyToolRosterDelta),包不持名册。
|
|
187
|
+
const raw = ev;
|
|
188
|
+
const delta = projectToolRosterDelta(raw.delta);
|
|
189
|
+
if (delta === undefined)
|
|
190
|
+
return dropped('malformed', 'tool_roster_delta');
|
|
191
|
+
const { identity, bad } = identityOrMalformed(raw, 'tool_roster_delta');
|
|
192
|
+
if (bad !== null)
|
|
193
|
+
return bad;
|
|
194
|
+
return projected(stamp(ctx, armBody({ type: 'tool_roster_delta', delta, ...identity })));
|
|
195
|
+
}
|
|
179
196
|
// ── `human_input`(core 5.14.0 design/171 / server 7.4.0 SSE,[3017]/[3020])────────────
|
|
180
197
|
// 🔴 **到期复核已兑现(sdk 6.9.0 提货,2026-08-08)**:本臂此前是 switch **之前**的一条 raw
|
|
181
198
|
// 预分派(理由 = 它还没进 SDK 6.3.0 的 `AgentEvent` union,`case 'human_input'` 在 `ev.type`
|
|
@@ -666,8 +683,12 @@ export function eventToSdkMessage(ev, ctx) {
|
|
|
666
683
|
// `eventId` 与别的臂同律带上(core 铸的事件身份;wire 未必带 ⇒ 缺席时键不在场)。
|
|
667
684
|
// 🔴 主会话收货门 A1c 抓出的死臂:适配层 `wiringManifestArm` 读 `m.eventId`,而本层原来没投它,
|
|
668
685
|
// 那句透传永远是空 —— 消费端拿不到幂等键,durable 重放只能退到内容去重。
|
|
669
|
-
|
|
670
|
-
|
|
686
|
+
// 三键身份同函数透传 + 坏值不买路(异源对抗复审第 1 轮 finding②:修前只留 eventId,臂看不见 sourceTaskId / bgAgentId,
|
|
687
|
+
// 子代的接线快照(0.71.0 起含 tools 名册)会上 leader 面、被端当作名册重同步基线)。
|
|
688
|
+
const { identity, bad } = identityOrMalformed(raw, 'wiring_manifest');
|
|
689
|
+
if (bad !== null)
|
|
690
|
+
return bad;
|
|
691
|
+
return projected(stamp(ctx, armBody({ type: 'wiring_manifest', ...body, ...identity })));
|
|
671
692
|
}
|
|
672
693
|
case 'task_notification': {
|
|
673
694
|
// 载荷两形:嵌在 `notification` 里(server 早期形)或直接摊在帧上(今天的 union 形)。
|
|
@@ -812,7 +833,6 @@ export function eventToSdkMessage(ev, ctx) {
|
|
|
812
833
|
case 'file_link':
|
|
813
834
|
case 'prompt_assembled':
|
|
814
835
|
case 'model_usage':
|
|
815
|
-
case 'context_usage':
|
|
816
836
|
case 'config_assembled':
|
|
817
837
|
// `needs_review`:plan-review park 的**事件**形;壳消费的是 done{status:'needs_review'} 终帧
|
|
818
838
|
// (runStream 的 plan_review_park chrome 臂),事件形在本切片重复且更早,故不投影。
|
|
@@ -886,6 +906,16 @@ export function eventToSdkMessage(ev, ctx) {
|
|
|
886
906
|
// 身份键**根本不在** SDK 臂声明里(SDK 从 SSE `id:` stamp),收窄形上读它们是编译错。
|
|
887
907
|
case 'engine_notice':
|
|
888
908
|
return engineNoticeProjection(ev, ctx);
|
|
909
|
+
// CC-08(0.71.0,sdk 9.6.0 换钉):两条新帧。投影仍走 raw `Record` 视图(理由同 engine_notice:
|
|
910
|
+
// wire 是 JSON,必填是 server 的承诺不是本层的前提;缺席/坏值逐键诚实处理)。
|
|
911
|
+
case 'tool_disclosure':
|
|
912
|
+
return toolDisclosureProjection(ev, ctx);
|
|
913
|
+
// CC-08 ③(0.71.0):`context_usage` 从 not_in_slice 组里拿出来 —— sections(core 7.18.0 #790)是「这条腿的系统提示词
|
|
914
|
+
// 由哪些段组成、哪一段大」,fleet/HUD 面要渲;三个标量走 finite 门(非有限即缺席,永不 null)。
|
|
915
|
+
case 'context_usage':
|
|
916
|
+
return contextUsageProjection(ev, ctx);
|
|
917
|
+
case 'tool_progress':
|
|
918
|
+
return toolProgressProjection(ev, ctx);
|
|
889
919
|
default:
|
|
890
920
|
// B5 穷举:SDK union 加成员必须在**编译期**打红这一行(而不是让新臂在用户面静默丢帧)。
|
|
891
921
|
assertNeverArm(ev);
|
|
@@ -894,6 +924,91 @@ export function eventToSdkMessage(ev, ctx) {
|
|
|
894
924
|
return dropped('unknown_arm', String(ev.type ?? 'unknown'));
|
|
895
925
|
}
|
|
896
926
|
}
|
|
927
|
+
/** CC-08:三键身份(sdk `EventIdentity`)—— 在场非串 ⇒ 坏值不买路;在场(含空串)⇒ 原样透传;`eventId` 非空才带。 */
|
|
928
|
+
function identityOrMalformed(ev, arm) {
|
|
929
|
+
for (const k of SEGMENT_END_IDENTITY_KEYS) {
|
|
930
|
+
if (ev[k] !== undefined && typeof ev[k] !== 'string')
|
|
931
|
+
return { identity: {}, bad: dropped('malformed', arm) };
|
|
932
|
+
}
|
|
933
|
+
const identity = {};
|
|
934
|
+
for (const k of ['eventId', ...SEGMENT_END_IDENTITY_KEYS]) {
|
|
935
|
+
// 🔴 三键**空串也透**:子流律是「键在场 = 子代帧」(`isSubFlowSegmentEnd` / `text_end` 投影同律),按 length>0 才抄会把
|
|
936
|
+
// `sourceTaskId: ''` 的子代帧洗成主流(异源对抗复审第 1 轮 finding③);`eventId` 是幂等键,仍要非空。
|
|
937
|
+
if (typeof ev[k] === 'string' && (k === 'eventId' ? ev[k].length > 0 : true))
|
|
938
|
+
identity[k] = ev[k];
|
|
939
|
+
}
|
|
940
|
+
return { identity, bad: null };
|
|
941
|
+
}
|
|
942
|
+
/** 非空串数组窄读:非数组 ⇒ undefined(调用方判 malformed);数组里的非串 / 空串按 server 律**逐个滤掉**。 */
|
|
943
|
+
function nameList(v) {
|
|
944
|
+
if (!Array.isArray(v))
|
|
945
|
+
return undefined;
|
|
946
|
+
return v.filter((x) => typeof x === 'string' && x.length > 0);
|
|
947
|
+
}
|
|
948
|
+
const nonNegInt = (v) => typeof v === 'number' && Number.isInteger(v) && v >= 0 ? v : undefined;
|
|
949
|
+
/**
|
|
950
|
+
* `tool_disclosure` → 中性内部臂(CC-08,0.71.0;core design/393 S3 第二缝,sdk 9.6.0)。
|
|
951
|
+
* 这条腿的工具**名字占位普查**:`policy` 开集三词(core 加一档要能穿过 default 臂)/ `thresholdPercent?`
|
|
952
|
+
* (🔴 缺席 = `always`/`never` 两档下根本没查过阈值,**不是**默认百分比;坏值 ⇒ 键不铸不丢帧)/
|
|
953
|
+
* `deferred[]` / `activated[]`(全量快照,整只替换;数组里的非串空串逐个滤 = server 律同形)。
|
|
954
|
+
* 🔴 三只必需位缺一 ⇒ `malformed`:半张普查表会被读成「只有这些被延迟」。
|
|
955
|
+
*/
|
|
956
|
+
function toolDisclosureProjection(ev, ctx) {
|
|
957
|
+
const policy = ev.policy;
|
|
958
|
+
if (typeof policy !== 'string' || policy.length === 0)
|
|
959
|
+
return dropped('malformed', 'tool_disclosure');
|
|
960
|
+
const deferred = nameList(ev.deferred);
|
|
961
|
+
const activated = nameList(ev.activated);
|
|
962
|
+
if (deferred === undefined || activated === undefined)
|
|
963
|
+
return dropped('malformed', 'tool_disclosure');
|
|
964
|
+
if (Array.isArray(ev.activated) && ev.activated.some((x) => typeof x !== 'string'))
|
|
965
|
+
return dropped('malformed', 'tool_disclosure');
|
|
966
|
+
const { identity, bad } = identityOrMalformed(ev, 'tool_disclosure');
|
|
967
|
+
if (bad !== null)
|
|
968
|
+
return bad;
|
|
969
|
+
const threshold = typeof ev.thresholdPercent === 'number' && Number.isFinite(ev.thresholdPercent) && ev.thresholdPercent >= 0
|
|
970
|
+
? ev.thresholdPercent
|
|
971
|
+
: undefined;
|
|
972
|
+
return projected(stamp(ctx, armBody({
|
|
973
|
+
type: 'tool_disclosure',
|
|
974
|
+
policy,
|
|
975
|
+
...(threshold !== undefined ? { thresholdPercent: threshold } : {}),
|
|
976
|
+
deferred,
|
|
977
|
+
activated,
|
|
978
|
+
...identity,
|
|
979
|
+
})));
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* `tool_progress` → 中性内部臂(CC-08,0.71.0;DV-741,clay C-R50 裁「一帧两拍」入 divergence 册,本包按裁定形投)。
|
|
983
|
+
* `toolCallId` / `toolName` 必在(接不回自己 `tool_start` 的 tick 挂不上卡 ⇒ `malformed`);
|
|
984
|
+
* `elapsedTimeSeconds?`(🔴 缺席不是 0);`output?` 在场 = 尾巴窗口(UNTRUSTED RAW,与 `tool_end.output` 同类,
|
|
985
|
+
* 绝不回喂模型)+ `totalLines?` / `totalBytes?`;`output` 缺席 ⇒ 后两键**一起**不铸(server 律:三者按 output 在场判)。
|
|
986
|
+
*/
|
|
987
|
+
function toolProgressProjection(ev, ctx) {
|
|
988
|
+
const toolCallId = ev.toolCallId;
|
|
989
|
+
const toolName = ev.toolName;
|
|
990
|
+
if (typeof toolCallId !== 'string' || toolCallId.length === 0)
|
|
991
|
+
return dropped('malformed', 'tool_progress');
|
|
992
|
+
if (typeof toolName !== 'string' || toolName.length === 0)
|
|
993
|
+
return dropped('malformed', 'tool_progress');
|
|
994
|
+
const { identity, bad } = identityOrMalformed(ev, 'tool_progress');
|
|
995
|
+
if (bad !== null)
|
|
996
|
+
return bad;
|
|
997
|
+
const elapsed = nonNegInt(ev.elapsedTimeSeconds);
|
|
998
|
+
const output = typeof ev.output === 'string' ? ev.output : undefined;
|
|
999
|
+
const totalLines = output !== undefined ? nonNegInt(ev.totalLines) : undefined;
|
|
1000
|
+
const totalBytes = output !== undefined ? nonNegInt(ev.totalBytes) : undefined;
|
|
1001
|
+
return projected(stamp(ctx, armBody({
|
|
1002
|
+
type: 'tool_progress',
|
|
1003
|
+
toolCallId,
|
|
1004
|
+
toolName,
|
|
1005
|
+
...(elapsed !== undefined ? { elapsedTimeSeconds: elapsed } : {}),
|
|
1006
|
+
...(output !== undefined ? { output } : {}),
|
|
1007
|
+
...(totalLines !== undefined ? { totalLines } : {}),
|
|
1008
|
+
...(totalBytes !== undefined ? { totalBytes } : {}),
|
|
1009
|
+
...identity,
|
|
1010
|
+
})));
|
|
1011
|
+
}
|
|
897
1012
|
/**
|
|
898
1013
|
* `text_end` → 中性内部**段边界**臂(#323 / core #447)。
|
|
899
1014
|
*
|
|
@@ -983,24 +1098,8 @@ function segmentEndProjection(ev, ctx, arm) {
|
|
|
983
1098
|
? projected(stamp(ctx, armBody({ type: 'text_end', content, ...identity })))
|
|
984
1099
|
: projected(stamp(ctx, armBody({ type: 'reasoning_end', content, ...identity })));
|
|
985
1100
|
}
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
*
|
|
989
|
-
* 🔴 **空数组 ≠ 缺席,两者都要能被消费端分辨**(core 顶注逐字:"an empty array is *this leg
|
|
990
|
-
* declared no servers*, absence is an older mint or an external derivation")⇒ **真的**空数组
|
|
991
|
-
* 原样铸成 `[]`。把它折成缺席 = 把「我一台都没申报」这句**正面事实**说成「不知道」。
|
|
992
|
-
* 🔴 **但「过滤后为空」不是「原本就是空」**(异源对抗复审 r1 [medium] 采纳,真病):一份
|
|
993
|
-
* `[{name:'github', errorCode:'http_503'}]`(缺 `status`)进来时,唯一那一行被下面的逐行判据
|
|
994
|
-
* 丢掉 —— 若照样铸出 `[]`,消费端按本臂的义务④读到的是**「这条腿一台都没申报」这句肯定话**,
|
|
995
|
-
* 一份读不懂的回体就此被伪装成一个确定的零申报。⇒ **非空输入而零行幸存 ⇒ 整段缺席**
|
|
996
|
-
* (「我读不出来」不是「我知道是零」)。这与下面「逐条独立」并不矛盾:只要**还有幸存者**,
|
|
997
|
-
* 半张表仍是真读数,坏行照旧只丢自己。
|
|
998
|
-
* 🔴 **逐条独立**:一条坏行只丢自己(与 server 侧 `continue` 同判据),绝不因为一条坏行丢整表。
|
|
999
|
-
* 🔴 **逐键挑,禁 spread**:core 往条目上加新键时必须由人显式处置 —— 而它下一个加的很可能又是
|
|
1000
|
-
* 一个像 `error` 那样的自由文本面。(0.60.0 按此显式处置了 S6-B 的 `delivered` / `httpStatus`。)
|
|
1001
|
-
* ⚠️ `toolCount` 按**有限数**判(`Number.isFinite`),不按真值判:`0` 是合法读数(连上了、零工具),
|
|
1002
|
-
* 折成缺席会让「连上了但没工具」与「没报」在消费端同形。
|
|
1003
|
-
*/
|
|
1101
|
+
const _mcpEntryViewPin = true;
|
|
1102
|
+
void _mcpEntryViewPin;
|
|
1004
1103
|
export function projectMcpSection(raw) {
|
|
1005
1104
|
if (!Array.isArray(raw))
|
|
1006
1105
|
return undefined;
|
|
@@ -1117,14 +1216,77 @@ function wiringManifestSupersetBody(ev) {
|
|
|
1117
1216
|
// 空数组是一句正面事实(「这条腿一台都没申报」),拿它当「没有这一段」会让 `mcp: []` 的帧连同
|
|
1118
1217
|
// 另两段一起落回 `not_in_slice`,而那正是 core 顶注点名要防的读法。
|
|
1119
1218
|
const mcp = projectMcpSection(ev.mcp);
|
|
1120
|
-
|
|
1219
|
+
// CC-08 ①(0.71.0):第四/五/六段进切片 —— tools(L-315;读器归 toolRoster.ts)/ hooks[] / lsp{mounted, lane?}。
|
|
1220
|
+
const tools = projectToolRoster(ev);
|
|
1221
|
+
const hooks = projectHooksSection(ev.hooks);
|
|
1222
|
+
const lsp = projectLspSection(ev.lsp);
|
|
1223
|
+
if (modelGate === undefined && autoMode === undefined && mcp === undefined && tools === undefined && hooks === undefined && lsp === undefined)
|
|
1121
1224
|
return undefined;
|
|
1122
1225
|
return {
|
|
1123
1226
|
...(modelGate !== undefined ? { _sema_modelGate: modelGate } : {}),
|
|
1124
1227
|
...(autoMode !== undefined ? { _sema_autoMode: autoMode } : {}),
|
|
1125
1228
|
...(mcp !== undefined ? { _sema_mcp: mcp } : {}),
|
|
1229
|
+
...(tools !== undefined ? { _sema_tools: tools } : {}),
|
|
1230
|
+
...(hooks !== undefined ? { _sema_hooks: hooks } : {}),
|
|
1231
|
+
...(lsp !== undefined ? { _sema_lsp: lsp } : {}),
|
|
1126
1232
|
};
|
|
1127
1233
|
}
|
|
1234
|
+
function projectHooksSection(raw) {
|
|
1235
|
+
if (!Array.isArray(raw))
|
|
1236
|
+
return undefined;
|
|
1237
|
+
const rows = [];
|
|
1238
|
+
for (const r of raw) {
|
|
1239
|
+
if (typeof r !== 'object' || r === null || Array.isArray(r))
|
|
1240
|
+
continue;
|
|
1241
|
+
const o = r;
|
|
1242
|
+
if (typeof o.family !== 'string' || o.family.length === 0 || typeof o.owner !== 'string' || o.owner.length === 0)
|
|
1243
|
+
continue;
|
|
1244
|
+
rows.push({ family: o.family, owner: o.owner, ...(o.observational === true ? { observational: true } : {}) });
|
|
1245
|
+
}
|
|
1246
|
+
return rows.length > 0 ? rows : undefined;
|
|
1247
|
+
}
|
|
1248
|
+
function projectLspSection(raw) {
|
|
1249
|
+
if (typeof raw !== 'object' || raw === null || Array.isArray(raw))
|
|
1250
|
+
return undefined;
|
|
1251
|
+
const o = raw;
|
|
1252
|
+
if (typeof o.mounted !== 'boolean')
|
|
1253
|
+
return undefined;
|
|
1254
|
+
return { mounted: o.mounted, ...(typeof o.lane === 'string' && o.lane.length > 0 ? { lane: o.lane } : {}) };
|
|
1255
|
+
}
|
|
1256
|
+
function contextUsageProjection(ev, ctx) {
|
|
1257
|
+
const { identity, bad } = identityOrMalformed(ev, 'context_usage');
|
|
1258
|
+
if (bad !== null)
|
|
1259
|
+
return bad;
|
|
1260
|
+
const fin = (v) => (typeof v === 'number' && Number.isFinite(v) ? v : undefined);
|
|
1261
|
+
const usedTokens = fin(ev.usedTokens);
|
|
1262
|
+
const windowTokens = fin(ev.windowTokens);
|
|
1263
|
+
const compactAtTokens = fin(ev.compactAtTokens);
|
|
1264
|
+
let sections;
|
|
1265
|
+
if (Array.isArray(ev.sections)) {
|
|
1266
|
+
const rows = [];
|
|
1267
|
+
for (const r of ev.sections) {
|
|
1268
|
+
if (typeof r !== 'object' || r === null || Array.isArray(r))
|
|
1269
|
+
continue;
|
|
1270
|
+
const o = r;
|
|
1271
|
+
const tokens = fin(o.tokens);
|
|
1272
|
+
if (typeof o.id !== 'string' || o.id.length === 0 || tokens === undefined)
|
|
1273
|
+
continue; // 坏行逐条丢(server 律同形)
|
|
1274
|
+
rows.push({ id: o.id, tokens, ...(typeof o.kind === 'string' && o.kind.length > 0 ? { kind: o.kind } : {}) });
|
|
1275
|
+
}
|
|
1276
|
+
if (rows.length > 0)
|
|
1277
|
+
sections = rows; // 全丢光 ⇒ 键缺席(= 这条腿没装配出段 IR,不是各段为零)
|
|
1278
|
+
}
|
|
1279
|
+
if (usedTokens === undefined && windowTokens === undefined && compactAtTokens === undefined && sections === undefined)
|
|
1280
|
+
return nothing('empty_payload');
|
|
1281
|
+
return projected(stamp(ctx, armBody({
|
|
1282
|
+
type: 'context_usage',
|
|
1283
|
+
...(usedTokens !== undefined ? { usedTokens } : {}),
|
|
1284
|
+
...(windowTokens !== undefined ? { windowTokens } : {}),
|
|
1285
|
+
...(compactAtTokens !== undefined ? { compactAtTokens } : {}),
|
|
1286
|
+
...(sections !== undefined ? { sections } : {}),
|
|
1287
|
+
...identity,
|
|
1288
|
+
})));
|
|
1289
|
+
}
|
|
1128
1290
|
function engineNoticeProjection(ev, ctx) {
|
|
1129
1291
|
const code = typeof ev.code === 'string' && ev.code.length > 0 ? ev.code : undefined;
|
|
1130
1292
|
if (code === undefined)
|
package/dist/agentsWireCaps.d.ts
CHANGED
|
@@ -5,13 +5,6 @@ export declare const MAX_AGENT_TEXT_CHARS = 4096;
|
|
|
5
5
|
export declare const MAX_AGENT_SYSTEM_PROMPT_CHARS = 65536;
|
|
6
6
|
export declare const MAX_AGENT_TOOLS = 64;
|
|
7
7
|
export declare const MAX_AGENT_TOOL_NAME_CHARS = 128;
|
|
8
|
-
/**
|
|
9
|
-
* 🔴 **已退役(0.70.2,CC-18):本常量不再被任何投影读**,保留导出只为不破型面,随下一个 minor 删。
|
|
10
|
-
* server 7.78.1 的 `agents[].skills` 臂删掉了 `v.length <= MAX_AGENT_SKILLS`(7.78.0 及以前仍有),
|
|
11
|
-
* 引擎侧改按字节预算渲染技能清单;包侧再按 10 条截 = 在一道已不存在的门下面**静默丢技能**,
|
|
12
|
-
* 与顶层 `SKILL_CAPS.items`(0.70.0 退役)是同一个病形的同轴存量。
|
|
13
|
-
*/
|
|
14
|
-
export declare const MAX_AGENT_SKILLS = 10;
|
|
15
8
|
export declare const MAX_AGENT_SKILL_CONTENT_CHARS = 1048576;
|
|
16
9
|
export declare const MAX_AGENT_MAX_TURNS = 1000;
|
|
17
10
|
/** server 1.205 TASK_AGENT_FIELD_SHAPES 的 15 字段白名单(permissionMode 显式拒收,不在表内)。 */
|
package/dist/agentsWireCaps.js
CHANGED
|
@@ -16,13 +16,7 @@ export const MAX_AGENT_TEXT_CHARS = 4_096;
|
|
|
16
16
|
export const MAX_AGENT_SYSTEM_PROMPT_CHARS = 65_536;
|
|
17
17
|
export const MAX_AGENT_TOOLS = 64;
|
|
18
18
|
export const MAX_AGENT_TOOL_NAME_CHARS = 128;
|
|
19
|
-
|
|
20
|
-
* 🔴 **已退役(0.70.2,CC-18):本常量不再被任何投影读**,保留导出只为不破型面,随下一个 minor 删。
|
|
21
|
-
* server 7.78.1 的 `agents[].skills` 臂删掉了 `v.length <= MAX_AGENT_SKILLS`(7.78.0 及以前仍有),
|
|
22
|
-
* 引擎侧改按字节预算渲染技能清单;包侧再按 10 条截 = 在一道已不存在的门下面**静默丢技能**,
|
|
23
|
-
* 与顶层 `SKILL_CAPS.items`(0.70.0 退役)是同一个病形的同轴存量。
|
|
24
|
-
*/
|
|
25
|
-
export const MAX_AGENT_SKILLS = 10;
|
|
19
|
+
// 0.71.0(CC-18 收口):`MAX_AGENT_SKILLS` 常量已删(0.70.2 退役保留一版;server 7.78.1 起 agents[].skills 无条数帽)。
|
|
26
20
|
export const MAX_AGENT_SKILL_CONTENT_CHARS = 1_048_576;
|
|
27
21
|
export const MAX_AGENT_MAX_TURNS = 1_000;
|
|
28
22
|
/** server 1.205 TASK_AGENT_FIELD_SHAPES 的 15 字段白名单(permissionMode 显式拒收,不在表内)。 */
|
|
@@ -100,7 +100,7 @@ export function cloudMcpToSpecs(servers, env) {
|
|
|
100
100
|
...(s.elicitation === true ? { elicitation: true } : {}),
|
|
101
101
|
// ── 0.64.2 族扫(cli L-167① 的**同形存量第二处**)─────────────────────────────────────
|
|
102
102
|
// 病形与 `mcpWireCaps.mcpConfigToSpec` **逐字同一条**:这也是一次逐键白名单重建,而
|
|
103
|
-
// settings-schema 的 mcp 段上有**解析透明键**(`z.unknown()`;1.10.0 两员 `source` / `toolFaces
|
|
103
|
+
// settings-schema 的 mcp 段上有**解析透明键**(`z.unknown()`;1.10.0 两员 `source` / `toolFaces`,2.0.0 同形〔2026-09-16 核〕)。
|
|
104
104
|
// 上游对 `toolFaces` 的成文是「三条腿(请求 / config-center / 本地 config.d)同一条规则」——
|
|
105
105
|
// 本函数正是 **config-center 那条腿落到请求面**的投影,只修本地那条 = 同形存量留一半:
|
|
106
106
|
// 用 center 下发配置的部署,运维声明的 per-tool 面照样在包边界被静默剥掉。
|
package/dist/decideReceipt.d.ts
CHANGED
|
@@ -97,16 +97,16 @@ export interface DecideRefusalDetail {
|
|
|
97
97
|
detail: string;
|
|
98
98
|
/**
|
|
99
99
|
* **同一个决定再发一次有没有用**。
|
|
100
|
-
* 🔴
|
|
101
|
-
* `host_unknown` = `false`(无重试价值);`
|
|
102
|
-
* (
|
|
103
|
-
* ⚠️ `true` **不带窗**:server
|
|
100
|
+
* 🔴 两个码上的取值各有出处(见 `engineErrorCodes.ts` 的逐码顶注),**不是**按严重程度排的:
|
|
101
|
+
* `host_unknown` = `false`(无重试价值);`remember_unsupported` = `true`(去掉 `remember` 重发)。
|
|
102
|
+
* 0.71.0 CC-20:曾有第三码(宿主没停在 park 上,可重发)已随 server 7.72.0 退役,那条车道改铸新 run 不再拒。
|
|
103
|
+
* ⚠️ `true` **不带窗**:server 在这两个码上**从不**铸 `retryAfterSec`(它只在
|
|
104
104
|
* `RESUME_RETRY_LATER_CODES` 那两码上铸)⇒ 端**不许**据此渲一个编出来的倒计时。
|
|
105
105
|
*/
|
|
106
106
|
resendable: boolean;
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
|
-
* 一个 decide 失败抛出物 → {@link DecideRefusalDetail}
|
|
109
|
+
* 一个 decide 失败抛出物 → {@link DecideRefusalDetail};不是这两个码之一 ⇒ `null`。
|
|
110
110
|
*
|
|
111
111
|
* 🔴 **判型是闭集的,消费面是开集的**(与 `resumeRefusalFromError` 逐字同律):不认识的码一律
|
|
112
112
|
* `null` ⇒ 端一个字都不补 ⇒ 机器可读那一行(`API Error: <status> <errorCode> · <msg>`)原样上屏。
|
package/dist/decideReceipt.js
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* 消费端渲卡时:**在场**才说「执行时被放行/被否」,缺席一个字都不说。
|
|
33
33
|
*/
|
|
34
34
|
import { gateOutcomeOf } from './gateOutcome.js';
|
|
35
|
-
import {
|
|
35
|
+
import { DECIDE_WORKFLOW_HOST_UNKNOWN, DECIDE_WORKFLOW_LANE_CODES, DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, } from './engineErrorCodes.js';
|
|
36
36
|
/** 受理形/parked 回执上那个**唯一**表示「受理了、还没做完」的状态词(sdk README §9.0.0 逐字)。 */
|
|
37
37
|
const STATUS_RESUMING = 'resuming';
|
|
38
38
|
/** 非空串窄读(与本包其余读面同一条:空串 = 没这一格)。 */
|
|
@@ -101,17 +101,15 @@ export function decideAcceptedNotResolved(receipt) {
|
|
|
101
101
|
*/
|
|
102
102
|
const DECIDE_REFUSAL_SENTENCES = Object.freeze({
|
|
103
103
|
[DECIDE_WORKFLOW_HOST_UNKNOWN]: 'this workflow run carries no originating session to deliver the decision to, so re-sending the same decision cannot help; the approval is still pending and can be decided again once the run is reachable',
|
|
104
|
-
[DECIDE_WORKFLOW_HOST_NOT_PARKED]: 'the host session is not sitting on a wakeable pause right now, so this delivery had nowhere to land; the approval is still pending — send it again once the host parks, or resume that run directly',
|
|
105
104
|
[DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED]: 'this lane refuses to remember the decision for the session; re-send the same decision without the remember option — nothing was consumed by this refusal',
|
|
106
105
|
});
|
|
107
106
|
/** 按码给出的 `resendable`(单铸;理由逐码写在 `engineErrorCodes.ts` 的顶注里)。 */
|
|
108
107
|
const DECIDE_RESENDABLE = Object.freeze({
|
|
109
108
|
[DECIDE_WORKFLOW_HOST_UNKNOWN]: false,
|
|
110
|
-
[DECIDE_WORKFLOW_HOST_NOT_PARKED]: true,
|
|
111
109
|
[DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED]: true,
|
|
112
110
|
});
|
|
113
111
|
/**
|
|
114
|
-
* 一个 decide 失败抛出物 → {@link DecideRefusalDetail}
|
|
112
|
+
* 一个 decide 失败抛出物 → {@link DecideRefusalDetail};不是这两个码之一 ⇒ `null`。
|
|
115
113
|
*
|
|
116
114
|
* 🔴 **判型是闭集的,消费面是开集的**(与 `resumeRefusalFromError` 逐字同律):不认识的码一律
|
|
117
115
|
* `null` ⇒ 端一个字都不补 ⇒ 机器可读那一行(`API Error: <status> <errorCode> · <msg>`)原样上屏。
|
|
@@ -258,14 +258,6 @@ export declare const RESUME_RETRY_LATER_CODES: readonly string[];
|
|
|
258
258
|
* `runId` 自己去看那条 run(或换一条路 resume 它)。
|
|
259
259
|
*/
|
|
260
260
|
export declare const DECIDE_WORKFLOW_HOST_UNKNOWN = "decide.workflow_host_unknown";
|
|
261
|
-
/**
|
|
262
|
-
* `decide.workflow_host_not_parked`(409;同上:「宿主此刻没停在可唤醒的 park 上 ⇒ **等它再 park
|
|
263
|
-
* 后重发**,或据 `runId` 自行 resume」)。
|
|
264
|
-
* 🔴 与上一码**刻意分成两个词**:这一个**可以**重发(宿主是时序问题),上一个不能。
|
|
265
|
-
* ⚠️ 但它**不在** {@link RESUME_RETRY_LATER_CODES} 里,也不该在 —— 那张表闭的是「server 在哪些码上
|
|
266
|
-
* 铸 `retryAfterSec`」,而本码**恒无窗**(server 给不出「等多久」)。可等 ≠ 有窗。
|
|
267
|
-
*/
|
|
268
|
-
export declare const DECIDE_WORKFLOW_HOST_NOT_PARKED = "decide.workflow_host_not_parked";
|
|
269
261
|
/**
|
|
270
262
|
* `decide.workflow_remember_unsupported`(400;同上:「本车道 fail-closed 拒 `remember:"session"`」)。
|
|
271
263
|
* 🔴 出路是**去掉 `remember` 重发**,而且 sdk 顶注逐字保证「零副作用」——这一格与另外两个 409
|
|
@@ -273,14 +265,18 @@ export declare const DECIDE_WORKFLOW_HOST_NOT_PARKED = "decide.workflow_host_not
|
|
|
273
265
|
*/
|
|
274
266
|
export declare const DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED = "decide.workflow_remember_unsupported";
|
|
275
267
|
/**
|
|
276
|
-
* `/decide` workflow 车道的拒绝码**闭集**(
|
|
268
|
+
* `/decide` workflow 车道的拒绝码**闭集**(两员;0.71.0 CC-20 退役 `host_not_parked` 后从三员收成两员)。
|
|
277
269
|
*
|
|
278
270
|
* 🔴 闭的不是「`decide.*` 一共有几个码」(那仍是开集:`approval_binding_mismatch` /
|
|
279
271
|
* `approval_stale` / `gate_not_tool_approval` 等都不在本表,它们各有既有处置),闭的是
|
|
280
|
-
*
|
|
272
|
+
* 「**这两个码是 workflow 那条新车道独有的、而且各自有一句人话**」。
|
|
281
273
|
* 🔴 **形制**:`Object.freeze` 的数组,不是 `ReadonlySet`(同 {@link RESUME_RETRY_LATER_CODES} 的
|
|
282
274
|
* 已定谳病形 —— `ReadonlySet` 只在类型面只读,而判定查的就是公面上这同一个实例)。
|
|
283
275
|
* 🔴 加成员必须**同批**补那一句人话 + 判据,不许靠 `decide.` 前缀放宽(前缀下住着三种处置)。
|
|
276
|
+
* 🔴 **删成员义务**(0.71.0 CC-20 补):上游退役某码(sdk errors.d.ts 顶注 ⚰️ RETIRED 无别名)⇒ 同批删常量、出路句、
|
|
277
|
+
* `resendable` 行,退役词进 census 门登记;decide-receipt 门 E0 对每一员钉「上游仍活着」,上游退役当天先红。
|
|
278
|
+
* 📋 **刻意不镜像**:`decide.workflow_park_identity_lost`(server 7.71.0 引入、7.75.0 退役,sdk 从未建模,继任 `decide.workflow_resume_not_admitted`
|
|
279
|
+
* 家族由 sdk 类承载);端收到未知 `decide.*` 码一律走开集通用行(机器行原样上屏),本表不为已退役码留位。
|
|
284
280
|
*/
|
|
285
281
|
export declare const DECIDE_WORKFLOW_LANE_CODES: readonly string[];
|
|
286
282
|
/** 这条 workflow 的 park 真相**读不出来**(店抛了 / 超时 / 记录不在 / 记录还在跑)。
|
package/dist/engineErrorCodes.js
CHANGED
|
@@ -351,14 +351,8 @@ export const RESUME_RETRY_LATER_CODES = Object.freeze([
|
|
|
351
351
|
* `runId` 自己去看那条 run(或换一条路 resume 它)。
|
|
352
352
|
*/
|
|
353
353
|
export const DECIDE_WORKFLOW_HOST_UNKNOWN = 'decide.workflow_host_unknown';
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
* 后重发**,或据 `runId` 自行 resume」)。
|
|
357
|
-
* 🔴 与上一码**刻意分成两个词**:这一个**可以**重发(宿主是时序问题),上一个不能。
|
|
358
|
-
* ⚠️ 但它**不在** {@link RESUME_RETRY_LATER_CODES} 里,也不该在 —— 那张表闭的是「server 在哪些码上
|
|
359
|
-
* 铸 `retryAfterSec`」,而本码**恒无窗**(server 给不出「等多久」)。可等 ≠ 有窗。
|
|
360
|
-
*/
|
|
361
|
-
export const DECIDE_WORKFLOW_HOST_NOT_PARKED = 'decide.workflow_host_not_parked';
|
|
354
|
+
// 0.71.0(CC-20):`decide.workflow_host_not_parked` 常量与出路句**整只退役**(server 7.72.0 退役无别名,sdk errors.d.ts ⚰️ 顶注:
|
|
355
|
+
// ≥7.72.0 永不再发 —— 那条车道有了第二条腿,宿主没停在 park 上时改铸新 run,不再拒);退役词由 census 门钉零命中。
|
|
362
356
|
/**
|
|
363
357
|
* `decide.workflow_remember_unsupported`(400;同上:「本车道 fail-closed 拒 `remember:"session"`」)。
|
|
364
358
|
* 🔴 出路是**去掉 `remember` 重发**,而且 sdk 顶注逐字保证「零副作用」——这一格与另外两个 409
|
|
@@ -366,18 +360,21 @@ export const DECIDE_WORKFLOW_HOST_NOT_PARKED = 'decide.workflow_host_not_parked'
|
|
|
366
360
|
*/
|
|
367
361
|
export const DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED = 'decide.workflow_remember_unsupported';
|
|
368
362
|
/**
|
|
369
|
-
* `/decide` workflow 车道的拒绝码**闭集**(
|
|
363
|
+
* `/decide` workflow 车道的拒绝码**闭集**(两员;0.71.0 CC-20 退役 `host_not_parked` 后从三员收成两员)。
|
|
370
364
|
*
|
|
371
365
|
* 🔴 闭的不是「`decide.*` 一共有几个码」(那仍是开集:`approval_binding_mismatch` /
|
|
372
366
|
* `approval_stale` / `gate_not_tool_approval` 等都不在本表,它们各有既有处置),闭的是
|
|
373
|
-
*
|
|
367
|
+
* 「**这两个码是 workflow 那条新车道独有的、而且各自有一句人话**」。
|
|
374
368
|
* 🔴 **形制**:`Object.freeze` 的数组,不是 `ReadonlySet`(同 {@link RESUME_RETRY_LATER_CODES} 的
|
|
375
369
|
* 已定谳病形 —— `ReadonlySet` 只在类型面只读,而判定查的就是公面上这同一个实例)。
|
|
376
370
|
* 🔴 加成员必须**同批**补那一句人话 + 判据,不许靠 `decide.` 前缀放宽(前缀下住着三种处置)。
|
|
371
|
+
* 🔴 **删成员义务**(0.71.0 CC-20 补):上游退役某码(sdk errors.d.ts 顶注 ⚰️ RETIRED 无别名)⇒ 同批删常量、出路句、
|
|
372
|
+
* `resendable` 行,退役词进 census 门登记;decide-receipt 门 E0 对每一员钉「上游仍活着」,上游退役当天先红。
|
|
373
|
+
* 📋 **刻意不镜像**:`decide.workflow_park_identity_lost`(server 7.71.0 引入、7.75.0 退役,sdk 从未建模,继任 `decide.workflow_resume_not_admitted`
|
|
374
|
+
* 家族由 sdk 类承载);端收到未知 `decide.*` 码一律走开集通用行(机器行原样上屏),本表不为已退役码留位。
|
|
377
375
|
*/
|
|
378
376
|
export const DECIDE_WORKFLOW_LANE_CODES = Object.freeze([
|
|
379
377
|
DECIDE_WORKFLOW_HOST_UNKNOWN,
|
|
380
|
-
DECIDE_WORKFLOW_HOST_NOT_PARKED,
|
|
381
378
|
DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED,
|
|
382
379
|
]);
|
|
383
380
|
// ══ 0.68.0 提货批(core 7.17.0 #652;server [7084] D 段)—— workflow **park 真相**四拒码 ══════
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
/** 一条通告是**说给谁听**的。两值,刻意不设第三值(见模块顶注)。 */
|
|
55
55
|
export type NoticeAudience = 'user' | 'operator';
|
|
56
56
|
/**
|
|
57
|
-
* 引擎**成文码册**的逐字镜像(core `ENGINE_NOTICE_CODES`,**7.
|
|
57
|
+
* 引擎**成文码册**的逐字镜像(core `ENGINE_NOTICE_CODES`,**7.20.0 = 六十四码**(7.19.0 五十九 + 7.20.0 五枚:`config.task_root_not_canonical` / `config.execution_env_capability_invalid` / `config.forward_sink_failed` / `memory.restore_withheld` / `agents.listing_truncated`,均 operator);顺序同源)。
|
|
58
58
|
* 🔴 这是一份**抄件**,不是本包的意见 —— 改它必须同 commit 附 core 坐标,且门会先红。
|
|
59
59
|
* ⚠️ `EngineNotice.code` 的型面在上游**故意留 `string`**(宿主把自己的通告转发进同一个水槽是
|
|
60
60
|
* 被支持的形),所以本表是**判据**不是型 —— 别拿它去窄化那个字段。
|
|
@@ -202,10 +202,9 @@ export interface DurableGateUnavailableFactsView {
|
|
|
202
202
|
export declare function readDurableGateUnavailable(notice: unknown): DurableGateUnavailableFactsView | undefined;
|
|
203
203
|
/** `skills.listing_truncated` 通告 `detail` 上的事实(core `skill-listing-budget.js` 铸点逐格)。 */
|
|
204
204
|
export interface SkillsListingTruncatedFactsView {
|
|
205
|
-
/** 清单实际拿到的字节预算(
|
|
205
|
+
/** 清单实际拿到的字节预算 = 在场预算(core 7.20.0 起 8 KiB 结构天花板退役,声明比例即实际;0.70.0 那版曾并列一个
|
|
206
|
+
* `requestedBudgetBytes?` 与派生 `laneClamped?`,随该 detail 键在 7.20.0 删除而**整只退役**——不留恒 false 的位)。 */
|
|
206
207
|
budgetBytes: number;
|
|
207
|
-
/** 部署声明的比例**要**的预算(clamp 之前);只在 clamp 真绑住时与 `budgetBytes` 不同。读不出 ⇒ 键不铸。 */
|
|
208
|
-
requestedBudgetBytes?: number;
|
|
209
208
|
/** 每条描述的字符帽(含省略号)。读不出 ⇒ 键不铸。 */
|
|
210
209
|
descMaxChars?: number;
|
|
211
210
|
/** 这一帧清单上的技能总数(初始清单 = 全名册;drift 帧 = 新宣告的那一批)。 */
|
|
@@ -216,9 +215,6 @@ export interface SkillsListingTruncatedFactsView {
|
|
|
216
215
|
nameOnly: readonly string[];
|
|
217
216
|
/** 整条没进清单的技能名(病态形;Skill 工具仍服务它们)。 */
|
|
218
217
|
dropped: readonly string[];
|
|
219
|
-
/** 🔴 清单是被**交付车道的结构性 clamp** 缩短的(而不是部署自己的比例):`requestedBudgetBytes` 在场且 ≠ `budgetBytes`。
|
|
220
|
-
* 两者都读得出才铸;缺席 = 分不出(不折 `false`)。运维面据此分「调 fraction 有用」与「调了也没用」。 */
|
|
221
|
-
laneClamped?: boolean;
|
|
222
218
|
/** 投给哪个会话。读不出 ⇒ 键不铸(operator 通告不要求会话)。 */
|
|
223
219
|
sessionId?: string;
|
|
224
220
|
}
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
* 出现在本包源码或产物里 => 当场红。
|
|
53
53
|
*/
|
|
54
54
|
/**
|
|
55
|
-
* 引擎**成文码册**的逐字镜像(core `ENGINE_NOTICE_CODES`,**7.
|
|
55
|
+
* 引擎**成文码册**的逐字镜像(core `ENGINE_NOTICE_CODES`,**7.20.0 = 六十四码**(7.19.0 五十九 + 7.20.0 五枚:`config.task_root_not_canonical` / `config.execution_env_capability_invalid` / `config.forward_sink_failed` / `memory.restore_withheld` / `agents.listing_truncated`,均 operator);顺序同源)。
|
|
56
56
|
* 🔴 这是一份**抄件**,不是本包的意见 —— 改它必须同 commit 附 core 坐标,且门会先红。
|
|
57
57
|
* ⚠️ `EngineNotice.code` 的型面在上游**故意留 `string`**(宿主把自己的通告转发进同一个水槽是
|
|
58
58
|
* 被支持的形),所以本表是**判据**不是型 —— 别拿它去窄化那个字段。
|
|
@@ -76,9 +76,14 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
76
76
|
// 0.68.0 提货批(core 7.17.0 加员;位置 = `governance-codes.js:108` 真字节,在
|
|
77
77
|
// `config.tool_model_gate_env_invalid` 与 `config.tool_card_undeclared` 之间)。
|
|
78
78
|
'config.artifact_host_invalid',
|
|
79
|
+
// core 7.20.0(0.71.0 提货):任务根非规范路径 / 远端执行环境能力声明坏值,两枚部署面通告;顺序同源(紧跟 artifact_host_invalid)。
|
|
80
|
+
'config.task_root_not_canonical',
|
|
81
|
+
'config.execution_env_capability_invalid',
|
|
79
82
|
'config.tool_card_undeclared',
|
|
80
83
|
'config.tool_face_undeclared',
|
|
81
84
|
'config.tool_face_invalid',
|
|
85
|
+
// core 7.20.0:转发 sink 失败;顺序同源(紧跟 tool_face_invalid)。
|
|
86
|
+
'config.forward_sink_failed',
|
|
82
87
|
'config.durable_gate_unavailable',
|
|
83
88
|
'config.peer_admission_out_of_range',
|
|
84
89
|
'config.peer_lane_unmounted',
|
|
@@ -111,6 +116,8 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
111
116
|
'memory.consolidation_incomplete',
|
|
112
117
|
'memory.consolidation_refused',
|
|
113
118
|
'memory.consolidation_withheld',
|
|
119
|
+
// core 7.20.0:恢复被扣留;顺序同源(紧跟 consolidation_withheld)。
|
|
120
|
+
'memory.restore_withheld',
|
|
114
121
|
'route.fallback_to_primary',
|
|
115
122
|
// core 7.18.0 #742(CC-05):分类器候选梯子无可路由席;元组 @44。
|
|
116
123
|
'route.classifier_unroutable',
|
|
@@ -128,6 +135,8 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
128
135
|
// core 7.19.0(CC-04 core 半场):`<skills>` 披露块超字节预算 ⇒ 至少一条只列名(`detail.nameOnly[]`)或整条不列
|
|
129
136
|
// (`detail.dropped[]`);Skill 工具仍服务全部技能。运维面事(调 skillListingBudgetFraction / skillListingMaxDescChars / 少声明)。
|
|
130
137
|
'skills.listing_truncated',
|
|
138
|
+
// core 7.20.0:agent roster 清单超预算(与 skills 同族;同一个 fraction 预算);顺序同源(紧跟 skills.listing_truncated)。
|
|
139
|
+
'agents.listing_truncated',
|
|
131
140
|
'tool_result.offload_put_failed',
|
|
132
141
|
]);
|
|
133
142
|
const CATALOG = new Set(ENGINE_NOTICE_CODES);
|
|
@@ -157,9 +166,12 @@ export const ENGINE_NOTICE_AUDIENCE = Object.freeze({
|
|
|
157
166
|
'config.tool_model_gate_env_invalid': 'operator',
|
|
158
167
|
// 0.68.0 提货批:`NOTICE_AUDIENCE_TABLE:181` 真字节 —— 一条「宿主把 artifact 席接坏了」的部署事实。
|
|
159
168
|
'config.artifact_host_invalid': 'operator',
|
|
169
|
+
'config.task_root_not_canonical': 'operator',
|
|
170
|
+
'config.execution_env_capability_invalid': 'operator',
|
|
160
171
|
'config.tool_card_undeclared': 'operator',
|
|
161
172
|
'config.tool_face_undeclared': 'operator',
|
|
162
173
|
'config.tool_face_invalid': 'operator',
|
|
174
|
+
'config.forward_sink_failed': 'operator',
|
|
163
175
|
'config.durable_gate_unavailable': 'user',
|
|
164
176
|
'config.peer_admission_out_of_range': 'operator',
|
|
165
177
|
'config.peer_lane_unmounted': 'operator',
|
|
@@ -192,6 +204,7 @@ export const ENGINE_NOTICE_AUDIENCE = Object.freeze({
|
|
|
192
204
|
// 🔴 core 7.14.0 **value-domain BREAKING**:user → operator(见模块顶注提货记账段;
|
|
193
205
|
// 理由 = 这条通告没有 sessionId,一次固化跑在任何会话之外)。
|
|
194
206
|
'memory.consolidation_withheld': 'operator',
|
|
207
|
+
'memory.restore_withheld': 'operator',
|
|
195
208
|
'route.fallback_to_primary': 'operator',
|
|
196
209
|
'route.classifier_unroutable': 'operator',
|
|
197
210
|
'route.base_url_changed_key_unchanged': 'operator',
|
|
@@ -205,6 +218,7 @@ export const ENGINE_NOTICE_AUDIENCE = Object.freeze({
|
|
|
205
218
|
'memory.capture_opted_out': 'user',
|
|
206
219
|
'memory.capture_optout_unpersisted': 'user',
|
|
207
220
|
'skills.listing_truncated': 'operator',
|
|
221
|
+
'agents.listing_truncated': 'operator',
|
|
208
222
|
'tool_result.offload_put_failed': 'operator',
|
|
209
223
|
});
|
|
210
224
|
/**
|
|
@@ -405,18 +419,16 @@ export function readSkillsListingTruncated(notice) {
|
|
|
405
419
|
if (budgetBytes === undefined || total === undefined || kept === undefined || nameOnly === undefined || dropped === undefined) {
|
|
406
420
|
return undefined;
|
|
407
421
|
}
|
|
408
|
-
|
|
422
|
+
// 0.71.0:`requestedBudgetBytes` 若在场(老引擎 7.19.0)**不铸不派生**——它在 7.20.0 已删,本视图不再有它的位。
|
|
409
423
|
const descMaxChars = nonNegInt(o.descMaxChars);
|
|
410
424
|
const sessionId = typeof o.sessionId === 'string' && o.sessionId.length > 0 ? o.sessionId : undefined;
|
|
411
425
|
return {
|
|
412
426
|
budgetBytes,
|
|
413
|
-
...(requestedBudgetBytes !== undefined ? { requestedBudgetBytes } : {}),
|
|
414
427
|
...(descMaxChars !== undefined ? { descMaxChars } : {}),
|
|
415
428
|
total,
|
|
416
429
|
kept,
|
|
417
430
|
nameOnly,
|
|
418
431
|
dropped,
|
|
419
|
-
...(requestedBudgetBytes !== undefined ? { laneClamped: requestedBudgetBytes !== budgetBytes } : {}),
|
|
420
432
|
...(sessionId !== undefined ? { sessionId } : {}),
|
|
421
433
|
};
|
|
422
434
|
}
|
|
@@ -1086,6 +1086,16 @@ export interface ToolApprovalFrame {
|
|
|
1086
1086
|
expiresAtMs?: number;
|
|
1087
1087
|
/** server 出帧时刻(epoch ms)——壳用它对本地时钟校偏后再消费 expiresAtMs。 */
|
|
1088
1088
|
serverNowMs?: number;
|
|
1089
|
+
/**
|
|
1090
|
+
* CC-08(0.71.0;core 7.19.0 #803,sdk 9.6.0 `TOOL_APPROVAL_FRAME_KEYS` 第 30 员):**根外读卡附读根候选**。
|
|
1091
|
+
* 在场 = 这只 ask 是「读了 trackedCwd 之外的目录」那一形,且引擎给出一个「把 `dir` 加为本会话读目录」的
|
|
1092
|
+
* 候选动作;`clearsThisAsk: true` 是穷举表恰一臂(第二成员域 = {true})。
|
|
1093
|
+
* 🔴 只按在场渲,`dir` 原样回传、显完整 dir(不截、不归一);缺席 = 今日行为(非根外读,或引擎早于 7.19.0)。
|
|
1094
|
+
*/
|
|
1095
|
+
readRootCandidate?: {
|
|
1096
|
+
dir: string;
|
|
1097
|
+
clearsThisAsk: true;
|
|
1098
|
+
};
|
|
1089
1099
|
}
|
|
1090
1100
|
/** {@link ToolApprovalFrame.delegation} 的形(命名形,不用内联匿名 —— typeshape 门 B4 棘轮口径)。 */
|
|
1091
1101
|
export interface ToolApprovalDelegation {
|
|
@@ -1101,7 +1111,7 @@ export interface ToolApprovalDelegation {
|
|
|
1101
1111
|
* `TOOL_APPROVAL_FRAME_KEYS` 比对——SDK additive 增键时对账当天红,不再人肉追平。
|
|
1102
1112
|
* 下面两个类型钉保证镜像与 interface 本身不可能漂移(少键/多键都是编译错)。
|
|
1103
1113
|
*/
|
|
1104
|
-
export declare const TOOL_APPROVAL_FRAME_KEYS_MIRROR: readonly ["type", "approvalId", "toolCallId", "toolName", "sourceTaskId", "fromSubagent", "sourceAgentName", "message", "args", "argsOmitted", "governanceForced", "ruleSuggestions", "ruleOffers", "ruleOffersAbsence", "denialLimitFallback", "ruleStoreUnreadable", "origin", "inputHasBidi", "parked", "persistedRuleShadowed", "probeCause", "ruleEvidence", "requiresRealApproval", "expiresInMs", "expiresAtMs", "serverNowMs", "delegation", "outcome"];
|
|
1114
|
+
export declare const TOOL_APPROVAL_FRAME_KEYS_MIRROR: readonly ["type", "approvalId", "toolCallId", "toolName", "sourceTaskId", "fromSubagent", "sourceAgentName", "message", "args", "argsOmitted", "governanceForced", "ruleSuggestions", "ruleOffers", "ruleOffersAbsence", "denialLimitFallback", "ruleStoreUnreadable", "readRootCandidate", "origin", "inputHasBidi", "parked", "persistedRuleShadowed", "probeCause", "ruleEvidence", "requiresRealApproval", "expiresInMs", "expiresAtMs", "serverNowMs", "delegation", "outcome"];
|
|
1105
1115
|
/**
|
|
1106
1116
|
* 子代帧判别:显式键 fromSubagent(core 1.378 RB-39②)优先;缺席退 sourceTaskId 在场性权宜式
|
|
1107
1117
|
* (server 1.258 [1549]①3,旧代际兼容)。
|
|
@@ -569,6 +569,8 @@ export const TOOL_APPROVAL_FRAME_KEYS_MIRROR = [
|
|
|
569
569
|
// ⚠️ 与 `persistedRuleShadowed`/`probeCause` 同形:sdk 8.8.0 的运行期锚**尚无**本键 ⇒ **领先**一代,
|
|
570
570
|
// 进对账门的 AHEAD_OF_ANCHOR 带退出条件登记(sdk 8.9.x 补上那天那条登记自红逼删,回到逐元素相等)。
|
|
571
571
|
'ruleStoreUnreadable',
|
|
572
|
+
// CC-08(0.71.0):core 7.19.0 #803 根外读卡附读根候选;sdk 9.6.0 锚第 30 员。
|
|
573
|
+
'readRootCandidate',
|
|
572
574
|
// S-125③/#564(client-core 0.59.0):server 7.57.0 起真发 `origin`(core 7.5.0 `ASK_ORIGINS`
|
|
573
575
|
// 八词;engine 7.60.0 fixture 直证)。同上:sdk 8.3.0 锚已含本键 ⇒ 追平,不进领先表。
|
|
574
576
|
'origin',
|