@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
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { UiLanguage } from './env/uiLanguage.js';
|
|
2
|
+
import type { ResumeStartupCause } from '@sema-agent/sdk';
|
|
1
3
|
import { RESUME_CONTEXT_UNAVAILABLE, CHECKPOINT_UNSUPPORTED_VERSION, CHECKPOINT_WALLTIME_AXIS_RETIRED, CHECKPOINT_CONFIG_REFUSED } from './engineErrorCodes.js';
|
|
2
4
|
export declare const RESUME_REFUSAL_CODES: readonly string[];
|
|
3
5
|
export interface ResumeRefusalDetail {
|
|
@@ -6,7 +8,7 @@ export interface ResumeRefusalDetail {
|
|
|
6
8
|
waitable: boolean;
|
|
7
9
|
}
|
|
8
10
|
export declare function resumeRefusalFromError(err: unknown): ResumeRefusalDetail | null;
|
|
9
|
-
export declare function resumeRefusalContent(detail: ResumeRefusalDetail): string;
|
|
11
|
+
export declare function resumeRefusalContent(detail: ResumeRefusalDetail, lang?: UiLanguage): string;
|
|
10
12
|
export interface ResumePolicyBlockDetail {
|
|
11
13
|
blockedBy: {
|
|
12
14
|
kind: 'named';
|
|
@@ -18,7 +20,7 @@ export interface ResumePolicyBlockDetail {
|
|
|
18
20
|
};
|
|
19
21
|
}
|
|
20
22
|
export declare function resumePolicyBlockFromError(err: unknown): ResumePolicyBlockDetail | null;
|
|
21
|
-
export declare function resumePolicyBlockContent(detail: ResumePolicyBlockDetail): string;
|
|
23
|
+
export declare function resumePolicyBlockContent(detail: ResumePolicyBlockDetail, lang?: UiLanguage): string;
|
|
22
24
|
export { resumeReopenFromError, resumeReopenContent } from './hitl/suspendedReopen.js';
|
|
23
25
|
export type { ResumeReopenDetail } from './hitl/suspendedReopen.js';
|
|
24
26
|
export type RequireExistingSessionRefusalForm = 'session_not_found' | 'session_id_missing';
|
|
@@ -27,26 +29,28 @@ export interface RequireExistingSessionRefusalDetail {
|
|
|
27
29
|
readonly form: RequireExistingSessionRefusalForm;
|
|
28
30
|
}
|
|
29
31
|
export declare function requireExistingSessionRefusalFromError(err: unknown): RequireExistingSessionRefusalDetail | null;
|
|
30
|
-
export declare function requireExistingSessionRefusalContent(detail: Pick<RequireExistingSessionRefusalDetail, 'form'
|
|
32
|
+
export declare function requireExistingSessionRefusalContent(detail: Pick<RequireExistingSessionRefusalDetail, 'form'>, lang?: UiLanguage): string;
|
|
31
33
|
export interface ResumeContextUnavailableDetail {
|
|
32
34
|
code: typeof RESUME_CONTEXT_UNAVAILABLE;
|
|
33
35
|
staleAfterSec?: number;
|
|
34
36
|
runId?: string;
|
|
35
37
|
}
|
|
36
38
|
export declare function resumeContextUnavailableFromError(err: unknown): ResumeContextUnavailableDetail | null;
|
|
37
|
-
export declare function resumeContextUnavailableContent(d: ResumeContextUnavailableDetail): string;
|
|
39
|
+
export declare function resumeContextUnavailableContent(d: ResumeContextUnavailableDetail, lang?: UiLanguage): string;
|
|
38
40
|
export type ParkedResumeStartupDecision = 'approve' | 'deny';
|
|
39
41
|
export type ParkedResumeStartupCause = 'resume_rejected' | 'undetermined';
|
|
40
42
|
export interface ParkedResumeStartupDetail {
|
|
41
43
|
code: string;
|
|
42
44
|
cause: ParkedResumeStartupCause;
|
|
43
45
|
taskId?: string;
|
|
44
|
-
startupCause?:
|
|
46
|
+
startupCause?: ResumeStartupCause | ResumeCauseCoreAhead;
|
|
45
47
|
resendable: false;
|
|
46
48
|
denyStaysOpen: true;
|
|
47
49
|
}
|
|
50
|
+
declare const RESUME_CAUSE_CORE_AHEAD: readonly ["transcript_corrupt"];
|
|
51
|
+
type ResumeCauseCoreAhead = (typeof RESUME_CAUSE_CORE_AHEAD)[number];
|
|
48
52
|
export declare function parkedResumeStartupFromError(err: unknown, decision?: ParkedResumeStartupDecision): ParkedResumeStartupDetail | null;
|
|
49
|
-
export declare function parkedResumeStartupContent(detail: ParkedResumeStartupDetail): string;
|
|
53
|
+
export declare function parkedResumeStartupContent(detail: ParkedResumeStartupDetail, lang?: UiLanguage): string;
|
|
50
54
|
export interface CheckpointUnsupportedVersionDetail {
|
|
51
55
|
code: 'checkpoint.unsupported_version';
|
|
52
56
|
retriable: true;
|
|
@@ -59,7 +63,7 @@ export interface CheckpointUnsupportedVersionContext {
|
|
|
59
63
|
readonly parkKind?: CheckpointUnsupportedParkKind;
|
|
60
64
|
readonly runId?: string;
|
|
61
65
|
}
|
|
62
|
-
export declare function checkpointUnsupportedVersionContent(detail: CheckpointUnsupportedVersionDetail, ctx?: CheckpointUnsupportedVersionContext): string;
|
|
66
|
+
export declare function checkpointUnsupportedVersionContent(detail: CheckpointUnsupportedVersionDetail, ctx?: CheckpointUnsupportedVersionContext, lang?: UiLanguage): string;
|
|
63
67
|
export type RefusedParkCode = typeof CHECKPOINT_UNSUPPORTED_VERSION | typeof CHECKPOINT_WALLTIME_AXIS_RETIRED | typeof CHECKPOINT_CONFIG_REFUSED;
|
|
64
68
|
export interface RefusedParkFacts {
|
|
65
69
|
readonly code: RefusedParkCode;
|
|
@@ -73,5 +77,5 @@ export interface RefusedParkContentInput {
|
|
|
73
77
|
readonly lane: 'interactive' | 'print';
|
|
74
78
|
readonly runId?: string;
|
|
75
79
|
}
|
|
76
|
-
export declare function refusedParkContent(input: RefusedParkContentInput): string;
|
|
77
|
-
export declare function refusedParkBlockedContent(taskId: string, lane?: 'interactive' | 'print'): string;
|
|
80
|
+
export declare function refusedParkContent(input: RefusedParkContentInput, lang?: UiLanguage): string;
|
|
81
|
+
export declare function refusedParkBlockedContent(taskId: string, lane?: 'interactive' | 'print', lang?: UiLanguage): string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { msg, renderMessage } from './i18n/translate.js';
|
|
2
|
+
import { readBlockedBy, readErrorNumber, readErrorString, readThrownSlot } from './wireFailureShape.js';
|
|
3
|
+
import { guardedRead, ownDataField, readOwnDataNonEmptyString, readOwnDataValue } from './ownKey.js';
|
|
4
|
+
import { CORE_RESUME_STARTUP_CAUSES } from './generated/engineFactTables.js';
|
|
3
5
|
import { RESUME_CONTEXT_UNAVAILABLE, RESUME_PLACEMENT_MISMATCH, RESUME_PREFLIGHT_REJECTED, RESUME_POLICY_FOLD_CODE, PARKED_RESUME_STARTUP_FAILED, isStatusDerivedCoarseCode, RESUME_SESSION_NOT_FOUND, REQUEST_FIELD_CONFLICT, CHECKPOINT_UNSUPPORTED_VERSION, CHECKPOINT_WALLTIME_AXIS_RETIRED, CHECKPOINT_CONFIG_REFUSED, isRefusedParkCode, refusalSaysStillPending, refusalRetriableReading, } from './engineErrorCodes.js';
|
|
4
6
|
import { capForDisplay } from './fleetTaskDesc.js';
|
|
5
7
|
import { engineVersionTier } from './supportFloor.js';
|
|
@@ -26,51 +28,30 @@ export function resumeRefusalFromError(err) {
|
|
|
26
28
|
...(timed.retryAfterSec !== undefined ? { retryAfterSec: timed.retryAfterSec } : {}),
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
|
-
export function resumeRefusalContent(detail) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
parts.push('The engine refused it before consuming anything — the parked work is untouched');
|
|
34
|
-
parts.push('Retry with the recorded root, or omit the placement root to inherit it');
|
|
35
|
-
return parts.join(' · ');
|
|
36
|
-
}
|
|
37
|
-
parts.push("The deployment's resume preflight refused this attempt");
|
|
38
|
-
parts.push('The refusal happened before the commit — your decision was not consumed');
|
|
39
|
-
parts.push(detail.waitable
|
|
40
|
-
? 'The engine supplied a wait, so this token stays redeemable once the obstacle clears'
|
|
41
|
-
:
|
|
42
|
-
'The engine supplied no wait, so this refusal does not say whether the token stays redeemable');
|
|
43
|
-
return parts.join(' · ');
|
|
31
|
+
export function resumeRefusalContent(detail, lang) {
|
|
32
|
+
if (detail.code === RESUME_PLACEMENT_MISMATCH)
|
|
33
|
+
return renderMessage(msg('resume.refusal.placementMismatch'), lang);
|
|
34
|
+
return renderMessage(msg(detail.waitable ? 'resume.refusal.preflightWaitable' : 'resume.refusal.preflightNoWait'), lang);
|
|
44
35
|
}
|
|
45
36
|
export function resumePolicyBlockFromError(err) {
|
|
46
37
|
if (typeof err !== 'object' || err === null)
|
|
47
38
|
return null;
|
|
48
39
|
const o = err;
|
|
49
|
-
|
|
50
|
-
try {
|
|
51
|
-
outer = o['errorCode'];
|
|
52
|
-
}
|
|
53
|
-
catch {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
40
|
+
const outer = guardedRead(() => ownDataField(err, 'errorCode'));
|
|
56
41
|
if (outer !== RESUME_POLICY_FOLD_CODE)
|
|
57
42
|
return null;
|
|
58
43
|
return { blockedBy: readBlockedBy(o) };
|
|
59
44
|
}
|
|
60
|
-
export function resumePolicyBlockContent(detail) {
|
|
45
|
+
export function resumePolicyBlockContent(detail, lang) {
|
|
61
46
|
const b = detail.blockedBy;
|
|
62
47
|
const reason = b.kind === 'named'
|
|
63
48
|
? isStatusDerivedCoarseCode(b.code)
|
|
64
|
-
?
|
|
65
|
-
:
|
|
49
|
+
? msg('resume.refusal.policyBlockReason.coarse', { code: b.code })
|
|
50
|
+
: msg('resume.refusal.policyBlockReason.named', { code: capForDisplay(b.code, 80) })
|
|
66
51
|
: b.kind === 'absent'
|
|
67
|
-
? '
|
|
68
|
-
: '
|
|
69
|
-
return
|
|
70
|
-
'The engine refused to resume this parked work at its admission check (the engine reports that its admission policy changed since the work was first accepted)',
|
|
71
|
-
reason,
|
|
72
|
-
"This refusal does not say whether anything was consumed before it or whether a retry would pass — check the task's current state before deciding again, and ask whoever operates this deployment if it keeps happening",
|
|
73
|
-
].join(' · ');
|
|
52
|
+
? msg('resume.refusal.policyBlockReason.absent')
|
|
53
|
+
: msg('resume.refusal.policyBlockReason.unreadable');
|
|
54
|
+
return renderMessage(msg('resume.refusal.policyBlock', { reason }), lang);
|
|
74
55
|
}
|
|
75
56
|
export { resumeReopenFromError, resumeReopenContent } from './hitl/suspendedReopen.js';
|
|
76
57
|
const REQUIRE_EXISTING_BY_STATUS = new Map([
|
|
@@ -81,27 +62,29 @@ export function requireExistingSessionRefusalFromError(err) {
|
|
|
81
62
|
if (typeof err !== 'object' || err === null)
|
|
82
63
|
return null;
|
|
83
64
|
try {
|
|
84
|
-
const
|
|
85
|
-
const status = o['status'];
|
|
65
|
+
const status = readThrownSlot(err, 'status', 'data');
|
|
86
66
|
const byStatus = typeof status === 'number' ? REQUIRE_EXISTING_BY_STATUS.get(status) : undefined;
|
|
87
67
|
if (byStatus === undefined)
|
|
88
68
|
return null;
|
|
89
|
-
return
|
|
69
|
+
return readThrownSlot(err, 'errorCode', 'data') === byStatus.code ? Object.freeze({ code: RESUME_SESSION_NOT_FOUND, form: byStatus.form }) : null;
|
|
90
70
|
}
|
|
91
71
|
catch {
|
|
92
72
|
return null;
|
|
93
73
|
}
|
|
94
74
|
}
|
|
95
|
-
const
|
|
96
|
-
session_not_found: '
|
|
97
|
-
session_id_missing: '
|
|
75
|
+
const REQUIRE_EXISTING_SESSION_KEYS = Object.freeze({
|
|
76
|
+
session_not_found: 'resume.refusal.requireExisting.sessionNotFound',
|
|
77
|
+
session_id_missing: 'resume.refusal.requireExisting.sessionIdMissing',
|
|
98
78
|
});
|
|
99
|
-
const REQUIRE_EXISTING_SESSION_GENERIC = '
|
|
100
|
-
export function requireExistingSessionRefusalContent(detail) {
|
|
79
|
+
const REQUIRE_EXISTING_SESSION_GENERIC = 'resume.refusal.requireExisting.generic';
|
|
80
|
+
export function requireExistingSessionRefusalContent(detail, lang) {
|
|
81
|
+
return renderMessage(msg(requireExistingSessionKey(detail)), lang);
|
|
82
|
+
}
|
|
83
|
+
function requireExistingSessionKey(detail) {
|
|
101
84
|
try {
|
|
102
85
|
const form = detail?.form;
|
|
103
|
-
return typeof form === 'string' && Object.hasOwn(
|
|
104
|
-
?
|
|
86
|
+
return typeof form === 'string' && Object.hasOwn(REQUIRE_EXISTING_SESSION_KEYS, form)
|
|
87
|
+
? REQUIRE_EXISTING_SESSION_KEYS[form]
|
|
105
88
|
: REQUIRE_EXISTING_SESSION_GENERIC;
|
|
106
89
|
}
|
|
107
90
|
catch {
|
|
@@ -111,8 +94,7 @@ export function requireExistingSessionRefusalContent(detail) {
|
|
|
111
94
|
export function resumeContextUnavailableFromError(err) {
|
|
112
95
|
if (typeof err !== 'object' || err === null)
|
|
113
96
|
return null;
|
|
114
|
-
|
|
115
|
-
if (e.errorCode !== RESUME_CONTEXT_UNAVAILABLE)
|
|
97
|
+
if (readThrownSlot(err, 'errorCode', 'data') !== RESUME_CONTEXT_UNAVAILABLE)
|
|
116
98
|
return null;
|
|
117
99
|
const sec = readErrorNumber(err, 'staleAfterSec');
|
|
118
100
|
const staleSec = sec !== undefined && Number.isInteger(sec) && sec >= 1 ? sec : undefined;
|
|
@@ -124,17 +106,11 @@ export function resumeContextUnavailableFromError(err) {
|
|
|
124
106
|
...(runId !== undefined ? { runId } : {}),
|
|
125
107
|
};
|
|
126
108
|
}
|
|
127
|
-
export function resumeContextUnavailableContent(d) {
|
|
109
|
+
export function resumeContextUnavailableContent(d, lang) {
|
|
128
110
|
const sec = d.staleAfterSec;
|
|
129
|
-
const retention = typeof sec === 'number' && Number.isSafeInteger(sec) && sec >= 1 ?
|
|
130
|
-
const third = (d.runId !== undefined
|
|
131
|
-
|
|
132
|
-
: 'The error carries no run id: go back to the run list, find this run and recover it yourself, then decide again; raising the conversation retention time only prevents this from happening again and cannot rescue this one') + retention;
|
|
133
|
-
return [
|
|
134
|
-
'This approval has nowhere to be delivered: the conversation that started this run has no usable context to continue it right now',
|
|
135
|
-
'Nothing was decided and your decision was not consumed; this card is still waiting',
|
|
136
|
-
third,
|
|
137
|
-
].join(' · ');
|
|
111
|
+
const retention = typeof sec === 'number' && Number.isSafeInteger(sec) && sec >= 1 ? msg('resume.refusal.contextRetention', { sec }) : '';
|
|
112
|
+
const third = msg(d.runId !== undefined ? 'resume.refusal.contextThird.withRun' : 'resume.refusal.contextThird.noRun', { retention });
|
|
113
|
+
return renderMessage(msg('resume.refusal.contextUnavailable', { third }), lang);
|
|
138
114
|
}
|
|
139
115
|
function parkedResumeStartupCauseWord(err) {
|
|
140
116
|
let named;
|
|
@@ -144,8 +120,14 @@ function parkedResumeStartupCauseWord(err) {
|
|
|
144
120
|
catch {
|
|
145
121
|
named = undefined;
|
|
146
122
|
}
|
|
147
|
-
return named;
|
|
123
|
+
return isResumeStartupCause(named) ? named : undefined;
|
|
124
|
+
}
|
|
125
|
+
function isResumeStartupCause(v) {
|
|
126
|
+
return typeof v === 'string' && CORE_RESUME_STARTUP_CAUSES.includes(v);
|
|
148
127
|
}
|
|
128
|
+
const RESUME_CAUSE_CORE_AHEAD = Object.freeze(['transcript_corrupt']);
|
|
129
|
+
const _startupCausePin = true;
|
|
130
|
+
void _startupCausePin;
|
|
149
131
|
export function parkedResumeStartupFromError(err, decision) {
|
|
150
132
|
if (typeof err !== 'object' || err === null)
|
|
151
133
|
return null;
|
|
@@ -170,32 +152,28 @@ export function parkedResumeStartupFromError(err, decision) {
|
|
|
170
152
|
denyStaysOpen: true,
|
|
171
153
|
};
|
|
172
154
|
}
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
'The engine could not start the parked work to apply this decision (its session may be gone, or the engine rejected the decision itself; this client cannot tell which)',
|
|
177
|
-
PARKED_RESUME_STARTUP_STATE,
|
|
178
|
-
'If the card is still there, decide it again from the fresh list',
|
|
179
|
-
].join(' · '),
|
|
180
|
-
undetermined: [
|
|
181
|
-
'The engine could not start the parked work to apply this decision',
|
|
182
|
-
PARKED_RESUME_STARTUP_STATE,
|
|
183
|
-
'If the card is still there: when the engine rejected the decision itself (for example an answer given to the wrong question), correct it and decide again; when the approved tool is one the agent inherits from the task that started it, approving it again will not work on this server — deny the card, or wait for a server upgrade',
|
|
184
|
-
].join(' · '),
|
|
155
|
+
const PARKED_RESUME_STARTUP_KEYS = Object.freeze({
|
|
156
|
+
resume_rejected: 'resume.refusal.startup.resumeRejected',
|
|
157
|
+
undetermined: 'resume.refusal.startup.undetermined',
|
|
185
158
|
});
|
|
186
|
-
|
|
187
|
-
|
|
159
|
+
const PARKED_RESUME_STARTUP_CAUSE_KEYS = Object.freeze({
|
|
160
|
+
environment: 'resume.refusal.startup.cause.environment',
|
|
161
|
+
session_gone: 'resume.refusal.startup.cause.sessionGone',
|
|
162
|
+
tool_unavailable: 'resume.refusal.startup.cause.toolUnavailable',
|
|
163
|
+
configuration: 'resume.refusal.startup.cause.configuration',
|
|
164
|
+
decision_rejected: 'resume.refusal.startup.cause.decisionRejected',
|
|
165
|
+
transcript_corrupt: 'resume.refusal.startup.cause.transcriptCorrupt',
|
|
166
|
+
});
|
|
167
|
+
export function parkedResumeStartupContent(detail, lang) {
|
|
168
|
+
const word = guardedRead(() => readOwnDataValue(detail, 'startupCause'));
|
|
169
|
+
if (isResumeStartupCause(word))
|
|
170
|
+
return renderMessage(msg(PARKED_RESUME_STARTUP_CAUSE_KEYS[word]), lang);
|
|
171
|
+
return renderMessage(msg(detail.cause === 'resume_rejected' ? PARKED_RESUME_STARTUP_KEYS.resume_rejected : PARKED_RESUME_STARTUP_KEYS.undetermined), lang);
|
|
188
172
|
}
|
|
189
173
|
export function checkpointUnsupportedVersionFromError(err) {
|
|
190
174
|
if (typeof err !== 'object' || err === null)
|
|
191
175
|
return null;
|
|
192
|
-
|
|
193
|
-
try {
|
|
194
|
-
code = err.errorCode;
|
|
195
|
-
}
|
|
196
|
-
catch {
|
|
197
|
-
return null;
|
|
198
|
-
}
|
|
176
|
+
const code = guardedRead(() => ownDataField(err, 'errorCode'));
|
|
199
177
|
if (code !== CHECKPOINT_UNSUPPORTED_VERSION || !refusalSaysStillPending(err))
|
|
200
178
|
return null;
|
|
201
179
|
const writerVersion = readErrorString(err, 'writerVersion');
|
|
@@ -221,10 +199,7 @@ function checkpointUnsupportedHasRun(kind) {
|
|
|
221
199
|
return undefined;
|
|
222
200
|
}
|
|
223
201
|
}
|
|
224
|
-
|
|
225
|
-
const CHECKPOINT_UNSUPPORTED_STILL_WAITING = 'Nothing was decided or resumed and the parked work is still waiting, but sending the same request again will not by itself continue it';
|
|
226
|
-
const CHECKPOINT_UNSUPPORTED_DRAIN = " — whoever operates this deployment can find such parked work before an upgrade with the server's pre-upgrade drain check";
|
|
227
|
-
export function checkpointUnsupportedVersionContent(detail, ctx) {
|
|
202
|
+
export function checkpointUnsupportedVersionContent(detail, ctx, lang) {
|
|
228
203
|
let writer;
|
|
229
204
|
let reader;
|
|
230
205
|
try {
|
|
@@ -236,11 +211,7 @@ export function checkpointUnsupportedVersionContent(detail, ctx) {
|
|
|
236
211
|
reader = undefined;
|
|
237
212
|
}
|
|
238
213
|
if (writerEngineIsNewer(writer, reader)) {
|
|
239
|
-
return
|
|
240
|
-
`This parked work was stored by a newer engine version (${String(writer)}) than this engine (${String(reader)})`,
|
|
241
|
-
CHECKPOINT_UNSUPPORTED_STILL_WAITING,
|
|
242
|
-
`Continue it on an engine at version ${String(writer)} or newer`,
|
|
243
|
-
].join(' · ');
|
|
214
|
+
return renderMessage(msg('resume.refusal.checkpoint.newerEngine', { writer: String(writer), reader: String(reader) }), lang);
|
|
244
215
|
}
|
|
245
216
|
let kind;
|
|
246
217
|
let runId;
|
|
@@ -255,17 +226,16 @@ export function checkpointUnsupportedVersionContent(detail, ctx) {
|
|
|
255
226
|
const hasRun = checkpointUnsupportedHasRun(kind);
|
|
256
227
|
let outlet;
|
|
257
228
|
if (hasRun === true) {
|
|
258
|
-
const named = typeof runId === 'string' && runId.length > 0 ?
|
|
259
|
-
outlet =
|
|
229
|
+
const named = typeof runId === 'string' && runId.length > 0 ? msg('resume.refusal.checkpoint.runNamed', { runId: capForDisplay(runId, 80) }) : '';
|
|
230
|
+
outlet = msg('resume.refusal.checkpoint.outletWithRun', { named });
|
|
260
231
|
}
|
|
261
232
|
else if (hasRun === false) {
|
|
262
|
-
outlet = '
|
|
233
|
+
outlet = msg('resume.refusal.checkpoint.outletNoRun');
|
|
263
234
|
}
|
|
264
235
|
else {
|
|
265
|
-
outlet =
|
|
266
|
-
'If it was parked before this server was upgraded, submit the work again as a new task (this client cannot tell which kind of parked work this is, so both ways out are given): when it still has a run waiting on it (a tool approval, a plan review or a paused resource), cancel that run first; when it was waiting to be woken up, or was a workflow step continuing its host conversation, there is no run to cancel, so start a new task in that conversation';
|
|
236
|
+
outlet = msg('resume.refusal.checkpoint.outletUnknownKind');
|
|
267
237
|
}
|
|
268
|
-
return
|
|
238
|
+
return renderMessage(msg('resume.refusal.checkpoint.content', { outlet }), lang);
|
|
269
239
|
}
|
|
270
240
|
const REFUSED_PARK_FIELD_TOKEN = /^[A-Za-z][A-Za-z0-9_]{0,63}$/;
|
|
271
241
|
export function refusedParkFromError(failure) {
|
|
@@ -300,16 +270,14 @@ function refusedParkShownRunId(runId) {
|
|
|
300
270
|
function refusedParkWhy(code, field) {
|
|
301
271
|
switch (code) {
|
|
302
272
|
case CHECKPOINT_WALLTIME_AXIS_RETIRED:
|
|
303
|
-
return '
|
|
273
|
+
return msg('resume.refusal.park.whyWalltime');
|
|
304
274
|
case CHECKPOINT_CONFIG_REFUSED:
|
|
305
|
-
return field === 'inheritedGate'
|
|
306
|
-
? 'the permission-mode setting it was parked with can no longer be read'
|
|
307
|
-
: 'the engine refuses the task configuration it was parked with';
|
|
275
|
+
return msg(field === 'inheritedGate' ? 'resume.refusal.park.whyInheritedGate' : 'resume.refusal.park.whyConfigRefused');
|
|
308
276
|
default:
|
|
309
|
-
return '
|
|
277
|
+
return msg('resume.refusal.park.whyUnsupported');
|
|
310
278
|
}
|
|
311
279
|
}
|
|
312
|
-
export function refusedParkContent(input) {
|
|
280
|
+
export function refusedParkContent(input, lang) {
|
|
313
281
|
let what;
|
|
314
282
|
let lane;
|
|
315
283
|
let runId;
|
|
@@ -334,30 +302,25 @@ export function refusedParkContent(input) {
|
|
|
334
302
|
rawCode = field = stillPending = undefined;
|
|
335
303
|
}
|
|
336
304
|
const code = rawCode === CHECKPOINT_WALLTIME_AXIS_RETIRED || rawCode === CHECKPOINT_CONFIG_REFUSED ? rawCode : CHECKPOINT_UNSUPPORTED_VERSION;
|
|
337
|
-
const shownWhat = typeof what === 'string' && what !== '' ? capForDisplay(what, 40) : '
|
|
305
|
+
const shownWhat = typeof what === 'string' && what !== '' ? capForDisplay(what, 40) : msg('resume.refusal.park.whatDefault');
|
|
338
306
|
const why = refusedParkWhy(code, typeof field === 'string' ? field : undefined);
|
|
339
307
|
const shownRun = refusedParkShownRunId(runId);
|
|
340
|
-
const head =
|
|
341
|
-
|
|
342
|
-
const configMayReturn = code === CHECKPOINT_CONFIG_REFUSED && field !== 'inheritedGate' ? ' If that configuration is restored, the same answer can go through again.' : '';
|
|
308
|
+
const head = msg('resume.refusal.park.head', { what: shownWhat, why });
|
|
309
|
+
const configMayReturn = code === CHECKPOINT_CONFIG_REFUSED && field !== 'inheritedGate' ? msg('resume.refusal.park.configMayReturn') : '';
|
|
343
310
|
if (lane === 'print') {
|
|
344
|
-
if (stillPending === false)
|
|
345
|
-
return
|
|
346
|
-
}
|
|
311
|
+
if (stillPending === false)
|
|
312
|
+
return renderMessage(msg('resume.refusal.park.printEnded', { head, code }), lang);
|
|
347
313
|
const cancel = `POST /v1/runs/${shownRun ?? '<run id>'}/cancel`;
|
|
348
|
-
return
|
|
349
|
-
}
|
|
350
|
-
if (stillPending === false) {
|
|
351
|
-
return `${head} The engine ended that parked run, so this conversation is free: send the work again as a new message.`;
|
|
314
|
+
return renderMessage(msg('resume.refusal.park.printHolds', { head, configMayReturn, code, cancel }), lang);
|
|
352
315
|
}
|
|
353
|
-
|
|
316
|
+
if (stillPending === false)
|
|
317
|
+
return renderMessage(msg('resume.refusal.park.interactiveEnded', { head }), lang);
|
|
318
|
+
return renderMessage(msg('resume.refusal.park.interactiveBusy', { head, configMayReturn }), lang);
|
|
354
319
|
}
|
|
355
|
-
export function refusedParkBlockedContent(taskId, lane = 'interactive') {
|
|
320
|
+
export function refusedParkBlockedContent(taskId, lane = 'interactive', lang) {
|
|
356
321
|
const runId = refusedParkShownRunId(taskId);
|
|
357
|
-
const
|
|
358
|
-
if (lane === 'print')
|
|
359
|
-
return
|
|
360
|
-
}
|
|
361
|
-
return (`${head} To free this conversation, send a message to bring the card back and answer it — sema then offers to cancel ` +
|
|
362
|
-
`that run, after which you can send the work again as a new message.`);
|
|
322
|
+
const run = runId ?? '<unknown>';
|
|
323
|
+
if (lane === 'print')
|
|
324
|
+
return renderMessage(msg('resume.refusal.park.blockedPrint', { run, cancel: `POST /v1/runs/${runId ?? '<run id>'}/cancel` }), lang);
|
|
325
|
+
return renderMessage(msg('resume.refusal.park.blockedInteractive', { run }), lang);
|
|
363
326
|
}
|
package/dist/retryStatus.d.ts
CHANGED
|
@@ -71,4 +71,49 @@ export interface BrainStatusPayload {
|
|
|
71
71
|
}
|
|
72
72
|
export declare const BRAIN_STATUS_PAYLOAD_KEYS: readonly ["phase", "detail", "retryInSec", "retryInMs", "attempt", "maxRetries", "errClass", "retryAtMs", "errorStatus", "elapsedMs", "timeoutMs", "providerCondition", "providerConditionSource"];
|
|
73
73
|
export declare function mapBrainStatusToRetry(p: BrainStatusPayload, nowMs: number): RetryStatus | null;
|
|
74
|
+
export interface RetryStatusArmLike {
|
|
75
|
+
readonly phase?: string;
|
|
76
|
+
readonly detail?: string;
|
|
77
|
+
readonly retryInSec?: number;
|
|
78
|
+
readonly retryInMs?: number;
|
|
79
|
+
readonly attempt?: number;
|
|
80
|
+
readonly maxRetries?: number;
|
|
81
|
+
readonly errClass?: string;
|
|
82
|
+
readonly retryAtMs?: number;
|
|
83
|
+
readonly errorStatus?: number;
|
|
84
|
+
readonly elapsedMs?: number;
|
|
85
|
+
readonly timeoutMs?: number;
|
|
86
|
+
readonly providerCondition?: string;
|
|
87
|
+
readonly providerConditionSource?: string;
|
|
88
|
+
readonly parentToolCallId?: string;
|
|
89
|
+
}
|
|
90
|
+
export declare function retryStatusFromArm(arm: RetryStatusArmLike | null | undefined, nowMs: number): RetryStatus | null | undefined;
|
|
91
|
+
export interface RetryStatusNotice {
|
|
92
|
+
readonly line: string;
|
|
93
|
+
readonly recourse?: 'switch_model' | 'wait' | 'fix_request';
|
|
94
|
+
readonly phase: 'retrying' | 'reconnecting' | 'waiting_first_token' | 'gave_up' | 'cleared';
|
|
95
|
+
}
|
|
96
|
+
export declare function retryStatusNotice(status: RetryStatus | null, ctx?: {
|
|
97
|
+
readonly modelName?: string;
|
|
98
|
+
}): RetryStatusNotice;
|
|
99
|
+
export interface ApiErrorRowLike {
|
|
100
|
+
readonly _sema_api_error_status?: number;
|
|
101
|
+
readonly _sema_provider_condition?: string;
|
|
102
|
+
readonly _sema_api_error_code?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface ApiErrorRowFacts {
|
|
105
|
+
readonly status?: number;
|
|
106
|
+
readonly providerCondition?: string;
|
|
107
|
+
readonly errorCode?: string;
|
|
108
|
+
}
|
|
109
|
+
export interface ApiErrorNotice {
|
|
110
|
+
readonly line: string;
|
|
111
|
+
readonly recourse?: NonNullable<RetryStatusNotice['recourse']> | 'check_credentials';
|
|
112
|
+
}
|
|
113
|
+
export interface ApiErrorNoticeCtx {
|
|
114
|
+
readonly modelName?: string;
|
|
115
|
+
readonly providerText?: string;
|
|
116
|
+
}
|
|
117
|
+
export declare function apiErrorFactsOfRow(row: ApiErrorRowLike | null | undefined): ApiErrorRowFacts;
|
|
118
|
+
export declare function apiErrorNotice(facts: ApiErrorRowFacts | null | undefined, ctx?: ApiErrorNoticeCtx): ApiErrorNotice | undefined;
|
|
74
119
|
export {};
|