@sema-agent/client-core 0.97.1 → 0.99.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 +607 -0
- package/README.md +96 -46
- package/dist/adapt/arms.d.ts +1 -0
- package/dist/adapt/arms.js +188 -53
- package/dist/adapt/ids.d.ts +12 -1
- package/dist/adapt/ids.js +59 -8
- package/dist/adapt/instanceLedger.d.ts +50 -0
- package/dist/adapt/instanceLedger.js +147 -0
- package/dist/adapt/panelTasks.d.ts +1 -1
- package/dist/adapt/panelTasks.js +2 -2
- package/dist/adapt/textStream.d.ts +1 -0
- package/dist/adapt/textStream.js +24 -7
- package/dist/adapt/toolCards.d.ts +27 -5
- package/dist/adapt/toolCards.js +39 -6
- package/dist/adapt/wireShapes.js +6 -2
- package/dist/adapt.d.ts +2 -0
- package/dist/adapt.js +8 -3
- package/dist/adapter/activeRunSelfHeal.d.ts +9 -3
- package/dist/adapter/activeRunSelfHeal.js +205 -313
- package/dist/adapter/downstream/eventToSdkMessage.d.ts +2 -5
- package/dist/adapter/downstream/eventToSdkMessage.js +77 -36
- package/dist/adapter/downstream/terminalToSdkResult.js +11 -4
- package/dist/adapter/downstream/turnUsageToModelUsage.d.ts +5 -2
- package/dist/adapter/downstream/turnUsageToModelUsage.js +2 -0
- package/dist/adapter/runStream.js +79 -48
- package/dist/adapter/types.d.ts +4 -4
- package/dist/adapter/types.js +2 -1
- package/dist/agentSession/backgroundView.js +2 -1
- package/dist/agentSession/engineAgentRegistryRead.d.ts +2 -2
- package/dist/agentSession/engineAgentRegistryRead.js +12 -13
- package/dist/agentSession/engineSessionBackgroundStop.js +16 -8
- package/dist/agentsWireCaps.d.ts +8 -11
- package/dist/agentsWireCaps.js +196 -194
- package/dist/approvalDecidedByCapability.d.ts +0 -4
- package/dist/approvalDecidedByCapability.js +0 -6
- package/dist/approvalsStreamLiveCapability.d.ts +0 -4
- package/dist/approvalsStreamLiveCapability.js +0 -6
- package/dist/assistantInbox.d.ts +34 -0
- package/dist/assistantInbox.js +118 -0
- package/dist/centerWiringCapability.js +9 -1
- package/dist/clientSlice.d.ts +0 -9
- package/dist/clientSlice.js +0 -3
- package/dist/cloudConfigWireCaps.d.ts +5 -3
- package/dist/cloudConfigWireCaps.js +106 -64
- package/dist/compensations.js +1 -1
- package/dist/connectorStatus.d.ts +21 -0
- package/dist/connectorStatus.js +112 -0
- package/dist/controlRouter.d.ts +18 -3
- package/dist/controlRouter.js +106 -67
- package/dist/coreValuePorts.d.ts +29 -4
- package/dist/coreValuePorts.js +10 -0
- package/dist/corruptSessionCopy.d.ts +2 -1
- package/dist/corruptSessionCopy.js +3 -3
- package/dist/decideReceipt.d.ts +2 -2
- package/dist/decideReceipt.js +5 -2
- package/dist/declared/supportFloorDeclared.js +3 -3
- package/dist/detachWire.js +3 -2
- package/dist/deviceExecutorManagementCapability.d.ts +0 -4
- package/dist/deviceExecutorManagementCapability.js +0 -6
- package/dist/deviceRebind.d.ts +49 -1
- package/dist/deviceRebind.js +221 -3
- package/dist/devicesFace.d.ts +34 -0
- package/dist/devicesFace.js +90 -0
- package/dist/displayUntrusted.d.ts +2 -0
- package/dist/displayUntrusted.js +253 -76
- package/dist/engineAgentAbsence.d.ts +1 -1
- package/dist/engineAgentPanelStore.d.ts +12 -4
- package/dist/engineAgentPanelStore.js +16 -11
- package/dist/engineCapReader.d.ts +2 -5
- package/dist/engineCapReader.js +8 -10
- package/dist/engineCapsCache.d.ts +12 -0
- package/dist/engineCapsCache.js +76 -18
- package/dist/engineCapsChange.d.ts +2 -0
- package/dist/engineCapsChange.js +9 -0
- package/dist/engineClosedSets.d.ts +1 -0
- package/dist/engineClosedSets.js +4 -1
- package/dist/engineErrorCodes.d.ts +11 -3
- package/dist/engineErrorCodes.js +11 -8
- package/dist/engineIdentity.d.ts +1 -0
- package/dist/engineIdentity.js +8 -0
- package/dist/engineRowRef.d.ts +28 -0
- package/dist/engineRowRef.js +114 -0
- package/dist/engineSessionMessages.d.ts +68 -0
- package/dist/engineSessionMessages.js +370 -0
- package/dist/engineTargetSeat.d.ts +27 -0
- package/dist/engineTargetSeat.js +199 -0
- package/dist/engineToolDirectory.d.ts +0 -9
- package/dist/engineToolDirectory.js +1 -94
- package/dist/engineUrl.d.ts +18 -0
- package/dist/engineUrl.js +52 -0
- package/dist/engineWireFor.js +3 -8
- package/dist/env/uiLanguage.d.ts +11 -1
- package/dist/env/uiLanguage.js +38 -2
- package/dist/eventLeg.d.ts +100 -0
- package/dist/eventLeg.js +305 -0
- package/dist/executionLaneCapability.d.ts +0 -4
- package/dist/executionLaneCapability.js +3 -16
- package/dist/fileHistoryCaptureCapability.d.ts +2 -5
- package/dist/fileHistoryCaptureCapability.js +13 -21
- package/dist/fileHistoryLegNotice.d.ts +2 -1
- package/dist/fileHistoryLegNotice.js +3 -3
- package/dist/fleet/fleetLedger.d.ts +0 -3
- package/dist/fleet/fleetLedger.js +21 -36
- package/dist/fleet/fleetProjection.d.ts +2 -2
- package/dist/fleet/fleetProjection.js +10 -8
- package/dist/frameBinding.d.ts +8 -0
- package/dist/frameBinding.js +35 -0
- package/dist/gateFailureCodes.d.ts +2 -0
- package/dist/gateFailureCodes.js +15 -0
- package/dist/gateOutcome.d.ts +3 -1
- package/dist/gateOutcome.js +41 -8
- package/dist/gateVocabulary.d.ts +10 -4
- package/dist/gateVocabulary.js +107 -47
- package/dist/generated/engineAskFaceTables.js +2 -2
- package/dist/generated/engineFactTables.d.ts +22 -3
- package/dist/generated/engineFactTables.js +51 -4
- package/dist/generated/engineNoticeTables.js +18 -3
- package/dist/generated/settingsSchemaFns.d.ts +6 -0
- package/dist/generated/settingsSchemaFns.js +57 -0
- package/dist/generated/settingsSchemaHooksClassifier.d.ts +2 -0
- package/dist/generated/settingsSchemaHooksClassifier.js +254 -0
- package/dist/generated/settingsSchemaTables.d.ts +1 -0
- package/dist/generated/settingsSchemaTables.js +4 -0
- package/dist/generated/settingsSchemaTypes.d.ts +105 -0
- package/dist/generated/settingsSchemaTypes.js +1 -0
- package/dist/generated/toolNameTables.d.ts +1 -0
- package/dist/generated/toolNameTables.js +1 -0
- package/dist/hitl/allowRuleShadow.d.ts +8 -2
- package/dist/hitl/allowRuleShadow.js +36 -29
- package/dist/hitl/approvalCardReading.d.ts +15 -0
- package/dist/hitl/approvalCardReading.js +154 -0
- package/dist/hitl/approvalCardReasons.d.ts +14 -0
- package/dist/hitl/approvalCardReasons.js +119 -0
- package/dist/hitl/approvalHolds.d.ts +50 -15
- package/dist/hitl/approvalHolds.js +177 -27
- package/dist/hitl/approvalResolution.d.ts +51 -26
- package/dist/hitl/approvalResolution.js +86 -122
- package/dist/hitl/approvalsFeed.js +6 -18
- package/dist/hitl/askClassPair.d.ts +2 -0
- package/dist/hitl/askClassPair.js +17 -0
- package/dist/hitl/askGateWire.d.ts +20 -2
- package/dist/hitl/askGateWire.js +50 -1
- package/dist/hitl/askParkRowRouting.d.ts +5 -0
- package/dist/hitl/askParkRowRouting.js +32 -1
- package/dist/hitl/askSettlementLine.d.ts +28 -0
- package/dist/hitl/askSettlementLine.js +99 -0
- package/dist/hitl/automaticAnswerVerdict.d.ts +3 -2
- package/dist/hitl/automaticAnswerVerdict.js +29 -13
- package/dist/hitl/crashConverged.d.ts +11 -20
- package/dist/hitl/crashConverged.js +56 -0
- package/dist/hitl/crashConvergedNotice.d.ts +6 -3
- package/dist/hitl/crashConvergedNotice.js +48 -24
- package/dist/hitl/decisionConflict.js +3 -10
- package/dist/hitl/decisionRefusal.d.ts +40 -1
- package/dist/hitl/decisionRefusal.js +199 -42
- package/dist/hitl/frameRouter.d.ts +5 -2
- package/dist/hitl/frameRouter.js +27 -24
- package/dist/hitl/gateLedger.d.ts +2 -0
- package/dist/hitl/gateLedger.js +50 -13
- package/dist/hitl/hitlBridge.d.ts +2 -2
- package/dist/hitl/hitlBridge.js +13 -10
- package/dist/hitl/livePendingAsk.d.ts +3 -3
- package/dist/hitl/livePendingAsk.js +7 -18
- package/dist/hitl/parkResolver.d.ts +2 -24
- package/dist/hitl/parkResolver.js +61 -97
- package/dist/hitl/persistedRulesWire.d.ts +25 -0
- package/dist/hitl/persistedRulesWire.js +104 -2
- package/dist/hitl/planReviewWire.d.ts +31 -13
- package/dist/hitl/planReviewWire.js +120 -78
- package/dist/hitl/refusedToolNameProse.d.ts +0 -1
- package/dist/hitl/refusedToolNameProse.js +0 -3
- package/dist/hitl/replayedApproval.d.ts +4 -3
- package/dist/hitl/replayedApproval.js +7 -4
- package/dist/hitl/sessionPolicyDeliverable.d.ts +2 -0
- package/dist/hitl/sessionPolicyDeliverable.js +48 -7
- package/dist/hitl/sessionPolicyWire.d.ts +34 -21
- package/dist/hitl/sessionPolicyWire.js +179 -70
- package/dist/hitl/standingRows.d.ts +20 -2
- package/dist/hitl/standingRows.js +69 -8
- package/dist/hitl/suspendedReopen.d.ts +2 -1
- package/dist/hitl/suspendedReopen.js +7 -10
- package/dist/hitl/toolApprovalWire.d.ts +103 -156
- package/dist/hitl/toolApprovalWire.js +661 -411
- package/dist/hookMatcherVerdict.d.ts +6 -1
- package/dist/hookMatcherVerdict.js +14 -7
- package/dist/hooksWireCaps.d.ts +2 -2
- package/dist/hooksWireCaps.js +174 -81
- package/dist/host.d.ts +21 -0
- package/dist/hostTurnSettings.d.ts +71 -0
- package/dist/hostTurnSettings.js +291 -0
- package/dist/humanTurn.d.ts +14 -1
- package/dist/humanTurn.js +100 -12
- package/dist/humanTurnRead.d.ts +2 -0
- package/dist/humanTurnRead.js +22 -1
- package/dist/i18n/messages.en.d.ts +703 -0
- package/dist/i18n/messages.en.js +701 -0
- package/dist/i18n/messages.zh.d.ts +3 -0
- package/dist/i18n/messages.zh.js +837 -0
- package/dist/i18n/translate.d.ts +25 -0
- package/dist/i18n/translate.js +127 -0
- package/dist/index.d.ts +78 -29
- package/dist/index.js +54 -18
- package/dist/inheritEnvCapability.d.ts +32 -0
- package/dist/inheritEnvCapability.js +104 -0
- package/dist/inheritEnvWire.d.ts +3 -2
- package/dist/inheritEnvWire.js +12 -14
- package/dist/interactiveHalt.js +17 -6
- package/dist/liveModelCatalog.d.ts +3 -3
- package/dist/liveModelCatalog.js +15 -13
- package/dist/liveQuestionStore.d.ts +2 -21
- package/dist/mcpLiveness.d.ts +2 -1
- package/dist/mcpPanel.d.ts +10 -1
- package/dist/mcpPanel.js +40 -13
- package/dist/mcpProbeCapability.d.ts +2 -1
- package/dist/mcpProbeCapability.js +7 -11
- package/dist/mcpProbeWire.d.ts +9 -2
- package/dist/mcpProbeWire.js +6 -1
- package/dist/mcpWireCaps.d.ts +47 -2
- package/dist/mcpWireCaps.js +164 -16
- package/dist/memoryEntriesWire.d.ts +4 -9
- package/dist/memoryEntriesWire.js +5 -10
- package/dist/model/modelSupplyRules.d.ts +0 -2
- package/dist/model/modelSupplyRules.js +3 -12
- package/dist/model/modelsPolicy.d.ts +0 -5
- package/dist/model/modelsPolicy.js +6 -36
- package/dist/model/onboardJudgement.d.ts +93 -0
- package/dist/model/onboardJudgement.js +415 -0
- package/dist/model/subagentModelWord.d.ts +31 -0
- package/dist/model/subagentModelWord.js +261 -0
- package/dist/model/tierVocabulary.d.ts +2 -0
- package/dist/model/tierVocabulary.js +17 -5
- package/dist/modelCapabilityProbe.d.ts +64 -0
- package/dist/modelCapabilityProbe.js +600 -0
- package/dist/modelIdentityResolvability.d.ts +3 -0
- package/dist/modelIdentityResolvability.js +26 -17
- package/dist/notifications.d.ts +6 -0
- package/dist/notifications.js +71 -23
- package/dist/outputStyleSeatCapability.d.ts +0 -3
- package/dist/outputStyleSeatCapability.js +0 -3
- package/dist/ownKey.d.ts +22 -0
- package/dist/ownKey.js +94 -3
- package/dist/panelReduce.d.ts +21 -10
- package/dist/panelReduce.js +728 -550
- package/dist/panelStateHolder.d.ts +3 -7
- package/dist/panelStateHolder.js +14 -130
- package/dist/peerLaneCapability.d.ts +0 -4
- package/dist/peerLaneCapability.js +0 -6
- package/dist/permissionRuleIssue.js +2 -0
- package/dist/permissionRulesWriteCapability.d.ts +2 -5
- package/dist/permissionRulesWriteCapability.js +8 -12
- package/dist/permissionWireCaps.d.ts +2 -2
- package/dist/permissionWireCaps.js +2 -0
- package/dist/permissionsAllowGrantCapability.d.ts +0 -4
- package/dist/permissionsAllowGrantCapability.js +0 -6
- package/dist/permissionsDeclaration.d.ts +0 -11
- package/dist/permissionsDeclaration.js +60 -53
- package/dist/pluginHooksWire.d.ts +46 -3
- package/dist/pluginHooksWire.js +219 -16
- package/dist/preemptWire.d.ts +44 -0
- package/dist/preemptWire.js +83 -0
- package/dist/printModelStatus.d.ts +63 -0
- package/dist/printModelStatus.js +155 -0
- package/dist/printToolResultFrame.js +15 -4
- package/dist/replayBody.d.ts +3 -0
- package/dist/replayBody.js +14 -0
- package/dist/request/taskRequest.d.ts +11 -6
- package/dist/request/taskRequest.js +112 -19
- package/dist/resumeRefusalCopy.d.ts +13 -9
- package/dist/resumeRefusalCopy.js +81 -118
- package/dist/retryStatus.d.ts +45 -0
- package/dist/retryStatus.js +185 -1
- package/dist/rewindArchiveCapability.d.ts +0 -4
- package/dist/rewindArchiveCapability.js +2 -10
- package/dist/rewindArchiveReading.d.ts +0 -1
- package/dist/rewindArchiveReading.js +0 -3
- package/dist/runCancelContext.d.ts +2 -1
- package/dist/runCancelContext.js +4 -2
- package/dist/runReattachPolicy.d.ts +31 -0
- package/dist/runReattachPolicy.js +46 -0
- package/dist/runTerminal.d.ts +3 -6
- package/dist/runTerminal.js +8 -9
- package/dist/sandboxWire.d.ts +3 -1
- package/dist/sandboxWire.js +76 -27
- package/dist/scenarioRefusal.d.ts +9 -0
- package/dist/scenarioRefusal.js +111 -0
- package/dist/scenarioWire.js +1 -1
- package/dist/seam.d.ts +48 -2
- package/dist/seam.js +25 -4
- package/dist/seatContract.d.ts +311 -18
- package/dist/seatContract.js +824 -100
- package/dist/selfOrchestrationDenial.js +7 -19
- package/dist/sessionIdSegment.d.ts +6 -0
- package/dist/sessionIdSegment.js +24 -0
- package/dist/sessionMemoryStatus.js +6 -11
- package/dist/sessionPolicyCapability.d.ts +2 -5
- package/dist/sessionPolicyCapability.js +8 -12
- package/dist/sessionSyncFileHistoryCapability.d.ts +0 -3
- package/dist/sessionSyncFileHistoryCapability.js +0 -3
- package/dist/settingsHooksSalvage.d.ts +44 -0
- package/dist/settingsHooksSalvage.js +211 -0
- package/dist/skillToolListsCapability.d.ts +2 -4
- package/dist/skillToolListsCapability.js +8 -9
- package/dist/sqlEngineCapability.d.ts +0 -4
- package/dist/sqlEngineCapability.js +0 -6
- package/dist/sseIdleTriage.js +3 -2
- package/dist/steerPriorityCapability.d.ts +0 -3
- package/dist/steerPriorityCapability.js +0 -3
- package/dist/streamDrainingLegs.d.ts +4 -0
- package/dist/streamDrainingLegs.js +6 -1
- package/dist/subagent/engineCompactWire.d.ts +0 -1
- package/dist/subagent/engineCompactWire.js +7 -5
- package/dist/subagent/engineSubagentResume.js +15 -9
- package/dist/subagent/engineTaskHandleWire.js +4 -7
- package/dist/subagentContentStore.d.ts +3 -0
- package/dist/subagentContentStore.js +22 -10
- package/dist/submitReopen.d.ts +24 -0
- package/dist/submitReopen.js +75 -0
- package/dist/terminalStatuses.d.ts +3 -0
- package/dist/terminalStatuses.js +10 -2
- package/dist/toolHistoryMismatch.js +3 -2
- package/dist/toolResult.d.ts +10 -1
- package/dist/toolResult.js +34 -6
- package/dist/toolRoster.d.ts +3 -4
- package/dist/toolRoster.js +21 -22
- package/dist/turnFailurePresentation.d.ts +39 -0
- package/dist/turnFailurePresentation.js +402 -0
- package/dist/usageAnalytics.js +6 -11
- package/dist/userAttachmentEnvelope.d.ts +1 -0
- package/dist/userAttachmentEnvelope.js +37 -7
- package/dist/userAttachmentSeat.d.ts +21 -0
- package/dist/userAttachmentSeat.js +75 -0
- package/dist/userInvokedSkillsCapability.d.ts +11 -4
- package/dist/userInvokedSkillsCapability.js +31 -10
- package/dist/webSearchBackendCapability.d.ts +0 -4
- package/dist/webSearchBackendCapability.js +0 -6
- package/dist/wireErrorTriage.d.ts +7 -0
- package/dist/wireErrorTriage.js +26 -23
- package/dist/wireFailureShape.d.ts +62 -5
- package/dist/wireFailureShape.js +106 -5
- package/dist/wireRefusalCopy.d.ts +25 -3
- package/dist/wireRefusalCopy.js +74 -80
- package/dist/workflowsJournalCapability.d.ts +2 -5
- package/dist/workflowsJournalCapability.js +8 -12
- package/dist/writeProtectionCapability.d.ts +0 -4
- package/dist/writeProtectionCapability.js +0 -6
- package/docs/INTEGRATION-CLIENTS.md +1775 -56
- package/package.json +6 -5
- package/dist/attachmentSeatCapability.d.ts +0 -12
- package/dist/attachmentSeatCapability.js +0 -23
- package/dist/hitl/approvalOutcomeNote.d.ts +0 -10
- package/dist/hitl/approvalOutcomeNote.js +0 -29
- package/dist/sessionReadRedactionCapability.d.ts +0 -13
- package/dist/sessionReadRedactionCapability.js +0 -35
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { capForDisplay } from './fleetTaskDesc.js';
|
|
2
|
+
import { readOwnDataValue } from './ownKey.js';
|
|
3
|
+
import { SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE } from './engineErrorCodes.js';
|
|
4
|
+
import { readErrorRecord, readErrorString } from './wireFailureShape.js';
|
|
5
|
+
import { effectiveWireErrorCode } from './wireErrorTriage.js';
|
|
6
|
+
const SCENARIO_REFUSAL_ERROR_MAX = 200;
|
|
7
|
+
function detailBits(detail) {
|
|
8
|
+
if (detail === undefined)
|
|
9
|
+
return {};
|
|
10
|
+
let scenario;
|
|
11
|
+
let source;
|
|
12
|
+
try {
|
|
13
|
+
scenario = readOwnDataValue(detail, 'scenario');
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
scenario = undefined;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
source = readOwnDataValue(detail, 'source');
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
source = undefined;
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
...(typeof scenario === 'string' && scenario.length > 0 ? { scenario } : {}),
|
|
26
|
+
...(source === 'ruling' || source === 'deployment' ? { source } : {}),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const isPlainRecord = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
30
|
+
export function scenarioRefusalOf(body) {
|
|
31
|
+
let raw;
|
|
32
|
+
try {
|
|
33
|
+
const d = Object.getOwnPropertyDescriptor(body, 'scenarioRefusal');
|
|
34
|
+
if (d === undefined)
|
|
35
|
+
return undefined;
|
|
36
|
+
raw = 'value' in d ? d.value : undefined;
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
if (!isPlainRecord(raw))
|
|
43
|
+
return Object.freeze({});
|
|
44
|
+
const own = (key) => {
|
|
45
|
+
try {
|
|
46
|
+
return readOwnDataValue(raw, key);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const errorCode = own('errorCode');
|
|
53
|
+
const error = own('error');
|
|
54
|
+
const detail = own('detail');
|
|
55
|
+
let bits = {};
|
|
56
|
+
try {
|
|
57
|
+
bits = detailBits(isPlainRecord(detail) ? detail : undefined);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
bits = {};
|
|
61
|
+
}
|
|
62
|
+
return Object.freeze({
|
|
63
|
+
...(typeof errorCode === 'string' && errorCode.length > 0 ? { errorCode } : {}),
|
|
64
|
+
...(typeof error === 'string' && error.length > 0 ? { error: capForDisplay(error, SCENARIO_REFUSAL_ERROR_MAX) } : {}),
|
|
65
|
+
...bits,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return Object.freeze({});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export function scenarioRefusalFromError(err) {
|
|
73
|
+
try {
|
|
74
|
+
if (err === null || typeof err !== 'object')
|
|
75
|
+
return null;
|
|
76
|
+
if (effectiveWireErrorCode(err) !== SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE)
|
|
77
|
+
return null;
|
|
78
|
+
const error = readErrorString(err, 'message');
|
|
79
|
+
return Object.freeze({
|
|
80
|
+
errorCode: SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE,
|
|
81
|
+
...(error !== undefined && error.length > 0 ? { error: capForDisplay(error, SCENARIO_REFUSAL_ERROR_MAX) } : {}),
|
|
82
|
+
...detailBits(readErrorRecord(err, 'detail')),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export function scenarioRefusalContent(reading) {
|
|
90
|
+
let code;
|
|
91
|
+
let scenario;
|
|
92
|
+
let source;
|
|
93
|
+
try {
|
|
94
|
+
code = isPlainRecord(reading) ? readOwnDataValue(reading, 'errorCode') : undefined;
|
|
95
|
+
scenario = isPlainRecord(reading) ? readOwnDataValue(reading, 'scenario') : undefined;
|
|
96
|
+
source = isPlainRecord(reading) ? readOwnDataValue(reading, 'source') : undefined;
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
code = undefined;
|
|
100
|
+
scenario = undefined;
|
|
101
|
+
source = undefined;
|
|
102
|
+
}
|
|
103
|
+
if (code === SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE) {
|
|
104
|
+
const name = typeof scenario === 'string' && scenario.length > 0 ? ` ("${capForDisplay(scenario, 80)}")` : '';
|
|
105
|
+
const from = source === 'ruling' ? ', assigned to you by the configuration center,' : source === 'deployment' ? ", this deployment's default scenario," : '';
|
|
106
|
+
return (`This deployment cannot resolve your scenario: the scenario${name}${from} does not exist here, so it refuses whatever depends on your scenario — ` +
|
|
107
|
+
"new runs that do not name a scenario, and this session's list of MCP servers · Ask whoever operates the engine to fix the scenario assignment");
|
|
108
|
+
}
|
|
109
|
+
const tail = typeof code === 'string' && code.length > 0 ? ` (${capForDisplay(code, 80)})` : '';
|
|
110
|
+
return `This deployment's scenario check refused to resolve your scenario${tail}, so whatever depends on your scenario is not available — this session's list of MCP servers is unknown`;
|
|
111
|
+
}
|
package/dist/scenarioWire.js
CHANGED
|
@@ -4,7 +4,7 @@ export const SCENARIO_NAME_RE = /^[a-z][a-z0-9-]{1,31}$/;
|
|
|
4
4
|
export const HEADLESS_SCENARIO_ENV = 'SEMA_HEADLESS_SCENARIO';
|
|
5
5
|
const USAGE_HINT = "sema: --scenario expects a scenario name (lowercase letters/digits/hyphens, starting with a letter, ≤32 chars).\n" +
|
|
6
6
|
' --scenario <name> route this run through the named engine scenario (deployment-defined tool\n' +
|
|
7
|
-
' roster + system prompt; unknown names
|
|
7
|
+
' roster + system prompt; unknown names are refused by the engine (scenario_unknown))\n' +
|
|
8
8
|
' (no flag) the default scenario — today\'s behaviour';
|
|
9
9
|
export function parseScenarioArgv(argv) {
|
|
10
10
|
const flag = lastFlagValue(argv, '--scenario');
|
package/dist/seam.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ import type { WiringManifestAutoMode, WiringManifestModelGate, WiringManifestMcp
|
|
|
5
5
|
import type { ToolRosterView, ToolRosterDeltaView, WiringManifestHandsView } from './toolRoster.js';
|
|
6
6
|
import type { WiringManifestFleetView } from './adapter/downstream/wiringManifestView.js';
|
|
7
7
|
import type { SuspendedReopenReading } from './hitl/suspendedReopen.js';
|
|
8
|
+
import type { ToolKillCause } from './toolResult.js';
|
|
9
|
+
import type { HumanInputAttachmentView } from './ownKey.js';
|
|
8
10
|
export interface AbortSignalLike {
|
|
9
11
|
readonly aborted: boolean;
|
|
10
12
|
}
|
|
@@ -27,7 +29,18 @@ export interface AdapterContext {
|
|
|
27
29
|
signal?: AbortSignalLike;
|
|
28
30
|
setTimer?(ms: number, fn: () => void): TimerHandle;
|
|
29
31
|
clearTimer?(handle: TimerHandle): void;
|
|
32
|
+
toolKillCause?(call: {
|
|
33
|
+
readonly toolCallId: string;
|
|
34
|
+
readonly toolName: string;
|
|
35
|
+
}): ToolKillCause | undefined;
|
|
30
36
|
coalesceIntervalMs?: number;
|
|
37
|
+
continuesPark?: ContinuesParkDeclaration;
|
|
38
|
+
}
|
|
39
|
+
export interface ContinuesParkDeclaration {
|
|
40
|
+
readonly toolCallId: string;
|
|
41
|
+
readonly checkpointId?: string;
|
|
42
|
+
readonly parkedTaskId?: string;
|
|
43
|
+
readonly continuationTaskId?: string;
|
|
31
44
|
}
|
|
32
45
|
export type ChromeEvent = {
|
|
33
46
|
kind: 'retry_status';
|
|
@@ -131,6 +144,7 @@ export type ChromeEvent = {
|
|
|
131
144
|
laneProof: LaneProof;
|
|
132
145
|
usage: ModelUsage;
|
|
133
146
|
engineUsage?: EngineTurnUsage;
|
|
147
|
+
engineUsageUnknownKeys?: number;
|
|
134
148
|
usageMissing?: true;
|
|
135
149
|
stopReason?: string;
|
|
136
150
|
responseModel?: string;
|
|
@@ -142,6 +156,7 @@ export type ChromeEvent = {
|
|
|
142
156
|
parentToolCallId: string;
|
|
143
157
|
usage?: ModelUsage;
|
|
144
158
|
engineUsage?: EngineTurnUsage;
|
|
159
|
+
engineUsageUnknownKeys?: number;
|
|
145
160
|
usageMissing?: true;
|
|
146
161
|
stopReason?: string;
|
|
147
162
|
responseModel?: string;
|
|
@@ -152,7 +167,7 @@ export type ChromeEvent = {
|
|
|
152
167
|
} | ({
|
|
153
168
|
kind: 'run_cost_reconciled';
|
|
154
169
|
laneProof: LaneProof;
|
|
155
|
-
} & RunCostReconcile) | HumanInputChromeEvent | MessageCommittedChromeEvent | EngineNoticeChromeEvent | TextSegmentEndChromeEvent | ThinkingSegmentEndChromeEvent | ToolDisclosureChromeEvent | ToolProgressChromeEvent | ToolRosterDeltaChromeEvent | ContextUsageChromeEvent | CompactionOutcomeChromeEvent | PromptAssembledChromeEvent | MemorySavedChromeEvent | WiringManifestChromeEvent | ResultTextDivergedChromeEvent | ApprovalRequestChromeEvent | ApprovalRevokeChromeEvent | {
|
|
170
|
+
} & RunCostReconcile) | HumanInputChromeEvent | MessageCommittedChromeEvent | EngineNoticeChromeEvent | TextSegmentEndChromeEvent | ThinkingSegmentEndChromeEvent | ToolDisclosureChromeEvent | ToolProgressChromeEvent | ToolRosterDeltaChromeEvent | ContextUsageChromeEvent | CompactionOutcomeChromeEvent | SubagentStartedChromeEvent | PromptAssembledChromeEvent | MemorySavedChromeEvent | WiringManifestChromeEvent | ResultTextDivergedChromeEvent | ResultReplayedChromeEvent | ToolParkedChromeEvent | ApprovalRequestChromeEvent | ApprovalRevokeChromeEvent | {
|
|
156
171
|
kind: 'suspended_reopened';
|
|
157
172
|
laneProof: LaneProof;
|
|
158
173
|
reopen: Extract<SuspendedReopenReading, {
|
|
@@ -222,6 +237,25 @@ export interface CompactionOutcomeChromeEvent {
|
|
|
222
237
|
reason?: string;
|
|
223
238
|
eventId?: string;
|
|
224
239
|
}
|
|
240
|
+
export interface SubagentStartedChromeEvent {
|
|
241
|
+
kind: 'subagent_started';
|
|
242
|
+
laneProof: LaneProof;
|
|
243
|
+
taskId: string;
|
|
244
|
+
sessionId?: string;
|
|
245
|
+
model?: string;
|
|
246
|
+
taskType?: string;
|
|
247
|
+
seq?: number;
|
|
248
|
+
workflowRunId?: string;
|
|
249
|
+
workflowAgentLabel?: string;
|
|
250
|
+
parentTaskId?: string;
|
|
251
|
+
parentSessionId?: string;
|
|
252
|
+
rootSessionId?: string;
|
|
253
|
+
name?: string;
|
|
254
|
+
spawnName?: string;
|
|
255
|
+
agentType?: string;
|
|
256
|
+
startedAt?: number;
|
|
257
|
+
eventId?: string;
|
|
258
|
+
}
|
|
225
259
|
export interface MemorySavedChromeEvent {
|
|
226
260
|
kind: 'memory_saved';
|
|
227
261
|
laneProof: LaneProof;
|
|
@@ -286,6 +320,17 @@ export interface ResultTextDivergedChromeEvent {
|
|
|
286
320
|
committedLength: number;
|
|
287
321
|
resultLength: number;
|
|
288
322
|
}
|
|
323
|
+
export interface ResultReplayedChromeEvent {
|
|
324
|
+
kind: 'result_replayed';
|
|
325
|
+
laneProof: LaneProof;
|
|
326
|
+
text: string;
|
|
327
|
+
}
|
|
328
|
+
export interface ToolParkedChromeEvent {
|
|
329
|
+
kind: 'tool_parked';
|
|
330
|
+
laneProof: LaneProof;
|
|
331
|
+
toolUseId: string;
|
|
332
|
+
rowUuid?: string;
|
|
333
|
+
}
|
|
289
334
|
export interface EngineNoticeChromeEvent {
|
|
290
335
|
kind: 'engine_notice';
|
|
291
336
|
laneProof: LaneProof;
|
|
@@ -314,7 +359,9 @@ export interface HumanInputChromeEvent {
|
|
|
314
359
|
actor?: HumanInputActor;
|
|
315
360
|
entryId?: string;
|
|
316
361
|
eventId?: string;
|
|
362
|
+
attachments?: HumanInputAttachmentView[];
|
|
317
363
|
}
|
|
364
|
+
export type { HumanInputAttachmentView } from './ownKey.js';
|
|
318
365
|
export interface MessageCommittedChromeEvent {
|
|
319
366
|
kind: 'message_committed';
|
|
320
367
|
laneProof: LaneProof;
|
|
@@ -352,6 +399,5 @@ export interface WireToCcAdapter {
|
|
|
352
399
|
}
|
|
353
400
|
export declare function deriveTranscriptId(frame: {
|
|
354
401
|
id?: unknown;
|
|
355
|
-
seq?: unknown;
|
|
356
402
|
toolCallId?: unknown;
|
|
357
403
|
}, ctx: Pick<AdapterContext, 'uuid'>, suffix?: string): string;
|
package/dist/seam.js
CHANGED
|
@@ -76,6 +76,14 @@ const CHROME_ARM_TABLE = {
|
|
|
76
76
|
duty: 'CC-89(0.75.0):一次压缩的非 compacted 结局(作废 / 失败等),给用户一条可见提示。`outcome` / `trigger` 是引擎开集原词,按成员渲染必带 default 臂、认不得照原词显示;' +
|
|
77
77
|
'🔴 不是终态 —— 任务还在跑,别据它收 spinner;`laneProof.lane` 为 subagent = 子代的压缩结局,别渲成主会话的;成功压缩不走本臂(权威是转录的 compact_boundary)。不接 = 压缩失败对用户不可见。',
|
|
78
78
|
},
|
|
79
|
+
subagent_started: {
|
|
80
|
+
required: false,
|
|
81
|
+
duty: '可选:委派子代每周期一帧的起跑事实(sdk `task_started`,服务端 ≥ 7.127.0)—— 要「起跑时就开子代行」的宿主接它(不接 = 首个 task_progress 才开行,与 0.98.0 同)。' +
|
|
82
|
+
'🔴 面板的起跑时刻证据:把本事件原样交 `publishEngineAgentPanelStart(event)`(只补行上缺的 `startedAt`、从不建行 / 不改身份归并;workflow 车道自报 `workflowRunId` 的帧它自己忽略)。' +
|
|
83
|
+
'🔴 `taskType` 开集读(缺席 = 前台同步子代,没有 fleet 行);`seq` 缺席 = 没有 a* 行,禁读作第 1 周期;`name` / `workflowAgentLabel` 是 UNTRUSTED 展示文本(渲前过展示出口);' +
|
|
84
|
+
'`laneProof.lane` 为 subagent = 挂在那张委派卡上(`parentToolCallId`),主车道 = 后台代理(卡已收口);workflow 车道的子代别开前台子代行(带 `workflowRunId` 即是);' +
|
|
85
|
+
'本事件不是 spinner / run 终态证据;缺席键 = 服务端没说,不是 0 / 空串。',
|
|
86
|
+
},
|
|
79
87
|
prompt_assembled: {
|
|
80
88
|
required: false,
|
|
81
89
|
duty: 'CC-91(0.76.0):这一次 prepare 的提示词装配清单(每段 / 块多大、挂了哪些工具),/context 类面板的引擎侧真值来源。🔴 一次任务可能多条(cascade / verify / resume 各自 re-prepare)' +
|
|
@@ -113,6 +121,19 @@ const CHROME_ARM_TABLE = {
|
|
|
113
121
|
'mcp 的空数组是「一台都没申报」这句正面事实、**不是**缺席(判在场写 mcp !== undefined,' +
|
|
114
122
|
'别写 mcp?.length),errorCode 按开集分支必带 default;durable 重放按 run/leg 幂等',
|
|
115
123
|
},
|
|
124
|
+
result_replayed: {
|
|
125
|
+
required: true,
|
|
126
|
+
duty: '0.98.0:提交幂等的重放(同一把幂等键命中更早的一次提交,这次没有新跑)。每个重放终局恰一条,在终局臂全部产出之后;渲一行 `text`,不进模型面。' +
|
|
127
|
+
'🔴 零转录行的重放终局(空正文成功 / 停驻)里本臂是这一轮唯一的可渲染产出 —— 不接 = 整轮无提示;' +
|
|
128
|
+
'句子只说「这次没有新跑」,结局由已有的行与结果帧说,别在本臂上拼结局,也别从行上的 `_sema_replay` 现拼句子;' +
|
|
129
|
+
'没收到本臂 ≠ 这次真跑;续读 / 接管重投的终局永不发本臂;冷恢复后看不到是诚实缺席(要留就把渲成的那一行随转录落盘)。',
|
|
130
|
+
},
|
|
131
|
+
tool_parked: {
|
|
132
|
+
required: true,
|
|
133
|
+
duty: '0.98.0:被停驻扣住的那只调用此刻是「停驻、没结算」—— 摘卡那一拍恰一枚(同一拍零终态行)。把 `rowUuid` 那一行(调用 occurrence 的开始行)置「在等审批」;' +
|
|
134
|
+
'按开始行 uuid 认行,不按 toolUseId(调用 id 只在同一条助手消息内唯一)。它的终态由执行腿的结果铸(续跑带见证时接回原行),或永远缺席(停驻被取消 / 过期)。' +
|
|
135
|
+
'连坐旁观者 / 普通错误 / 停驻卡上 Esc(包已自发中断拒绝,行照铸 Interrupted)零枚。',
|
|
136
|
+
},
|
|
116
137
|
result_text_diverged: {
|
|
117
138
|
required: false,
|
|
118
139
|
duty: '可选:终帧正文与已上屏正文**互相都不是对方前缀**时的诚实披露。🔴 处置是把这一拍的转录行**改口**' +
|
|
@@ -123,7 +144,8 @@ const CHROME_ARM_TABLE = {
|
|
|
123
144
|
approval_request: {
|
|
124
145
|
required: true,
|
|
125
146
|
duty: '用 sdk isApprovalRequestFrameV1 窄化 frame 才取 card/askId/窗三键;窄不下来 ⇒ 呈通用卡(安全元数据 + 人工 approve/deny),' +
|
|
126
|
-
'🔴 永不 auto-deny
|
|
147
|
+
'🔴 永不 auto-deny;开卡前调 claimApprovalCard(身份, { signal }):joined / aborted ⇒ 不开卡,held ⇒ 开卡且每条出口恰调一次 hold.release(settled?)' +
|
|
148
|
+
'(去重判定归包 —— legacy 帧那一路的持有与结局在进程级持有表 / 已结表里,宿主不自持 legacy 已收口集);流上下文经 approvalFrameContextOf(这只 chrome 事件) 查,查不到不开卡;' +
|
|
127
149
|
'🔴 账本重放的历史帧只用于时间线渲染,卡集的全量对账基准是开流 preamble(它带的 expiresInMs 是铸帧时刻的旧值);' +
|
|
128
150
|
'card 的 message/args 是模型/工具产文,只渲染永不回喂模型',
|
|
129
151
|
},
|
|
@@ -155,14 +177,13 @@ const CHROME_ARM_TABLE = {
|
|
|
155
177
|
'⑦序:该段尾部的活体增量(`stream_delta`)一律先于本事件到达,本事件之后不再有同段增量(下一条增量属于下一段)。',
|
|
156
178
|
},
|
|
157
179
|
};
|
|
180
|
+
const _chromeArmRequiredFloorPins = [true, true];
|
|
181
|
+
void _chromeArmRequiredFloorPins;
|
|
158
182
|
export const CHROME_ARMS = Object.entries(CHROME_ARM_TABLE).map(([kind, d]) => ({ kind, required: d.required, duty: d.duty }));
|
|
159
183
|
export function deriveTranscriptId(frame, ctx, suffix) {
|
|
160
184
|
if (typeof frame.id === 'string' && frame.id.length > 0) {
|
|
161
185
|
return uuidV5(TRANSCRIPT_ID_NAMESPACE, suffix !== undefined ? `wid_${frame.id}#${suffix}` : `wid_${frame.id}`);
|
|
162
186
|
}
|
|
163
|
-
if (typeof frame.seq === 'number') {
|
|
164
|
-
return uuidV5(TRANSCRIPT_ID_NAMESPACE, suffix !== undefined ? `wseq#${suffix}_${frame.seq}` : `wseq_${frame.seq}`);
|
|
165
|
-
}
|
|
166
187
|
if (typeof frame.toolCallId === 'string' && frame.toolCallId.length > 0) {
|
|
167
188
|
return uuidV5(TRANSCRIPT_ID_NAMESPACE, suffix !== undefined ? `wtc#${suffix}_${frame.toolCallId}` : `wtc_${frame.toolCallId}`);
|
|
168
189
|
}
|