@sema-agent/client-core 0.100.0 → 0.102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +452 -0
- package/README.md +172 -120
- package/dist/adapt/arms.js +51 -16
- package/dist/adapt/textStream.js +7 -4
- package/dist/adapt/toolCards.d.ts +2 -1
- package/dist/adapt/toolCards.js +28 -13
- package/dist/adapt.d.ts +1 -1
- package/dist/adapt.js +8 -2
- package/dist/adapter/activeRunSelfHeal.d.ts +24 -2
- package/dist/adapter/activeRunSelfHeal.js +108 -6
- package/dist/adapter/downstream/eventToSdkMessage.js +38 -79
- package/dist/adapter/downstream/terminalToSdkResult.d.ts +60 -1
- package/dist/adapter/downstream/terminalToSdkResult.js +209 -39
- package/dist/adapter/downstream/wiringManifestView.d.ts +1 -0
- package/dist/adapter/downstream/wiringManifestView.js +138 -0
- package/dist/adapter/runStream.d.ts +4 -4
- package/dist/adapter/runStream.js +158 -43
- package/dist/agentsWireCaps.d.ts +2 -7
- package/dist/agentsWireCaps.js +1 -2
- package/dist/approvalDecidedByCapability.js +2 -2
- package/dist/approvalFrameFamilies.d.ts +33 -0
- package/dist/approvalFrameFamilies.js +120 -0
- package/dist/approvalsStreamLiveCapability.js +2 -2
- package/dist/attachmentsWireCaps.js +41 -13
- package/dist/callerCwdCapability.js +2 -2
- package/dist/centerWiringCapability.js +2 -2
- package/dist/clockReading.d.ts +2 -0
- package/dist/clockReading.js +4 -0
- package/dist/cloudConfigWireCaps.d.ts +19 -5
- package/dist/cloudConfigWireCaps.js +193 -56
- package/dist/compensations.js +1 -1
- package/dist/coreValuePorts.d.ts +12 -2
- package/dist/coreValuePorts.js +9 -0
- package/dist/decideFailureNote.js +5 -3
- package/dist/decideReceipt.js +2 -2
- package/dist/deviceExecutorManagementCapability.js +2 -2
- package/dist/deviceFlowPolling.js +1 -1
- package/dist/disableSkillsWire.d.ts +1 -1
- package/dist/disableSkillsWire.js +4 -3
- package/dist/displayUntrusted.d.ts +9 -4
- package/dist/displayUntrusted.js +834 -104
- package/dist/engineCapReader.js +1 -1
- package/dist/engineConfigDrift.js +1 -1
- package/dist/engineErrorCodes.d.ts +14 -5
- package/dist/engineErrorCodes.js +27 -6
- package/dist/engineGenerationConvergence.d.ts +39 -0
- package/dist/engineGenerationConvergence.js +95 -0
- package/dist/engineGenerationPort.d.ts +61 -0
- package/dist/engineGenerationPort.js +144 -0
- package/dist/engineHealthFacts.d.ts +23 -0
- package/dist/engineHealthFacts.js +92 -0
- package/dist/engineIdentity.d.ts +4 -0
- package/dist/engineIdentity.js +11 -0
- package/dist/engineNoticeCodes.d.ts +2 -5
- package/dist/engineRowRef.js +4 -0
- package/dist/engineSessionMessages.js +2 -2
- package/dist/engineToolDirectory.js +2 -2
- package/dist/engineWireFor.d.ts +99 -0
- package/dist/engineWireFor.js +248 -6
- package/dist/engineWireTarget.d.ts +1 -0
- package/dist/engineWireTarget.js +8 -0
- package/dist/env/uiLanguage.js +1 -1
- package/dist/errorSupplementRoles.d.ts +3 -0
- package/dist/errorSupplementRoles.js +37 -0
- package/dist/executionLaneCapability.js +2 -2
- package/dist/fileHistoryCaptureCapability.js +3 -3
- package/dist/finalVerifyWire.d.ts +6 -3
- package/dist/finalVerifyWire.js +6 -23
- package/dist/flagInput.d.ts +4 -0
- package/dist/flagInput.js +24 -0
- package/dist/fleet/fleetLedger.js +5 -2
- package/dist/fleet/fleetProjection.d.ts +1 -0
- package/dist/fleet/fleetProjection.js +16 -3
- package/dist/gateVocabulary.js +3 -0
- package/dist/generated/engineFactTables.d.ts +7 -3
- package/dist/generated/engineFactTables.js +52 -0
- package/dist/generated/engineNoticeTables.js +12 -0
- package/dist/generated/settingsSchemaActiveTiers.d.ts +1 -0
- package/dist/generated/settingsSchemaActiveTiers.js +14 -0
- package/dist/generated/settingsSchemaCallerTextEcho.d.ts +1 -0
- package/dist/generated/settingsSchemaCallerTextEcho.js +8 -0
- package/dist/generated/settingsSchemaControlAndBidi.d.ts +1 -0
- package/dist/generated/settingsSchemaControlAndBidi.js +8 -0
- package/dist/generated/settingsSchemaDefaultModel.d.ts +11 -0
- package/dist/generated/settingsSchemaDefaultModel.js +25 -0
- package/dist/generated/settingsSchemaFns.d.ts +54 -0
- package/dist/generated/settingsSchemaFns.js +26 -1
- package/dist/generated/settingsSchemaMcpRequestEntry.d.ts +1 -1
- package/dist/generated/settingsSchemaMcpRequestEntry.js +1 -7
- package/dist/generated/settingsSchemaSafetyMergeSpec.d.ts +1 -0
- package/dist/generated/settingsSchemaSafetyMergeSpec.js +95 -0
- package/dist/generated/settingsSchemaSettingsSources.d.ts +1 -0
- package/dist/generated/settingsSchemaSettingsSources.js +58 -0
- package/dist/generated/settingsSchemaTables.d.ts +2 -0
- package/dist/generated/settingsSchemaTables.js +13 -0
- package/dist/generated/settingsSchemaUrlPattern.d.ts +1 -0
- package/dist/generated/settingsSchemaUrlPattern.js +183 -0
- package/dist/headlessPermissionModeWire.d.ts +18 -2
- package/dist/headlessPermissionModeWire.js +30 -19
- package/dist/hitl/allowRuleShadow.js +7 -5
- package/dist/hitl/approvalCardReading.d.ts +3 -0
- package/dist/hitl/approvalCardReading.js +17 -0
- package/dist/hitl/approvalCompleteParked.js +1 -1
- package/dist/hitl/approvalDelivery.d.ts +87 -0
- package/dist/hitl/approvalDelivery.js +193 -0
- package/dist/hitl/approvalResolution.d.ts +11 -0
- package/dist/hitl/approvalResolution.js +50 -11
- package/dist/hitl/askClassPair.d.ts +6 -0
- package/dist/hitl/askClassPair.js +30 -3
- package/dist/hitl/askParkAutoReopenBlock.d.ts +30 -0
- package/dist/hitl/askParkAutoReopenBlock.js +117 -0
- package/dist/hitl/askParkRowRouting.js +4 -1
- package/dist/hitl/attributionLadder.d.ts +42 -3
- package/dist/hitl/attributionLadder.js +79 -8
- package/dist/hitl/automaticAnswerVerdict.d.ts +6 -1
- package/dist/hitl/automaticAnswerVerdict.js +46 -11
- package/dist/hitl/crashConverged.js +2 -2
- package/dist/hitl/decisionConflict.d.ts +6 -2
- package/dist/hitl/decisionConflict.js +24 -9
- package/dist/hitl/decisionRefusal.d.ts +20 -10
- package/dist/hitl/decisionRefusal.js +99 -54
- package/dist/hitl/decisionSend.d.ts +3 -0
- package/dist/hitl/decisionSend.js +87 -103
- package/dist/hitl/frameRouter.d.ts +1 -0
- package/dist/hitl/frameRouter.js +9 -2
- package/dist/hitl/hitlBridge.d.ts +18 -6
- package/dist/hitl/hitlBridge.js +41 -37
- package/dist/hitl/livePendingAsk.js +4 -3
- package/dist/hitl/noAllowCause.js +1 -1
- package/dist/hitl/parkResolver.js +3 -2
- package/dist/hitl/persistedRulesWire.js +1 -0
- package/dist/hitl/planReviewWire.d.ts +4 -0
- package/dist/hitl/planReviewWire.js +59 -30
- package/dist/hitl/resumeRunningCard.d.ts +3 -2
- package/dist/hitl/resumeRunningCard.js +17 -11
- package/dist/hitl/sessionPolicyDeliverable.d.ts +5 -2
- package/dist/hitl/sessionPolicyDeliverable.js +62 -29
- package/dist/hitl/sessionPolicyWire.d.ts +13 -3
- package/dist/hitl/sessionPolicyWire.js +81 -16
- package/dist/hitl/standingRows.js +1 -1
- package/dist/hitl/toolApprovalWire.d.ts +9 -10
- package/dist/hitl/toolApprovalWire.js +72 -54
- package/dist/hookMatcherVerdict.d.ts +2 -0
- package/dist/hookMatcherVerdict.js +12 -0
- package/dist/hooksCompactTransition.d.ts +19 -0
- package/dist/hooksCompactTransition.js +41 -0
- package/dist/hooksWireCaps.d.ts +1 -1
- package/dist/hooksWireCaps.js +202 -203
- package/dist/host.d.ts +1 -14
- package/dist/host.js +0 -8
- package/dist/hostCallbackGuard.d.ts +1 -0
- package/dist/hostCallbackGuard.js +1 -1
- package/dist/hostSettingsSource.d.ts +172 -0
- package/dist/hostSettingsSource.js +675 -0
- package/dist/hostTurnSettings.d.ts +73 -17
- package/dist/hostTurnSettings.js +594 -97
- package/dist/httpHookPolicy.d.ts +37 -0
- package/dist/httpHookPolicy.js +176 -0
- package/dist/humanTurn.d.ts +2 -1
- package/dist/humanTurn.js +37 -7
- package/dist/humanTurnRead.js +4 -3
- package/dist/humanTurnSentences.d.ts +10 -0
- package/dist/humanTurnSentences.js +74 -0
- package/dist/i18n/messages.en.d.ts +222 -2
- package/dist/i18n/messages.en.js +225 -5
- package/dist/i18n/messages.zh.js +237 -5
- package/dist/i18n/translate.js +3 -3
- package/dist/index.d.ts +77 -15
- package/dist/index.js +50 -13
- package/dist/inheritEnvCapability.d.ts +3 -1
- package/dist/inheritEnvCapability.js +31 -17
- package/dist/inheritEnvWire.d.ts +2 -1
- package/dist/inheritEnvWire.js +11 -5
- package/dist/interactiveHalt.d.ts +3 -1
- package/dist/interactiveHalt.js +2 -0
- package/dist/interactiveInterrupt.d.ts +2 -0
- package/dist/interactiveInterrupt.js +15 -0
- package/dist/interactiveToolsWire.d.ts +4 -2
- package/dist/interactiveToolsWire.js +5 -5
- package/dist/jsonFaithful.d.ts +20 -0
- package/dist/jsonFaithful.js +152 -0
- package/dist/limitsWire.d.ts +7 -2
- package/dist/limitsWire.js +19 -13
- package/dist/liveInitToolFace.d.ts +6 -1
- package/dist/liveInitToolFace.js +5 -3
- package/dist/liveModelCatalog.d.ts +22 -0
- package/dist/liveModelCatalog.js +132 -18
- package/dist/mcpPanel.js +1 -1
- package/dist/mcpProbeCapability.js +2 -2
- package/dist/mcpStatusSupersetKeys.d.ts +24 -0
- package/dist/mcpStatusSupersetKeys.js +45 -0
- package/dist/mcpToolToggles.js +2 -1
- package/dist/mcpWireCaps.d.ts +39 -1
- package/dist/mcpWireCaps.js +254 -50
- package/dist/memoryComplianceCapability.js +2 -2
- package/dist/memoryOriginCapability.js +2 -2
- package/dist/model/catalogDefault.d.ts +24 -0
- package/dist/model/catalogDefault.js +4 -0
- package/dist/model/liveCatalogShape.js +5 -4
- package/dist/model/modelsPolicy.js +4 -3
- package/dist/model/onboardJudgement.d.ts +1 -0
- package/dist/model/onboardJudgement.js +1 -1
- package/dist/model/subagentModelWord.js +2 -2
- package/dist/modelCapabilityProbe.js +6 -6
- package/dist/modelIdentityResolvability.d.ts +10 -1
- package/dist/modelIdentityResolvability.js +62 -39
- package/dist/modsFace.d.ts +8 -0
- package/dist/modsFace.js +59 -0
- package/dist/modsKernelIdentity.d.ts +10 -0
- package/dist/modsKernelIdentity.js +103 -0
- package/dist/modsKernelTransit.d.ts +8 -0
- package/dist/modsKernelTransit.js +6 -0
- package/dist/notifications.d.ts +30 -12
- package/dist/notifications.js +241 -53
- package/dist/outputStyleSeatCapability.js +2 -2
- package/dist/ownKey.d.ts +12 -0
- package/dist/ownKey.js +179 -3
- package/dist/panelReduce.js +1 -1
- package/dist/peerFrames.d.ts +1 -1
- package/dist/peerFrames.js +6 -2
- package/dist/peerLaneCapability.js +2 -2
- package/dist/permissionModesCapability.js +4 -4
- package/dist/permissionRuleIssue.js +2 -0
- package/dist/permissionRulesWriteCapability.js +2 -2
- package/dist/permissionsAllowGrantCapability.js +2 -2
- package/dist/permissionsDeclaration.d.ts +43 -4
- package/dist/permissionsDeclaration.js +102 -35
- package/dist/pluginHooksWire.d.ts +20 -4
- package/dist/pluginHooksWire.js +92 -53
- package/dist/prepareRefusal.d.ts +3 -2
- package/dist/prepareRefusal.js +27 -9
- package/dist/printInitToolFace.js +2 -2
- package/dist/printModelStatus.js +1 -1
- package/dist/printToolResultFrame.js +1 -1
- package/dist/projectMemory.d.ts +32 -0
- package/dist/projectMemory.js +70 -0
- package/dist/promptBlockedCopy.d.ts +2 -1
- package/dist/promptBlockedCopy.js +2 -1
- package/dist/promptDelivery.d.ts +23 -3
- package/dist/promptDelivery.js +169 -30
- package/dist/providerRejection.d.ts +19 -1
- package/dist/providerRejection.js +75 -4
- package/dist/queuedDelivery.d.ts +48 -0
- package/dist/queuedDelivery.js +233 -0
- package/dist/reattachWindow.d.ts +94 -0
- package/dist/reattachWindow.js +127 -0
- package/dist/request/printNotification.d.ts +1 -1
- package/dist/request/printNotification.js +6 -2
- package/dist/request/submissionIdentity.d.ts +37 -0
- package/dist/request/submissionIdentity.js +65 -0
- package/dist/request/taskRequest.d.ts +33 -4
- package/dist/request/taskRequest.js +341 -156
- package/dist/resultFrameKeys.d.ts +1 -0
- package/dist/resultFrameKeys.js +4 -1
- package/dist/retryStatus.d.ts +8 -0
- package/dist/retryStatus.js +57 -9
- package/dist/rewindArchiveCapability.js +2 -2
- package/dist/rewindEngineAction.d.ts +2 -0
- package/dist/rewindEngineAction.js +23 -1
- package/dist/rowKind.d.ts +36 -0
- package/dist/rowKind.js +97 -0
- package/dist/ruleCompileVerdict.d.ts +18 -0
- package/dist/ruleCompileVerdict.js +67 -2
- package/dist/ruleReadings.d.ts +58 -0
- package/dist/ruleReadings.js +132 -0
- package/dist/ruleRefusalSentence.d.ts +4 -0
- package/dist/ruleRefusalSentence.js +9 -3
- package/dist/runCancelContext.d.ts +0 -1
- package/dist/runCancelContext.js +1 -2
- package/dist/runTerminal.d.ts +5 -0
- package/dist/runTerminal.js +52 -17
- package/dist/sandboxWire.d.ts +1 -1
- package/dist/sandboxWire.js +4 -6
- package/dist/scenarioRefusal.js +1 -1
- package/dist/scenarioSkills.d.ts +20 -0
- package/dist/scenarioSkills.js +72 -0
- package/dist/scenarioWire.d.ts +5 -2
- package/dist/scenarioWire.js +9 -9
- package/dist/sealedKeyCapability.js +2 -2
- package/dist/seam.d.ts +2 -0
- package/dist/seam.js +3 -3
- package/dist/seatContract.d.ts +68 -7
- package/dist/seatContract.js +84 -25
- package/dist/selfOrchestrationDenial.js +1 -1
- package/dist/sessionBackground.d.ts +165 -0
- package/dist/sessionBackground.js +781 -0
- package/dist/sessionBackgroundHandoff.d.ts +54 -0
- package/dist/sessionBackgroundHandoff.js +321 -0
- package/dist/sessionMap.js +4 -1
- package/dist/sessionPolicyCapability.js +2 -2
- package/dist/sessionRulesChildrenReadLive.d.ts +6 -0
- package/dist/sessionRulesChildrenReadLive.js +5 -0
- package/dist/sessionRulesNamespaceFormsCapability.d.ts +12 -0
- package/dist/sessionRulesNamespaceFormsCapability.js +29 -0
- package/dist/sessionSyncFileHistoryCapability.js +2 -2
- package/dist/settingsCredentialKeyPaths.js +55 -15
- package/dist/settingsHooksSalvage.d.ts +1 -0
- package/dist/settingsHooksSalvage.js +7 -1
- package/dist/settingsLayerAdmission.d.ts +4 -0
- package/dist/settingsLayerAdmission.js +16 -0
- package/dist/skillToolListsCapability.js +6 -5
- package/dist/skillsWireCaps.d.ts +14 -0
- package/dist/skillsWireCaps.js +47 -16
- package/dist/slashCommandGate.d.ts +24 -0
- package/dist/slashCommandGate.js +74 -0
- package/dist/slashCommandTable.d.ts +14 -0
- package/dist/slashCommandTable.js +99 -0
- package/dist/sqlEngineCapability.js +2 -2
- package/dist/steerPriorityCapability.js +2 -2
- package/dist/storePostureCapability.js +2 -2
- package/dist/subagent/agentStateDetail.js +1 -1
- package/dist/subagent/engineDelegatedPrompt.d.ts +9 -0
- package/dist/subagent/engineDelegatedPrompt.js +38 -7
- package/dist/subagent/engineRowStopGate.js +2 -2
- package/dist/subagent/engineSubagentResume.js +3 -3
- package/dist/subagent/engineTaskHandleWire.d.ts +1 -0
- package/dist/subagent/engineTaskHandleWire.js +10 -0
- package/dist/submitFailure.d.ts +8 -0
- package/dist/submitFailure.js +17 -0
- package/dist/supportFloor.d.ts +1 -0
- package/dist/supportFloor.js +7 -0
- package/dist/terminationIntent.d.ts +55 -0
- package/dist/terminationIntent.js +352 -0
- package/dist/thinkingLatch.d.ts +69 -0
- package/dist/thinkingLatch.js +255 -0
- package/dist/thinkingLatchWords.d.ts +7 -0
- package/dist/thinkingLatchWords.js +4 -0
- package/dist/toolHistoryMismatch.d.ts +8 -0
- package/dist/toolHistoryMismatch.js +37 -6
- package/dist/toolResult.d.ts +13 -3
- package/dist/toolResult.js +159 -32
- package/dist/toolResultContent.d.ts +13 -0
- package/dist/toolResultContent.js +82 -7
- package/dist/toolRoster.d.ts +18 -0
- package/dist/toolRoster.js +64 -0
- package/dist/turnFailurePresentation.js +27 -90
- package/dist/usageLimitAutoResume.d.ts +74 -0
- package/dist/usageLimitAutoResume.js +227 -0
- package/dist/userAttachmentEnvelope.js +1 -1
- package/dist/userAttachmentSeat.js +5 -5
- package/dist/userInvokedSkillsCapability.js +2 -2
- package/dist/webSearchBackendCapability.js +2 -2
- package/dist/wireErrorTriage.js +99 -50
- package/dist/wireFailureShape.d.ts +25 -1
- package/dist/wireFailureShape.js +92 -5
- package/dist/wireRefusalCopy.d.ts +24 -1
- package/dist/wireRefusalCopy.js +253 -32
- package/dist/wiringFleetDoctor.d.ts +3 -0
- package/dist/wiringFleetDoctor.js +21 -0
- package/dist/workflow.d.ts +2 -1
- package/dist/workflow.js +38 -1
- package/dist/workflowClient.d.ts +2 -7
- package/dist/workflowsJournalCapability.js +2 -2
- package/dist/writeProtectionCapability.js +2 -2
- package/docs/INTEGRATION-CLIENTS.md +907 -182
- package/package.json +14 -3
- package/dist/argvFlagValue.d.ts +0 -8
- package/dist/argvFlagValue.js +0 -37
package/dist/adapt/arms.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ccToolDenialKindForToolEnd, gateOutcomeOf } from '../gateOutcome.js';
|
|
|
2
2
|
import { terminalOwnerOf } from '../seam.js';
|
|
3
3
|
import { isSubFlowSegmentEnd, SEGMENT_END_IDENTITY_KEYS, snapshotSegmentIdentity, snapshotIsSubFlow } from '../adapter/types.js';
|
|
4
4
|
import { classifyPeerNotification, renderPeerFrameTranscriptText } from '../peerFrames.js';
|
|
5
|
-
import { dropQueuedNotificationsForRun, isEngineWorkflowNotified, isWorkflowCompletionCardEnqueued, markEngineWorkflowNotified, noteOwnWorkflowRun, normalizeTaskNotification, noteWorkflowCompletionCardEnqueued, renderTaskNotificationXml, taskNotificationDedupKey } from '../notifications.js';
|
|
5
|
+
import { dropQueuedNotificationsForRun, freezeTaskNotificationFields, isEngineWorkflowNotified, isWorkflowCompletionCardEnqueued, markEngineWorkflowNotified, noteOwnWorkflowRun, normalizeTaskNotification, noteWorkflowCompletionCardEnqueued, renderTaskNotificationXml, taskNotificationDedupKey } from '../notifications.js';
|
|
6
6
|
import { retryStatusFromArm } from '../retryStatus.js';
|
|
7
7
|
import { steeringInjectedToAttachments } from '../steering.js';
|
|
8
8
|
import { projectDiagnosticsFrame } from '../diagnostics.js';
|
|
@@ -12,13 +12,15 @@ import { readAsyncLaunchedAgentReceipt } from '../toolResult.js';
|
|
|
12
12
|
import { recordWorkflowAgentTaskId } from '../workflow.js';
|
|
13
13
|
import { isCoreTaskNotificationTerminal, isCoreTaskNotificationTerminalNotSuccess, isCoreTaskProgressTerminal, isCoreTaskProgressTerminalNotSuccess } from '../terminalStatuses.js';
|
|
14
14
|
import { readToolHistoryMismatchKey } from '../toolHistoryMismatch.js';
|
|
15
|
-
import { readProviderRejectionResendKey } from '../providerRejection.js';
|
|
16
|
-
import {
|
|
15
|
+
import { isMintedRowCcError, readProviderRejectionResendKey } from '../providerRejection.js';
|
|
16
|
+
import { rowKindOf } from '../rowKind.js';
|
|
17
|
+
import { terminalCodedDetailOf } from '../runTerminal.js';
|
|
18
|
+
import { contextUsageReadingOf, guardedRead, humanInputAttachmentsOf, ownSnapshotRecord, ownSnapshotWhenTyped, readOwnDataValue, promptManifestIdentityOfFrame, promptManifestSectionViewOf, readFrameStringKey, readFrameTrueMark } from '../ownKey.js';
|
|
17
19
|
import { CORE_USER_ATTACHMENT_LABEL_MAX } from '../generated/engineFactTables.js';
|
|
18
20
|
import { ESCAPE_FACE, paintAndCap, washCredentials } from '../displayUntrusted.js';
|
|
19
21
|
import { resolveEnginePanelTaskId } from '../engineAgentPanelStore.js';
|
|
20
22
|
import { cycleSeqValue } from '../cycleOrder.js';
|
|
21
|
-
import { fleetRowAgentType } from '../fleet/fleetRowAgentType.js';
|
|
23
|
+
import { fleetRowAgentType, recordFleetRowAgentType } from '../fleet/fleetRowAgentType.js';
|
|
22
24
|
import { chrome, mainLane, transcript, messageIdentityOf } from './ids.js';
|
|
23
25
|
import { engineRefOf } from '../engineRowRef.js';
|
|
24
26
|
import { isReplayMarked, RESULT_REPLAYED_TEXT } from '../replayBody.js';
|
|
@@ -50,21 +52,42 @@ function claimParkedCard(m, callId, toolName, deps) {
|
|
|
50
52
|
function laneOfCard(p) {
|
|
51
53
|
return p.parentToolCallId !== undefined && p.parentToolCallId !== '' ? { lane: 'subagent', parentToolCallId: p.parentToolCallId } : mainLane();
|
|
52
54
|
}
|
|
55
|
+
function isMintedSyntheticRow(m) {
|
|
56
|
+
return readFrameTrueMark(m, '_sema_api_error_message');
|
|
57
|
+
}
|
|
53
58
|
function terminalOwnerCarry(m) {
|
|
54
|
-
if (m
|
|
59
|
+
if (!isMintedSyntheticRow(m))
|
|
55
60
|
return {};
|
|
56
61
|
const owner = terminalOwnerOf(m);
|
|
57
62
|
return owner === undefined ? {} : { _sema_terminal_owner: owner };
|
|
58
63
|
}
|
|
64
|
+
function rowKindCarry(m) {
|
|
65
|
+
if (!isMintedSyntheticRow(m))
|
|
66
|
+
return {};
|
|
67
|
+
const kind = rowKindOf(m);
|
|
68
|
+
const code = readFrameStringKey(m, '_sema_api_error_code');
|
|
69
|
+
const err = guardedRead(() => readOwnDataValue(m, 'error'));
|
|
70
|
+
return {
|
|
71
|
+
...(kind !== undefined ? { _sema_row_kind: kind } : {}),
|
|
72
|
+
...(code !== undefined ? { _sema_api_error_code: code } : {}),
|
|
73
|
+
...(isMintedRowCcError(err) ? { error: err } : {}),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function codedDetailCarry(m, relayedRowKind) {
|
|
77
|
+
if (!isMintedSyntheticRow(m) || relayedRowKind !== 'api_error')
|
|
78
|
+
return {};
|
|
79
|
+
const body = terminalCodedDetailOf(m);
|
|
80
|
+
return body === undefined ? {} : { _sema_coded_detail: body };
|
|
81
|
+
}
|
|
59
82
|
function toolHistoryKeyCarry(m) {
|
|
60
|
-
if (m
|
|
83
|
+
if (!isMintedSyntheticRow(m))
|
|
61
84
|
return {};
|
|
62
85
|
const raw = m._sema_tool_history_mismatch;
|
|
63
86
|
const key = readToolHistoryMismatchKey(typeof raw === 'object' && raw !== null ? raw : undefined);
|
|
64
87
|
return key === undefined ? {} : { _sema_tool_history_mismatch: key };
|
|
65
88
|
}
|
|
66
89
|
function providerResendKeyCarry(m) {
|
|
67
|
-
if (m
|
|
90
|
+
if (!isMintedSyntheticRow(m))
|
|
68
91
|
return {};
|
|
69
92
|
const raw = m._sema_provider_rejection_resend;
|
|
70
93
|
const key = readProviderRejectionResendKey(typeof raw === 'object' && raw !== null ? raw : undefined);
|
|
@@ -178,7 +201,8 @@ const assistantArm = function* (m, deps) {
|
|
|
178
201
|
if (textBlock && typeof textBlock.text === 'string' && textBlock.text.length > 0)
|
|
179
202
|
text.anchorWindow(m);
|
|
180
203
|
if (textBlock && typeof textBlock.text === 'string' && textBlock.text.length > 0) {
|
|
181
|
-
const rowText = m
|
|
204
|
+
const rowText = isMintedSyntheticRow(m) ? washCredentials(textBlock.text) : textBlock.text;
|
|
205
|
+
const relayedKind = rowKindCarry(m);
|
|
182
206
|
text.appendAnswer(rowText);
|
|
183
207
|
text.beginAssistantMessage();
|
|
184
208
|
yield* text.takeThinking();
|
|
@@ -188,10 +212,12 @@ const assistantArm = function* (m, deps) {
|
|
|
188
212
|
uuid: idOf(m),
|
|
189
213
|
session_id: ctx.sessionId,
|
|
190
214
|
parent_tool_use_id: null,
|
|
191
|
-
...(m
|
|
215
|
+
...(isMintedSyntheticRow(m) ? { _sema_api_error_message: true } : {}),
|
|
192
216
|
...toolHistoryKeyCarry(m),
|
|
193
217
|
...providerResendKeyCarry(m),
|
|
194
218
|
...terminalOwnerCarry(m),
|
|
219
|
+
...relayedKind,
|
|
220
|
+
...codedDetailCarry(m, relayedKind._sema_row_kind),
|
|
195
221
|
}, ctx.now());
|
|
196
222
|
text.markEmittedText(rowText);
|
|
197
223
|
}
|
|
@@ -507,6 +533,8 @@ const taskStartedArm = function* (m) {
|
|
|
507
533
|
const agentType = str(m.agentType);
|
|
508
534
|
const startedAt = num(m.startedAt);
|
|
509
535
|
const eventId = str(idSnap.eventId);
|
|
536
|
+
if (agentType !== undefined && workflowRunId === undefined)
|
|
537
|
+
recordFleetRowAgentType(taskId, agentType);
|
|
510
538
|
yield chrome({
|
|
511
539
|
kind: 'subagent_started',
|
|
512
540
|
laneProof,
|
|
@@ -639,8 +667,9 @@ const toolEndResultArm = function* (m, deps) {
|
|
|
639
667
|
const { idOf, cards, panel, ctx, inst, pass } = deps;
|
|
640
668
|
const callId = typeof m.toolCallId === 'string' ? m.toolCallId : undefined;
|
|
641
669
|
recordEngineToolLabel(callId, m.label);
|
|
670
|
+
const structured = ownSnapshotWhenTyped(m.structured, 'task-output');
|
|
642
671
|
if (callId !== undefined) {
|
|
643
|
-
const launched = readAsyncLaunchedAgentReceipt(
|
|
672
|
+
const launched = readAsyncLaunchedAgentReceipt(structured);
|
|
644
673
|
if (launched !== null)
|
|
645
674
|
registerSubagentContentAlias(callId, launched.taskId);
|
|
646
675
|
}
|
|
@@ -665,7 +694,6 @@ const toolEndResultArm = function* (m, deps) {
|
|
|
665
694
|
}
|
|
666
695
|
if (p === undefined || callId === undefined)
|
|
667
696
|
return;
|
|
668
|
-
const structured = m.structured;
|
|
669
697
|
const closeEventIdRaw = m.eventId;
|
|
670
698
|
const closeParentRaw = m.parentToolCallId;
|
|
671
699
|
const closeEventId = typeof closeEventIdRaw === 'string' ? closeEventIdRaw : undefined;
|
|
@@ -781,7 +809,7 @@ const taskProgressArm = function* (m, { ctx, cards, panel, inst }) {
|
|
|
781
809
|
: undefined;
|
|
782
810
|
const identity = resolveEnginePanelTaskId(taskId);
|
|
783
811
|
if (!panel.isLive(taskId)) {
|
|
784
|
-
yield* panel.start(taskId, fleetRowAgentType(identity.taskId));
|
|
812
|
+
yield* panel.start(taskId, fleetRowAgentType(taskId) ?? fleetRowAgentType(identity.taskId));
|
|
785
813
|
}
|
|
786
814
|
panel.noteResidency(taskId, identity.taskId);
|
|
787
815
|
panel.markLive(taskId);
|
|
@@ -914,7 +942,7 @@ const resultArm = function* (m, { ctx, idOf, text, cards, panel, flags }) {
|
|
|
914
942
|
yield chrome({ kind: 'result_replayed', laneProof: mainLane(), text: RESULT_REPLAYED_TEXT });
|
|
915
943
|
};
|
|
916
944
|
const taskNotificationArm = function* (m, { ctx, idOf, panel, inst }) {
|
|
917
|
-
const n = (m
|
|
945
|
+
const n = ownSnapshotRecord(guardedRead(() => readOwnDataValue(m, 'notification'))) ?? {};
|
|
918
946
|
const fields = normalizeTaskNotification(n);
|
|
919
947
|
if (fields === null)
|
|
920
948
|
return;
|
|
@@ -961,6 +989,7 @@ const taskNotificationArm = function* (m, { ctx, idOf, panel, inst }) {
|
|
|
961
989
|
return;
|
|
962
990
|
if (peerFrame === null && n.task_type !== 'external')
|
|
963
991
|
markEngineWorkflowNotified(taskId);
|
|
992
|
+
const fact = peerFrame === null ? freezeTaskNotificationFields(fields) : undefined;
|
|
964
993
|
yield transcript({
|
|
965
994
|
type: 'user',
|
|
966
995
|
message: {
|
|
@@ -968,15 +997,19 @@ const taskNotificationArm = function* (m, { ctx, idOf, panel, inst }) {
|
|
|
968
997
|
content: [
|
|
969
998
|
{
|
|
970
999
|
type: 'text',
|
|
971
|
-
text: peerFrame !== null ? renderPeerFrameTranscriptText(peerFrame) : renderTaskNotificationXml(fields),
|
|
1000
|
+
text: peerFrame !== null ? renderPeerFrameTranscriptText(peerFrame) : renderTaskNotificationXml(fact ?? fields),
|
|
972
1001
|
},
|
|
973
1002
|
],
|
|
974
1003
|
},
|
|
975
1004
|
uuid: idOf(m),
|
|
976
1005
|
session_id: ctx.sessionId,
|
|
1006
|
+
...(fact !== undefined ? { _sema_task_notification: fact } : {}),
|
|
977
1007
|
}, ctx.now());
|
|
978
1008
|
};
|
|
979
|
-
const workflowCompleteArm = function* (
|
|
1009
|
+
const workflowCompleteArm = function* (frame) {
|
|
1010
|
+
const m = ownSnapshotRecord(frame);
|
|
1011
|
+
if (m === undefined)
|
|
1012
|
+
return;
|
|
980
1013
|
const runId = typeof m.runId === 'string' ? m.runId : undefined;
|
|
981
1014
|
if (runId === undefined)
|
|
982
1015
|
return;
|
|
@@ -986,13 +1019,15 @@ const workflowCompleteArm = function* (m) {
|
|
|
986
1019
|
const wfStatus = m.status === 'failed' ? 'failed' : 'completed';
|
|
987
1020
|
const wfSummary = typeof m.summary === 'string' ? m.summary : '';
|
|
988
1021
|
noteWorkflowCompletionCardEnqueued(runId);
|
|
1022
|
+
const notification = freezeTaskNotificationFields({ taskId: runId, taskType: 'workflow', status: wfStatus, summary: wfSummary });
|
|
989
1023
|
yield chrome({
|
|
990
1024
|
kind: 'workflow_notification_enqueue',
|
|
991
1025
|
laneProof: mainLane(),
|
|
992
1026
|
runId,
|
|
993
1027
|
status: wfStatus,
|
|
994
1028
|
summary: wfSummary,
|
|
995
|
-
message: renderTaskNotificationXml(
|
|
1029
|
+
message: renderTaskNotificationXml(notification),
|
|
1030
|
+
notification,
|
|
996
1031
|
});
|
|
997
1032
|
};
|
|
998
1033
|
const retryStatusArm = function* (m, { ctx, flags }) {
|
package/dist/adapt/textStream.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { chrome, mainLane, segmentRowId, transcript, messageIdentityOf } from './ids.js';
|
|
2
2
|
import { estimateCjkTokens, FLUSH_INTERVAL_MS } from './wireShapes.js';
|
|
3
3
|
import { resolveTextSegmentAuthority } from './textSegmentAuthority.js';
|
|
4
|
+
import { carriesAnswerText } from '../ownKey.js';
|
|
4
5
|
export const SEMA_SEGMENT_ID_KEY = '_sema_segment_id';
|
|
5
6
|
const SENTENCE_END_CHARS = new Set(['。', '!', '?', '…', '.', '!', '?']);
|
|
6
7
|
const SENTENCE_CLOSING_CHARS = new Set([
|
|
@@ -167,6 +168,8 @@ export function createTextStream(ctx, idOf) {
|
|
|
167
168
|
}
|
|
168
169
|
return {
|
|
169
170
|
*feedText(delta, frame) {
|
|
171
|
+
if (delta.length === 0 && segmentWindowCloseArmed && previousSegmentCommitted + segmentCommitted !== '')
|
|
172
|
+
return;
|
|
170
173
|
consumeArmedClose();
|
|
171
174
|
if (thinking.length > 0 || thinkingPending.length > 0) {
|
|
172
175
|
yield* drainLive();
|
|
@@ -251,11 +254,11 @@ export function createTextStream(ctx, idOf) {
|
|
|
251
254
|
committedText = txt;
|
|
252
255
|
currentTouched = true;
|
|
253
256
|
}
|
|
254
|
-
if (txt
|
|
257
|
+
if (carriesAnswerText(txt))
|
|
255
258
|
lastNonEmpty = txt;
|
|
256
259
|
}
|
|
257
260
|
if (!currentTouched && committedText.length > 0) { }
|
|
258
|
-
if (committedText
|
|
261
|
+
if (!carriesAnswerText(committedText) && lastNonEmpty.length > 0)
|
|
259
262
|
previousCommittedText = lastNonEmpty;
|
|
260
263
|
booksSynced = true;
|
|
261
264
|
}
|
|
@@ -413,7 +416,7 @@ export function createTextStream(ctx, idOf) {
|
|
|
413
416
|
},
|
|
414
417
|
beginAssistantMessage: () => {
|
|
415
418
|
messageSerial += 1;
|
|
416
|
-
if (committedText
|
|
419
|
+
if (carriesAnswerText(committedText))
|
|
417
420
|
previousCommittedText = committedText;
|
|
418
421
|
committedText = '';
|
|
419
422
|
previousSegmentCommitted += segmentCommitted;
|
|
@@ -426,7 +429,7 @@ export function createTextStream(ctx, idOf) {
|
|
|
426
429
|
return committedText;
|
|
427
430
|
},
|
|
428
431
|
get lastCommittedAnswerText() {
|
|
429
|
-
return committedText
|
|
432
|
+
return carriesAnswerText(committedText) ? committedText : previousCommittedText;
|
|
430
433
|
},
|
|
431
434
|
get emittedAssistantText() {
|
|
432
435
|
return emittedAssistantText;
|
|
@@ -37,8 +37,9 @@ export interface ToolResultRowFlagParts {
|
|
|
37
37
|
readonly _sema_interrupted_never_started?: true;
|
|
38
38
|
readonly _sema_approval_window_expired?: true;
|
|
39
39
|
readonly _sema_denial_limit_window_expired?: true;
|
|
40
|
+
readonly _sema_answered_by?: string;
|
|
40
41
|
}
|
|
41
|
-
export declare function toolResultRowFlagParts(arm: object | null | undefined): ToolResultRowFlagParts;
|
|
42
|
+
export declare function toolResultRowFlagParts(arm: object | null | undefined, gate: GateOutcomeView | undefined): ToolResultRowFlagParts;
|
|
42
43
|
interface ToolEndPayload {
|
|
43
44
|
output?: unknown;
|
|
44
45
|
structured?: unknown;
|
package/dist/adapt/toolCards.js
CHANGED
|
@@ -5,8 +5,8 @@ import { flattenWireOutput } from './wireShapes.js';
|
|
|
5
5
|
import { toolResultBlocksOf } from '../toolResultContent.js';
|
|
6
6
|
import { bashExitOf, bashExitReadingFailed } from '../bashExitReading.js';
|
|
7
7
|
import { isCcToolDenialKind } from '../gateVocabulary.js';
|
|
8
|
-
import { guardedRead, readFrameStringKey, readFrameTrueMark } from '../ownKey.js';
|
|
9
|
-
import {
|
|
8
|
+
import { guardedRead, ownSnapshotWhenTyped, readFrameStringKey, readFrameTrueMark, readOwnDataValue } from '../ownKey.js';
|
|
9
|
+
import { gateDeniedBy, isApprovalWindowExpiredGate, isDeniedGate, isDenialLimitAutoDeniedGate } from '../gateOutcome.js';
|
|
10
10
|
import { TOOL_END_INTERRUPTED_NEVER_STARTED } from '../engineErrorCodes.js';
|
|
11
11
|
function toolUseResultParts(v) {
|
|
12
12
|
return v !== undefined ? { tool_use_result: v } : {};
|
|
@@ -14,18 +14,19 @@ function toolUseResultParts(v) {
|
|
|
14
14
|
export function toolResultOutcomeOf(toolName, end, rawInput, owner, ledgerTier, killCauseOf) {
|
|
15
15
|
const isError = end?.isError ?? false;
|
|
16
16
|
const leaderLedger = owner === 'leader';
|
|
17
|
+
const structured = ownSnapshotWhenTyped(end?.structured, 'task-output');
|
|
17
18
|
const body = end && end.output !== undefined
|
|
18
|
-
? wireOutputToBody(toolName, end.output, isError, end.truncated === true, flattenWireOutput,
|
|
19
|
+
? wireOutputToBody(toolName, end.output, isError, end.truncated === true, flattenWireOutput, structured, leaderLedger, killCauseOf)
|
|
19
20
|
: degradedToolResultBody(isError);
|
|
20
|
-
let rich =
|
|
21
|
-
? structuredToToolUseResult(
|
|
21
|
+
let rich = structured !== undefined
|
|
22
|
+
? structuredToToolUseResult(structured, end?.output !== undefined ? flattenWireOutput(end.output) : undefined, leaderLedger)
|
|
22
23
|
: null;
|
|
23
24
|
if (rich === null && ledgerTier !== undefined)
|
|
24
25
|
rich = ledgerTier(isError);
|
|
25
26
|
if (rich === null && !isError && toolName === 'ReportFindings') {
|
|
26
|
-
rich = reportFindingsToolUseResult(
|
|
27
|
+
rich = reportFindingsToolUseResult(structured, rawInput);
|
|
27
28
|
}
|
|
28
|
-
const failed = body.isError || rich?.isError === true || bashExitReadingFailed(bashExitOf(
|
|
29
|
+
const failed = body.isError || rich?.isError === true || bashExitReadingFailed(bashExitOf(structured, () => null));
|
|
29
30
|
const settled = failed && !body.isError ? { ...body, isError: true } : body;
|
|
30
31
|
return { body: withContentBlocks(settled, end), rich };
|
|
31
32
|
}
|
|
@@ -52,18 +53,32 @@ export function toolResultRowIdentity(sources, toolCallId, ctx) {
|
|
|
52
53
|
}
|
|
53
54
|
return { uuid: deriveTranscriptId({ toolCallId }, ctx) };
|
|
54
55
|
}
|
|
55
|
-
export function toolResultRowFlagParts(arm) {
|
|
56
|
+
export function toolResultRowFlagParts(arm, gate) {
|
|
56
57
|
if (arm === null || arm === undefined)
|
|
57
58
|
return {};
|
|
58
|
-
const
|
|
59
|
+
const notExecuted = readFrameTrueMark(arm, 'notExecuted');
|
|
60
|
+
const answeredBy = modAnsweredByOf(arm, notExecuted, gate);
|
|
59
61
|
return {
|
|
60
|
-
...(
|
|
62
|
+
...(notExecuted ? { _sema_not_executed: true } : {}),
|
|
61
63
|
...(readFrameTrueMark(arm, '_sema_collateral_abort') ? { _sema_collateral_abort: true } : {}),
|
|
62
64
|
...(readFrameStringKey(arm, 'errorCode') === TOOL_END_INTERRUPTED_NEVER_STARTED ? { _sema_interrupted_never_started: true } : {}),
|
|
63
65
|
...(isApprovalWindowExpiredGate(gate) ? { _sema_approval_window_expired: true } : {}),
|
|
64
66
|
...(isDenialLimitAutoDeniedGate(gate) ? { _sema_denial_limit_window_expired: true } : {}),
|
|
67
|
+
...(answeredBy !== undefined ? { _sema_answered_by: answeredBy } : {}),
|
|
65
68
|
};
|
|
66
69
|
}
|
|
70
|
+
const MOD_ENGINE_ORIGIN = 'engine';
|
|
71
|
+
function modAnsweredByOf(arm, notExecuted, gate) {
|
|
72
|
+
const by = readFrameStringKey(arm, 'answeredBy');
|
|
73
|
+
if (by === undefined || by === MOD_ENGINE_ORIGIN || !notExecuted)
|
|
74
|
+
return undefined;
|
|
75
|
+
if (gate !== undefined && gate.unreadable !== undefined && gate.unreadable.length > 0)
|
|
76
|
+
return undefined;
|
|
77
|
+
const isErrorRaw = guardedRead(() => readOwnDataValue(arm, 'isError'));
|
|
78
|
+
if (isDeniedGate(gate))
|
|
79
|
+
return gateDeniedBy(gate) === 'hook' && isErrorRaw === true ? by : undefined;
|
|
80
|
+
return isErrorRaw === false ? by : undefined;
|
|
81
|
+
}
|
|
67
82
|
export function createToolCardLedger(ctx, idOf) {
|
|
68
83
|
const pending = new Map();
|
|
69
84
|
let assistantResponseId = null;
|
|
@@ -73,8 +88,8 @@ export function createToolCardLedger(ctx, idOf) {
|
|
|
73
88
|
const parentToolCallId = end?.parentToolCallId ?? p.parentToolCallId;
|
|
74
89
|
if ((p.name === 'Bash' || p.name === 'Monitor') && !isError) {
|
|
75
90
|
const outputText = end?.output !== undefined ? flattenWireOutput(end.output) : undefined;
|
|
76
|
-
const reg = detectEngineBgShellDetach(p.name, p.rawInput, end?.structured, outputText) ??
|
|
77
|
-
detectEngineBgShellReceipt(p.name, p.rawInput, outputText, end?.structured);
|
|
91
|
+
const reg = detectEngineBgShellDetach(p.name, p.rawInput, end?.structured, outputText, p.id) ??
|
|
92
|
+
detectEngineBgShellReceipt(p.name, p.rawInput, outputText, end?.structured, p.id);
|
|
78
93
|
if (reg !== null) {
|
|
79
94
|
yield chrome({ kind: 'bgshell_register', laneProof: parentToolCallId === undefined ? mainLane() : { lane: 'subagent', parentToolCallId }, taskId: reg.taskId, registration: reg });
|
|
80
95
|
}
|
|
@@ -109,7 +124,7 @@ export function createToolCardLedger(ctx, idOf) {
|
|
|
109
124
|
...toolResultEnvelopeParts(outcome),
|
|
110
125
|
...(isCcToolDenialKind(end?.denialKind) ? { _sema_denial_kind: end.denialKind } : {}),
|
|
111
126
|
...(end?.gate !== undefined ? { _sema_gate: end.gate } : {}),
|
|
112
|
-
...toolResultRowFlagParts(end?.closeArm),
|
|
127
|
+
...toolResultRowFlagParts(end?.closeArm, end?.gate),
|
|
113
128
|
}, ctx.now());
|
|
114
129
|
}
|
|
115
130
|
function* closeCard(p, end) {
|
package/dist/adapt.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare const ADAPTER_COVERAGE: {
|
|
|
13
13
|
readonly transcriptKinds: readonly ["assistant_text", "assistant_thinking", "assistant_tool_use", "user_tool_result_decision", "user_task_notification", "system_passthrough"];
|
|
14
14
|
readonly b3: readonly ["T38 三清第三清 + T57 第五处断闸:prompt_suggestions(turn 开场作废 + 子流断闸)", "T40 IDLE-FLUSH 1.5s 竞速(需 ctx.setTimer;缺席=不启用)", "T58 手动 iterator 的 finally cleanup(early break/throw 都要关上游生成器)", "T59 abort 半场(ctx.signal;中断后不产终答)", "T60 无 result 收尾腿(泄尾增量 → 清 liveness → 尾思考 → 尾文本段)"];
|
|
15
15
|
readonly b4: readonly ["A 层第 14 臂 task_progress:workflow lane 三级门 + 判据④ belt 回植 + C1 alias + bindTaskCard(显式父/FIFO/含糊即 unbound)+ inline stats + T50 双形读 + SubagentStart + #6 resident 台账 + 面板 tick", "settlePanelTasks 三处 sweep 全接线(tool_end 显式关卡带报告 / result 防御 sweep / turn 末 + abort sweep)", "P0-2 tool label 侧信道(sanitizeToolUseBlock 摘 label + engineToolLabelStore 登记;0.5.0 真缺口,label 会随 tool_use block 落转录 → /compact 直发 provider 400)", "task_notification 的两件宿主义务收回库内自持:dropQueuedNotificationsForRun + clearEnginePanelTaskResident;stop hook 的 if-started 门由库解", "T8 flattenWireOutput 提为独立导出(A 层 settle 报告与 B 层卡体同一份)"];
|
|
16
|
-
readonly b5: readonly ["B 层 structuredToToolUseResult 14 case(ask-user-question/bash/edit/create/update/text/grep/glob/notebook-edit/cron-create/cron-delete/cron-list/agent/task-output)+ workflow-run 登记副作用", "D 层 wireOutputToBody 3 臂(bash / taskoutput / 泛化);structured 白名单在场时 T11+T14 正则退位,缺席保回落", "E 层 4
|
|
16
|
+
readonly b5: readonly ["B 层 structuredToToolUseResult 14 case(ask-user-question/bash/edit/create/update/text/grep/glob/notebook-edit/cron-create/cron-delete/cron-list/agent/task-output)+ workflow-run 登记副作用", "D 层 wireOutputToBody 3 臂(bash / taskoutput / 泛化);structured 白名单在场时 T11+T14 正则退位,缺席保回落", "E 层 4 臂:bg Bash 回执 + Monitor 回执(同臂按工具名分,registration.source 判别;判定在库→chrome bgshell_register)+ CC-331 交出后台的 Bash(结构化 detached 位同形登记,一张卡至多一条;结构化位自述登记失败时两臂都不铸)· TodoWrite oldTodos 富卡 · ReportFindings 按名认领 · Remember→memory_saved 系统消息", "tool_end_result → user tool_result 正常路径(卡本体);result 与 turn 末两处开卡兜底关闭(abort 不兜底,cli 同)", "task/task-list structured → chrome task_ledger_sync{source:\"structured\"}(判定归一在库、落盘留宿主)", "T7 诚实缺席(§8-4:不搬 mock 合成器,改 degraded 标记)· T20 diff hunks 进包(src/diff/patch.ts)"];
|
|
17
17
|
readonly todo: readonly ["T13 的 **D 层** 半场(taskoutput block content)未随 structured 退位:退位会改 block content 形状(cli 那里是裸对象 = 件1 隐患),属行为面改动,无真实需求驱动 ⇒ 见 DIVERGENCE-8", "macrotask 让渡(cli 在提交前让出宏任务给 Ink;宿主渲染策略,不进库)"];
|
|
18
18
|
};
|
|
19
19
|
export declare const ADAPTER_DIVERGENCES: readonly [string, string, string, string, string, string, string, string, string, string, string, string];
|
package/dist/adapt.js
CHANGED
|
@@ -8,6 +8,7 @@ import { createPanelTaskLedger } from './adapt/panelTasks.js';
|
|
|
8
8
|
import { createAdapterInstanceLedger } from './adapt/instanceLedger.js';
|
|
9
9
|
import { createTurnFlags } from './adapt/turnFlags.js';
|
|
10
10
|
import { ARMS } from './adapt/arms.js';
|
|
11
|
+
import { guardedRead, ownSnapshotTyped, readOwnDataNonEmptyString } from './ownKey.js';
|
|
11
12
|
export const ADAPTER_COVERAGE = {
|
|
12
13
|
frames: [
|
|
13
14
|
'assistant',
|
|
@@ -55,7 +56,7 @@ export const ADAPTER_COVERAGE = {
|
|
|
55
56
|
b5: [
|
|
56
57
|
'B 层 structuredToToolUseResult 14 case(ask-user-question/bash/edit/create/update/text/grep/glob/notebook-edit/cron-create/cron-delete/cron-list/agent/task-output)+ workflow-run 登记副作用',
|
|
57
58
|
'D 层 wireOutputToBody 3 臂(bash / taskoutput / 泛化);structured 白名单在场时 T11+T14 正则退位,缺席保回落',
|
|
58
|
-
'E 层 4
|
|
59
|
+
'E 层 4 臂:bg Bash 回执 + Monitor 回执(同臂按工具名分,registration.source 判别;判定在库→chrome bgshell_register)+ CC-331 交出后台的 Bash(结构化 detached 位同形登记,一张卡至多一条;结构化位自述登记失败时两臂都不铸)· TodoWrite oldTodos 富卡 · ReportFindings 按名认领 · Remember→memory_saved 系统消息',
|
|
59
60
|
'tool_end_result → user tool_result 正常路径(卡本体);result 与 turn 末两处开卡兜底关闭(abort 不兜底,cli 同)',
|
|
60
61
|
'task/task-list structured → chrome task_ledger_sync{source:"structured"}(判定归一在库、落盘留宿主)',
|
|
61
62
|
'T7 诚实缺席(§8-4:不搬 mock 合成器,改 degraded 标记)· T20 diff hunks 进包(src/diff/patch.ts)',
|
|
@@ -221,9 +222,14 @@ class WireToCcAdapterImpl {
|
|
|
221
222
|
const rawFrame = step.value;
|
|
222
223
|
if (ctx.signal?.aborted)
|
|
223
224
|
break;
|
|
224
|
-
|
|
225
|
+
let m = rawFrame;
|
|
225
226
|
if (m === null || typeof m !== 'object')
|
|
226
227
|
continue;
|
|
228
|
+
{
|
|
229
|
+
const noticeWord = guardedRead(() => readOwnDataNonEmptyString(m, 'type'));
|
|
230
|
+
if (noticeWord === 'task_notification' || noticeWord === 'workflow_complete')
|
|
231
|
+
m = ownSnapshotTyped(m) ?? {};
|
|
232
|
+
}
|
|
227
233
|
yield* flags.onFrameBeforeDispatch(m);
|
|
228
234
|
if (m.type !== 'stream_event')
|
|
229
235
|
yield* text.drainLive();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { UiLanguage } from '../env/uiLanguage.js';
|
|
2
2
|
import type { ActiveRunBusySignal } from './runStream.js';
|
|
3
|
+
import type { RejectedSubmissionOrigin } from '../request/submissionIdentity.js';
|
|
3
4
|
import type { PlanReviewReopenTrigger } from '../hitl/planReviewWire.js';
|
|
5
|
+
import { type AskParkAutoReopenBlock } from '../hitl/askParkAutoReopenBlock.js';
|
|
4
6
|
import { atMostOnceFailureClass } from '../atMostOnce.js';
|
|
5
7
|
export declare const PLAN_REVIEW_GATE_KIND = "plan_review";
|
|
6
8
|
export type DurableDecideLeg = 'approval' | 'plan_review' | 'other_gate' | 'unreadable' | 'absent';
|
|
@@ -41,6 +43,7 @@ export type ReopenCardVerdict = {
|
|
|
41
43
|
_sema_noPresentationSurface?: true;
|
|
42
44
|
_sema_errorCode?: string;
|
|
43
45
|
_sema_reopenRefusal?: PlanReviewReopenRefusal;
|
|
46
|
+
_sema_policyBlocked?: AskParkAutoReopenBlock;
|
|
44
47
|
} | {
|
|
45
48
|
reopened: true;
|
|
46
49
|
firstSight: boolean;
|
|
@@ -60,6 +63,11 @@ export interface StaleParkChoiceRequest {
|
|
|
60
63
|
status: string;
|
|
61
64
|
canCancel: boolean;
|
|
62
65
|
}
|
|
66
|
+
export interface InterruptedSettleWindow {
|
|
67
|
+
budgetMs?: number;
|
|
68
|
+
intervalMs?: number;
|
|
69
|
+
now?: () => number;
|
|
70
|
+
}
|
|
63
71
|
export interface ActiveRunSelfHealDeps {
|
|
64
72
|
hasPendingDecision?: () => boolean;
|
|
65
73
|
listOwnedPendingApprovals?: (opts?: {
|
|
@@ -68,7 +76,9 @@ export interface ActiveRunSelfHealDeps {
|
|
|
68
76
|
reopenPlanReview?: (taskId: string, opts?: {
|
|
69
77
|
trigger?: PlanReviewReopenTrigger;
|
|
70
78
|
}) => ReopenCardVerdict | Promise<ReopenCardVerdict>;
|
|
71
|
-
reopenAskPark?: (taskId: string
|
|
79
|
+
reopenAskPark?: (taskId: string, opts?: {
|
|
80
|
+
trigger?: PlanReviewReopenTrigger;
|
|
81
|
+
}) => Promise<ReopenCardVerdict>;
|
|
72
82
|
offerRunningChoice?: (req: RunningChoiceRequest) => Promise<'steer' | 'cancel' | 'wait' | 'attach'>;
|
|
73
83
|
canAttachRunning?: boolean;
|
|
74
84
|
offerStaleParkChoice?: (req: StaleParkChoiceRequest) => Promise<'cancel' | 'wait'>;
|
|
@@ -77,6 +87,8 @@ export interface ActiveRunSelfHealDeps {
|
|
|
77
87
|
cancelReleaseWaitMs?: number;
|
|
78
88
|
submissionOrigin?: RejectedSubmissionOrigin;
|
|
79
89
|
sessionId?: string;
|
|
90
|
+
wasRecentlyTerminatedByUs?: (taskId: string) => boolean;
|
|
91
|
+
interruptedSettle?: InterruptedSettleWindow;
|
|
80
92
|
}
|
|
81
93
|
export type SelfHealOutcome = {
|
|
82
94
|
kind: 'ask-reopened';
|
|
@@ -98,6 +110,7 @@ export type SelfHealOutcome = {
|
|
|
98
110
|
dismissedByUser?: true;
|
|
99
111
|
noPresentationSurface?: true;
|
|
100
112
|
errorCode?: string;
|
|
113
|
+
reopenRefusal?: PlanReviewReopenRefusal;
|
|
101
114
|
} | {
|
|
102
115
|
kind: 'not-parked';
|
|
103
116
|
taskId: string;
|
|
@@ -111,6 +124,14 @@ export type SelfHealOutcome = {
|
|
|
111
124
|
kind: 'running-settled';
|
|
112
125
|
taskId: string;
|
|
113
126
|
status: string;
|
|
127
|
+
} | {
|
|
128
|
+
kind: 'interrupted-settled';
|
|
129
|
+
taskId: string;
|
|
130
|
+
status: string;
|
|
131
|
+
} | {
|
|
132
|
+
kind: 'interrupted-still-finishing';
|
|
133
|
+
taskId: string;
|
|
134
|
+
waitedMs: number;
|
|
114
135
|
} | {
|
|
115
136
|
kind: 'state-unknown';
|
|
116
137
|
taskId: string | null;
|
|
@@ -123,6 +144,7 @@ export type SelfHealOutcome = {
|
|
|
123
144
|
pendingRowGone?: true;
|
|
124
145
|
noPresentationSurface?: true;
|
|
125
146
|
errorCode?: string;
|
|
147
|
+
policyBlocked?: AskParkAutoReopenBlock;
|
|
126
148
|
} | {
|
|
127
149
|
kind: 'ask-decided-without-card';
|
|
128
150
|
taskId: string;
|
|
@@ -191,7 +213,7 @@ export type SelfHealOutcome = {
|
|
|
191
213
|
status: string;
|
|
192
214
|
alreadyOffered?: true;
|
|
193
215
|
};
|
|
194
|
-
export type RejectedSubmissionOrigin
|
|
216
|
+
export type { RejectedSubmissionOrigin };
|
|
195
217
|
export type SelfHealSubmissionDisposition = 'held-for-decision' | 'resending' | 'handed-off' | 'not-delivered';
|
|
196
218
|
export declare function selfHealSubmissionDisposition(outcome: SelfHealOutcome): SelfHealSubmissionDisposition;
|
|
197
219
|
export type SteerFollowIntent = {
|