@sema-agent/client-core 0.83.6 → 0.84.1
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 +176 -0
- package/README.md +20 -13
- package/dist/abortableSleep.d.ts +10 -0
- package/dist/abortableSleep.js +37 -0
- package/dist/adapt/wireShapes.js +3 -2
- package/dist/adapter/activeRunSelfHeal.js +7 -7
- package/dist/adapter/downstream/eventToSdkMessage.js +6 -2
- package/dist/adapter/downstream/terminalToSdkResult.d.ts +1 -0
- package/dist/adapter/downstream/terminalToSdkResult.js +10 -5
- package/dist/adapter/downstream/wiringManifestView.d.ts +3 -1
- package/dist/adapter/downstream/wiringManifestView.js +1 -0
- package/dist/agentSession/engineAgentRegistryRead.d.ts +18 -0
- package/dist/agentSession/engineAgentRegistryRead.js +167 -0
- package/dist/agentsWireCaps.js +10 -1
- package/dist/attachmentsWireCaps.js +2 -2
- package/dist/controlRouter.js +1 -1
- package/dist/decideFailureNote.d.ts +2 -1
- package/dist/decideFailureNote.js +5 -3
- package/dist/detachWire.d.ts +1 -0
- package/dist/detachWire.js +13 -5
- package/dist/displayUntrusted.js +114 -18
- package/dist/engineAgentAbsence.d.ts +37 -0
- package/dist/engineAgentAbsence.js +142 -0
- package/dist/engineErrorCodes.d.ts +2 -0
- package/dist/engineErrorCodes.js +9 -5
- package/dist/engineNoticeCodes.d.ts +43 -0
- package/dist/engineNoticeCodes.js +118 -5
- package/dist/engineWireSdk.d.ts +2 -0
- package/dist/fleet/fleetProjection.js +3 -2
- package/dist/frozenSet.d.ts +1 -0
- package/dist/frozenSet.js +20 -0
- package/dist/handsSeam.d.ts +3 -0
- package/dist/handsSeam.js +19 -0
- package/dist/hitl/askGateWire.d.ts +1 -1
- package/dist/hitl/askGateWire.js +1 -1
- package/dist/hitl/hitlHostSurface.js +1 -1
- package/dist/hitl/parkResolver.d.ts +1 -0
- package/dist/hitl/parkResolver.js +9 -3
- package/dist/hitl/planReviewWire.d.ts +30 -3
- package/dist/hitl/planReviewWire.js +139 -32
- package/dist/hitl/sessionPolicyDeliverable.d.ts +2 -0
- package/dist/hitl/sessionPolicyDeliverable.js +14 -3
- package/dist/hitl/sessionPolicyWire.d.ts +40 -0
- package/dist/hitl/sessionPolicyWire.js +210 -0
- package/dist/hitl/toolApprovalWire.js +2 -2
- package/dist/index.d.ts +24 -13
- package/dist/index.js +13 -13
- package/dist/liveInitToolFace.js +28 -10
- package/dist/model/catalogLoader.js +3 -3
- package/dist/model/tierVocabulary.js +1 -1
- package/dist/request/taskRequest.js +15 -5
- package/dist/resumeRefusalCopy.d.ts +11 -0
- package/dist/resumeRefusalCopy.js +39 -1
- package/dist/rewindWireCaps.d.ts +0 -1
- package/dist/seam.d.ts +2 -1
- package/dist/seatContract.js +2 -2
- package/dist/systemReminderTag.d.ts +5 -0
- package/dist/systemReminderTag.js +20 -9
- package/dist/toolResult.js +2 -6
- package/dist/toolRoster.d.ts +16 -0
- package/dist/toolRoster.js +46 -5
- package/dist/wireErrorTriage.js +1 -11
- package/dist/workflowClient.js +4 -3
- package/dist/workflowMonitor.d.ts +1 -1
- package/docs/INTEGRATION-CLIENTS.md +701 -37
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export * from './seam.js';
|
|
2
2
|
export * from './workflow.js';
|
|
3
|
-
export
|
|
3
|
+
export { _resetEngineTaskNotificationForTest, _resetNotificationQueuePortForTest, _setWatcherTimingForTest, _tickWatchOnceForTest, classifyHookFailureFrame, classifyHookNoticeFrame, deriveNotificationResidualLines, dropQueuedNotificationsForRun, enqueueBgChildNotification, enqueueEngineWorkflowNotification, enqueuePlanReviewOutcome, HOOK_NOTICE_WARN_PREFIX, hookNoticeLastCheckText, installBgTaskStatusProbe, installNotificationQueuePort, installWorkflowStatusProbe, isEngineWorkflowNotified, isHookNoticeFrame, isOwnWorkflowRun, isTaskNotificationObjective, isWorkflowCompletionCardEnqueued, listOwnWorkflowRuns, markEngineWorkflowNotified, normalizeTaskNotification, noteOwnWorkflowRun, noteWorkflowCompletionCardEnqueued, notificationDropCounters, notificationQueuePortMisses, outstandingAbandonedCount, outstandingBgTaskPrompt, outstandingDeliverableWorkflowCount, outstandingWorkflowCount, parseTranscriptNotificationSeeds, registerOutstandingBgTask, registerOutstandingWorkflowRun, renderTaskNotificationXml, splitApiErrorSupplement, subscribeOutstandingWorkflows, taskNotificationDedupKey, taskNotificationDedupKeyFromWire, taskNotificationDeliverySupplement, } from './notifications.js';
|
|
4
|
+
export type { EngineWorkflowCompletion, GoalHookNotice, HookEntryType, HookFailureNotice, HookFailureReason, HookFailureVerdict, HookNoticeReason, HookNoticeVerdict, HookNoticeWire, NotificationDropCounters, NotificationQueuePort, QueuedCommandLike, TaskNotificationFields, TranscriptNotificationSeeds, } from './notifications.js';
|
|
4
5
|
export * from './peerFrames.js';
|
|
5
6
|
export * from './steering.js';
|
|
6
|
-
export
|
|
7
|
+
export type { DiagnosticsAttachment, } from './diagnostics.js';
|
|
7
8
|
export * from './retryStatus.js';
|
|
8
9
|
export * from './sessionMemoryStatus.js';
|
|
9
10
|
export * from './memorySpecWire.js';
|
|
@@ -12,11 +13,13 @@ export * from './adapt/textSegmentAuthority.js';
|
|
|
12
13
|
export * from './engineHttpTools.js';
|
|
13
14
|
export * from './sdkWireTransit.js';
|
|
14
15
|
export { SEMA_SEGMENT_ID_KEY } from './adapt/textStream.js';
|
|
15
|
-
export
|
|
16
|
+
export { __resetSubagentContentStoreConfigForTests, __resetSubagentOwnerLedgerForTests, clearSubagentContent, coerceOutput, configureSubagentContentStore, getBgParentRun, getBgParentRunOwner, getBgTerminalFacts, getSubagentContentSnapshot, isOwnEngineRun, parentToolCallIdOf, planSubagentViewSlots, publishSubagentContentEvent, pushSubagentLocalEcho, recordBgParentRun, recordBgTerminalFacts, recordOwnEngineRun, recordSubagentOwner, recordSubagentOwnerFromProgress, registerSubagentAlias, settleSubagentContent, SUBAGENT_CONTENT_STORE_DEFAULTS, subagentContentStoreConfig, subagentOwnerSessionConflicts, subscribeSubagentContent, } from './subagentContentStore.js';
|
|
17
|
+
export type { BgTerminalFacts, SubagentContentEvent, SubagentContentItem, SubagentContentSnapshot, SubagentContentStoreConfig, SubagentOwnerRecord, SubagentOwnerSessionConflict, SubagentViewSlot, } from './subagentContentStore.js';
|
|
16
18
|
export * from './engineAgentPanelStore.js';
|
|
17
19
|
export * from './engineAgentAbsence.js';
|
|
18
20
|
export * from './fleetAgentPanelProjection.js';
|
|
19
|
-
export
|
|
21
|
+
export { _resetLiveQuestionStore, hasLocalQuestionResponder, hasQuestionOverlay, hasQuestionOverlayFor, onQuestionFrame, onQuestionFrameFor, publishQuestionFrame, publishQuestionFrameFor, registerLocalQuestionResponder, respondToQuestion, setQuestionRespond, } from './liveQuestionStore.js';
|
|
22
|
+
export type { AskQuestion, AskQuestionOption, QuestionAnswer, QuestionFrame, } from './liveQuestionStore.js';
|
|
20
23
|
export * from './engineInlineTaskStats.js';
|
|
21
24
|
export * from './printToolResultFrame.js';
|
|
22
25
|
export * from './engineCapsCache.js';
|
|
@@ -67,7 +70,9 @@ export * from './sseIdleTriage.js';
|
|
|
67
70
|
export * from './engineWireSdk.js';
|
|
68
71
|
export * from './classifierVerdictWire.js';
|
|
69
72
|
export { stripSystemReminderBlocks, unwrapSystemReminder } from './systemReminderTag.js';
|
|
70
|
-
export
|
|
73
|
+
export { findSystemReminderOpenTag, type SystemReminderOpenTagSpan } from './systemReminderTag.js';
|
|
74
|
+
export { ACTIVE_RUN_BUSY_ERROR_CODE, asModelFallbackReason, CAPABILITY_SELF_ORCHESTRATION_REQUIRED, CONFIG_DELEGATION_ENTRY_CAPS, CONFIG_LEGACY_TOOL_NAME, CONFIG_LIMIT_INVALID, CONFIG_LIMIT_UNKNOWN_KEY, CONFIG_MEMORY_PROJECT_KEY_SPELLING, CONFIG_MEMORY_WRITE_SCOPE_MISMATCH, CONFIG_REFUSAL_CODES, CONFIG_STRATEGY_FIND_LIMIT_INVALID, CONFIG_STRATEGY_MAX_SIZE_INVALID, DECIDE_WORKFLOW_HOST_UNKNOWN, DECIDE_WORKFLOW_LANE_CODES, DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, DELEGATION_CAP_CODES, DELEGATION_CONCURRENCY_CAP, DELEGATION_SESSION_CAP, delegationCapDispositionOf, DRAINING_ERROR_CODE, ENGINE_STOP_REASONS, engineStopReasonToCc, ENV_LIFETIME_EXPIRED, GATE_PARKED_ERROR_CODE, isConfigRefusalCode, isDelegationCapCode, isInterruptedToolEndCode, isLimitsExceededCode, isRewindFamilyCode, isWorkflowParkRefusalCode, LIMITS_MAX_COST_EXCEEDED, LIMITS_MAX_TOKENS_EXCEEDED, LIMITS_MAX_TURNS_EXCEEDED, LIMITS_MAX_WALLTIME_EXCEEDED, MCP_SERVER_REVOKED, MODEL_FALLBACK_INHERIT_NO_TIER_BINDING, OUTPUT_INVALID, PARKED_RESUME_STARTUP_FAILED, RESUME_AT_ERROR_CODE_PREFIX, RESUME_CONTEXT_UNAVAILABLE, RESUME_ENV_FAILED, RESUME_PLACEMENT_MISMATCH, RESUME_POLICY_FOLD_CODE, RESUME_PREFLIGHT_REJECTED, RESUME_REOPEN_CODES, RESUME_RETRY_LATER_CODES, RESUME_TOOL_CONTRACT_MISMATCH, RESUME_TOOL_UNAVAILABLE, RESUME_USAGE_WINDOW_EXHAUSTED, REWIND_ERROR_CODE_PREFIXES, SCENARIO_NOT_ALLOWED_ERROR_CODE, STOP_CONFLICT_CODES, STREAM_MAX_DURATION, TOOL_END_INTERRUPTED_NEVER_STARTED, TOOL_END_INTERRUPTED_OUTCOME_UNKNOWN, USAGE_WINDOW_EXHAUSTED, WORKFLOW_PARK_REFUSAL_CODES, } from './engineErrorCodes.js';
|
|
75
|
+
export type { DelegationCapDisposition, ModelFallbackReason, } from './engineErrorCodes.js';
|
|
71
76
|
export * from './agentsWireCaps.js';
|
|
72
77
|
export * from './attachmentsWireCaps.js';
|
|
73
78
|
export * from './clientContextWireCaps.js';
|
|
@@ -115,20 +120,23 @@ export * from './limitsWire.js';
|
|
|
115
120
|
export * from './interactiveToolsWire.js';
|
|
116
121
|
export * from './headlessPermissionModeWire.js';
|
|
117
122
|
export * from './headlessReconnectWire.js';
|
|
118
|
-
export
|
|
123
|
+
export { coerceTaskStatus, coerceWorkflowStatus, CONTROL_TOOL_VERBS, FLEET_TASK_ROW_KEYS_NOT_PROJECTED, FLEET_TASK_ROW_WIRE_KEYS, FLEET_TASK_VIEW_KEYS, FLEET_WORKFLOW_ROW_KEYS_NOT_PROJECTED, FLEET_WORKFLOW_ROW_WIRE_KEYS, FLEET_WORKFLOW_VIEW_KEYS, projectDescription, projectTasks, projectWorkflows, TERMINAL_FLEET_TASK_STATUSES, wireResumable, wireRowUsage, } from './fleet/fleetProjection.js';
|
|
124
|
+
export type { FleetRowUsage, FleetTaskStatus, FleetTaskView, FleetWorkflowView, NotProjectedEntry, ProjectTasksOptions, } from './fleet/fleetProjection.js';
|
|
119
125
|
export * from './fleet/fleetLedger.js';
|
|
120
126
|
export * from './fleet/workflowSizeWarning.js';
|
|
121
127
|
export * from './subagent/engineDelegatedPrompt.js';
|
|
122
128
|
export * from './subagent/engineRowStopGate.js';
|
|
123
129
|
export * from './subagent/engineSubagentOutput.js';
|
|
124
130
|
export * from './subagent/engineSubagentSteer.js';
|
|
125
|
-
export
|
|
131
|
+
export { __resetRetainWithoutWakeWarningForTests, auditRetainWithoutWake, classifySubagentResumeFailure, resolveOwnerRunId, resolveSubagentContinueTarget, resolveSubagentResumeContext, resumeSettledSubagent, SUBAGENT_RESUME_CAP, subagentResumeAvailable, } from './subagent/engineSubagentResume.js';
|
|
132
|
+
export type { RetainWithoutWakeInput, RetainWithoutWakeVerdict, SubagentOwnerContext, SubagentResumeContext, SubagentResumeFacade, SubagentResumeFailureKind, SubagentResumeFailureVerdict, SubagentResumeOutcome, } from './subagent/engineSubagentResume.js';
|
|
126
133
|
export * from './subagent/engineTaskHandleWire.js';
|
|
127
134
|
export * from './subagent/engineCompactWire.js';
|
|
128
135
|
export * from './subagent/engineSubagentTail.js';
|
|
129
|
-
export
|
|
136
|
+
export { __resetBgOwnerAbsenceForTests, } from './subagent/subagentOwnerAbsence.js';
|
|
130
137
|
export * from './engineSessionParam.js';
|
|
131
|
-
export
|
|
138
|
+
export { engineWireTarget, engineWireTargetFor, installEngineWireTarget, installEngineWireTargetFor, } from './engineWireTarget.js';
|
|
139
|
+
export type { EngineWireTarget, } from './engineWireTarget.js';
|
|
132
140
|
export * from './principalWire.js';
|
|
133
141
|
export * from './wireErrorTriage.js';
|
|
134
142
|
export * from './resumeRefusalCopy.js';
|
|
@@ -143,20 +151,21 @@ export { ENGINE_FIRED_HOOK_EVENTS, PLUGIN_HOOK_DISPOSITIONS, PLUGIN_HOOK_REASONS
|
|
|
143
151
|
export * from './liveInitToolFace.js';
|
|
144
152
|
export * from './printInitToolFace.js';
|
|
145
153
|
export * from './model/providerPresets.js';
|
|
146
|
-
export
|
|
154
|
+
export { __setDecideTimeoutRetryBudgetForTests, backendDeny, DecideTransportRetryExhaustedError, findPendingForTask, HitlBridge, HitlSafetyError, isPlanReviewModeAfter, makeHitlCanUseTool, PLAN_REVIEW_MODE_AFTER_WORDS, readDecideCurrentPending, readWireErrorCode, } from './hitl/hitlBridge.js';
|
|
155
|
+
export type { ActiveGate, ApprovalsResourceLike, AskAnswer, AssistantResourceLike, DecideOperationEnd, DecideOperationEvent, DecideOperationIdentity, DecideOperationObserver, DecideOperationSpan, DecideOperationStart, FindPendingOutcome, GateCurrentPending, GatePrompt, HitlBackendDenyDecision, HitlBridgeOptions, HitlCanUseToolFn, HitlClientLike, HitlDecideDenyOutcome, HitlFailureStage, HitlPermissionDecisionLike, HitlSafetyCode, PlanReviewModeAfter, PlanReviewOutcome, } from './hitl/hitlBridge.js';
|
|
147
156
|
export * from './hitl/suspendedReopen.js';
|
|
148
157
|
export * from './hitl/approvalOutcomeNote.js';
|
|
149
158
|
export * from './hitl/approvalResolution.js';
|
|
150
159
|
export { toolEndOutputText, ENGINE_ABORT_TOOL_RESULT } from './hitl/frameRouter.js';
|
|
151
|
-
export {
|
|
152
|
-
export
|
|
160
|
+
export { _resetHitlHostSurfaceForTest, CANCEL_DENY_BUDGET_MS, CANCEL_DENY_WARN_TEXT, EDIT_NOT_FORWARDED_WARN_TEXT, EDIT_REFUSED_ON_BLIND_ASK_WARN_TEXT, hitlHostSurfaceFor, hitlHostSurfaceMisses, hitlHostSurfaceMissesFor, installHitlHostSurface, installHitlHostSurfaceFor, observeCancelByDeny, REMEMBER_NOT_APPLIED_WARN_TEXT, RULE_NOT_SENT_REJECTED_WARN_TEXT, RULE_NOT_SENT_WARN_TEXT, surfaceEditRefusedOnBlindAsk, surfaceForCurrentSession, surfaceRememberNotApplied, } from './hitl/hitlHostSurface.js';
|
|
161
|
+
export type { ClassifierDenyContext, HitlHostSurface, HitlNotice, } from './hitl/hitlHostSurface.js';
|
|
153
162
|
export * from './hitl/toolApprovalWire.js';
|
|
154
163
|
export * from './hitl/editedRuleTextPrecheck.js';
|
|
155
164
|
export * from './coreValuePorts.js';
|
|
156
165
|
export * from './hitl/askGateWire.js';
|
|
157
166
|
export * from './hitl/planReviewWire.js';
|
|
158
167
|
export { PLAN_REVIEW_QUESTION_ID_PREFIX, REOPEN_ID_TAIL, approvalCallKey, askGateQuestionId, planReviewQuestionId, liveFrameCallKey, armedKeyFromQuestionId, } from './hitl/gateIdentity.js';
|
|
159
|
-
export
|
|
168
|
+
export { _resetArmedGateRegistryForTest, _setGateArmedWaitMsForTest, clearArmedGate, gateArmedWaitMs, notePlanReviewAnswered, onGateArmed, planReviewArmedKey, registerArmedGate, registerArmedGateFor, registerArmedGateFromQuestionId, waitForGateArmed, wasGateArmed, wasGateArmedFor, } from './hitl/armedGateRegistry.js';
|
|
160
169
|
export * from './hitl/parkOwnership.js';
|
|
161
170
|
export * from './hitl/parkRowBirthWait.js';
|
|
162
171
|
export * from './hitl/approvalDecisionNoteAudit.js';
|
|
@@ -176,6 +185,8 @@ export * from './request/printNotification.js';
|
|
|
176
185
|
export * from './seatContract.js';
|
|
177
186
|
export * from './agentSession/contract.js';
|
|
178
187
|
export * from './agentSession/backgroundView.js';
|
|
188
|
+
export { readEngineAgentRegistry, isEngineAgentRegistryListingSuperseded } from './agentSession/engineAgentRegistryRead.js';
|
|
189
|
+
export type { EngineAgentRegistryClient } from './agentSession/engineAgentRegistryRead.js';
|
|
179
190
|
export * from './model/catalog.js';
|
|
180
191
|
export * from './model/catalogLoader.js';
|
|
181
192
|
export * from './model/providerAuth.js';
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export * from './seam.js';
|
|
2
2
|
export * from './workflow.js';
|
|
3
|
-
export
|
|
3
|
+
export { _resetEngineTaskNotificationForTest, _resetNotificationQueuePortForTest, _setWatcherTimingForTest, _tickWatchOnceForTest, classifyHookFailureFrame, classifyHookNoticeFrame, deriveNotificationResidualLines, dropQueuedNotificationsForRun, enqueueBgChildNotification, enqueueEngineWorkflowNotification, enqueuePlanReviewOutcome, HOOK_NOTICE_WARN_PREFIX, hookNoticeLastCheckText, installBgTaskStatusProbe, installNotificationQueuePort, installWorkflowStatusProbe, isEngineWorkflowNotified, isHookNoticeFrame, isOwnWorkflowRun, isTaskNotificationObjective, isWorkflowCompletionCardEnqueued, listOwnWorkflowRuns, markEngineWorkflowNotified, normalizeTaskNotification, noteOwnWorkflowRun, noteWorkflowCompletionCardEnqueued, notificationDropCounters, notificationQueuePortMisses, outstandingAbandonedCount, outstandingBgTaskPrompt, outstandingDeliverableWorkflowCount, outstandingWorkflowCount, parseTranscriptNotificationSeeds, registerOutstandingBgTask, registerOutstandingWorkflowRun, renderTaskNotificationXml, splitApiErrorSupplement, subscribeOutstandingWorkflows, taskNotificationDedupKey, taskNotificationDedupKeyFromWire, taskNotificationDeliverySupplement, } from './notifications.js';
|
|
4
4
|
export * from './peerFrames.js';
|
|
5
5
|
export * from './steering.js';
|
|
6
|
-
export * from './diagnostics.js';
|
|
7
6
|
export * from './retryStatus.js';
|
|
8
7
|
export * from './sessionMemoryStatus.js';
|
|
9
8
|
export * from './memorySpecWire.js';
|
|
@@ -12,11 +11,11 @@ export * from './adapt/textSegmentAuthority.js';
|
|
|
12
11
|
export * from './engineHttpTools.js';
|
|
13
12
|
export * from './sdkWireTransit.js';
|
|
14
13
|
export { SEMA_SEGMENT_ID_KEY } from './adapt/textStream.js';
|
|
15
|
-
export
|
|
14
|
+
export { __resetSubagentContentStoreConfigForTests, __resetSubagentOwnerLedgerForTests, clearSubagentContent, coerceOutput, configureSubagentContentStore, getBgParentRun, getBgParentRunOwner, getBgTerminalFacts, getSubagentContentSnapshot, isOwnEngineRun, parentToolCallIdOf, planSubagentViewSlots, publishSubagentContentEvent, pushSubagentLocalEcho, recordBgParentRun, recordBgTerminalFacts, recordOwnEngineRun, recordSubagentOwner, recordSubagentOwnerFromProgress, registerSubagentAlias, settleSubagentContent, SUBAGENT_CONTENT_STORE_DEFAULTS, subagentContentStoreConfig, subagentOwnerSessionConflicts, subscribeSubagentContent, } from './subagentContentStore.js';
|
|
16
15
|
export * from './engineAgentPanelStore.js';
|
|
17
16
|
export * from './engineAgentAbsence.js';
|
|
18
17
|
export * from './fleetAgentPanelProjection.js';
|
|
19
|
-
export
|
|
18
|
+
export { _resetLiveQuestionStore, hasLocalQuestionResponder, hasQuestionOverlay, hasQuestionOverlayFor, onQuestionFrame, onQuestionFrameFor, publishQuestionFrame, publishQuestionFrameFor, registerLocalQuestionResponder, respondToQuestion, setQuestionRespond, } from './liveQuestionStore.js';
|
|
20
19
|
export * from './engineInlineTaskStats.js';
|
|
21
20
|
export * from './printToolResultFrame.js';
|
|
22
21
|
export * from './engineCapsCache.js';
|
|
@@ -65,7 +64,8 @@ export * from './sseIdleTriage.js';
|
|
|
65
64
|
export * from './engineWireSdk.js';
|
|
66
65
|
export * from './classifierVerdictWire.js';
|
|
67
66
|
export { stripSystemReminderBlocks, unwrapSystemReminder } from './systemReminderTag.js';
|
|
68
|
-
export
|
|
67
|
+
export { findSystemReminderOpenTag } from './systemReminderTag.js';
|
|
68
|
+
export { ACTIVE_RUN_BUSY_ERROR_CODE, asModelFallbackReason, CAPABILITY_SELF_ORCHESTRATION_REQUIRED, CONFIG_DELEGATION_ENTRY_CAPS, CONFIG_LEGACY_TOOL_NAME, CONFIG_LIMIT_INVALID, CONFIG_LIMIT_UNKNOWN_KEY, CONFIG_MEMORY_PROJECT_KEY_SPELLING, CONFIG_MEMORY_WRITE_SCOPE_MISMATCH, CONFIG_REFUSAL_CODES, CONFIG_STRATEGY_FIND_LIMIT_INVALID, CONFIG_STRATEGY_MAX_SIZE_INVALID, DECIDE_WORKFLOW_HOST_UNKNOWN, DECIDE_WORKFLOW_LANE_CODES, DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, DELEGATION_CAP_CODES, DELEGATION_CONCURRENCY_CAP, DELEGATION_SESSION_CAP, delegationCapDispositionOf, DRAINING_ERROR_CODE, ENGINE_STOP_REASONS, engineStopReasonToCc, ENV_LIFETIME_EXPIRED, GATE_PARKED_ERROR_CODE, isConfigRefusalCode, isDelegationCapCode, isInterruptedToolEndCode, isLimitsExceededCode, isRewindFamilyCode, isWorkflowParkRefusalCode, LIMITS_MAX_COST_EXCEEDED, LIMITS_MAX_TOKENS_EXCEEDED, LIMITS_MAX_TURNS_EXCEEDED, LIMITS_MAX_WALLTIME_EXCEEDED, MCP_SERVER_REVOKED, MODEL_FALLBACK_INHERIT_NO_TIER_BINDING, OUTPUT_INVALID, PARKED_RESUME_STARTUP_FAILED, RESUME_AT_ERROR_CODE_PREFIX, RESUME_CONTEXT_UNAVAILABLE, RESUME_ENV_FAILED, RESUME_PLACEMENT_MISMATCH, RESUME_POLICY_FOLD_CODE, RESUME_PREFLIGHT_REJECTED, RESUME_REOPEN_CODES, RESUME_RETRY_LATER_CODES, RESUME_TOOL_CONTRACT_MISMATCH, RESUME_TOOL_UNAVAILABLE, RESUME_USAGE_WINDOW_EXHAUSTED, REWIND_ERROR_CODE_PREFIXES, SCENARIO_NOT_ALLOWED_ERROR_CODE, STOP_CONFLICT_CODES, STREAM_MAX_DURATION, TOOL_END_INTERRUPTED_NEVER_STARTED, TOOL_END_INTERRUPTED_OUTCOME_UNKNOWN, USAGE_WINDOW_EXHAUSTED, WORKFLOW_PARK_REFUSAL_CODES, } from './engineErrorCodes.js';
|
|
69
69
|
export * from './agentsWireCaps.js';
|
|
70
70
|
export * from './attachmentsWireCaps.js';
|
|
71
71
|
export * from './clientContextWireCaps.js';
|
|
@@ -112,20 +112,20 @@ export * from './limitsWire.js';
|
|
|
112
112
|
export * from './interactiveToolsWire.js';
|
|
113
113
|
export * from './headlessPermissionModeWire.js';
|
|
114
114
|
export * from './headlessReconnectWire.js';
|
|
115
|
-
export
|
|
115
|
+
export { coerceTaskStatus, coerceWorkflowStatus, CONTROL_TOOL_VERBS, FLEET_TASK_ROW_KEYS_NOT_PROJECTED, FLEET_TASK_ROW_WIRE_KEYS, FLEET_TASK_VIEW_KEYS, FLEET_WORKFLOW_ROW_KEYS_NOT_PROJECTED, FLEET_WORKFLOW_ROW_WIRE_KEYS, FLEET_WORKFLOW_VIEW_KEYS, projectDescription, projectTasks, projectWorkflows, TERMINAL_FLEET_TASK_STATUSES, wireResumable, wireRowUsage, } from './fleet/fleetProjection.js';
|
|
116
116
|
export * from './fleet/fleetLedger.js';
|
|
117
117
|
export * from './fleet/workflowSizeWarning.js';
|
|
118
118
|
export * from './subagent/engineDelegatedPrompt.js';
|
|
119
119
|
export * from './subagent/engineRowStopGate.js';
|
|
120
120
|
export * from './subagent/engineSubagentOutput.js';
|
|
121
121
|
export * from './subagent/engineSubagentSteer.js';
|
|
122
|
-
export
|
|
122
|
+
export { __resetRetainWithoutWakeWarningForTests, auditRetainWithoutWake, classifySubagentResumeFailure, resolveOwnerRunId, resolveSubagentContinueTarget, resolveSubagentResumeContext, resumeSettledSubagent, SUBAGENT_RESUME_CAP, subagentResumeAvailable, } from './subagent/engineSubagentResume.js';
|
|
123
123
|
export * from './subagent/engineTaskHandleWire.js';
|
|
124
124
|
export * from './subagent/engineCompactWire.js';
|
|
125
125
|
export * from './subagent/engineSubagentTail.js';
|
|
126
|
-
export
|
|
126
|
+
export { __resetBgOwnerAbsenceForTests, } from './subagent/subagentOwnerAbsence.js';
|
|
127
127
|
export * from './engineSessionParam.js';
|
|
128
|
-
export
|
|
128
|
+
export { engineWireTarget, engineWireTargetFor, installEngineWireTarget, installEngineWireTargetFor, } from './engineWireTarget.js';
|
|
129
129
|
export * from './principalWire.js';
|
|
130
130
|
export * from './wireErrorTriage.js';
|
|
131
131
|
export * from './resumeRefusalCopy.js';
|
|
@@ -140,20 +140,19 @@ export { ENGINE_FIRED_HOOK_EVENTS, PLUGIN_HOOK_DISPOSITIONS, PLUGIN_HOOK_REASONS
|
|
|
140
140
|
export * from './liveInitToolFace.js';
|
|
141
141
|
export * from './printInitToolFace.js';
|
|
142
142
|
export * from './model/providerPresets.js';
|
|
143
|
-
export
|
|
143
|
+
export { __setDecideTimeoutRetryBudgetForTests, backendDeny, DecideTransportRetryExhaustedError, findPendingForTask, HitlBridge, HitlSafetyError, isPlanReviewModeAfter, makeHitlCanUseTool, PLAN_REVIEW_MODE_AFTER_WORDS, readDecideCurrentPending, readWireErrorCode, } from './hitl/hitlBridge.js';
|
|
144
144
|
export * from './hitl/suspendedReopen.js';
|
|
145
145
|
export * from './hitl/approvalOutcomeNote.js';
|
|
146
146
|
export * from './hitl/approvalResolution.js';
|
|
147
147
|
export { toolEndOutputText, ENGINE_ABORT_TOOL_RESULT } from './hitl/frameRouter.js';
|
|
148
|
-
export {
|
|
149
|
-
export * from './hitl/hitlHostSurface.js';
|
|
148
|
+
export { _resetHitlHostSurfaceForTest, CANCEL_DENY_BUDGET_MS, CANCEL_DENY_WARN_TEXT, EDIT_NOT_FORWARDED_WARN_TEXT, EDIT_REFUSED_ON_BLIND_ASK_WARN_TEXT, hitlHostSurfaceFor, hitlHostSurfaceMisses, hitlHostSurfaceMissesFor, installHitlHostSurface, installHitlHostSurfaceFor, observeCancelByDeny, REMEMBER_NOT_APPLIED_WARN_TEXT, RULE_NOT_SENT_REJECTED_WARN_TEXT, RULE_NOT_SENT_WARN_TEXT, surfaceEditRefusedOnBlindAsk, surfaceForCurrentSession, surfaceRememberNotApplied, } from './hitl/hitlHostSurface.js';
|
|
150
149
|
export * from './hitl/toolApprovalWire.js';
|
|
151
150
|
export * from './hitl/editedRuleTextPrecheck.js';
|
|
152
151
|
export * from './coreValuePorts.js';
|
|
153
152
|
export * from './hitl/askGateWire.js';
|
|
154
153
|
export * from './hitl/planReviewWire.js';
|
|
155
154
|
export { PLAN_REVIEW_QUESTION_ID_PREFIX, REOPEN_ID_TAIL, approvalCallKey, askGateQuestionId, planReviewQuestionId, liveFrameCallKey, armedKeyFromQuestionId, } from './hitl/gateIdentity.js';
|
|
156
|
-
export
|
|
155
|
+
export { _resetArmedGateRegistryForTest, _setGateArmedWaitMsForTest, clearArmedGate, gateArmedWaitMs, notePlanReviewAnswered, onGateArmed, planReviewArmedKey, registerArmedGate, registerArmedGateFor, registerArmedGateFromQuestionId, waitForGateArmed, wasGateArmed, wasGateArmedFor, } from './hitl/armedGateRegistry.js';
|
|
157
156
|
export * from './hitl/parkOwnership.js';
|
|
158
157
|
export * from './hitl/parkRowBirthWait.js';
|
|
159
158
|
export * from './hitl/approvalDecisionNoteAudit.js';
|
|
@@ -173,6 +172,7 @@ export * from './request/printNotification.js';
|
|
|
173
172
|
export * from './seatContract.js';
|
|
174
173
|
export * from './agentSession/contract.js';
|
|
175
174
|
export * from './agentSession/backgroundView.js';
|
|
175
|
+
export { readEngineAgentRegistry, isEngineAgentRegistryListingSuperseded } from './agentSession/engineAgentRegistryRead.js';
|
|
176
176
|
export * from './model/catalog.js';
|
|
177
177
|
export * from './model/catalogLoader.js';
|
|
178
178
|
export * from './model/providerAuth.js';
|
package/dist/liveInitToolFace.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { makeEngineWireClient, resolveWireAuth } from './engineWireSdk.js';
|
|
2
|
+
import { settleWithinDeadline } from './abortableSleep.js';
|
|
2
3
|
import { hostLog } from './host.js';
|
|
3
4
|
import { scenarioForPrint } from './scenarioWire.js';
|
|
4
5
|
import { resolveHeadlessInteractiveTools } from './interactiveToolsWire.js';
|
|
@@ -58,17 +59,34 @@ export function _resetLiveInitToolFaceForTest() {
|
|
|
58
59
|
cached = null;
|
|
59
60
|
}
|
|
60
61
|
export async function probeScenarioTools(baseUrl, scenario, opts) {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
const injected = opts?.client;
|
|
63
|
+
let body;
|
|
64
|
+
if (injected !== undefined) {
|
|
65
|
+
if (typeof injected?.scenarioCapabilities !== 'function')
|
|
66
|
+
return null;
|
|
67
|
+
const got = await settleWithinDeadline(opts?.timeoutMs ?? 2000, (signal) => injected.scenarioCapabilities(scenario, { signal }));
|
|
68
|
+
if (got.kind !== 'value')
|
|
69
|
+
return null;
|
|
70
|
+
body = got.value;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
const client = makeEngineWireClient({
|
|
74
|
+
baseUrl,
|
|
75
|
+
...(opts?.authToken ? { token: opts.authToken } : {}),
|
|
76
|
+
...(opts?.principal ? { principal: opts.principal } : {}),
|
|
77
|
+
timeoutMs: opts?.timeoutMs ?? 2000,
|
|
78
|
+
...(opts?.fetchImpl ? { fetchImpl: opts.fetchImpl } : {}),
|
|
79
|
+
});
|
|
80
|
+
if (!client)
|
|
81
|
+
return null;
|
|
82
|
+
try {
|
|
83
|
+
body = await client.scenarioCapabilities(scenario);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
70
89
|
try {
|
|
71
|
-
const body = await client.scenarioCapabilities(scenario);
|
|
72
90
|
if (!Array.isArray(body?.tools))
|
|
73
91
|
return null;
|
|
74
92
|
const names = body.tools.filter((t) => typeof t === 'string' && t.length > 0);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { hostEnv } from '../hostEnv.js';
|
|
2
2
|
import { resolveModelCatalog, } from './catalog.js';
|
|
3
|
-
export const DEFAULT_CATALOG_SOURCES = [
|
|
3
|
+
export const DEFAULT_CATALOG_SOURCES = Object.freeze([
|
|
4
4
|
'https://raw.githubusercontent.com/sema-agent/sema-model-catalog/main/dist/catalog.json',
|
|
5
5
|
'https://cdn.jsdelivr.net/gh/sema-agent/sema-model-catalog@main/dist/catalog.json',
|
|
6
|
-
];
|
|
7
|
-
export const CATALOG_DEFAULT_HOSTS = ['raw.githubusercontent.com', 'cdn.jsdelivr.net'];
|
|
6
|
+
]);
|
|
7
|
+
export const CATALOG_DEFAULT_HOSTS = Object.freeze(['raw.githubusercontent.com', 'cdn.jsdelivr.net']);
|
|
8
8
|
export const CATALOG_SOURCES_ENV = 'SEMA_CATALOG_SOURCES';
|
|
9
9
|
const DEFAULT_CATALOG_TIMEOUT_MS = 3500;
|
|
10
10
|
const CATALOG_CACHE_RELATIVE_PATH = 'cache/model-catalog.json';
|
|
@@ -39,11 +39,11 @@ export const REQUEST_FIELD_MATRIX = [
|
|
|
39
39
|
{ field: 'reasoningEffort', lanes: ['interactive', 'print', 'utility'], live: false, why: '思考档位(sdk `TaskRequest.reasoningEffort` 七词闭集;上游对表外词 400 响亮拒 ⇒ 本层不预铸第二判官)。档位是请求级的位、与车道无关:交互面 = `/effort` 拨盘,无人值守面 = 档位旗。🔴 端交的必须是**档位词**:「思考 token 数」今天没有上游对位(见 `UPSTREAM_ABSENT_REQUEST_INTENTS` 的 `maxThinkingTokens`),别把一个数字折成档位词发出去', whyUtilityLane: '有座:side-channel 该用显式低档(省钱省时);与 model 同一条理由 —— 本车道上这两位都由壳显式给,不跟用户会话的拨盘走' },
|
|
40
40
|
{ field: 'model', lanes: ['interactive', 'print', 'utility'], live: false, why: '模型选择(sdk `TaskRequest.model`;交互面 = `/model` 中途换模型的拨盘,无人值守面 = 模型旗 / 部署缺省那一路,side-channel 面 = 壳显式挑的那一只)。三条车道都有来源、都是提交面。🔴 0.79.0 改口:修前「print 的模型走另一条路」这句理由被用户面实测证伪 —— 无人值守车道传了模型名却整键不上请求体,于是同一个坏名字在交互态被引擎 400 点名、在无人值守态却安静换成部署缺省并在首帧回显一个没生效的名字。一个**选择**类声明被静默丢掉,后果与收紧类声明被静默丢掉同形(端不读回执就以为生效)—— 与 `excludeTools` 补 print 座同律。本层原样透传、不预判模型名(名字的合法性归引擎,本层不铸第二判官)', whyUtilityLane: '有座:side-channel 显式挑便宜的那只模型(不跟用户会话的 `/model` 拨盘走)' },
|
|
41
41
|
{ field: 'images', lanes: ['interactive'], live: false, why: '贴图提交是交互动作,`-p` 的 stdin 没有图片块', whyUtilityLane: '无座:贴图是交互动作,side-channel 的提交体里没有图片块' },
|
|
42
|
-
{ field: 'resumeAt/resumeAtMode/restoreFiles/
|
|
42
|
+
{ field: 'resumeAt/resumeAtMode/restoreFiles/rewindFilesTo', lanes: ['interactive'], live: false, why: 'E18 `/rewind` 是交互命令;四键同生同灭(CC-145:core 6.0.0 起 both 臂发 restoreFiles;CC-223 起退役键 rewindFiles 不再有座 —— 交它按表外子键响亮拒;resumeAtMode 是 both/conversation 两臂恒带的排他截语义位)', whyUtilityLane: '无座:回退是交互命令,而 side-channel 是一次性的独立会话,没有可回退的历史' },
|
|
43
43
|
{ field: 'clientContext', lanes: ['interactive'], live: false, why: 'IANA 时区 + 可选邮箱 → core 本地化 `# Environment` 的 today;print 同样跑在用户机器上,缺席让引擎误标 (UTC)', gap: true, whyUtilityLane: '无座:本地化 today 的用途在用户会话的环境段,而 side-channel 的系统提示由壳整段给出 —— 这一列我判不准要不要(与本行 `gap` 同一条待办:要补先单独立项)' },
|
|
44
44
|
{ field: 'scratchpadDir', lanes: ['interactive'], live: true, why: '[816]③ per-session 暂存目录;print 也有 session,缺席让 `-p` 的工具写不进 exemptDir', gap: true, whyUtilityLane: '无座:per-session 暂存目录是给**工具**写的,零工具面上没人写' },
|
|
45
45
|
];
|
|
46
|
-
export const LIVE_DEFAULT_FIELDS = [
|
|
46
|
+
export const LIVE_DEFAULT_FIELDS = Object.freeze([
|
|
47
47
|
'cwd',
|
|
48
48
|
'additionalDirectories',
|
|
49
49
|
'additionalReadDirectories',
|
|
@@ -54,7 +54,7 @@ export const LIVE_DEFAULT_FIELDS = [
|
|
|
54
54
|
'suggestNextPrompts',
|
|
55
55
|
'compactionModel',
|
|
56
56
|
'sessionId(三态解析)',
|
|
57
|
-
];
|
|
57
|
+
]);
|
|
58
58
|
export const TASK_REQUEST_OMISSION_CAUSES = Object.freeze([
|
|
59
59
|
'upstream_absent',
|
|
60
60
|
'other_channel',
|
|
@@ -125,7 +125,7 @@ const INPUT_KEY_ROUTES = {
|
|
|
125
125
|
memoryCapture: row('memoryCapture'),
|
|
126
126
|
memory: row('memory'),
|
|
127
127
|
approverPosture: row('approverPosture'),
|
|
128
|
-
rewind: row('resumeAt/resumeAtMode/restoreFiles/
|
|
128
|
+
rewind: row('resumeAt/resumeAtMode/restoreFiles/rewindFilesTo'),
|
|
129
129
|
repo: row('repo'),
|
|
130
130
|
council: row('council'),
|
|
131
131
|
debate: row('debate'),
|
|
@@ -585,11 +585,12 @@ export function assembleTaskRequest(input, lane) {
|
|
|
585
585
|
refuseBadMaxTokens(maxTokensIn);
|
|
586
586
|
refuseBadOutputRetries(outputRetriesIn);
|
|
587
587
|
const rewindRoute = INPUT_KEY_ROUTES.rewind;
|
|
588
|
+
const RETIRED_REWIND_FILES_KEY = 'rewindFiles';
|
|
588
589
|
const REWIND_KEYS = rewindRoute.via === 'matrix' ? rewindRoute.field.split('/') : [];
|
|
589
590
|
const rewindIn = i.rewind;
|
|
590
591
|
if (present(rewindIn) && (typeof rewindIn !== 'object' || Array.isArray(rewindIn))) {
|
|
591
592
|
throw new TypeError(`buildTaskRequest: rewind 只接受对象或缺席(undefined/null)—— 收到 ${coarseShape(rewindIn)}。` +
|
|
592
|
-
'
|
|
593
|
+
'它是四个具名请求键(resumeAt / resumeAtMode / restoreFiles / rewindFilesTo)的合写位,不是任意展开口。错误文本只报形状,不回显值。');
|
|
593
594
|
}
|
|
594
595
|
const rewindObj = present(rewindIn) ? rewindIn : {};
|
|
595
596
|
const rewindWire = {};
|
|
@@ -632,14 +633,23 @@ export function assembleTaskRequest(input, lane) {
|
|
|
632
633
|
continue;
|
|
633
634
|
unknownKeys.push(`settings.${sub}`);
|
|
634
635
|
}
|
|
636
|
+
let retiredRewindFiles = false;
|
|
635
637
|
for (const sub of Object.keys(rewindObj)) {
|
|
636
638
|
if (REWIND_KEYS.includes(sub))
|
|
637
639
|
continue;
|
|
638
640
|
const stray = rewindObj[sub];
|
|
639
641
|
if (!present(stray))
|
|
640
642
|
continue;
|
|
643
|
+
if (sub === RETIRED_REWIND_FILES_KEY)
|
|
644
|
+
retiredRewindFiles = true;
|
|
641
645
|
unknownKeys.push(`rewind.${sub}`);
|
|
642
646
|
}
|
|
647
|
+
if (retiredRewindFiles) {
|
|
648
|
+
throw new TypeError('buildTaskRequest: "rewind.rewindFiles" 是退役键(引擎 core 6.0.0 起退役:「逐轮捕获」那一义被引擎忽略 —— 文件首触追踪恒开,' +
|
|
649
|
+
'无需请求;「回退时一并还原文件」那一义被引擎拒收、改名为 restoreFiles)。本包在装配前拒:在场即拒,true / false 同判。' +
|
|
650
|
+
'处置:删掉这个键;要在回退会话时一并还原文件,改交 ' +
|
|
651
|
+
'rewind.restoreFiles: true(必须与 rewind.resumeAt 同交);只还原文件、不动会话,交 rewind.rewindFilesTo。错误文本只报键名,不回显值。');
|
|
652
|
+
}
|
|
643
653
|
if (unknownKeys.length > 0) {
|
|
644
654
|
const shown = unknownKeys.slice(0, MAX_UNKNOWN_KEYS_SHOWN).map(keyForDisplay).join(', ');
|
|
645
655
|
const more = unknownKeys.length > MAX_UNKNOWN_KEYS_SHOWN ? ` 等共 ${unknownKeys.length} 个` : '';
|
|
@@ -33,3 +33,14 @@ export interface ResumeContextUnavailableDetail {
|
|
|
33
33
|
}
|
|
34
34
|
export declare function resumeContextUnavailableFromError(err: unknown): ResumeContextUnavailableDetail | null;
|
|
35
35
|
export declare function resumeContextUnavailableContent(d: ResumeContextUnavailableDetail): string;
|
|
36
|
+
export type ParkedResumeStartupDecision = 'approve' | 'deny';
|
|
37
|
+
export type ParkedResumeStartupCause = 'resume_rejected' | 'undetermined';
|
|
38
|
+
export interface ParkedResumeStartupDetail {
|
|
39
|
+
code: string;
|
|
40
|
+
cause: ParkedResumeStartupCause;
|
|
41
|
+
taskId?: string;
|
|
42
|
+
resendable: false;
|
|
43
|
+
denyStaysOpen: true;
|
|
44
|
+
}
|
|
45
|
+
export declare function parkedResumeStartupFromError(err: unknown, decision?: ParkedResumeStartupDecision): ParkedResumeStartupDetail | null;
|
|
46
|
+
export declare function parkedResumeStartupContent(detail: ParkedResumeStartupDetail): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readErrorNumber, readErrorString } from './wireFailureShape.js';
|
|
2
|
-
import { RESUME_CONTEXT_UNAVAILABLE, RESUME_PLACEMENT_MISMATCH, RESUME_PREFLIGHT_REJECTED, RESUME_REOPEN_CODES, RESUME_ENV_FAILED, RESUME_TOOL_UNAVAILABLE, RESUME_POLICY_FOLD_CODE, } from './engineErrorCodes.js';
|
|
2
|
+
import { RESUME_CONTEXT_UNAVAILABLE, RESUME_PLACEMENT_MISMATCH, RESUME_PREFLIGHT_REJECTED, RESUME_REOPEN_CODES, RESUME_ENV_FAILED, RESUME_TOOL_UNAVAILABLE, RESUME_POLICY_FOLD_CODE, PARKED_RESUME_STARTUP_FAILED, } from './engineErrorCodes.js';
|
|
3
3
|
import { capForDisplay } from './fleetTaskDesc.js';
|
|
4
4
|
import { resumeRetryLaterFromError } from './wireErrorTriage.js';
|
|
5
5
|
export const RESUME_REFUSAL_CODES = Object.freeze([
|
|
@@ -134,3 +134,41 @@ export function resumeContextUnavailableContent(d) {
|
|
|
134
134
|
third,
|
|
135
135
|
].join(' · ');
|
|
136
136
|
}
|
|
137
|
+
export function parkedResumeStartupFromError(err, decision) {
|
|
138
|
+
if (typeof err !== 'object' || err === null)
|
|
139
|
+
return null;
|
|
140
|
+
let code;
|
|
141
|
+
try {
|
|
142
|
+
code = err.errorCode;
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
if (code !== PARKED_RESUME_STARTUP_FAILED)
|
|
148
|
+
return null;
|
|
149
|
+
const rawTaskId = readErrorString(err, 'taskId');
|
|
150
|
+
const taskId = rawTaskId !== undefined && rawTaskId.length > 0 ? rawTaskId : undefined;
|
|
151
|
+
return {
|
|
152
|
+
code: PARKED_RESUME_STARTUP_FAILED,
|
|
153
|
+
cause: decision === 'deny' ? 'resume_rejected' : 'undetermined',
|
|
154
|
+
...(taskId !== undefined ? { taskId } : {}),
|
|
155
|
+
resendable: false,
|
|
156
|
+
denyStaysOpen: true,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
const PARKED_RESUME_STARTUP_STATE = 'This refusal does not say whether the card is still waiting — re-fetch the pending approvals';
|
|
160
|
+
const PARKED_RESUME_STARTUP_SENTENCES = Object.freeze({
|
|
161
|
+
resume_rejected: [
|
|
162
|
+
'The engine could not start the parked work to apply this decision (its session may be gone, or the engine rejected the decision itself)',
|
|
163
|
+
PARKED_RESUME_STARTUP_STATE,
|
|
164
|
+
'If the card is still there, decide it again from the fresh list',
|
|
165
|
+
].join(' · '),
|
|
166
|
+
undetermined: [
|
|
167
|
+
'The engine could not start the parked work to apply this decision',
|
|
168
|
+
PARKED_RESUME_STARTUP_STATE,
|
|
169
|
+
'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',
|
|
170
|
+
].join(' · '),
|
|
171
|
+
});
|
|
172
|
+
export function parkedResumeStartupContent(detail) {
|
|
173
|
+
return detail.cause === 'resume_rejected' ? PARKED_RESUME_STARTUP_SENTENCES.resume_rejected : PARKED_RESUME_STARTUP_SENTENCES.undetermined;
|
|
174
|
+
}
|
package/dist/rewindWireCaps.d.ts
CHANGED
package/dist/seam.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ModelUsage, SDKMessage } from '@sema-agent/agent-types';
|
|
|
2
2
|
import type { EngineTurnUsage } from './adapter/downstream/turnUsageToModelUsage.js';
|
|
3
3
|
import type { RunCostReconcile } from './adapter/downstream/terminalToSdkResult.js';
|
|
4
4
|
import type { WiringManifestAutoMode, WiringManifestModelGate, WiringManifestMcpEntryView, WiringManifestHookEntryView, WiringManifestLspSeamView, WiringManifestWriteProtectionView, WiringManifestAutoConsolidationView, WiringManifestReadDenyView, ContextUsageSectionView, PromptManifestSectionView, PromptManifestBlockView, PromptManifestToolView } from './adapter/downstream/eventToSdkMessage.js';
|
|
5
|
-
import type { ToolRosterView, ToolRosterDeltaView } from './toolRoster.js';
|
|
5
|
+
import type { ToolRosterView, ToolRosterDeltaView, WiringManifestHandsView } from './toolRoster.js';
|
|
6
6
|
export interface AbortSignalLike {
|
|
7
7
|
readonly aborted: boolean;
|
|
8
8
|
}
|
|
@@ -162,6 +162,7 @@ export interface WiringManifestChromeEvent {
|
|
|
162
162
|
writeProtection?: WiringManifestWriteProtectionView;
|
|
163
163
|
autoConsolidation?: WiringManifestAutoConsolidationView;
|
|
164
164
|
readDeny?: WiringManifestReadDenyView;
|
|
165
|
+
hands?: WiringManifestHandsView;
|
|
165
166
|
eventId?: string;
|
|
166
167
|
}
|
|
167
168
|
export interface TextSegmentCommittedRow {
|
package/dist/seatContract.js
CHANGED
|
@@ -12,13 +12,13 @@ const isObject = (v) => typeof v === "object" && v !== null;
|
|
|
12
12
|
const isAbsent = (v) => typeof v === "undefined";
|
|
13
13
|
const optionalString = (v) => isAbsent(v) || typeof v === "string";
|
|
14
14
|
const inTuple = (tuple, v) => tuple.includes(v);
|
|
15
|
-
export const TOOL_PERMISSION_REQUEST_ID_DOMAINS = [
|
|
15
|
+
export const TOOL_PERMISSION_REQUEST_ID_DOMAINS = Object.freeze([
|
|
16
16
|
"live:",
|
|
17
17
|
"durable:",
|
|
18
18
|
"question:",
|
|
19
19
|
"elicit:",
|
|
20
20
|
"plan:",
|
|
21
|
-
];
|
|
21
|
+
]);
|
|
22
22
|
export function toolPermissionRequestIdDomain(requestId) {
|
|
23
23
|
if (typeof requestId !== "string")
|
|
24
24
|
return undefined;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
export interface SystemReminderOpenTagSpan {
|
|
2
|
+
readonly start: number;
|
|
3
|
+
readonly end: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function findSystemReminderOpenTag(text: string, from?: number): SystemReminderOpenTagSpan | null;
|
|
1
6
|
export declare function unwrapSystemReminder(text: string): string;
|
|
2
7
|
export declare function stripSystemReminderBlocks(text: string): string;
|
|
@@ -1,29 +1,40 @@
|
|
|
1
1
|
const OPEN_TAG_SOURCE = '<system-reminder(?: mark="[A-Za-z0-9_-]{22}")?>';
|
|
2
2
|
const CLOSE_TAG = '</system-reminder>';
|
|
3
|
-
|
|
3
|
+
function matchOpenTag(text, from, anchored) {
|
|
4
|
+
const re = new RegExp(OPEN_TAG_SOURCE, anchored ? 'y' : 'g');
|
|
5
|
+
re.lastIndex = from;
|
|
6
|
+
const m = re.exec(text);
|
|
7
|
+
return m === null ? null : { start: m.index, end: m.index + m[0].length };
|
|
8
|
+
}
|
|
9
|
+
export function findSystemReminderOpenTag(text, from) {
|
|
10
|
+
if (typeof text !== 'string')
|
|
11
|
+
return null;
|
|
12
|
+
const at = from === undefined ? 0 : from;
|
|
13
|
+
if (!Number.isInteger(at) || at < 0 || at > text.length)
|
|
14
|
+
return null;
|
|
15
|
+
return matchOpenTag(text, at, false);
|
|
16
|
+
}
|
|
4
17
|
export function unwrapSystemReminder(text) {
|
|
5
18
|
const head = text.trimStart();
|
|
6
|
-
const open =
|
|
19
|
+
const open = matchOpenTag(head, 0, true);
|
|
7
20
|
if (open === null)
|
|
8
21
|
return text;
|
|
9
22
|
const whole = head.trimEnd();
|
|
10
|
-
if (!whole.endsWith(CLOSE_TAG) || whole.length - CLOSE_TAG.length < open
|
|
23
|
+
if (!whole.endsWith(CLOSE_TAG) || whole.length - CLOSE_TAG.length < open.end)
|
|
11
24
|
return text;
|
|
12
|
-
return whole.slice(open
|
|
25
|
+
return whole.slice(open.end, whole.length - CLOSE_TAG.length).trim();
|
|
13
26
|
}
|
|
14
27
|
export function stripSystemReminderBlocks(text) {
|
|
15
|
-
const openRe = new RegExp(OPEN_TAG_SOURCE, 'g');
|
|
16
28
|
let out = '';
|
|
17
29
|
let pos = 0;
|
|
18
30
|
for (;;) {
|
|
19
|
-
|
|
20
|
-
const open = openRe.exec(text);
|
|
31
|
+
const open = matchOpenTag(text, pos, false);
|
|
21
32
|
if (open === null)
|
|
22
33
|
break;
|
|
23
|
-
const close = text.indexOf(CLOSE_TAG, open.
|
|
34
|
+
const close = text.indexOf(CLOSE_TAG, open.end);
|
|
24
35
|
if (close === -1)
|
|
25
36
|
break;
|
|
26
|
-
out += text.slice(pos, open.
|
|
37
|
+
out += text.slice(pos, open.start);
|
|
27
38
|
pos = close + CLOSE_TAG.length;
|
|
28
39
|
}
|
|
29
40
|
return pos === 0 ? text : out + text.slice(pos);
|
package/dist/toolResult.js
CHANGED
|
@@ -2,7 +2,8 @@ import { convertLeadingTabsToSpaces, getPatchFromContents } from './diff/patch.j
|
|
|
2
2
|
import { markEngineWorkflowNotified, registerOutstandingBgTask, registerOutstandingWorkflowRun, } from './notifications.js';
|
|
3
3
|
import { parseWorkflowPollEnvelope, projectWorkflowTaskOutput } from './workflow.js';
|
|
4
4
|
import { asModelFallbackReason } from './engineErrorCodes.js';
|
|
5
|
-
|
|
5
|
+
import { frozenSet } from './frozenSet.js';
|
|
6
|
+
export const STRUCTURED_DETAIL_TYPES = frozenSet([
|
|
6
7
|
'edit',
|
|
7
8
|
'create',
|
|
8
9
|
'update',
|
|
@@ -58,13 +59,8 @@ export function structuredDetailType(structured) {
|
|
|
58
59
|
const MAX_STRUCTURED_FIELD_CHARS = 1_000_000;
|
|
59
60
|
const WF_TERMINAL_STATUSES = new Set([
|
|
60
61
|
'completed',
|
|
61
|
-
'done',
|
|
62
62
|
'failed',
|
|
63
|
-
'stopped',
|
|
64
|
-
'interrupted',
|
|
65
|
-
'error',
|
|
66
63
|
'cancelled',
|
|
67
|
-
'canceled',
|
|
68
64
|
]);
|
|
69
65
|
export const PROTOCOL_MARKERS = {
|
|
70
66
|
bashHead: /^exit code: (-?\d+)(?: \(([^)\n]*)\))?\n(--- stdout ---\n)?/,
|
package/dist/toolRoster.d.ts
CHANGED
|
@@ -63,6 +63,22 @@ export type HandsMountedReading = {
|
|
|
63
63
|
why: 'no-manifest' | 'no-roster' | 'roster-unreadable' | 'mount-condition-absent';
|
|
64
64
|
};
|
|
65
65
|
export declare function handsMountedFromManifest(manifest: unknown): HandsMountedReading;
|
|
66
|
+
export interface WiringManifestHandsView {
|
|
67
|
+
mounted: boolean;
|
|
68
|
+
reason?: string;
|
|
69
|
+
}
|
|
70
|
+
export type HandsSeamReading = {
|
|
71
|
+
kind: 'not_reported';
|
|
72
|
+
} | {
|
|
73
|
+
kind: 'mounted';
|
|
74
|
+
} | {
|
|
75
|
+
kind: 'not_mounted';
|
|
76
|
+
reason?: string;
|
|
77
|
+
};
|
|
78
|
+
export declare function handsSeamReadingOf(view: {
|
|
79
|
+
readonly hands?: WiringManifestHandsView;
|
|
80
|
+
} | null | undefined): HandsSeamReading;
|
|
81
|
+
export declare function handsSeamDetail(reading: HandsSeamReading): string;
|
|
66
82
|
export declare function handsMountedDetail(reading: HandsMountedReading): string;
|
|
67
83
|
export declare function toolRosterNames(roster: ToolRosterView | undefined): readonly string[];
|
|
68
84
|
export interface ToolShim {
|