@sema-agent/client-core 0.110.0 → 0.112.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 +244 -0
- package/README.md +59 -18
- package/dist/abortableSleep.d.ts +7 -0
- package/dist/abortableSleep.js +37 -0
- package/dist/adapt/arms.js +25 -4
- package/dist/adapt/toolCards.d.ts +3 -1
- package/dist/adapt/toolCards.js +4 -2
- package/dist/adapter/activeRunSelfHeal.d.ts +39 -0
- package/dist/adapter/activeRunSelfHeal.js +171 -3
- package/dist/adapter/downstream/eventToSdkMessage.js +10 -10
- package/dist/adapter/downstream/terminalToSdkResult.d.ts +2 -0
- package/dist/adapter/downstream/terminalToSdkResult.js +11 -0
- package/dist/adapter/runStream.d.ts +5 -0
- package/dist/adapter/runStream.js +15 -3
- package/dist/agentSession/engineSessionBackgroundStop.js +2 -2
- package/dist/attachmentRoute.d.ts +20 -0
- package/dist/attachmentRoute.js +39 -0
- package/dist/attachmentsWireCaps.js +1 -1
- package/dist/builtinOutputStyles.d.ts +12 -0
- package/dist/builtinOutputStyles.js +147 -0
- package/dist/checkpointRowVerdict.d.ts +3 -0
- package/dist/checkpointRowVerdict.js +14 -1
- package/dist/compactionStatus.d.ts +9 -0
- package/dist/compactionStatus.js +29 -5
- package/dist/consoleCaPin.d.ts +136 -0
- package/dist/consoleCaPin.js +827 -0
- package/dist/controlRouter.js +2 -1
- package/dist/coreValuePorts.d.ts +39 -1
- package/dist/coreValuePorts.js +10 -0
- package/dist/decideReceipt.d.ts +2 -1
- package/dist/deviceRebind.js +3 -3
- package/dist/displayUntrusted.d.ts +1 -0
- package/dist/displayUntrusted.js +6 -0
- package/dist/effectiveFacts.d.ts +9 -0
- package/dist/effectiveFacts.js +33 -0
- package/dist/engineAddress.d.ts +1 -0
- package/dist/engineAddress.js +4 -1
- package/dist/engineCredentialRelease.d.ts +54 -0
- package/dist/engineCredentialRelease.js +146 -0
- package/dist/engineErrorCodes.d.ts +1 -0
- package/dist/engineErrorCodes.js +1 -0
- package/dist/engineHealthProbeVerdict.d.ts +24 -0
- package/dist/engineHealthProbeVerdict.js +123 -0
- package/dist/engineNoticeCodes.js +5 -7
- package/dist/engineRepoint.d.ts +12 -5
- package/dist/engineRepoint.js +44 -19
- package/dist/engineRowRef.d.ts +3 -0
- package/dist/engineRowRef.js +11 -1
- package/dist/engineSwapCrossing.d.ts +57 -0
- package/dist/engineSwapCrossing.js +297 -0
- package/dist/engineUnavailable.d.ts +45 -0
- package/dist/engineUnavailable.js +496 -0
- package/dist/engineUrl.js +4 -2
- package/dist/eventLeg.js +3 -3
- package/dist/gateFailureCodes.js +2 -2
- package/dist/generated/sdkFactTables.d.ts +2 -1
- package/dist/generated/sdkFactTables.js +14 -0
- package/dist/generated/settingsSchemaFns.d.ts +1 -0
- package/dist/generated/settingsSchemaFns.js +3 -0
- package/dist/generated/settingsSchemaHooksClassifier.js +38 -9
- package/dist/generated/settingsSchemaTables.d.ts +56 -0
- package/dist/generated/settingsSchemaTables.js +19 -0
- package/dist/generated/settingsSchemaTypes.d.ts +23 -13
- package/dist/generated/settingsSchemaUrlShape.d.ts +1 -0
- package/dist/generated/settingsSchemaUrlShape.js +17 -0
- package/dist/hitl/approvalDelivery.d.ts +1 -0
- package/dist/hitl/approvalDelivery.js +1 -1
- package/dist/hitl/approvalResolution.d.ts +1 -1
- package/dist/hitl/approvalResolution.js +2 -1
- package/dist/hitl/askGateWire.js +5 -6
- package/dist/hitl/decisionRefusal.d.ts +6 -0
- package/dist/hitl/decisionRefusal.js +19 -10
- package/dist/hitl/decisionRefusalCarrier.d.ts +3 -0
- package/dist/hitl/decisionRefusalCarrier.js +348 -0
- package/dist/hitl/decisionSend.d.ts +7 -0
- package/dist/hitl/decisionSend.js +34 -12
- package/dist/hitl/editedApprovalAcceptance.js +1 -1
- package/dist/hitl/elicitationRefusal.d.ts +4 -0
- package/dist/hitl/elicitationRefusal.js +23 -0
- package/dist/hitl/frameRouter.d.ts +2 -2
- package/dist/hitl/frameRouter.js +8 -15
- package/dist/hitl/gateIdentity.d.ts +5 -0
- package/dist/hitl/gateIdentity.js +23 -0
- package/dist/hitl/hitlBridge.d.ts +6 -0
- package/dist/hitl/hitlBridge.js +10 -4
- package/dist/hitl/hitlHostSurface.d.ts +2 -1
- package/dist/hitl/hitlHostSurface.js +7 -2
- package/dist/hitl/localAllowRedemption.d.ts +70 -0
- package/dist/hitl/localAllowRedemption.js +276 -0
- package/dist/hitl/parkOwnership.js +2 -1
- package/dist/hitl/parkResolver.js +14 -4
- package/dist/hitl/persistedRulesWire.d.ts +16 -0
- package/dist/hitl/persistedRulesWire.js +70 -0
- package/dist/hitl/planReviewWire.d.ts +3 -0
- package/dist/hitl/planReviewWire.js +23 -6
- package/dist/hitl/policyDenyCause.d.ts +1 -1
- package/dist/hitl/policyDenyCause.js +1 -1
- package/dist/hitl/resumeRunningCard.d.ts +1 -0
- package/dist/hitl/resumeRunningCard.js +1 -0
- package/dist/hitl/screenCardCarriers.d.ts +15 -0
- package/dist/hitl/screenCardCarriers.js +41 -0
- package/dist/hitl/screenDecisionCards.d.ts +98 -0
- package/dist/hitl/screenDecisionCards.js +363 -0
- package/dist/hitl/sessionPolicyWire.js +2 -2
- package/dist/hitl/standingRows.d.ts +6 -2
- package/dist/hitl/standingRows.js +27 -2
- package/dist/hitl/toolApprovalWire.d.ts +30 -8
- package/dist/hitl/toolApprovalWire.js +264 -121
- package/dist/hooksReaderGenerations.js +1 -1
- package/dist/hooksWireCaps.js +3 -3
- package/dist/hostSettingNoticeArm.d.ts +3 -0
- package/dist/hostSettingNoticeArm.js +12 -0
- package/dist/hostTurnSettings.d.ts +3 -0
- package/dist/hostTurnSettings.js +38 -5
- package/dist/humanTurnRead.js +11 -1
- package/dist/i18n/messages.en.d.ts +292 -0
- package/dist/i18n/messages.en.js +298 -7
- package/dist/i18n/messages.zh.js +316 -6
- package/dist/i18n/translate.d.ts +3 -0
- package/dist/i18n/translate.js +78 -10
- package/dist/i18n/zh.d.ts +1 -0
- package/dist/i18n/zh.js +1 -0
- package/dist/index.d.ts +71 -20
- package/dist/index.js +44 -13
- package/dist/interactiveHalt.js +2 -1
- package/dist/interactiveInterrupt.js +20 -2
- package/dist/liveModelCatalog.d.ts +4 -0
- package/dist/liveModelCatalog.js +12 -3
- package/dist/localConfig/documents.d.ts +61 -0
- package/dist/localConfig/documents.js +51 -0
- package/dist/localConfig/kernel.d.ts +149 -0
- package/dist/localConfig/kernel.js +597 -0
- package/dist/localConfig/mcp/edit.d.ts +161 -0
- package/dist/localConfig/mcp/edit.js +846 -0
- package/dist/localConfig/mcp/servers.d.ts +165 -0
- package/dist/localConfig/mcp/servers.js +776 -0
- package/dist/localConfig/mcp/views.d.ts +170 -0
- package/dist/localConfig/mcp/views.js +429 -0
- package/dist/localConfig/modelPool.d.ts +262 -0
- package/dist/localConfig/modelPool.js +1489 -0
- package/dist/localConfig/modelPoolWords.d.ts +13 -0
- package/dist/localConfig/modelPoolWords.js +20 -0
- package/dist/localConfig/receiptShape.d.ts +7 -0
- package/dist/localConfig/receiptShape.js +135 -0
- package/dist/localConfig/settingsWrite.d.ts +127 -0
- package/dist/localConfig/settingsWrite.js +237 -0
- package/dist/localConfig/skills.d.ts +124 -0
- package/dist/localConfig/skills.js +397 -0
- package/dist/localConfig/skillsWords.d.ts +10 -0
- package/dist/localConfig/skillsWords.js +5 -0
- package/dist/localEngineSeatReading.d.ts +2 -2
- package/dist/localEngineSeatReading.js +5 -3
- package/dist/localEngineSpawn.d.ts +0 -7
- package/dist/localEngineSpawn.js +0 -92
- package/dist/localEngineStep.d.ts +2 -2
- package/dist/localEngineStep.js +2 -0
- package/dist/mcpProbeWire.js +2 -1
- package/dist/mcpReconnect.js +3 -3
- package/dist/mcpWireCaps.js +1 -1
- package/dist/memoryVerbsWire.js +3 -2
- package/dist/model/engineModelWords.d.ts +3 -0
- package/dist/model/engineModelWords.js +13 -0
- package/dist/model/onboardJudgement.d.ts +14 -4
- package/dist/model/onboardJudgement.js +91 -139
- package/dist/model/subagentModelWord.d.ts +21 -2
- package/dist/model/subagentModelWord.js +100 -29
- package/dist/modelCapabilityProbe.js +3 -40
- package/dist/modelConfigGapNotice.d.ts +20 -0
- package/dist/modelConfigGapNotice.js +102 -0
- package/dist/modsKernelIdentity.js +2 -47
- package/dist/notifications.d.ts +19 -0
- package/dist/notifications.js +114 -12
- package/dist/ownKey.d.ts +7 -0
- package/dist/ownKey.js +71 -8
- package/dist/pendingUserRow.d.ts +4 -0
- package/dist/pendingUserRow.js +16 -0
- package/dist/permissionsDeclaration.d.ts +3 -1
- package/dist/permissionsDeclaration.js +33 -9
- package/dist/planReviewCardFacts.d.ts +3 -0
- package/dist/planReviewCardFacts.js +52 -2
- package/dist/pluginHooksWire.d.ts +9 -1
- package/dist/pluginHooksWire.js +40 -6
- package/dist/printToolResultFrame.js +4 -2
- package/dist/promptBlockedCopy.js +12 -7
- package/dist/promptSuggestionBatch.d.ts +7 -0
- package/dist/promptSuggestionBatch.js +9 -0
- package/dist/promptSuggestionsTail.d.ts +39 -0
- package/dist/promptSuggestionsTail.js +116 -0
- package/dist/request/taskRequest.js +10 -6
- package/dist/requestCoordinate.d.ts +1 -0
- package/dist/requestCoordinate.js +13 -0
- package/dist/resumeRefusalCopy.d.ts +3 -1
- package/dist/resumeRefusalCopy.js +12 -4
- package/dist/rewindArchiveReading.js +4 -4
- package/dist/runCancelContext.d.ts +2 -1
- package/dist/runCancelContext.js +1 -0
- package/dist/runLedgerSnapshot.js +3 -3
- package/dist/runPermissionModeSwitch.js +3 -4
- package/dist/scenarioRefusal.js +11 -13
- package/dist/scenarioSkills.js +11 -6
- package/dist/seam.d.ts +16 -2
- package/dist/seam.js +10 -0
- package/dist/seatContract.d.ts +259 -9
- package/dist/seatContract.js +444 -15
- package/dist/sessionCostReading.d.ts +70 -0
- package/dist/sessionCostReading.js +150 -0
- package/dist/sessionHooksRoster.d.ts +4 -0
- package/dist/sessionHooksRoster.js +158 -0
- package/dist/sessionIdSegment.d.ts +1 -0
- package/dist/sessionIdSegment.js +4 -1
- package/dist/sessionMemoryErase.js +2 -1
- package/dist/sessionMemoryStatus.js +2 -2
- package/dist/sessionReadRedaction.d.ts +7 -0
- package/dist/sessionReadRedaction.js +26 -0
- package/dist/sessionSyncFileHistory.js +8 -9
- package/dist/settingsHooksSalvage.js +2 -1
- package/dist/sha256Bytes.d.ts +1 -0
- package/dist/sha256Bytes.js +46 -0
- package/dist/skillOverrideChain.d.ts +83 -0
- package/dist/skillOverrideChain.js +378 -0
- package/dist/skillsWireCaps.d.ts +3 -0
- package/dist/skillsWireCaps.js +16 -1
- package/dist/sseIdleTriage.js +2 -1
- package/dist/storeDurabilityWord.d.ts +15 -0
- package/dist/storeDurabilityWord.js +18 -0
- package/dist/storePostureCapability.d.ts +7 -3
- package/dist/storePostureCapability.js +69 -39
- package/dist/subagent/engineSubagentResume.js +2 -2
- package/dist/subagent/engineSubagentTail.js +2 -1
- package/dist/subagentContentStore.d.ts +11 -0
- package/dist/subagentContentStore.js +28 -2
- package/dist/toolResult.d.ts +1 -0
- package/dist/toolResult.js +2 -0
- package/dist/turnFailurePresentation.js +4 -10
- package/dist/userAttachmentEnvelope.d.ts +2 -1
- package/dist/userAttachmentEnvelope.js +10 -0
- package/dist/wireErrorTriage.js +2 -1
- package/dist/wireFailureShape.d.ts +4 -0
- package/dist/wireFailureShape.js +141 -19
- package/dist/wireRefusalCopy.d.ts +6 -5
- package/dist/wireRefusalCopy.js +49 -92
- package/docs/INTEGRATION-CLIENTS.md +2718 -17
- package/package.json +7 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hostLog } from '../host.js';
|
|
2
2
|
import { isNotFoundFailure, resumeRetryLaterFromError } from '../wireErrorTriage.js';
|
|
3
3
|
import { readThrownSlot, THROWN_SLOT_UNREADABLE } from '../wireFailureShape.js';
|
|
4
|
-
import { RESUME_SESSION_NOT_FOUND } from '../engineErrorCodes.js';
|
|
4
|
+
import { RESUME_SESSION_NOT_FOUND, STEERING_NOT_RUNNING } from '../engineErrorCodes.js';
|
|
5
5
|
import { displayUntrusted } from '../displayUntrusted.js';
|
|
6
6
|
import { engineCapTrue } from '../engineCapsCache.js';
|
|
7
7
|
import { clientHasVerbs, engineWireFor, INJECTED_WIRE_SETTLE_MS, noAnswerDetailFrom, sendOnce, settleInjected } from '../engineWireFor.js';
|
|
@@ -63,7 +63,7 @@ export function classifySubagentResumeFailure(e) {
|
|
|
63
63
|
}
|
|
64
64
|
if (errorCode === 'steering.still_running')
|
|
65
65
|
return { reason: 'still-running', detail: message };
|
|
66
|
-
if (errorCode ===
|
|
66
|
+
if (errorCode === STEERING_NOT_RUNNING)
|
|
67
67
|
return { reason: 'not-resumable', detail: message };
|
|
68
68
|
if (errorCode === 'steering.ambiguous_target')
|
|
69
69
|
return { reason: 'ambiguous-target', detail: message };
|
|
@@ -4,7 +4,7 @@ import { clientHasVerbs, engineWireFor, INJECTED_WIRE_SETTLE_MS, settleInjected
|
|
|
4
4
|
import { engineCapStateVia } from '../engineCapsCache.js';
|
|
5
5
|
import { engineSessionParamFor } from '../engineSessionParam.js';
|
|
6
6
|
import { resolveOwnerContext } from './engineSubagentResume.js';
|
|
7
|
-
import { coerceOutput, parentToolCallIdOf, publishSubagentContentEvent, settleSubagentContent, } from '../subagentContentStore.js';
|
|
7
|
+
import { coerceOutput, parentToolCallIdOf, publishSubagentContentEvent, settleSubagentContent, subagentToolEndDenialParts, } from '../subagentContentStore.js';
|
|
8
8
|
import { noteBgOwnerAbsence } from './subagentOwnerAbsence.js';
|
|
9
9
|
import { readFrameTrueMark } from '../ownKey.js';
|
|
10
10
|
import { publishEngineInlineTaskModel } from '../engineInlineTaskStats.js';
|
|
@@ -143,6 +143,7 @@ export function tailEngineSubagent(taskId, opts) {
|
|
|
143
143
|
...(out !== undefined ? { output: out } : {}),
|
|
144
144
|
...(d.isError === true ? { isError: true } : {}),
|
|
145
145
|
...(readFrameTrueMark(d, 'notExecuted') ? { notExecuted: true } : {}),
|
|
146
|
+
...subagentToolEndDenialParts(d),
|
|
146
147
|
});
|
|
147
148
|
}
|
|
148
149
|
else if (t === 'task_settled') {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CcToolDenialKind } from './gateVocabulary.js';
|
|
1
2
|
export type SubagentContentItem = {
|
|
2
3
|
kind: 'text';
|
|
3
4
|
text: string;
|
|
@@ -12,6 +13,8 @@ export type SubagentContentItem = {
|
|
|
12
13
|
output?: string;
|
|
13
14
|
isError?: boolean;
|
|
14
15
|
notExecuted?: true;
|
|
16
|
+
denialKind?: CcToolDenialKind;
|
|
17
|
+
refusalNoted?: true;
|
|
15
18
|
} | {
|
|
16
19
|
kind: 'echo';
|
|
17
20
|
text: string;
|
|
@@ -33,7 +36,13 @@ export interface SubagentContentEvent {
|
|
|
33
36
|
output?: string | undefined;
|
|
34
37
|
isError?: boolean | undefined;
|
|
35
38
|
notExecuted?: true | undefined;
|
|
39
|
+
denialKind?: CcToolDenialKind | undefined;
|
|
40
|
+
refusalNoted?: true | undefined;
|
|
36
41
|
}
|
|
42
|
+
export declare function subagentToolEndDenialParts(frame: object): {
|
|
43
|
+
denialKind?: CcToolDenialKind;
|
|
44
|
+
refusalNoted?: true;
|
|
45
|
+
};
|
|
37
46
|
export declare function coerceOutput(v: unknown): string | undefined;
|
|
38
47
|
export declare function subagentContentEventOf(ev: {
|
|
39
48
|
readonly type: string;
|
|
@@ -97,6 +106,8 @@ export type SubagentViewSlot = {
|
|
|
97
106
|
output?: string;
|
|
98
107
|
isError?: boolean;
|
|
99
108
|
notExecuted?: true;
|
|
109
|
+
denialKind?: CcToolDenialKind;
|
|
110
|
+
refusalNoted?: true;
|
|
100
111
|
};
|
|
101
112
|
export declare function planSubagentViewSlots(taskId: string): SubagentViewSlot[];
|
|
102
113
|
export declare function parentToolCallIdOf(taskId: string): string | undefined;
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { DEFAULT_SESSION_KEY } from './sessionSlot.js';
|
|
2
|
-
import { readFrameTrueMark, readOwnDataNonEmptyString, readOwnDataValue } from './ownKey.js';
|
|
2
|
+
import { guardedRead, readFrameTrueMark, readOwnDataNonEmptyString, readOwnDataValue } from './ownKey.js';
|
|
3
3
|
import { cycleSeqValue } from './cycleOrder.js';
|
|
4
4
|
import { toolEndOutputText } from './toolResultContent.js';
|
|
5
|
+
import { ccToolDenialKindForToolEnd, gateOutcomeOf } from './gateOutcome.js';
|
|
6
|
+
import { isCcToolDenialKind } from './gateVocabulary.js';
|
|
7
|
+
import { refusalNotedOf } from './engineRowRef.js';
|
|
8
|
+
export function subagentToolEndDenialParts(frame) {
|
|
9
|
+
const denialKind = guardedRead(() => ccToolDenialKindForToolEnd(frame));
|
|
10
|
+
const gate = guardedRead(() => gateOutcomeOf(frame));
|
|
11
|
+
return {
|
|
12
|
+
...(denialKind !== undefined ? { denialKind } : {}),
|
|
13
|
+
...(refusalNotedOf(denialKind, gate) ? { refusalNoted: true } : {}),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
5
16
|
export function coerceOutput(v) {
|
|
6
17
|
return toolEndOutputText(v);
|
|
7
18
|
}
|
|
@@ -26,6 +37,7 @@ export function subagentContentEventOf(ev) {
|
|
|
26
37
|
output: coerceOutput(sub.output),
|
|
27
38
|
isError: sub.isError,
|
|
28
39
|
notExecuted: readFrameTrueMark(sub, 'notExecuted') ? true : undefined,
|
|
40
|
+
...(t === 'tool_end' ? subagentToolEndDenialParts(ev) : {}),
|
|
29
41
|
};
|
|
30
42
|
}
|
|
31
43
|
const MAX_ITEMS_PER_TASK = 200;
|
|
@@ -633,16 +645,26 @@ export function publishSubagentContentEvent(ev) {
|
|
|
633
645
|
const outBefore = it.output;
|
|
634
646
|
const errBefore = it.isError;
|
|
635
647
|
const notExecBefore = it.notExecuted;
|
|
648
|
+
const denialBefore = it.denialKind;
|
|
649
|
+
const notedBefore = it.refusalNoted;
|
|
636
650
|
it.output = ev.output ?? '';
|
|
637
651
|
it.isError = ev.isError === true;
|
|
638
652
|
if (ev.notExecuted === true)
|
|
639
653
|
it.notExecuted = true;
|
|
640
654
|
else
|
|
641
655
|
delete it.notExecuted;
|
|
656
|
+
if (isCcToolDenialKind(ev.denialKind))
|
|
657
|
+
it.denialKind = ev.denialKind;
|
|
658
|
+
else
|
|
659
|
+
delete it.denialKind;
|
|
660
|
+
if (ev.refusalNoted === true)
|
|
661
|
+
it.refusalNoted = true;
|
|
662
|
+
else
|
|
663
|
+
delete it.refusalNoted;
|
|
642
664
|
const delta = itemBytesOf(it) - before;
|
|
643
665
|
s.itemBytes[at] = (s.itemBytes[at] ?? 0) + delta;
|
|
644
666
|
addBytes(s, delta);
|
|
645
|
-
stampPhase(s, it.id, 'end', ev.eventId, it.output !== outBefore || it.isError !== errBefore || it.notExecuted !== notExecBefore);
|
|
667
|
+
stampPhase(s, it.id, 'end', ev.eventId, it.output !== outBefore || it.isError !== errBefore || it.notExecuted !== notExecBefore || it.denialKind !== denialBefore || it.refusalNoted !== notedBefore);
|
|
646
668
|
break;
|
|
647
669
|
}
|
|
648
670
|
const synthId = id ?? `${ev.taskId}-tool-${s.items.length}`;
|
|
@@ -654,6 +676,8 @@ export function publishSubagentContentEvent(ev) {
|
|
|
654
676
|
output: ev.output ?? '',
|
|
655
677
|
isError: ev.isError === true,
|
|
656
678
|
...(ev.notExecuted === true ? { notExecuted: true } : {}),
|
|
679
|
+
...(isCcToolDenialKind(ev.denialKind) ? { denialKind: ev.denialKind } : {}),
|
|
680
|
+
...(ev.refusalNoted === true ? { refusalNoted: true } : {}),
|
|
657
681
|
});
|
|
658
682
|
recordCut(s);
|
|
659
683
|
stampPhase(s, synthId, 'end', ev.eventId, true);
|
|
@@ -698,6 +722,8 @@ export function planSubagentViewSlots(taskId) {
|
|
|
698
722
|
...(it.output !== undefined ? { output: it.output } : {}),
|
|
699
723
|
...(it.isError === true ? { isError: true } : {}),
|
|
700
724
|
...(it.notExecuted === true ? { notExecuted: true } : {}),
|
|
725
|
+
...(it.denialKind !== undefined ? { denialKind: it.denialKind } : {}),
|
|
726
|
+
...(it.refusalNoted === true ? { refusalNoted: true } : {}),
|
|
701
727
|
});
|
|
702
728
|
}
|
|
703
729
|
else if (it.kind === 'text') {
|
package/dist/toolResult.d.ts
CHANGED
|
@@ -109,6 +109,7 @@ export interface ToolResultRowFlags {
|
|
|
109
109
|
readonly interruptedNeverStarted: boolean;
|
|
110
110
|
readonly approvalWindowExpired: boolean;
|
|
111
111
|
readonly denialLimitWindowExpired: boolean;
|
|
112
|
+
readonly refusalNoted: boolean;
|
|
112
113
|
}
|
|
113
114
|
export declare function toolResultRowFlagsOf(row: object | null | undefined): ToolResultRowFlags;
|
|
114
115
|
export type ToolKillCause = NonNullable<ReturnType<typeof toolKillCauseAcrossEngineIdentity>> | 'memory_pressure';
|
package/dist/toolResult.js
CHANGED
|
@@ -8,6 +8,7 @@ import { guardedRead, ownDataField, ownSnapshotWhenTyped, readFrameTrueMark, rea
|
|
|
8
8
|
import { displayUntrusted } from './displayUntrusted.js';
|
|
9
9
|
import { isCoreSemaTaskTerminal } from './terminalStatuses.js';
|
|
10
10
|
import { CORE_ENGINE_CARD_TYPES } from './generated/engineFactTables.js';
|
|
11
|
+
import { SEMA_REFUSAL_NOTED_KEY } from './engineRowRef.js';
|
|
11
12
|
export const STRUCTURED_DETAIL_TYPES = frozenSet(CORE_ENGINE_CARD_TYPES);
|
|
12
13
|
const LEGACY_STRUCTURED_DETAIL_TYPE = 'task-output';
|
|
13
14
|
export function structuredDetailType(structured) {
|
|
@@ -318,6 +319,7 @@ export function toolResultRowFlagsOf(row) {
|
|
|
318
319
|
interruptedNeverStarted: readFrameTrueMark(row, '_sema_interrupted_never_started'),
|
|
319
320
|
approvalWindowExpired: readFrameTrueMark(row, '_sema_approval_window_expired'),
|
|
320
321
|
denialLimitWindowExpired: readFrameTrueMark(row, '_sema_denial_limit_window_expired'),
|
|
322
|
+
refusalNoted: readFrameTrueMark(row, SEMA_REFUSAL_NOTED_KEY),
|
|
321
323
|
});
|
|
322
324
|
}
|
|
323
325
|
const TOOL_KILL_TEXT = {
|
|
@@ -3,7 +3,8 @@ import { classifyTurnWireError, isPreStreamDrainingReject } from './wireErrorTri
|
|
|
3
3
|
import { isSseIdleError, streamEndedReasonOf } from './sseIdleTriage.js';
|
|
4
4
|
import { runNotFollowedOf } from './runFollow.js';
|
|
5
5
|
import { isCodeClassifiedGateFailure } from './gateFailureCodes.js';
|
|
6
|
-
import {
|
|
6
|
+
import { DRAINING_ERROR_CODE } from './engineErrorCodes.js';
|
|
7
|
+
import { SDK_NON_RETRYABLE_CODES } from './generated/sdkFactTables.js';
|
|
7
8
|
import { admissionWallRefusalContent, admissionWallRefusalFromError, bodyShapeRefusalFromError, bodyShapeRefusalTouchesSettings, fleetLeaseUnavailableContent, fleetLeaseUnavailableFromError, hostPostureRefusalContent, hostPostureRefusalFromError, fieldLimitRefusalContent, fieldLimitRefusalFromError, toolDeclarationRefusalContent, toolDeclarationRefusalFromError, usageWindowExhaustedContent, usageWindowExhaustedFromError, quotaExhaustedContent, quotaExhaustedFromError, userAttachmentRefusalFromError, } from './wireRefusalCopy.js';
|
|
8
9
|
import { THROWN_SLOT_UNREADABLE, readErrorNumber, readThrownSlot, wireFailureTextsOf } from './wireFailureShape.js';
|
|
9
10
|
import { effectiveCodeOf, ownReadingSlot, provablyNotSent, triageReadingOf } from './engineWireFor.js';
|
|
@@ -68,14 +69,7 @@ function isIdleWatchdog(err) {
|
|
|
68
69
|
return false;
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
|
-
const DETERMINISTIC_SERVER_CODES = new Set(
|
|
72
|
-
CORRUPT_SESSION_ERROR_CODE,
|
|
73
|
-
CORRUPT_ROW_ERROR_CODE,
|
|
74
|
-
SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE,
|
|
75
|
-
MEMORY_CONTROL_PLANE_CORRUPT,
|
|
76
|
-
'approvals.read_corrupt',
|
|
77
|
-
'workflow.journal_incompatible',
|
|
78
|
-
]);
|
|
72
|
+
const DETERMINISTIC_SERVER_CODES = new Set(SDK_NON_RETRYABLE_CODES);
|
|
79
73
|
const BROWSER_FETCH_FAILURE = /\bfailed to fetch\b|\bnetworkerror\b|\bnetwork error\b|\bload failed\b/i;
|
|
80
74
|
function httpShapeOf(verdict, code) {
|
|
81
75
|
const status = verdict.status;
|
|
@@ -90,7 +84,7 @@ function httpShapeOf(verdict, code) {
|
|
|
90
84
|
return { category: 'rate_limited', offer: false };
|
|
91
85
|
if (code === 'budget.precall' || code === 'budget.exceeded')
|
|
92
86
|
return { category: 'billing', offer: false };
|
|
93
|
-
if (code ===
|
|
87
|
+
if (code === DRAINING_ERROR_CODE || verdict.leaseUnavailable === true || isPreStreamDrainingReject(facts))
|
|
94
88
|
return { category: 'server_error', offer: true };
|
|
95
89
|
if (status === 501 || (code !== undefined && code.startsWith('capability.')))
|
|
96
90
|
return { category: 'capability_unavailable', offer: false };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DescriptorView } from './humanTurnRead.js';
|
|
2
2
|
export type UserAttachmentSource = 'at-mention' | 'compact-restore';
|
|
3
|
-
export type UserAttachmentNotIncludedReason = 'too-large' | 'unreadable' | 'read-denied' | 'approval-required' | 'server-not-connected' | 'resource-not-listed' | 'read-failed';
|
|
3
|
+
export type UserAttachmentNotIncludedReason = 'too-large' | 'unreadable' | 'read-denied' | 'approval-required' | 'server-not-connected' | 'resource-not-listed' | 'read-failed' | 'tools-elsewhere' | 'tools-location-unconfirmed';
|
|
4
4
|
export type UserAttachmentMcpResourcePart = {
|
|
5
5
|
readonly kind: 'text';
|
|
6
6
|
readonly text: string;
|
|
@@ -77,6 +77,7 @@ export type UserAttachmentDescriptor = {
|
|
|
77
77
|
readonly truncated: boolean;
|
|
78
78
|
};
|
|
79
79
|
export declare function showAttachmentName(s: string): string;
|
|
80
|
+
export declare function showAttachmentNameCc(s: string): string;
|
|
80
81
|
export declare function mintEnvelopeOf(d: DescriptorView, imageDelivery: 'attached' | 'not-attached'): string;
|
|
81
82
|
export declare function seatTextOf(d: DescriptorView): string | undefined;
|
|
82
83
|
export declare function mintReferenceOf(d: DescriptorView): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readDescriptor } from './humanTurnRead.js';
|
|
2
|
+
import { msg, renderMessage } from './i18n/translate.js';
|
|
2
3
|
const TILDE_CLASS_RUN = /[~\u02DC\u2053\u223C\u301C\uFF5E]+/g;
|
|
3
4
|
function envelopeFence(text) {
|
|
4
5
|
let longest = 0;
|
|
@@ -29,6 +30,13 @@ export function showAttachmentName(s) {
|
|
|
29
30
|
return cp > 0xffff ? `\\u{${cp.toString(16)}}` : `\\u${hex4(cp)}`;
|
|
30
31
|
});
|
|
31
32
|
}
|
|
33
|
+
const CC_CONTROL_UNITS = /[\p{Cc}\u2028\u2029]/gu;
|
|
34
|
+
export function showAttachmentNameCc(s) {
|
|
35
|
+
return String(s ?? '')
|
|
36
|
+
.replaceAll('<', '<')
|
|
37
|
+
.replaceAll('>', '>')
|
|
38
|
+
.replace(CC_CONTROL_UNITS, (c) => `&#${c.charCodeAt(0)};`);
|
|
39
|
+
}
|
|
32
40
|
const ESCAPE_NOTE = 'Some lines contain line-break control characters inside the line; they are shown as escape sequences (such as \\r or \\u2028), so those lines are not byte-for-byte the same as the file.';
|
|
33
41
|
const plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
|
|
34
42
|
function firstLine(source, what, name) {
|
|
@@ -169,6 +177,8 @@ const NOT_INCLUDED_REASON = Object.freeze({
|
|
|
169
177
|
'server-not-connected': 'the MCP server it comes from is not connected',
|
|
170
178
|
'resource-not-listed': 'the MCP server does not list that resource',
|
|
171
179
|
'read-failed': 'reading it from the MCP server failed',
|
|
180
|
+
'tools-elsewhere': renderMessage(msg('attachments.withheld.toolsElsewhere.model')),
|
|
181
|
+
'tools-location-unconfirmed': renderMessage(msg('attachments.withheld.toolsLocationUnconfirmed.model')),
|
|
172
182
|
});
|
|
173
183
|
function targetWhat(target) {
|
|
174
184
|
return target === 'directory' ? 'a directory' : target === 'file' ? 'a file' : 'a file or directory';
|
package/dist/wireErrorTriage.js
CHANGED
|
@@ -2,6 +2,7 @@ import { PROTOCOL_ERROR_NAME, effectiveWireCodeReading, isSlotCarrier, protocolE
|
|
|
2
2
|
import { capForDisplay, escapeDisplayControlChars } from './fleetTaskDesc.js';
|
|
3
3
|
import { readOwnDataValue } from './ownKey.js';
|
|
4
4
|
import { fleetLeaseUnavailableFromError } from './wireRefusalCopy.js';
|
|
5
|
+
import { isStreamEndedWithoutTerminalError } from './sseIdleTriage.js';
|
|
5
6
|
import { answerReadingOf, captureAnswer, captureUnanswered, causeSlotReadOf, effectiveCodeOf, noteTriageReading, ownReadingSlot } from './engineWireFor.js';
|
|
6
7
|
import { CORRUPT_ROW_ERROR_CODE, DRAINING_ERROR_CODE, FLEET_LEASE_UNAVAILABLE, isCorruptSessionCode, RESUME_AT_ERROR_CODE_PREFIX, RESUME_RETRY_LATER_CODES, RESUME_USAGE_WINDOW_EXHAUSTED, SCENARIO_NOT_ALLOWED_ERROR_CODE, } from './engineErrorCodes.js';
|
|
7
8
|
export const WIRE_NETWORK_ERROR_PATTERN = /fetch failed|ECONNREFUSED|ECONNRESET|ETIMEDOUT|EAI_AGAIN|ENOTFOUND|EHOSTUNREACH|ENETUNREACH|EPIPE|socket hang up|UND_ERR|\bterminated\b|\bother side closed\b/i;
|
|
@@ -105,7 +106,7 @@ export function classifyTurnWireError(err) {
|
|
|
105
106
|
if (captured !== undefined && captured.layer === err)
|
|
106
107
|
return httpVerdictOf(captured, () => renderedText(err), undefined, topCauseRecordOf(err, topCauseRead));
|
|
107
108
|
const slots = readTurnErrorSlots(err, topStatusOf(err, ans), topCauseRead);
|
|
108
|
-
if (slots.status !== THROWN_SLOT_UNREADABLE &&
|
|
109
|
+
if (slots.status !== THROWN_SLOT_UNREADABLE && isStreamEndedWithoutTerminalError(err)) {
|
|
109
110
|
return noted({ kind: 'stream-ended-without-terminal' }, ans, captured, transportShapeOf(slots, err, ans), err, slots.errorCode, topCauseRead);
|
|
110
111
|
}
|
|
111
112
|
if (captured !== undefined) {
|
|
@@ -13,6 +13,8 @@ interface WireFailureShape {
|
|
|
13
13
|
export declare const THROWN_SLOT_UNREADABLE: unique symbol;
|
|
14
14
|
export declare function isSlotCarrier(x: {} | null | undefined): x is object;
|
|
15
15
|
export declare function readThrownSlot(o: unknown, key: string, own?: boolean | 'data'): unknown;
|
|
16
|
+
export declare function errnoCode(e: {} | null | undefined): string | undefined;
|
|
17
|
+
export declare function thrownSlotOf(err: {} | null | undefined, name: string, kind?: boolean | 'data'): {} | null | undefined;
|
|
16
18
|
export declare function thrownIsInstanceOf<C extends abstract new (...args: never[]) => unknown>(e: unknown, cls: C): e is InstanceType<C>;
|
|
17
19
|
export type ThrownExtraReading = {
|
|
18
20
|
readonly state: 'object';
|
|
@@ -27,6 +29,8 @@ export interface ThrownExtraSnapshot {
|
|
|
27
29
|
readonly bag: ThrownExtraReading;
|
|
28
30
|
}
|
|
29
31
|
export declare function readThrownExtraSnapshot(o: {} | null | undefined): ThrownExtraSnapshot;
|
|
32
|
+
export declare function liftLegacyRefusalFacts(code: {} | null | undefined, bag: object): object;
|
|
33
|
+
export declare function placeThrownExtraOnCopy<V>(thrown: object, copy: object, copyBag: (bag: object) => V | undefined): 'placed' | 'not_placed' | 'place_failed';
|
|
30
34
|
export declare const PROTOCOL_ERROR_NAME: Readonly<{
|
|
31
35
|
readonly ApprovalBindingMismatchError: "ApprovalBindingMismatchError";
|
|
32
36
|
readonly ApprovalStaleError: "ApprovalStaleError";
|
package/dist/wireFailureShape.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { msg, renderMessage } from './i18n/translate.js';
|
|
2
|
-
import { guardedRead, ownDataField, readOwnDataValue } from './ownKey.js';
|
|
3
|
-
import { RESUME_POLICY_FOLD_CODE } from './engineErrorCodes.js';
|
|
2
|
+
import { guardedRead, ownDataField, readOwnDataNonEmptyString, readOwnDataValue } from './ownKey.js';
|
|
3
|
+
import { CONFIG_AGENT_UNKNOWN_TOOL, CONFIG_TOOL_FACE_CONTROL, REQUEST_FIELD_CONFLICT, RESUME_POLICY_FOLD_CODE, SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE, USER_ATTACHMENT_INVALID_ERROR_CODE } from './engineErrorCodes.js';
|
|
4
|
+
import { requestCoordinateText } from './requestCoordinate.js';
|
|
4
5
|
export const THROWN_SLOT_UNREADABLE = Symbol('thrown-slot-unreadable');
|
|
5
6
|
export function isSlotCarrier(x) {
|
|
6
7
|
return (typeof x === 'object' && x !== null) || typeof x === 'function';
|
|
@@ -20,6 +21,13 @@ export function readThrownSlot(o, key, own = false) {
|
|
|
20
21
|
return THROWN_SLOT_UNREADABLE;
|
|
21
22
|
}
|
|
22
23
|
}
|
|
24
|
+
export function errnoCode(e) {
|
|
25
|
+
return guardedRead(() => readOwnDataNonEmptyString(e, 'code'));
|
|
26
|
+
}
|
|
27
|
+
export function thrownSlotOf(err, name, kind = false) {
|
|
28
|
+
const v = readThrownSlot(err, name, kind);
|
|
29
|
+
return v === THROWN_SLOT_UNREADABLE ? undefined : v;
|
|
30
|
+
}
|
|
23
31
|
function readGuarded(o, key) {
|
|
24
32
|
const v = readThrownSlot(o, key);
|
|
25
33
|
return v === THROWN_SLOT_UNREADABLE ? undefined : v;
|
|
@@ -117,7 +125,125 @@ export function readThrownExtraSnapshot(o) {
|
|
|
117
125
|
catch {
|
|
118
126
|
return { bag: { state: 'unreadable' } };
|
|
119
127
|
}
|
|
120
|
-
return { bag: { state: 'object', value: slot } };
|
|
128
|
+
return { bag: { state: 'object', value: liftLegacyRefusalFacts(readThrownSlot(o, 'errorCode', 'data'), slot) } };
|
|
129
|
+
}
|
|
130
|
+
export function liftLegacyRefusalFacts(code, bag) {
|
|
131
|
+
try {
|
|
132
|
+
if (typeof code !== 'string')
|
|
133
|
+
return bag;
|
|
134
|
+
const dd = Object.getOwnPropertyDescriptor(bag, 'detail');
|
|
135
|
+
if (dd === undefined || !Object.hasOwn(dd, 'value'))
|
|
136
|
+
return bag;
|
|
137
|
+
const detail = dd.value;
|
|
138
|
+
if (typeof detail !== 'object' || detail === null || Array.isArray(detail))
|
|
139
|
+
return bag;
|
|
140
|
+
const moves = legacyRefusalMovesOf(code, bag, detail);
|
|
141
|
+
if (moves === undefined)
|
|
142
|
+
return bag;
|
|
143
|
+
const out = Object.create(null);
|
|
144
|
+
for (const key of Reflect.ownKeys(bag)) {
|
|
145
|
+
if (key === 'detail')
|
|
146
|
+
continue;
|
|
147
|
+
const d = Object.getOwnPropertyDescriptor(bag, key);
|
|
148
|
+
if (d !== undefined)
|
|
149
|
+
Object.defineProperty(out, key, { ...d, configurable: true });
|
|
150
|
+
}
|
|
151
|
+
for (const [key, value, override] of moves) {
|
|
152
|
+
if (!override && Object.getOwnPropertyDescriptor(out, key) !== undefined)
|
|
153
|
+
continue;
|
|
154
|
+
Object.defineProperty(out, key, { value, enumerable: true, writable: false, configurable: true });
|
|
155
|
+
}
|
|
156
|
+
return Object.freeze(out);
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
return bag;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const LEGACY_PROBLEMS_CODES = Object.freeze(['request.field_invalid', CONFIG_AGENT_UNKNOWN_TOOL, CONFIG_TOOL_FACE_CONTROL, 'request.unprocessable', RESUME_POLICY_FOLD_CODE]);
|
|
163
|
+
const LEGACY_HOOKS_KEYS = Object.freeze(['reason', 'event', 'alias', 'canonical', 'groupIndex', 'budgetMs', 'totalMs', 'type', 'key', 'count', 'cap']);
|
|
164
|
+
function legacyRefusalMovesOf(code, bag, detail) {
|
|
165
|
+
const moves = [];
|
|
166
|
+
const take = (from, to = from, override = false) => {
|
|
167
|
+
const v = guardedRead(() => readOwnDataValue(detail, from));
|
|
168
|
+
if (v !== undefined)
|
|
169
|
+
moves.push([to, v, override]);
|
|
170
|
+
};
|
|
171
|
+
const rootField = guardedRead(() => readOwnDataValue(bag, 'field'));
|
|
172
|
+
if (code === 'request.field_invalid' && rootField === 'settings.hooks') {
|
|
173
|
+
for (const k of LEGACY_HOOKS_KEYS)
|
|
174
|
+
take(k);
|
|
175
|
+
const path = legacyHooksPathOf(detail);
|
|
176
|
+
if (path !== undefined)
|
|
177
|
+
moves.push(['field', requestCoordinateText(path[0] === 'hooks' ? 'settings' : 'settings.hooks', path), true]);
|
|
178
|
+
for (const k of ['problems', 'total', 'callerTrust'])
|
|
179
|
+
take(k);
|
|
180
|
+
return moves;
|
|
181
|
+
}
|
|
182
|
+
if (code === REQUEST_FIELD_CONFLICT) {
|
|
183
|
+
take('kind', 'reason');
|
|
184
|
+
for (const k of ['fields', 'count', 'cap'])
|
|
185
|
+
take(k);
|
|
186
|
+
return moves;
|
|
187
|
+
}
|
|
188
|
+
if (LEGACY_PROBLEMS_CODES.includes(code)) {
|
|
189
|
+
for (const k of ['problems', 'total', 'callerTrust'])
|
|
190
|
+
take(k);
|
|
191
|
+
return moves;
|
|
192
|
+
}
|
|
193
|
+
if (code === 'conflict.session_placed')
|
|
194
|
+
take('placement_kind');
|
|
195
|
+
else if (code === SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE)
|
|
196
|
+
for (const k of ['scenario', 'source'])
|
|
197
|
+
take(k);
|
|
198
|
+
else if (code === 'steering.duplicate_input_id')
|
|
199
|
+
take('differs');
|
|
200
|
+
else if (code === USER_ATTACHMENT_INVALID_ERROR_CODE) {
|
|
201
|
+
const path = guardedRead(() => readOwnDataValue(detail, 'path'));
|
|
202
|
+
if (typeof path === 'string' && path.length > 0)
|
|
203
|
+
moves.push(['field', path, false]);
|
|
204
|
+
const index = guardedRead(() => readOwnDataValue(detail, 'index'));
|
|
205
|
+
if (typeof index === 'number' && Number.isSafeInteger(index) && index >= 0)
|
|
206
|
+
moves.push(['index', index, false]);
|
|
207
|
+
}
|
|
208
|
+
else
|
|
209
|
+
return undefined;
|
|
210
|
+
return moves;
|
|
211
|
+
}
|
|
212
|
+
function legacyHooksPathOf(detail) {
|
|
213
|
+
try {
|
|
214
|
+
const raw = readOwnDataValue(detail, 'path');
|
|
215
|
+
if (!Array.isArray(raw) || raw.length === 0)
|
|
216
|
+
return undefined;
|
|
217
|
+
const out = [];
|
|
218
|
+
for (let i = 0; i < raw.length; i++) {
|
|
219
|
+
if (!Object.hasOwn(raw, i))
|
|
220
|
+
return undefined;
|
|
221
|
+
const v = raw[i];
|
|
222
|
+
if (typeof v === 'string' || (typeof v === 'number' && Number.isSafeInteger(v) && v >= 0))
|
|
223
|
+
out.push(v);
|
|
224
|
+
else
|
|
225
|
+
return undefined;
|
|
226
|
+
}
|
|
227
|
+
return out;
|
|
228
|
+
}
|
|
229
|
+
catch {
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
export function placeThrownExtraOnCopy(thrown, copy, copyBag) {
|
|
234
|
+
try {
|
|
235
|
+
const bag = readThrownExtraSnapshot(thrown).bag;
|
|
236
|
+
if (bag.state !== 'object')
|
|
237
|
+
return 'not_placed';
|
|
238
|
+
const value = copyBag(bag.value);
|
|
239
|
+
if (value === undefined)
|
|
240
|
+
return 'not_placed';
|
|
241
|
+
Object.defineProperty(copy, EXTRA_KEY, { value, writable: true, enumerable: true, configurable: true });
|
|
242
|
+
return 'placed';
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
return 'place_failed';
|
|
246
|
+
}
|
|
121
247
|
}
|
|
122
248
|
export const PROTOCOL_ERROR_NAME = Object.freeze({
|
|
123
249
|
ApprovalBindingMismatchError: 'ApprovalBindingMismatchError',
|
|
@@ -472,24 +598,20 @@ export function readRefusalNamedFields(o) {
|
|
|
472
598
|
out.push(v);
|
|
473
599
|
};
|
|
474
600
|
add(guardedRead(() => readRefusalField(o)));
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
const
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
if (typeof item !== 'object' || item === null)
|
|
486
|
-
continue;
|
|
487
|
-
add(guardedRead(() => readOwnDataValue(item, 'field')));
|
|
488
|
-
}
|
|
601
|
+
try {
|
|
602
|
+
const list = readErrorPresent(o, 'problems');
|
|
603
|
+
if (Array.isArray(list)) {
|
|
604
|
+
const n = list.length;
|
|
605
|
+
const len = typeof n === 'number' && Number.isSafeInteger(n) && n > 0 ? Math.min(n, REFUSAL_PROBLEMS_READ_MAX) : 0;
|
|
606
|
+
for (let i = 0; i < len; i += 1) {
|
|
607
|
+
const item = guardedRead(() => readOwnDataValue(list, String(i)));
|
|
608
|
+
if (typeof item !== 'object' || item === null)
|
|
609
|
+
continue;
|
|
610
|
+
add(guardedRead(() => readOwnDataValue(item, 'field')));
|
|
489
611
|
}
|
|
490
612
|
}
|
|
491
|
-
|
|
492
|
-
|
|
613
|
+
}
|
|
614
|
+
catch {
|
|
493
615
|
}
|
|
494
616
|
return Object.freeze(out);
|
|
495
617
|
}
|
|
@@ -108,28 +108,29 @@ export type HookMatcherRefusal = {
|
|
|
108
108
|
readonly event: string;
|
|
109
109
|
readonly alias: string;
|
|
110
110
|
readonly canonical: string;
|
|
111
|
-
readonly
|
|
111
|
+
readonly groupIndex?: number;
|
|
112
|
+
readonly field?: string;
|
|
112
113
|
} | {
|
|
113
114
|
readonly reason: 'invalid_regex';
|
|
114
115
|
readonly event: string;
|
|
115
116
|
readonly groupIndex: number;
|
|
116
|
-
readonly
|
|
117
|
+
readonly field?: string;
|
|
117
118
|
} | {
|
|
118
119
|
readonly reason: 'over_budget';
|
|
119
120
|
readonly event: string;
|
|
120
121
|
readonly groupIndex: number;
|
|
121
122
|
readonly budgetMs?: number;
|
|
122
|
-
readonly
|
|
123
|
+
readonly field?: string;
|
|
123
124
|
} | {
|
|
124
125
|
readonly reason: 'budget_exceeded';
|
|
125
126
|
readonly event: string;
|
|
126
127
|
readonly groupIndex: number;
|
|
127
128
|
readonly totalMs?: number;
|
|
128
|
-
readonly
|
|
129
|
+
readonly field?: string;
|
|
129
130
|
};
|
|
130
131
|
export interface SettingsHooksRefusal {
|
|
131
132
|
readonly reason: string;
|
|
132
|
-
readonly
|
|
133
|
+
readonly field: string;
|
|
133
134
|
readonly matcher?: HookMatcherRefusal;
|
|
134
135
|
readonly count?: number;
|
|
135
136
|
readonly cap?: number;
|