@sema-agent/client-core 0.104.1 → 0.106.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 +310 -0
- package/README.md +36 -14
- package/dist/adapt/arms.js +23 -6
- package/dist/adapter/activeRunSelfHeal.d.ts +14 -2
- package/dist/adapter/activeRunSelfHeal.js +90 -12
- package/dist/adapter/downstream/eventToSdkMessage.d.ts +0 -5
- package/dist/adapter/downstream/eventToSdkMessage.js +24 -23
- package/dist/adapter/downstream/terminalToSdkResult.js +2 -3
- package/dist/adapter/downstream/wiringManifestView.d.ts +7 -3
- package/dist/adapter/downstream/wiringManifestView.js +25 -1
- package/dist/adapter/runStream.js +8 -5
- package/dist/approvalReachWire.d.ts +1 -0
- package/dist/approvalReachWire.js +4 -1
- package/dist/approvalSeat.d.ts +21 -0
- package/dist/approvalSeat.js +73 -0
- package/dist/assistantInbox.d.ts +2 -0
- package/dist/assistantInbox.js +3 -0
- package/dist/checkpointRowVerdict.d.ts +23 -0
- package/dist/checkpointRowVerdict.js +89 -0
- package/dist/cloudConfigWireCaps.js +3 -0
- package/dist/compensations.js +6 -6
- package/dist/coreValuePorts.d.ts +14 -1
- package/dist/coreValuePorts.js +14 -0
- package/dist/decideFailureNote.js +3 -1
- package/dist/decideReceipt.d.ts +9 -0
- package/dist/decideReceipt.js +29 -1
- package/dist/declared/supportFloorDeclared.js +2 -2
- package/dist/deviceRebind.d.ts +7 -0
- package/dist/deviceRebind.js +39 -5
- package/dist/displayUntrusted.d.ts +4 -2
- package/dist/displayUntrusted.js +45 -22
- package/dist/engineAddress.d.ts +3 -0
- package/dist/engineAddress.js +25 -0
- package/dist/engineDirectory.js +9 -17
- package/dist/engineErrorCodes.d.ts +8 -0
- package/dist/engineErrorCodes.js +8 -0
- package/dist/engineGenerationPort.d.ts +11 -2
- package/dist/engineGenerationPort.js +63 -9
- package/dist/engineHealthFacts.d.ts +5 -0
- package/dist/engineHealthFacts.js +11 -0
- package/dist/engineNoticeCodes.d.ts +26 -3
- package/dist/engineNoticeCodes.js +52 -7
- package/dist/engineRowRef.js +1 -1
- package/dist/errorSupplementRoles.js +2 -0
- package/dist/eventLeg.d.ts +3 -3
- package/dist/eventLeg.js +25 -4
- package/dist/fleet/fleetProjection.js +26 -5
- package/dist/generated/engineFactTables.d.ts +3 -1
- package/dist/generated/engineFactTables.js +4 -1
- package/dist/generated/engineNoticeTables.js +19 -4
- package/dist/generated/sdkFactTables.d.ts +5 -0
- package/dist/generated/sdkFactTables.js +24 -0
- package/dist/generated/settingsSchemaFns.d.ts +11 -0
- package/dist/generated/settingsSchemaFns.js +2 -1
- package/dist/generated/settingsSchemaSafetyMergeSpec.js +1 -1
- package/dist/generated/settingsSchemaSettingsSources.d.ts +1 -1
- package/dist/generated/settingsSchemaSettingsSources.js +22 -2
- package/dist/headlessReconnectWire.js +31 -4
- package/dist/hitl/approvalLiveFace.d.ts +17 -0
- package/dist/hitl/approvalLiveFace.js +35 -0
- package/dist/hitl/approvalQueueRow.d.ts +21 -0
- package/dist/hitl/approvalQueueRow.js +69 -0
- package/dist/hitl/approvalsFeed.d.ts +5 -4
- package/dist/hitl/approvalsFeed.js +38 -6
- package/dist/hitl/askGateWire.js +26 -2
- package/dist/hitl/askParkRowRouting.d.ts +4 -3
- package/dist/hitl/askParkRowRouting.js +15 -3
- package/dist/hitl/automaticAnswerVerdict.js +13 -10
- package/dist/hitl/crashConverged.d.ts +5 -1
- package/dist/hitl/decisionConflict.js +2 -1
- package/dist/hitl/decisionRefusal.js +1 -1
- package/dist/hitl/decisionSend.d.ts +1 -0
- package/dist/hitl/decisionSend.js +14 -2
- package/dist/hitl/frameRouter.d.ts +4 -0
- package/dist/hitl/frameRouter.js +18 -5
- package/dist/hitl/gateIdentity.d.ts +1 -0
- package/dist/hitl/gateIdentity.js +3 -0
- package/dist/hitl/hitlBridge.d.ts +1 -1
- package/dist/hitl/hitlBridge.js +26 -5
- package/dist/hitl/livePendingAsk.d.ts +5 -0
- package/dist/hitl/livePendingAsk.js +6 -1
- package/dist/hitl/planReviewCard.d.ts +23 -0
- package/dist/hitl/planReviewCard.js +250 -0
- package/dist/hitl/planReviewWire.d.ts +39 -14
- package/dist/hitl/planReviewWire.js +450 -163
- package/dist/hitl/sessionAllowRoute.d.ts +2 -0
- package/dist/hitl/sessionAllowRoute.js +7 -0
- package/dist/hitl/sessionPolicyWire.d.ts +1 -7
- package/dist/hitl/sessionPolicyWire.js +3 -43
- package/dist/hitl/subagentSource.d.ts +1 -0
- package/dist/hitl/subagentSource.js +13 -0
- package/dist/hitl/toolApprovalWire.d.ts +3 -2
- package/dist/hitl/toolApprovalWire.js +79 -37
- package/dist/hostSettingsSource.d.ts +5 -2
- package/dist/hostSettingsSource.js +19 -10
- package/dist/hostTurnSettings.d.ts +5 -6
- package/dist/hostTurnSettings.js +106 -26
- package/dist/i18n/messages.en.d.ts +85 -12
- package/dist/i18n/messages.en.js +85 -12
- package/dist/i18n/messages.zh.js +88 -12
- package/dist/index.d.ts +35 -4
- package/dist/index.js +19 -2
- package/dist/liveInitToolFace.js +0 -1
- package/dist/liveModelCatalog.d.ts +15 -0
- package/dist/liveModelCatalog.js +40 -0
- package/dist/mcpTransportKindsCapability.d.ts +18 -0
- package/dist/mcpTransportKindsCapability.js +75 -0
- package/dist/mcpWireCaps.d.ts +4 -1
- package/dist/mcpWireCaps.js +25 -14
- package/dist/modelCapabilityProbe.js +66 -33
- package/dist/notifications.d.ts +9 -0
- package/dist/notifications.js +11 -2
- package/dist/ownKey.d.ts +4 -1
- package/dist/ownKey.js +8 -2
- package/dist/permissionModeWriteCapability.d.ts +13 -0
- package/dist/permissionModeWriteCapability.js +35 -0
- package/dist/permissionsAllowGrantCapability.d.ts +3 -0
- package/dist/permissionsAllowGrantCapability.js +26 -3
- package/dist/permissionsDeclaration.d.ts +25 -3
- package/dist/permissionsDeclaration.js +69 -41
- package/dist/planReviewCardFacts.d.ts +116 -0
- package/dist/planReviewCardFacts.js +469 -0
- package/dist/projectSeed.d.ts +39 -0
- package/dist/projectSeed.js +80 -0
- package/dist/promptDelivery.js +1 -1
- package/dist/reattachWindow.d.ts +8 -1
- package/dist/reattachWindow.js +44 -12
- package/dist/replayBody.d.ts +7 -6
- package/dist/replayBody.js +62 -7
- package/dist/request/taskRequest.js +3 -4
- package/dist/ruleCompileVerdict.d.ts +0 -2
- package/dist/ruleCompileVerdict.js +0 -31
- package/dist/ruleRefusalSentence.js +0 -3
- package/dist/runFollow.d.ts +30 -0
- package/dist/runFollow.js +117 -0
- package/dist/runLedgerSnapshot.d.ts +20 -0
- package/dist/runLedgerSnapshot.js +272 -0
- package/dist/runPermissionModeSwitch.d.ts +57 -0
- package/dist/runPermissionModeSwitch.js +135 -0
- package/dist/runReattachPolicy.d.ts +16 -5
- package/dist/runReattachPolicy.js +72 -24
- package/dist/runTerminal.js +30 -8
- package/dist/sandboxWire.d.ts +0 -3
- package/dist/sandboxWire.js +0 -9
- package/dist/seam.d.ts +17 -7
- package/dist/seam.js +13 -1
- package/dist/seatContract.d.ts +57 -7
- package/dist/seatContract.js +133 -3
- package/dist/serverSupportRange.d.ts +18 -0
- package/dist/serverSupportRange.js +25 -0
- package/dist/sessionEngine.d.ts +156 -0
- package/dist/sessionEngine.js +464 -0
- package/dist/sessionMap.d.ts +11 -1
- package/dist/sessionMap.js +35 -9
- package/dist/sessionMemoryErase.d.ts +1 -1
- package/dist/sessionMemoryErase.js +5 -0
- package/dist/sessionMemoryStatus.d.ts +27 -1
- package/dist/sessionMemoryStatus.js +117 -0
- package/dist/sessionMemorySync.d.ts +31 -0
- package/dist/sessionMemorySync.js +95 -0
- package/dist/sessionRowTag.d.ts +4 -0
- package/dist/sessionRowTag.js +18 -0
- package/dist/settingsLayerAdmission.d.ts +1 -0
- package/dist/settingsLayerAdmission.js +4 -1
- package/dist/sseIdleTriage.d.ts +3 -1
- package/dist/sseIdleTriage.js +19 -4
- package/dist/subagent/engineSubagentTail.js +2 -0
- package/dist/subagentContentStore.d.ts +3 -0
- package/dist/subagentContentStore.js +10 -1
- package/dist/toolResult.js +1 -1
- package/dist/turnFailurePresentation.d.ts +5 -2
- package/dist/turnFailurePresentation.js +12 -4
- package/dist/wireRefusalCopy.js +2 -6
- package/docs/INTEGRATION-CLIENTS.md +1507 -18
- package/package.json +5 -5
|
@@ -4,10 +4,13 @@ import { type LiveModelCatalog } from './liveModelCatalog.js';
|
|
|
4
4
|
import type { TaskRequestLike } from './request/taskRequest.js';
|
|
5
5
|
export type TurnFailureCategory = 'auth' | 'billing' | 'rate_limited' | 'invalid_request' | 'capability_unavailable' | 'timeout' | 'server_error' | 'connection_lost' | 'parked' | 'internal';
|
|
6
6
|
export declare const TURN_FAILURE_CATEGORIES: readonly TurnFailureCategory[];
|
|
7
|
-
export
|
|
7
|
+
export type TurnFailureRetry = {
|
|
8
8
|
readonly offer: boolean;
|
|
9
9
|
readonly basis: 'wire' | 'category';
|
|
10
|
-
}
|
|
10
|
+
} | {
|
|
11
|
+
readonly offer: false;
|
|
12
|
+
readonly basis: 'not_followed';
|
|
13
|
+
};
|
|
11
14
|
export interface TurnFailurePresentation {
|
|
12
15
|
readonly category: TurnFailureCategory;
|
|
13
16
|
readonly kind: TurnWireErrorVerdict['kind'];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { msg, renderMessage } from './i18n/translate.js';
|
|
2
2
|
import { classifyTurnWireError, isPreStreamDrainingReject } from './wireErrorTriage.js';
|
|
3
3
|
import { isSseIdleError } from './sseIdleTriage.js';
|
|
4
|
+
import { runNotFollowedOf } from './runFollow.js';
|
|
4
5
|
import { isCodeClassifiedGateFailure } from './gateFailureCodes.js';
|
|
5
6
|
import { CORRUPT_ROW_ERROR_CODE, CORRUPT_SESSION_ERROR_CODE, MEMORY_CONTROL_PLANE_CORRUPT, SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE } from './engineErrorCodes.js';
|
|
6
7
|
import { admissionWallRefusalContent, admissionWallRefusalFromError, bodyShapeRefusalFromError, bodyShapeRefusalTouchesSettings, fleetLeaseUnavailableContent, fleetLeaseUnavailableFromError, hostPostureRefusalContent, hostPostureRefusalFromError, fieldLimitRefusalContent, fieldLimitRefusalFromError, toolDeclarationRefusalContent, toolDeclarationRefusalFromError, usageWindowExhaustedContent, usageWindowExhaustedFromError, quotaExhaustedContent, quotaExhaustedFromError, userAttachmentRefusalFromError, } from './wireRefusalCopy.js';
|
|
@@ -158,7 +159,12 @@ export function turnFailurePresentation(err, evidence, notesCtx, lang) {
|
|
|
158
159
|
const status = verdict.kind === 'http' ? verdict.status : undefined;
|
|
159
160
|
const errorCode = verdict.kind === 'http' ? httpCode : undefined;
|
|
160
161
|
const wireRetriable = readThrownSlot(subject, 'retriable', 'data') === true && !isCodeClassifiedGateFailure(errorCode, true);
|
|
161
|
-
const
|
|
162
|
+
const notFollowed = runNotFollowedOf(err) !== undefined;
|
|
163
|
+
const retry = notFollowed
|
|
164
|
+
? { offer: false, basis: 'not_followed' }
|
|
165
|
+
: wireRetriable && shape.category !== 'parked'
|
|
166
|
+
? { offer: true, basis: 'wire' }
|
|
167
|
+
: { offer: shape.offer, basis: 'category' };
|
|
162
168
|
const waitSec = waitSecOf(subject);
|
|
163
169
|
const chain = turnFailureNotesOf(subject, verdict, notesCtx, waitSec, lang);
|
|
164
170
|
const headline = headlineKey !== undefined ? renderMessage(msg(headlineKey), lang) : undefined;
|
|
@@ -298,7 +304,7 @@ export function seatTurnFailureOf(err, evidence) {
|
|
|
298
304
|
const p = turnFailurePresentation(err, evidence);
|
|
299
305
|
return {
|
|
300
306
|
category: p.category,
|
|
301
|
-
retry: { offer: p.retry.offer, basis: p.retry.basis },
|
|
307
|
+
retry: p.retry.basis === 'not_followed' ? { offer: false, basis: 'not_followed' } : { offer: p.retry.offer, basis: p.retry.basis },
|
|
302
308
|
...(p.waitSec !== undefined ? { waitSec: p.waitSec } : {}),
|
|
303
309
|
...(p.headline !== undefined ? { headline: p.headline } : {}),
|
|
304
310
|
...(p.errorCode !== undefined ? { errorCode: p.errorCode } : {}),
|
|
@@ -333,7 +339,9 @@ function seatTurnFailureShapeOf(event) {
|
|
|
333
339
|
return undefined;
|
|
334
340
|
const offer = seatDataField(retry, 'offer');
|
|
335
341
|
const basis = seatDataField(retry, 'basis');
|
|
336
|
-
if (typeof offer !== 'boolean' || (basis !== 'wire' && basis !== 'category'))
|
|
342
|
+
if (typeof offer !== 'boolean' || (basis !== 'wire' && basis !== 'category' && basis !== 'not_followed'))
|
|
343
|
+
return undefined;
|
|
344
|
+
if (basis === 'not_followed' && offer !== false)
|
|
337
345
|
return undefined;
|
|
338
346
|
const waitSec = seatDataField(raw, 'waitSec');
|
|
339
347
|
if (waitSec !== undefined && !(typeof waitSec === 'number' && Number.isInteger(waitSec) && waitSec >= 1))
|
|
@@ -346,7 +354,7 @@ function seatTurnFailureShapeOf(event) {
|
|
|
346
354
|
return undefined;
|
|
347
355
|
return Object.freeze({
|
|
348
356
|
category: category,
|
|
349
|
-
retry: Object.freeze({ offer, basis }),
|
|
357
|
+
retry: Object.freeze(basis === 'not_followed' ? { offer: false, basis } : { offer, basis }),
|
|
350
358
|
...(waitSec !== undefined ? { waitSec } : {}),
|
|
351
359
|
...(headline !== undefined ? { headline } : {}),
|
|
352
360
|
...(errorCode !== undefined ? { errorCode } : {}),
|
package/dist/wireRefusalCopy.js
CHANGED
|
@@ -4,6 +4,7 @@ import { ACTIVE_RUN_BUSY_ERROR_CODE, FLEET_LEASE_UNAVAILABLE, REQUEST_AUTONOMY_L
|
|
|
4
4
|
import { capForDisplay } from './fleetTaskDesc.js';
|
|
5
5
|
import { effectiveWireErrorCode } from './wireErrorTriage.js';
|
|
6
6
|
import { CORE_TOOL_DECLARATION_CODES } from './generated/engineFactTables.js';
|
|
7
|
+
import { SETTINGS_ECHO_CALLER_TEXT } from './generated/settingsSchemaFns.js';
|
|
7
8
|
import { PERMISSION_RULE_ISSUE_CODES, permissionRuleIssueDetail } from './permissionRuleIssue.js';
|
|
8
9
|
import { ruleRefusalListText } from './ruleRefusalSentence.js';
|
|
9
10
|
import { msg, renderMessage } from './i18n/translate.js';
|
|
@@ -579,11 +580,6 @@ export function bodyShapeRefusalFromError(err) {
|
|
|
579
580
|
}
|
|
580
581
|
}
|
|
581
582
|
const SETTINGS_PERMISSIONS_PREFIX = 'permissions.';
|
|
582
|
-
const ECHO_MAX_CHARS = 64;
|
|
583
|
-
function echoedKeyName(key) {
|
|
584
|
-
const clean = key.replace(/[\u0000-\u001f\u007f\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/g, '');
|
|
585
|
-
return clean.length > ECHO_MAX_CHARS ? `${clean.slice(0, ECHO_MAX_CHARS)}…` : clean;
|
|
586
|
-
}
|
|
587
583
|
function hasCustomJson(v) {
|
|
588
584
|
return typeof v === 'object' && v !== null && typeof v.toJSON === 'function';
|
|
589
585
|
}
|
|
@@ -615,7 +611,7 @@ function echoMatch(bag, prefix, echo) {
|
|
|
615
611
|
}
|
|
616
612
|
let state = 'absent';
|
|
617
613
|
for (const name of names) {
|
|
618
|
-
if (prefix +
|
|
614
|
+
if (prefix + SETTINGS_ECHO_CALLER_TEXT(name) !== echo)
|
|
619
615
|
continue;
|
|
620
616
|
const s = sentValue(bag, name).state;
|
|
621
617
|
if (s === 'sent')
|