@sema-agent/client-core 0.95.0 → 0.97.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 +269 -0
- package/README.md +61 -31
- package/dist/adapt/arms.js +7 -1
- package/dist/adapt/toolCards.d.ts +1 -0
- package/dist/adapt/toolCards.js +16 -3
- package/dist/adapt/wireShapes.js +2 -16
- package/dist/adapter/activeRunSelfHeal.d.ts +4 -2
- package/dist/adapter/activeRunSelfHeal.js +32 -6
- package/dist/adapter/downstream/eventToSdkMessage.js +11 -3
- package/dist/adapter/downstream/terminalToSdkResult.js +14 -11
- package/dist/adapter/runStream.js +30 -47
- package/dist/agentSession/backgroundView.js +2 -15
- package/dist/agentSession/engineAgentRegistryRead.js +5 -4
- package/dist/agentSession/engineSessionBackgroundStop.js +22 -15
- package/dist/agentsWireCaps.d.ts +1 -1
- package/dist/agentsWireCaps.js +29 -12
- package/dist/approvalDecidedByCapability.d.ts +2 -0
- package/dist/approvalDecidedByCapability.js +0 -1
- package/dist/approvalsStreamLiveCapability.d.ts +2 -0
- package/dist/approvalsStreamLiveCapability.js +3 -2
- package/dist/attachmentSeatCapability.d.ts +2 -0
- package/dist/attachmentSeatCapability.js +0 -1
- package/dist/callerCwdCapability.d.ts +2 -4
- package/dist/callerCwdCapability.js +0 -7
- package/dist/centerWiringCapability.d.ts +2 -4
- package/dist/centerWiringCapability.js +4 -9
- package/dist/classifierVerdictWire.js +4 -16
- package/dist/clientSlice.js +1 -1
- package/dist/cloudConfigWireCaps.d.ts +4 -4
- package/dist/cloudConfigWireCaps.js +241 -85
- package/dist/coreValuePorts.d.ts +11 -7
- package/dist/coreValuePorts.js +5 -8
- package/dist/credentialProvenance.d.ts +28 -0
- package/dist/credentialProvenance.js +76 -0
- package/dist/decideFailureNote.js +3 -1
- package/dist/decideReceipt.js +7 -10
- package/dist/declared/supportFloorDeclared.js +3 -3
- package/dist/deviceExecutorManagementCapability.d.ts +2 -0
- package/dist/deviceExecutorManagementCapability.js +3 -2
- package/dist/displayUntrusted.d.ts +10 -3
- package/dist/displayUntrusted.js +371 -60
- package/dist/engineCapReader.d.ts +8 -2
- package/dist/engineCapReader.js +15 -7
- package/dist/engineCapsCache.d.ts +17 -3
- package/dist/engineCapsCache.js +268 -43
- package/dist/engineDirectory.d.ts +79 -0
- package/dist/engineDirectory.js +186 -0
- package/dist/engineErrorCodes.d.ts +17 -1
- package/dist/engineErrorCodes.js +46 -16
- package/dist/engineNoticeCodes.d.ts +17 -0
- package/dist/engineNoticeCodes.js +54 -1
- package/dist/executionLaneCapability.d.ts +2 -0
- package/dist/executionLaneCapability.js +3 -2
- package/dist/fileHistoryCaptureCapability.d.ts +16 -0
- package/dist/fileHistoryCaptureCapability.js +98 -2
- package/dist/fileHistoryLegNotice.js +4 -0
- package/dist/fleet/bgSubagentRow.d.ts +15 -0
- package/dist/fleet/bgSubagentRow.js +67 -0
- package/dist/fleet/fleetLedger.d.ts +1 -0
- package/dist/fleet/fleetLedger.js +164 -126
- package/dist/fleet/fleetProjection.d.ts +1 -0
- package/dist/fleet/fleetProjection.js +10 -3
- package/dist/fleetTaskDesc.js +4 -17
- package/dist/gateOutcome.d.ts +12 -1
- package/dist/gateOutcome.js +56 -1
- package/dist/gateVocabulary.d.ts +2 -2
- package/dist/gateVocabulary.js +4 -3
- package/dist/generated/engineAskFaceTables.js +1 -1
- package/dist/generated/engineFactTables.d.ts +5 -3
- package/dist/generated/engineFactTables.js +17 -4
- package/dist/generated/engineNoticeTables.js +12 -3
- package/dist/generated/sdkFactTables.d.ts +2 -0
- package/dist/generated/sdkFactTables.js +7 -0
- package/dist/generated/settingsSchemaFns.d.ts +3 -0
- package/dist/generated/settingsSchemaFns.js +53 -0
- package/dist/generated/toolNameTables.d.ts +1 -1
- package/dist/generated/toolNameTables.js +1 -42
- package/dist/hitl/approvalDecisionNoteAudit.js +2 -2
- package/dist/hitl/approvalEndingCause.d.ts +2 -0
- package/dist/hitl/approvalEndingCause.js +26 -21
- package/dist/hitl/approvalHolds.d.ts +16 -1
- package/dist/hitl/approvalHolds.js +52 -12
- package/dist/hitl/askGateWire.js +1 -0
- package/dist/hitl/askParkRowRouting.js +1 -1
- package/dist/hitl/automaticAnswerVerdict.d.ts +1 -1
- package/dist/hitl/automaticAnswerVerdict.js +13 -10
- package/dist/hitl/decisionConflict.js +4 -5
- package/dist/hitl/decisionRefusal.d.ts +8 -0
- package/dist/hitl/decisionRefusal.js +55 -14
- package/dist/hitl/frameRouter.d.ts +3 -1
- package/dist/hitl/frameRouter.js +58 -39
- package/dist/hitl/gateLedger.d.ts +0 -5
- package/dist/hitl/gateLedger.js +0 -21
- package/dist/hitl/hitlBridge.d.ts +6 -2
- package/dist/hitl/hitlBridge.js +46 -11
- package/dist/hitl/localAllowRule.d.ts +1 -0
- package/dist/hitl/localAllowRule.js +2 -2
- package/dist/hitl/noAllowCause.d.ts +2 -1
- package/dist/hitl/noAllowCause.js +3 -2
- package/dist/hitl/parkResolver.d.ts +1 -0
- package/dist/hitl/parkResolver.js +14 -56
- package/dist/hitl/parkRowBirthWait.d.ts +1 -0
- package/dist/hitl/parkRowBirthWait.js +2 -2
- package/dist/hitl/planReviewWire.d.ts +1 -0
- package/dist/hitl/planReviewWire.js +98 -20
- package/dist/hitl/replayedApproval.d.ts +3 -3
- package/dist/hitl/replayedApproval.js +21 -16
- package/dist/hitl/sessionPolicyDeliverable.d.ts +0 -1
- package/dist/hitl/sessionPolicyDeliverable.js +17 -17
- package/dist/hitl/sessionPolicyWire.d.ts +2 -0
- package/dist/hitl/sessionPolicyWire.js +15 -3
- package/dist/hitl/standingRows.d.ts +19 -0
- package/dist/hitl/standingRows.js +148 -0
- package/dist/hitl/suspendedReopen.js +2 -1
- package/dist/hitl/toolApprovalWire.d.ts +22 -10
- package/dist/hitl/toolApprovalWire.js +286 -47
- package/dist/hookMatcherVerdict.d.ts +1 -9
- package/dist/hookMatcherVerdict.js +21 -61
- package/dist/hooksWireCaps.js +2 -2
- package/dist/hostCallbackGuard.d.ts +1 -0
- package/dist/hostCallbackGuard.js +6 -0
- package/dist/index.d.ts +26 -12
- package/dist/index.js +20 -10
- package/dist/liveModelCatalog.d.ts +13 -0
- package/dist/liveModelCatalog.js +56 -0
- package/dist/mcpProbeCapability.d.ts +2 -4
- package/dist/mcpProbeCapability.js +3 -8
- package/dist/mcpWireCaps.d.ts +1 -0
- package/dist/mcpWireCaps.js +4 -1
- package/dist/memoryComplianceCapability.d.ts +2 -4
- package/dist/memoryComplianceCapability.js +3 -8
- package/dist/memoryOriginCapability.d.ts +2 -4
- package/dist/memoryOriginCapability.js +3 -8
- package/dist/memorySpecWire.js +2 -2
- package/dist/modelIdentityResolvability.d.ts +2 -2
- package/dist/modelIdentityResolvability.js +14 -5
- package/dist/noticePresentation.d.ts +68 -0
- package/dist/noticePresentation.js +247 -0
- package/dist/outputStyleSeatCapability.d.ts +2 -1
- package/dist/outputStyleSeatCapability.js +0 -4
- package/dist/ownKey.d.ts +2 -0
- package/dist/ownKey.js +18 -0
- package/dist/peerFrames.js +13 -9
- package/dist/peerLaneCapability.d.ts +2 -0
- package/dist/peerLaneCapability.js +3 -2
- package/dist/permissionModesCapability.d.ts +2 -4
- package/dist/permissionModesCapability.js +0 -7
- package/dist/permissionRuleIssue.js +0 -3
- package/dist/permissionRulesWriteCapability.d.ts +2 -0
- package/dist/permissionRulesWriteCapability.js +3 -2
- package/dist/permissionsAllowGrantCapability.d.ts +2 -0
- package/dist/permissionsAllowGrantCapability.js +4 -2
- package/dist/permissionsDeclaration.d.ts +2 -0
- package/dist/permissionsDeclaration.js +72 -59
- package/dist/printPermissionOutcome.d.ts +12 -0
- package/dist/printPermissionOutcome.js +50 -0
- package/dist/printToolResultFrame.d.ts +1 -0
- package/dist/printToolResultFrame.js +5 -9
- package/dist/promptBlockedCopy.d.ts +5 -0
- package/dist/promptBlockedCopy.js +35 -0
- package/dist/protocolSegment.d.ts +9 -6
- package/dist/protocolSegment.js +31 -21
- package/dist/providerRejection.d.ts +4 -0
- package/dist/providerRejection.js +75 -14
- package/dist/replayBody.d.ts +12 -0
- package/dist/replayBody.js +25 -0
- package/dist/request/taskRequest.d.ts +1 -4
- package/dist/request/taskRequest.js +74 -19
- package/dist/resumeRefusalCopy.js +9 -25
- package/dist/retryStatus.d.ts +9 -1
- package/dist/retryStatus.js +9 -2
- package/dist/rewindArchiveCapability.d.ts +3 -13
- package/dist/rewindArchiveCapability.js +12 -58
- package/dist/rewindArchiveReading.d.ts +17 -0
- package/dist/rewindArchiveReading.js +55 -0
- package/dist/ruleCompileVerdict.d.ts +9 -1
- package/dist/ruleCompileVerdict.js +29 -4
- package/dist/runTerminal.d.ts +48 -5
- package/dist/runTerminal.js +215 -12
- package/dist/sandboxWire.js +13 -0
- package/dist/sdkWireTransit.d.ts +2 -1
- package/dist/sdkWireTransit.js +1 -0
- package/dist/sealedKeyCapability.d.ts +2 -4
- package/dist/sealedKeyCapability.js +0 -7
- package/dist/seam.js +4 -2
- package/dist/seatContract.d.ts +76 -11
- package/dist/seatContract.js +222 -27
- package/dist/sessionPolicyCapability.d.ts +2 -0
- package/dist/sessionPolicyCapability.js +3 -2
- package/dist/sessionReadRedactionCapability.d.ts +2 -4
- package/dist/sessionReadRedactionCapability.js +0 -7
- package/dist/sessionSyncFileHistory.d.ts +4 -0
- package/dist/sessionSyncFileHistory.js +66 -0
- package/dist/sessionSyncFileHistoryCapability.d.ts +2 -1
- package/dist/sessionSyncFileHistoryCapability.js +3 -5
- package/dist/skillToolListsCapability.d.ts +2 -1
- package/dist/skillToolListsCapability.js +3 -5
- package/dist/sqlEngineCapability.d.ts +2 -0
- package/dist/sqlEngineCapability.js +4 -3
- package/dist/steerPriorityCapability.d.ts +2 -1
- package/dist/steerPriorityCapability.js +3 -5
- package/dist/storePostureCapability.d.ts +2 -4
- package/dist/storePostureCapability.js +4 -9
- package/dist/subagent/engineSubagentSteer.js +7 -5
- package/dist/subagentContentStore.js +4 -15
- package/dist/supportFloor.d.ts +1 -0
- package/dist/supportFloor.js +13 -9
- package/dist/systemReminderTag.d.ts +1 -0
- package/dist/systemReminderTag.js +8 -0
- package/dist/toolHistoryBadTurn.js +3 -2
- package/dist/toolHistoryMismatch.d.ts +0 -3
- package/dist/toolHistoryMismatch.js +3 -7
- package/dist/toolResult.d.ts +12 -1
- package/dist/toolResult.js +55 -1
- package/dist/toolResultContent.d.ts +2 -0
- package/dist/toolResultContent.js +63 -0
- package/dist/usageAnalytics.js +40 -16
- package/dist/userInvokedSkillsCapability.d.ts +2 -1
- package/dist/userInvokedSkillsCapability.js +3 -5
- package/dist/webSearchBackendCapability.d.ts +2 -0
- package/dist/webSearchBackendCapability.js +3 -2
- package/dist/wireErrorTriage.d.ts +2 -0
- package/dist/wireErrorTriage.js +91 -38
- package/dist/wireFailureShape.d.ts +20 -3
- package/dist/wireFailureShape.js +128 -72
- package/dist/workflowsJournalCapability.d.ts +2 -0
- package/dist/workflowsJournalCapability.js +3 -2
- package/dist/writeProtectionCapability.d.ts +2 -0
- package/dist/writeProtectionCapability.js +3 -2
- package/docs/INTEGRATION-CLIENTS.md +1784 -20
- package/package.json +5 -5
- package/dist/engineRefusedToolName.d.ts +0 -1
- package/dist/engineRefusedToolName.js +0 -8
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export type PermissionModesReading = {
|
|
2
2
|
kind: 'unobserved';
|
|
3
|
+
} | {
|
|
4
|
+
kind: 'unreadable';
|
|
3
5
|
} | {
|
|
4
6
|
kind: 'not_reported';
|
|
5
7
|
} | {
|
|
@@ -7,9 +9,5 @@ export type PermissionModesReading = {
|
|
|
7
9
|
modes: readonly string[];
|
|
8
10
|
};
|
|
9
11
|
export declare function projectPermissionModesCapability(caps: unknown): PermissionModesReading | undefined;
|
|
10
|
-
export declare function noteEngineCapsForPermissionModes(baseUrl: string, caps: unknown, opts?: {
|
|
11
|
-
generation?: number;
|
|
12
|
-
}): void;
|
|
13
12
|
export declare function observedPermissionModes(baseUrl?: string | undefined): PermissionModesReading;
|
|
14
13
|
export declare function permissionModeAdmitted(reading: PermissionModesReading | undefined, mode: string): boolean;
|
|
15
|
-
export declare function __resetPermissionModesReadingsForTests(): void;
|
|
@@ -38,11 +38,7 @@ export function projectPermissionModesCapability(caps) {
|
|
|
38
38
|
const reader = createEngineCapReader({
|
|
39
39
|
name: 'permissionModes',
|
|
40
40
|
project: projectPermissionModesCapability,
|
|
41
|
-
makeUnobserved: () => ({ kind: 'unobserved' }),
|
|
42
41
|
});
|
|
43
|
-
export function noteEngineCapsForPermissionModes(baseUrl, caps, opts) {
|
|
44
|
-
reader.note(baseUrl, caps, opts);
|
|
45
|
-
}
|
|
46
42
|
export function observedPermissionModes(baseUrl = engineWireTarget()?.baseUrl) {
|
|
47
43
|
return reader.observed(baseUrl);
|
|
48
44
|
}
|
|
@@ -61,6 +57,3 @@ export function permissionModeAdmitted(reading, mode) {
|
|
|
61
57
|
return false;
|
|
62
58
|
}
|
|
63
59
|
}
|
|
64
|
-
export function __resetPermissionModesReadingsForTests() {
|
|
65
|
-
reader.__resetForTests();
|
|
66
|
-
}
|
|
@@ -34,9 +34,6 @@ const ISSUE_SENTENCES = Object.freeze({
|
|
|
34
34
|
'unsupported.path_base': 'this path rule is not supported as spelled: the base it is relative to is missing or is not a usable absolute path, so it would reach nothing and is refused rather than compiled',
|
|
35
35
|
'unsupported.mcp_paren': 'a parenthesised parameter rule is not supported on an MCP tool name',
|
|
36
36
|
'unsupported.covering_paren': 'a parenthesised parameter rule is not supported on a covering protocol name — the parameter grammar is keyed by an exact tool name, so no mounted tool could ever bear it',
|
|
37
|
-
'invalid.allow_param_rule': 'this rule is invalid: an allow rule cannot carry a parameter pattern — only bare tool rules auto-allow',
|
|
38
|
-
'unsupported.bash_prefix': 'a standing approval for a command belongs in the persisted-rule store, so this allow rule is not supported here (deny and ask rules with the same shape do compile)',
|
|
39
|
-
'unsupported.file_glob': 'a standing approval by path belongs in the consent store, so this allow rule is not supported here (deny and ask path rules do compile)',
|
|
40
37
|
});
|
|
41
38
|
const PARAM_SPLIT_WITH_COLON = 'this rule is invalid: a parameter rule is written name:pattern, and the name before the colon or the pattern after it is empty';
|
|
42
39
|
const PARAM_SPLIT_NO_COLON = 'this rule is invalid: there is no colon inside the parentheses, so this is not a parameter rule (a parameter rule is written name:pattern)';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { engineWireTarget } from './engineWireTarget.js';
|
|
2
|
-
import { createEngineCapReader } from './engineCapReader.js';
|
|
2
|
+
import { createEngineCapReader, unreadableReadingDetail } from './engineCapReader.js';
|
|
3
3
|
import { ownDataField } from './ownKey.js';
|
|
4
4
|
export function projectPermissionRulesWriteCapability(caps) {
|
|
5
5
|
try {
|
|
@@ -21,7 +21,6 @@ export function projectPermissionRulesWriteCapability(caps) {
|
|
|
21
21
|
const reader = createEngineCapReader({
|
|
22
22
|
name: 'permissionRulesWrite',
|
|
23
23
|
project: projectPermissionRulesWriteCapability,
|
|
24
|
-
makeUnobserved: () => ({ kind: 'unobserved' }),
|
|
25
24
|
});
|
|
26
25
|
export function noteEngineCapsForPermissionRulesWrite(baseUrl, caps, opts) {
|
|
27
26
|
reader.note(baseUrl, caps, opts);
|
|
@@ -34,6 +33,8 @@ export function permissionRulesWriteAvailable(reading) {
|
|
|
34
33
|
}
|
|
35
34
|
export function permissionRulesWriteDoctorDetail(reading) {
|
|
36
35
|
switch (reading.kind) {
|
|
36
|
+
case 'unreadable':
|
|
37
|
+
return unreadableReadingDetail('permission-rule write entry');
|
|
37
38
|
case 'unobserved':
|
|
38
39
|
return 'permission-rule write entry not observed — the engine reports it on /v1/capabilities (permissionRulesWrite); 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)';
|
|
39
40
|
case 'not_reported':
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { engineWireTarget } from './engineWireTarget.js';
|
|
2
|
-
import { createEngineCapReader } from './engineCapReader.js';
|
|
2
|
+
import { createEngineCapReader, unreadableReadingDetail } from './engineCapReader.js';
|
|
3
3
|
import { ownDataField } from './ownKey.js';
|
|
4
4
|
import { hasCoreValuePort } from './coreValuePorts.js';
|
|
5
5
|
const ALLOW_GRANT_CAP_PATH = ['settings', 'permissions', 'allowGrant'];
|
|
@@ -35,7 +35,6 @@ export function projectPermissionsAllowGrantCapability(caps) {
|
|
|
35
35
|
const reader = createEngineCapReader({
|
|
36
36
|
name: ALLOW_GRANT_CAP_PATH.join('.'),
|
|
37
37
|
project: projectPermissionsAllowGrantCapability,
|
|
38
|
-
makeUnobserved: () => ({ kind: 'unobserved' }),
|
|
39
38
|
});
|
|
40
39
|
export function noteEngineCapsForPermissionsAllowGrant(baseUrl, caps, opts) {
|
|
41
40
|
reader.note(baseUrl, caps, opts);
|
|
@@ -95,6 +94,9 @@ export function permissionsAllowGrantDoctorDetail(reading, settingsRead) {
|
|
|
95
94
|
if (kind === 'present' && ownReadingField(reading, 'grants') === false) {
|
|
96
95
|
return 'allow rules kept on this side — this engine says it does not read allow rules as rules of that kind, so they are not sent and matching approvals are still answered here';
|
|
97
96
|
}
|
|
97
|
+
if (kind === 'unreadable') {
|
|
98
|
+
return `${unreadableReadingDetail('how this engine reads allow rules')}; allow rules are kept on this side (not sent), and matching approvals are still answered here`;
|
|
99
|
+
}
|
|
98
100
|
if (kind === 'not_reported') {
|
|
99
101
|
return 'allow rules kept on this side — this engine does not say how it reads allow rules; sending them to an engine that reads them as an exclusive list would block every tool not on it, so they are not sent and matching approvals are still answered here';
|
|
100
102
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { compileAllowList, hasCoreValuePort, protocolOf,
|
|
2
|
-
import { clientOwnedServerPrefix,
|
|
1
|
+
import { compileAllowList, hasCoreValuePort, protocolOf, ruleToolGrammarOf } from './coreValuePorts.js';
|
|
2
|
+
import { clientOwnedServerPrefix, mintedPrefixOf, ruleToolNameVerdictOf } from './protocolSegment.js';
|
|
3
3
|
import { ruleCompileVerdict } from './ruleCompileVerdict.js';
|
|
4
4
|
import { allowRulesGate, allowWireForm } from './permissionsAllowGrantCapability.js';
|
|
5
5
|
import { THROWN_SLOT_UNREADABLE, readThrownSlot } from './wireFailureShape.js';
|
|
@@ -29,19 +29,6 @@ export const PERMISSIONS_KEPT_REASONS = Object.freeze([
|
|
|
29
29
|
'duplicate',
|
|
30
30
|
'voids_allow_list',
|
|
31
31
|
]);
|
|
32
|
-
function normalizeLegacyToolName(name) {
|
|
33
|
-
switch (name) {
|
|
34
|
-
case 'Task':
|
|
35
|
-
return 'Agent';
|
|
36
|
-
case 'KillShell':
|
|
37
|
-
return 'TaskStop';
|
|
38
|
-
case 'AgentOutputTool':
|
|
39
|
-
case 'BashOutputTool':
|
|
40
|
-
return 'TaskOutput';
|
|
41
|
-
default:
|
|
42
|
-
return name;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
32
|
function unescapedIndex(str, char, fromEnd) {
|
|
46
33
|
for (let k = 0; k < str.length; k++) {
|
|
47
34
|
const i = fromEnd ? str.length - 1 - k : k;
|
|
@@ -61,35 +48,46 @@ function unescapeRuleContent(content) {
|
|
|
61
48
|
function parseRule(rule) {
|
|
62
49
|
const open = unescapedIndex(rule, '(', false);
|
|
63
50
|
if (open === -1)
|
|
64
|
-
return { toolName:
|
|
51
|
+
return { toolName: rule };
|
|
65
52
|
const close = unescapedIndex(rule, ')', true);
|
|
66
53
|
if (close === -1 || close <= open || close !== rule.length - 1)
|
|
67
|
-
return { toolName:
|
|
54
|
+
return { toolName: rule };
|
|
68
55
|
const toolName = rule.substring(0, open);
|
|
69
56
|
const rawContent = rule.substring(open + 1, close);
|
|
70
57
|
if (!toolName)
|
|
71
|
-
return { toolName:
|
|
58
|
+
return { toolName: rule };
|
|
72
59
|
if (rawContent === '' || rawContent === '*')
|
|
73
|
-
return { toolName
|
|
74
|
-
return { toolName
|
|
60
|
+
return { toolName };
|
|
61
|
+
return { toolName, ruleContent: unescapeRuleContent(rawContent) };
|
|
75
62
|
}
|
|
76
63
|
function requireRulePorts() {
|
|
77
|
-
const required = ['MCP_NAMESPACE', '
|
|
64
|
+
const required = ['MCP_NAMESPACE', 'judgeRuleToolName', 'protocolOf', 'ruleToolGrammarOf', 'validatePermissionRules'];
|
|
78
65
|
const missing = required.filter((p) => !hasCoreValuePort(p));
|
|
79
66
|
if (missing.length === 0)
|
|
80
67
|
return;
|
|
81
68
|
throw new Error(`permissionsDeclaration: 规则判据端口缺席(${missing.join(' / ')})—— 先用 installCoreValuePorts 装上 core 的同名实现。` +
|
|
82
69
|
'缺席不等于全部合格:不判就发会让整份请求被引擎拒收,不判就删会静默丢掉 deny 规则,所以这里拒绝装配。');
|
|
83
70
|
}
|
|
84
|
-
function
|
|
71
|
+
function nameCheck(name) {
|
|
85
72
|
if (name.includes('('))
|
|
86
|
-
return 'paren_in_tool_name';
|
|
87
|
-
|
|
88
|
-
|
|
73
|
+
return { issue: 'paren_in_tool_name' };
|
|
74
|
+
const verdict = ruleToolNameVerdictOf(name);
|
|
75
|
+
if (verdict.kind === 'unknown') {
|
|
76
|
+
throw new Error('permissionsDeclaration: 规则工具名判官(judgeRuleToolName)答不上来(抛 / 回的不是 current · retired · unprefixed_namespace · unmintable_segment 之一)—— ' +
|
|
77
|
+
'装的必须是 core 的同名实现、原样装。判不出不等于够得着:不判就发会让整份请求被引擎拒收,不判就删会静默丢掉 deny 规则,所以这里拒绝装配。');
|
|
78
|
+
}
|
|
79
|
+
if (verdict.kind === 'retired')
|
|
80
|
+
return { retired: verdict.currentName !== undefined ? { currentName: verdict.currentName } : {} };
|
|
81
|
+
if (verdict.kind === 'unprefixed_namespace')
|
|
82
|
+
return { issue: 'unprefixed_namespaced_name' };
|
|
89
83
|
const ns = protocolOf(name);
|
|
90
|
-
if (ns === undefined)
|
|
91
|
-
return
|
|
92
|
-
|
|
84
|
+
if (ns !== undefined && ns.parse(name) === undefined)
|
|
85
|
+
return { issue: 'incomplete_protocol_name' };
|
|
86
|
+
if (verdict.kind === 'unmintable_segment') {
|
|
87
|
+
const minted = mintedPrefixOf(name);
|
|
88
|
+
return { unminted: minted !== undefined ? { minted } : {} };
|
|
89
|
+
}
|
|
90
|
+
return { ok: true };
|
|
93
91
|
}
|
|
94
92
|
function wholeServerRuleName(name) {
|
|
95
93
|
const read = name.trim();
|
|
@@ -101,11 +99,16 @@ function wholeServerRuleName(name) {
|
|
|
101
99
|
}
|
|
102
100
|
const compileVerdict = ruleCompileVerdict;
|
|
103
101
|
const kept = (reason) => ({ sent: false, reason });
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
function compileRefused(verdict) {
|
|
103
|
+
return {
|
|
104
|
+
sent: false,
|
|
105
|
+
reason: 'compile_refused',
|
|
106
|
+
...(verdict.code !== undefined ? { code: verdict.code } : {}),
|
|
107
|
+
...(verdict.message !== undefined ? { message: verdict.message } : {}),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function sentFate(wire, check, unchecked) {
|
|
111
|
+
return 'unminted' in check ? { sent: true, wire, unchecked, unreachable: check.unminted } : { sent: true, wire, unchecked };
|
|
109
112
|
}
|
|
110
113
|
function judgeList(rules, behavior, allowForm = 'grant') {
|
|
111
114
|
let portsChecked = false;
|
|
@@ -118,43 +121,46 @@ function judgeList(rules, behavior, allowForm = 'grant') {
|
|
|
118
121
|
}
|
|
119
122
|
const parsed = parseRule(rule);
|
|
120
123
|
if (parsed.ruleContent === undefined) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (
|
|
130
|
-
return kept('
|
|
124
|
+
let name = wholeServerRuleName(parsed.toolName);
|
|
125
|
+
let check = nameCheck(name);
|
|
126
|
+
if ('retired' in check) {
|
|
127
|
+
const successor = check.retired.currentName;
|
|
128
|
+
if (behavior === 'allow' || successor === undefined)
|
|
129
|
+
return kept('retired_tool_name');
|
|
130
|
+
name = successor;
|
|
131
|
+
check = nameCheck(name);
|
|
132
|
+
if ('retired' in check)
|
|
133
|
+
return kept('retired_tool_name');
|
|
131
134
|
}
|
|
135
|
+
if ('issue' in check)
|
|
136
|
+
return kept(check.issue);
|
|
137
|
+
if (behavior === 'allow' && 'unminted' in check)
|
|
138
|
+
return kept('unminted_protocol_segment');
|
|
132
139
|
const verdict = compileVerdict(name, behavior === 'ask' ? 'ask' : 'deny');
|
|
133
|
-
if (verdict === 'refused')
|
|
134
|
-
return
|
|
135
|
-
if (verdict === 'unknown' && behavior === 'allow')
|
|
140
|
+
if (verdict.kind === 'refused')
|
|
141
|
+
return compileRefused(verdict);
|
|
142
|
+
if (verdict.kind === 'unknown' && behavior === 'allow')
|
|
136
143
|
return kept('judge_failed');
|
|
137
|
-
return behavior === 'allow' ? { sent: true, wire: name, unchecked: false } : sentFate(name,
|
|
144
|
+
return behavior === 'allow' ? { sent: true, wire: name, unchecked: false } : sentFate(name, check, verdict.kind === 'unknown');
|
|
138
145
|
}
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
141
|
-
return kept(
|
|
146
|
+
const check = nameCheck(parsed.toolName);
|
|
147
|
+
if ('retired' in check)
|
|
148
|
+
return kept('retired_tool_name');
|
|
149
|
+
if ('issue' in check)
|
|
150
|
+
return kept(check.issue);
|
|
142
151
|
if (ruleToolGrammarOf(parsed.toolName) === 'path' && parsed.ruleContent.startsWith('~/'))
|
|
143
152
|
return kept('home_relative_path');
|
|
144
153
|
if (behavior === 'allow') {
|
|
145
154
|
if (allowForm !== 'layer')
|
|
146
155
|
return kept('content_form_not_grantable');
|
|
147
|
-
|
|
148
|
-
if (segment.kind === 'unminted')
|
|
156
|
+
if ('unminted' in check)
|
|
149
157
|
return kept('unminted_protocol_segment');
|
|
150
|
-
if (segment.kind === 'unknown')
|
|
151
|
-
return kept('judge_failed');
|
|
152
158
|
return { sent: true, wire: rule, unchecked: false };
|
|
153
159
|
}
|
|
154
160
|
const verdict = compileVerdict(rule, behavior);
|
|
155
|
-
if (verdict === 'refused')
|
|
156
|
-
return
|
|
157
|
-
return sentFate(rule,
|
|
161
|
+
if (verdict.kind === 'refused')
|
|
162
|
+
return compileRefused(verdict);
|
|
163
|
+
return sentFate(rule, check, verdict.kind === 'unknown');
|
|
158
164
|
});
|
|
159
165
|
}
|
|
160
166
|
function outsideSettingsFiles(origin) {
|
|
@@ -370,8 +376,15 @@ function assemble(input, caps) {
|
|
|
370
376
|
for (const [bucket, slots, j] of rows) {
|
|
371
377
|
slots.forEach((s, k) => {
|
|
372
378
|
const f = j.fates[k];
|
|
373
|
-
if (!f.sent)
|
|
374
|
-
keptRows.push({
|
|
379
|
+
if (!f.sent) {
|
|
380
|
+
keptRows.push({
|
|
381
|
+
rule: s.rule,
|
|
382
|
+
bucket,
|
|
383
|
+
reason: f.reason,
|
|
384
|
+
...(f.code !== undefined ? { code: f.code } : {}),
|
|
385
|
+
...(f.message !== undefined ? { message: f.message } : {}),
|
|
386
|
+
});
|
|
387
|
+
}
|
|
375
388
|
});
|
|
376
389
|
for (const wire of j.sent) {
|
|
377
390
|
const winner = j.winnerOf.get(wire);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type GateOutcomeView } from './gateOutcome.js';
|
|
2
|
+
import { type NoticeOutlet, type NoticeSeatClass } from './noticePresentation.js';
|
|
3
|
+
export declare const PRINT_PERMISSION_OUTCOME_FORMS: readonly ["mode_denied", "no_approver", "mode_released"];
|
|
4
|
+
export type PrintPermissionOutcomeForm = (typeof PRINT_PERMISSION_OUTCOME_FORMS)[number];
|
|
5
|
+
export interface PrintPermissionOutcome {
|
|
6
|
+
readonly form: PrintPermissionOutcomeForm;
|
|
7
|
+
readonly sentence: string;
|
|
8
|
+
readonly audience: 'user';
|
|
9
|
+
readonly outlet: NoticeOutlet;
|
|
10
|
+
readonly seatClass: NoticeSeatClass;
|
|
11
|
+
}
|
|
12
|
+
export declare function printPermissionOutcomeOf(gate: GateOutcomeView | undefined): PrintPermissionOutcome | undefined;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { modeReleaseReasonSentence } from './gateOutcome.js';
|
|
2
|
+
import { noticeSeatClassOf } from './noticePresentation.js';
|
|
3
|
+
import { guardedRead, readOwnDataValue } from './ownKey.js';
|
|
4
|
+
export const PRINT_PERMISSION_OUTCOME_FORMS = Object.freeze(['mode_denied', 'no_approver', 'mode_released']);
|
|
5
|
+
const ALLOW_RULE_REMEDY = 'add an allow rule for the tool in settings (or pass --allowedTools)';
|
|
6
|
+
const SENTENCES = Object.freeze({
|
|
7
|
+
dontAsk: {
|
|
8
|
+
sentence: `the dontAsk permission mode denies tools that need approval unless a permission rule allows them — ${ALLOW_RULE_REMEDY}`,
|
|
9
|
+
outlet: 'present',
|
|
10
|
+
},
|
|
11
|
+
bypassPermissions: {
|
|
12
|
+
sentence: 'the bypassPermissions permission mode refused a call because it could not tell whether the write it makes lands on a protected path',
|
|
13
|
+
outlet: 'absent',
|
|
14
|
+
},
|
|
15
|
+
mode: { sentence: "the session's permission mode denied a call that needed approval", outlet: 'absent' },
|
|
16
|
+
no_approver: {
|
|
17
|
+
sentence: `print mode has no approval channel: tools that need approval are denied unless a permission rule allows them — ${ALLOW_RULE_REMEDY}, or pass --permission-mode acceptEdits or auto`,
|
|
18
|
+
outlet: 'present',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
function outcomeOf(form, sentence, outlet) {
|
|
22
|
+
return Object.freeze({ form, sentence, audience: 'user', outlet, seatClass: noticeSeatClassOf('user', outlet) });
|
|
23
|
+
}
|
|
24
|
+
function slot(from, key) {
|
|
25
|
+
return typeof from === 'object' && from !== null ? guardedRead(() => readOwnDataValue(from, key)) : undefined;
|
|
26
|
+
}
|
|
27
|
+
export function printPermissionOutcomeOf(gate) {
|
|
28
|
+
const disposition = slot(gate, 'disposition');
|
|
29
|
+
const kind = slot(disposition, 'kind');
|
|
30
|
+
if (kind === 'denied') {
|
|
31
|
+
const deniedBy = slot(disposition, 'deniedBy');
|
|
32
|
+
if (deniedBy === 'mode') {
|
|
33
|
+
const mode = slot(disposition, 'mode');
|
|
34
|
+
const row = mode === 'dontAsk' ? SENTENCES.dontAsk : mode === 'bypassPermissions' ? SENTENCES.bypassPermissions : SENTENCES.mode;
|
|
35
|
+
return outcomeOf('mode_denied', row.sentence, row.outlet);
|
|
36
|
+
}
|
|
37
|
+
if (deniedBy === 'ask_resolution') {
|
|
38
|
+
const settled = slot(slot(gate, 'settlement'), 'kind');
|
|
39
|
+
if (settled === 'no_approver' || settled === 'approver_unavailable')
|
|
40
|
+
return outcomeOf('no_approver', SENTENCES.no_approver.sentence, SENTENCES.no_approver.outlet);
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
if (kind === 'allowed') {
|
|
45
|
+
const reason = slot(slot(disposition, 'released'), 'reason');
|
|
46
|
+
const sentence = typeof reason === 'string' ? modeReleaseReasonSentence(reason) : undefined;
|
|
47
|
+
return sentence === undefined ? undefined : outcomeOf('mode_released', sentence, 'absent');
|
|
48
|
+
}
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { isCcToolDenialKind } from './gateVocabulary.js';
|
|
2
2
|
export { flattenWireOutput as flattenToolOutput } from './adapt/wireShapes.js';
|
|
3
3
|
import { flattenWireOutput } from './adapt/wireShapes.js';
|
|
4
|
-
import { parseModelFacingBash } from './toolResult.js';
|
|
5
|
-
import { bashExitOf, bashExitReadingFailed } from './bashExitReading.js';
|
|
6
4
|
import { toolResultEnvelopeParts, toolResultOutcomeOf } from './adapt/toolCards.js';
|
|
7
|
-
|
|
8
|
-
if (typeof toolName !== 'string' || toolName.toLowerCase() !== 'bash')
|
|
9
|
-
return false;
|
|
10
|
-
return bashExitReadingFailed(bashExitOf(structured, () => parseModelFacingBash(text)));
|
|
11
|
-
}
|
|
5
|
+
import { readFrameTrueMark } from './ownKey.js';
|
|
12
6
|
export function toolEndResultToUserFrame(arm) {
|
|
13
7
|
if (typeof arm.toolCallId !== 'string' || arm.toolCallId.length === 0)
|
|
14
8
|
return null;
|
|
@@ -21,6 +15,7 @@ export function toolEndResultToUserFrame(arm) {
|
|
|
21
15
|
isError: arm.isError === true,
|
|
22
16
|
}, undefined, parent === null ? 'leader' : 'subagent');
|
|
23
17
|
const envelope = toolResultEnvelopeParts(outcome);
|
|
18
|
+
const content = Array.isArray(outcome.body.content) ? outcome.body.content : arm.truncated === true ? `${text}\n…(truncated)` : text;
|
|
24
19
|
return {
|
|
25
20
|
type: 'user',
|
|
26
21
|
message: {
|
|
@@ -29,13 +24,14 @@ export function toolEndResultToUserFrame(arm) {
|
|
|
29
24
|
{
|
|
30
25
|
type: 'tool_result',
|
|
31
26
|
tool_use_id: arm.toolCallId,
|
|
32
|
-
content
|
|
33
|
-
is_error:
|
|
27
|
+
content,
|
|
28
|
+
is_error: outcome.body.isError,
|
|
34
29
|
},
|
|
35
30
|
],
|
|
36
31
|
},
|
|
37
32
|
parent_tool_use_id: parent,
|
|
38
33
|
...(isCcToolDenialKind(arm._sema_denial_kind) ? { _sema_denial_kind: arm._sema_denial_kind } : {}),
|
|
34
|
+
...(readFrameTrueMark(arm, 'notExecuted') ? { _sema_not_executed: true } : {}),
|
|
39
35
|
...(Object.hasOwn(envelope, 'tool_use_result') ? { tool_use_result: envelope.tool_use_result } : {}),
|
|
40
36
|
...(Object.hasOwn(envelope, '_sema_degraded') ? { _sema_degraded: envelope._sema_degraded } : {}),
|
|
41
37
|
uuid: arm.uuid,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { displayUntrusted } from './displayUntrusted.js';
|
|
2
|
+
import { stripSystemReminderTagTokens, unwrapSystemReminder } from './systemReminderTag.js';
|
|
3
|
+
export const PROMPT_BLOCKED_BY_HOOK_ROW_LEAD = 'UserPromptSubmit operation blocked by hook';
|
|
4
|
+
const RUN_BLOCKED_REASONED = 'Run blocked';
|
|
5
|
+
const RUN_BLOCKED_NO_REASON = 'Run blocked (the agent reported it cannot proceed)';
|
|
6
|
+
const HOOK_WORDS_SHOWN_MAX = 1000;
|
|
7
|
+
const CAUSE_CLAUSE = Object.freeze({
|
|
8
|
+
crashed: 'the hook failed before it answered; the prompt was not submitted',
|
|
9
|
+
timeout: 'the hook did not answer in time; the prompt was not submitted',
|
|
10
|
+
cancelled: 'the run was cancelled while the hook was checking the prompt; the prompt was not submitted',
|
|
11
|
+
});
|
|
12
|
+
function shownHookWords(words) {
|
|
13
|
+
if (words === undefined)
|
|
14
|
+
return undefined;
|
|
15
|
+
const shown = stripSystemReminderTagTokens(displayUntrusted(stripSystemReminderTagTokens(words), { max: HOOK_WORDS_SHOWN_MAX })).trim();
|
|
16
|
+
return shown === '' ? undefined : shown;
|
|
17
|
+
}
|
|
18
|
+
export function runBlockedText(blocked) {
|
|
19
|
+
const detail = blocked.detail;
|
|
20
|
+
if (detail !== undefined && detail.kind === 'prompt_blocked_by_hook') {
|
|
21
|
+
const clause = detail.cause !== 'unrecognized' && Object.hasOwn(CAUSE_CLAUSE, detail.cause) ? CAUSE_CLAUSE[detail.cause] : undefined;
|
|
22
|
+
const words = shownHookWords(detail.hookReason);
|
|
23
|
+
if (clause !== undefined)
|
|
24
|
+
return `${PROMPT_BLOCKED_BY_HOOK_ROW_LEAD}: ${clause}${words !== undefined ? `\n${words}` : ''}`;
|
|
25
|
+
return words !== undefined ? `${PROMPT_BLOCKED_BY_HOOK_ROW_LEAD}:\n${words}` : PROMPT_BLOCKED_BY_HOOK_ROW_LEAD;
|
|
26
|
+
}
|
|
27
|
+
const reason = blocked.reason;
|
|
28
|
+
if (reason === undefined)
|
|
29
|
+
return RUN_BLOCKED_NO_REASON;
|
|
30
|
+
const unwrapped = unwrapSystemReminder(reason);
|
|
31
|
+
if (unwrapped === reason)
|
|
32
|
+
return `${RUN_BLOCKED_REASONED}: ${reason}`;
|
|
33
|
+
const body = stripSystemReminderTagTokens(unwrapped).trim();
|
|
34
|
+
return body === '' ? RUN_BLOCKED_NO_REASON : `${RUN_BLOCKED_REASONED}: ${body}`;
|
|
35
|
+
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
export type
|
|
2
|
-
readonly kind: '
|
|
1
|
+
export type RuleToolNameReading = {
|
|
2
|
+
readonly kind: 'current';
|
|
3
3
|
} | {
|
|
4
|
-
readonly kind: '
|
|
4
|
+
readonly kind: 'retired';
|
|
5
|
+
readonly currentName?: string;
|
|
5
6
|
} | {
|
|
6
|
-
readonly kind: '
|
|
7
|
-
|
|
7
|
+
readonly kind: 'unprefixed_namespace';
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'unmintable_segment';
|
|
8
10
|
} | {
|
|
9
11
|
readonly kind: 'unknown';
|
|
10
12
|
};
|
|
11
|
-
export declare function
|
|
13
|
+
export declare function ruleToolNameVerdictOf(name: string): RuleToolNameReading;
|
|
14
|
+
export declare function mintedPrefixOf(name: string): string | undefined;
|
|
12
15
|
export declare function clientOwnedServerPrefix(server: string): string | undefined;
|
package/dist/protocolSegment.js
CHANGED
|
@@ -1,33 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return { kind: 'empty' };
|
|
6
|
-
const ns = protocolOf(name);
|
|
7
|
-
if (ns === undefined)
|
|
8
|
-
return hasCoreValuePort('protocolOf') ? { kind: 'ok' } : { kind: 'unknown' };
|
|
9
|
-
let parsed;
|
|
1
|
+
import { mcpNamespace, mintNamespacePrefix, protocolOf, ruleToolNameJudgement } from './coreValuePorts.js';
|
|
2
|
+
export function ruleToolNameVerdictOf(name) {
|
|
3
|
+
let kind;
|
|
4
|
+
let currentName;
|
|
10
5
|
try {
|
|
11
|
-
|
|
6
|
+
const v = ruleToolNameJudgement(name, new Set());
|
|
7
|
+
if (v === null || typeof v !== 'object')
|
|
8
|
+
return { kind: 'unknown' };
|
|
9
|
+
kind = v.kind;
|
|
10
|
+
if (kind === 'retired')
|
|
11
|
+
currentName = v.currentName;
|
|
12
12
|
}
|
|
13
13
|
catch {
|
|
14
14
|
return { kind: 'unknown' };
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
switch (kind) {
|
|
17
|
+
case 'current':
|
|
18
|
+
case 'unprefixed_namespace':
|
|
19
|
+
case 'unmintable_segment':
|
|
20
|
+
return { kind };
|
|
21
|
+
case 'retired':
|
|
22
|
+
return typeof currentName === 'string' && currentName !== '' ? { kind, currentName } : { kind };
|
|
23
|
+
default:
|
|
24
|
+
return { kind: 'unknown' };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function mintedPrefixOf(name) {
|
|
22
28
|
try {
|
|
23
|
-
|
|
29
|
+
const ns = protocolOf(name);
|
|
30
|
+
if (ns === undefined)
|
|
31
|
+
return undefined;
|
|
32
|
+
const peer = ns.parse(name)?.peer;
|
|
33
|
+
if (typeof peer !== 'string' || peer.includes('*'))
|
|
34
|
+
return undefined;
|
|
35
|
+
const minted = mintNamespacePrefix(ns, peer);
|
|
36
|
+
return typeof minted === 'string' ? minted : undefined;
|
|
24
37
|
}
|
|
25
38
|
catch {
|
|
26
|
-
return
|
|
39
|
+
return undefined;
|
|
27
40
|
}
|
|
28
|
-
if (typeof minted !== 'string')
|
|
29
|
-
return { kind: 'unknown' };
|
|
30
|
-
return minted === `${ns.prefix}${peer}__` ? { kind: 'ok' } : { kind: 'unminted', minted };
|
|
31
41
|
}
|
|
32
42
|
export function clientOwnedServerPrefix(server) {
|
|
33
43
|
try {
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type RunTerminalFailureDetail } from './runTerminal.js';
|
|
2
2
|
import { type ToolHistoryErrorCarrier } from './toolHistoryMismatch.js';
|
|
3
|
+
export declare const PROVIDER_REJECTION_KINDS: readonly ["schema_invalid", "auth", "rate_limited", "resend_eligible", "unknown"];
|
|
4
|
+
export type ProviderRejectionKind = (typeof PROVIDER_REJECTION_KINDS)[number];
|
|
3
5
|
export interface ProviderRejectionResend {
|
|
4
6
|
resend: 'edit_and_resend' | 'not_by_editing';
|
|
5
7
|
text: string;
|
|
8
|
+
kind: ProviderRejectionKind;
|
|
6
9
|
}
|
|
7
10
|
export declare function readProviderRejectionResendKey(v: object | null | undefined): ProviderRejectionResend | undefined;
|
|
8
11
|
export declare function providerRejectionResend(detail: RunTerminalFailureDetail | null | undefined, carrier?: ToolHistoryErrorCarrier | null): ProviderRejectionResend | undefined;
|
|
12
|
+
export declare function providerRejectionKind(detail: RunTerminalFailureDetail | null | undefined): ProviderRejectionKind;
|