@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,7 +1,7 @@
|
|
|
1
1
|
import { errCodes } from '../controlRouter.js';
|
|
2
2
|
import { hostLog } from '../host.js';
|
|
3
3
|
import { isSessionIdPathSegment } from '../sessionIdSegment.js';
|
|
4
|
-
import {
|
|
4
|
+
import { engineCapNestedValue } from '../engineCapsCache.js';
|
|
5
5
|
const unavailable = (why) => ({
|
|
6
6
|
kind: 'unavailable',
|
|
7
7
|
why,
|
|
@@ -58,13 +58,11 @@ export function registryListingProvenanceOf(listing) {
|
|
|
58
58
|
export function isEngineAgentRegistryListingSuperseded(listing) {
|
|
59
59
|
return registryListingProvenanceOf(listing)?.superseded === true;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return false;
|
|
67
|
-
return ownDataField(bg, 'listFace') === true;
|
|
61
|
+
function listFaceGate(capsBaseUrl) {
|
|
62
|
+
const v = engineCapNestedValue(typeof capsBaseUrl === 'string' ? capsBaseUrl : undefined, 'background', 'listFace');
|
|
63
|
+
if (v.kind === 'unobserved' || v.kind === 'unreadable')
|
|
64
|
+
return 'capability_unknown';
|
|
65
|
+
return v.kind === 'value' && v.value === true ? null : 'no_list_face';
|
|
68
66
|
}
|
|
69
67
|
function readRow(v) {
|
|
70
68
|
if (typeof v !== 'object' || v === null || Array.isArray(v))
|
|
@@ -85,18 +83,19 @@ function readRow(v) {
|
|
|
85
83
|
...(typeof createdAt === 'number' && Number.isFinite(createdAt) ? { createdAt } : {}),
|
|
86
84
|
};
|
|
87
85
|
}
|
|
88
|
-
export async function readEngineAgentRegistry(client, sessionId,
|
|
86
|
+
export async function readEngineAgentRegistry(client, sessionId, capsBaseUrl, opts) {
|
|
89
87
|
try {
|
|
90
|
-
return await readOnce(client, sessionId,
|
|
88
|
+
return await readOnce(client, sessionId, capsBaseUrl, opts);
|
|
91
89
|
}
|
|
92
90
|
catch {
|
|
93
91
|
noteReadFailed('reader threw');
|
|
94
92
|
return unavailable('read_failed');
|
|
95
93
|
}
|
|
96
94
|
}
|
|
97
|
-
async function readOnce(client, sessionId,
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
async function readOnce(client, sessionId, capsBaseUrl, opts) {
|
|
96
|
+
const gate = listFaceGate(capsBaseUrl);
|
|
97
|
+
if (gate !== null)
|
|
98
|
+
return unavailable(gate);
|
|
100
99
|
if (!isSessionIdPathSegment(sessionId)) {
|
|
101
100
|
noteReadFailed('bad session id');
|
|
102
101
|
return unavailable('read_failed');
|
|
@@ -4,7 +4,7 @@ import { clientHasVerbs, engineWireFor, INJECTED_WIRE_SETTLE_MS, noAnswerDetailF
|
|
|
4
4
|
import { engineWireDebugEnabled } from '../engineWireTarget.js';
|
|
5
5
|
import { hostLog } from '../host.js';
|
|
6
6
|
import { isSessionIdPathSegment } from '../sessionIdSegment.js';
|
|
7
|
-
import { wireFailureTextsOf } from '../wireFailureShape.js';
|
|
7
|
+
import { readThrownSlot, readThrownStatusSlot, THROWN_SLOT_UNREADABLE, wireFailureTextsOf } from '../wireFailureShape.js';
|
|
8
8
|
import { DEFAULT_SESSION_KEY } from '../sessionSlot.js';
|
|
9
9
|
const NOTHING_SENT = ' — nothing sent';
|
|
10
10
|
const DETAIL_BAD_SESSION = `the session id must be a non-empty string that is not a dot segment${NOTHING_SENT}`;
|
|
@@ -155,13 +155,16 @@ function refusedWhyOf(rawCode, status) {
|
|
|
155
155
|
return undefined;
|
|
156
156
|
}
|
|
157
157
|
function diagOf(e) {
|
|
158
|
-
const
|
|
159
|
-
const
|
|
158
|
+
const rawStatus = readThrownStatusSlot(e);
|
|
159
|
+
const rawCode = readThrownSlot(e, 'errorCode', 'data');
|
|
160
|
+
if (rawStatus === THROWN_SLOT_UNREADABLE || rawCode === THROWN_SLOT_UNREADABLE)
|
|
161
|
+
return undefined;
|
|
160
162
|
const status = typeof rawStatus === 'number' && Number.isInteger(rawStatus) ? rawStatus : undefined;
|
|
161
|
-
const errorCode = typeof
|
|
162
|
-
const ra =
|
|
163
|
+
const errorCode = typeof rawCode === 'string' && rawCode.length > 0 ? rawCode : undefined;
|
|
164
|
+
const ra = readThrownSlot(e, 'retryAfterMs', 'data');
|
|
163
165
|
const retryAfterMs = typeof ra === 'number' && Number.isFinite(ra) && ra >= 0 ? ra : undefined;
|
|
164
|
-
const
|
|
166
|
+
const rawMessage = readThrownSlot(e, 'message');
|
|
167
|
+
const message = typeof rawMessage === 'string' && rawMessage.length > 0 ? rawMessage : undefined;
|
|
165
168
|
return {
|
|
166
169
|
...(status !== undefined ? { status } : {}),
|
|
167
170
|
...(errorCode !== undefined ? { errorCode } : {}),
|
|
@@ -169,6 +172,10 @@ function diagOf(e) {
|
|
|
169
172
|
...(message !== undefined ? { message } : {}),
|
|
170
173
|
};
|
|
171
174
|
}
|
|
175
|
+
function unreadableFailure() {
|
|
176
|
+
note('error (the failure could not be read)');
|
|
177
|
+
return { kind: 'error', detail: 'the stop request failed (the error could not be read)' };
|
|
178
|
+
}
|
|
172
179
|
function classifyFailure(e) {
|
|
173
180
|
try {
|
|
174
181
|
if (typeof e !== 'object' || e === null) {
|
|
@@ -176,6 +183,8 @@ function classifyFailure(e) {
|
|
|
176
183
|
return { kind: 'error', detail: `the stop request failed: ${wireFailureTextsOf(e).reason.slice(0, 200)}` };
|
|
177
184
|
}
|
|
178
185
|
const d = diagOf(e);
|
|
186
|
+
if (d === undefined)
|
|
187
|
+
return unreadableFailure();
|
|
179
188
|
if (d.status === undefined && d.errorCode === undefined) {
|
|
180
189
|
const noAnswer = noAnswerDetailFrom(e);
|
|
181
190
|
if (noAnswer !== null) {
|
|
@@ -200,8 +209,7 @@ function classifyFailure(e) {
|
|
|
200
209
|
return { kind: 'error', detail: (d.message ?? 'the stop request failed').slice(0, 300), ...diag };
|
|
201
210
|
}
|
|
202
211
|
catch {
|
|
203
|
-
|
|
204
|
-
return { kind: 'error', detail: 'the stop request failed (the error could not be read)' };
|
|
212
|
+
return unreadableFailure();
|
|
205
213
|
}
|
|
206
214
|
}
|
|
207
215
|
export async function stopEngineSessionBackground(sessionId, body, opts) {
|
package/dist/agentsWireCaps.d.ts
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { type EngineProbeOpts, type WireAuthTokenSource } from './engineWireSdk.js';
|
|
2
2
|
import type { ReasoningEffort } from './effortWire.js';
|
|
3
3
|
import type { ToolRosterView } from './toolRoster.js';
|
|
4
|
-
import { type
|
|
4
|
+
import { type AssemblyRefusal } from './wireFailureShape.js';
|
|
5
5
|
export declare const MAX_TASK_AGENTS = 32;
|
|
6
|
-
export declare const MAX_AGENT_NAME_CHARS = 64;
|
|
7
|
-
export declare const MAX_AGENT_TEXT_CHARS = 4096;
|
|
8
|
-
export declare const MAX_AGENT_SYSTEM_PROMPT_CHARS = 65536;
|
|
9
|
-
export declare const MAX_AGENT_TOOLS = 64;
|
|
10
|
-
export declare const MAX_AGENT_TOOL_NAME_CHARS = 128;
|
|
11
|
-
export declare const MAX_AGENT_SKILL_CONTENT_CHARS = 1048576;
|
|
12
|
-
export declare const MAX_AGENT_MAX_TURNS = 1000;
|
|
13
6
|
export declare const TASK_AGENT_WIRE_FIELDS: readonly ["name", "whenToUse", "whenToUseLean", "allowTools", "denyTools", "skills", "background", "isolation", "model", "thinking", "systemPrompt", "maxTurns", "memory", "observer", "observerMessage"];
|
|
14
7
|
export type WireThinkingLevel = ReasoningEffort;
|
|
15
8
|
export type TaskAgentWireSkill = {
|
|
@@ -61,8 +54,6 @@ export type ProjectAgentsDeps = {
|
|
|
61
54
|
effortToThinking: (effort: unknown) => WireThinkingLevel | undefined;
|
|
62
55
|
skillSpecs?: TaskAgentWireSkill[];
|
|
63
56
|
toolRoster?: ToolRosterView | null;
|
|
64
|
-
withholdRefusedDenyLists?: boolean;
|
|
65
|
-
toolDirectory?: EngineToolDirectory;
|
|
66
57
|
agentSourceLabel?: (agentName: string) => string | undefined;
|
|
67
58
|
};
|
|
68
59
|
export type ProjectAgentsResult = {
|
|
@@ -78,6 +69,7 @@ export interface AgentToolListFlaw {
|
|
|
78
69
|
readonly kind: AgentToolListFlawKind;
|
|
79
70
|
readonly currentName?: string;
|
|
80
71
|
readonly toolName?: string;
|
|
72
|
+
readonly rewritten?: true;
|
|
81
73
|
}
|
|
82
74
|
export declare function agentToolListFlaws(agents: readonly TaskAgentWireItem[] | undefined, roster?: ToolRosterView | null): AgentToolListFlaw[];
|
|
83
75
|
export declare function projectAgentsForWire(defs: readonly AgentDefLike[], deps: ProjectAgentsDeps): ProjectAgentsResult;
|
|
@@ -90,7 +82,12 @@ export type WireConfig = {
|
|
|
90
82
|
export type ProjectorFn = () => Promise<ProjectAgentsResult>;
|
|
91
83
|
export declare function prepareTaskAgentsWireWith(cfg: WireConfig, projector: ProjectorFn): Promise<void>;
|
|
92
84
|
export declare function invalidateTaskAgentsWire(): Promise<void>;
|
|
93
|
-
export declare function awaitTaskAgentsWire(timeoutMs?: number): Promise<
|
|
85
|
+
export declare function awaitTaskAgentsWire(timeoutMs?: number): Promise<{
|
|
86
|
+
readonly ok: true;
|
|
87
|
+
} | {
|
|
88
|
+
readonly ok: false;
|
|
89
|
+
readonly refusal: AssemblyRefusal;
|
|
90
|
+
}>;
|
|
94
91
|
export declare function taskAgentsField(): {
|
|
95
92
|
agents?: TaskAgentWireItem[];
|
|
96
93
|
};
|