@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
package/dist/frameBinding.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { AgentEvent } from '@sema-agent/sdk';
|
|
2
2
|
import type { EngineBoundRun } from './engineRowRef.js';
|
|
3
|
+
import type { ApprovalFrameContext } from './eventLeg.js';
|
|
4
|
+
export declare function registerApprovalFrameContext(frame: AgentEvent, ctx: ApprovalFrameContext): void;
|
|
5
|
+
export declare function approvalFrameContextOfFrame(frame: object | null | undefined): ApprovalFrameContext | undefined;
|
|
3
6
|
export declare function registerFrameBinding(frame: AgentEvent, binding: EngineBoundRun): void;
|
|
4
7
|
export declare function frameBindingOf(frame: AgentEvent): EngineBoundRun | undefined;
|
|
5
8
|
export declare function inheritFrameBinding<T extends AgentEvent>(from: AgentEvent, to: T): T;
|
package/dist/frameBinding.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
const frameBindings = new WeakMap();
|
|
2
|
+
const approvalFrameContexts = new WeakMap();
|
|
3
|
+
export function registerApprovalFrameContext(frame, ctx) {
|
|
4
|
+
if (typeof frame !== 'object' || frame === null || approvalFrameContexts.has(frame))
|
|
5
|
+
return;
|
|
6
|
+
approvalFrameContexts.set(frame, ctx);
|
|
7
|
+
}
|
|
8
|
+
export function approvalFrameContextOfFrame(frame) {
|
|
9
|
+
return typeof frame === 'object' && frame !== null ? approvalFrameContexts.get(frame) : undefined;
|
|
10
|
+
}
|
|
2
11
|
export function registerFrameBinding(frame, binding) {
|
|
3
12
|
if (typeof frame !== 'object' || frame === null)
|
|
4
13
|
return;
|
|
@@ -19,5 +28,8 @@ export function inheritFrameBinding(from, to) {
|
|
|
19
28
|
const binding = frameBindings.get(from);
|
|
20
29
|
if (binding !== undefined && !frameBindings.has(to))
|
|
21
30
|
frameBindings.set(to, binding);
|
|
31
|
+
const ctx = approvalFrameContexts.get(from);
|
|
32
|
+
if (ctx !== undefined && !approvalFrameContexts.has(to))
|
|
33
|
+
approvalFrameContexts.set(to, ctx);
|
|
22
34
|
return to;
|
|
23
35
|
}
|
package/dist/gateOutcome.js
CHANGED
|
@@ -237,9 +237,23 @@ export function gateOutcomeOf(frame) {
|
|
|
237
237
|
return readGateRecord(frame)?.view;
|
|
238
238
|
}
|
|
239
239
|
export function isGateParkedToolEnd(frame) {
|
|
240
|
-
if (typeof frame !== 'object' || frame === null
|
|
240
|
+
if (typeof frame !== 'object' || frame === null)
|
|
241
|
+
return false;
|
|
242
|
+
try {
|
|
243
|
+
if (Array.isArray(frame))
|
|
244
|
+
return false;
|
|
245
|
+
if (readOwnDataValue(frame, 'errorCode') === GATE_PARKED_ERROR_CODE)
|
|
246
|
+
return true;
|
|
247
|
+
if (readOwnDataValue(frame, 'role') !== 'toolResult')
|
|
248
|
+
return false;
|
|
249
|
+
const details = readOwnDataValue(frame, 'details');
|
|
250
|
+
if (typeof details !== 'object' || details === null || Array.isArray(details))
|
|
251
|
+
return false;
|
|
252
|
+
return readOwnDataValue(details, 'code') === GATE_PARKED_ERROR_CODE;
|
|
253
|
+
}
|
|
254
|
+
catch {
|
|
241
255
|
return false;
|
|
242
|
-
|
|
256
|
+
}
|
|
243
257
|
}
|
|
244
258
|
export function gateModeRelease(g) {
|
|
245
259
|
return g?.disposition.kind === 'allowed' ? g.disposition.released : undefined;
|
package/dist/gateVocabulary.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CORE_DENIED_BY_VALUES, CORE_PERSISTED_RULE_MANDATES } from './generated/engineFactTables.js';
|
|
2
|
+
import type { UiLanguage } from './env/uiLanguage.js';
|
|
2
3
|
export declare const CC_TOOL_DENIAL_KINDS: readonly ["user-rejected", "permission-rule", "automode-blocked", "automode-unavailable", "automode-parsing-error", "interrupted", "cancelled"];
|
|
3
4
|
export type CcToolDenialKind = (typeof CC_TOOL_DENIAL_KINDS)[number];
|
|
4
5
|
export declare function isCcToolDenialKind(v: unknown): v is CcToolDenialKind;
|
|
@@ -7,15 +8,15 @@ export declare function ccToolDenialKindForSettledBy(settledBy: unknown): CcTool
|
|
|
7
8
|
export type GateDeniedByWord = (typeof CORE_DENIED_BY_VALUES)[number];
|
|
8
9
|
export declare const GATE_DENIED_BY_WORDS: readonly GateDeniedByWord[];
|
|
9
10
|
export declare function isGateDeniedByWord(v: unknown): v is GateDeniedByWord;
|
|
10
|
-
export declare function gateDeniedByDetail(deniedBy: unknown): string;
|
|
11
|
-
export declare function askOriginDetail(origin: unknown): string;
|
|
12
|
-
export declare function askOriginNoteOf(origin: string | undefined): string | undefined;
|
|
11
|
+
export declare function gateDeniedByDetail(deniedBy: unknown, lang?: UiLanguage): string;
|
|
12
|
+
export declare function askOriginDetail(origin: unknown, lang?: UiLanguage): string;
|
|
13
|
+
export declare function askOriginNoteOf(origin: string | undefined, lang?: UiLanguage): string | undefined;
|
|
13
14
|
export declare function ruleOffersAbsenceDetail(reason: string | undefined, opts?: {
|
|
14
15
|
readonly deploymentListSessionRow?: boolean;
|
|
15
|
-
}): string | undefined;
|
|
16
|
-
export declare function ruleOfferUncoveredDetail(reason: string | undefined): string;
|
|
17
|
-
export declare function mandatedApprovalDetail(): string;
|
|
16
|
+
}, lang?: UiLanguage): string | undefined;
|
|
17
|
+
export declare function ruleOfferUncoveredDetail(reason: string | undefined, lang?: UiLanguage): string;
|
|
18
|
+
export declare function mandatedApprovalDetail(lang?: UiLanguage): string;
|
|
18
19
|
export declare const APPROVAL_MANDATE_WORDS: readonly (typeof CORE_PERSISTED_RULE_MANDATES)[number][];
|
|
19
20
|
export type ApprovalMandateWord = (typeof APPROVAL_MANDATE_WORDS)[number];
|
|
20
21
|
export declare function isApprovalMandateWord(v: unknown): v is ApprovalMandateWord;
|
|
21
|
-
export declare function approvalMandateDetail(word: ApprovalMandateWord): string;
|
|
22
|
+
export declare function approvalMandateDetail(word: ApprovalMandateWord, lang?: UiLanguage): string;
|
package/dist/gateVocabulary.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CORE_DENIED_BY_VALUES, CORE_PERSISTED_RULE_MANDATES } from './generated/engineFactTables.js';
|
|
2
2
|
import { guardedRead, readOwnDataValue } from './ownKey.js';
|
|
3
|
+
import { msg, renderMessage } from './i18n/translate.js';
|
|
3
4
|
export const CC_TOOL_DENIAL_KINDS = Object.freeze([
|
|
4
5
|
'user-rejected',
|
|
5
6
|
'permission-rule',
|
|
@@ -25,53 +26,53 @@ export function ccToolDenialKindForSettledBy(settledBy) {
|
|
|
25
26
|
export const GATE_DENIED_BY_WORDS = Object.freeze([...CORE_DENIED_BY_VALUES]);
|
|
26
27
|
const _deniedByWordsPin = true;
|
|
27
28
|
void _deniedByWordsPin;
|
|
28
|
-
const
|
|
29
|
-
policy:
|
|
30
|
-
hook: '
|
|
31
|
-
org: '
|
|
32
|
-
persisted_rule: '
|
|
33
|
-
classifier: '
|
|
34
|
-
compliance: '
|
|
35
|
-
write_protection: '
|
|
36
|
-
ask_resolution: '
|
|
37
|
-
read_boundary: '
|
|
38
|
-
mode:
|
|
29
|
+
const DENIED_BY_KEYS = Object.freeze({
|
|
30
|
+
policy: 'approval.deniedBy.policy',
|
|
31
|
+
hook: 'approval.deniedBy.hook',
|
|
32
|
+
org: 'approval.deniedBy.org',
|
|
33
|
+
persisted_rule: 'approval.deniedBy.persistedRule',
|
|
34
|
+
classifier: 'approval.deniedBy.classifier',
|
|
35
|
+
compliance: 'approval.deniedBy.compliance',
|
|
36
|
+
write_protection: 'approval.deniedBy.writeProtection',
|
|
37
|
+
ask_resolution: 'approval.deniedBy.askResolution',
|
|
38
|
+
read_boundary: 'approval.deniedBy.readBoundary',
|
|
39
|
+
mode: 'approval.deniedBy.mode',
|
|
39
40
|
});
|
|
40
41
|
export function isGateDeniedByWord(v) {
|
|
41
42
|
return typeof v === 'string' && GATE_DENIED_BY_WORDS.includes(v);
|
|
42
43
|
}
|
|
43
|
-
export function gateDeniedByDetail(deniedBy) {
|
|
44
|
-
if (typeof deniedBy === 'string' && Object.hasOwn(
|
|
45
|
-
return
|
|
44
|
+
export function gateDeniedByDetail(deniedBy, lang) {
|
|
45
|
+
if (typeof deniedBy === 'string' && Object.hasOwn(DENIED_BY_KEYS, deniedBy)) {
|
|
46
|
+
return renderMessage(msg(DENIED_BY_KEYS[deniedBy]), lang);
|
|
46
47
|
}
|
|
47
|
-
const word = typeof deniedBy === 'string' && deniedBy.length > 0 ? deniedBy : '
|
|
48
|
-
return
|
|
48
|
+
const word = typeof deniedBy === 'string' && deniedBy.length > 0 ? deniedBy : msg('approval.card.noWord');
|
|
49
|
+
return renderMessage(msg('approval.deniedBy.unknown', { word }), lang);
|
|
49
50
|
}
|
|
50
|
-
const
|
|
51
|
-
content_question: '
|
|
52
|
-
plan_review: '
|
|
53
|
-
ancestor_marked: '
|
|
54
|
-
org_unavailable: '
|
|
55
|
-
org_rule: '
|
|
56
|
-
rule_store_unavailable: '
|
|
57
|
-
hook: '
|
|
58
|
-
ask_rule: '
|
|
59
|
-
denial_limit_fallback: '
|
|
60
|
-
shell_gate_tighten: '
|
|
61
|
-
safety_tighten: '
|
|
62
|
-
policy: '
|
|
51
|
+
const ASK_ORIGIN_KEYS = Object.freeze({
|
|
52
|
+
content_question: 'approval.origin.contentQuestion',
|
|
53
|
+
plan_review: 'approval.origin.planReview',
|
|
54
|
+
ancestor_marked: 'approval.origin.ancestorMarked',
|
|
55
|
+
org_unavailable: 'approval.origin.orgUnavailable',
|
|
56
|
+
org_rule: 'approval.origin.orgRule',
|
|
57
|
+
rule_store_unavailable: 'approval.origin.ruleStoreUnavailable',
|
|
58
|
+
hook: 'approval.origin.hook',
|
|
59
|
+
ask_rule: 'approval.origin.askRule',
|
|
60
|
+
denial_limit_fallback: 'approval.origin.denialLimitFallback',
|
|
61
|
+
shell_gate_tighten: 'approval.origin.shellGateTighten',
|
|
62
|
+
safety_tighten: 'approval.origin.safetyTighten',
|
|
63
|
+
policy: 'approval.origin.policy',
|
|
63
64
|
});
|
|
64
|
-
export function askOriginDetail(origin) {
|
|
65
|
-
const known = typeof origin === 'string' && Object.hasOwn(
|
|
66
|
-
?
|
|
65
|
+
export function askOriginDetail(origin, lang) {
|
|
66
|
+
const known = typeof origin === 'string' && Object.hasOwn(ASK_ORIGIN_KEYS, origin)
|
|
67
|
+
? ASK_ORIGIN_KEYS[origin]
|
|
67
68
|
: undefined;
|
|
68
69
|
if (known !== undefined)
|
|
69
|
-
return known;
|
|
70
|
-
const word = typeof origin === 'string' && origin.length > 0 ? origin : '
|
|
71
|
-
return unknownAskOriginSentence(word);
|
|
70
|
+
return renderMessage(msg(known), lang);
|
|
71
|
+
const word = typeof origin === 'string' && origin.length > 0 ? origin : msg('approval.card.noWord');
|
|
72
|
+
return renderMessage(unknownAskOriginSentence(word), lang);
|
|
72
73
|
}
|
|
73
74
|
function unknownAskOriginSentence(word) {
|
|
74
|
-
return
|
|
75
|
+
return word === undefined ? msg('approval.origin.unknownNoWord') : msg('approval.origin.unknownWithWord', { word });
|
|
75
76
|
}
|
|
76
77
|
const ASK_ORIGIN_QUIET = Object.freeze({
|
|
77
78
|
content_question: true,
|
|
@@ -87,51 +88,48 @@ const ASK_ORIGIN_QUIET = Object.freeze({
|
|
|
87
88
|
safety_tighten: false,
|
|
88
89
|
policy: true,
|
|
89
90
|
});
|
|
90
|
-
export function askOriginNoteOf(origin) {
|
|
91
|
+
export function askOriginNoteOf(origin, lang) {
|
|
91
92
|
if (typeof origin !== 'string' || origin === '')
|
|
92
93
|
return undefined;
|
|
93
94
|
if (Object.hasOwn(ASK_ORIGIN_QUIET, origin)) {
|
|
94
|
-
return ASK_ORIGIN_QUIET[origin] === true ? undefined : askOriginDetail(origin);
|
|
95
|
+
return ASK_ORIGIN_QUIET[origin] === true ? undefined : askOriginDetail(origin, lang);
|
|
95
96
|
}
|
|
96
|
-
return unknownAskOriginSentence(undefined);
|
|
97
|
+
return renderMessage(unknownAskOriginSentence(undefined), lang);
|
|
97
98
|
}
|
|
98
|
-
const
|
|
99
|
-
const RULE_OFFERS_ABSENCE_LINES = Object.freeze({
|
|
99
|
+
const RULE_OFFERS_ABSENCE_KEYS = Object.freeze({
|
|
100
100
|
mandated: { line: null },
|
|
101
|
-
allow_outranked: {
|
|
102
|
-
line: `${NO_REMEMBER_HEAD}: an allow rule already matches this call, but this question outranks it — another allow rule would be outranked the same way`,
|
|
103
|
-
},
|
|
101
|
+
allow_outranked: { line: 'approval.ruleOffer.absence.allowOutranked' },
|
|
104
102
|
ask_rule_matched: {
|
|
105
|
-
line:
|
|
106
|
-
deploymentList:
|
|
103
|
+
line: 'approval.ruleOffer.absence.askRuleMatched',
|
|
104
|
+
deploymentList: 'approval.ruleOffer.absence.askRuleMatchedDeploymentList',
|
|
107
105
|
},
|
|
108
|
-
lane_cannot_speak: { line:
|
|
106
|
+
lane_cannot_speak: { line: 'approval.ruleOffer.absence.laneCannotSpeak' },
|
|
109
107
|
});
|
|
110
|
-
export function ruleOffersAbsenceDetail(reason, opts) {
|
|
108
|
+
export function ruleOffersAbsenceDetail(reason, opts, lang) {
|
|
111
109
|
if (typeof reason !== 'string' || reason === '')
|
|
112
110
|
return undefined;
|
|
113
|
-
if (Object.hasOwn(
|
|
114
|
-
const entry =
|
|
111
|
+
if (Object.hasOwn(RULE_OFFERS_ABSENCE_KEYS, reason)) {
|
|
112
|
+
const entry = RULE_OFFERS_ABSENCE_KEYS[reason];
|
|
115
113
|
if (entry.line === null)
|
|
116
114
|
return undefined;
|
|
117
115
|
const onList = guardedRead(() => readOwnDataValue(opts, 'deploymentListSessionRow')) === true;
|
|
118
|
-
return onList && entry.deploymentList !== undefined ? entry.deploymentList : entry.line;
|
|
116
|
+
return renderMessage(msg(onList && entry.deploymentList !== undefined ? entry.deploymentList : entry.line), lang);
|
|
119
117
|
}
|
|
120
|
-
return
|
|
118
|
+
return renderMessage(msg('approval.ruleOffer.absence.unknown'), lang);
|
|
121
119
|
}
|
|
122
|
-
const
|
|
123
|
-
redirection: '
|
|
124
|
-
no_rule_form: '
|
|
125
|
-
cap_overflow: '
|
|
120
|
+
const RULE_OFFER_UNCOVERED_KEYS = Object.freeze({
|
|
121
|
+
redirection: 'approval.ruleOffer.uncovered.redirection',
|
|
122
|
+
no_rule_form: 'approval.ruleOffer.uncovered.noRuleForm',
|
|
123
|
+
cap_overflow: 'approval.ruleOffer.uncovered.capOverflow',
|
|
126
124
|
});
|
|
127
|
-
export function ruleOfferUncoveredDetail(reason) {
|
|
128
|
-
if (typeof reason === 'string' && Object.hasOwn(
|
|
129
|
-
return
|
|
125
|
+
export function ruleOfferUncoveredDetail(reason, lang) {
|
|
126
|
+
if (typeof reason === 'string' && Object.hasOwn(RULE_OFFER_UNCOVERED_KEYS, reason)) {
|
|
127
|
+
return renderMessage(msg(RULE_OFFER_UNCOVERED_KEYS[reason]), lang);
|
|
130
128
|
}
|
|
131
|
-
return '
|
|
129
|
+
return renderMessage(msg('approval.ruleOffer.uncovered.unknown'), lang);
|
|
132
130
|
}
|
|
133
|
-
export function mandatedApprovalDetail() {
|
|
134
|
-
return '
|
|
131
|
+
export function mandatedApprovalDetail(lang) {
|
|
132
|
+
return renderMessage(msg('approval.mandate.generic'), lang);
|
|
135
133
|
}
|
|
136
134
|
export const APPROVAL_MANDATE_WORDS = Object.freeze([...CORE_PERSISTED_RULE_MANDATES]);
|
|
137
135
|
const _mandateWordsPin = true;
|
|
@@ -139,18 +137,18 @@ void _mandateWordsPin;
|
|
|
139
137
|
export function isApprovalMandateWord(v) {
|
|
140
138
|
return APPROVAL_MANDATE_SET.has(v);
|
|
141
139
|
}
|
|
142
|
-
const
|
|
143
|
-
operator_always: '
|
|
144
|
-
tool_marks: '
|
|
145
|
-
probe_mandate: '
|
|
146
|
-
probe_unanswered: '
|
|
147
|
-
write_protection:
|
|
148
|
-
target_unresolved: '
|
|
140
|
+
const APPROVAL_MANDATE_KEYS = Object.freeze({
|
|
141
|
+
operator_always: 'approval.mandate.word.operatorAlways',
|
|
142
|
+
tool_marks: 'approval.mandate.word.toolMarks',
|
|
143
|
+
probe_mandate: 'approval.mandate.word.probeMandate',
|
|
144
|
+
probe_unanswered: 'approval.mandate.word.probeUnanswered',
|
|
145
|
+
write_protection: 'approval.mandate.word.writeProtection',
|
|
146
|
+
target_unresolved: 'approval.mandate.word.targetUnresolved',
|
|
149
147
|
});
|
|
150
148
|
const APPROVAL_MANDATE_SET = new Set(APPROVAL_MANDATE_WORDS);
|
|
151
|
-
export function approvalMandateDetail(word) {
|
|
152
|
-
if (typeof word === 'string' && Object.hasOwn(
|
|
153
|
-
return
|
|
149
|
+
export function approvalMandateDetail(word, lang) {
|
|
150
|
+
if (typeof word === 'string' && Object.hasOwn(APPROVAL_MANDATE_KEYS, word)) {
|
|
151
|
+
return renderMessage(msg(APPROVAL_MANDATE_KEYS[word]), lang);
|
|
154
152
|
}
|
|
155
|
-
return '
|
|
153
|
+
return renderMessage(msg('approval.mandate.unknownWord'), lang);
|
|
156
154
|
}
|
|
@@ -43,5 +43,21 @@ export declare const CORE_PERMISSION_MODES: readonly ["default", "acceptEdits",
|
|
|
43
43
|
export declare const CORE_APPROVAL_REACH: readonly ["none"];
|
|
44
44
|
export declare const CORE_PERSISTED_RULE_MANDATES: readonly ["operator_always", "tool_marks", "probe_mandate", "probe_unanswered", "write_protection", "target_unresolved"];
|
|
45
45
|
export declare const CORE_TASK_NOTIFICATION_TERMINAL_STATUSES: readonly ["completed", "failed", "killed", "cancelled"];
|
|
46
|
-
export declare const CORE_RESUME_STARTUP_CAUSES: readonly ["environment", "session_gone", "tool_unavailable", "configuration", "decision_rejected"];
|
|
46
|
+
export declare const CORE_RESUME_STARTUP_CAUSES: readonly ["environment", "session_gone", "transcript_corrupt", "tool_unavailable", "configuration", "decision_rejected"];
|
|
47
47
|
export declare const CORE_BUILTIN_SUBAGENT_TYPES: readonly ["Explore", "Plan", "fork", "general-purpose"];
|
|
48
|
+
export declare const CORE_USER_ATTACHMENT_KINDS: readonly ["text", "notebook", "image", "pdf", "directory", "client_text", "client_image"];
|
|
49
|
+
export declare const CORE_USER_ATTACHMENT_SUPPLIES: readonly ["path", "content_text", "content_image"];
|
|
50
|
+
export declare const CORE_USER_ATTACHMENT_OUTCOMES: readonly ["attached", "partial", "unchanged", "not_attached"];
|
|
51
|
+
export interface CoreUserAttachmentSeatLimits {
|
|
52
|
+
readonly maxEntries: number;
|
|
53
|
+
readonly maxRenderedTextChars: number;
|
|
54
|
+
}
|
|
55
|
+
export interface CoreUserAttachmentSeat {
|
|
56
|
+
readonly entries: readonly string[];
|
|
57
|
+
readonly kinds: readonly (typeof CORE_USER_ATTACHMENT_KINDS)[number][];
|
|
58
|
+
readonly supplies: readonly (typeof CORE_USER_ATTACHMENT_SUPPLIES)[number][];
|
|
59
|
+
readonly limits: CoreUserAttachmentSeatLimits;
|
|
60
|
+
}
|
|
61
|
+
export declare const CORE_USER_ATTACHMENT_SEAT: CoreUserAttachmentSeat;
|
|
62
|
+
export declare const CORE_USER_ATTACHMENTS_MAX: number;
|
|
63
|
+
export declare const CORE_USER_ATTACHMENT_LABEL_MAX: number;
|
|
@@ -289,6 +289,7 @@ export const CORE_TASK_NOTIFICATION_TERMINAL_STATUSES = Object.freeze([
|
|
|
289
289
|
export const CORE_RESUME_STARTUP_CAUSES = Object.freeze([
|
|
290
290
|
"environment",
|
|
291
291
|
"session_gone",
|
|
292
|
+
"transcript_corrupt",
|
|
292
293
|
"tool_unavailable",
|
|
293
294
|
"configuration",
|
|
294
295
|
"decision_rejected",
|
|
@@ -299,3 +300,31 @@ export const CORE_BUILTIN_SUBAGENT_TYPES = Object.freeze([
|
|
|
299
300
|
"fork",
|
|
300
301
|
"general-purpose",
|
|
301
302
|
]);
|
|
303
|
+
export const CORE_USER_ATTACHMENT_KINDS = Object.freeze([
|
|
304
|
+
"text",
|
|
305
|
+
"notebook",
|
|
306
|
+
"image",
|
|
307
|
+
"pdf",
|
|
308
|
+
"directory",
|
|
309
|
+
"client_text",
|
|
310
|
+
"client_image",
|
|
311
|
+
]);
|
|
312
|
+
export const CORE_USER_ATTACHMENT_SUPPLIES = Object.freeze([
|
|
313
|
+
"path",
|
|
314
|
+
"content_text",
|
|
315
|
+
"content_image",
|
|
316
|
+
]);
|
|
317
|
+
export const CORE_USER_ATTACHMENT_OUTCOMES = Object.freeze([
|
|
318
|
+
"attached",
|
|
319
|
+
"partial",
|
|
320
|
+
"unchanged",
|
|
321
|
+
"not_attached",
|
|
322
|
+
]);
|
|
323
|
+
export const CORE_USER_ATTACHMENT_SEAT = Object.freeze({
|
|
324
|
+
entries: Object.freeze(["objective"]),
|
|
325
|
+
kinds: CORE_USER_ATTACHMENT_KINDS,
|
|
326
|
+
supplies: CORE_USER_ATTACHMENT_SUPPLIES,
|
|
327
|
+
limits: Object.freeze({ maxEntries: 20, maxRenderedTextChars: 100000 }),
|
|
328
|
+
});
|
|
329
|
+
export const CORE_USER_ATTACHMENTS_MAX = 20;
|
|
330
|
+
export const CORE_USER_ATTACHMENT_LABEL_MAX = 4096;
|
|
@@ -25,12 +25,14 @@ export const CORE_ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
25
25
|
"config.peer_admission_out_of_range",
|
|
26
26
|
"config.peer_lane_unmounted",
|
|
27
27
|
"config.secret_env_scrubbed",
|
|
28
|
+
"config.credential_not_withheld",
|
|
28
29
|
"config.permission_mode_unavailable",
|
|
29
30
|
"permission.ask_released_by_mode",
|
|
30
31
|
"permission.read_deny_unapplied",
|
|
31
32
|
"permission.rule_store_unavailable",
|
|
32
33
|
"permission.rule_row_dropped",
|
|
33
34
|
"permission.allowed_tool_not_granted",
|
|
35
|
+
"mods.registration_refused",
|
|
34
36
|
"peer.inbound_disposition",
|
|
35
37
|
"peer.held_settled",
|
|
36
38
|
"peer.idle_subscription",
|
|
@@ -64,7 +66,7 @@ export const CORE_ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
64
66
|
"memory.project_scope_absent",
|
|
65
67
|
"route.fallback_to_primary",
|
|
66
68
|
"route.classifier_unroutable",
|
|
67
|
-
"route.
|
|
69
|
+
"route.credential_origin_mismatch",
|
|
68
70
|
"route.response_model_mismatch",
|
|
69
71
|
"route.tool_call_id_folded",
|
|
70
72
|
"route.finish_reason_unknown",
|
|
@@ -120,12 +122,14 @@ export const CORE_NOTICE_AUDIENCE = Object.freeze({
|
|
|
120
122
|
"config.peer_admission_out_of_range": "operator",
|
|
121
123
|
"config.peer_lane_unmounted": "operator",
|
|
122
124
|
"config.secret_env_scrubbed": "operator",
|
|
125
|
+
"config.credential_not_withheld": "operator",
|
|
123
126
|
"config.permission_mode_unavailable": "user",
|
|
124
127
|
"permission.ask_released_by_mode": "user",
|
|
125
128
|
"permission.read_deny_unapplied": "user",
|
|
126
129
|
"permission.rule_store_unavailable": "user",
|
|
127
130
|
"permission.rule_row_dropped": "user",
|
|
128
131
|
"permission.allowed_tool_not_granted": "user",
|
|
132
|
+
"mods.registration_refused": "user",
|
|
129
133
|
"peer.inbound_disposition": "user",
|
|
130
134
|
"peer.held_settled": "user",
|
|
131
135
|
"peer.idle_subscription": "user",
|
|
@@ -159,7 +163,7 @@ export const CORE_NOTICE_AUDIENCE = Object.freeze({
|
|
|
159
163
|
"memory.project_scope_absent": "operator",
|
|
160
164
|
"route.fallback_to_primary": "operator",
|
|
161
165
|
"route.classifier_unroutable": "operator",
|
|
162
|
-
"route.
|
|
166
|
+
"route.credential_origin_mismatch": "user",
|
|
163
167
|
"route.response_model_mismatch": "operator",
|
|
164
168
|
"route.tool_call_id_folded": "operator",
|
|
165
169
|
"route.finish_reason_unknown": "user",
|
|
@@ -221,12 +225,14 @@ export const CORE_NOTICE_MINTER = Object.freeze({
|
|
|
221
225
|
"config.peer_admission_out_of_range": "engine",
|
|
222
226
|
"config.peer_lane_unmounted": "engine",
|
|
223
227
|
"config.secret_env_scrubbed": "engine",
|
|
228
|
+
"config.credential_not_withheld": "engine",
|
|
224
229
|
"config.permission_mode_unavailable": "engine",
|
|
225
230
|
"permission.ask_released_by_mode": "engine",
|
|
226
231
|
"permission.read_deny_unapplied": "engine",
|
|
227
232
|
"permission.rule_store_unavailable": "engine",
|
|
228
233
|
"permission.rule_row_dropped": "engine",
|
|
229
234
|
"permission.allowed_tool_not_granted": "engine",
|
|
235
|
+
"mods.registration_refused": "engine",
|
|
230
236
|
"peer.inbound_disposition": "engine",
|
|
231
237
|
"peer.held_settled": "engine",
|
|
232
238
|
"peer.idle_subscription": "engine",
|
|
@@ -260,7 +266,7 @@ export const CORE_NOTICE_MINTER = Object.freeze({
|
|
|
260
266
|
"memory.project_scope_absent": "engine",
|
|
261
267
|
"route.fallback_to_primary": "engine",
|
|
262
268
|
"route.classifier_unroutable": "engine",
|
|
263
|
-
"route.
|
|
269
|
+
"route.credential_origin_mismatch": "engine",
|
|
264
270
|
"route.response_model_mismatch": "engine",
|
|
265
271
|
"route.tool_call_id_folded": "engine",
|
|
266
272
|
"route.finish_reason_unknown": "engine",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HooksClassification } from './settingsSchemaTypes.js';
|
|
1
2
|
export declare const SETTINGS_AT_MENTION_MODES: readonly ["all", "none", "only"];
|
|
2
3
|
export type SettingsAtMention = {
|
|
3
4
|
readonly mode: Exclude<(typeof SETTINGS_AT_MENTION_MODES)[number], 'only'>;
|
|
@@ -11,3 +12,8 @@ export declare const SETTINGS_IS_HIERARCHICAL_URL: (raw: string) => boolean;
|
|
|
11
12
|
export declare const SETTINGS_NARROW_AT_MENTION: (atMention: SettingsAtMention, available: ReadonlySet<string>) => SettingsAtMention;
|
|
12
13
|
export declare const SETTINGS_HOOK_MATCHER_SELECTS: (matcher: string | undefined, name: string) => boolean | 'invalid';
|
|
13
14
|
export declare const SETTINGS_HOOK_MATCHER_FORM: (matcher: string | undefined) => SettingsHookMatcherForm;
|
|
15
|
+
export declare const SETTINGS_HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "PostToolUseFailure", "PostToolBatch", "Notification", "UserPromptSubmit", "UserPromptExpansion", "SessionStart", "SessionEnd", "Stop", "StopFailure", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "PermissionRequest", "PermissionDenied", "Setup", "TeammateIdle", "TaskCreated", "TaskCompleted", "Elicitation", "ElicitationResult", "ConfigChange", "WorktreeCreate", "WorktreeRemove", "InstructionsLoaded", "CwdChanged", "FileChanged", "MessageDisplay", "DirectoryAdded", "PreModelSwitch", "PostModelSwitch"];
|
|
16
|
+
export declare const SETTINGS_HOOKS_CLASSIFICATION_OUTCOMES: readonly ["loaded", "loaded-partial", "rejected"];
|
|
17
|
+
export declare const SETTINGS_HOOKS_DROPPED_PIECE_CODES: readonly ["hooks-not-object", "unknown-event", "event-not-array", "matcher-invalid", "entry-invalid"];
|
|
18
|
+
export declare const SETTINGS_HOOKS_REJECTION_CODES: readonly ["guard-outside-hooks", "hooks-is-matcher", "guard-under-unknown-event", "guard-event-not-array", "guard-matcher-invalid", "guard-entry-invalid"];
|
|
19
|
+
export declare const SETTINGS_CLASSIFY_HOOKS_CONFIG: (settingsDoc: unknown) => HooksClassification;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SETTINGS_CLASSIFY_HOOKS_CONFIG_CLOSURE } from './settingsSchemaHooksClassifier.js';
|
|
1
2
|
export const SETTINGS_AT_MENTION_MODES = Object.freeze([
|
|
2
3
|
"all",
|
|
3
4
|
"none",
|
|
@@ -73,3 +74,59 @@ export const SETTINGS_HOOK_MATCHER_FORM = function hookMatcherForm(matcher) {
|
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
};
|
|
77
|
+
export const SETTINGS_HOOK_EVENTS = Object.freeze([
|
|
78
|
+
"PreToolUse",
|
|
79
|
+
"PostToolUse",
|
|
80
|
+
"PostToolUseFailure",
|
|
81
|
+
"PostToolBatch",
|
|
82
|
+
"Notification",
|
|
83
|
+
"UserPromptSubmit",
|
|
84
|
+
"UserPromptExpansion",
|
|
85
|
+
"SessionStart",
|
|
86
|
+
"SessionEnd",
|
|
87
|
+
"Stop",
|
|
88
|
+
"StopFailure",
|
|
89
|
+
"SubagentStart",
|
|
90
|
+
"SubagentStop",
|
|
91
|
+
"PreCompact",
|
|
92
|
+
"PostCompact",
|
|
93
|
+
"PermissionRequest",
|
|
94
|
+
"PermissionDenied",
|
|
95
|
+
"Setup",
|
|
96
|
+
"TeammateIdle",
|
|
97
|
+
"TaskCreated",
|
|
98
|
+
"TaskCompleted",
|
|
99
|
+
"Elicitation",
|
|
100
|
+
"ElicitationResult",
|
|
101
|
+
"ConfigChange",
|
|
102
|
+
"WorktreeCreate",
|
|
103
|
+
"WorktreeRemove",
|
|
104
|
+
"InstructionsLoaded",
|
|
105
|
+
"CwdChanged",
|
|
106
|
+
"FileChanged",
|
|
107
|
+
"MessageDisplay",
|
|
108
|
+
"DirectoryAdded",
|
|
109
|
+
"PreModelSwitch",
|
|
110
|
+
"PostModelSwitch",
|
|
111
|
+
]);
|
|
112
|
+
export const SETTINGS_HOOKS_CLASSIFICATION_OUTCOMES = Object.freeze([
|
|
113
|
+
"loaded",
|
|
114
|
+
"loaded-partial",
|
|
115
|
+
"rejected",
|
|
116
|
+
]);
|
|
117
|
+
export const SETTINGS_HOOKS_DROPPED_PIECE_CODES = Object.freeze([
|
|
118
|
+
"hooks-not-object",
|
|
119
|
+
"unknown-event",
|
|
120
|
+
"event-not-array",
|
|
121
|
+
"matcher-invalid",
|
|
122
|
+
"entry-invalid",
|
|
123
|
+
]);
|
|
124
|
+
export const SETTINGS_HOOKS_REJECTION_CODES = Object.freeze([
|
|
125
|
+
"guard-outside-hooks",
|
|
126
|
+
"hooks-is-matcher",
|
|
127
|
+
"guard-under-unknown-event",
|
|
128
|
+
"guard-event-not-array",
|
|
129
|
+
"guard-matcher-invalid",
|
|
130
|
+
"guard-entry-invalid",
|
|
131
|
+
]);
|
|
132
|
+
export const SETTINGS_CLASSIFY_HOOKS_CONFIG = SETTINGS_CLASSIFY_HOOKS_CONFIG_CLOSURE(SETTINGS_HOOK_EVENTS);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { HooksClassification } from './settingsSchemaTypes.js';
|
|
2
|
+
export declare const SETTINGS_CLASSIFY_HOOKS_CONFIG_CLOSURE: (HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "PostToolUseFailure", "PostToolBatch", "Notification", "UserPromptSubmit", "UserPromptExpansion", "SessionStart", "SessionEnd", "Stop", "StopFailure", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "PermissionRequest", "PermissionDenied", "Setup", "TeammateIdle", "TaskCreated", "TaskCompleted", "Elicitation", "ElicitationResult", "ConfigChange", "WorktreeCreate", "WorktreeRemove", "InstructionsLoaded", "CwdChanged", "FileChanged", "MessageDisplay", "DirectoryAdded", "PreModelSwitch", "PostModelSwitch"]) => (settingsDoc: unknown) => HooksClassification;
|