@sema-agent/client-core 0.92.0 → 0.93.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 +227 -0
- package/README.md +25 -16
- package/dist/adapt/arms.js +2 -0
- package/dist/adapt/toolCards.js +6 -4
- package/dist/adapt.d.ts +1 -1
- package/dist/adapt.js +1 -1
- package/dist/adapter/runStream.js +3 -1
- package/dist/agentsWireCaps.js +1 -1
- package/dist/approvalDecidedByCapability.d.ts +16 -0
- package/dist/approvalDecidedByCapability.js +47 -0
- package/dist/approvalsStreamLiveCapability.js +3 -3
- package/dist/askSurvivesStandingAnswer.d.ts +1 -1
- package/dist/centerWiringCapability.js +1 -1
- package/dist/cloudConfigWireCaps.js +5 -5
- package/dist/compensations.js +2 -2
- package/dist/decideReceipt.d.ts +2 -0
- package/dist/decideReceipt.js +34 -9
- package/dist/detachWire.d.ts +2 -14
- package/dist/detachWire.js +1 -47
- package/dist/deviceExecutorManagementCapability.d.ts +6 -2
- package/dist/deviceExecutorManagementCapability.js +61 -15
- package/dist/engineConfigDrift.d.ts +20 -0
- package/dist/engineConfigDrift.js +54 -0
- package/dist/engineErrorCodes.d.ts +3 -0
- package/dist/engineErrorCodes.js +12 -4
- package/dist/engineInlineTaskStats.d.ts +1 -0
- package/dist/engineNoticeCodes.d.ts +2 -2
- package/dist/engineWireFor.d.ts +22 -0
- package/dist/engineWireFor.js +154 -9
- package/dist/engineWireSdk.d.ts +0 -1
- package/dist/engineWireSdk.js +0 -3
- package/dist/executionLaneCapability.js +2 -2
- package/dist/fileHistoryCaptureCapability.d.ts +1 -1
- package/dist/fileHistoryCaptureCapability.js +1 -6
- package/dist/fileHistoryLegNotice.d.ts +1 -1
- package/dist/fileHistoryLegNotice.js +1 -6
- package/dist/gateVocabulary.d.ts +1 -5
- package/dist/gateVocabulary.js +4 -22
- package/dist/generated/engineFactTables.d.ts +4 -3
- package/dist/generated/engineFactTables.js +10 -0
- package/dist/generated/engineNoticeTables.d.ts +1 -1
- package/dist/generated/engineNoticeTables.js +1 -1
- package/dist/goalStopHook.d.ts +1 -8
- package/dist/goalStopHook.js +2 -58
- package/dist/headlessPermissionModeWire.d.ts +3 -2
- package/dist/headlessPermissionModeWire.js +46 -5
- package/dist/hitl/approvalResolution.d.ts +3 -2
- package/dist/hitl/approvalResolution.js +13 -0
- package/dist/hitl/askParkRowRouting.js +2 -2
- package/dist/hitl/frameRouter.js +7 -2
- package/dist/hitl/gateLedger.d.ts +1 -0
- package/dist/hitl/gateLedger.js +3 -0
- package/dist/hitl/hitlBridge.d.ts +1 -0
- package/dist/hitl/hitlBridge.js +6 -1
- package/dist/hitl/hitlHostSurface.d.ts +6 -2
- package/dist/hitl/hitlHostSurface.js +29 -3
- package/dist/hitl/parkResolver.js +22 -4
- package/dist/hitl/persistedRulesWire.js +29 -17
- package/dist/hitl/planReviewWire.d.ts +0 -2
- package/dist/hitl/planReviewWire.js +1 -18
- package/dist/hitl/sessionPolicyDeliverable.js +3 -3
- package/dist/hitl/sessionPolicyWire.d.ts +2 -0
- package/dist/hitl/sessionPolicyWire.js +7 -4
- package/dist/hitl/toolApprovalWire.d.ts +32 -7
- package/dist/hitl/toolApprovalWire.js +282 -59
- package/dist/hooksWireCaps.d.ts +1 -1
- package/dist/hooksWireCaps.js +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.js +6 -2
- package/dist/inheritEnvWire.d.ts +1 -4
- package/dist/inheritEnvWire.js +0 -18
- package/dist/limitsWire.d.ts +0 -6
- package/dist/limitsWire.js +0 -38
- package/dist/mcpProbeCapability.js +1 -1
- package/dist/mcpProbeWire.js +10 -12
- package/dist/mcpReconnect.d.ts +5 -0
- package/dist/mcpReconnect.js +28 -0
- package/dist/memoryComplianceCapability.js +2 -2
- package/dist/memoryOriginCapability.js +2 -2
- package/dist/memoryVerbsWire.js +14 -13
- package/dist/ownKey.d.ts +2 -0
- package/dist/ownKey.js +15 -0
- package/dist/peerLaneCapability.js +2 -2
- package/dist/permissionModesCapability.d.ts +16 -0
- package/dist/permissionModesCapability.js +71 -0
- package/dist/permissionRuleIssue.js +1 -1
- package/dist/permissionRulesWriteCapability.js +2 -2
- package/dist/permissionWireCaps.d.ts +2 -0
- package/dist/permissionWireCaps.js +8 -1
- package/dist/permissionsAllowGrantCapability.js +7 -2
- package/dist/postureKnob.js +1 -1
- package/dist/protocolSegment.d.ts +2 -0
- package/dist/protocolSegment.js +3 -0
- package/dist/readFacePosture.js +1 -1
- package/dist/resumeRefusalCopy.d.ts +1 -0
- package/dist/resumeRefusalCopy.js +26 -3
- package/dist/retryStatus.js +2 -1
- package/dist/rewindArchiveCapability.js +2 -2
- package/dist/runTerminal.d.ts +16 -0
- package/dist/runTerminal.js +32 -3
- package/dist/seam.d.ts +1 -0
- package/dist/sessionPolicyCapability.js +1 -1
- package/dist/sessionSyncFileHistoryCapability.js +2 -2
- package/dist/skillToolListsCapability.js +1 -1
- package/dist/sqlEngineCapability.js +1 -1
- package/dist/steerPriorityCapability.js +1 -1
- package/dist/storePostureCapability.js +2 -2
- package/dist/supportFloor.d.ts +1 -0
- package/dist/supportFloor.js +13 -3
- package/dist/taskRequestWords.d.ts +4 -2
- package/dist/taskRequestWords.js +1 -1
- package/dist/toolHistoryBadTurn.js +1 -2
- package/dist/toolResult.d.ts +2 -1
- package/dist/toolResult.js +33 -3
- package/dist/userInvokedSkillsCapability.js +1 -1
- package/dist/webSearchBackendCapability.js +2 -2
- package/dist/webSearchWireCaps.d.ts +1 -1
- package/dist/webSearchWireCaps.js +40 -2
- package/dist/wireFailureShape.js +2 -2
- package/dist/wireRefusalCopy.d.ts +9 -3
- package/dist/wireRefusalCopy.js +41 -4
- package/dist/workflowsJournalCapability.js +1 -1
- package/dist/writeProtectionCapability.js +1 -1
- package/docs/INTEGRATION-CLIENTS.md +999 -15
- package/package.json +2 -2
|
@@ -115,6 +115,8 @@ export declare function sessionPolicyReadNotice(outcome: Exclude<SessionPolicyRe
|
|
|
115
115
|
kind: 'present';
|
|
116
116
|
}> | {
|
|
117
117
|
kind: 'no_target';
|
|
118
|
+
} | {
|
|
119
|
+
kind: 'not_started';
|
|
118
120
|
}): string;
|
|
119
121
|
export interface SessionPolicyRemovedEntry {
|
|
120
122
|
readonly field: 'toolDeny' | 'toolAllow';
|
|
@@ -328,7 +328,7 @@ export function sessionPolicyTightenNotice(outcome) {
|
|
|
328
328
|
case 'face_unavailable':
|
|
329
329
|
return 'This deployment does not keep per-session tool rules, so nothing was written.';
|
|
330
330
|
case 'session_not_found':
|
|
331
|
-
return 'This session is not readable from here — it may not exist, or it may belong to someone else; nothing was written.';
|
|
331
|
+
return 'This session is not readable from here — it may not exist, or it may belong to someone else (the engine answers both the same way, so this client cannot tell which); nothing was written.';
|
|
332
332
|
case 'session_ownerless':
|
|
333
333
|
return 'This session has no owner, so a rule written for it could never be read back; nothing was written. Attach an identity to the session and try again.';
|
|
334
334
|
case 'unauthorized':
|
|
@@ -354,6 +354,7 @@ export function sessionPolicyTightenNotice(outcome) {
|
|
|
354
354
|
}
|
|
355
355
|
const READ_NOTICE_GENERIC = 'This session’s rule record could not be shown, so what it holds is not known. Try reading it again.';
|
|
356
356
|
const READ_NOTICE_NO_TARGET = 'There is no engine connection for this session, so its rule record cannot be read and what it holds is not known. Look again once it is connected.';
|
|
357
|
+
const READ_NOTICE_NOT_STARTED = 'This session has not begun on the engine yet — nothing has been sent in it — so it has no rule record to read. Send a first message, then look again.';
|
|
357
358
|
function readFailureSentence(kind) {
|
|
358
359
|
switch (kind) {
|
|
359
360
|
case 'face-unavailable':
|
|
@@ -367,7 +368,7 @@ function readFailureSentence(kind) {
|
|
|
367
368
|
case 'session-ownerless':
|
|
368
369
|
return 'This session has no owner, so it has no rule record to read.';
|
|
369
370
|
case 'session-not-found':
|
|
370
|
-
return 'This session is not readable from here — it may not exist, or it may belong to someone else — so its rule record cannot be shown. Check that you are connected to the engine and the session you meant, or continue in a new session.';
|
|
371
|
+
return 'This session is not readable from here — it may not exist, or it may belong to someone else (the engine answers both the same way, so this client cannot tell which) — so its rule record cannot be shown. Check that you are connected to the engine and the session you meant, or continue in a new session.';
|
|
371
372
|
case 'request-rejected':
|
|
372
373
|
return 'The engine rejected the request to read this session’s rule record as malformed, so it could not be read. Sending the same request again will not change that; check which session was asked for.';
|
|
373
374
|
case 'legacy-tool-name':
|
|
@@ -409,6 +410,8 @@ export function sessionPolicyReadNotice(outcome) {
|
|
|
409
410
|
return readMalformedSentence(ownRead(outcome, 'why')) ?? READ_NOTICE_GENERIC;
|
|
410
411
|
if (arm === 'no_target')
|
|
411
412
|
return READ_NOTICE_NO_TARGET;
|
|
413
|
+
if (arm === 'not_started')
|
|
414
|
+
return READ_NOTICE_NOT_STARTED;
|
|
412
415
|
return READ_NOTICE_GENERIC;
|
|
413
416
|
}
|
|
414
417
|
catch {
|
|
@@ -569,7 +572,7 @@ export function sessionPolicyRemovalNotice(outcome) {
|
|
|
569
572
|
case 'face_unavailable':
|
|
570
573
|
return 'This deployment does not keep per-session tool rules, so there is no session rule record to remove entries from — nothing was changed.';
|
|
571
574
|
case 'session_not_found':
|
|
572
|
-
return 'This session is not readable from here — it may not exist, or it may belong to someone else; nothing was changed.';
|
|
575
|
+
return 'This session is not readable from here — it may not exist, or it may belong to someone else (the engine answers both the same way, so this client cannot tell which); nothing was changed.';
|
|
573
576
|
case 'session_ownerless':
|
|
574
577
|
return 'This session has no owner, so it has no session rule record to change; nothing was changed.';
|
|
575
578
|
case 'unauthorized':
|
|
@@ -586,7 +589,7 @@ export function sessionPolicyRemovalNotice(outcome) {
|
|
|
586
589
|
case 'store_corrupt':
|
|
587
590
|
return 'The engine could not establish which version this session’s rules are at and refused to stamp a new one, so nothing was changed. This needs an operator to look at the rule store.';
|
|
588
591
|
case 'session_not_found':
|
|
589
|
-
return 'This session is not writable from here — it may not exist, or it may belong to someone else; nothing was changed.';
|
|
592
|
+
return 'This session is not writable from here — it may not exist, or it may belong to someone else (the engine answers both the same way, so this client cannot tell which); nothing was changed.';
|
|
590
593
|
case 'unauthorized':
|
|
591
594
|
return 'This call could not present a verifiable identity, so nothing was changed.';
|
|
592
595
|
default:
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type GateCurrentPending, type HitlFailureStage, type HitlSafetyCode, type HitlClientLike, type DecideOperationObserver } from './hitlBridge.js';
|
|
2
2
|
import { type AllowRuleShadowedWireMember, type ApprovalAllowRuleShadow } from './allowRuleShadow.js';
|
|
3
|
-
import { type RuleStoreUnreadableKind } from '../gateVocabulary.js';
|
|
4
3
|
import { type ApprovalMandateWord } from '../gateVocabulary.js';
|
|
5
4
|
import type { ToolPermissionRequest } from '../seatContract.js';
|
|
6
5
|
import { type DenyAttributionRefusalDetail } from '../wireRefusalCopy.js';
|
|
6
|
+
import { type ApprovalDecidedByReading } from '../approvalDecidedByCapability.js';
|
|
7
7
|
import { type DecideReceiptView } from '../decideReceipt.js';
|
|
8
8
|
import { RULE_OFFER_MATCHES, RULE_OFFER_BATCH_MEMBER_KINDS, RULE_OFFER_UNCOVERED_REASONS, RULE_OFFERS_ABSENCE_REASONS } from '@sema-agent/sdk';
|
|
9
|
-
import type {
|
|
9
|
+
import type { ToolApprovalRespondAck, PersistedRuleAnchor as SdkPersistedRuleAnchor, RuleOfferMatch as SdkRuleOfferMatch, RuleOfferBatchMember as SdkRuleOfferBatchMember, RuleOfferUncoveredDetail as SdkRuleOfferUncoveredDetail, RuleOfferUncoveredReason as SdkRuleOfferUncoveredReason, AskOrigin as SdkAskOrigin, RuleOffersAbsence as SdkRuleOffersAbsence, DenialLimitKind as SdkDenialLimitKind, DenialLimitFallback as SdkDenialLimitFallback } from '@sema-agent/sdk';
|
|
10
10
|
export declare function isFsApprovalGate(gate: {
|
|
11
11
|
kind?: unknown;
|
|
12
12
|
toolName?: unknown;
|
|
@@ -24,13 +24,17 @@ export type FsApprovalOutcome = {
|
|
|
24
24
|
denySettledBy?: ApprovalDenySettledBy | undefined;
|
|
25
25
|
denyReason?: string | undefined;
|
|
26
26
|
denyAttributionDropped?: true;
|
|
27
|
+
denyAttributionRenamed?: true;
|
|
27
28
|
receipt?: DecideReceiptView | undefined;
|
|
29
|
+
joinedInFlight?: true;
|
|
28
30
|
} | {
|
|
29
31
|
kind: 'aborted';
|
|
30
32
|
gatedCallId?: string | undefined;
|
|
33
|
+
joinedInFlight?: true;
|
|
31
34
|
} | {
|
|
32
35
|
kind: 'retracted';
|
|
33
36
|
gatedCallId?: string | undefined;
|
|
37
|
+
joinedInFlight?: true;
|
|
34
38
|
} | {
|
|
35
39
|
kind: 'failed';
|
|
36
40
|
stage: HitlFailureStage;
|
|
@@ -44,11 +48,13 @@ export type FsApprovalOutcome = {
|
|
|
44
48
|
currentPending?: GateCurrentPending | undefined;
|
|
45
49
|
denyAttributionRefusal?: DenyAttributionRefusalDetail | undefined;
|
|
46
50
|
editRefused?: true;
|
|
51
|
+
joinedInFlight?: true;
|
|
47
52
|
};
|
|
48
53
|
export interface FsApprovalWireDeps {
|
|
49
54
|
client: HitlClientLike;
|
|
50
55
|
onPresented?: () => void;
|
|
51
56
|
onDecideOperation?: DecideOperationObserver;
|
|
57
|
+
approvalDecidedBy?: ApprovalDecidedByReading | undefined;
|
|
52
58
|
}
|
|
53
59
|
export declare function structurallyEqual(a: unknown, b: unknown): boolean;
|
|
54
60
|
export type RuleOfferMatch = SdkRuleOfferMatch;
|
|
@@ -151,7 +157,6 @@ export interface ApprovalCardRequest {
|
|
|
151
157
|
origin?: string;
|
|
152
158
|
askClass?: string;
|
|
153
159
|
classes?: readonly string[];
|
|
154
|
-
ruleStoreUnreadable?: RuleStoreUnreadableKind;
|
|
155
160
|
}
|
|
156
161
|
export type ApprovalCardPort = (req: ApprovalCardRequest) => Promise<ApprovalCardDecision>;
|
|
157
162
|
export declare function installApprovalCardPort(port: ApprovalCardPort | null): () => void;
|
|
@@ -164,6 +169,11 @@ export declare function approvalCardPortFor(sessionKey: string): ApprovalCardPor
|
|
|
164
169
|
export declare function _resetApprovalCardPortForTest(): void;
|
|
165
170
|
export declare function surfaceApprovalCard(req: ApprovalCardRequest): Promise<ApprovalCardDecision>;
|
|
166
171
|
export declare function surfaceFsApprovalAndDecide(deps: FsApprovalWireDeps, taskId: string, argsByCall: Map<string, unknown>, signal?: AbortSignal, parkGatedCallId?: string): Promise<FsApprovalOutcome>;
|
|
172
|
+
export interface BoundSkillGrantsWire {
|
|
173
|
+
readonly skill: string | null;
|
|
174
|
+
readonly allowedTools: readonly string[];
|
|
175
|
+
readonly disallowedTools: readonly string[];
|
|
176
|
+
}
|
|
167
177
|
export interface ToolApprovalFrame {
|
|
168
178
|
type: 'tool_approval' | 'tool_approval_complete';
|
|
169
179
|
approvalId: string;
|
|
@@ -178,13 +188,14 @@ export interface ToolApprovalFrame {
|
|
|
178
188
|
sourceAgentName?: string;
|
|
179
189
|
governanceForced?: true;
|
|
180
190
|
delegation?: ToolApprovalDelegation;
|
|
181
|
-
ruleSuggestions?: RuleSuggestion[];
|
|
182
191
|
ruleOffers?: readonly WireRuleOffer[];
|
|
183
192
|
ruleOffersAbsence?: string;
|
|
184
193
|
denialLimitFallback?: DenialLimitFallback;
|
|
185
|
-
ruleStoreUnreadable?: string;
|
|
186
194
|
persistedRuleShadowed?: string;
|
|
187
195
|
allowRuleShadowed?: readonly AllowRuleShadowedWireMember[];
|
|
196
|
+
boundGrantDigest?: string;
|
|
197
|
+
boundGrants?: BoundSkillGrantsWire;
|
|
198
|
+
classifierNoRuling?: string;
|
|
188
199
|
probeCause?: unknown;
|
|
189
200
|
probeReason?: string;
|
|
190
201
|
rememberRefused?: true;
|
|
@@ -212,7 +223,7 @@ export interface ToolApprovalDelegation {
|
|
|
212
223
|
depth: number;
|
|
213
224
|
agentName?: string;
|
|
214
225
|
}
|
|
215
|
-
export declare const TOOL_APPROVAL_FRAME_KEYS_MIRROR: readonly ["type", "approvalId", "toolCallId", "toolName", "sourceTaskId", "fromSubagent", "sourceAgentName", "message", "args", "argsOmitted", "governanceForced", "
|
|
226
|
+
export declare const TOOL_APPROVAL_FRAME_KEYS_MIRROR: readonly ["type", "approvalId", "toolCallId", "toolName", "sourceTaskId", "fromSubagent", "sourceAgentName", "message", "args", "argsOmitted", "governanceForced", "ruleOffers", "ruleOffersAbsence", "denialLimitFallback", "readRootCandidate", "mandated", "mandate", "origin", "askClass", "classes", "inputHasBidi", "parked", "persistedRuleShadowed", "allowRuleShadowed", "probeCause", "probeReason", "rememberRefused", "boundGrantDigest", "boundGrants", "classifierNoRuling", "ruleEvidence", "requiresRealApproval", "expiresInMs", "expiresAtMs", "serverNowMs", "delegation", "outcome"];
|
|
216
227
|
export interface ApprovalMandatedFacts {
|
|
217
228
|
readonly mandated?: true;
|
|
218
229
|
readonly ruleOffersAbsence?: string;
|
|
@@ -233,11 +244,22 @@ export interface RespondToolApprovalOpts {
|
|
|
233
244
|
persistRuleBatchOfferIndex?: number;
|
|
234
245
|
note?: string;
|
|
235
246
|
settledBy?: 'policy';
|
|
247
|
+
decidedBy?: 'policy';
|
|
236
248
|
}
|
|
237
249
|
export type RespondToolApprovalFn = (approvalId: string, decision: ToolApprovalRespondDecision, opts?: RespondToolApprovalOpts) => Promise<ToolApprovalRespondAck | void>;
|
|
238
250
|
export type ToolApprovalRespondAckView = ToolApprovalRespondAck;
|
|
239
251
|
export type PersistedRuleAnchor = SdkPersistedRuleAnchor;
|
|
240
252
|
export declare function readToolApprovalRespondAck(v: unknown): ToolApprovalRespondAckView | undefined;
|
|
253
|
+
export interface ToolApprovalRespondParkingView {
|
|
254
|
+
readonly approvalId: string;
|
|
255
|
+
readonly retryAfterMs?: number;
|
|
256
|
+
readonly decidePath?: string;
|
|
257
|
+
}
|
|
258
|
+
export declare function decisionAttributionKeyOf(reading: ApprovalDecidedByReading | undefined, denySettledBy: ApprovalDenySettledBy | undefined): {
|
|
259
|
+
decidedBy: 'policy';
|
|
260
|
+
} | {
|
|
261
|
+
settledBy: 'policy';
|
|
262
|
+
} | Record<never, never>;
|
|
241
263
|
export interface ToolApprovalFrameOutcome {
|
|
242
264
|
decision: ToolApprovalRespondDecision | 'unresolved';
|
|
243
265
|
ack?: ToolApprovalRespondAckView;
|
|
@@ -248,6 +270,8 @@ export interface ToolApprovalFrameOutcome {
|
|
|
248
270
|
denyReason?: string;
|
|
249
271
|
denyAttributionRefusal?: DenyAttributionRefusalDetail;
|
|
250
272
|
denyAttributionDropped?: true;
|
|
273
|
+
denyAttributionRenamed?: true;
|
|
274
|
+
parking?: ToolApprovalRespondParkingView;
|
|
251
275
|
}
|
|
252
276
|
interface ToolApprovalRespondRefusalFields {
|
|
253
277
|
status?: number;
|
|
@@ -265,11 +289,12 @@ export declare function readToolApprovalRespondRefusal(err: unknown): ToolApprov
|
|
|
265
289
|
export declare function isToolApprovalFrame(ev: unknown): ev is ToolApprovalFrame;
|
|
266
290
|
export declare function readDenialLimitFallback(v: unknown): DenialLimitFallback | undefined;
|
|
267
291
|
export declare function readRuleOffers(v: unknown): RuleOffer[] | undefined;
|
|
268
|
-
export declare function readRuleOfferSupply(offers: unknown
|
|
292
|
+
export declare function readRuleOfferSupply(offers: unknown): RuleOffer[] | undefined;
|
|
269
293
|
export interface ToolApprovalFrameLaneOpts {
|
|
270
294
|
approvalDecisionNoteCapable?: boolean;
|
|
271
295
|
respondFreeFormRulesCapable?: boolean;
|
|
272
296
|
respondBatchRuleOffersCapable?: boolean;
|
|
297
|
+
approvalDecidedBy?: ApprovalDecidedByReading | undefined;
|
|
273
298
|
windowIsCurrent?: boolean;
|
|
274
299
|
argsUnavailable?: true;
|
|
275
300
|
}
|