@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
|
@@ -1,92 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ⇄ B2 批搬迁(2026-07-27,多端改造设计稿 §3 B2):cli src/sema/cloudConfigWireCaps.ts 搬入(依赖 mcpWireCaps/skillsWireCaps,同批)。
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* src/sema/cloudConfigWireCaps.ts — PURE projections for the CLOUD CONFIG WIRE (P2): the registry's
|
|
6
|
-
* GET /api/v1/effective body → the same wire shapes the LOCAL loaders produce, so flipping the
|
|
7
|
-
* config-source switch swaps the SOURCE without changing a single downstream contract:
|
|
8
|
-
*
|
|
9
|
-
* config.mcp.servers → `McpServerSpec[]` (== mcpWire loadMcpSpecs output → TaskRequest.mcpServers)
|
|
10
|
-
* config.skills.skills → `SkillSpec[]` (== skillsWire loadSkillSpecs output → TaskRequest.skills;
|
|
11
|
-
* the v1 wire is a MANIFEST — content replaced by contentHash —
|
|
12
|
-
* so the body is injected via `resolveBody(contentHash)`)
|
|
13
|
-
* config.models → config.d/models.json document (registry-core ModelsConfig IS the engine's
|
|
14
|
-
* FileConfigStore models.json shape — verbatim passthrough,
|
|
15
|
-
* written to a SHADOW config.d root, never the user's own)
|
|
16
|
-
* rosters → names only (v1 thinnest seam: display + reference; the /api/v1/effective wire
|
|
17
|
-
* STRIPS rosters — registry-core resolve-roster `shipped()` —
|
|
18
|
-
* so the IO half pulls the domain raw when it can)
|
|
19
|
-
*
|
|
20
|
-
* SECRET BOUNDARY: the registry NEVER ships secret values — mcp transports carry `envRefs`/`headerRefs`
|
|
21
|
-
* (target key → an ENV NAME) and models carry `apiKeyEnv`. The projection resolves env-NAME refs against the
|
|
22
|
-
* SHELL's env (the engine child inherits it), and reports the names that resolve to nothing so callers can warn.
|
|
23
|
-
*
|
|
24
|
-
* Split from cloudConfigWire.ts (the IO half: token/fetch/cache/shadow-write) so this file is esbuild-bundleable
|
|
25
|
-
* alone for the assertion suite — it imports only erased types + the sibling pure caps modules.
|
|
26
|
-
*/
|
|
27
1
|
import type { SkillSpec } from '@sema-agent/sdk';
|
|
28
2
|
import type { McpServerSpec } from './mcpWireCaps.js';
|
|
29
3
|
import type { EnvLike } from './hostEnv.js';
|
|
30
|
-
/** The SDK wire shape TaskRequest.mcpServers carries (the SDK barrel doesn't re-export McpServerSpec by
|
|
31
|
-
* name — derive it from TaskRequest so this stays the EXACT wire type, never a drifting copy). */
|
|
32
4
|
export type { McpServerSpec };
|
|
33
5
|
type Rec = Record<string, unknown>;
|
|
34
|
-
/** Env lookup shape (process.env or a test fixture). */
|
|
35
6
|
export type { EnvLike };
|
|
36
|
-
/** REF-CC-157(midband-05,fix-outright) 丢弃理由的四态之一——仿 skillsMissingBody 给 mcp 域补留痕:
|
|
37
|
-
* 一个打错字的 server name/字段此前会在用户毫无感知的情况下从 wire 上消失。 */
|
|
38
7
|
export type CloudMcpDropReason = 'disabled' | 'missing-field' | 'unknown-transport' | 'capped';
|
|
39
8
|
export interface CloudMcpDroppedServer {
|
|
40
|
-
/** 能取到就带上(未取到 name 的原始行——比如整条不是对象——留空,调用方仍能报「有 N 行没生效」)。 */
|
|
41
9
|
name?: string;
|
|
42
10
|
reason: CloudMcpDropReason;
|
|
43
11
|
}
|
|
44
12
|
export interface CloudMcpProjection {
|
|
45
13
|
specs: McpServerSpec[];
|
|
46
|
-
/** env NAMES referenced by envRefs/headerRefs that resolve to nothing in `env` (the ref is DROPPED —
|
|
47
|
-
* fail-closed on the value, loud in the caller's warning line). */
|
|
48
14
|
missingEnv: string[];
|
|
49
|
-
/** REF-CC-157:每一条被丢弃的原始 mcp server 行 + 丢弃理由,登记进 CloudProjection 供宿主警示。 */
|
|
50
15
|
droppedServers: CloudMcpDroppedServer[];
|
|
51
16
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Project the registry's mcp domain (`config.mcp.servers`, registry-core McpServerSpec — the CENTER shape
|
|
54
|
-
* with envRefs/headerRefs) → the SDK/core wire `McpServerSpec[]` (real env/header VALUES, resolved from the
|
|
55
|
-
* shell env). Disabled servers are skipped; unknown transport kinds are skipped (never mis-mapped); the
|
|
56
|
-
* result is capped at MCP_CAPS.items exactly like the local `.mcp.json` projection. Every skip is recorded
|
|
57
|
-
* in `droppedServers` (REF-CC-157) — nothing vanishes from the wire silently.
|
|
58
|
-
*/
|
|
59
17
|
export declare function cloudMcpToSpecs(servers: unknown, env: EnvLike): CloudMcpProjection;
|
|
60
|
-
/**
|
|
61
|
-
* Project the /api/v1/effective skills MANIFEST (content replaced by `contentHash` — registry-core
|
|
62
|
-
* toSkillsManifest) → the capped wire `SkillSpec[]`. `resolveBody(contentHash)` supplies each body (the IO
|
|
63
|
-
* half caches bodies by hash; null ⇒ the skill is SKIPPED — a nameless/bodyless SkillSpec is a 400). Same
|
|
64
|
-
* caps + dedupe as the local projection (skillsWireCaps), so the wire is well-formed by construction.
|
|
65
|
-
*/
|
|
66
18
|
export declare function cloudSkillsToSpecs(manifestSkills: unknown, resolveBody: (contentHash: string) => string | null): SkillSpec[];
|
|
67
|
-
/**
|
|
68
|
-
* The registry's models domain (registry-core ModelsConfig) IS the engine's `config.d/models.json` contract
|
|
69
|
-
* (the same zod schema parses both — engine CONFIG_PROVIDER=local FileConfigStore lane), so the projection is
|
|
70
|
-
* a VALIDATION-LITE PASSTHROUGH: keep exactly {models, roles, atModelAllowlist}, drop everything else, and
|
|
71
|
-
* return null when there is no well-formed models array (caller then writes an empty catalog — engine
|
|
72
|
-
* semantics: no enabled models ⇒ env-catalog fallback).
|
|
73
|
-
*/
|
|
74
19
|
export declare function cloudModelsToDoc(models: unknown): Rec | null;
|
|
75
20
|
export interface CloudDroppedModel {
|
|
76
|
-
/** 能取到就带上;整条丢弃是因为二者都缺时,两个字段都可能不在。 */
|
|
77
21
|
id?: string;
|
|
78
22
|
name?: string;
|
|
79
23
|
}
|
|
80
|
-
/**
|
|
81
|
-
* REF-CC-157(midband-05,fix-outright):`config.models.models` 里被 `cloudModelsToDoc` 过滤掉的原始
|
|
82
|
-
* 条目(缺 `name` 或 `id`)——仿 `skillsMissingBody` 的形状,重扫同一份原始数组产出丢弃清单,让调用方
|
|
83
|
-
* 能警示用户「你的 model 配置有 N 行没生效」,而不是让一个打错字的字段静默从目录消失。
|
|
84
|
-
*/
|
|
85
24
|
export declare function cloudModelsDropped(models: unknown): CloudDroppedModel[];
|
|
86
|
-
/** ENABLED model names in a models doc (banner/status display + "did the cloud catalog apply" checks). */
|
|
87
25
|
export declare function cloudModelNames(doc: Rec | null): string[];
|
|
88
|
-
/** `apiKeyEnv` NAMES referenced by enabled models that resolve to nothing in `env` — the engine child would
|
|
89
|
-
* route those models with no key (a mid-session 401 the user can't diagnose); callers warn up front. */
|
|
90
26
|
export declare function cloudModelMissingKeyEnv(doc: Rec | null, env: EnvLike): string[];
|
|
91
27
|
export interface CloudSessionMirrorProjection {
|
|
92
28
|
engineUrl: string;
|
|
@@ -95,43 +31,21 @@ export interface CloudSessionMirrorProjection {
|
|
|
95
31
|
export interface CloudExecutionProjection {
|
|
96
32
|
required: boolean;
|
|
97
33
|
allowedLanes: string[];
|
|
98
|
-
/** registry-core 0.10.1 `execution.sessionMirror`(附B 单C):org 默认会话镜像目标两层配置。
|
|
99
|
-
* null = 未下发/形状不对(INERT — 缺省零行为差;misshapen 绝不猜出一个镜像目标)。 */
|
|
100
34
|
sessionMirror: CloudSessionMirrorProjection | null;
|
|
101
35
|
}
|
|
102
|
-
/** Project the registry's execution domain (registry-core 0.8 ExecutionPolicy — `{required, allowedLanes}`,
|
|
103
|
-
* allowedLanes = OPEN string vocab, [580]④; 0.10.1 adds `sessionMirror{engineUrl, required}` — additive).
|
|
104
|
-
* Defensive like every other projection: a missing/misshapen domain (an 0.7 registry) yields the schema
|
|
105
|
-
* defaults `{required:false, allowedLanes:["host"], sessionMirror:null}` — never a throw, never an
|
|
106
|
-
* accidental lock-ON, and never a guessed mirror target (engineUrl must be a non-empty string or the
|
|
107
|
-
* whole sessionMirror is dropped: a mirror carries session content + a Bearer, we don't improvise one). */
|
|
108
36
|
export declare function cloudExecutionToPolicy(execution: unknown): CloudExecutionProjection;
|
|
109
|
-
/** Roster names from a rosters domain value ({rosters:[{name,…}]}). The /api/v1/effective wire strips
|
|
110
|
-
* rosters (control-plane only), so the IO half feeds this from the raw scoped domain GET when readable. */
|
|
111
37
|
export declare function cloudRosterNames(rostersValue: unknown): string[];
|
|
112
38
|
export interface CloudProjection {
|
|
113
39
|
mcp: McpServerSpec[];
|
|
114
40
|
skills: SkillSpec[];
|
|
115
|
-
/** The shadow config.d/models.json document (null = registry shipped no well-formed models domain). */
|
|
116
41
|
modelsDoc: Rec | null;
|
|
117
42
|
modelNames: string[];
|
|
118
43
|
rosterNames: string[];
|
|
119
|
-
/** env NAMES referenced by the cloud config (mcp refs + model apiKeyEnv) missing from the shell env. */
|
|
120
44
|
missingEnv: string[];
|
|
121
45
|
scope: string;
|
|
122
|
-
/** Skills present in the manifest whose body could not be resolved (skipped on the wire). */
|
|
123
46
|
skillsMissingBody: string[];
|
|
124
|
-
/** REF-CC-157(midband-05):mcp 域被丢弃的原始 server 行(disabled/missing-field/unknown-transport/
|
|
125
|
-
* capped 四态之一)——仿 skillsMissingBody 的留痕机制,此前 mcp/models 两域零回执。 */
|
|
126
47
|
droppedMcpServers: CloudMcpDroppedServer[];
|
|
127
|
-
/** REF-CC-157:models 域被丢弃的原始条目(缺 name 或 id)。 */
|
|
128
48
|
droppedModels: CloudDroppedModel[];
|
|
129
|
-
/** S3 execution-lane policy ([580]① / registry-core 0.8). Consumed by the sandbox policy-lock seam;
|
|
130
|
-
* ⚠️ client-enforced ADVISORY (P5=A) — the engine gate is service [580]. */
|
|
131
49
|
execution: CloudExecutionProjection;
|
|
132
50
|
}
|
|
133
|
-
/**
|
|
134
|
-
* Project one /api/v1/effective BODY (fresh or cached — the fallback path MUST produce the identical shape)
|
|
135
|
-
* into everything the shell consumes. Pure: bodies + env are injected.
|
|
136
|
-
*/
|
|
137
51
|
export declare function projectEffectiveBody(body: unknown, skillBodies: Record<string, string>, env: EnvLike, rostersValue?: unknown): CloudProjection;
|
|
@@ -3,13 +3,6 @@ import { toCappedSpec } from './skillsWireCaps.js';
|
|
|
3
3
|
const asRec = (v) => (typeof v === 'object' && v !== null && !Array.isArray(v) ? v : undefined);
|
|
4
4
|
const asArr = (v) => (Array.isArray(v) ? v : []);
|
|
5
5
|
const asStr = (v) => (typeof v === 'string' && v.length > 0 ? v : undefined);
|
|
6
|
-
/**
|
|
7
|
-
* Project the registry's mcp domain (`config.mcp.servers`, registry-core McpServerSpec — the CENTER shape
|
|
8
|
-
* with envRefs/headerRefs) → the SDK/core wire `McpServerSpec[]` (real env/header VALUES, resolved from the
|
|
9
|
-
* shell env). Disabled servers are skipped; unknown transport kinds are skipped (never mis-mapped); the
|
|
10
|
-
* result is capped at MCP_CAPS.items exactly like the local `.mcp.json` projection. Every skip is recorded
|
|
11
|
-
* in `droppedServers` (REF-CC-157) — nothing vanishes from the wire silently.
|
|
12
|
-
*/
|
|
13
6
|
export function cloudMcpToSpecs(servers, env) {
|
|
14
7
|
const specs = [];
|
|
15
8
|
const missingEnv = [];
|
|
@@ -20,8 +13,6 @@ export function cloudMcpToSpecs(servers, env) {
|
|
|
20
13
|
for (const raw of asArr(servers)) {
|
|
21
14
|
const s = asRec(raw);
|
|
22
15
|
const name = s ? asStr(s.name) : undefined;
|
|
23
|
-
// cap first: everything past MCP_CAPS.items is dropped regardless of what it looks like — this is
|
|
24
|
-
// the reason it never got evaluated, so report it as such (not as a false 'missing-field').
|
|
25
16
|
if (specs.length >= MCP_CAPS.items) {
|
|
26
17
|
drop(name, 'capped');
|
|
27
18
|
continue;
|
|
@@ -42,8 +33,6 @@ export function cloudMcpToSpecs(servers, env) {
|
|
|
42
33
|
drop(name, 'missing-field');
|
|
43
34
|
continue;
|
|
44
35
|
}
|
|
45
|
-
// envRefs: target ENV key → ENV NAME holding the value (center never stores the secret). Resolve
|
|
46
|
-
// against the shell env — the engine child inherits it, so stdio spawn sees the same values.
|
|
47
36
|
const envOut = {};
|
|
48
37
|
for (const [target, ref] of Object.entries(asRec(t.envRefs) ?? {})) {
|
|
49
38
|
const refName = asStr(ref);
|
|
@@ -89,7 +78,7 @@ export function cloudMcpToSpecs(servers, env) {
|
|
|
89
78
|
};
|
|
90
79
|
}
|
|
91
80
|
else {
|
|
92
|
-
drop(name, 'unknown-transport');
|
|
81
|
+
drop(name, 'unknown-transport');
|
|
93
82
|
continue;
|
|
94
83
|
}
|
|
95
84
|
const allowTools = asArr(s.allowTools).filter((a) => typeof a === 'string');
|
|
@@ -98,33 +87,11 @@ export function cloudMcpToSpecs(servers, env) {
|
|
|
98
87
|
transport,
|
|
99
88
|
...(allowTools.length > 0 ? { allowTools } : {}),
|
|
100
89
|
...(s.elicitation === true ? { elicitation: true } : {}),
|
|
101
|
-
// ── 0.64.2 族扫(cli L-167① 的**同形存量第二处**)─────────────────────────────────────
|
|
102
|
-
// 病形与 `mcpWireCaps.mcpConfigToSpec` **逐字同一条**:这也是一次逐键白名单重建,而
|
|
103
|
-
// settings-schema 的 mcp 段上有**解析透明键**(`z.unknown()`;1.10.0 两员 `source` / `toolFaces`,2.0.0 同形〔2026-09-16 核〕)。
|
|
104
|
-
// 上游对 `toolFaces` 的成文是「三条腿(请求 / config-center / 本地 config.d)同一条规则」——
|
|
105
|
-
// 本函数正是 **config-center 那条腿落到请求面**的投影,只修本地那条 = 同形存量留一半:
|
|
106
|
-
// 用 center 下发配置的部署,运维声明的 per-tool 面照样在包边界被静默剥掉。
|
|
107
|
-
// 🔴 **原样过境,不校形**(理由见 `mcpWireCaps.ts` 模块顶注与 `McpConfigLike.toolFaces` 的注):
|
|
108
|
-
// 形的判决属引擎摄入侧;包在这里判一次形,判严了就把运维声明的保护静默吞掉。
|
|
109
|
-
// 🔴 **`source` 同样不在这条腿上**:它是部署面的分组标签,而本函数的产物是**请求面**
|
|
110
|
-
// `McpServerSpec`(sdk 8.8.0 上没有这个键)。两条腿的记账逐字相同。
|
|
111
|
-
// 🔴 **两条腿刻意不共用一个函数,改由门同源**:跨文件共用要么给公面加一个没有外部消费者的
|
|
112
|
-
// 名字,要么把这一行抽成一个新叶子(闭包/单例账各加一笔)。这里的「规则」只有一行
|
|
113
|
-
// (键在场 ⇒ 原样铸),真正会漂的是**哪些键算透明** —— 那张表的属主在上游,而
|
|
114
|
-
// `run-additive-key-passthrough-test.mjs` G7 段是从**实装 schema** 取表、对**两条腿各对一次账**,
|
|
115
|
-
// 任一条漏一个键当天红。⇒ 单一真源在上游 + 机械门,不是两份各自为政的判断。
|
|
116
90
|
...(s.toolFaces !== undefined ? { toolFaces: s.toolFaces } : {}),
|
|
117
91
|
});
|
|
118
92
|
}
|
|
119
93
|
return { specs, missingEnv: [...new Set(missingEnv)], droppedServers };
|
|
120
94
|
}
|
|
121
|
-
// ── skills: config.skills.skills (MANIFEST) + bodies → SkillSpec[] ───────────────────────────────────────
|
|
122
|
-
/**
|
|
123
|
-
* Project the /api/v1/effective skills MANIFEST (content replaced by `contentHash` — registry-core
|
|
124
|
-
* toSkillsManifest) → the capped wire `SkillSpec[]`. `resolveBody(contentHash)` supplies each body (the IO
|
|
125
|
-
* half caches bodies by hash; null ⇒ the skill is SKIPPED — a nameless/bodyless SkillSpec is a 400). Same
|
|
126
|
-
* caps + dedupe as the local projection (skillsWireCaps), so the wire is well-formed by construction.
|
|
127
|
-
*/
|
|
128
95
|
export function cloudSkillsToSpecs(manifestSkills, resolveBody) {
|
|
129
96
|
const specs = [];
|
|
130
97
|
const seen = new Set();
|
|
@@ -147,14 +114,6 @@ export function cloudSkillsToSpecs(manifestSkills, resolveBody) {
|
|
|
147
114
|
}
|
|
148
115
|
return specs;
|
|
149
116
|
}
|
|
150
|
-
// ── models: config.models → shadow config.d/models.json document ─────────────────────────────────────────
|
|
151
|
-
/**
|
|
152
|
-
* The registry's models domain (registry-core ModelsConfig) IS the engine's `config.d/models.json` contract
|
|
153
|
-
* (the same zod schema parses both — engine CONFIG_PROVIDER=local FileConfigStore lane), so the projection is
|
|
154
|
-
* a VALIDATION-LITE PASSTHROUGH: keep exactly {models, roles, atModelAllowlist}, drop everything else, and
|
|
155
|
-
* return null when there is no well-formed models array (caller then writes an empty catalog — engine
|
|
156
|
-
* semantics: no enabled models ⇒ env-catalog fallback).
|
|
157
|
-
*/
|
|
158
117
|
export function cloudModelsToDoc(models) {
|
|
159
118
|
const m = asRec(models);
|
|
160
119
|
if (!m || !Array.isArray(m.models))
|
|
@@ -169,11 +128,6 @@ export function cloudModelsToDoc(models) {
|
|
|
169
128
|
...(Array.isArray(m.atModelAllowlist) ? { atModelAllowlist: m.atModelAllowlist } : {}),
|
|
170
129
|
};
|
|
171
130
|
}
|
|
172
|
-
/**
|
|
173
|
-
* REF-CC-157(midband-05,fix-outright):`config.models.models` 里被 `cloudModelsToDoc` 过滤掉的原始
|
|
174
|
-
* 条目(缺 `name` 或 `id`)——仿 `skillsMissingBody` 的形状,重扫同一份原始数组产出丢弃清单,让调用方
|
|
175
|
-
* 能警示用户「你的 model 配置有 N 行没生效」,而不是让一个打错字的字段静默从目录消失。
|
|
176
|
-
*/
|
|
177
131
|
export function cloudModelsDropped(models) {
|
|
178
132
|
const m = asRec(models);
|
|
179
133
|
if (!m || !Array.isArray(m.models))
|
|
@@ -182,14 +136,13 @@ export function cloudModelsDropped(models) {
|
|
|
182
136
|
for (const e of m.models) {
|
|
183
137
|
const r = asRec(e);
|
|
184
138
|
if (r && asStr(r.name) && asStr(r.id))
|
|
185
|
-
continue;
|
|
139
|
+
continue;
|
|
186
140
|
const id = r ? asStr(r.id) : undefined;
|
|
187
141
|
const name = r ? asStr(r.name) : undefined;
|
|
188
142
|
out.push({ ...(id ? { id } : {}), ...(name ? { name } : {}) });
|
|
189
143
|
}
|
|
190
144
|
return out;
|
|
191
145
|
}
|
|
192
|
-
/** ENABLED model names in a models doc (banner/status display + "did the cloud catalog apply" checks). */
|
|
193
146
|
export function cloudModelNames(doc) {
|
|
194
147
|
if (!doc)
|
|
195
148
|
return [];
|
|
@@ -200,8 +153,6 @@ export function cloudModelNames(doc) {
|
|
|
200
153
|
})
|
|
201
154
|
.filter((n) => !!n);
|
|
202
155
|
}
|
|
203
|
-
/** `apiKeyEnv` NAMES referenced by enabled models that resolve to nothing in `env` — the engine child would
|
|
204
|
-
* route those models with no key (a mid-session 401 the user can't diagnose); callers warn up front. */
|
|
205
156
|
export function cloudModelMissingKeyEnv(doc, env) {
|
|
206
157
|
if (!doc)
|
|
207
158
|
return [];
|
|
@@ -216,12 +167,6 @@ export function cloudModelMissingKeyEnv(doc, env) {
|
|
|
216
167
|
}
|
|
217
168
|
return [...out];
|
|
218
169
|
}
|
|
219
|
-
/** Project the registry's execution domain (registry-core 0.8 ExecutionPolicy — `{required, allowedLanes}`,
|
|
220
|
-
* allowedLanes = OPEN string vocab, [580]④; 0.10.1 adds `sessionMirror{engineUrl, required}` — additive).
|
|
221
|
-
* Defensive like every other projection: a missing/misshapen domain (an 0.7 registry) yields the schema
|
|
222
|
-
* defaults `{required:false, allowedLanes:["host"], sessionMirror:null}` — never a throw, never an
|
|
223
|
-
* accidental lock-ON, and never a guessed mirror target (engineUrl must be a non-empty string or the
|
|
224
|
-
* whole sessionMirror is dropped: a mirror carries session content + a Bearer, we don't improvise one). */
|
|
225
170
|
export function cloudExecutionToPolicy(execution) {
|
|
226
171
|
const e = asRec(execution);
|
|
227
172
|
const lanes = asArr(e?.allowedLanes).filter((l) => typeof l === 'string' && l.length > 0);
|
|
@@ -230,23 +175,15 @@ export function cloudExecutionToPolicy(execution) {
|
|
|
230
175
|
return {
|
|
231
176
|
required: e?.required === true,
|
|
232
177
|
allowedLanes: lanes.length > 0 ? lanes : ['host'],
|
|
233
|
-
// trailing-slash normalization matches engineTarget.normalizeEngineUrl (origin/no-op comparisons downstream)
|
|
234
178
|
sessionMirror: mirrorUrl ? { engineUrl: mirrorUrl.replace(/\/+$/, ''), required: m?.required === true } : null,
|
|
235
179
|
};
|
|
236
180
|
}
|
|
237
|
-
// ── rosters: v1 thinnest seam (names for display / model-order reference) ────────────────────────────────
|
|
238
|
-
/** Roster names from a rosters domain value ({rosters:[{name,…}]}). The /api/v1/effective wire strips
|
|
239
|
-
* rosters (control-plane only), so the IO half feeds this from the raw scoped domain GET when readable. */
|
|
240
181
|
export function cloudRosterNames(rostersValue) {
|
|
241
182
|
const r = asRec(rostersValue);
|
|
242
183
|
return asArr(r?.rosters)
|
|
243
184
|
.map((e) => asStr(asRec(e)?.name))
|
|
244
185
|
.filter((n) => !!n);
|
|
245
186
|
}
|
|
246
|
-
/**
|
|
247
|
-
* Project one /api/v1/effective BODY (fresh or cached — the fallback path MUST produce the identical shape)
|
|
248
|
-
* into everything the shell consumes. Pure: bodies + env are injected.
|
|
249
|
-
*/
|
|
250
187
|
export function projectEffectiveBody(body, skillBodies, env, rostersValue) {
|
|
251
188
|
const b = asRec(body) ?? {};
|
|
252
189
|
const config = asRec(b.config) ?? {};
|
package/dist/compensations.d.ts
CHANGED
|
@@ -1,64 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* compensations.ts — **补偿层登记表**(B6 引入,设计稿 §2 补偿表 T1–T60 的落码侧账本)。
|
|
3
|
-
*
|
|
4
|
-
* ## 为什么要有这张表
|
|
5
|
-
*
|
|
6
|
-
* 搬迁把「壳替引擎补的那 60 件事」分成三种命运:整条进包 / **拆两半**(判定归库、执行留宿主)/
|
|
7
|
-
* 留宿主。前两种里最危险的是**拆**:它天然是 [paired-mechanisms-must-share-premise] 的形状 ——
|
|
8
|
-
* 库这半以为「宿主会做另一半」,宿主那半以为「库已经处理了」,两半各自都对、组合零结果。
|
|
9
|
-
* 而且这种失效**不报错**,只是某个面悄悄空掉。
|
|
10
|
-
*
|
|
11
|
-
* ⇒ 与 `CHROME_ARMS` / `CLIENT_VERBS` 同一套纪律:**把义务做成数据**,让它可被断言,而不是
|
|
12
|
-
* 散在注释里。pure 门对本表跑三条:①id 唯一 ②每条 `split` 的 `chromeArm` 必须真在
|
|
13
|
-
* `CHROME_ARMS` 里 ③而且必须是 `required: true` —— 拆缝对面的义务若是「可选」,那这一刀就等于
|
|
14
|
-
* 在多端上静默丢行为。
|
|
15
|
-
*
|
|
16
|
-
* ## 它不是什么
|
|
17
|
-
*
|
|
18
|
-
* 🔴 **不是 `ADAPTER_DIVERGENCES`**。那张表登记的是「adapt() 与 cli `sdkMessagesToCcEvents`
|
|
19
|
-
* **行为不同**」的地方,差分守卫按它豁免比对。本表里的东西两侧**行为相同**(补偿是从 cli 原样
|
|
20
|
-
* 搬过来的),登记的是「这条补偿为什么存在、上游到货后什么时候能删」。把回落臂写进 DIVERGENCES
|
|
21
|
-
* 会让差分表撒谎 —— 那等于宣布两侧在这里不等价,而它们是等价的。
|
|
22
|
-
*
|
|
23
|
-
* ## 增长方式
|
|
24
|
-
*
|
|
25
|
-
* 每批只登记**这一批处置掉**的条目(B6 = P5 那八条)。不预先把 T1–T60 全填进来:填了但没落码的
|
|
26
|
-
* 行只会让表看起来完整而实际没有判别力([probe-must-prove-it-speaks])。
|
|
27
|
-
*/
|
|
28
1
|
import { type ChromeArmKind } from './seam.js';
|
|
29
2
|
export interface CompensationRecord {
|
|
30
|
-
/** census 编号(设计稿 §2 补偿表 T1–T60)。 */
|
|
31
3
|
id: string;
|
|
32
|
-
/** 它补的是什么(一句话;完整说明在落码处的注释里,那里是真源)。 */
|
|
33
4
|
what: string;
|
|
34
|
-
/** `in-library` = 整条进包;`split` = 判定归库、执行留宿主。 */
|
|
35
5
|
disposition: 'in-library' | 'split';
|
|
36
|
-
/** 库这一半落在哪(模块 / 函数)。 */
|
|
37
6
|
libraryHalf: string;
|
|
38
|
-
/** 拆缝对面的宿主义务经由哪个 chrome 臂交付(`in-library` 恒 null)。 */
|
|
39
7
|
chromeArm: ChromeArmKind | null;
|
|
40
|
-
/** 宿主那一半要做什么(`in-library` 恒 null)。 */
|
|
41
8
|
hostHalf: string | null;
|
|
42
|
-
/**
|
|
43
|
-
* 退休条件 —— 上游到货后这条补偿可以删或简化;`null` = 它不是补偿而是**长期职责**
|
|
44
|
-
* (删了就是丢功能,不是清债)。
|
|
45
|
-
*/
|
|
46
9
|
retireOn: string | null;
|
|
47
10
|
}
|
|
48
|
-
/**
|
|
49
|
-
* B6 P5 处置的八条(T32/T34/T47/T48/T49 整条进包 · T35/T36/T44 拆)+ **B7 完成事件族五条**
|
|
50
|
-
* (T1/T2/T3/T25/T53,全部「只搬不删」—— P1-3 未到货)。
|
|
51
|
-
*
|
|
52
|
-
* 🔴 事实核对(B6 余项批实测,不是照抄设计稿):这八条的落码**都发生在 B4**
|
|
53
|
-
* (`adapt.ts` A 层第 14 臂 `task_progress` 收官那一批),本批做的是**核实 + 登记 + 定案**,
|
|
54
|
-
* 不是重新搬一遍。核实方式 = 逐条在 `adapt.ts` 找到落码点并配上断言,见 pure 门 B6 段。
|
|
55
|
-
*/
|
|
56
11
|
export declare const MIGRATED_COMPENSATIONS: readonly CompensationRecord[];
|
|
57
|
-
/**
|
|
58
|
-
* 自检:每条 `split` 的宿主义务(若经 chrome 臂交付)必须真在 `CHROME_ARMS` 里,而且是
|
|
59
|
-
* `required: true`。返回违规条目;**恒应为空数组**。
|
|
60
|
-
*
|
|
61
|
-
* 🔴 判据锚在「决定结果的量」上:拆缝对面若挂在一个 `required:false` 的臂上,宿主可以合法不实现,
|
|
62
|
-
* 于是这一刀就是「库不做了、端也不做」——正是配对机制两半各自都对、组合零结果的那个形状。
|
|
63
|
-
*/
|
|
64
12
|
export declare function compensationSplitViolations(): string[];
|
package/dist/compensations.js
CHANGED
|
@@ -1,39 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* compensations.ts — **补偿层登记表**(B6 引入,设计稿 §2 补偿表 T1–T60 的落码侧账本)。
|
|
3
|
-
*
|
|
4
|
-
* ## 为什么要有这张表
|
|
5
|
-
*
|
|
6
|
-
* 搬迁把「壳替引擎补的那 60 件事」分成三种命运:整条进包 / **拆两半**(判定归库、执行留宿主)/
|
|
7
|
-
* 留宿主。前两种里最危险的是**拆**:它天然是 [paired-mechanisms-must-share-premise] 的形状 ——
|
|
8
|
-
* 库这半以为「宿主会做另一半」,宿主那半以为「库已经处理了」,两半各自都对、组合零结果。
|
|
9
|
-
* 而且这种失效**不报错**,只是某个面悄悄空掉。
|
|
10
|
-
*
|
|
11
|
-
* ⇒ 与 `CHROME_ARMS` / `CLIENT_VERBS` 同一套纪律:**把义务做成数据**,让它可被断言,而不是
|
|
12
|
-
* 散在注释里。pure 门对本表跑三条:①id 唯一 ②每条 `split` 的 `chromeArm` 必须真在
|
|
13
|
-
* `CHROME_ARMS` 里 ③而且必须是 `required: true` —— 拆缝对面的义务若是「可选」,那这一刀就等于
|
|
14
|
-
* 在多端上静默丢行为。
|
|
15
|
-
*
|
|
16
|
-
* ## 它不是什么
|
|
17
|
-
*
|
|
18
|
-
* 🔴 **不是 `ADAPTER_DIVERGENCES`**。那张表登记的是「adapt() 与 cli `sdkMessagesToCcEvents`
|
|
19
|
-
* **行为不同**」的地方,差分守卫按它豁免比对。本表里的东西两侧**行为相同**(补偿是从 cli 原样
|
|
20
|
-
* 搬过来的),登记的是「这条补偿为什么存在、上游到货后什么时候能删」。把回落臂写进 DIVERGENCES
|
|
21
|
-
* 会让差分表撒谎 —— 那等于宣布两侧在这里不等价,而它们是等价的。
|
|
22
|
-
*
|
|
23
|
-
* ## 增长方式
|
|
24
|
-
*
|
|
25
|
-
* 每批只登记**这一批处置掉**的条目(B6 = P5 那八条)。不预先把 T1–T60 全填进来:填了但没落码的
|
|
26
|
-
* 行只会让表看起来完整而实际没有判别力([probe-must-prove-it-speaks])。
|
|
27
|
-
*/
|
|
28
1
|
import { CHROME_ARMS } from './seam.js';
|
|
29
|
-
/**
|
|
30
|
-
* B6 P5 处置的八条(T32/T34/T47/T48/T49 整条进包 · T35/T36/T44 拆)+ **B7 完成事件族五条**
|
|
31
|
-
* (T1/T2/T3/T25/T53,全部「只搬不删」—— P1-3 未到货)。
|
|
32
|
-
*
|
|
33
|
-
* 🔴 事实核对(B6 余项批实测,不是照抄设计稿):这八条的落码**都发生在 B4**
|
|
34
|
-
* (`adapt.ts` A 层第 14 臂 `task_progress` 收官那一批),本批做的是**核实 + 登记 + 定案**,
|
|
35
|
-
* 不是重新搬一遍。核实方式 = 逐条在 `adapt.ts` 找到落码点并配上断言,见 pure 门 B6 段。
|
|
36
|
-
*/
|
|
37
2
|
export const MIGRATED_COMPENSATIONS = [
|
|
38
3
|
{
|
|
39
4
|
id: 'T32',
|
|
@@ -42,7 +7,6 @@ export const MIGRATED_COMPENSATIONS = [
|
|
|
42
7
|
libraryHalf: 'adapt.ts bindTaskCard()',
|
|
43
8
|
chromeArm: null,
|
|
44
9
|
hostHalf: null,
|
|
45
|
-
// 见下方 P1-2 定案段:FIFO 那一臂**不删**,它是 tolerate-absent 的保护臂。
|
|
46
10
|
retireOn: 'P1-2 到货且达标线 ≥ server 1.290(typed parentToolCallId 在每条 tick 上恒在)后,' +
|
|
47
11
|
'FIFO 回落臂可删 —— 但只在**确认不再支持老引擎**时删,见 bindTaskCard 的 old-engine fallback 注释',
|
|
48
12
|
},
|
|
@@ -53,7 +17,7 @@ export const MIGRATED_COMPENSATIONS = [
|
|
|
53
17
|
libraryHalf: 'adapt.ts liveBoundPanelTasks + settlePanelTasks(cardId===null) 防御 sweep',
|
|
54
18
|
chromeArm: null,
|
|
55
19
|
hostHalf: null,
|
|
56
|
-
retireOn: null,
|
|
20
|
+
retireOn: null,
|
|
57
21
|
},
|
|
58
22
|
{
|
|
59
23
|
id: 'T35',
|
|
@@ -80,7 +44,7 @@ export const MIGRATED_COMPENSATIONS = [
|
|
|
80
44
|
libraryHalf: 'adapt.ts E 层 ② —— structured task/task-list 的判定 + 归一',
|
|
81
45
|
chromeArm: 'task_ledger_sync',
|
|
82
46
|
hostHalf: '按 toolUseId 幂等落盘(cli engineTaskListSync 的 fs 面;web 宿主落 BFF/本地存储)',
|
|
83
|
-
retireOn: null,
|
|
47
|
+
retireOn: null,
|
|
84
48
|
},
|
|
85
49
|
{
|
|
86
50
|
id: 'T47',
|
|
@@ -99,16 +63,8 @@ export const MIGRATED_COMPENSATIONS = [
|
|
|
99
63
|
chromeArm: null,
|
|
100
64
|
hostHalf: 'footer 行过滤 isFooterTaskRow/filterFooterTaskRows —— 含「丢弃所有无 parentId 顶层行」' +
|
|
101
65
|
'这条**端专属决策**(主 run 头部行由端自己合成渲染),留 TUI',
|
|
102
|
-
// 🔴 这条的写者与读者**都在库内**(设计稿 §2.4.1-B 已裁):做成 chrome 臂会让「宿主没接线 ⇒
|
|
103
|
-
// Set 恒空 ⇒ 判据④ 静默失效」复活,所以 chromeArm 恒 null,拆的是**过滤策略**不是台账。
|
|
104
66
|
retireOn: 'P1-2 到货后 fleet 行自带 parentToolCallId ⇒ 双生行不需要按尾段查',
|
|
105
67
|
},
|
|
106
|
-
// ── B7 处置的五条(完成事件族 T1/T2/T3/T25/T53)──────────────────────────────────────────────
|
|
107
|
-
// 🔴 **P1-3(完成事件单一权威)未到货 ⇒ 这五条全是「只搬不删」**:四道去重原样保留。
|
|
108
|
-
// 每条的 `retireOn` 写的就是「P1-3 到货后**降哪一道**」——退役条件必须是**可执行的判据**,
|
|
109
|
-
// 不是「以后再说」。设计稿 §3 B7:「P1-3 到货 ⇒ 四道去重降到一道 + 删 XML 反解回植」。
|
|
110
|
-
// ⚠️ 「降到一道」不等于「删三道」:下面 T53 行逐道写清了哪一道是权威、另外三道各防什么,
|
|
111
|
-
// 否则到货那天没人分得清哪些能删([anchor-on-the-deciding-quantity]:先定这个量门控什么)。
|
|
112
68
|
{
|
|
113
69
|
id: 'T1',
|
|
114
70
|
what: '三个跨 turn 台账(渲染去重 / 跨通道记账 / 完成卡已入队)—— completion inbox 是 at-least-once,' +
|
|
@@ -118,7 +74,6 @@ export const MIGRATED_COMPENSATIONS = [
|
|
|
118
74
|
'适配器实例的 renderedNotifications;序列化口 exportLedger/importLedger',
|
|
119
75
|
chromeArm: null,
|
|
120
76
|
hostHalf: null,
|
|
121
|
-
// 长期职责:只要投递是 at-least-once,客户端就得有去重记忆。P1-3 换的是**键**不是台账。
|
|
122
77
|
retireOn: null,
|
|
123
78
|
},
|
|
124
79
|
{
|
|
@@ -157,15 +112,6 @@ export const MIGRATED_COMPENSATIONS = [
|
|
|
157
112
|
id: 'T53',
|
|
158
113
|
what: '同一次完成四通道扇出 ⇒ 四道去重(设计稿列为最贵 #4)',
|
|
159
114
|
disposition: 'in-library',
|
|
160
|
-
// 四道各自防什么(P1-3 到货那天要按这个清单逐道判,别一刀切):
|
|
161
|
-
// ① renderedNotifications(键=T2)—— 防**同一帧重放**(durable re-attach / at-least-once 重投)。
|
|
162
|
-
// ⇒ P1-3 后这一道**留**,只是键换成 completionId。这是「降到一道」里的那一道。
|
|
163
|
-
// ② isWorkflowCompletionCardEnqueued —— 防「Path B 已入队的完成卡」与「Path A 推送帧」双投。
|
|
164
|
-
// ⇒ P1-3 后可删:两条通道带同一 completionId,①就能盖住。
|
|
165
|
-
// ③ isEngineWorkflowNotified(workflow_complete 臂首行)—— 防补发通道在引擎已 server-side
|
|
166
|
-
// inject 之后再喂一遍。⇒ P1-3 后可删,同②。
|
|
167
|
-
// ④ dropQueuedNotificationsForRun —— 回声到达时把还躺在队列里的同 run 条目捞回来。
|
|
168
|
-
// ⇒ **不是去重是撤单**,P1-3 后仍需要(队列里那条已经排上了,得有人撤)。
|
|
169
115
|
libraryHalf: 'adapt.ts task_notification / workflow_complete 两臂的四道门(逐道说明见本行上方注释)',
|
|
170
116
|
chromeArm: null,
|
|
171
117
|
hostHalf: null,
|
|
@@ -182,13 +128,6 @@ export const MIGRATED_COMPENSATIONS = [
|
|
|
182
128
|
retireOn: 'P1-2 到货后 content 帧自带 taskId ⇒ alias 学习整条可删',
|
|
183
129
|
},
|
|
184
130
|
];
|
|
185
|
-
/**
|
|
186
|
-
* 自检:每条 `split` 的宿主义务(若经 chrome 臂交付)必须真在 `CHROME_ARMS` 里,而且是
|
|
187
|
-
* `required: true`。返回违规条目;**恒应为空数组**。
|
|
188
|
-
*
|
|
189
|
-
* 🔴 判据锚在「决定结果的量」上:拆缝对面若挂在一个 `required:false` 的臂上,宿主可以合法不实现,
|
|
190
|
-
* 于是这一刀就是「库不做了、端也不做」——正是配对机制两半各自都对、组合零结果的那个形状。
|
|
191
|
-
*/
|
|
192
131
|
export function compensationSplitViolations() {
|
|
193
132
|
const byKind = new Map(CHROME_ARMS.map(a => [a.kind, a]));
|
|
194
133
|
const bad = [];
|