@sema-agent/client-core 0.98.0 → 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 +199 -0
- package/README.md +35 -22
- package/dist/adapt/arms.js +61 -20
- package/dist/adapt/panelTasks.d.ts +1 -1
- package/dist/adapt/panelTasks.js +2 -2
- package/dist/adapter/activeRunSelfHeal.d.ts +4 -3
- package/dist/adapter/activeRunSelfHeal.js +162 -293
- package/dist/adapter/downstream/eventToSdkMessage.js +52 -4
- package/dist/adapter/runStream.js +52 -37
- package/dist/adapter/types.js +2 -1
- package/dist/agentSession/engineSessionBackgroundStop.js +16 -8
- package/dist/agentsWireCaps.d.ts +0 -3
- package/dist/agentsWireCaps.js +33 -24
- package/dist/cloudConfigWireCaps.d.ts +1 -1
- package/dist/cloudConfigWireCaps.js +26 -4
- package/dist/controlRouter.d.ts +4 -2
- package/dist/controlRouter.js +39 -51
- package/dist/coreValuePorts.d.ts +26 -1
- package/dist/coreValuePorts.js +10 -0
- package/dist/corruptSessionCopy.d.ts +2 -1
- package/dist/corruptSessionCopy.js +3 -3
- package/dist/declared/supportFloorDeclared.js +1 -1
- package/dist/detachWire.js +3 -2
- package/dist/devicesFace.d.ts +34 -0
- package/dist/devicesFace.js +90 -0
- package/dist/displayUntrusted.d.ts +1 -0
- package/dist/displayUntrusted.js +3 -0
- package/dist/engineAgentPanelStore.d.ts +7 -0
- package/dist/engineAgentPanelStore.js +14 -0
- package/dist/engineCapReader.d.ts +2 -1
- package/dist/engineCapReader.js +7 -5
- package/dist/engineCapsCache.d.ts +8 -0
- package/dist/engineCapsCache.js +59 -6
- package/dist/engineCapsChange.d.ts +2 -0
- package/dist/engineCapsChange.js +9 -0
- package/dist/engineErrorCodes.d.ts +2 -1
- package/dist/engineErrorCodes.js +2 -7
- package/dist/engineRowRef.js +3 -0
- package/dist/engineSessionMessages.d.ts +1 -0
- package/dist/engineSessionMessages.js +7 -1
- package/dist/engineTargetSeat.d.ts +27 -0
- package/dist/engineTargetSeat.js +199 -0
- package/dist/engineWireFor.js +3 -8
- package/dist/env/uiLanguage.d.ts +2 -1
- package/dist/env/uiLanguage.js +3 -2
- package/dist/eventLeg.d.ts +8 -0
- package/dist/eventLeg.js +61 -41
- package/dist/fileHistoryCaptureCapability.d.ts +2 -1
- package/dist/fileHistoryCaptureCapability.js +12 -18
- package/dist/fileHistoryLegNotice.d.ts +2 -1
- package/dist/fileHistoryLegNotice.js +3 -3
- package/dist/frameBinding.d.ts +3 -0
- package/dist/frameBinding.js +12 -0
- package/dist/gateOutcome.js +16 -2
- package/dist/gateVocabulary.d.ts +8 -7
- package/dist/gateVocabulary.js +71 -73
- package/dist/generated/engineFactTables.d.ts +17 -1
- package/dist/generated/engineFactTables.js +29 -0
- package/dist/generated/engineNoticeTables.js +9 -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/hitl/allowRuleShadow.d.ts +2 -1
- package/dist/hitl/allowRuleShadow.js +17 -14
- package/dist/hitl/approvalCardReasons.d.ts +3 -2
- package/dist/hitl/approvalCardReasons.js +27 -28
- package/dist/hitl/approvalHolds.d.ts +3 -0
- package/dist/hitl/approvalHolds.js +73 -29
- package/dist/hitl/askClassPair.d.ts +1 -1
- package/dist/hitl/askClassPair.js +16 -0
- package/dist/hitl/askGateWire.js +2 -1
- package/dist/hitl/askSettlementLine.d.ts +14 -4
- package/dist/hitl/askSettlementLine.js +67 -47
- package/dist/hitl/automaticAnswerVerdict.d.ts +2 -1
- package/dist/hitl/automaticAnswerVerdict.js +8 -8
- package/dist/hitl/crashConvergedNotice.d.ts +5 -4
- package/dist/hitl/crashConvergedNotice.js +28 -41
- package/dist/hitl/frameRouter.js +7 -8
- package/dist/hitl/hitlBridge.d.ts +1 -0
- package/dist/hitl/hitlBridge.js +3 -3
- package/dist/hitl/persistedRulesWire.d.ts +6 -5
- package/dist/hitl/persistedRulesWire.js +55 -73
- package/dist/hitl/planReviewWire.d.ts +5 -0
- package/dist/hitl/planReviewWire.js +8 -0
- package/dist/hitl/sessionPolicyDeliverable.d.ts +2 -0
- package/dist/hitl/sessionPolicyDeliverable.js +46 -3
- package/dist/hitl/sessionPolicyWire.d.ts +2 -1
- package/dist/hitl/sessionPolicyWire.js +23 -24
- package/dist/hitl/suspendedReopen.d.ts +2 -1
- package/dist/hitl/suspendedReopen.js +7 -10
- package/dist/hitl/toolApprovalWire.d.ts +17 -5
- package/dist/hitl/toolApprovalWire.js +79 -40
- package/dist/hooksWireCaps.js +145 -56
- 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 +582 -0
- package/dist/i18n/messages.en.js +582 -0
- package/dist/i18n/messages.zh.js +718 -1
- package/dist/index.d.ts +29 -13
- package/dist/index.js +18 -9
- package/dist/inheritEnvCapability.d.ts +3 -2
- package/dist/inheritEnvCapability.js +3 -3
- package/dist/inheritEnvWire.d.ts +3 -2
- package/dist/inheritEnvWire.js +12 -14
- package/dist/interactiveHalt.js +17 -6
- package/dist/liveModelCatalog.d.ts +2 -1
- package/dist/liveModelCatalog.js +14 -8
- 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 +3 -1
- package/dist/mcpProbeWire.js +5 -0
- package/dist/mcpWireCaps.d.ts +34 -0
- package/dist/mcpWireCaps.js +117 -17
- package/dist/memoryEntriesWire.js +5 -10
- package/dist/model/onboardJudgement.d.ts +93 -0
- package/dist/model/onboardJudgement.js +415 -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/ownKey.d.ts +7 -0
- package/dist/ownKey.js +34 -0
- package/dist/panelReduce.d.ts +6 -1
- package/dist/panelReduce.js +50 -3
- package/dist/permissionRuleIssue.js +2 -0
- package/dist/permissionRulesWriteCapability.d.ts +2 -1
- package/dist/permissionRulesWriteCapability.js +8 -6
- package/dist/pluginHooksWire.d.ts +46 -3
- package/dist/pluginHooksWire.js +217 -11
- package/dist/printModelStatus.d.ts +63 -0
- package/dist/printModelStatus.js +155 -0
- package/dist/request/taskRequest.d.ts +11 -5
- package/dist/request/taskRequest.js +112 -16
- package/dist/resumeRefusalCopy.d.ts +12 -9
- package/dist/resumeRefusalCopy.js +70 -143
- package/dist/retryStatus.d.ts +37 -0
- package/dist/retryStatus.js +79 -0
- package/dist/scenarioRefusal.d.ts +9 -0
- package/dist/scenarioRefusal.js +111 -0
- package/dist/seam.d.ts +25 -1
- package/dist/seam.js +10 -1
- package/dist/seatContract.d.ts +260 -10
- package/dist/seatContract.js +692 -19
- 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 -1
- package/dist/sessionPolicyCapability.js +8 -6
- package/dist/settingsHooksSalvage.d.ts +44 -0
- package/dist/settingsHooksSalvage.js +211 -0
- package/dist/skillToolListsCapability.d.ts +2 -1
- package/dist/skillToolListsCapability.js +8 -6
- package/dist/sseIdleTriage.js +3 -2
- package/dist/subagent/engineSubagentResume.js +15 -9
- package/dist/subagentContentStore.d.ts +3 -0
- package/dist/subagentContentStore.js +22 -0
- package/dist/toolHistoryMismatch.js +3 -2
- package/dist/toolRoster.d.ts +3 -2
- package/dist/toolRoster.js +21 -20
- package/dist/turnFailurePresentation.d.ts +12 -1
- package/dist/turnFailurePresentation.js +212 -15
- 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 -1
- package/dist/userInvokedSkillsCapability.js +31 -7
- package/dist/wireErrorTriage.d.ts +7 -0
- package/dist/wireErrorTriage.js +23 -1
- package/dist/wireFailureShape.js +2 -1
- package/dist/wireRefusalCopy.d.ts +13 -1
- package/dist/wireRefusalCopy.js +24 -28
- package/dist/workflowsJournalCapability.d.ts +2 -1
- package/dist/workflowsJournalCapability.js +8 -6
- package/docs/INTEGRATION-CLIENTS.md +542 -30
- package/package.json +5 -5
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { engineWireTarget } from './engineWireTarget.js';
|
|
2
2
|
import { createEngineCapReader, unreadableReadingDetail } from './engineCapReader.js';
|
|
3
|
-
import {
|
|
3
|
+
import { msg, renderMessage } from './i18n/translate.js';
|
|
4
|
+
import { ownDataField, readOwnDataValue } from './ownKey.js';
|
|
4
5
|
export function projectUserInvokedSkillsCapability(caps) {
|
|
5
6
|
try {
|
|
6
7
|
if (caps === null || typeof caps !== 'object' || Array.isArray(caps))
|
|
@@ -30,17 +31,40 @@ export function userInvokedSkillsAvailable(reading) {
|
|
|
30
31
|
return 'no';
|
|
31
32
|
return 'unknown';
|
|
32
33
|
}
|
|
33
|
-
export function userInvokedSkillsDoctorDetail(reading) {
|
|
34
|
+
export function userInvokedSkillsDoctorDetail(reading, lang) {
|
|
35
|
+
const subject = msg('notice.capability.subject.userInvokedSkills');
|
|
34
36
|
switch (reading.kind) {
|
|
35
37
|
case 'unreadable':
|
|
36
|
-
return unreadableReadingDetail(
|
|
38
|
+
return unreadableReadingDetail(renderMessage(subject, lang), lang);
|
|
37
39
|
case 'unobserved':
|
|
38
|
-
return
|
|
40
|
+
return renderMessage(msg('notice.capability.unobserved', { subject, key: 'userInvokedSkills' }), lang);
|
|
39
41
|
case 'not_reported':
|
|
40
|
-
return '
|
|
42
|
+
return renderMessage(msg('notice.capability.userInvokedSkills.notReported'), lang);
|
|
41
43
|
case 'absent':
|
|
42
|
-
return '
|
|
44
|
+
return renderMessage(msg('notice.capability.userInvokedSkills.absent'), lang);
|
|
43
45
|
case 'present':
|
|
44
|
-
return '
|
|
46
|
+
return renderMessage(msg('notice.capability.userInvokedSkills.present'), lang);
|
|
45
47
|
}
|
|
46
48
|
}
|
|
49
|
+
export function userInvokedSkillsDeclaration(names, reading) {
|
|
50
|
+
let named = false;
|
|
51
|
+
try {
|
|
52
|
+
named = Array.isArray(names) && names.length > 0;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
named = false;
|
|
56
|
+
}
|
|
57
|
+
if (!named)
|
|
58
|
+
return { field: {} };
|
|
59
|
+
let kind;
|
|
60
|
+
try {
|
|
61
|
+
kind = reading !== null && typeof reading === 'object' ? readOwnDataValue(reading, 'kind') : undefined;
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
kind = undefined;
|
|
65
|
+
}
|
|
66
|
+
if (kind === 'present')
|
|
67
|
+
return { field: { userInvokedSkills: names } };
|
|
68
|
+
const cause = kind === 'absent' || kind === 'not_reported' || kind === 'unobserved' ? kind : 'unreadable';
|
|
69
|
+
return { field: {}, withheld: { cause } };
|
|
70
|
+
}
|
|
@@ -21,6 +21,13 @@ export declare function classifyTurnWireError(err: unknown): TurnWireErrorVerdic
|
|
|
21
21
|
export declare function isWireTransportError(err: unknown): boolean;
|
|
22
22
|
export declare function isPreStreamDrainingReject(err: unknown): boolean;
|
|
23
23
|
export declare function effectiveWireErrorCode(err: unknown): string | undefined;
|
|
24
|
+
export type NotFoundFailure = {
|
|
25
|
+
readonly kind: 'not_found';
|
|
26
|
+
readonly code: string;
|
|
27
|
+
} | {
|
|
28
|
+
readonly kind: 'unknown_404';
|
|
29
|
+
};
|
|
30
|
+
export declare function isNotFoundFailure(e: {} | null | undefined): NotFoundFailure | false;
|
|
24
31
|
export declare function corruptStoredRowWhere(err: unknown): string | undefined;
|
|
25
32
|
export declare function corruptStoredRowContent(where: string): string;
|
|
26
33
|
export declare function isResumeAtRejection(err: unknown): boolean;
|
package/dist/wireErrorTriage.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readBlockedBy, readErrorNumber, readErrorString, readErrorStringList, readThrownSlot, thrownIsInstanceOf, THROWN_SLOT_UNREADABLE, WIRE_FAILURE_UNRENDERABLE_TEXT, } from './wireFailureShape.js';
|
|
1
|
+
import { PROTOCOL_ERROR_NAME, protocolErrorNameOf, readBlockedBy, readErrorNumber, readErrorString, readErrorStringList, readThrownSlot, readThrownStatusSlot, thrownIsInstanceOf, THROWN_SLOT_UNREADABLE, WIRE_FAILURE_UNRENDERABLE_TEXT, } from './wireFailureShape.js';
|
|
2
2
|
import { capForDisplay, escapeDisplayControlChars } from './fleetTaskDesc.js';
|
|
3
3
|
import { readOwnDataValue } from './ownKey.js';
|
|
4
4
|
import { fleetLeaseUnavailableFromError } from './wireRefusalCopy.js';
|
|
@@ -76,6 +76,28 @@ export function effectiveWireErrorCode(err) {
|
|
|
76
76
|
const outer = typeof outerRaw === 'string' && outerRaw.length > 0 ? outerRaw : undefined;
|
|
77
77
|
return foldedWireErrorCode(err, outer);
|
|
78
78
|
}
|
|
79
|
+
export function isNotFoundFailure(e) {
|
|
80
|
+
try {
|
|
81
|
+
if (e === null || e === undefined || (typeof e !== 'object' && typeof e !== 'function'))
|
|
82
|
+
return false;
|
|
83
|
+
const code = readThrownSlot(e, 'errorCode', 'data');
|
|
84
|
+
if (code === THROWN_SLOT_UNREADABLE)
|
|
85
|
+
return false;
|
|
86
|
+
if (typeof code === 'string') {
|
|
87
|
+
return code.startsWith(NOT_FOUND_CODE_PREFIX) ? Object.freeze({ kind: 'not_found', code }) : false;
|
|
88
|
+
}
|
|
89
|
+
const status = readThrownStatusSlot(e);
|
|
90
|
+
if (status === 404)
|
|
91
|
+
return Object.freeze({ kind: 'unknown_404' });
|
|
92
|
+
if (status === undefined && typeof e === 'object' && protocolErrorNameOf(e) === PROTOCOL_ERROR_NAME.NotFoundError)
|
|
93
|
+
return Object.freeze({ kind: 'unknown_404' });
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const NOT_FOUND_CODE_PREFIX = 'not_found.';
|
|
79
101
|
function foldedWireErrorCode(err, outer) {
|
|
80
102
|
if (outer !== RESUME_POLICY_FOLD_CODE)
|
|
81
103
|
return outer;
|
package/dist/wireFailureShape.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { msg, renderMessage } from './i18n/translate.js';
|
|
1
2
|
import { guardedRead, ownDataField, readOwnDataValue } from './ownKey.js';
|
|
2
3
|
export const THROWN_SLOT_UNREADABLE = Symbol('thrown-slot-unreadable');
|
|
3
4
|
export function readThrownSlot(o, key, own = false) {
|
|
@@ -373,7 +374,7 @@ export function withAssemblyRefusal(err, cause) {
|
|
|
373
374
|
export function asAssemblyRefusal(thrown, cause, who) {
|
|
374
375
|
if (assemblyRefusalOf(thrown) !== undefined)
|
|
375
376
|
return thrown;
|
|
376
|
-
return withAssemblyRefusal(new Error(
|
|
377
|
+
return withAssemblyRefusal(new Error(renderMessage(msg('config.assembly.thrownDuringAssembly', { who })), { cause: thrown }), cause);
|
|
377
378
|
}
|
|
378
379
|
export function assemblyRefusalOf(x) {
|
|
379
380
|
if (x === null || x === undefined)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FLEET_LEASE_UNAVAILABLE, REQUEST_AUTONOMY_LANE_REFUSED, SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE, USAGE_WINDOW_EXHAUSTED } from './engineErrorCodes.js';
|
|
1
|
+
import { FLEET_LEASE_UNAVAILABLE, REQUEST_AUTONOMY_LANE_REFUSED, SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE, USAGE_WINDOW_EXHAUSTED, USER_ATTACHMENT_INVALID_ERROR_CODE, USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE } from './engineErrorCodes.js';
|
|
2
2
|
import type { TaskRequestLike } from './request/taskRequest.js';
|
|
3
3
|
export declare const CONFLICT_APPROVAL_SETTLED = "conflict.approval_settled";
|
|
4
4
|
export declare const CONFLICT_RUN_NOT_RUNNING = "conflict.run_not_running";
|
|
@@ -98,3 +98,15 @@ export interface AutonomyLaneRefusalDetail {
|
|
|
98
98
|
}
|
|
99
99
|
export declare function autonomyLaneRefusalFromError(err: unknown): AutonomyLaneRefusalDetail | null;
|
|
100
100
|
export declare function autonomyLaneRefusalContent(): string;
|
|
101
|
+
export interface UserAttachmentRefusalDetail {
|
|
102
|
+
readonly code: typeof USER_ATTACHMENT_INVALID_ERROR_CODE;
|
|
103
|
+
readonly retryable: false;
|
|
104
|
+
}
|
|
105
|
+
export declare function userAttachmentRefusalFromError(err: {} | null | undefined): UserAttachmentRefusalDetail | null;
|
|
106
|
+
export declare function userAttachmentRefusalContent(): string;
|
|
107
|
+
export interface UserInvokedSkillRefusalDetail {
|
|
108
|
+
readonly code: typeof USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE;
|
|
109
|
+
readonly retryable: false;
|
|
110
|
+
}
|
|
111
|
+
export declare function userInvokedSkillRefusalFromError(err: {} | null | undefined): UserInvokedSkillRefusalDetail | null;
|
|
112
|
+
export declare function userInvokedSkillRefusalContent(): string;
|
package/dist/wireRefusalCopy.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { PROTOCOL_ERROR_NAME, THROWN_SLOT_UNREADABLE, protocolErrorNameOf, readErrorNumber, readErrorRecord, readErrorStrictStringList, readErrorString, readErrorStringList, readRefusalField, readThrownSlot, readThrownStatusSlot } from './wireFailureShape.js';
|
|
2
2
|
import { readOwnDataValue, readOwnNonEmptyString } from './ownKey.js';
|
|
3
|
-
import { ACTIVE_RUN_BUSY_ERROR_CODE, FLEET_LEASE_UNAVAILABLE, REQUEST_AUTONOMY_LANE_REFUSED, REQUEST_FIELD_CONFLICT, RESUME_OUTCOME_INVALID, RESUME_POLICY_FOLD_CODE, SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE, USAGE_WINDOW_EXHAUSTED } from './engineErrorCodes.js';
|
|
3
|
+
import { ACTIVE_RUN_BUSY_ERROR_CODE, FLEET_LEASE_UNAVAILABLE, REQUEST_AUTONOMY_LANE_REFUSED, REQUEST_FIELD_CONFLICT, RESUME_OUTCOME_INVALID, RESUME_POLICY_FOLD_CODE, SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE, USAGE_WINDOW_EXHAUSTED, USER_ATTACHMENT_INVALID_ERROR_CODE, USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE } 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';
|
|
7
|
+
import { scenarioRefusalFromError } from './scenarioRefusal.js';
|
|
7
8
|
export const CONFLICT_APPROVAL_SETTLED = 'conflict.approval_settled';
|
|
8
9
|
export const CONFLICT_RUN_NOT_RUNNING = 'conflict.run_not_running';
|
|
9
10
|
function ownNonEmptyStringSlot(o, key) {
|
|
@@ -138,33 +139,14 @@ export function fleetLeaseUnavailableContent(detail) {
|
|
|
138
139
|
return `${head}${cause}${wait}`;
|
|
139
140
|
}
|
|
140
141
|
export function scenarioAssignmentUnknownFromError(err) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return null;
|
|
144
|
-
if (effectiveWireErrorCode(err) !== SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE)
|
|
145
|
-
return null;
|
|
146
|
-
const detail = readErrorRecord(err, 'detail');
|
|
147
|
-
const bit = (key) => {
|
|
148
|
-
if (detail === undefined)
|
|
149
|
-
return undefined;
|
|
150
|
-
try {
|
|
151
|
-
return Object.hasOwn(detail, key) ? detail[key] : undefined;
|
|
152
|
-
}
|
|
153
|
-
catch {
|
|
154
|
-
return undefined;
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
const scenario = bit('scenario');
|
|
158
|
-
const source = bit('source');
|
|
159
|
-
return {
|
|
160
|
-
code: SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE,
|
|
161
|
-
...(typeof scenario === 'string' && scenario.length > 0 ? { scenario } : {}),
|
|
162
|
-
...(source === 'ruling' || source === 'deployment' ? { source } : {}),
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
catch {
|
|
142
|
+
const r = scenarioRefusalFromError(err);
|
|
143
|
+
if (r === null)
|
|
166
144
|
return null;
|
|
167
|
-
|
|
145
|
+
return {
|
|
146
|
+
code: SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE,
|
|
147
|
+
...(r.scenario !== undefined ? { scenario: r.scenario } : {}),
|
|
148
|
+
...(r.source !== undefined ? { source: r.source } : {}),
|
|
149
|
+
};
|
|
168
150
|
}
|
|
169
151
|
const SETTLED_BY_NOT_IN_PROOF = 'settled_by_not_in_proof';
|
|
170
152
|
const DECIDED_BY_NOT_IN_PROOF = 'decided_by_not_in_proof';
|
|
@@ -526,7 +508,7 @@ function readProp(o, key) {
|
|
|
526
508
|
}
|
|
527
509
|
export function hostPostureRefusalFromError(err, sentRequest) {
|
|
528
510
|
try {
|
|
529
|
-
if (
|
|
511
|
+
if (readThrownSlot(err, 'errorCode', 'data') !== HOST_POSTURE_REFUSED)
|
|
530
512
|
return null;
|
|
531
513
|
const askedWholeEnvironment = readProp(sentRequest, 'inheritEnv') === 'all';
|
|
532
514
|
const askedOpenWriteFace = readProp(sentRequest, 'permissionMode') === BYPASS_PERMISSIONS ||
|
|
@@ -615,3 +597,17 @@ export function autonomyLaneRefusalContent() {
|
|
|
615
597
|
return ('The engine did not start this leader run: this deployment runs in plan-only autonomy, and a leader run has no way to have its plan reviewed, ' +
|
|
616
598
|
'so nothing was started · Submit the work as a regular run instead, or ask whoever operates the engine to change its autonomy setting');
|
|
617
599
|
}
|
|
600
|
+
export function userAttachmentRefusalFromError(err) {
|
|
601
|
+
return effectiveWireErrorCode(err) === USER_ATTACHMENT_INVALID_ERROR_CODE ? { code: USER_ATTACHMENT_INVALID_ERROR_CODE, retryable: false } : null;
|
|
602
|
+
}
|
|
603
|
+
export function userAttachmentRefusalContent() {
|
|
604
|
+
return ('This message was not sent: the engine refused the files attached to it — together with the message they are more than it can take in one request on this model, ' +
|
|
605
|
+
'or one of them is in a form it does not accept · Nothing was started and your draft is kept · Remove some attachments or attach smaller parts, then send it again');
|
|
606
|
+
}
|
|
607
|
+
export function userInvokedSkillRefusalFromError(err) {
|
|
608
|
+
return effectiveWireErrorCode(err) === USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE ? { code: USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE, retryable: false } : null;
|
|
609
|
+
}
|
|
610
|
+
export function userInvokedSkillRefusalContent() {
|
|
611
|
+
return ('The engine did not start this run: a skill named for it is not one this run has loaded, or skills are turned off for this run · ' +
|
|
612
|
+
'Nothing was started and your draft is kept · Check the skill name, or load that skill, then send it again');
|
|
613
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { UiLanguage } from './env/uiLanguage.js';
|
|
1
2
|
export type WorkflowsJournalReading = {
|
|
2
3
|
kind: 'unobserved';
|
|
3
4
|
} | {
|
|
@@ -12,4 +13,4 @@ export type WorkflowsJournalReading = {
|
|
|
12
13
|
export declare function projectWorkflowsJournalCapability(caps: unknown): WorkflowsJournalReading | undefined;
|
|
13
14
|
export declare function observedWorkflowsJournal(baseUrl?: string | undefined): WorkflowsJournalReading;
|
|
14
15
|
export declare function workflowsJournalAvailable(reading: WorkflowsJournalReading): 'yes' | 'no' | 'unknown';
|
|
15
|
-
export declare function workflowsJournalDoctorDetail(reading: WorkflowsJournalReading): string;
|
|
16
|
+
export declare function workflowsJournalDoctorDetail(reading: WorkflowsJournalReading, lang?: UiLanguage): string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { engineWireTarget } from './engineWireTarget.js';
|
|
2
2
|
import { createEngineCapReader, unreadableReadingDetail } from './engineCapReader.js';
|
|
3
|
+
import { msg, renderMessage } from './i18n/translate.js';
|
|
3
4
|
import { ownDataField } from './ownKey.js';
|
|
4
5
|
export function projectWorkflowsJournalCapability(caps) {
|
|
5
6
|
try {
|
|
@@ -30,17 +31,18 @@ export function workflowsJournalAvailable(reading) {
|
|
|
30
31
|
return 'no';
|
|
31
32
|
return 'unknown';
|
|
32
33
|
}
|
|
33
|
-
export function workflowsJournalDoctorDetail(reading) {
|
|
34
|
+
export function workflowsJournalDoctorDetail(reading, lang) {
|
|
35
|
+
const subject = msg('notice.capability.subject.workflowsJournal');
|
|
34
36
|
switch (reading.kind) {
|
|
35
37
|
case 'unreadable':
|
|
36
|
-
return unreadableReadingDetail(
|
|
38
|
+
return unreadableReadingDetail(renderMessage(subject, lang), lang);
|
|
37
39
|
case 'unobserved':
|
|
38
|
-
return
|
|
40
|
+
return renderMessage(msg('notice.capability.unobserved', { subject, key: 'workflowsJournal' }), lang);
|
|
39
41
|
case 'not_reported':
|
|
40
|
-
return '
|
|
42
|
+
return renderMessage(msg('notice.capability.workflowsJournal.notReported'), lang);
|
|
41
43
|
case 'absent':
|
|
42
|
-
return '
|
|
44
|
+
return renderMessage(msg('notice.capability.workflowsJournal.absent'), lang);
|
|
43
45
|
case 'present':
|
|
44
|
-
return '
|
|
46
|
+
return renderMessage(msg('notice.capability.workflowsJournal.present'), lang);
|
|
45
47
|
}
|
|
46
48
|
}
|