@sema-agent/client-core 0.101.0 → 0.102.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 +57 -0
- package/README.md +12 -7
- package/dist/adapt/toolCards.d.ts +2 -1
- package/dist/adapt/toolCards.js +20 -6
- package/dist/adapt.d.ts +1 -1
- package/dist/adapt.js +1 -1
- package/dist/adapter/downstream/eventToSdkMessage.js +6 -68
- package/dist/adapter/downstream/wiringManifestView.d.ts +1 -0
- package/dist/adapter/downstream/wiringManifestView.js +138 -0
- package/dist/compensations.js +1 -1
- package/dist/displayUntrusted.d.ts +8 -4
- package/dist/displayUntrusted.js +769 -96
- package/dist/engineRowRef.js +1 -0
- package/dist/fleet/fleetProjection.js +1 -1
- package/dist/i18n/messages.en.d.ts +38 -0
- package/dist/i18n/messages.en.js +38 -0
- package/dist/i18n/messages.zh.js +40 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +5 -0
- package/dist/interactiveHalt.d.ts +3 -1
- package/dist/interactiveHalt.js +2 -0
- package/dist/interactiveInterrupt.d.ts +2 -0
- package/dist/interactiveInterrupt.js +15 -0
- package/dist/modsFace.d.ts +8 -0
- package/dist/modsFace.js +59 -0
- package/dist/ownKey.d.ts +1 -0
- package/dist/ownKey.js +15 -0
- package/dist/printToolResultFrame.js +1 -1
- package/dist/request/printNotification.js +1 -1
- package/dist/request/taskRequest.d.ts +21 -0
- package/dist/request/taskRequest.js +123 -7
- package/dist/seam.js +1 -1
- package/dist/seatContract.d.ts +22 -6
- package/dist/seatContract.js +35 -6
- package/dist/sessionBackground.d.ts +165 -0
- package/dist/sessionBackground.js +781 -0
- package/dist/sessionBackgroundHandoff.d.ts +54 -0
- package/dist/sessionBackgroundHandoff.js +321 -0
- package/dist/sessionMap.js +4 -1
- package/dist/settingsCredentialKeyPaths.js +2 -17
- package/dist/thinkingLatch.d.ts +69 -0
- package/dist/thinkingLatch.js +255 -0
- package/dist/thinkingLatchWords.d.ts +7 -0
- package/dist/thinkingLatchWords.js +4 -0
- package/dist/toolResult.js +2 -24
- package/docs/INTEGRATION-CLIENTS.md +309 -10
- package/package.json +1 -1
- package/dist/argvFlagValue.d.ts +0 -8
- package/dist/argvFlagValue.js +0 -37
package/dist/adapt/toolCards.js
CHANGED
|
@@ -5,8 +5,8 @@ import { flattenWireOutput } from './wireShapes.js';
|
|
|
5
5
|
import { toolResultBlocksOf } from '../toolResultContent.js';
|
|
6
6
|
import { bashExitOf, bashExitReadingFailed } from '../bashExitReading.js';
|
|
7
7
|
import { isCcToolDenialKind } from '../gateVocabulary.js';
|
|
8
|
-
import { guardedRead, ownSnapshotWhenTyped, readFrameStringKey, readFrameTrueMark } from '../ownKey.js';
|
|
9
|
-
import {
|
|
8
|
+
import { guardedRead, ownSnapshotWhenTyped, readFrameStringKey, readFrameTrueMark, readOwnDataValue } from '../ownKey.js';
|
|
9
|
+
import { gateDeniedBy, isApprovalWindowExpiredGate, isDeniedGate, isDenialLimitAutoDeniedGate } from '../gateOutcome.js';
|
|
10
10
|
import { TOOL_END_INTERRUPTED_NEVER_STARTED } from '../engineErrorCodes.js';
|
|
11
11
|
function toolUseResultParts(v) {
|
|
12
12
|
return v !== undefined ? { tool_use_result: v } : {};
|
|
@@ -53,18 +53,32 @@ export function toolResultRowIdentity(sources, toolCallId, ctx) {
|
|
|
53
53
|
}
|
|
54
54
|
return { uuid: deriveTranscriptId({ toolCallId }, ctx) };
|
|
55
55
|
}
|
|
56
|
-
export function toolResultRowFlagParts(arm) {
|
|
56
|
+
export function toolResultRowFlagParts(arm, gate) {
|
|
57
57
|
if (arm === null || arm === undefined)
|
|
58
58
|
return {};
|
|
59
|
-
const
|
|
59
|
+
const notExecuted = readFrameTrueMark(arm, 'notExecuted');
|
|
60
|
+
const answeredBy = modAnsweredByOf(arm, notExecuted, gate);
|
|
60
61
|
return {
|
|
61
|
-
...(
|
|
62
|
+
...(notExecuted ? { _sema_not_executed: true } : {}),
|
|
62
63
|
...(readFrameTrueMark(arm, '_sema_collateral_abort') ? { _sema_collateral_abort: true } : {}),
|
|
63
64
|
...(readFrameStringKey(arm, 'errorCode') === TOOL_END_INTERRUPTED_NEVER_STARTED ? { _sema_interrupted_never_started: true } : {}),
|
|
64
65
|
...(isApprovalWindowExpiredGate(gate) ? { _sema_approval_window_expired: true } : {}),
|
|
65
66
|
...(isDenialLimitAutoDeniedGate(gate) ? { _sema_denial_limit_window_expired: true } : {}),
|
|
67
|
+
...(answeredBy !== undefined ? { _sema_answered_by: answeredBy } : {}),
|
|
66
68
|
};
|
|
67
69
|
}
|
|
70
|
+
const MOD_ENGINE_ORIGIN = 'engine';
|
|
71
|
+
function modAnsweredByOf(arm, notExecuted, gate) {
|
|
72
|
+
const by = readFrameStringKey(arm, 'answeredBy');
|
|
73
|
+
if (by === undefined || by === MOD_ENGINE_ORIGIN || !notExecuted)
|
|
74
|
+
return undefined;
|
|
75
|
+
if (gate !== undefined && gate.unreadable !== undefined && gate.unreadable.length > 0)
|
|
76
|
+
return undefined;
|
|
77
|
+
const isErrorRaw = guardedRead(() => readOwnDataValue(arm, 'isError'));
|
|
78
|
+
if (isDeniedGate(gate))
|
|
79
|
+
return gateDeniedBy(gate) === 'hook' && isErrorRaw === true ? by : undefined;
|
|
80
|
+
return isErrorRaw === false ? by : undefined;
|
|
81
|
+
}
|
|
68
82
|
export function createToolCardLedger(ctx, idOf) {
|
|
69
83
|
const pending = new Map();
|
|
70
84
|
let assistantResponseId = null;
|
|
@@ -110,7 +124,7 @@ export function createToolCardLedger(ctx, idOf) {
|
|
|
110
124
|
...toolResultEnvelopeParts(outcome),
|
|
111
125
|
...(isCcToolDenialKind(end?.denialKind) ? { _sema_denial_kind: end.denialKind } : {}),
|
|
112
126
|
...(end?.gate !== undefined ? { _sema_gate: end.gate } : {}),
|
|
113
|
-
...toolResultRowFlagParts(end?.closeArm),
|
|
127
|
+
...toolResultRowFlagParts(end?.closeArm, end?.gate),
|
|
114
128
|
}, ctx.now());
|
|
115
129
|
}
|
|
116
130
|
function* closeCard(p, end) {
|
package/dist/adapt.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare const ADAPTER_COVERAGE: {
|
|
|
13
13
|
readonly transcriptKinds: readonly ["assistant_text", "assistant_thinking", "assistant_tool_use", "user_tool_result_decision", "user_task_notification", "system_passthrough"];
|
|
14
14
|
readonly b3: readonly ["T38 三清第三清 + T57 第五处断闸:prompt_suggestions(turn 开场作废 + 子流断闸)", "T40 IDLE-FLUSH 1.5s 竞速(需 ctx.setTimer;缺席=不启用)", "T58 手动 iterator 的 finally cleanup(early break/throw 都要关上游生成器)", "T59 abort 半场(ctx.signal;中断后不产终答)", "T60 无 result 收尾腿(泄尾增量 → 清 liveness → 尾思考 → 尾文本段)"];
|
|
15
15
|
readonly b4: readonly ["A 层第 14 臂 task_progress:workflow lane 三级门 + 判据④ belt 回植 + C1 alias + bindTaskCard(显式父/FIFO/含糊即 unbound)+ inline stats + T50 双形读 + SubagentStart + #6 resident 台账 + 面板 tick", "settlePanelTasks 三处 sweep 全接线(tool_end 显式关卡带报告 / result 防御 sweep / turn 末 + abort sweep)", "P0-2 tool label 侧信道(sanitizeToolUseBlock 摘 label + engineToolLabelStore 登记;0.5.0 真缺口,label 会随 tool_use block 落转录 → /compact 直发 provider 400)", "task_notification 的两件宿主义务收回库内自持:dropQueuedNotificationsForRun + clearEnginePanelTaskResident;stop hook 的 if-started 门由库解", "T8 flattenWireOutput 提为独立导出(A 层 settle 报告与 B 层卡体同一份)"];
|
|
16
|
-
readonly b5: readonly ["B 层 structuredToToolUseResult 14 case(ask-user-question/bash/edit/create/update/text/grep/glob/notebook-edit/cron-create/cron-delete/cron-list/agent/task-output)+ workflow-run 登记副作用", "D 层 wireOutputToBody 3 臂(bash / taskoutput / 泛化);structured 白名单在场时 T11+T14 正则退位,缺席保回落", "E 层 4
|
|
16
|
+
readonly b5: readonly ["B 层 structuredToToolUseResult 14 case(ask-user-question/bash/edit/create/update/text/grep/glob/notebook-edit/cron-create/cron-delete/cron-list/agent/task-output)+ workflow-run 登记副作用", "D 层 wireOutputToBody 3 臂(bash / taskoutput / 泛化);structured 白名单在场时 T11+T14 正则退位,缺席保回落", "E 层 4 臂:bg Bash 回执 + Monitor 回执(同臂按工具名分,registration.source 判别;判定在库→chrome bgshell_register)+ CC-331 交出后台的 Bash(结构化 detached 位同形登记,一张卡至多一条;结构化位自述登记失败时两臂都不铸)· TodoWrite oldTodos 富卡 · ReportFindings 按名认领 · Remember→memory_saved 系统消息", "tool_end_result → user tool_result 正常路径(卡本体);result 与 turn 末两处开卡兜底关闭(abort 不兜底,cli 同)", "task/task-list structured → chrome task_ledger_sync{source:\"structured\"}(判定归一在库、落盘留宿主)", "T7 诚实缺席(§8-4:不搬 mock 合成器,改 degraded 标记)· T20 diff hunks 进包(src/diff/patch.ts)"];
|
|
17
17
|
readonly todo: readonly ["T13 的 **D 层** 半场(taskoutput block content)未随 structured 退位:退位会改 block content 形状(cli 那里是裸对象 = 件1 隐患),属行为面改动,无真实需求驱动 ⇒ 见 DIVERGENCE-8", "macrotask 让渡(cli 在提交前让出宏任务给 Ink;宿主渲染策略,不进库)"];
|
|
18
18
|
};
|
|
19
19
|
export declare const ADAPTER_DIVERGENCES: readonly [string, string, string, string, string, string, string, string, string, string, string, string];
|
package/dist/adapt.js
CHANGED
|
@@ -56,7 +56,7 @@ export const ADAPTER_COVERAGE = {
|
|
|
56
56
|
b5: [
|
|
57
57
|
'B 层 structuredToToolUseResult 14 case(ask-user-question/bash/edit/create/update/text/grep/glob/notebook-edit/cron-create/cron-delete/cron-list/agent/task-output)+ workflow-run 登记副作用',
|
|
58
58
|
'D 层 wireOutputToBody 3 臂(bash / taskoutput / 泛化);structured 白名单在场时 T11+T14 正则退位,缺席保回落',
|
|
59
|
-
'E 层 4
|
|
59
|
+
'E 层 4 臂:bg Bash 回执 + Monitor 回执(同臂按工具名分,registration.source 判别;判定在库→chrome bgshell_register)+ CC-331 交出后台的 Bash(结构化 detached 位同形登记,一张卡至多一条;结构化位自述登记失败时两臂都不铸)· TodoWrite oldTodos 富卡 · ReportFindings 按名认领 · Remember→memory_saved 系统消息',
|
|
60
60
|
'tool_end_result → user tool_result 正常路径(卡本体);result 与 turn 末两处开卡兜底关闭(abort 不兜底,cli 同)',
|
|
61
61
|
'task/task-list structured → chrome task_ledger_sync{source:"structured"}(判定归一在库、落盘留宿主)',
|
|
62
62
|
'T7 诚实缺席(§8-4:不搬 mock 合成器,改 degraded 标记)· T20 diff hunks 进包(src/diff/patch.ts)',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { readFleetSegment, readInstructionsSegment, wiringManifestViewOf } from './wiringManifestView.js';
|
|
1
|
+
import { modRowsOf, readFleetSegment, readInstructionsSegment, wiringManifestViewOf } from './wiringManifestView.js';
|
|
2
2
|
import { stamp, snapshotSegmentIdentity, } from '../types.js';
|
|
3
3
|
import { turnUsageToModelUsage } from './turnUsageToModelUsage.js';
|
|
4
4
|
import { ccToolDenialKindForToolEnd, gateOutcomeOf } from '../../gateOutcome.js';
|
|
5
5
|
import { projectToolRoster, projectToolRosterDelta } from '../../toolRoster.js';
|
|
6
6
|
import { projectHandsSection } from '../../handsSeam.js';
|
|
7
7
|
import { readMcpLiveness } from '../../mcpLiveness.js';
|
|
8
|
-
import { contextUsageReadingOf, humanInputAttachmentsOf, guardedRead, markMcpSectionDroppedNamedRows, ownSnapshotTyped, promptManifestIdentityOfFrame, promptManifestSectionViewOf, readFrameTrueMark, readOwnDataNonEmptyString } from '../../ownKey.js';
|
|
8
|
+
import { contextUsageReadingOf, humanInputAttachmentsOf, guardedRead, markMcpSectionDroppedNamedRows, ownSnapshotTyped, promptManifestIdentityOfFrame, promptManifestSectionViewOf, readFrameStringKey, readFrameTrueMark, readOwnDataNonEmptyString } from '../../ownKey.js';
|
|
9
9
|
import { SEGMENT_END_IDENTITY_KEYS, eventSeq, stripToolUseSideChannels } from '../types.js';
|
|
10
10
|
import { frozenSet } from '../../frozenSet.js';
|
|
11
11
|
import { isCoreWorkflowRunTerminal } from '../../terminalStatuses.js';
|
|
@@ -229,6 +229,7 @@ function projectEvent(ev, ctx) {
|
|
|
229
229
|
const collateralAbort = ev._sema_collateral_abort;
|
|
230
230
|
const denialKind = ccToolDenialKindForToolEnd(ev);
|
|
231
231
|
const toolEndNotExecuted = readFrameTrueMark(ev, 'notExecuted');
|
|
232
|
+
const toolEndAnsweredBy = readFrameStringKey(ev, 'answeredBy');
|
|
232
233
|
return projected(stamp(ctx, armBody({
|
|
233
234
|
type: 'tool_end_result',
|
|
234
235
|
toolCallId: ev.toolCallId,
|
|
@@ -251,6 +252,7 @@ function projectEvent(ev, ctx) {
|
|
|
251
252
|
...(collateralAbort === true ? { _sema_collateral_abort: true } : {}),
|
|
252
253
|
...(denialKind !== undefined ? { _sema_denial_kind: denialKind } : {}),
|
|
253
254
|
...(toolEndNotExecuted ? { notExecuted: true } : {}),
|
|
255
|
+
...(toolEndAnsweredBy !== undefined ? { answeredBy: toolEndAnsweredBy } : {}),
|
|
254
256
|
...(ev.eventId !== undefined ? { eventId: ev.eventId } : {}),
|
|
255
257
|
...(ev.parentToolCallId !== undefined
|
|
256
258
|
? { parentToolCallId: ev.parentToolCallId }
|
|
@@ -681,72 +683,8 @@ function projectModsSection(holder) {
|
|
|
681
683
|
try {
|
|
682
684
|
if (!Object.hasOwn(holder, 'mods'))
|
|
683
685
|
return undefined;
|
|
684
|
-
const
|
|
685
|
-
|
|
686
|
-
return undefined;
|
|
687
|
-
const rows = [];
|
|
688
|
-
for (const r of raw) {
|
|
689
|
-
const row = modRowOf(r);
|
|
690
|
-
if (row !== undefined)
|
|
691
|
-
rows.push(row);
|
|
692
|
-
}
|
|
693
|
-
if (raw.length > 0 && rows.length === 0)
|
|
694
|
-
return undefined;
|
|
695
|
-
return rows;
|
|
696
|
-
}
|
|
697
|
-
catch {
|
|
698
|
-
return undefined;
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
function modRowOf(r) {
|
|
702
|
-
try {
|
|
703
|
-
if (typeof r !== 'object' || r === null || Array.isArray(r))
|
|
704
|
-
return undefined;
|
|
705
|
-
const str = (v) => (typeof v === 'string' && v.length > 0 ? v : undefined);
|
|
706
|
-
const strList = (v) => (Array.isArray(v) && v.every((x) => typeof x === 'string') ? [...v] : undefined);
|
|
707
|
-
const o = r;
|
|
708
|
-
const name = str(o.name);
|
|
709
|
-
const seat = str(o.seat);
|
|
710
|
-
const tier = str(o.tier);
|
|
711
|
-
if (name === undefined || seat === undefined || tier === undefined)
|
|
712
|
-
return undefined;
|
|
713
|
-
const eventsRaw = o.events;
|
|
714
|
-
const observeRaw = o.observe;
|
|
715
|
-
const skippedRaw = o.skipped;
|
|
716
|
-
const refusedByRaw = o.refusedBy;
|
|
717
|
-
const reasonRaw = o.reason;
|
|
718
|
-
const hasMountedKey = eventsRaw !== undefined || observeRaw !== undefined || skippedRaw !== undefined;
|
|
719
|
-
const hasRefusedKey = refusedByRaw !== undefined || reasonRaw !== undefined;
|
|
720
|
-
if (hasMountedKey && hasRefusedKey)
|
|
721
|
-
return undefined;
|
|
722
|
-
if (hasRefusedKey) {
|
|
723
|
-
const refusedBy = str(refusedByRaw);
|
|
724
|
-
const reason = str(reasonRaw);
|
|
725
|
-
return refusedBy === undefined || reason === undefined ? undefined : { name, seat, tier, refusedBy, reason };
|
|
726
|
-
}
|
|
727
|
-
const events = strList(eventsRaw);
|
|
728
|
-
if (events === undefined)
|
|
729
|
-
return undefined;
|
|
730
|
-
const observe = observeRaw === undefined ? undefined : strList(observeRaw);
|
|
731
|
-
const skipped = Array.isArray(skippedRaw)
|
|
732
|
-
? skippedRaw.flatMap((x) => {
|
|
733
|
-
if (typeof x !== 'object' || x === null || Array.isArray(x))
|
|
734
|
-
return [];
|
|
735
|
-
const k = x;
|
|
736
|
-
const registration = str(k.registration);
|
|
737
|
-
const cause = str(k.cause);
|
|
738
|
-
const why = str(k.reason);
|
|
739
|
-
return registration === undefined || cause === undefined || why === undefined ? [] : [{ registration, cause, reason: why }];
|
|
740
|
-
})
|
|
741
|
-
: undefined;
|
|
742
|
-
return {
|
|
743
|
-
name,
|
|
744
|
-
seat,
|
|
745
|
-
tier,
|
|
746
|
-
events,
|
|
747
|
-
...(observe !== undefined ? { observe } : {}),
|
|
748
|
-
...(skipped !== undefined && skipped.length > 0 ? { skipped } : {}),
|
|
749
|
-
};
|
|
686
|
+
const rows = modRowsOf(holder.mods);
|
|
687
|
+
return rows === undefined ? undefined : rows.slice();
|
|
750
688
|
}
|
|
751
689
|
catch {
|
|
752
690
|
return undefined;
|
|
@@ -46,3 +46,4 @@ export declare function readInstructionsSegment(holder: object, key: 'instructio
|
|
|
46
46
|
} | undefined;
|
|
47
47
|
export declare function readFleetSegment(holder: object, key: 'fleet' | '_sema_fleet'): WiringManifestFleetView | undefined;
|
|
48
48
|
export declare function wiringManifestViewOf(s: WiringManifestSections): WiringManifestView | undefined;
|
|
49
|
+
export declare function modRowsOf(records: unknown): readonly WiringManifestModView[] | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { appendOwnElement } from '../../ownKey.js';
|
|
1
2
|
const _viewPin = true;
|
|
2
3
|
void _viewPin;
|
|
3
4
|
const _viewKeysPin = true;
|
|
@@ -67,3 +68,140 @@ export function wiringManifestViewOf(s) {
|
|
|
67
68
|
view.eventId = s.eventId;
|
|
68
69
|
return view;
|
|
69
70
|
}
|
|
71
|
+
const isModRecordObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
72
|
+
function ownSlot(o, key) {
|
|
73
|
+
try {
|
|
74
|
+
const d = Object.getOwnPropertyDescriptor(o, key);
|
|
75
|
+
if (d === undefined)
|
|
76
|
+
return { state: 'absent' };
|
|
77
|
+
if (!Object.hasOwn(d, 'value'))
|
|
78
|
+
return { state: 'unreadable' };
|
|
79
|
+
return d.value === undefined ? { state: 'absent' } : { state: 'value', value: d.value };
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return { state: 'unreadable' };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function ownLength(v) {
|
|
86
|
+
const s = ownSlot(v, 'length');
|
|
87
|
+
return s.state === 'value' && typeof s.value === 'number' && Number.isSafeInteger(s.value) && s.value >= 0 ? s.value : undefined;
|
|
88
|
+
}
|
|
89
|
+
const nonEmpty = (s) => (s.state === 'value' && typeof s.value === 'string' && s.value.length > 0 ? s.value : undefined);
|
|
90
|
+
function ownStringList(v) {
|
|
91
|
+
try {
|
|
92
|
+
if (!Array.isArray(v))
|
|
93
|
+
return undefined;
|
|
94
|
+
const n = ownLength(v);
|
|
95
|
+
if (n === undefined)
|
|
96
|
+
return undefined;
|
|
97
|
+
const out = [];
|
|
98
|
+
for (let i = 0; i < n; i++) {
|
|
99
|
+
const x = ownSlot(v, String(i));
|
|
100
|
+
if (x.state !== 'value' || typeof x.value !== 'string')
|
|
101
|
+
return undefined;
|
|
102
|
+
appendOwnElement(out, x.value);
|
|
103
|
+
}
|
|
104
|
+
return out;
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function skipOf(x) {
|
|
111
|
+
try {
|
|
112
|
+
if (!isModRecordObject(x))
|
|
113
|
+
return undefined;
|
|
114
|
+
const registration = nonEmpty(ownSlot(x, 'registration'));
|
|
115
|
+
const cause = nonEmpty(ownSlot(x, 'cause'));
|
|
116
|
+
const reason = nonEmpty(ownSlot(x, 'reason'));
|
|
117
|
+
return registration === undefined || cause === undefined || reason === undefined ? undefined : { registration, cause, reason };
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function modRowOf(r) {
|
|
124
|
+
try {
|
|
125
|
+
if (!isModRecordObject(r))
|
|
126
|
+
return undefined;
|
|
127
|
+
const name = nonEmpty(ownSlot(r, 'name'));
|
|
128
|
+
const seat = nonEmpty(ownSlot(r, 'seat'));
|
|
129
|
+
const tier = nonEmpty(ownSlot(r, 'tier'));
|
|
130
|
+
if (name === undefined || seat === undefined || tier === undefined)
|
|
131
|
+
return undefined;
|
|
132
|
+
const events = ownSlot(r, 'events');
|
|
133
|
+
const observe = ownSlot(r, 'observe');
|
|
134
|
+
const skipped = ownSlot(r, 'skipped');
|
|
135
|
+
const refusedBy = ownSlot(r, 'refusedBy');
|
|
136
|
+
const reason = ownSlot(r, 'reason');
|
|
137
|
+
const hasMountedKey = events.state !== 'absent' || observe.state !== 'absent' || skipped.state !== 'absent';
|
|
138
|
+
const hasRefusedKey = refusedBy.state !== 'absent' || reason.state !== 'absent';
|
|
139
|
+
if (hasMountedKey && hasRefusedKey)
|
|
140
|
+
return undefined;
|
|
141
|
+
if (hasRefusedKey) {
|
|
142
|
+
const by = nonEmpty(refusedBy);
|
|
143
|
+
const why = nonEmpty(reason);
|
|
144
|
+
if (by === undefined || why === undefined)
|
|
145
|
+
return undefined;
|
|
146
|
+
const refused = { name, seat, tier, refusedBy: by, reason: why };
|
|
147
|
+
return refused;
|
|
148
|
+
}
|
|
149
|
+
const eventList = events.state === 'value' ? ownStringList(events.value) : undefined;
|
|
150
|
+
if (eventList === undefined)
|
|
151
|
+
return undefined;
|
|
152
|
+
const observeList = observe.state === 'value' ? ownStringList(observe.value) : undefined;
|
|
153
|
+
const skipList = skipped.state === 'value' ? skipListOf(skipped.value) : undefined;
|
|
154
|
+
const mounted = {
|
|
155
|
+
name,
|
|
156
|
+
seat,
|
|
157
|
+
tier,
|
|
158
|
+
events: eventList,
|
|
159
|
+
...(observeList !== undefined ? { observe: observeList } : {}),
|
|
160
|
+
...(skipList !== undefined && skipList.length > 0 ? { skipped: skipList } : {}),
|
|
161
|
+
};
|
|
162
|
+
return mounted;
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function skipListOf(v) {
|
|
169
|
+
try {
|
|
170
|
+
if (!Array.isArray(v))
|
|
171
|
+
return undefined;
|
|
172
|
+
const n = ownLength(v);
|
|
173
|
+
if (n === undefined)
|
|
174
|
+
return undefined;
|
|
175
|
+
const out = [];
|
|
176
|
+
for (let i = 0; i < n; i++) {
|
|
177
|
+
const x = ownSlot(v, String(i));
|
|
178
|
+
const s = x.state === 'value' ? skipOf(x.value) : undefined;
|
|
179
|
+
if (s !== undefined)
|
|
180
|
+
appendOwnElement(out, s);
|
|
181
|
+
}
|
|
182
|
+
return out;
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
return undefined;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
export function modRowsOf(records) {
|
|
189
|
+
try {
|
|
190
|
+
if (!Array.isArray(records))
|
|
191
|
+
return undefined;
|
|
192
|
+
const n = ownLength(records);
|
|
193
|
+
if (n === undefined)
|
|
194
|
+
return undefined;
|
|
195
|
+
const rows = [];
|
|
196
|
+
for (let i = 0; i < n; i++) {
|
|
197
|
+
const x = ownSlot(records, String(i));
|
|
198
|
+
const row = x.state === 'value' ? modRowOf(x.value) : undefined;
|
|
199
|
+
if (row !== undefined)
|
|
200
|
+
appendOwnElement(rows, row);
|
|
201
|
+
}
|
|
202
|
+
return n > 0 && rows.length === 0 ? undefined : rows;
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
return undefined;
|
|
206
|
+
}
|
|
207
|
+
}
|
package/dist/compensations.js
CHANGED
|
@@ -87,7 +87,7 @@ export const MIGRATED_COMPENSATIONS = [
|
|
|
87
87
|
{
|
|
88
88
|
id: 'T3',
|
|
89
89
|
what: '从落盘转录的 `<task-notification>` XML 反解回植去重键 —— 去重面纯内存,重启即蒸发,' +
|
|
90
|
-
'「通知 user-turn 已落盘、ack 未落」的 crash 窗口会二次喂模型
|
|
90
|
+
'「通知 user-turn 已落盘、ack 未落」的 crash 窗口会二次喂模型',
|
|
91
91
|
disposition: 'in-library',
|
|
92
92
|
libraryHalf: 'notifications.ts parseTranscriptNotificationSeeds(**唯一一份**解析;0.98.0 起逐块解析归线性块解析器,单条口 readTaskNotificationXml 读同一只)+ ' +
|
|
93
93
|
'adapt.ts importLedgerFromTranscript(消费口)',
|
|
@@ -2,6 +2,11 @@ export declare const REDACTION_MARKER_PREFIX = "\u00ABredacted";
|
|
|
2
2
|
export declare function looksLikeKnownSecret(s: string): boolean;
|
|
3
3
|
export declare function isDiagnosticValueWord(value: string): boolean;
|
|
4
4
|
export declare function percentBoundaryReadingOf(text: string): string;
|
|
5
|
+
interface WashStats {
|
|
6
|
+
passes: number;
|
|
7
|
+
capped: boolean;
|
|
8
|
+
collections: number;
|
|
9
|
+
}
|
|
5
10
|
export declare function washCredentials(text: string): string;
|
|
6
11
|
export type DisplayMark = 'escape' | 'dot' | 'space';
|
|
7
12
|
export interface DisplayFace {
|
|
@@ -40,13 +45,12 @@ export declare const DISPLAY_CAP_BACKOFF_MAX: number;
|
|
|
40
45
|
export declare function markerSafeCut(text: string, cut: number): number;
|
|
41
46
|
export declare function capDisplay(text: string, max: number | undefined, mark: DisplayMark): string;
|
|
42
47
|
export declare function paintAndCap(text: string, face: DisplayFace, max?: number): string;
|
|
43
|
-
export declare function credentialWashPasses(text: string, opts?: DisplayUntrustedOptions | null):
|
|
44
|
-
passes: number;
|
|
45
|
-
capped: boolean;
|
|
46
|
-
};
|
|
48
|
+
export declare function credentialWashPasses(text: string, opts?: DisplayUntrustedOptions | null): Readonly<WashStats>;
|
|
47
49
|
export declare function displayUntrusted(text: string, opts?: DisplayUntrustedOptions): string;
|
|
48
50
|
export declare function cleanUntrustedScalar(v: string | number | bigint | boolean | null | undefined): string;
|
|
49
51
|
export declare function queryCarriesCredential(query: string): boolean;
|
|
50
52
|
export declare function displayConfiguredUrl(url: string, opts?: DisplayUntrustedOptions): string;
|
|
53
|
+
export declare function configuredValueCarriesCredential(value: string): boolean;
|
|
51
54
|
export declare function quoteUntrustedForSentence(text: string, max: number): string | undefined;
|
|
52
55
|
export declare function displayUntrustedMarks(text: string, opts?: DisplayUntrustedOptions): DisplayUntrustedMarked;
|
|
56
|
+
export {};
|