@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
package/dist/wireRefusalCopy.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readErrorNumber, readErrorRecord, readErrorStrictStringList, readErrorString, readErrorStringList } from './wireFailureShape.js';
|
|
2
2
|
import { readOwnNonEmptyString } from './ownKey.js';
|
|
3
|
-
import { ACTIVE_RUN_BUSY_ERROR_CODE, FLEET_LEASE_UNAVAILABLE, REQUEST_FIELD_CONFLICT, RESUME_POLICY_FOLD_CODE, USAGE_WINDOW_EXHAUSTED } from './engineErrorCodes.js';
|
|
3
|
+
import { ACTIVE_RUN_BUSY_ERROR_CODE, FLEET_LEASE_UNAVAILABLE, REQUEST_FIELD_CONFLICT, RESUME_POLICY_FOLD_CODE, SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE, USAGE_WINDOW_EXHAUSTED } from './engineErrorCodes.js';
|
|
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';
|
|
@@ -145,7 +145,38 @@ export function fleetLeaseUnavailableContent(detail) {
|
|
|
145
145
|
: ' · The engine did not say how long to wait — send it again a little later';
|
|
146
146
|
return `${head}${cause}${wait}`;
|
|
147
147
|
}
|
|
148
|
+
export function scenarioAssignmentUnknownFromError(err) {
|
|
149
|
+
try {
|
|
150
|
+
if (err === null || typeof err !== 'object')
|
|
151
|
+
return null;
|
|
152
|
+
if (effectiveWireErrorCode(err) !== SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE)
|
|
153
|
+
return null;
|
|
154
|
+
const detail = readErrorRecord(err, 'detail');
|
|
155
|
+
const bit = (key) => {
|
|
156
|
+
if (detail === undefined)
|
|
157
|
+
return undefined;
|
|
158
|
+
try {
|
|
159
|
+
return Object.hasOwn(detail, key) ? detail[key] : undefined;
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
return undefined;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
const scenario = bit('scenario');
|
|
166
|
+
const source = bit('source');
|
|
167
|
+
return {
|
|
168
|
+
code: SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE,
|
|
169
|
+
...(typeof scenario === 'string' && scenario.length > 0 ? { scenario } : {}),
|
|
170
|
+
...(source === 'ruling' || source === 'deployment' ? { source } : {}),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
148
177
|
const SETTLED_BY_NOT_IN_PROOF = 'settled_by_not_in_proof';
|
|
178
|
+
const DECIDED_BY_NOT_IN_PROOF = 'decided_by_not_in_proof';
|
|
179
|
+
const RETIRED_DECISION_KEY = 'settledBy';
|
|
149
180
|
const RESUME_OUTCOME_INVALID = 'resume_outcome_invalid';
|
|
150
181
|
const APPROVAL_NON_BINDING_FIELDS = new Set(['hostDecision', 'approver']);
|
|
151
182
|
function readRefusalField(o) {
|
|
@@ -163,7 +194,7 @@ function readRefusalField(o) {
|
|
|
163
194
|
}
|
|
164
195
|
return readStringField(o, 'field');
|
|
165
196
|
}
|
|
166
|
-
export function denyAttributionRefusalFromError(err,
|
|
197
|
+
export function denyAttributionRefusalFromError(err, sentAttributionKey) {
|
|
167
198
|
try {
|
|
168
199
|
if (err === null || typeof err !== 'object')
|
|
169
200
|
return null;
|
|
@@ -175,9 +206,12 @@ export function denyAttributionRefusalFromError(err, sentSettledBy) {
|
|
|
175
206
|
const code = readStringField(o, 'errorCode');
|
|
176
207
|
if (code === undefined)
|
|
177
208
|
return null;
|
|
178
|
-
if (status === 400 && code === SETTLED_BY_NOT_IN_PROOF)
|
|
209
|
+
if (status === 400 && (code === SETTLED_BY_NOT_IN_PROOF || code === DECIDED_BY_NOT_IN_PROOF))
|
|
179
210
|
return { kind: 'not_in_proof', code, status };
|
|
180
|
-
if (status === 400 && code ===
|
|
211
|
+
if (status === 400 && code === BODY_SHAPE && readRefusalField(o) === RETIRED_DECISION_KEY) {
|
|
212
|
+
return { kind: 'retired_key', code, status, field: RETIRED_DECISION_KEY };
|
|
213
|
+
}
|
|
214
|
+
if (status === 400 && code === REQUEST_FIELD_CONFLICT && sentAttributionKey) {
|
|
181
215
|
return { kind: 'decision_conflict', code, status };
|
|
182
216
|
}
|
|
183
217
|
if (status === 409 && code === RESUME_OUTCOME_INVALID) {
|
|
@@ -202,6 +236,9 @@ export function denyAttributionRefusalContent(detail) {
|
|
|
202
236
|
return ('The engine refused this decision before judging it: the body says a policy settled it and also asks to allow the call, ' +
|
|
203
237
|
'and only a person can allow one · Nothing was decided and the approval is still waiting — ' +
|
|
204
238
|
'send it again with the decision and the note in agreement');
|
|
239
|
+
case 'retired_key':
|
|
240
|
+
return ('The engine refused this decision before judging it: the note saying who settled it was sent under a name this engine no longer accepts · ' +
|
|
241
|
+
'Nothing was decided and the approval is still waiting — send the decision again with who made it given under the name the engine now takes in its place');
|
|
205
242
|
case 'attribution_rejected': {
|
|
206
243
|
const named = typeof detail.field === 'string' && APPROVAL_NON_BINDING_FIELDS.has(detail.field)
|
|
207
244
|
? ` It named ${detail.field} as the part it would not take.`
|
|
@@ -33,7 +33,7 @@ export function workflowsJournalAvailable(reading) {
|
|
|
33
33
|
export function workflowsJournalDoctorDetail(reading) {
|
|
34
34
|
switch (reading.kind) {
|
|
35
35
|
case 'unobserved':
|
|
36
|
-
return 'workflow journal not observed — the engine reports it on /v1/capabilities (workflowsJournal); this process has no usable capabilities reading cached for it (none received, or the last one was
|
|
36
|
+
return 'workflow journal not observed — the engine reports it on /v1/capabilities (workflowsJournal); this process has no usable capabilities reading cached for it (none received, the last one was unreadable, or the last one was discarded when the engine connection was reset; this process cannot tell which)';
|
|
37
37
|
case 'not_reported':
|
|
38
38
|
return 'workflow journal not reported by this engine — the engine predates the separate flag, so the workflow listing flag still covers the journal';
|
|
39
39
|
case 'absent':
|
|
@@ -75,7 +75,7 @@ export function writeProtectionDoctorDetail(reading) {
|
|
|
75
75
|
switch (reading.kind) {
|
|
76
76
|
case 'unobserved':
|
|
77
77
|
return ('not observed — the engine reports it on /v1/capabilities; this process has no usable ' +
|
|
78
|
-
'capabilities reading cached for it (none received, or the last one was
|
|
78
|
+
'capabilities reading cached for it (none received, the last one was unreadable, or the last one was discarded when the engine connection was reset; this process cannot tell which)');
|
|
79
79
|
case 'not_reported':
|
|
80
80
|
return ('not reported by this engine — the capability position needs a newer engine; this says ' +
|
|
81
81
|
'nothing about whether a protected-name table is in effect (an absent seat is the engine ' +
|