@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
package/dist/wireRefusalCopy.js
CHANGED
|
@@ -1,36 +1,25 @@
|
|
|
1
|
-
import { readErrorNumber, readErrorRecord, readErrorStrictStringList, readErrorString, readErrorStringList, readRefusalField } from './wireFailureShape.js';
|
|
2
|
-
import { readOwnNonEmptyString } from './ownKey.js';
|
|
3
|
-
import { ACTIVE_RUN_BUSY_ERROR_CODE, FLEET_LEASE_UNAVAILABLE, REQUEST_AUTONOMY_LANE_REFUSED, REQUEST_FIELD_CONFLICT, RESUME_OUTCOME_INVALID, RESUME_POLICY_FOLD_CODE, SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE, USAGE_WINDOW_EXHAUSTED } from './engineErrorCodes.js';
|
|
1
|
+
import { PROTOCOL_ERROR_NAME, THROWN_SLOT_UNREADABLE, protocolErrorNameOf, readErrorNumber, readErrorRecord, readErrorStrictStringList, readErrorString, readErrorStringList, readRefusalField, readThrownSlot, readThrownStatusSlot } from './wireFailureShape.js';
|
|
2
|
+
import { readOwnDataValue, readOwnNonEmptyString } from './ownKey.js';
|
|
3
|
+
import { ACTIVE_RUN_BUSY_ERROR_CODE, FLEET_LEASE_UNAVAILABLE, REQUEST_AUTONOMY_LANE_REFUSED, REQUEST_FIELD_CONFLICT, RESUME_OUTCOME_INVALID, RESUME_POLICY_FOLD_CODE, SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE, USAGE_WINDOW_EXHAUSTED, USER_ATTACHMENT_INVALID_ERROR_CODE, USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE } from './engineErrorCodes.js';
|
|
4
4
|
import { capForDisplay } from './fleetTaskDesc.js';
|
|
5
5
|
import { effectiveWireErrorCode } from './wireErrorTriage.js';
|
|
6
6
|
import { CORE_TOOL_DECLARATION_CODES } from './generated/engineFactTables.js';
|
|
7
|
+
import { scenarioRefusalFromError } from './scenarioRefusal.js';
|
|
7
8
|
export const CONFLICT_APPROVAL_SETTLED = 'conflict.approval_settled';
|
|
8
9
|
export const CONFLICT_RUN_NOT_RUNNING = 'conflict.run_not_running';
|
|
9
|
-
function
|
|
10
|
-
const v = o
|
|
10
|
+
function ownNonEmptyStringSlot(o, key) {
|
|
11
|
+
const v = readThrownSlot(o, key, 'data');
|
|
11
12
|
return typeof v === 'string' && v !== '' ? v : undefined;
|
|
12
13
|
}
|
|
13
14
|
export function cancelConflictFromError(err) {
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
if (err === null || typeof err !== 'object')
|
|
17
|
-
return null;
|
|
18
|
-
o = err;
|
|
19
|
-
const rawStatus = o.status ?? o.statusCode;
|
|
20
|
-
const is409 = rawStatus === 409 || (rawStatus === undefined && o.name === 'ConflictError');
|
|
21
|
-
if (!is409)
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
catch {
|
|
15
|
+
if (err === null || typeof err !== 'object')
|
|
25
16
|
return null;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
code = undefined;
|
|
33
|
-
}
|
|
17
|
+
const rawStatus = readThrownStatusSlot(err);
|
|
18
|
+
if (rawStatus === THROWN_SLOT_UNREADABLE)
|
|
19
|
+
return null;
|
|
20
|
+
if (!(rawStatus === 409 || (rawStatus === undefined && protocolErrorNameOf(err) === PROTOCOL_ERROR_NAME.ConflictError)))
|
|
21
|
+
return null;
|
|
22
|
+
const code = ownNonEmptyStringSlot(err, 'errorCode');
|
|
34
23
|
if (code === CONFLICT_APPROVAL_SETTLED)
|
|
35
24
|
return { kind: 'approval_settled', code };
|
|
36
25
|
if (code === CONFLICT_RUN_NOT_RUNNING)
|
|
@@ -58,17 +47,20 @@ export function usageWindowExhaustedFromError(err) {
|
|
|
58
47
|
if (err === null || typeof err !== 'object')
|
|
59
48
|
return null;
|
|
60
49
|
const o = err;
|
|
61
|
-
if (o
|
|
50
|
+
if (readThrownSlot(o, 'errorCode', 'data') !== USAGE_WINDOW_EXHAUSTED)
|
|
51
|
+
return null;
|
|
52
|
+
const rawStatus = readThrownStatusSlot(o);
|
|
53
|
+
if (rawStatus === THROWN_SLOT_UNREADABLE)
|
|
62
54
|
return null;
|
|
63
|
-
const
|
|
64
|
-
const is429 = rawStatus === 429 || (rawStatus === undefined && (
|
|
55
|
+
const protocolName = rawStatus === undefined ? protocolErrorNameOf(o) : undefined;
|
|
56
|
+
const is429 = rawStatus === 429 || (rawStatus === undefined && (protocolName === PROTOCOL_ERROR_NAME.UsageWindowExhaustedError || protocolName === PROTOCOL_ERROR_NAME.RateLimitedError));
|
|
65
57
|
if (!is429)
|
|
66
58
|
return null;
|
|
67
59
|
const rawSec = readErrorNumber(o, 'retryAfterSec');
|
|
68
60
|
const sec = nonNegativeFinite(rawSec)
|
|
69
61
|
? Math.ceil(rawSec)
|
|
70
62
|
: (() => {
|
|
71
|
-
const rawMs = o
|
|
63
|
+
const rawMs = readThrownSlot(o, 'retryAfterMs', 'data');
|
|
72
64
|
return nonNegativeFinite(rawMs) ? Math.ceil(rawMs / 1000) : undefined;
|
|
73
65
|
})();
|
|
74
66
|
return { code: USAGE_WINDOW_EXHAUSTED, ...(sec !== undefined ? { retryAfterSec: sec } : {}) };
|
|
@@ -98,13 +90,7 @@ const positiveFinite = (v) => typeof v === 'number' && Number.isFinite(v) && v >
|
|
|
98
90
|
export function fleetLeaseUnavailableFromError(err) {
|
|
99
91
|
if (err === null || typeof err !== 'object')
|
|
100
92
|
return null;
|
|
101
|
-
|
|
102
|
-
try {
|
|
103
|
-
code = err.errorCode;
|
|
104
|
-
}
|
|
105
|
-
catch {
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
93
|
+
const code = readThrownSlot(err, 'errorCode', 'data');
|
|
108
94
|
if (code !== FLEET_LEASE_UNAVAILABLE)
|
|
109
95
|
return null;
|
|
110
96
|
const reason = readErrorString(err, 'reason');
|
|
@@ -153,33 +139,14 @@ export function fleetLeaseUnavailableContent(detail) {
|
|
|
153
139
|
return `${head}${cause}${wait}`;
|
|
154
140
|
}
|
|
155
141
|
export function scenarioAssignmentUnknownFromError(err) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return null;
|
|
159
|
-
if (effectiveWireErrorCode(err) !== SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE)
|
|
160
|
-
return null;
|
|
161
|
-
const detail = readErrorRecord(err, 'detail');
|
|
162
|
-
const bit = (key) => {
|
|
163
|
-
if (detail === undefined)
|
|
164
|
-
return undefined;
|
|
165
|
-
try {
|
|
166
|
-
return Object.hasOwn(detail, key) ? detail[key] : undefined;
|
|
167
|
-
}
|
|
168
|
-
catch {
|
|
169
|
-
return undefined;
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
const scenario = bit('scenario');
|
|
173
|
-
const source = bit('source');
|
|
174
|
-
return {
|
|
175
|
-
code: SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE,
|
|
176
|
-
...(typeof scenario === 'string' && scenario.length > 0 ? { scenario } : {}),
|
|
177
|
-
...(source === 'ruling' || source === 'deployment' ? { source } : {}),
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
catch {
|
|
142
|
+
const r = scenarioRefusalFromError(err);
|
|
143
|
+
if (r === null)
|
|
181
144
|
return null;
|
|
182
|
-
|
|
145
|
+
return {
|
|
146
|
+
code: SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE,
|
|
147
|
+
...(r.scenario !== undefined ? { scenario: r.scenario } : {}),
|
|
148
|
+
...(r.source !== undefined ? { source: r.source } : {}),
|
|
149
|
+
};
|
|
183
150
|
}
|
|
184
151
|
const SETTLED_BY_NOT_IN_PROOF = 'settled_by_not_in_proof';
|
|
185
152
|
const DECIDED_BY_NOT_IN_PROOF = 'decided_by_not_in_proof';
|
|
@@ -190,11 +157,11 @@ export function denyAttributionRefusalFromError(err, sentAttributionKey) {
|
|
|
190
157
|
if (err === null || typeof err !== 'object')
|
|
191
158
|
return null;
|
|
192
159
|
const o = err;
|
|
193
|
-
const rawStatus = o
|
|
160
|
+
const rawStatus = readThrownStatusSlot(o);
|
|
194
161
|
const status = typeof rawStatus === 'number' && Number.isFinite(rawStatus) ? rawStatus : undefined;
|
|
195
162
|
if (status === undefined)
|
|
196
163
|
return null;
|
|
197
|
-
const code =
|
|
164
|
+
const code = ownNonEmptyStringSlot(o, 'errorCode');
|
|
198
165
|
if (code === undefined)
|
|
199
166
|
return null;
|
|
200
167
|
if (status === 400 && (code === SETTLED_BY_NOT_IN_PROOF || code === DECIDED_BY_NOT_IN_PROOF))
|
|
@@ -245,12 +212,12 @@ export function sessionDeleteConflictFromError(err) {
|
|
|
245
212
|
try {
|
|
246
213
|
if (err === null || typeof err !== 'object')
|
|
247
214
|
return null;
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
if (!
|
|
215
|
+
const rawStatus = readThrownStatusSlot(err);
|
|
216
|
+
if (rawStatus === THROWN_SLOT_UNREADABLE)
|
|
217
|
+
return null;
|
|
218
|
+
if (!(rawStatus === 409 || (rawStatus === undefined && protocolErrorNameOf(err) === PROTOCOL_ERROR_NAME.ConflictError)))
|
|
252
219
|
return null;
|
|
253
|
-
const code =
|
|
220
|
+
const code = ownNonEmptyStringSlot(err, 'errorCode');
|
|
254
221
|
if (code === CONFLICT_SESSION_CHILDREN_ALIVE) {
|
|
255
222
|
const remaining = readErrorStringList(err, 'remaining')?.filter((id) => id.length > 0);
|
|
256
223
|
return { kind: 'children_alive', code, ...(remaining !== undefined && remaining.length > 0 ? { remaining: Object.freeze(remaining) } : {}) };
|
|
@@ -391,13 +358,7 @@ export function toolDeclarationRefusalFromError(err) {
|
|
|
391
358
|
try {
|
|
392
359
|
if (typeof err !== 'object' || err === null)
|
|
393
360
|
return null;
|
|
394
|
-
|
|
395
|
-
try {
|
|
396
|
-
code = err.errorCode;
|
|
397
|
-
}
|
|
398
|
-
catch {
|
|
399
|
-
return null;
|
|
400
|
-
}
|
|
361
|
+
const code = readThrownSlot(err, 'errorCode', 'data');
|
|
401
362
|
if (typeof code !== 'string' || !CORE_TOOL_DECLARATION_CODES.includes(code))
|
|
402
363
|
return null;
|
|
403
364
|
return Object.freeze({ code });
|
|
@@ -547,7 +508,7 @@ function readProp(o, key) {
|
|
|
547
508
|
}
|
|
548
509
|
export function hostPostureRefusalFromError(err, sentRequest) {
|
|
549
510
|
try {
|
|
550
|
-
if (
|
|
511
|
+
if (readThrownSlot(err, 'errorCode', 'data') !== HOST_POSTURE_REFUSED)
|
|
551
512
|
return null;
|
|
552
513
|
const askedWholeEnvironment = readProp(sentRequest, 'inheritEnv') === 'all';
|
|
553
514
|
const askedOpenWriteFace = readProp(sentRequest, 'permissionMode') === BYPASS_PERMISSIONS ||
|
|
@@ -600,11 +561,30 @@ export function hookMatcherRefusalFromError(err) {
|
|
|
600
561
|
if (detail === undefined)
|
|
601
562
|
return undefined;
|
|
602
563
|
const event = readOwnNonEmptyString(detail, 'event');
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
564
|
+
if (event === undefined)
|
|
565
|
+
return undefined;
|
|
566
|
+
const reasonRaw = readOwnDataValue(detail, 'reason');
|
|
567
|
+
if (reasonRaw === undefined || reasonRaw === 'dead_alias') {
|
|
568
|
+
const alias = readOwnNonEmptyString(detail, 'alias');
|
|
569
|
+
const canonical = readOwnNonEmptyString(detail, 'canonical');
|
|
570
|
+
if (alias === undefined || canonical === undefined)
|
|
571
|
+
return undefined;
|
|
572
|
+
return Object.freeze({ reason: 'alias_without_canonical', event, alias, canonical });
|
|
573
|
+
}
|
|
574
|
+
if (reasonRaw !== 'invalid_regex' && reasonRaw !== 'over_budget')
|
|
575
|
+
return undefined;
|
|
576
|
+
const groupIndex = readOwnDataValue(detail, 'groupIndex');
|
|
577
|
+
if (typeof groupIndex !== 'number' || !Number.isInteger(groupIndex) || groupIndex < 0)
|
|
606
578
|
return undefined;
|
|
607
|
-
|
|
579
|
+
if (reasonRaw === 'invalid_regex')
|
|
580
|
+
return Object.freeze({ reason: 'invalid_regex', event, groupIndex });
|
|
581
|
+
const budget = readOwnDataValue(detail, 'budgetMs');
|
|
582
|
+
return Object.freeze({
|
|
583
|
+
reason: 'over_budget',
|
|
584
|
+
event,
|
|
585
|
+
groupIndex,
|
|
586
|
+
...(typeof budget === 'number' && Number.isFinite(budget) && budget > 0 ? { budgetMs: budget } : {}),
|
|
587
|
+
});
|
|
608
588
|
}
|
|
609
589
|
catch {
|
|
610
590
|
return undefined;
|
|
@@ -617,3 +597,17 @@ export function autonomyLaneRefusalContent() {
|
|
|
617
597
|
return ('The engine did not start this leader run: this deployment runs in plan-only autonomy, and a leader run has no way to have its plan reviewed, ' +
|
|
618
598
|
'so nothing was started · Submit the work as a regular run instead, or ask whoever operates the engine to change its autonomy setting');
|
|
619
599
|
}
|
|
600
|
+
export function userAttachmentRefusalFromError(err) {
|
|
601
|
+
return effectiveWireErrorCode(err) === USER_ATTACHMENT_INVALID_ERROR_CODE ? { code: USER_ATTACHMENT_INVALID_ERROR_CODE, retryable: false } : null;
|
|
602
|
+
}
|
|
603
|
+
export function userAttachmentRefusalContent() {
|
|
604
|
+
return ('This message was not sent: the engine refused the files attached to it — together with the message they are more than it can take in one request on this model, ' +
|
|
605
|
+
'or one of them is in a form it does not accept · Nothing was started and your draft is kept · Remove some attachments or attach smaller parts, then send it again');
|
|
606
|
+
}
|
|
607
|
+
export function userInvokedSkillRefusalFromError(err) {
|
|
608
|
+
return effectiveWireErrorCode(err) === USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE ? { code: USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE, retryable: false } : null;
|
|
609
|
+
}
|
|
610
|
+
export function userInvokedSkillRefusalContent() {
|
|
611
|
+
return ('The engine did not start this run: a skill named for it is not one this run has loaded, or skills are turned off for this run · ' +
|
|
612
|
+
'Nothing was started and your draft is kept · Check the skill name, or load that skill, then send it again');
|
|
613
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { UiLanguage } from './env/uiLanguage.js';
|
|
1
2
|
export type WorkflowsJournalReading = {
|
|
2
3
|
kind: 'unobserved';
|
|
3
4
|
} | {
|
|
@@ -10,10 +11,6 @@ export type WorkflowsJournalReading = {
|
|
|
10
11
|
kind: 'present';
|
|
11
12
|
};
|
|
12
13
|
export declare function projectWorkflowsJournalCapability(caps: unknown): WorkflowsJournalReading | undefined;
|
|
13
|
-
export declare function noteEngineCapsForWorkflowsJournal(baseUrl: string, caps: unknown, opts?: {
|
|
14
|
-
generation?: number;
|
|
15
|
-
}): void;
|
|
16
14
|
export declare function observedWorkflowsJournal(baseUrl?: string | undefined): WorkflowsJournalReading;
|
|
17
15
|
export declare function workflowsJournalAvailable(reading: WorkflowsJournalReading): 'yes' | 'no' | 'unknown';
|
|
18
|
-
export declare function workflowsJournalDoctorDetail(reading: WorkflowsJournalReading): string;
|
|
19
|
-
export declare function __resetWorkflowsJournalReadingsForTests(): void;
|
|
16
|
+
export declare function workflowsJournalDoctorDetail(reading: WorkflowsJournalReading, lang?: UiLanguage): string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { engineWireTarget } from './engineWireTarget.js';
|
|
2
2
|
import { createEngineCapReader, unreadableReadingDetail } from './engineCapReader.js';
|
|
3
|
+
import { msg, renderMessage } from './i18n/translate.js';
|
|
3
4
|
import { ownDataField } from './ownKey.js';
|
|
4
5
|
export function projectWorkflowsJournalCapability(caps) {
|
|
5
6
|
try {
|
|
@@ -20,9 +21,6 @@ const reader = createEngineCapReader({
|
|
|
20
21
|
name: 'workflowsJournal',
|
|
21
22
|
project: projectWorkflowsJournalCapability,
|
|
22
23
|
});
|
|
23
|
-
export function noteEngineCapsForWorkflowsJournal(baseUrl, caps, opts) {
|
|
24
|
-
reader.note(baseUrl, caps, opts);
|
|
25
|
-
}
|
|
26
24
|
export function observedWorkflowsJournal(baseUrl = engineWireTarget()?.baseUrl) {
|
|
27
25
|
return reader.observed(baseUrl);
|
|
28
26
|
}
|
|
@@ -33,20 +31,18 @@ export function workflowsJournalAvailable(reading) {
|
|
|
33
31
|
return 'no';
|
|
34
32
|
return 'unknown';
|
|
35
33
|
}
|
|
36
|
-
export function workflowsJournalDoctorDetail(reading) {
|
|
34
|
+
export function workflowsJournalDoctorDetail(reading, lang) {
|
|
35
|
+
const subject = msg('notice.capability.subject.workflowsJournal');
|
|
37
36
|
switch (reading.kind) {
|
|
38
37
|
case 'unreadable':
|
|
39
|
-
return unreadableReadingDetail(
|
|
38
|
+
return unreadableReadingDetail(renderMessage(subject, lang), lang);
|
|
40
39
|
case 'unobserved':
|
|
41
|
-
return
|
|
40
|
+
return renderMessage(msg('notice.capability.unobserved', { subject, key: 'workflowsJournal' }), lang);
|
|
42
41
|
case 'not_reported':
|
|
43
|
-
return '
|
|
42
|
+
return renderMessage(msg('notice.capability.workflowsJournal.notReported'), lang);
|
|
44
43
|
case 'absent':
|
|
45
|
-
return '
|
|
44
|
+
return renderMessage(msg('notice.capability.workflowsJournal.absent'), lang);
|
|
46
45
|
case 'present':
|
|
47
|
-
return '
|
|
46
|
+
return renderMessage(msg('notice.capability.workflowsJournal.present'), lang);
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
|
-
export function __resetWorkflowsJournalReadingsForTests() {
|
|
51
|
-
reader.__resetForTests();
|
|
52
|
-
}
|
|
@@ -24,10 +24,6 @@ export interface WriteProtectionPostureView {
|
|
|
24
24
|
droppedDefaultRows?: readonly string[];
|
|
25
25
|
}
|
|
26
26
|
export declare function projectWriteProtectionPosture(wiring: unknown): WriteProtectionPostureView | undefined;
|
|
27
|
-
export declare function noteEngineCapsForWriteProtection(baseUrl: string, caps: unknown, opts?: {
|
|
28
|
-
generation?: number;
|
|
29
|
-
}): void;
|
|
30
27
|
export declare function observedWriteProtection(baseUrl?: string | undefined): WriteProtectionReading;
|
|
31
28
|
export declare function writeProtectionDoctorDetail(reading: WriteProtectionReading): string;
|
|
32
29
|
export declare function writeProtectionPostureDetail(posture: WriteProtectionPostureView): string;
|
|
33
|
-
export declare function __resetWriteProtectionReadingsForTests(): void;
|
|
@@ -66,9 +66,6 @@ const reader = createEngineCapReader({
|
|
|
66
66
|
name: 'writeProtection',
|
|
67
67
|
project: projectWriteProtectionCapability,
|
|
68
68
|
});
|
|
69
|
-
export function noteEngineCapsForWriteProtection(baseUrl, caps, opts) {
|
|
70
|
-
reader.note(baseUrl, caps, opts);
|
|
71
|
-
}
|
|
72
69
|
export function observedWriteProtection(baseUrl = engineWireTarget()?.baseUrl) {
|
|
73
70
|
return reader.observed(baseUrl);
|
|
74
71
|
}
|
|
@@ -113,6 +110,3 @@ export function writeProtectionPostureDetail(posture) {
|
|
|
113
110
|
: '';
|
|
114
111
|
return `source ${source} · ${String(posture.rows.length)} ${posture.rows.length === 1 ? 'name' : 'names'}: ${shown}${more}${dropped}`;
|
|
115
112
|
}
|
|
116
|
-
export function __resetWriteProtectionReadingsForTests() {
|
|
117
|
-
reader.__resetForTests();
|
|
118
|
-
}
|