@sema-agent/client-core 0.77.1 → 0.78.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 +42 -1
- package/README.md +6 -5
- package/dist/abortableSleep.d.ts +0 -28
- package/dist/abortableSleep.js +0 -28
- package/dist/adapt/arms.d.ts +0 -46
- package/dist/adapt/arms.js +9 -544
- package/dist/adapt/ids.d.ts +0 -58
- package/dist/adapt/ids.js +0 -63
- package/dist/adapt/instanceLedger.d.ts +0 -25
- package/dist/adapt/instanceLedger.js +0 -20
- package/dist/adapt/panelTasks.d.ts +0 -69
- package/dist/adapt/panelTasks.js +0 -95
- package/dist/adapt/textSegmentAuthority.d.ts +1 -137
- package/dist/adapt/textSegmentAuthority.js +0 -54
- package/dist/adapt/textStream.d.ts +0 -252
- package/dist/adapt/textStream.js +2 -281
- package/dist/adapt/toolCards.d.ts +0 -46
- package/dist/adapt/toolCards.js +0 -23
- package/dist/adapt/turnFlags.d.ts +0 -54
- package/dist/adapt/turnFlags.js +1 -17
- package/dist/adapt/wireShapes.d.ts +0 -92
- package/dist/adapt/wireShapes.js +0 -83
- package/dist/adapt.d.ts +0 -55
- package/dist/adapt.js +1 -120
- package/dist/adapter/activeRunSelfHeal.d.ts +22 -515
- package/dist/adapter/activeRunSelfHeal.js +10 -625
- package/dist/adapter/downstream/eventToSdkMessage.d.ts +2 -305
- package/dist/adapter/downstream/eventToSdkMessage.js +2 -867
- package/dist/adapter/downstream/terminalToSdkResult.d.ts +2 -314
- package/dist/adapter/downstream/terminalToSdkResult.js +13 -560
- package/dist/adapter/downstream/turnUsageToModelUsage.d.ts +0 -95
- package/dist/adapter/downstream/turnUsageToModelUsage.js +2 -31
- package/dist/adapter/runStream.d.ts +0 -206
- package/dist/adapter/runStream.js +6 -596
- package/dist/adapter/types.d.ts +0 -111
- package/dist/adapter/types.js +0 -29
- package/dist/agentSession/backgroundView.d.ts +0 -106
- package/dist/agentSession/backgroundView.js +3 -49
- package/dist/agentSession/contract.d.ts +0 -98
- package/dist/agentSession/contract.js +0 -12
- package/dist/agentsWireCaps.d.ts +0 -72
- package/dist/agentsWireCaps.js +4 -72
- package/dist/approvalsStreamLiveCapability.d.ts +0 -25
- package/dist/approvalsStreamLiveCapability.js +0 -31
- package/dist/argvFlagValue.d.ts +0 -33
- package/dist/argvFlagValue.js +3 -35
- package/dist/attachmentsWireCaps.d.ts +0 -127
- package/dist/attachmentsWireCaps.js +0 -144
- package/dist/autoModeUnavailable.d.ts +0 -120
- package/dist/autoModeUnavailable.js +0 -144
- package/dist/classifierStatus.d.ts +0 -72
- package/dist/classifierStatus.js +0 -167
- package/dist/classifierVerdictWire.d.ts +0 -54
- package/dist/classifierVerdictWire.js +0 -133
- package/dist/clientContextWireCaps.d.ts +0 -37
- package/dist/clientContextWireCaps.js +0 -36
- package/dist/clientSlice.d.ts +0 -63
- package/dist/clientSlice.js +0 -45
- package/dist/cloudConfigWireCaps.d.ts +0 -86
- package/dist/cloudConfigWireCaps.js +2 -65
- package/dist/compensations.d.ts +0 -52
- package/dist/compensations.js +2 -63
- package/dist/controlRouter.d.ts +2 -208
- package/dist/controlRouter.js +1 -129
- package/dist/coreValuePorts.d.ts +0 -84
- package/dist/coreValuePorts.js +0 -29
- package/dist/decideReceipt.d.ts +0 -110
- package/dist/decideReceipt.js +0 -84
- package/dist/detachWire.d.ts +0 -130
- package/dist/detachWire.js +1 -130
- package/dist/deviceExecutorManagementCapability.d.ts +2 -35
- package/dist/deviceExecutorManagementCapability.js +1 -37
- package/dist/diagnostics.d.ts +0 -8
- package/dist/diagnostics.js +0 -8
- package/dist/diff/patch.d.ts +0 -17
- package/dist/diff/patch.js +0 -19
- package/dist/effectiveFacts.d.ts +0 -40
- package/dist/effectiveFacts.js +0 -22
- package/dist/effortWire.d.ts +0 -11
- package/dist/effortWire.js +0 -12
- package/dist/engineAgentPanelStore.d.ts +0 -169
- package/dist/engineAgentPanelStore.js +13 -293
- package/dist/engineCapReader.d.ts +0 -62
- package/dist/engineCapReader.js +1 -43
- package/dist/engineCapsCache.d.ts +0 -177
- package/dist/engineCapsCache.js +0 -199
- package/dist/engineCapsGenerationGuard.d.ts +0 -2
- package/dist/engineCapsGenerationGuard.js +0 -11
- package/dist/engineErrorCodes.d.ts +1 -316
- package/dist/engineErrorCodes.js +0 -427
- package/dist/engineHttpTools.d.ts +0 -29
- package/dist/engineHttpTools.js +0 -29
- package/dist/engineIdentity.d.ts +0 -83
- package/dist/engineIdentity.js +0 -88
- package/dist/engineInlineTaskStats.d.ts +0 -57
- package/dist/engineInlineTaskStats.js +1 -42
- package/dist/engineNoticeCodes.d.ts +0 -190
- package/dist/engineNoticeCodes.js +0 -182
- package/dist/engineSessionParam.d.ts +0 -30
- package/dist/engineSessionParam.js +0 -52
- package/dist/engineToolLabelStore.d.ts +0 -29
- package/dist/engineToolLabelStore.js +0 -31
- package/dist/engineWireSdk.d.ts +0 -90
- package/dist/engineWireSdk.js +0 -74
- package/dist/engineWireTarget.d.ts +0 -14
- package/dist/engineWireTarget.js +0 -39
- package/dist/env/localeGeo.d.ts +0 -12
- package/dist/env/localeGeo.js +2 -77
- package/dist/env/localeTag.d.ts +0 -34
- package/dist/env/localeTag.js +0 -32
- package/dist/env/uiLanguage.d.ts +0 -13
- package/dist/env/uiLanguage.js +0 -25
- package/dist/envFlag.d.ts +0 -37
- package/dist/envFlag.js +0 -40
- package/dist/executionLaneCapability.d.ts +0 -48
- package/dist/executionLaneCapability.js +0 -54
- package/dist/finalVerifyWire.d.ts +0 -67
- package/dist/finalVerifyWire.js +3 -43
- package/dist/fleet/fleetLedger.d.ts +0 -308
- package/dist/fleet/fleetLedger.js +10 -429
- package/dist/fleet/fleetProjection.d.ts +0 -240
- package/dist/fleet/fleetProjection.js +0 -189
- package/dist/fleet/fleetRowAgentType.d.ts +0 -6
- package/dist/fleet/fleetRowAgentType.js +1 -32
- package/dist/fleet/workflowSizeWarning.d.ts +0 -47
- package/dist/fleet/workflowSizeWarning.js +1 -46
- package/dist/fleetAgentPanelProjection.d.ts +0 -48
- package/dist/fleetAgentPanelProjection.js +8 -173
- package/dist/fleetTaskDesc.d.ts +0 -39
- package/dist/fleetTaskDesc.js +0 -69
- package/dist/forkWireCaps.d.ts +0 -23
- package/dist/forkWireCaps.js +1 -24
- package/dist/gateOutcome.d.ts +0 -140
- package/dist/gateOutcome.js +0 -85
- package/dist/gateVocabulary.d.ts +0 -114
- package/dist/gateVocabulary.js +3 -161
- package/dist/goalStopHook.d.ts +0 -127
- package/dist/goalStopHook.js +0 -178
- package/dist/headlessPermissionModeWire.d.ts +0 -76
- package/dist/headlessPermissionModeWire.js +1 -155
- package/dist/headlessReconnectWire.d.ts +0 -84
- package/dist/headlessReconnectWire.js +13 -67
- package/dist/hitl/approvalDecisionNoteAudit.d.ts +0 -49
- package/dist/hitl/approvalDecisionNoteAudit.js +0 -56
- package/dist/hitl/approvalOutcomeNote.d.ts +0 -2
- package/dist/hitl/approvalOutcomeNote.js +0 -20
- package/dist/hitl/approvalResolution.d.ts +0 -113
- package/dist/hitl/approvalResolution.js +0 -66
- package/dist/hitl/approvalsFeed.d.ts +0 -183
- package/dist/hitl/approvalsFeed.js +12 -243
- package/dist/hitl/armedGateRegistry.d.ts +0 -55
- package/dist/hitl/armedGateRegistry.js +0 -146
- package/dist/hitl/askGateWire.d.ts +0 -86
- package/dist/hitl/askGateWire.js +1 -95
- package/dist/hitl/askParkRowRouting.d.ts +0 -123
- package/dist/hitl/askParkRowRouting.js +1 -89
- package/dist/hitl/crashConverged.d.ts +0 -148
- package/dist/hitl/crashConverged.js +0 -214
- package/dist/hitl/editedRuleTextPrecheck.d.ts +0 -109
- package/dist/hitl/editedRuleTextPrecheck.js +0 -71
- package/dist/hitl/frameRouter.d.ts +0 -134
- package/dist/hitl/frameRouter.js +6 -378
- package/dist/hitl/gateIdentity.d.ts +0 -39
- package/dist/hitl/gateIdentity.js +0 -41
- package/dist/hitl/gateLedger.d.ts +0 -267
- package/dist/hitl/gateLedger.js +0 -121
- package/dist/hitl/hitlBridge.d.ts +7 -431
- package/dist/hitl/hitlBridge.js +7 -476
- package/dist/hitl/hitlHostSurface.d.ts +0 -150
- package/dist/hitl/hitlHostSurface.js +0 -169
- package/dist/hitl/livePendingAsk.d.ts +0 -91
- package/dist/hitl/livePendingAsk.js +0 -74
- package/dist/hitl/localAllowRule.d.ts +0 -62
- package/dist/hitl/localAllowRule.js +1 -33
- package/dist/hitl/parkOwnership.d.ts +0 -56
- package/dist/hitl/parkOwnership.js +0 -22
- package/dist/hitl/parkResolver.d.ts +3 -88
- package/dist/hitl/parkResolver.js +8 -349
- package/dist/hitl/parkRowBirthWait.d.ts +2 -26
- package/dist/hitl/parkRowBirthWait.js +3 -93
- package/dist/hitl/persistedRulesWire.d.ts +23 -371
- package/dist/hitl/persistedRulesWire.js +62 -329
- package/dist/hitl/planReviewWire.d.ts +4 -176
- package/dist/hitl/planReviewWire.js +9 -312
- package/dist/hitl/resumeRunningCard.d.ts +0 -105
- package/dist/hitl/resumeRunningCard.js +0 -105
- package/dist/hitl/sessionPolicyWire.d.ts +11 -191
- package/dist/hitl/sessionPolicyWire.js +0 -149
- package/dist/hitl/suspendedReopen.d.ts +3 -24
- package/dist/hitl/suspendedReopen.js +0 -14
- package/dist/hitl/toolApprovalWire.d.ts +5 -1308
- package/dist/hitl/toolApprovalWire.js +5 -945
- package/dist/hooksWireCaps.d.ts +0 -38
- package/dist/hooksWireCaps.js +0 -190
- package/dist/host.d.ts +0 -105
- package/dist/host.js +0 -33
- package/dist/hostEnv.d.ts +0 -14
- package/dist/hostEnv.js +0 -13
- package/dist/imagesWireCaps.d.ts +0 -21
- package/dist/imagesWireCaps.js +0 -22
- package/dist/index.d.ts +0 -134
- package/dist/index.js +0 -476
- package/dist/interactiveHalt.d.ts +5 -153
- package/dist/interactiveHalt.js +0 -111
- package/dist/interactiveToolsWire.d.ts +0 -62
- package/dist/interactiveToolsWire.js +1 -67
- package/dist/leaderConflict.d.ts +0 -59
- package/dist/leaderConflict.js +0 -48
- package/dist/limitsWire.d.ts +0 -125
- package/dist/limitsWire.js +2 -120
- package/dist/liveInitToolFace.d.ts +0 -77
- package/dist/liveInitToolFace.js +1 -109
- package/dist/liveModelCatalog.d.ts +0 -52
- package/dist/liveModelCatalog.js +0 -48
- package/dist/liveQuestionStore.d.ts +0 -87
- package/dist/liveQuestionStore.js +1 -56
- package/dist/mcpLiveness.d.ts +0 -151
- package/dist/mcpLiveness.js +0 -122
- package/dist/mcpPanel.d.ts +0 -104
- package/dist/mcpPanel.js +0 -49
- package/dist/mcpReconnect.d.ts +0 -58
- package/dist/mcpReconnect.js +0 -69
- package/dist/mcpWireCaps.d.ts +0 -55
- package/dist/mcpWireCaps.js +1 -13
- package/dist/memoryComplianceCapability.d.ts +3 -57
- package/dist/memoryComplianceCapability.js +0 -57
- package/dist/memoryEntriesWire.d.ts +6 -198
- package/dist/memoryEntriesWire.js +0 -144
- package/dist/memoryOriginCapability.d.ts +3 -53
- package/dist/memoryOriginCapability.js +0 -50
- package/dist/memorySpecWire.d.ts +0 -116
- package/dist/memorySpecWire.js +0 -150
- package/dist/model/catalog.d.ts +0 -111
- package/dist/model/catalog.js +0 -87
- package/dist/model/catalogLoader.d.ts +0 -114
- package/dist/model/catalogLoader.js +2 -139
- package/dist/model/modelSupplyRules.d.ts +1 -55
- package/dist/model/modelSupplyRules.js +0 -62
- package/dist/model/providerAuth.d.ts +0 -103
- package/dist/model/providerAuth.js +2 -38
- package/dist/model/providerCatalog.d.ts +0 -45
- package/dist/model/providerCatalog.js +0 -37
- package/dist/model/providerPresets.d.ts +0 -33
- package/dist/model/providerPresets.js +2 -91
- package/dist/model/tierVocabulary.d.ts +0 -31
- package/dist/model/tierVocabulary.js +0 -27
- package/dist/modelBudgetRule.d.ts +0 -39
- package/dist/modelBudgetRule.js +0 -39
- package/dist/modelCapabilityProbe.d.ts +0 -175
- package/dist/modelCapabilityProbe.js +0 -147
- package/dist/modelWireCaps.d.ts +0 -13
- package/dist/modelWireCaps.js +0 -13
- package/dist/notifications.d.ts +0 -233
- package/dist/notifications.js +14 -492
- package/dist/oneShotWireCaps.d.ts +0 -34
- package/dist/oneShotWireCaps.js +0 -35
- package/dist/ownKey.d.ts +0 -33
- package/dist/ownKey.js +0 -33
- package/dist/panelRunningHistory.d.ts +0 -28
- package/dist/panelRunningHistory.js +0 -43
- package/dist/peerFrames.d.ts +0 -71
- package/dist/peerFrames.js +0 -168
- package/dist/peerLaneCapability.d.ts +0 -44
- package/dist/peerLaneCapability.js +0 -52
- package/dist/permissionRuleIssue.d.ts +0 -30
- package/dist/permissionRuleIssue.js +0 -78
- package/dist/permissionRulesWriteCapability.d.ts +0 -46
- package/dist/permissionRulesWriteCapability.js +0 -54
- package/dist/permissionWireCaps.d.ts +0 -37
- package/dist/permissionWireCaps.js +0 -37
- package/dist/postureKnob.d.ts +0 -71
- package/dist/postureKnob.js +0 -86
- package/dist/principalWire.d.ts +0 -17
- package/dist/principalWire.js +0 -17
- package/dist/printToolResultFrame.d.ts +0 -100
- package/dist/printToolResultFrame.js +0 -33
- package/dist/promptProfileWireCaps.d.ts +0 -13
- package/dist/promptProfileWireCaps.js +0 -13
- package/dist/readFacePosture.d.ts +0 -43
- package/dist/readFacePosture.js +0 -46
- package/dist/request/printNotification.d.ts +0 -20
- package/dist/request/printNotification.js +0 -55
- package/dist/request/taskRequest.d.ts +1 -249
- package/dist/request/taskRequest.js +20 -498
- package/dist/resumeRefusalCopy.d.ts +0 -136
- package/dist/resumeRefusalCopy.js +1 -117
- package/dist/retainBackgroundWireCaps.d.ts +0 -48
- package/dist/retainBackgroundWireCaps.js +0 -48
- package/dist/retryStatus.d.ts +2 -221
- package/dist/retryStatus.js +0 -107
- package/dist/rewindWireCaps.d.ts +0 -27
- package/dist/rewindWireCaps.js +0 -24
- package/dist/runCancelContext.d.ts +1 -20
- package/dist/runCancelContext.js +0 -34
- package/dist/runTerminal.d.ts +0 -273
- package/dist/runTerminal.js +0 -177
- package/dist/sandboxWire.d.ts +0 -38
- package/dist/sandboxWire.js +0 -82
- package/dist/scenarioWire.d.ts +0 -60
- package/dist/scenarioWire.js +0 -68
- package/dist/scratchpadWireCaps.d.ts +0 -11
- package/dist/scratchpadWireCaps.js +0 -32
- package/dist/sdkWireTransit.d.ts +0 -38
- package/dist/sdkWireTransit.js +0 -30
- package/dist/seam.d.ts +18 -853
- package/dist/seam.js +0 -52
- package/dist/seatContract.d.ts +0 -555
- package/dist/seatContract.js +5 -304
- package/dist/selfOrchestrationDenial.d.ts +0 -189
- package/dist/selfOrchestrationDenial.js +0 -162
- package/dist/selfOrchestrationWireCaps.d.ts +0 -38
- package/dist/selfOrchestrationWireCaps.js +0 -38
- package/dist/sessionMap.d.ts +0 -60
- package/dist/sessionMap.js +0 -37
- package/dist/sessionMemoryStatus.d.ts +11 -114
- package/dist/sessionMemoryStatus.js +0 -112
- package/dist/sessionModelLatch.d.ts +0 -29
- package/dist/sessionModelLatch.js +0 -40
- package/dist/sessionPolicyCapability.d.ts +3 -53
- package/dist/sessionPolicyCapability.js +0 -52
- package/dist/sessionSlot.d.ts +0 -26
- package/dist/sessionSlot.js +0 -17
- package/dist/skillsWireCaps.d.ts +0 -87
- package/dist/skillsWireCaps.js +0 -38
- package/dist/sqlEngineCapability.d.ts +0 -118
- package/dist/sqlEngineCapability.js +0 -134
- package/dist/sseIdleTriage.d.ts +0 -79
- package/dist/sseIdleTriage.js +1 -80
- package/dist/steering.d.ts +0 -54
- package/dist/steering.js +0 -63
- package/dist/subagent/engineCompactWire.d.ts +0 -34
- package/dist/subagent/engineCompactWire.js +4 -134
- package/dist/subagent/engineDelegatedPrompt.d.ts +0 -31
- package/dist/subagent/engineDelegatedPrompt.js +1 -103
- package/dist/subagent/engineRowStopGate.d.ts +0 -20
- package/dist/subagent/engineRowStopGate.js +0 -49
- package/dist/subagent/engineSubagentOutput.d.ts +0 -7
- package/dist/subagent/engineSubagentOutput.js +1 -51
- package/dist/subagent/engineSubagentResume.d.ts +2 -279
- package/dist/subagent/engineSubagentResume.js +2 -129
- package/dist/subagent/engineSubagentSteer.d.ts +0 -26
- package/dist/subagent/engineSubagentSteer.js +0 -63
- package/dist/subagent/engineSubagentTail.d.ts +0 -38
- package/dist/subagent/engineSubagentTail.js +2 -110
- package/dist/subagent/engineTaskHandleWire.d.ts +6 -67
- package/dist/subagent/engineTaskHandleWire.js +0 -126
- package/dist/subagent/subagentOwnerAbsence.d.ts +0 -2
- package/dist/subagent/subagentOwnerAbsence.js +0 -25
- package/dist/subagentContentStore.d.ts +3 -260
- package/dist/subagentContentStore.js +7 -540
- package/dist/systemReminderTag.d.ts +0 -49
- package/dist/systemReminderTag.js +0 -61
- package/dist/toolResult.d.ts +1 -211
- package/dist/toolResult.js +1 -358
- package/dist/toolRoster.d.ts +0 -140
- package/dist/toolRoster.js +0 -66
- package/dist/typePins.d.ts +0 -46
- package/dist/types/engineState.d.ts +0 -71
- package/dist/types/engineState.js +0 -16
- package/dist/ultracodeWireCaps.d.ts +0 -75
- package/dist/ultracodeWireCaps.js +0 -92
- package/dist/unrefTimer.d.ts +0 -27
- package/dist/webSearchBackendCapability.d.ts +0 -72
- package/dist/webSearchBackendCapability.js +0 -79
- package/dist/webSearchWireCaps.d.ts +0 -37
- package/dist/webSearchWireCaps.js +0 -34
- package/dist/websearch/searchProviderPresets.d.ts +0 -81
- package/dist/websearch/searchProviderPresets.js +0 -27
- package/dist/wireErrorTriage.d.ts +4 -160
- package/dist/wireErrorTriage.js +0 -171
- package/dist/wireRefusalCopy.d.ts +0 -28
- package/dist/wireRefusalCopy.js +0 -28
- package/dist/workflow.d.ts +0 -40
- package/dist/workflow.js +0 -52
- package/dist/workflowClient.d.ts +0 -122
- package/dist/workflowClient.js +8 -360
- package/dist/workflowMonitor.d.ts +2 -72
- package/dist/workflowMonitor.js +0 -26
- package/dist/writeProtectionCapability.d.ts +0 -112
- package/dist/writeProtectionCapability.js +0 -109
- package/docs/INTEGRATION-CLIENTS.md +78 -5
- package/package.json +3 -3
package/dist/notifications.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ⚠️ 调用方契约(交叉复审 [MED] 登记):cli 原版在渲染前有两条默认值回填——
|
|
3
|
-
* summary 缺省 ⇒ `Background task "${taskId}" ${status}`;status 非串 ⇒ 'unknown'(0.72.12 起;此前 'completed')。
|
|
4
|
-
* 本纯函数不做回填(职责在 adapt() 输入侧),直接透传引擎原始 JSON 会渲出空 <summary>。
|
|
5
|
-
* 落 adapt() 时必须先补齐这两个字段再调本函数。
|
|
6
|
-
* 另注:<status> 段转义为**有意统一变更**(cli 原版曾不转义;2026-07-25 双侧统一为转义,
|
|
7
|
-
* status 为受控枚举零实际影响,顺手关闭注入面)。
|
|
8
|
-
*/
|
|
9
1
|
export interface TaskNotificationFields {
|
|
10
2
|
taskId: string;
|
|
11
3
|
status: string;
|
|
@@ -23,96 +15,33 @@ export interface TaskNotificationFields {
|
|
|
23
15
|
resumable?: boolean;
|
|
24
16
|
externalSource?: string;
|
|
25
17
|
}
|
|
26
|
-
/** 通知 user-turn XML 渲染(core task-notification 同形;external 帧开标签带 from= 属性)。 */
|
|
27
18
|
export declare function renderTaskNotificationXml(n: TaskNotificationFields): string;
|
|
28
|
-
/**
|
|
29
|
-
* core 1.262.0 残局包([558]A/D)— 从 task_notification 帧派生残局显示行,与 core 进程内
|
|
30
|
-
* renderResidual(core/task-notification.ts:75-86)**逐字节对齐**:先 `- tool target → outcome`
|
|
31
|
-
* 步骤行,再 ONE `edited: path (×N), …` 行(editedFiles 折进 recent-steps,core 不铸独立
|
|
32
|
-
* <edited-files> tag——别自创)。字段是 additive 的,老引擎没有 ⇒ []。返回裸串,转义由调用方按
|
|
33
|
-
* 自己的面做(XML/Ink 行)。cli deriveNotificationResidualLines 的等价搬运。
|
|
34
|
-
*/
|
|
35
19
|
export declare function deriveNotificationResidualLines(n: Record<string, unknown>): string[];
|
|
36
|
-
/**
|
|
37
|
-
* 引擎 task_notification 原始 payload → renderTaskNotificationXml 的入参(**含上面注释里那两条
|
|
38
|
-
* 回填**:summary 缺省 ⇒ `Background task "<id>" <status>`;status 非串 ⇒ 'unknown',summary 改说 outcome unknown)。
|
|
39
|
-
* task_id 空串/缺失 ⇒ null(RB-75 同族:空 id 会塌成 ':status' 共享桶互吞,无 id 的通知本就无意义)。
|
|
40
|
-
* 字段名映射按 wire 真形:task_id/output_file/task_type/source 是 snake/wire 名,其余同名。
|
|
41
|
-
*/
|
|
42
20
|
export declare function normalizeTaskNotification(n: Record<string, unknown>): TaskNotificationFields | null;
|
|
43
|
-
/** 通知去重键——cli engineTaskNotificationDedupKey **逐字等价**(对抗复审抓的
|
|
44
|
-
* 等价性破坏,0.1.1 修):无 seq 不追加段(与 seq:1 是不同键);仅 external 用
|
|
45
|
-
* `external:` 前缀;seq 收 number|string。格式:`[external:]taskId:status[:seq]`。 */
|
|
46
21
|
export declare function taskNotificationDedupKey(n: {
|
|
47
22
|
taskId: string;
|
|
48
23
|
status: string;
|
|
49
24
|
seq?: number | string;
|
|
50
25
|
taskType?: string;
|
|
51
26
|
}): string;
|
|
52
|
-
/**
|
|
53
|
-
* ⇄ B7(T2):同一把键的 **裸 wire 载荷** 入口 —— cli `upstreamBridge.engineTaskNotificationDedupKey`
|
|
54
|
-
* 的等价物(入参是引擎 `task_notification` 帧的原始 payload:snake_case `task_id` / `task_type`)。
|
|
55
|
-
*
|
|
56
|
-
* 🔴 **不是第二份算法**:字段归一之后直接委托给上面那一个 `taskNotificationDedupKey`。
|
|
57
|
-
* 两份手写算法正是这条键在 0.1.1 被 对抗复审抓到过的形(无 seq 追不追段的差异会让
|
|
58
|
-
* 「重放去重」整条失效而两边代码看着都对);pure 门 B7 段对两个入口做**同键对拍**。
|
|
59
|
-
*
|
|
60
|
-
* 键形:`[external:]taskId:status[:seq]`。缺 `task_id` ⇒ 空 taskId 段(与 cli 逐字一致 ——
|
|
61
|
-
* 空 id 的通知本就在 `normalizeTaskNotification` 那一层被丢弃,这里不额外加语义)。
|
|
62
|
-
*
|
|
63
|
-
* ⚠️ **P1-3(完成事件单一权威)未到货 ⇒ 只搬不删**:引擎给出 `completionId` 之后,这把
|
|
64
|
-
* 「客户端按 taskId:status[:seq] 自己重算」的键才能换成「读引擎发的 id」。退役条件见
|
|
65
|
-
* `compensations.ts` 的 T2 行。
|
|
66
|
-
*/
|
|
67
27
|
export declare function taskNotificationDedupKeyFromWire(n: Record<string, unknown>): string;
|
|
68
|
-
/**
|
|
69
|
-
* ⇄ B7(T3):从**落盘转录**里的 `<task-notification>` 块反解去重键 —— #63 resume 回植的
|
|
70
|
-
* **纯解析半场**(适配器实例的 `importLedgerFromTranscript` 与宿主的 resume 装载腿共用这一份)。
|
|
71
|
-
*
|
|
72
|
-
* 为什么要单独导出:cli 里这段解析有**两份**(`upstreamBridge.seedEngineTaskNotificationDedupFromTranscript`
|
|
73
|
-
* 与包内 `WireToCcAdapterImpl.importLedgerFromTranscript`),两份的差异会让 resume 回植在某一侧
|
|
74
|
-
* 静默失效。B7 把解析收成一份纯函数,两个消费口都调它;壳侧那份 shim 化后直接调
|
|
75
|
-
* `bridgeAdapter().importLedgerFromTranscript(...)`。
|
|
76
|
-
*
|
|
77
|
-
* 🔴 键形必须是**无 seq** 的:落盘 XML 不带 seq,Monitor 的 `:seq` 批键形与之不同 —— 这正是
|
|
78
|
-
* 「绝不误伤 Monitor 多批流」的判据(cli `taskNotificationResumeSeed` 单测双向钉的就是它)。
|
|
79
|
-
*
|
|
80
|
-
* ⚠️ **P1-3 到货后**:仍需回植(crash 窗口是客观存在的),但不必再解 XML —— 转录里会直接带
|
|
81
|
-
* `completionId`。退役条件见 `compensations.ts` 的 T3 行。
|
|
82
|
-
*/
|
|
83
28
|
export interface TranscriptNotificationSeeds {
|
|
84
|
-
/** 渲染去重键(`[external:]taskId:status`,**无 seq 段**)。 */
|
|
85
29
|
renderedKeys: string[];
|
|
86
|
-
/** 跨通道记账键(裸 taskId;仅**非 external** 的终态 completed/failed/killed)。 */
|
|
87
30
|
notifiedKeys: string[];
|
|
88
|
-
/** 解出的块数(= cli `seeded` 返回值)。 */
|
|
89
31
|
seeded: number;
|
|
90
32
|
}
|
|
91
33
|
export declare function parseTranscriptNotificationSeeds(messages: ReadonlyArray<unknown>): TranscriptNotificationSeeds;
|
|
92
|
-
/** 宿主队列条目的最小结构形(壳 QueuedCommand 的子集;本包只读这三个键)。 */
|
|
93
34
|
export interface QueuedCommandLike {
|
|
94
35
|
mode?: unknown;
|
|
95
36
|
agentId?: unknown;
|
|
96
37
|
value?: unknown;
|
|
97
38
|
}
|
|
98
39
|
export interface NotificationQueuePort {
|
|
99
|
-
/** 壳 = messageQueueManager.enqueuePendingNotification(无显式优先级 ⇒ 队列缺省 'later')。 */
|
|
100
40
|
enqueuePendingNotification(command: {
|
|
101
41
|
value: string;
|
|
102
42
|
mode: 'task-notification';
|
|
103
43
|
}): void;
|
|
104
|
-
/** 壳 = messageQueueManager.removeByFilter;返回被摘掉的条目(数量是判据)。 */
|
|
105
44
|
removeByFilter(predicate: (cmd: QueuedCommandLike) => boolean): QueuedCommandLike[];
|
|
106
|
-
/**
|
|
107
|
-
* B7:`mode:'prompt'` 的 **isMeta** 回植(今天唯一的消费者 = plan_review 结局,
|
|
108
|
-
* `hitl/planReviewWire.ts`)。与上面那条是**不同的队列语义**(task-notification 走
|
|
109
|
-
* `<task-notification>` 通道;这条是一个 isMeta 的 prompt turn),所以是第二个动词而不是
|
|
110
|
-
* 给第一个加参数。
|
|
111
|
-
*
|
|
112
|
-
* 🔴 **可选**(`?`):既有宿主(壳 B2 起装的那份)不实现它照样满足接口 —— 加必填方法会让所有
|
|
113
|
-
* 已装配的宿主在类型层一起红,而这条动词只有一个消费者。缺席 ⇒ 计 miss + 该结局不回植
|
|
114
|
-
* (模型在 approve 之后原地不动),**不是**静默可接受的面,所以计 miss 而不是静默。
|
|
115
|
-
*/
|
|
116
45
|
enqueueMetaPrompt?(command: {
|
|
117
46
|
value: string;
|
|
118
47
|
mode: 'prompt';
|
|
@@ -121,47 +50,14 @@ export interface NotificationQueuePort {
|
|
|
121
50
|
workload: string;
|
|
122
51
|
}): void;
|
|
123
52
|
}
|
|
124
|
-
/** 宿主装配:壳侧 shim / web 宿主在**模块加载期**装(装之前的调用会计入 miss)。 */
|
|
125
53
|
export declare function installNotificationQueuePort(port: NotificationQueuePort | null): void;
|
|
126
|
-
/** 🔴 未注入队列口而发生的投递次数 —— 恒应为 0;>0 = 宿主装配漏了,通知已静默丢失。 */
|
|
127
54
|
export declare function notificationQueuePortMisses(): number;
|
|
128
|
-
/** 测试钩:清 port + miss 计数(不动台账,台账各有自己的 reset)。 */
|
|
129
55
|
export declare function _resetNotificationQueuePortForTest(): void;
|
|
130
|
-
/**
|
|
131
|
-
* B1(frame-lane-matrix 三节定谳)— Path A 回声到达时丢弃同 run 的 pending 队列条目。
|
|
132
|
-
* 双投机理:活跃 turn 内 Path B(workflow_complete/bg_notification/probe feeder →
|
|
133
|
-
* enqueuePendingNotification)先入队,Path A(引擎 server-side steer-inject 的
|
|
134
|
-
* task_notification 回声帧)随流到达——引擎侧模型已收到一遍;turn 收口 idle 排水若再
|
|
135
|
-
* auto-submit 队列条目 = 模型二收同一份 XML。壳撤不回引擎侧注入(跨进程),但能在
|
|
136
|
-
* drain 前把已被回声证实送达的同 run 队列条目丢掉。键空间 = 裸 taskId/runId(与
|
|
137
|
-
* notifiedRunIds/cardEnqueuedRunIds 同域);条目匹配按队列 XML 的 <task-id> 标签
|
|
138
|
-
* (enqueue 两族与 bridge 渲染同用 escapeXml,键形字节对齐)。仅主线程 task-notification
|
|
139
|
-
* 条目(agentId undefined);用户输入/其他模式绝不触碰。
|
|
140
|
-
*/
|
|
141
|
-
/**
|
|
142
|
-
* B7:plan_review 结局回植(`hitl/planReviewWire.ts` 的唯一调用点)。走队列口的
|
|
143
|
-
* `enqueueMetaPrompt` 可选动词 —— 口或动词缺席 ⇒ 计 miss(与 `port()` 同一个计数器,宿主
|
|
144
|
-
* 只看 `hostPortMisses()` 一个数)并**返回 false**,调用方 fail-soft。
|
|
145
|
-
*
|
|
146
|
-
* 🔴 为什么不复用 `enqueuePendingNotification`:那条走的是 `<task-notification>` 通道(队列
|
|
147
|
-
* 的 `task-notification` 模式,drain 时按通知语义处理);plan_review 结局是一个 **isMeta 的
|
|
148
|
-
* prompt turn**。混用 = 结局被当成后台任务完成通知渲染,是「看起来送到了」的假绑定。
|
|
149
|
-
*/
|
|
150
56
|
export declare function enqueuePlanReviewOutcome(value: string): boolean;
|
|
151
57
|
export declare function dropQueuedNotificationsForRun(taskId: string): number;
|
|
152
|
-
/**
|
|
153
|
-
* Pre-seed the runId dedup WITHOUT enqueueing — the completion already reached the model in-band
|
|
154
|
-
* (clay 2026-07-04 复审:模型用 TaskOutput 轮询拿到 workflow 终态并当轮总结完;引擎 completion inbox
|
|
155
|
-
* 不知道"轮询已送达",下一次开流仍补发 workflow_complete —— 对模型是纯重复,还触发一轮"这是补发通知,
|
|
156
|
-
* 无需重复"的空转)。终态在 turn 内经过壳的投影(TaskOutput workflow 终态卡 / 引擎 server-side 已
|
|
157
|
-
* steer-inject 的 task_notification 帧)即预标记,Channel A 对同 runId 的补发直接丢弃。
|
|
158
|
-
*/
|
|
159
58
|
export declare function markEngineWorkflowNotified(runId: string): void;
|
|
160
|
-
/** 跨通道去重的**读**口(适配器 workflow_complete 臂的发射门;cli 同域)。 */
|
|
161
59
|
export declare function isEngineWorkflowNotified(runId: string): boolean;
|
|
162
|
-
/** 「这个 run 的完成卡已入队」的**写**口(cli 侧等价物 = 两个 enqueue 函数内的 `cardEnqueuedRunIds.add`)。 */
|
|
163
60
|
export declare function noteWorkflowCompletionCardEnqueued(runId: string): void;
|
|
164
|
-
/** 台账序列化面(`exportLedger`)—— 只读快照,顺序 = 插入序。 */
|
|
165
61
|
export declare function listNotifiedRuns(): string[];
|
|
166
62
|
export declare function listWorkflowCompletionCardsEnqueued(): string[];
|
|
167
63
|
export declare function isWorkflowCompletionCardEnqueued(runId: string): boolean;
|
|
@@ -171,83 +67,29 @@ type WorkflowStatusProbe = (runId: string) => Promise<{
|
|
|
171
67
|
summary: string;
|
|
172
68
|
} | null>;
|
|
173
69
|
export declare function outstandingWorkflowCount(): number;
|
|
174
|
-
/** headless(-p)退出门用([1340] BGB 分化案):**可送达**的 outstanding 数——probe 未装
|
|
175
|
-
* (mock/离线)恒 0,print 驱动器不为永远等不到的通知悬置;probe 在装则 watcher 5s 节拍
|
|
176
|
-
* 必然送达或 TTL 放弃(2h 上界=run 蒸发极端形,与 CC 等本地 bg 任务的无界形同族)。 */
|
|
177
70
|
export declare function outstandingDeliverableWorkflowCount(): number;
|
|
178
71
|
export declare function subscribeOutstandingWorkflows(listener: () => void): () => void;
|
|
179
|
-
/**
|
|
180
|
-
* 🔴 已**停止等待**的 outstanding 条目数(workflow + bg 合计,process-lifetime 只增)。
|
|
181
|
-
* 消费方(footer / headless 退出前的收尾行)据此把「N 个后台任务已停止等待」与「都送达了」
|
|
182
|
-
* 分开渲——H1:排队与放弃对消费方必须可分辨。additive:既有计数口的语义一字节不变。
|
|
183
|
-
*/
|
|
184
72
|
export declare function outstandingAbandonedCount(): number;
|
|
185
|
-
/**
|
|
186
|
-
* 观测口:被**静默 return 掉**的投递次数(notif-02)。去重与丢失在行为上都是「不入队」,
|
|
187
|
-
* 不记账就在观测上等价 —— 分成两个键是因为它们的正当性完全不同:
|
|
188
|
-
* · `bgDedupDropped` = 同 (taskId,seq,status) 键重复,**正当**(at-least-once 双投自免),恒可 >0;
|
|
189
|
-
* · `bgCrossChannelDropped` = 首周期已由别的通道送达而被压制,**正当但需可查**(seq 透传一旦
|
|
190
|
-
* 回归,复活周期会伪装成首周期落进这一格 —— 这个数异常增长就是 seq 又丢了的信号);
|
|
191
|
-
* · `stuckTickResets` = 在飞 tick 超过 STUCK_TICK_RESET_MS 被强制复位的次数,**恒应为 0**;
|
|
192
|
-
* >0 = 有 probe 连 PROBE_TIMEOUT_MS 都没能截断它。
|
|
193
|
-
*
|
|
194
|
-
* 🔴 [2393] F-1 补两格 —— 上面三格全是 **enqueue 内部**的记账,而 watcher 收摊臂在到达 enqueue
|
|
195
|
-
* **之前**就把台账条目删掉了:「复活周期被秒删」这条路径对上面三格 100% 不可见(立案时被点名当
|
|
196
|
-
* 信号的 `bgCrossChannelDropped` 正是这样对它零判别力的)。删除动作要挣得,也要看得见:
|
|
197
|
-
* · `bgWatchRevivalPromoted` = 收摊臂靠 probe 实证「任务又在跑」把条目升到新周期的次数
|
|
198
|
-
* —— 正是修前被静默秒删的那一类;>0 说明 wire 的 seq 没到货,壳在自己补周期号;
|
|
199
|
-
* · `bgWatchCollectedUnprobed` = probe 未装(mock/离线)时按裸 id 黑名单**盲摘**的次数,
|
|
200
|
-
* 这是唯一保留的无证据删除;>0 = 有完成周期在这类宿主上恒不可观察。
|
|
201
|
-
*/
|
|
202
73
|
export interface NotificationDropCounters {
|
|
203
74
|
bgDedupDropped: number;
|
|
204
75
|
bgCrossChannelDropped: number;
|
|
205
|
-
/** 🔴 [2393] notif-F1:workflow 侧「已通知过」而被静默吞掉的投递次数(第三处漏网拼法)。
|
|
206
|
-
* 与 bg 两格同理:去重与误吞在行为上都是「不入队」,不记账就在观测上等价。恒可 >0(推送帧与
|
|
207
|
-
* probe 链双投自免是正当的);**异常增长** = runId 铸法变了或两条链 id 不同域,真完成在被吞。 */
|
|
208
76
|
workflowDedupDropped: number;
|
|
209
77
|
stuckTickResets: number;
|
|
210
78
|
bgWatchRevivalPromoted: number;
|
|
211
79
|
bgWatchCollectedUnprobed: number;
|
|
212
80
|
}
|
|
213
81
|
export declare function notificationDropCounters(): NotificationDropCounters;
|
|
214
|
-
/** liveClient 在构造会话 client 时注册(带正确 baseUrl/token/principal 的 workflows.get)。 */
|
|
215
82
|
export declare function installWorkflowStatusProbe(probe: WorkflowStatusProbe): void;
|
|
216
83
|
type BgTaskStatusProbe = (taskId: string) => Promise<{
|
|
217
84
|
terminal: boolean;
|
|
218
85
|
status: string;
|
|
219
86
|
} | null>;
|
|
220
|
-
/** 委派 prompt 取件口(行消费端建行/详情页兜底用)。未登记 ⇒ undefined(诚实缺席)。 */
|
|
221
87
|
export declare function outstandingBgTaskPrompt(taskId: string): string | undefined;
|
|
222
88
|
export declare function installBgTaskStatusProbe(probe: BgTaskStatusProbe): void;
|
|
223
|
-
/**
|
|
224
|
-
* bridge 在 Agent async_launched 回执(structured type:'agent')经过时登记。按 (taskId,seq) 幂等。
|
|
225
|
-
*
|
|
226
|
-
* 🔴 notif-02(两账分离):登记闸**不再查 `notifiedRunIds`**。那个集合是「模型通知去重」账
|
|
227
|
-
* (哪次完成已经喂给模型了),不是「是否还要观察」账;两账混用的后果是 seq≥2 的复活周期
|
|
228
|
-
* 永远登记不进来(`notifiedRunIds` 全文无 delete 站点,首周期一通知就是终身黑名单)。
|
|
229
|
-
* 首周期若确已送达,由 watcher 的收摊臂在下一拍摘除(见 `tickWatchInner` bg 半场),
|
|
230
|
-
* 代价是一次 no-op 遍历,而不是一整个完成周期的结构性缺席。
|
|
231
|
-
*
|
|
232
|
-
* 🔴 [2393] F-1:`seq` 缺席时这里仍然**按首周期解释,不在登记口猜周期号** —— 猜出来的周期号会
|
|
233
|
-
* 把「已终局任务的回执重放」也升成新周期,方向相反地造出重复通知。周期号只在 watcher 那侧、
|
|
234
|
-
* 拿到 probe 的「它又在跑」这个证据之后才前进(见 `tickWatchInner` 的收摊臂三档)。
|
|
235
|
-
*
|
|
236
|
-
* @param seq bg 子代生命周期号;wire 未带 ⇒ 按首周期(BG_FIRST_SEQ)解释,复活周期由 watcher 补。
|
|
237
|
-
*/
|
|
238
89
|
export declare function registerOutstandingBgTask(taskId: string, description: string, prompt?: string, seq?: number): void;
|
|
239
90
|
export declare function isOwnWorkflowRun(runId: string): boolean;
|
|
240
|
-
/** 本壳亲手启动过的 workflow run 列表(Set 插入序 = 启动序;/workflows 命令的目标 run 选择用,
|
|
241
|
-
* cmd-workflows.tsx——fleet source 无行可选时的兜底 id 源)。 */
|
|
242
91
|
export declare function listOwnWorkflowRuns(): string[];
|
|
243
|
-
/**
|
|
244
|
-
* CC-37(0.72.2,cli [7468] ②):只登 own 台账、不动 outstanding —— 给 adapter 的 workflow lane 门用:带 `workflowRunId`
|
|
245
|
-
* 的 `task_progress` 帧**且**其父指向本会话见过的 Workflow 工具卡(own-run 正向证明)时,在为其铸行的那一拍就登记,
|
|
246
|
-
* 不再等 run_workflow 回执;此前 fleet 行已渲 13 s 而 `listOwnWorkflowRuns()` 仍空。幂等;别的会话的 workflow 帧
|
|
247
|
-
* (无本会话卡为父)**不登**。
|
|
248
|
-
*/
|
|
249
92
|
export declare function noteOwnWorkflowRun(runId: string): void;
|
|
250
|
-
/** bridge 在 run_workflow 回执(structured type:'workflow-run')经过时登记。幂等;已通知的不再登记。 */
|
|
251
93
|
export declare function registerOutstandingWorkflowRun(runId: string): void;
|
|
252
94
|
export interface EngineWorkflowCompletion {
|
|
253
95
|
runId: string;
|
|
@@ -257,54 +99,22 @@ export interface EngineWorkflowCompletion {
|
|
|
257
99
|
export declare function enqueueBgChildNotification(n: {
|
|
258
100
|
taskId: string;
|
|
259
101
|
status: string;
|
|
260
|
-
/** bg 子代生命周期号(SendMessage 复活即 +1;service seq 字段)。去重键必须含 seq——
|
|
261
|
-
* revive 周期(seq≥2)与首周期同 (taskId,status),不带 seq 会被首周期键吞掉
|
|
262
|
-
* =「续派后完成通知永不上屏」(clay 图2 案根因,core1.355 复验帧实锤 2026-07-20)。 */
|
|
263
102
|
seq?: number;
|
|
264
103
|
summary?: string;
|
|
265
104
|
}): void;
|
|
266
105
|
export declare function enqueueEngineWorkflowNotification(c: EngineWorkflowCompletion): void;
|
|
267
|
-
/** 测试钩(B2 新增,壳侧原文件没有):清空全部通知台账 + probe 槽 + watcher。
|
|
268
|
-
* 🔴 生产绝不调用 —— 台账是 process-lifetime 去重的唯一凭据,清了就会双投。 */
|
|
269
106
|
export declare function _resetEngineTaskNotificationForTest(): void;
|
|
270
|
-
/**
|
|
271
|
-
* 测试钩:**驱动一拍** watcher(生产由 setInterval 驱动,外部无入口 ⇒ 护栏/TTL/deadline
|
|
272
|
-
* 三条链在门里全不可达,notif-01/-02/-03 才会一路活到今天)。
|
|
273
|
-
* @param nowMs TTL 判据的时钟注入(WATCH_TTL_MS 是 2h,不注入时钟就只能真等两小时)。
|
|
274
|
-
* 🔴 生产绝不调用。
|
|
275
|
-
*/
|
|
276
107
|
export declare function _tickWatchOnceForTest(nowMs?: number): Promise<void>;
|
|
277
|
-
/**
|
|
278
|
-
* 测试钩:覆写 watcher 时序常量(默认是 10s/60s 量级,门里等不起)。传 null 恢复生产值。
|
|
279
|
-
* 🔴 生产绝不调用;覆写只影响 deadline 与强制复位门,不动 WATCH_INTERVAL_MS/WATCH_TTL_MS。
|
|
280
|
-
*/
|
|
281
108
|
export declare function _setWatcherTimingForTest(o: {
|
|
282
109
|
probeTimeoutMs?: number;
|
|
283
110
|
stuckTickResetMs?: number;
|
|
284
111
|
} | null): void;
|
|
285
|
-
/** 该 objective 是否为 task-notification 自动提交 turn 的注入 XML(整体即通知,非提及)。 */
|
|
286
112
|
export declare function isTaskNotificationObjective(objective: unknown): boolean;
|
|
287
|
-
/**
|
|
288
|
-
* 通知 turn → supplement 文案(非通知 turn → undefined,判别不扩散)。措辞英文、CC 报错语气
|
|
289
|
-
* (事实 + 出路,不惊悚)。status 从 XML `<status>` 读:completed 用定稿句;其余终态如实带
|
|
290
|
-
* status(通知可能报 failed/killed —— 谎称 completed 比不加更糟)。
|
|
291
|
-
*/
|
|
292
113
|
export declare function taskNotificationDeliverySupplement(objective: unknown): string | undefined;
|
|
293
|
-
/**
|
|
294
|
-
* API-error 行文拆分(渲染层消费):尾部的 supplement 行(若在)分离出来渲 dim,main 保留原始
|
|
295
|
-
* error 字面渲红。无 supplement 的行原样返回 —— 既有 API-error 渲染路径零改变。
|
|
296
|
-
*/
|
|
297
114
|
export declare function splitApiErrorSupplement(text: string): {
|
|
298
115
|
main: string;
|
|
299
116
|
supplement?: string;
|
|
300
117
|
};
|
|
301
|
-
/** SSE 平铺 wire 形(server 1.280.0 http/server.js:6347-6355 直证;ownerScope/ownerSessionId 上 wire 前剥掉)。
|
|
302
|
-
* 🔴 平铺形在 7.48.0 仍逐字成立:`dist/http/routes/fleet.js:146` =
|
|
303
|
-
* `send("hook_notice", { type:"hook_notice", ...hookNoticeWire(hn), ts })`(spread,不是 `notice:` 嵌套)。
|
|
304
|
-
* 🔴 本形是**第一族**(`hook_decision_unavailable`)的平铺视图,**刻意不为第二族加宽**:
|
|
305
|
-
* 两族只共用 `type`/`kind`/`event`/`ts`,而 `reason` 的**值域各自闭集**(同名不同义)。
|
|
306
|
-
* 第二族的专有键走本文件内部视图 `HookFailureWireView`(不出包边界)—— 把两族的键混进同一个
|
|
307
|
-
* 导出形,等于对外承诺一个「哪一族都不完全对」的形,消费端读哪一位都得再猜一次 kind。 */
|
|
308
118
|
export interface HookNoticeWire {
|
|
309
119
|
type?: unknown;
|
|
310
120
|
kind?: unknown;
|
|
@@ -314,13 +124,11 @@ export interface HookNoticeWire {
|
|
|
314
124
|
ts?: unknown;
|
|
315
125
|
}
|
|
316
126
|
export type HookNoticeReason = 'no_content' | 'unparsed' | 'skipped';
|
|
317
|
-
/** ActiveGoal.lastNotice 的形(壳 state/AppStateStore.ts 同步声明)。 */
|
|
318
127
|
export interface GoalHookNotice {
|
|
319
128
|
reason: HookNoticeReason;
|
|
320
129
|
detail?: string;
|
|
321
130
|
at: number;
|
|
322
131
|
}
|
|
323
|
-
/** 判定结果:ok=true 才交给宿主写 store;drop 原因供宿主打 SEMA_DEBUG 档(壳侧文案不变)。 */
|
|
324
132
|
export type HookNoticeVerdict = {
|
|
325
133
|
ok: true;
|
|
326
134
|
notice: GoalHookNotice;
|
|
@@ -332,53 +140,27 @@ export type HookNoticeVerdict = {
|
|
|
332
140
|
event?: string;
|
|
333
141
|
reason?: HookNoticeReason;
|
|
334
142
|
};
|
|
335
|
-
/**
|
|
336
|
-
* hook_notice 帧的判定本体(壳 ingestHookNoticeFrame 的判定半场逐字等价)。
|
|
337
|
-
* 🔴 归属镜像在**这里**做而不是在 fleetClient 里做 —— #105 变异普查(F3)定谳过:分发条件留在
|
|
338
|
-
* fleetClient 时,离线门只能 grep 源码,而 grep 对「把 'hook_notice' 改成 'hook_noticeZZZ'」
|
|
339
|
-
* 这类变异因注释碰撞+子串命中恒绿。提到这里后离线门直接**行为测本函数**。
|
|
340
|
-
*/
|
|
341
143
|
export declare function classifyHookNoticeFrame(frame: unknown, opts: {
|
|
342
144
|
sessionScoped: boolean;
|
|
343
145
|
now?: number;
|
|
344
146
|
}): HookNoticeVerdict;
|
|
345
|
-
/** 判别口:是不是 hook_notice 帧(宿主 fleet applyFrame 的分发条件;不是则继续走别的臂)。 */
|
|
346
147
|
export declare function isHookNoticeFrame(frame: unknown): boolean;
|
|
347
|
-
/**
|
|
348
|
-
* 「Last check」行的诚实文案([1790] 措辞纪律:「本轮未能评估,已放行」方向;detail 是 server
|
|
349
|
-
* 结构化日志同源的机器话,dim 展示原文比意译更可追责)。
|
|
350
|
-
*/
|
|
351
148
|
export declare function hookNoticeLastCheckText(n: GoalHookNotice): string;
|
|
352
|
-
/** footer 通知条文案前缀(测试锁字面;宿主拼 ` (${reason})`)。 */
|
|
353
149
|
export declare const HOOK_NOTICE_WARN_PREFIX = "Goal check: couldn't evaluate this turn \u2014 proceeded";
|
|
354
|
-
/** 机器可判的故障形(dist 逐字闭集)。 */
|
|
355
150
|
export type HookFailureReason = 'exit_nonzero' | 'timeout' | 'spawn_failed' | 'bad_json';
|
|
356
|
-
/** 条目类型 —— 没有它,`hookName` 是命令还是 URL 还是提示词全靠猜(dist 逐字闭集)。 */
|
|
357
151
|
export type HookEntryType = 'command' | 'http' | 'prompt' | 'agent';
|
|
358
|
-
/** 宿主写 store / 渲横幅的形(与 {@link GoalHookNotice} 平级,但**不是**同一件事)。 */
|
|
359
152
|
export interface HookFailureNotice {
|
|
360
|
-
/** 哪个 hook 事件(`PreToolUse` / `Stop` / …)。开集:server 不闭这一位。 */
|
|
361
153
|
event: string;
|
|
362
154
|
reason: HookFailureReason;
|
|
363
|
-
/** hook 身份(server 侧 `statusMessage` 优先,否则 command / url / prompt),已脱敏 + 有界。 */
|
|
364
155
|
hookName: string;
|
|
365
156
|
entryType: HookEntryType;
|
|
366
|
-
/** 🔴 **超时 / spawn 失败没有退出码 ⇒ 缺席**(绝不铸 0 那种看着合法的假读数)。 */
|
|
367
157
|
exitCode?: number;
|
|
368
|
-
/** 工具事件才有(PreToolUse/PostToolUse/PostToolUseFailure);非工具事件缺席。 */
|
|
369
158
|
toolName?: string;
|
|
370
|
-
/** hook 的 stderr 摘要(server 已脱敏 + 截断;本包边界再兜底一次)。空 ⇒ 缺席。 */
|
|
371
159
|
stderr?: string;
|
|
372
160
|
detail?: string;
|
|
373
161
|
at: number;
|
|
374
162
|
}
|
|
375
|
-
/**
|
|
376
|
-
* 观测帧自由文本上限 —— 与 server `MAX_HOOK_NOTICE_TEXT_CHARS`(`fleet/fleet-bus.d.ts`)同值。
|
|
377
|
-
* 🔴 server 已截过一遍(那一遍拿得到原文,是**承重**的);本包这一遍是**边界兜底**,挡住忘了截断的
|
|
378
|
-
* 未来生产者把一条无界流灌进单行横幅。幂等:输出恒 ≤ 上限。
|
|
379
|
-
*/
|
|
380
163
|
export declare const MAX_HOOK_NOTICE_TEXT_CHARS = 512;
|
|
381
|
-
/** 第二族的判定结果。drop 原因供宿主打 SEMA_DEBUG 档。 */
|
|
382
164
|
export type HookFailureVerdict = {
|
|
383
165
|
ok: true;
|
|
384
166
|
failure: HookFailureNotice;
|
|
@@ -387,21 +169,6 @@ export type HookFailureVerdict = {
|
|
|
387
169
|
drop: 'not-hook-notice' | 'unknown-kind' | 'not-session-scoped' | 'unknown-reason' | 'unknown-entry-type' | 'no-hook-name';
|
|
388
170
|
kind?: string;
|
|
389
171
|
};
|
|
390
|
-
/**
|
|
391
|
-
* `hook_non_blocking_failure` 帧的判定本体(#281 的客户端半场)。
|
|
392
|
-
*
|
|
393
|
-
* 🔴 **与 {@link classifyHookNoticeFrame} 是两个口,不是一个口的两条臂**:两族的载荷形不同
|
|
394
|
-
* (那族出 {@link GoalHookNotice},本族出 {@link HookFailureNotice}),把它们塞进同一个返回联合会
|
|
395
|
-
* **破坏既有消费端**(现在 `v.ok` 之后直接读 `v.notice` 的写法要全部改窄化)。分口 ⇒ 姊妹口的行为
|
|
396
|
-
* **逐字节不变**(它对本族仍报 `unknown-kind`,常驻套对这一格有钉),宿主按 `kind` 分派一次即可。
|
|
397
|
-
*
|
|
398
|
-
* 🔴 **闭集位一律「不认就丢」,绝不折成某一档**:与姊妹族「表外 reason 归一到 `skipped`」刻意不同 ——
|
|
399
|
-
* 那一族的 `skipped` 有真兜底语义(「跳过了」),本族**没有**「兜底故障形」这种东西,把一个没见过的
|
|
400
|
-
* 词折成 `exit_nonzero` 就是替引擎编一个它没说过的故障。
|
|
401
|
-
*
|
|
402
|
-
* 🔴 `hookName` 缺席即丢:一条「某个 hook 坏了、但不知道是哪个」的横幅,用户拿它什么都做不了,
|
|
403
|
-
* 只会制造焦虑 —— 而 server 侧这一位是**必填**,缺席意味着这不是一帧合规的本族帧。
|
|
404
|
-
*/
|
|
405
172
|
export declare function classifyHookFailureFrame(frame: unknown, opts: {
|
|
406
173
|
sessionScoped: boolean;
|
|
407
174
|
now?: number;
|