@sema-agent/client-core 0.102.0 → 0.104.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 +172 -0
- package/README.md +23 -17
- package/dist/adapt/toolCards.d.ts +2 -1
- package/dist/adapt/toolCards.js +3 -1
- package/dist/adapter/downstream/eventToSdkMessage.d.ts +5 -1
- package/dist/adapter/downstream/eventToSdkMessage.js +23 -3
- package/dist/adapter/downstream/terminalToSdkResult.d.ts +0 -1
- package/dist/adapter/downstream/terminalToSdkResult.js +3 -2
- package/dist/adapter/downstream/wiringManifestView.js +4 -1
- package/dist/agentSession/engineAgentRegistryRead.js +3 -0
- package/dist/cloudConfigWireCaps.js +6 -3
- package/dist/coreValuePorts.d.ts +3 -1
- package/dist/coreValuePorts.js +5 -0
- package/dist/credentialPlaneCapability.d.ts +22 -0
- package/dist/credentialPlaneCapability.js +75 -0
- package/dist/deviceExecutorManagementCapability.d.ts +1 -0
- package/dist/deviceExecutorManagementCapability.js +3 -1
- package/dist/deviceRebind.d.ts +17 -4
- package/dist/deviceRebind.js +43 -14
- package/dist/engineAgentAbsence.d.ts +1 -0
- package/dist/engineErrorCodes.d.ts +1 -0
- package/dist/engineErrorCodes.js +3 -1
- package/dist/engineNoticeCodes.d.ts +26 -0
- package/dist/engineNoticeCodes.js +121 -12
- package/dist/engineRowRef.js +1 -0
- package/dist/errorSupplementRoles.js +1 -3
- package/dist/eventLeg.js +2 -1
- package/dist/executionPlacementWords.d.ts +3 -0
- package/dist/executionPlacementWords.js +2 -0
- package/dist/fleet/fleetProjection.js +15 -9
- package/dist/gateOutcome.d.ts +20 -0
- package/dist/gateOutcome.js +89 -0
- package/dist/generated/engineAskFaceTables.js +2 -2
- package/dist/generated/engineFactTables.d.ts +8 -3
- package/dist/generated/engineFactTables.js +58 -2
- package/dist/generated/engineNoticeTables.js +30 -0
- package/dist/generated/settingsSchemaDefaultModel.d.ts +1 -1
- package/dist/generated/settingsSchemaDefaultModel.js +2 -2
- package/dist/generated/settingsSchemaFns.d.ts +15 -0
- package/dist/generated/settingsSchemaFns.js +25 -2
- package/dist/generated/settingsSchemaHooksClassifier.js +109 -29
- package/dist/generated/settingsSchemaMcpRequestEntry.d.ts +1 -1
- package/dist/generated/settingsSchemaMcpRequestEntry.js +213 -93
- package/dist/generated/settingsSchemaMcpServerName.d.ts +1 -0
- package/dist/generated/settingsSchemaMcpServerName.js +8 -0
- package/dist/generated/settingsSchemaOwnKeyRead.d.ts +1 -0
- package/dist/generated/settingsSchemaOwnKeyRead.js +172 -0
- package/dist/generated/settingsSchemaPlainJsonObject.d.ts +1 -0
- package/dist/generated/settingsSchemaPlainJsonObject.js +28 -0
- package/dist/generated/settingsSchemaSafetyMergeSpec.js +10 -7
- package/dist/generated/settingsSchemaTierWords.d.ts +1 -0
- package/dist/generated/settingsSchemaTierWords.js +7 -0
- package/dist/generated/settingsSchemaTypes.d.ts +3 -1
- package/dist/hitl/automaticAnswerVerdict.d.ts +1 -1
- package/dist/hitl/automaticAnswerVerdict.js +47 -11
- package/dist/hitl/decisionConflict.js +11 -11
- package/dist/hitl/decisionRefusal.d.ts +1 -0
- package/dist/hitl/decisionRefusal.js +4 -2
- package/dist/hitl/editedRuleTextPrecheck.d.ts +1 -0
- package/dist/hitl/editedRuleTextPrecheck.js +26 -1
- package/dist/hitl/persistedRulesWire.js +1 -0
- package/dist/hitl/planReviewWire.d.ts +2 -1
- package/dist/hitl/planReviewWire.js +8 -12
- package/dist/hitl/sessionPolicyDeliverable.d.ts +0 -1
- package/dist/hitl/sessionPolicyDeliverable.js +31 -10
- package/dist/hitl/sessionPolicyWire.js +1 -1
- package/dist/hitl/toolApprovalWire.d.ts +20 -7
- package/dist/hitl/toolApprovalWire.js +171 -19
- package/dist/host.d.ts +0 -3
- package/dist/hostTurnSettings.js +3 -1
- package/dist/humanTurn.js +2 -2
- package/dist/i18n/messages.en.d.ts +5 -0
- package/dist/i18n/messages.en.js +6 -1
- package/dist/i18n/messages.zh.js +6 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.js +3 -1
- package/dist/inheritEnvWire.d.ts +1 -0
- package/dist/inheritEnvWire.js +8 -5
- package/dist/jsonFaithful.js +5 -3
- package/dist/mcpEngineLeg.d.ts +3 -0
- package/dist/mcpEngineLeg.js +4 -1
- package/dist/mcpLiveness.d.ts +18 -0
- package/dist/mcpLiveness.js +48 -1
- package/dist/mcpReconnect.d.ts +3 -0
- package/dist/mcpReconnect.js +6 -0
- package/dist/mcpStatusSupersetKeys.js +24 -1
- package/dist/mcpWireCaps.d.ts +2 -3
- package/dist/mcpWireCaps.js +10 -9
- package/dist/memoryEntriesWire.d.ts +35 -1
- package/dist/memoryEntriesWire.js +110 -14
- package/dist/modsFace.js +7 -3
- package/dist/postureKnob.js +1 -1
- package/dist/prepareRefusal.d.ts +0 -1
- package/dist/prepareRefusal.js +0 -3
- package/dist/printModelStatus.d.ts +1 -0
- package/dist/printModelStatus.js +6 -2
- package/dist/promptProfileWireCaps.d.ts +1 -3
- package/dist/promptProfileWireCaps.js +2 -2
- package/dist/request/taskRequest.d.ts +1 -1
- package/dist/request/taskRequest.js +3 -3
- package/dist/retryStatus.d.ts +20 -1
- package/dist/retryStatus.js +31 -7
- package/dist/ruleCompileVerdict.d.ts +1 -0
- package/dist/ruleCompileVerdict.js +3 -1
- package/dist/seatContract.d.ts +7 -7
- package/dist/seatContract.js +49 -10
- package/dist/sessionMemoryErase.js +24 -2
- package/dist/sessionRowTag.d.ts +24 -0
- package/dist/sessionRowTag.js +77 -0
- package/dist/systemReminderTag.js +14 -4
- package/dist/turnFailurePresentation.js +8 -1
- package/dist/wireFailureShape.d.ts +12 -1
- package/dist/wireFailureShape.js +58 -24
- package/dist/wireRefusalCopy.d.ts +0 -3
- package/dist/wireRefusalCopy.js +0 -17
- package/docs/INTEGRATION-CLIENTS.md +400 -14
- package/package.json +5 -5
|
@@ -23,6 +23,11 @@ export type ThrownExtraReading = {
|
|
|
23
23
|
readonly state: 'unreadable';
|
|
24
24
|
};
|
|
25
25
|
export declare function readThrownExtra(o: {} | null | undefined): ThrownExtraReading;
|
|
26
|
+
export interface ThrownExtraSnapshot {
|
|
27
|
+
readonly sdkInstance: boolean;
|
|
28
|
+
readonly bag: ThrownExtraReading;
|
|
29
|
+
}
|
|
30
|
+
export declare function readThrownExtraSnapshot(o: {} | null | undefined): ThrownExtraSnapshot;
|
|
26
31
|
export declare const PROTOCOL_ERROR_NAME: Readonly<{
|
|
27
32
|
readonly ApprovalBindingMismatchError: "ApprovalBindingMismatchError";
|
|
28
33
|
readonly ApprovalStaleError: "ApprovalStaleError";
|
|
@@ -53,7 +58,7 @@ export type ProtocolErrorNameReading = {
|
|
|
53
58
|
} | {
|
|
54
59
|
readonly state: 'unreadable';
|
|
55
60
|
};
|
|
56
|
-
export declare function protocolErrorNameReading(e: object): ProtocolErrorNameReading;
|
|
61
|
+
export declare function protocolErrorNameReading(e: object, extra?: ThrownExtraSnapshot): ProtocolErrorNameReading;
|
|
57
62
|
export declare function protocolErrorNameOf(e: object): ProtocolErrorName | undefined;
|
|
58
63
|
export type ThrownStatusReading = number | undefined | typeof THROWN_SLOT_UNREADABLE;
|
|
59
64
|
export declare function readThrownStatusSlot(o: object, notePresence?: (presence: SlotPresence) => void): ThrownStatusReading;
|
|
@@ -66,6 +71,7 @@ export declare function slotPresenceOf(o: object, key: string): SlotPresence;
|
|
|
66
71
|
export declare function slotReadOf(o: object, key: string): OwnSlotRead;
|
|
67
72
|
export declare function readErrorNumber(o: object, key: string): number | undefined;
|
|
68
73
|
export declare function readErrorRecord(o: object, key: string): object | undefined;
|
|
74
|
+
export declare function readErrorPresent(o: object, key: string): {} | null | undefined;
|
|
69
75
|
export declare function readErrorString(o: object, key: string): string | undefined;
|
|
70
76
|
export declare function readErrorStringList(o: object, key: string): readonly string[] | undefined;
|
|
71
77
|
export declare function readErrorStrictStringList(o: object, key: string): readonly string[] | undefined;
|
|
@@ -106,6 +112,11 @@ export declare function ownFoldedCodeBitsOf(wire: {
|
|
|
106
112
|
readonly blockedBy?: string;
|
|
107
113
|
} | undefined): FoldedCodeBits;
|
|
108
114
|
export declare function readRefusalField(o: object): string | undefined;
|
|
115
|
+
export interface RefusalSlotReading {
|
|
116
|
+
readonly word: string | undefined;
|
|
117
|
+
readonly present: boolean;
|
|
118
|
+
}
|
|
119
|
+
export declare function readRefusalSlots<K extends string>(o: object, keys: readonly K[], bag?: ThrownExtraReading): Readonly<Record<K, RefusalSlotReading>>;
|
|
109
120
|
export declare const REFUSAL_PROBLEMS_READ_MAX = 1000;
|
|
110
121
|
export declare function readRefusalNamedFields(o: object): readonly string[];
|
|
111
122
|
export declare function isDisplayableWireCode(s: string): boolean;
|
package/dist/wireFailureShape.js
CHANGED
|
@@ -87,28 +87,38 @@ function isBuiltinErrorPrototype(node) {
|
|
|
87
87
|
return ['message', 'name', 'toString'].every((k) => Object.getOwnPropertyDescriptor(node, k) !== undefined);
|
|
88
88
|
}
|
|
89
89
|
export function readThrownExtra(o) {
|
|
90
|
+
return readThrownExtraSnapshot(o).bag;
|
|
91
|
+
}
|
|
92
|
+
export function readThrownExtraSnapshot(o) {
|
|
90
93
|
if (o === null || o === undefined || (typeof o !== 'object' && typeof o !== 'function'))
|
|
91
|
-
return { state: 'absent' };
|
|
94
|
+
return { sdkInstance: false, bag: { state: 'absent' } };
|
|
95
|
+
let at;
|
|
96
|
+
try {
|
|
97
|
+
at = extraSlotOf(o);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return { sdkInstance: false, bag: { state: 'unreadable' } };
|
|
101
|
+
}
|
|
102
|
+
const sdkInstance = at.kind === 'sdk-class';
|
|
103
|
+
if (at.kind === 'own-accessor')
|
|
104
|
+
return { sdkInstance, bag: { state: 'unreadable' } };
|
|
105
|
+
if (at.kind === 'none')
|
|
106
|
+
return { sdkInstance, bag: { state: 'absent' } };
|
|
92
107
|
let slot;
|
|
93
108
|
try {
|
|
94
|
-
const at = extraSlotOf(o);
|
|
95
|
-
if (at.kind === 'own-accessor')
|
|
96
|
-
return { state: 'unreadable' };
|
|
97
|
-
if (at.kind === 'none')
|
|
98
|
-
return { state: 'absent' };
|
|
99
109
|
slot = at.kind === 'own-data' ? at.value : Reflect.get(o, EXTRA_KEY);
|
|
100
110
|
}
|
|
101
111
|
catch {
|
|
102
|
-
return { state: 'unreadable' };
|
|
112
|
+
return { sdkInstance, bag: { state: 'unreadable' } };
|
|
103
113
|
}
|
|
104
114
|
try {
|
|
105
115
|
if (typeof slot !== 'object' || slot === null || Array.isArray(slot))
|
|
106
|
-
return { state: 'absent' };
|
|
116
|
+
return { sdkInstance, bag: { state: 'absent' } };
|
|
107
117
|
}
|
|
108
118
|
catch {
|
|
109
|
-
return { state: 'unreadable' };
|
|
119
|
+
return { sdkInstance, bag: { state: 'unreadable' } };
|
|
110
120
|
}
|
|
111
|
-
return { state: 'object', value: slot };
|
|
121
|
+
return { sdkInstance, bag: { state: 'object', value: slot } };
|
|
112
122
|
}
|
|
113
123
|
export const PROTOCOL_ERROR_NAME = Object.freeze({
|
|
114
124
|
ApprovalBindingMismatchError: 'ApprovalBindingMismatchError',
|
|
@@ -137,11 +147,11 @@ export function isSdkErrorInstance(o) {
|
|
|
137
147
|
return false;
|
|
138
148
|
}
|
|
139
149
|
}
|
|
140
|
-
export function protocolErrorNameReading(e) {
|
|
150
|
+
export function protocolErrorNameReading(e, extra) {
|
|
141
151
|
if (typeof e !== 'object' || e === null)
|
|
142
152
|
return { state: 'absent' };
|
|
143
153
|
try {
|
|
144
|
-
if (isSdkErrorInstance(e))
|
|
154
|
+
if (extra !== undefined ? extra.sdkInstance : isSdkErrorInstance(e))
|
|
145
155
|
return { state: 'sdk-instance' };
|
|
146
156
|
const name = ownDataField(e, 'name');
|
|
147
157
|
return typeof name === 'string' && PROTOCOL_ERROR_NAMES.has(name) ? { state: 'named', name: name } : { state: 'absent' };
|
|
@@ -221,6 +231,10 @@ export function readErrorRecord(o, key) {
|
|
|
221
231
|
const v = readErrorSlot(o, key, (x) => typeof x === 'object' && x !== null && !Array.isArray(x));
|
|
222
232
|
return typeof v === 'object' && v !== null && !Array.isArray(v) ? v : undefined;
|
|
223
233
|
}
|
|
234
|
+
export function readErrorPresent(o, key) {
|
|
235
|
+
const v = readErrorSlot(o, key, (x) => x !== undefined);
|
|
236
|
+
return v === undefined ? undefined : v;
|
|
237
|
+
}
|
|
224
238
|
export function readErrorString(o, key) {
|
|
225
239
|
const v = readErrorSlot(o, key, (x) => typeof x === 'string');
|
|
226
240
|
return typeof v === 'string' ? v : undefined;
|
|
@@ -396,18 +410,38 @@ export function ownFoldedCodeBitsOf(wire) {
|
|
|
396
410
|
return Object.freeze({ errorCode: bit('errorCode'), blockedBy: bit('blockedBy') });
|
|
397
411
|
}
|
|
398
412
|
export function readRefusalField(o) {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
413
|
+
return readRefusalSlots(o, REFUSAL_FIELD_ONLY).field.word;
|
|
414
|
+
}
|
|
415
|
+
const REFUSAL_SLOT_ABSENT = Object.freeze({ word: undefined, present: false });
|
|
416
|
+
const REFUSAL_SLOT_HELD_UNREADABLE = Object.freeze({ word: undefined, present: true });
|
|
417
|
+
const REFUSAL_FIELD_ONLY = Object.freeze(['field']);
|
|
418
|
+
function refusalSlotOf(container, key) {
|
|
419
|
+
try {
|
|
420
|
+
const d = Object.getOwnPropertyDescriptor(container, key);
|
|
421
|
+
if (d === undefined)
|
|
422
|
+
return REFUSAL_SLOT_ABSENT;
|
|
423
|
+
if (!Object.hasOwn(d, 'value'))
|
|
424
|
+
return REFUSAL_SLOT_HELD_UNREADABLE;
|
|
425
|
+
const v = d.value;
|
|
426
|
+
if (v === undefined)
|
|
427
|
+
return REFUSAL_SLOT_ABSENT;
|
|
428
|
+
return typeof v === 'string' && v !== '' ? Object.freeze({ word: v, present: true }) : REFUSAL_SLOT_HELD_UNREADABLE;
|
|
429
|
+
}
|
|
430
|
+
catch {
|
|
431
|
+
return REFUSAL_SLOT_HELD_UNREADABLE;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
export function readRefusalSlots(o, keys, bag = readThrownExtra(o)) {
|
|
435
|
+
const carrier = isSlotCarrier(o);
|
|
436
|
+
const out = Object.create(null);
|
|
437
|
+
for (const key of keys) {
|
|
438
|
+
const fromBag = bag.state === 'object' ? refusalSlotOf(bag.value, key) : REFUSAL_SLOT_ABSENT;
|
|
439
|
+
const top = carrier ? refusalSlotOf(o, key) : REFUSAL_SLOT_ABSENT;
|
|
440
|
+
const word = fromBag.word ?? top.word;
|
|
441
|
+
const present = bag.state === 'unreadable' || fromBag.present || top.present;
|
|
442
|
+
out[key] = word === undefined && !present ? REFUSAL_SLOT_ABSENT : Object.freeze({ word, present });
|
|
443
|
+
}
|
|
444
|
+
return Object.freeze(out);
|
|
411
445
|
}
|
|
412
446
|
export const REFUSAL_PROBLEMS_READ_MAX = 1000;
|
|
413
447
|
export function readRefusalNamedFields(o) {
|
|
@@ -126,7 +126,6 @@ export type HookMatcherRefusal = {
|
|
|
126
126
|
readonly totalMs?: number;
|
|
127
127
|
readonly path?: readonly (string | number)[];
|
|
128
128
|
};
|
|
129
|
-
export declare function hookMatcherRefusalFromError(err: unknown): HookMatcherRefusal | undefined;
|
|
130
129
|
export interface SettingsHooksRefusal {
|
|
131
130
|
readonly reason: string;
|
|
132
131
|
readonly path?: readonly (string | number)[];
|
|
@@ -159,11 +158,9 @@ export interface UserAttachmentRefusalDetail {
|
|
|
159
158
|
readonly path?: string;
|
|
160
159
|
}
|
|
161
160
|
export declare function userAttachmentRefusalFromError(err: {} | null | undefined): UserAttachmentRefusalDetail | null;
|
|
162
|
-
export declare function userAttachmentRefusalContent(detail?: Pick<UserAttachmentRefusalDetail, 'index'>): string;
|
|
163
161
|
export interface UserInvokedSkillRefusalDetail {
|
|
164
162
|
readonly code: typeof USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE;
|
|
165
163
|
readonly retryable: false;
|
|
166
164
|
}
|
|
167
165
|
export declare function userInvokedSkillRefusalFromError(err: {} | null | undefined): UserInvokedSkillRefusalDetail | null;
|
|
168
|
-
export declare function userInvokedSkillRefusalContent(): string;
|
|
169
166
|
export {};
|
package/dist/wireRefusalCopy.js
CHANGED
|
@@ -4,7 +4,6 @@ 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 { prepareRefusalNoteOf } from './prepareRefusal.js';
|
|
8
7
|
import { PERMISSION_RULE_ISSUE_CODES, permissionRuleIssueDetail } from './permissionRuleIssue.js';
|
|
9
8
|
import { ruleRefusalListText } from './ruleRefusalSentence.js';
|
|
10
9
|
import { msg, renderMessage } from './i18n/translate.js';
|
|
@@ -734,9 +733,6 @@ export function hostPostureRefusalContent(detail, lang) {
|
|
|
734
733
|
}
|
|
735
734
|
}
|
|
736
735
|
const HOOK_MATCHER_REFUSAL_FIELD = 'settings.hooks';
|
|
737
|
-
export function hookMatcherRefusalFromError(err) {
|
|
738
|
-
return settingsHooksRefusalFromError(err)?.matcher;
|
|
739
|
-
}
|
|
740
736
|
function hooksRefusalPathOf(detail) {
|
|
741
737
|
try {
|
|
742
738
|
const raw = readOwnDataValue(detail, 'path');
|
|
@@ -979,19 +975,6 @@ export function userAttachmentRefusalFromError(err) {
|
|
|
979
975
|
return null;
|
|
980
976
|
}
|
|
981
977
|
}
|
|
982
|
-
export function userAttachmentRefusalContent(detail) {
|
|
983
|
-
let index;
|
|
984
|
-
try {
|
|
985
|
-
index = detail === undefined || detail === null ? undefined : detail.index;
|
|
986
|
-
}
|
|
987
|
-
catch {
|
|
988
|
-
index = undefined;
|
|
989
|
-
}
|
|
990
|
-
return prepareRefusalNoteOf(USER_ATTACHMENT_INVALID_ERROR_CODE, typeof index === 'number' ? { index } : undefined);
|
|
991
|
-
}
|
|
992
978
|
export function userInvokedSkillRefusalFromError(err) {
|
|
993
979
|
return effectiveWireErrorCode(err) === USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE ? { code: USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE, retryable: false } : null;
|
|
994
980
|
}
|
|
995
|
-
export function userInvokedSkillRefusalContent() {
|
|
996
|
-
return prepareRefusalNoteOf(USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE);
|
|
997
|
-
}
|