@sema-agent/client-core 0.100.0 → 0.101.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 +395 -0
- package/README.md +164 -117
- package/dist/adapt/arms.js +51 -16
- package/dist/adapt/textStream.js +7 -4
- package/dist/adapt/toolCards.js +9 -8
- package/dist/adapt.js +7 -1
- package/dist/adapter/activeRunSelfHeal.d.ts +24 -2
- package/dist/adapter/activeRunSelfHeal.js +108 -6
- package/dist/adapter/downstream/eventToSdkMessage.js +33 -12
- package/dist/adapter/downstream/terminalToSdkResult.d.ts +60 -1
- package/dist/adapter/downstream/terminalToSdkResult.js +209 -39
- package/dist/adapter/runStream.d.ts +4 -4
- package/dist/adapter/runStream.js +158 -43
- package/dist/agentsWireCaps.d.ts +2 -7
- package/dist/agentsWireCaps.js +1 -2
- package/dist/approvalDecidedByCapability.js +2 -2
- package/dist/approvalFrameFamilies.d.ts +33 -0
- package/dist/approvalFrameFamilies.js +120 -0
- package/dist/approvalsStreamLiveCapability.js +2 -2
- package/dist/attachmentsWireCaps.js +41 -13
- package/dist/callerCwdCapability.js +2 -2
- package/dist/centerWiringCapability.js +2 -2
- package/dist/clockReading.d.ts +2 -0
- package/dist/clockReading.js +4 -0
- package/dist/cloudConfigWireCaps.d.ts +19 -5
- package/dist/cloudConfigWireCaps.js +193 -56
- package/dist/coreValuePorts.d.ts +12 -2
- package/dist/coreValuePorts.js +9 -0
- package/dist/decideFailureNote.js +5 -3
- package/dist/decideReceipt.js +2 -2
- package/dist/deviceExecutorManagementCapability.js +2 -2
- package/dist/deviceFlowPolling.js +1 -1
- package/dist/disableSkillsWire.d.ts +1 -1
- package/dist/disableSkillsWire.js +4 -3
- package/dist/displayUntrusted.d.ts +1 -0
- package/dist/displayUntrusted.js +65 -8
- package/dist/engineCapReader.js +1 -1
- package/dist/engineConfigDrift.js +1 -1
- package/dist/engineErrorCodes.d.ts +14 -5
- package/dist/engineErrorCodes.js +27 -6
- package/dist/engineGenerationConvergence.d.ts +39 -0
- package/dist/engineGenerationConvergence.js +95 -0
- package/dist/engineGenerationPort.d.ts +61 -0
- package/dist/engineGenerationPort.js +144 -0
- package/dist/engineHealthFacts.d.ts +23 -0
- package/dist/engineHealthFacts.js +92 -0
- package/dist/engineIdentity.d.ts +4 -0
- package/dist/engineIdentity.js +11 -0
- package/dist/engineNoticeCodes.d.ts +2 -5
- package/dist/engineRowRef.js +3 -0
- package/dist/engineSessionMessages.js +2 -2
- package/dist/engineToolDirectory.js +2 -2
- package/dist/engineWireFor.d.ts +99 -0
- package/dist/engineWireFor.js +248 -6
- package/dist/engineWireTarget.d.ts +1 -0
- package/dist/engineWireTarget.js +8 -0
- package/dist/env/uiLanguage.js +1 -1
- package/dist/errorSupplementRoles.d.ts +3 -0
- package/dist/errorSupplementRoles.js +37 -0
- package/dist/executionLaneCapability.js +2 -2
- package/dist/fileHistoryCaptureCapability.js +3 -3
- package/dist/finalVerifyWire.d.ts +6 -3
- package/dist/finalVerifyWire.js +6 -23
- package/dist/flagInput.d.ts +4 -0
- package/dist/flagInput.js +24 -0
- package/dist/fleet/fleetLedger.js +5 -2
- package/dist/fleet/fleetProjection.d.ts +1 -0
- package/dist/fleet/fleetProjection.js +15 -2
- package/dist/gateVocabulary.js +3 -0
- package/dist/generated/engineFactTables.d.ts +7 -3
- package/dist/generated/engineFactTables.js +52 -0
- package/dist/generated/engineNoticeTables.js +12 -0
- package/dist/generated/settingsSchemaActiveTiers.d.ts +1 -0
- package/dist/generated/settingsSchemaActiveTiers.js +14 -0
- package/dist/generated/settingsSchemaCallerTextEcho.d.ts +1 -0
- package/dist/generated/settingsSchemaCallerTextEcho.js +8 -0
- package/dist/generated/settingsSchemaControlAndBidi.d.ts +1 -0
- package/dist/generated/settingsSchemaControlAndBidi.js +8 -0
- package/dist/generated/settingsSchemaDefaultModel.d.ts +11 -0
- package/dist/generated/settingsSchemaDefaultModel.js +25 -0
- package/dist/generated/settingsSchemaFns.d.ts +54 -0
- package/dist/generated/settingsSchemaFns.js +26 -1
- package/dist/generated/settingsSchemaMcpRequestEntry.d.ts +1 -1
- package/dist/generated/settingsSchemaMcpRequestEntry.js +1 -7
- package/dist/generated/settingsSchemaSafetyMergeSpec.d.ts +1 -0
- package/dist/generated/settingsSchemaSafetyMergeSpec.js +95 -0
- package/dist/generated/settingsSchemaSettingsSources.d.ts +1 -0
- package/dist/generated/settingsSchemaSettingsSources.js +58 -0
- package/dist/generated/settingsSchemaTables.d.ts +2 -0
- package/dist/generated/settingsSchemaTables.js +13 -0
- package/dist/generated/settingsSchemaUrlPattern.d.ts +1 -0
- package/dist/generated/settingsSchemaUrlPattern.js +183 -0
- package/dist/headlessPermissionModeWire.d.ts +18 -2
- package/dist/headlessPermissionModeWire.js +30 -19
- package/dist/hitl/allowRuleShadow.js +7 -5
- package/dist/hitl/approvalCardReading.d.ts +3 -0
- package/dist/hitl/approvalCardReading.js +17 -0
- package/dist/hitl/approvalCompleteParked.js +1 -1
- package/dist/hitl/approvalDelivery.d.ts +87 -0
- package/dist/hitl/approvalDelivery.js +193 -0
- package/dist/hitl/approvalResolution.d.ts +11 -0
- package/dist/hitl/approvalResolution.js +50 -11
- package/dist/hitl/askClassPair.d.ts +6 -0
- package/dist/hitl/askClassPair.js +30 -3
- package/dist/hitl/askParkAutoReopenBlock.d.ts +30 -0
- package/dist/hitl/askParkAutoReopenBlock.js +117 -0
- package/dist/hitl/askParkRowRouting.js +4 -1
- package/dist/hitl/attributionLadder.d.ts +42 -3
- package/dist/hitl/attributionLadder.js +79 -8
- package/dist/hitl/automaticAnswerVerdict.d.ts +6 -1
- package/dist/hitl/automaticAnswerVerdict.js +46 -11
- package/dist/hitl/crashConverged.js +2 -2
- package/dist/hitl/decisionConflict.d.ts +6 -2
- package/dist/hitl/decisionConflict.js +24 -9
- package/dist/hitl/decisionRefusal.d.ts +20 -10
- package/dist/hitl/decisionRefusal.js +99 -54
- package/dist/hitl/decisionSend.d.ts +3 -0
- package/dist/hitl/decisionSend.js +87 -103
- package/dist/hitl/frameRouter.d.ts +1 -0
- package/dist/hitl/frameRouter.js +9 -2
- package/dist/hitl/hitlBridge.d.ts +18 -6
- package/dist/hitl/hitlBridge.js +41 -37
- package/dist/hitl/livePendingAsk.js +4 -3
- package/dist/hitl/noAllowCause.js +1 -1
- package/dist/hitl/parkResolver.js +3 -2
- package/dist/hitl/persistedRulesWire.js +1 -0
- package/dist/hitl/planReviewWire.d.ts +4 -0
- package/dist/hitl/planReviewWire.js +59 -30
- package/dist/hitl/resumeRunningCard.d.ts +3 -2
- package/dist/hitl/resumeRunningCard.js +17 -11
- package/dist/hitl/sessionPolicyDeliverable.d.ts +5 -2
- package/dist/hitl/sessionPolicyDeliverable.js +62 -29
- package/dist/hitl/sessionPolicyWire.d.ts +13 -3
- package/dist/hitl/sessionPolicyWire.js +81 -16
- package/dist/hitl/standingRows.js +1 -1
- package/dist/hitl/toolApprovalWire.d.ts +9 -10
- package/dist/hitl/toolApprovalWire.js +72 -54
- package/dist/hookMatcherVerdict.d.ts +2 -0
- package/dist/hookMatcherVerdict.js +12 -0
- package/dist/hooksCompactTransition.d.ts +19 -0
- package/dist/hooksCompactTransition.js +41 -0
- package/dist/hooksWireCaps.d.ts +1 -1
- package/dist/hooksWireCaps.js +202 -203
- package/dist/host.d.ts +1 -14
- package/dist/host.js +0 -8
- package/dist/hostCallbackGuard.d.ts +1 -0
- package/dist/hostCallbackGuard.js +1 -1
- package/dist/hostSettingsSource.d.ts +172 -0
- package/dist/hostSettingsSource.js +675 -0
- package/dist/hostTurnSettings.d.ts +73 -17
- package/dist/hostTurnSettings.js +594 -97
- package/dist/httpHookPolicy.d.ts +37 -0
- package/dist/httpHookPolicy.js +176 -0
- package/dist/humanTurn.d.ts +2 -1
- package/dist/humanTurn.js +37 -7
- package/dist/humanTurnRead.js +4 -3
- package/dist/humanTurnSentences.d.ts +10 -0
- package/dist/humanTurnSentences.js +74 -0
- package/dist/i18n/messages.en.d.ts +184 -2
- package/dist/i18n/messages.en.js +187 -5
- package/dist/i18n/messages.zh.js +197 -5
- package/dist/i18n/translate.js +3 -3
- package/dist/index.d.ts +69 -15
- package/dist/index.js +45 -13
- package/dist/inheritEnvCapability.d.ts +3 -1
- package/dist/inheritEnvCapability.js +31 -17
- package/dist/inheritEnvWire.d.ts +2 -1
- package/dist/inheritEnvWire.js +11 -5
- package/dist/interactiveToolsWire.d.ts +4 -2
- package/dist/interactiveToolsWire.js +5 -5
- package/dist/jsonFaithful.d.ts +20 -0
- package/dist/jsonFaithful.js +152 -0
- package/dist/limitsWire.d.ts +7 -2
- package/dist/limitsWire.js +19 -13
- package/dist/liveInitToolFace.d.ts +6 -1
- package/dist/liveInitToolFace.js +5 -3
- package/dist/liveModelCatalog.d.ts +22 -0
- package/dist/liveModelCatalog.js +132 -18
- package/dist/mcpPanel.js +1 -1
- package/dist/mcpProbeCapability.js +2 -2
- package/dist/mcpStatusSupersetKeys.d.ts +24 -0
- package/dist/mcpStatusSupersetKeys.js +45 -0
- package/dist/mcpToolToggles.js +2 -1
- package/dist/mcpWireCaps.d.ts +39 -1
- package/dist/mcpWireCaps.js +254 -50
- package/dist/memoryComplianceCapability.js +2 -2
- package/dist/memoryOriginCapability.js +2 -2
- package/dist/model/catalogDefault.d.ts +24 -0
- package/dist/model/catalogDefault.js +4 -0
- package/dist/model/liveCatalogShape.js +5 -4
- package/dist/model/modelsPolicy.js +4 -3
- package/dist/model/onboardJudgement.d.ts +1 -0
- package/dist/model/onboardJudgement.js +1 -1
- package/dist/model/subagentModelWord.js +2 -2
- package/dist/modelCapabilityProbe.js +6 -6
- package/dist/modelIdentityResolvability.d.ts +10 -1
- package/dist/modelIdentityResolvability.js +62 -39
- package/dist/modsKernelIdentity.d.ts +10 -0
- package/dist/modsKernelIdentity.js +103 -0
- package/dist/modsKernelTransit.d.ts +8 -0
- package/dist/modsKernelTransit.js +6 -0
- package/dist/notifications.d.ts +30 -12
- package/dist/notifications.js +241 -53
- package/dist/outputStyleSeatCapability.js +2 -2
- package/dist/ownKey.d.ts +11 -0
- package/dist/ownKey.js +164 -3
- package/dist/panelReduce.js +1 -1
- package/dist/peerFrames.d.ts +1 -1
- package/dist/peerFrames.js +6 -2
- package/dist/peerLaneCapability.js +2 -2
- package/dist/permissionModesCapability.js +4 -4
- package/dist/permissionRuleIssue.js +2 -0
- package/dist/permissionRulesWriteCapability.js +2 -2
- package/dist/permissionsAllowGrantCapability.js +2 -2
- package/dist/permissionsDeclaration.d.ts +43 -4
- package/dist/permissionsDeclaration.js +102 -35
- package/dist/pluginHooksWire.d.ts +20 -4
- package/dist/pluginHooksWire.js +92 -53
- package/dist/prepareRefusal.d.ts +3 -2
- package/dist/prepareRefusal.js +27 -9
- package/dist/printInitToolFace.js +2 -2
- package/dist/printModelStatus.js +1 -1
- package/dist/projectMemory.d.ts +32 -0
- package/dist/projectMemory.js +70 -0
- package/dist/promptBlockedCopy.d.ts +2 -1
- package/dist/promptBlockedCopy.js +2 -1
- package/dist/promptDelivery.d.ts +23 -3
- package/dist/promptDelivery.js +169 -30
- package/dist/providerRejection.d.ts +19 -1
- package/dist/providerRejection.js +75 -4
- package/dist/queuedDelivery.d.ts +48 -0
- package/dist/queuedDelivery.js +233 -0
- package/dist/reattachWindow.d.ts +94 -0
- package/dist/reattachWindow.js +127 -0
- package/dist/request/printNotification.d.ts +1 -1
- package/dist/request/printNotification.js +5 -1
- package/dist/request/submissionIdentity.d.ts +37 -0
- package/dist/request/submissionIdentity.js +65 -0
- package/dist/request/taskRequest.d.ts +12 -4
- package/dist/request/taskRequest.js +221 -152
- package/dist/resultFrameKeys.d.ts +1 -0
- package/dist/resultFrameKeys.js +4 -1
- package/dist/retryStatus.d.ts +8 -0
- package/dist/retryStatus.js +57 -9
- package/dist/rewindArchiveCapability.js +2 -2
- package/dist/rewindEngineAction.d.ts +2 -0
- package/dist/rewindEngineAction.js +23 -1
- package/dist/rowKind.d.ts +36 -0
- package/dist/rowKind.js +97 -0
- package/dist/ruleCompileVerdict.d.ts +18 -0
- package/dist/ruleCompileVerdict.js +67 -2
- package/dist/ruleReadings.d.ts +58 -0
- package/dist/ruleReadings.js +132 -0
- package/dist/ruleRefusalSentence.d.ts +4 -0
- package/dist/ruleRefusalSentence.js +9 -3
- package/dist/runCancelContext.d.ts +0 -1
- package/dist/runCancelContext.js +1 -2
- package/dist/runTerminal.d.ts +5 -0
- package/dist/runTerminal.js +52 -17
- package/dist/sandboxWire.d.ts +1 -1
- package/dist/sandboxWire.js +4 -6
- package/dist/scenarioRefusal.js +1 -1
- package/dist/scenarioSkills.d.ts +20 -0
- package/dist/scenarioSkills.js +72 -0
- package/dist/scenarioWire.d.ts +5 -2
- package/dist/scenarioWire.js +9 -9
- package/dist/sealedKeyCapability.js +2 -2
- package/dist/seam.d.ts +2 -0
- package/dist/seam.js +2 -2
- package/dist/seatContract.d.ts +46 -1
- package/dist/seatContract.js +49 -19
- package/dist/selfOrchestrationDenial.js +1 -1
- package/dist/sessionPolicyCapability.js +2 -2
- package/dist/sessionRulesChildrenReadLive.d.ts +6 -0
- package/dist/sessionRulesChildrenReadLive.js +5 -0
- package/dist/sessionRulesNamespaceFormsCapability.d.ts +12 -0
- package/dist/sessionRulesNamespaceFormsCapability.js +29 -0
- package/dist/sessionSyncFileHistoryCapability.js +2 -2
- package/dist/settingsCredentialKeyPaths.js +60 -5
- package/dist/settingsHooksSalvage.d.ts +1 -0
- package/dist/settingsHooksSalvage.js +7 -1
- package/dist/settingsLayerAdmission.d.ts +4 -0
- package/dist/settingsLayerAdmission.js +16 -0
- package/dist/skillToolListsCapability.js +6 -5
- package/dist/skillsWireCaps.d.ts +14 -0
- package/dist/skillsWireCaps.js +47 -16
- package/dist/slashCommandGate.d.ts +24 -0
- package/dist/slashCommandGate.js +74 -0
- package/dist/slashCommandTable.d.ts +14 -0
- package/dist/slashCommandTable.js +99 -0
- package/dist/sqlEngineCapability.js +2 -2
- package/dist/steerPriorityCapability.js +2 -2
- package/dist/storePostureCapability.js +2 -2
- package/dist/subagent/agentStateDetail.js +1 -1
- package/dist/subagent/engineDelegatedPrompt.d.ts +9 -0
- package/dist/subagent/engineDelegatedPrompt.js +38 -7
- package/dist/subagent/engineRowStopGate.js +2 -2
- package/dist/subagent/engineSubagentResume.js +3 -3
- package/dist/subagent/engineTaskHandleWire.d.ts +1 -0
- package/dist/subagent/engineTaskHandleWire.js +10 -0
- package/dist/submitFailure.d.ts +8 -0
- package/dist/submitFailure.js +17 -0
- package/dist/supportFloor.d.ts +1 -0
- package/dist/supportFloor.js +7 -0
- package/dist/terminationIntent.d.ts +55 -0
- package/dist/terminationIntent.js +352 -0
- package/dist/toolHistoryMismatch.d.ts +8 -0
- package/dist/toolHistoryMismatch.js +37 -6
- package/dist/toolResult.d.ts +13 -3
- package/dist/toolResult.js +158 -9
- package/dist/toolResultContent.d.ts +13 -0
- package/dist/toolResultContent.js +82 -7
- package/dist/toolRoster.d.ts +18 -0
- package/dist/toolRoster.js +64 -0
- package/dist/turnFailurePresentation.js +27 -90
- package/dist/usageLimitAutoResume.d.ts +74 -0
- package/dist/usageLimitAutoResume.js +227 -0
- package/dist/userAttachmentEnvelope.js +1 -1
- package/dist/userAttachmentSeat.js +5 -5
- package/dist/userInvokedSkillsCapability.js +2 -2
- package/dist/webSearchBackendCapability.js +2 -2
- package/dist/wireErrorTriage.js +99 -50
- package/dist/wireFailureShape.d.ts +25 -1
- package/dist/wireFailureShape.js +92 -5
- package/dist/wireRefusalCopy.d.ts +24 -1
- package/dist/wireRefusalCopy.js +253 -32
- package/dist/wiringFleetDoctor.d.ts +3 -0
- package/dist/wiringFleetDoctor.js +21 -0
- package/dist/workflow.d.ts +2 -1
- package/dist/workflow.js +38 -1
- package/dist/workflowClient.d.ts +2 -7
- package/dist/workflowsJournalCapability.js +2 -2
- package/dist/writeProtectionCapability.js +2 -2
- package/docs/INTEGRATION-CLIENTS.md +607 -181
- package/package.json +14 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { capForDisplay } from './fleetTaskDesc.js';
|
|
2
|
-
import {
|
|
2
|
+
import { engineWireTargetBaseUrl } from './engineWireTarget.js';
|
|
3
3
|
import { createEngineCapReader, unreadableReadingDetail } from './engineCapReader.js';
|
|
4
4
|
import { ownDataField } from './ownKey.js';
|
|
5
5
|
export function projectExecutionLaneCapability(caps) {
|
|
@@ -49,7 +49,7 @@ const reader = createEngineCapReader({
|
|
|
49
49
|
name: 'executionLane',
|
|
50
50
|
project: projectExecutionLaneCapability,
|
|
51
51
|
});
|
|
52
|
-
export function observedExecutionLane(baseUrl =
|
|
52
|
+
export function observedExecutionLane(baseUrl = engineWireTargetBaseUrl()) {
|
|
53
53
|
return reader.observed(baseUrl);
|
|
54
54
|
}
|
|
55
55
|
export function toolsRunHereFromExecutionLane(reading) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { msg, renderMessage } from './i18n/translate.js';
|
|
2
2
|
import { capForDisplay } from './fleetTaskDesc.js';
|
|
3
|
-
import {
|
|
3
|
+
import { engineWireTargetBaseUrl } from './engineWireTarget.js';
|
|
4
4
|
import { createEngineCapReader, unreadableReadingDetail } from './engineCapReader.js';
|
|
5
5
|
import { refreshEngineCapsOnce } from './engineCapsCache.js';
|
|
6
6
|
import { ownDataField } from './ownKey.js';
|
|
@@ -23,7 +23,7 @@ const reader = createEngineCapReader({
|
|
|
23
23
|
name: 'fileHistoryCapture',
|
|
24
24
|
project: projectFileHistoryCaptureCapability,
|
|
25
25
|
});
|
|
26
|
-
export function observedFileHistoryCapture(baseUrl =
|
|
26
|
+
export function observedFileHistoryCapture(baseUrl = engineWireTargetBaseUrl()) {
|
|
27
27
|
return reader.observed(baseUrl);
|
|
28
28
|
}
|
|
29
29
|
export function fileHistoryCaptureMode(reading) {
|
|
@@ -118,7 +118,7 @@ export async function judgeFileHistoryTighten(captureOffByUser, opts) {
|
|
|
118
118
|
withinMs = 0;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
const baseUrl = explicitBase ??
|
|
121
|
+
const baseUrl = explicitBase ?? engineWireTargetBaseUrl();
|
|
122
122
|
const first = observedFileHistoryCapture(baseUrl);
|
|
123
123
|
const v1 = fileHistoryTightenVerdict(first, captureOffByUser);
|
|
124
124
|
if (v1 !== 'unjudged')
|
|
@@ -2,11 +2,14 @@ import type { SemaSettings } from '@sema-agent/sdk';
|
|
|
2
2
|
import { type EnvLike } from './hostEnv.js';
|
|
3
3
|
export type WireHooksConfig = NonNullable<SemaSettings['hooks']>;
|
|
4
4
|
export declare const HEADLESS_FINAL_VERIFY_ENV = "SEMA_HEADLESS_FINAL_VERIFY";
|
|
5
|
-
export
|
|
5
|
+
export interface HeadlessFinalVerifyFlags {
|
|
6
|
+
readonly noFinalVerify?: boolean;
|
|
7
|
+
readonly finalVerify?: boolean;
|
|
8
|
+
}
|
|
6
9
|
export declare function headlessFinalVerifyDisabledByEnv(env?: EnvLike): boolean;
|
|
7
10
|
export declare function hasUserStopHook(wireHooks: WireHooksConfig | undefined): boolean;
|
|
8
|
-
export declare function resolveHeadlessFinalVerify(
|
|
9
|
-
export declare function resolveHeadlessFinalVerifyDetail(
|
|
11
|
+
export declare function resolveHeadlessFinalVerify(flags: HeadlessFinalVerifyFlags | undefined, env?: EnvLike, wireHooks?: WireHooksConfig): boolean;
|
|
12
|
+
export declare function resolveHeadlessFinalVerifyDetail(flags: HeadlessFinalVerifyFlags | undefined, env?: EnvLike, wireHooks?: WireHooksConfig): {
|
|
10
13
|
on: boolean;
|
|
11
14
|
offReason?: 'flag' | 'env' | 'stop-hook';
|
|
12
15
|
};
|
package/dist/finalVerifyWire.js
CHANGED
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
import { hostEnv } from './hostEnv.js';
|
|
2
2
|
import { envFlagOff, envFlagOn } from './envFlag.js';
|
|
3
|
+
import { flagTrue } from './flagInput.js';
|
|
3
4
|
export const HEADLESS_FINAL_VERIFY_ENV = 'SEMA_HEADLESS_FINAL_VERIFY';
|
|
4
|
-
export function parseNoFinalVerifyArgv(argv) {
|
|
5
|
-
for (const a of argv) {
|
|
6
|
-
if (a === '--')
|
|
7
|
-
break;
|
|
8
|
-
if (a === '--no-final-verify')
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
function parseFinalVerifyArgv(argv) {
|
|
14
|
-
for (const a of argv) {
|
|
15
|
-
if (a === '--')
|
|
16
|
-
break;
|
|
17
|
-
if (a === '--final-verify')
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
5
|
export function headlessFinalVerifyDisabledByEnv(env = hostEnv()) {
|
|
23
6
|
return envFlagOff(env[HEADLESS_FINAL_VERIFY_ENV]);
|
|
24
7
|
}
|
|
@@ -26,15 +9,15 @@ export function hasUserStopHook(wireHooks) {
|
|
|
26
9
|
const groups = wireHooks?.['Stop'];
|
|
27
10
|
return Array.isArray(groups) && groups.length > 0;
|
|
28
11
|
}
|
|
29
|
-
export function resolveHeadlessFinalVerify(
|
|
30
|
-
return resolveHeadlessFinalVerifyDetail(
|
|
12
|
+
export function resolveHeadlessFinalVerify(flags, env = hostEnv(), wireHooks) {
|
|
13
|
+
return resolveHeadlessFinalVerifyDetail(flags, env, wireHooks).on;
|
|
31
14
|
}
|
|
32
|
-
export function resolveHeadlessFinalVerifyDetail(
|
|
33
|
-
if (
|
|
15
|
+
export function resolveHeadlessFinalVerifyDetail(flags, env = hostEnv(), wireHooks) {
|
|
16
|
+
if (flagTrue(flags, 'noFinalVerify'))
|
|
34
17
|
return { on: false, offReason: 'flag' };
|
|
35
18
|
if (headlessFinalVerifyDisabledByEnv(env))
|
|
36
19
|
return { on: false, offReason: 'env' };
|
|
37
|
-
const explicitOn =
|
|
20
|
+
const explicitOn = flagTrue(flags, 'finalVerify') || envFlagOn(env[HEADLESS_FINAL_VERIFY_ENV]);
|
|
38
21
|
if (explicitOn) {
|
|
39
22
|
if (hasUserStopHook(wireHooks))
|
|
40
23
|
return { on: false, offReason: 'stop-hook' };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function flagObject(flags: object | null | undefined, key: string): object | undefined;
|
|
2
|
+
export declare function flagIsWronglyTyped(flags: object | null | undefined, key: string): boolean;
|
|
3
|
+
export declare function flagString(flags: object | null | undefined, key: string): string | undefined;
|
|
4
|
+
export declare function flagTrue(flags: object | null | undefined, key: string): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { guardedRead, readOwnDataValue } from './ownKey.js';
|
|
2
|
+
function flagSlot(flags, key) {
|
|
3
|
+
return guardedRead(() => readOwnDataValue(flags, key));
|
|
4
|
+
}
|
|
5
|
+
export function flagObject(flags, key) {
|
|
6
|
+
const v = flagSlot(flags, key);
|
|
7
|
+
try {
|
|
8
|
+
return typeof v === 'object' && v !== null && !Array.isArray(v) ? v : undefined;
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function flagIsWronglyTyped(flags, key) {
|
|
15
|
+
const v = flagSlot(flags, key);
|
|
16
|
+
return v !== undefined && typeof v !== 'string';
|
|
17
|
+
}
|
|
18
|
+
export function flagString(flags, key) {
|
|
19
|
+
const v = flagSlot(flags, key);
|
|
20
|
+
return typeof v === 'string' ? v : undefined;
|
|
21
|
+
}
|
|
22
|
+
export function flagTrue(flags, key) {
|
|
23
|
+
return flagSlot(flags, key) === true;
|
|
24
|
+
}
|
|
@@ -12,6 +12,7 @@ import { isSdkFleetTaskTerminal, isSdkFleetTaskTerminalNotSuccess } from '../ter
|
|
|
12
12
|
import { projectTasks, projectWorkflows, wireCycleSeq, wireParentId, } from './fleetProjection.js';
|
|
13
13
|
import { isInStreamDrainingEnd } from '../wireErrorTriage.js';
|
|
14
14
|
import { cycleSeqOrder, cycleSeqValue } from '../cycleOrder.js';
|
|
15
|
+
import { guardedRead, ownSnapshotRecord, readOwnDataValue } from '../ownKey.js';
|
|
15
16
|
export const TERMINAL_RETAIN_MS = 60_000;
|
|
16
17
|
function hasRowId(row) {
|
|
17
18
|
const id = row?.id;
|
|
@@ -382,7 +383,7 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
382
383
|
hooks.onHookNotice?.(frame, sessionScopedMeta === true);
|
|
383
384
|
break;
|
|
384
385
|
case 'bg_notification':
|
|
385
|
-
applyBgNotification(frame
|
|
386
|
+
applyBgNotification(guardedRead(() => readOwnDataValue(frame, 'notification')), ing);
|
|
386
387
|
break;
|
|
387
388
|
default:
|
|
388
389
|
if (isInStreamDrainingEnd(frame)) {
|
|
@@ -394,7 +395,8 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
394
395
|
break;
|
|
395
396
|
}
|
|
396
397
|
}
|
|
397
|
-
function applyBgNotification(
|
|
398
|
+
function applyBgNotification(raw, ing) {
|
|
399
|
+
const n = ownSnapshotRecord(raw);
|
|
398
400
|
if (typeof n?.taskId !== 'string' || typeof n?.status !== 'string') {
|
|
399
401
|
droppedMalformed++;
|
|
400
402
|
debug('[fleet-frame] MALFORMED bg_notification dropped(taskId 或 status 缺席/非串)');
|
|
@@ -554,6 +556,7 @@ export function createFleetLedger(hooks = {}, opts = {}) {
|
|
|
554
556
|
status: n.status,
|
|
555
557
|
...(typeof n.seq === 'number' ? { seq: n.seq } : {}),
|
|
556
558
|
...(typeof n.summary === 'string' ? { summary: n.summary } : {}),
|
|
559
|
+
...(typeof n.completionId === 'string' && n.completionId.length > 0 ? { completionId: n.completionId } : {}),
|
|
557
560
|
});
|
|
558
561
|
}
|
|
559
562
|
function project(nowMs, opts) {
|
|
@@ -54,6 +54,7 @@ export interface FleetWorkflowView {
|
|
|
54
54
|
}
|
|
55
55
|
export declare function coerceTaskStatus(s: string): FleetTaskStatus;
|
|
56
56
|
export declare function coerceWorkflowStatus(s: string | undefined): FleetTaskStatus;
|
|
57
|
+
export declare function workflowRunDisplayStatusOf(run: object | null | undefined): FleetTaskStatus;
|
|
57
58
|
export declare const CONTROL_TOOL_VERBS: ReadonlySet<string>;
|
|
58
59
|
export declare function projectDescription(description: string | undefined): string;
|
|
59
60
|
export declare function wireParentId(r: Pick<FleetTaskRow, 'parentId'>): string | undefined;
|
|
@@ -2,6 +2,7 @@ import { collapseLabel, escapeDisplayControlChars, taskDescFromName } from '../f
|
|
|
2
2
|
import { rowIdTail } from '../workflow.js';
|
|
3
3
|
import { cycleSeqValue } from '../cycleOrder.js';
|
|
4
4
|
import { frozenSet } from '../frozenSet.js';
|
|
5
|
+
import { guardedRead, readOwnDataValue } from '../ownKey.js';
|
|
5
6
|
import { CORE_RESERVED_AGENT_NAMES } from '../generated/engineFactTables.js';
|
|
6
7
|
export function coerceTaskStatus(s) {
|
|
7
8
|
if (s === 'parked')
|
|
@@ -26,7 +27,15 @@ export function coerceTaskStatus(s) {
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
export function coerceWorkflowStatus(s) {
|
|
29
|
-
|
|
30
|
+
return workflowRunDisplayStatusOf({ status: s });
|
|
31
|
+
}
|
|
32
|
+
export function workflowRunDisplayStatusOf(run) {
|
|
33
|
+
const status = runField(run, 'status');
|
|
34
|
+
if (runField(run, 'parked') === true)
|
|
35
|
+
return 'awaiting approval';
|
|
36
|
+
if (status === 'failed' && runField(run, 'errorCode') === WORKFLOW_AGENT_PARKED_ERROR_CODE)
|
|
37
|
+
return 'awaiting approval';
|
|
38
|
+
switch (status) {
|
|
30
39
|
case 'completed':
|
|
31
40
|
return 'completed';
|
|
32
41
|
case 'failed':
|
|
@@ -43,6 +52,10 @@ export function coerceWorkflowStatus(s) {
|
|
|
43
52
|
return 'idle';
|
|
44
53
|
}
|
|
45
54
|
}
|
|
55
|
+
const WORKFLOW_AGENT_PARKED_ERROR_CODE = 'workflow.agent_parked';
|
|
56
|
+
function runField(run, key) {
|
|
57
|
+
return guardedRead(() => typeof run === 'object' && run !== null && !Array.isArray(run) ? readOwnDataValue(run, key) : undefined);
|
|
58
|
+
}
|
|
46
59
|
function deriveAgentLabel(agentType, agentName, name, id) {
|
|
47
60
|
const identity = collapseLabel(agentName ?? '') || collapseLabel(agentType ?? '');
|
|
48
61
|
if (identity)
|
|
@@ -218,7 +231,7 @@ export function projectWorkflows(rows) {
|
|
|
218
231
|
id: r.id,
|
|
219
232
|
name: collapseLabel(r.name ?? '') || 'Dynamic workflow',
|
|
220
233
|
description: projectDescription(r.description),
|
|
221
|
-
status:
|
|
234
|
+
status: workflowRunDisplayStatusOf(r),
|
|
222
235
|
...wireNumberKey('doneCount', wireCount(r.doneCount)),
|
|
223
236
|
...wireNumberKey('totalCount', wireCount(r.totalCount)),
|
|
224
237
|
...wireNumberKey('elapsedMs', wireDuration(r.elapsedMs)),
|
package/dist/gateVocabulary.js
CHANGED
|
@@ -105,6 +105,8 @@ const RULE_OFFERS_ABSENCE_KEYS = Object.freeze({
|
|
|
105
105
|
},
|
|
106
106
|
lane_cannot_speak: { line: 'approval.ruleOffer.absence.laneCannotSpeak' },
|
|
107
107
|
});
|
|
108
|
+
const _absenceWordsPin = true;
|
|
109
|
+
void _absenceWordsPin;
|
|
108
110
|
export function ruleOffersAbsenceDetail(reason, opts, lang) {
|
|
109
111
|
if (typeof reason !== 'string' || reason === '')
|
|
110
112
|
return undefined;
|
|
@@ -144,6 +146,7 @@ const APPROVAL_MANDATE_KEYS = Object.freeze({
|
|
|
144
146
|
probe_unanswered: 'approval.mandate.word.probeUnanswered',
|
|
145
147
|
write_protection: 'approval.mandate.word.writeProtection',
|
|
146
148
|
target_unresolved: 'approval.mandate.word.targetUnresolved',
|
|
149
|
+
cross_boundary_taint: 'approval.mandate.word.crossBoundaryTaint',
|
|
147
150
|
});
|
|
148
151
|
const APPROVAL_MANDATE_SET = new Set(APPROVAL_MANDATE_WORDS);
|
|
149
152
|
export function approvalMandateDetail(word, lang) {
|
|
@@ -14,7 +14,7 @@ export declare const CORE_ASK_EVIDENCE_ABSENCE_VALUES: readonly ["not_wired", "n
|
|
|
14
14
|
export declare const CORE_SYSTEM_INJECTION_PRIORITIES: readonly ["now", "next", "later"];
|
|
15
15
|
export declare const CORE_READ_DENY_BUILTIN_TIERS: readonly ["credentials", "shell-history", "browser", "wallet", "agent-config"];
|
|
16
16
|
export declare const CORE_READ_DENY_DEFAULT_TIERS: readonly ["credentials", "agent-config"];
|
|
17
|
-
export declare const CORE_ASK_CLASSES: readonly ["content_question", "hook", "ancestor", "dangerous_delete", "unverifiable_delete", "unverifiable_shell_text", "transcript_write", "org_rule", "rule_unreadable", "ask_rule", "denial_limit_fallback", "classifier_no_ruling", "requires_user_interaction", "operator_forced", "shell_floor", "target_unresolved", "probe", "write_protection", "tool_marks_mcp", "tool_marks_a2a", "policy_rra", "artifact_shared_read", "mode", "unstated", "ordinary"];
|
|
17
|
+
export declare const CORE_ASK_CLASSES: readonly ["content_question", "hook", "ancestor", "dangerous_delete", "unverifiable_delete", "unverifiable_shell_text", "transcript_write", "org_rule", "rule_unreadable", "ask_rule", "denial_limit_fallback", "classifier_no_ruling", "requires_user_interaction", "cross_boundary", "operator_forced", "shell_floor", "target_unresolved", "probe", "write_protection", "tool_marks_mcp", "tool_marks_a2a", "policy_rra", "artifact_shared_read", "mode", "unstated", "ordinary"];
|
|
18
18
|
export interface CoreModeArbitrationRow {
|
|
19
19
|
readonly bypassImmune: boolean;
|
|
20
20
|
readonly classifierEligible: boolean;
|
|
@@ -22,7 +22,7 @@ export interface CoreModeArbitrationRow {
|
|
|
22
22
|
readonly ruleMayClear: boolean;
|
|
23
23
|
readonly hookAskFloor: boolean;
|
|
24
24
|
}
|
|
25
|
-
export declare const CORE_MODE_ARBITRATION: Readonly<Record<"content_question" | "hook" | "ancestor" | "dangerous_delete" | "unverifiable_delete" | "unverifiable_shell_text" | "transcript_write" | "org_rule" | "rule_unreadable" | "ask_rule" | "denial_limit_fallback" | "classifier_no_ruling" | "requires_user_interaction" | "operator_forced" | "shell_floor" | "target_unresolved" | "probe" | "write_protection" | "tool_marks_mcp" | "tool_marks_a2a" | "policy_rra" | "artifact_shared_read" | "mode" | "unstated" | "ordinary", CoreModeArbitrationRow>>;
|
|
25
|
+
export declare const CORE_MODE_ARBITRATION: Readonly<Record<"content_question" | "hook" | "ancestor" | "dangerous_delete" | "unverifiable_delete" | "unverifiable_shell_text" | "transcript_write" | "org_rule" | "rule_unreadable" | "ask_rule" | "denial_limit_fallback" | "classifier_no_ruling" | "requires_user_interaction" | "cross_boundary" | "operator_forced" | "shell_floor" | "target_unresolved" | "probe" | "write_protection" | "tool_marks_mcp" | "tool_marks_a2a" | "policy_rra" | "artifact_shared_read" | "mode" | "unstated" | "ordinary", CoreModeArbitrationRow>>;
|
|
26
26
|
export declare const CORE_SKILL_GRANT_ORIGINS: readonly ["model", "user", "inherited"];
|
|
27
27
|
export declare const CORE_ALLOW_ENTRY_INERT_REASONS: readonly ["wildcard_all", "namespace_wildcard", "content_unsupported", "grammar", "tool_name", "near_miss", "earlier_grammar"];
|
|
28
28
|
export declare const CORE_ALLOW_RULE_MEMBERS: readonly ["hook", "deployment", "persisted", "skill", "request"];
|
|
@@ -42,10 +42,14 @@ export declare const CORE_MAX_PENDING_STEER_CHARS: number;
|
|
|
42
42
|
export declare const CORE_PROMPT_BLOCK_CAUSES: readonly ["block", "crashed", "timeout", "cancelled"];
|
|
43
43
|
export declare const CORE_PERMISSION_MODES: readonly ["default", "acceptEdits", "plan", "auto", "bypassPermissions", "dontAsk"];
|
|
44
44
|
export declare const CORE_APPROVAL_REACH: readonly ["none"];
|
|
45
|
-
export declare const CORE_PERSISTED_RULE_MANDATES: readonly ["operator_always", "tool_marks", "probe_mandate", "probe_unanswered", "write_protection", "target_unresolved"];
|
|
45
|
+
export declare const CORE_PERSISTED_RULE_MANDATES: readonly ["operator_always", "tool_marks", "probe_mandate", "probe_unanswered", "write_protection", "target_unresolved", "cross_boundary_taint"];
|
|
46
46
|
export declare const CORE_TASK_NOTIFICATION_TERMINAL_STATUSES: readonly ["completed", "failed", "killed", "cancelled"];
|
|
47
47
|
export declare const CORE_RESUME_STARTUP_CAUSES: readonly ["environment", "session_gone", "transcript_corrupt", "tool_unavailable", "configuration", "decision_rejected"];
|
|
48
48
|
export declare const CORE_BUILTIN_SUBAGENT_TYPES: readonly ["Explore", "Plan", "fork", "general-purpose"];
|
|
49
|
+
export declare const CORE_RULE_OFFERS_ABSENCES: readonly ["mandated", "allow_outranked", "ask_rule_matched", "lane_cannot_speak"];
|
|
50
|
+
export declare const CORE_TOOL_APPROVAL_CARDS: readonly ["file-edit", "file-write", "notebook-edit", "shell", "fetch", "skill", "workflow", "plan", "question", "generic"];
|
|
51
|
+
export declare const CORE_ASK_CLASSES_WITHOUT_REASON_ROW: readonly ["probe"];
|
|
52
|
+
export declare const CORE_ASK_CLASS_REASONS: Readonly<Record<Exclude<(typeof CORE_ASK_CLASSES)[number], (typeof CORE_ASK_CLASSES_WITHOUT_REASON_ROW)[number]>, string>>;
|
|
49
53
|
export declare const CORE_USER_ATTACHMENT_KINDS: readonly ["text", "notebook", "image", "pdf", "directory", "client_text", "client_image"];
|
|
50
54
|
export declare const CORE_USER_ATTACHMENT_SUPPLIES: readonly ["path", "content_text", "content_image"];
|
|
51
55
|
export declare const CORE_USER_ATTACHMENT_OUTCOMES: readonly ["attached", "partial", "unchanged", "not_attached"];
|
|
@@ -85,6 +85,7 @@ export const CORE_ENGINE_CARD_TYPES = Object.freeze([
|
|
|
85
85
|
"workflow-run",
|
|
86
86
|
"report-findings",
|
|
87
87
|
"tool-search",
|
|
88
|
+
"advisor",
|
|
88
89
|
"ask-question",
|
|
89
90
|
"exit-plan-mode",
|
|
90
91
|
"enter-plan-mode",
|
|
@@ -154,6 +155,7 @@ export const CORE_ASK_CLASSES = Object.freeze([
|
|
|
154
155
|
"denial_limit_fallback",
|
|
155
156
|
"classifier_no_ruling",
|
|
156
157
|
"requires_user_interaction",
|
|
158
|
+
"cross_boundary",
|
|
157
159
|
"operator_forced",
|
|
158
160
|
"shell_floor",
|
|
159
161
|
"target_unresolved",
|
|
@@ -181,6 +183,7 @@ export const CORE_MODE_ARBITRATION = Object.freeze({
|
|
|
181
183
|
"denial_limit_fallback": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
|
|
182
184
|
"classifier_no_ruling": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
|
|
183
185
|
"requires_user_interaction": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: true }),
|
|
186
|
+
"cross_boundary": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: false, ruleMayClear: false, hookAskFloor: false }),
|
|
184
187
|
"operator_forced": Object.freeze({ bypassImmune: true, classifierEligible: true, sandboxAdmission: true, ruleMayClear: false, hookAskFloor: false }),
|
|
185
188
|
"shell_floor": Object.freeze({ bypassImmune: true, classifierEligible: true, sandboxAdmission: true, ruleMayClear: false, hookAskFloor: false }),
|
|
186
189
|
"target_unresolved": Object.freeze({ bypassImmune: true, classifierEligible: false, sandboxAdmission: true, ruleMayClear: false, hookAskFloor: true }),
|
|
@@ -306,6 +309,7 @@ export const CORE_PERSISTED_RULE_MANDATES = Object.freeze([
|
|
|
306
309
|
"probe_unanswered",
|
|
307
310
|
"write_protection",
|
|
308
311
|
"target_unresolved",
|
|
312
|
+
"cross_boundary_taint",
|
|
309
313
|
]);
|
|
310
314
|
export const CORE_TASK_NOTIFICATION_TERMINAL_STATUSES = Object.freeze([
|
|
311
315
|
"completed",
|
|
@@ -327,6 +331,54 @@ export const CORE_BUILTIN_SUBAGENT_TYPES = Object.freeze([
|
|
|
327
331
|
"fork",
|
|
328
332
|
"general-purpose",
|
|
329
333
|
]);
|
|
334
|
+
export const CORE_RULE_OFFERS_ABSENCES = Object.freeze([
|
|
335
|
+
"mandated",
|
|
336
|
+
"allow_outranked",
|
|
337
|
+
"ask_rule_matched",
|
|
338
|
+
"lane_cannot_speak",
|
|
339
|
+
]);
|
|
340
|
+
export const CORE_TOOL_APPROVAL_CARDS = Object.freeze([
|
|
341
|
+
"file-edit",
|
|
342
|
+
"file-write",
|
|
343
|
+
"notebook-edit",
|
|
344
|
+
"shell",
|
|
345
|
+
"fetch",
|
|
346
|
+
"skill",
|
|
347
|
+
"workflow",
|
|
348
|
+
"plan",
|
|
349
|
+
"question",
|
|
350
|
+
"generic",
|
|
351
|
+
]);
|
|
352
|
+
export const CORE_ASK_CLASSES_WITHOUT_REASON_ROW = Object.freeze([
|
|
353
|
+
"probe",
|
|
354
|
+
]);
|
|
355
|
+
export const CORE_ASK_CLASS_REASONS = Object.freeze({
|
|
356
|
+
"content_question": "the call is the engine's own question to a person",
|
|
357
|
+
"hook": "a PreToolUse hook asks about this call — the deployment's own screening is answered by a person",
|
|
358
|
+
"ancestor": "the task that delegated this one owns this question",
|
|
359
|
+
"dangerous_delete": "this removal targets a protected location (the filesystem root, a top-level directory, a home directory, or a workspace directory or one of its ancestors) — it is cleared by confirming this call, never by an allow rule",
|
|
360
|
+
"unverifiable_delete": "this removal could not be verified safe — it is cleared by confirming this call, never by an allow rule",
|
|
361
|
+
"unverifiable_shell_text": "the text this shell will run cannot be read by the engine — it is cleared by confirming this call, never by an allow rule",
|
|
362
|
+
"transcript_write": "this write targets the session transcript — it is cleared by confirming this call, never by an allow rule",
|
|
363
|
+
"org_rule": "an organization policy rule requires approval for this call",
|
|
364
|
+
"rule_unreadable": "a rule that may govern this call cannot currently be read (this deployment's organization policy, a partition of the person's standing rules, or this call against a deny or ask rule), so whether one forbids it is unknown",
|
|
365
|
+
"ask_rule": "an explicit ask rule matched this call (a person's or the deployment's ask-me-each-time outranks a standing allow rule)",
|
|
366
|
+
"denial_limit_fallback": "the auto-mode classifier refused too many calls in a row, so a person decides",
|
|
367
|
+
"classifier_no_ruling": "the auto-mode classifier could not judge this call, so a person decides",
|
|
368
|
+
"requires_user_interaction": "this tool's server declares that a call must be put to a person",
|
|
369
|
+
"cross_boundary": "this run executes on a device outside the deployment's trust boundary and the deployment is multi-tenant, so an org-side write — or, after an off-target read, a call bound for the device — is confirmed by the deployment's approver for this call: no standing allow rule and no automatic lane answers for it, and an allow the configuration gives (a blanket seat or a policy's answer) is refused",
|
|
370
|
+
"operator_forced": "this call arrived already marked as requiring confirmation (an earlier layer of this run, or the task that delegated it, judged it so) — it is cleared by confirming this call, never by a standing allow rule",
|
|
371
|
+
"shell_floor": "this deployment mandates per-call confirmation for shell commands (shellGate: always)",
|
|
372
|
+
"target_unresolved": "where this write leads on disk could not be determined (a link on the way could not be examined, or the environment could not resolve the target), so whether it lands on a guarded path is unknown — it is cleared by confirming this call: no standing rule and no automatic decider answers for it, though a wired approver seat can",
|
|
373
|
+
"write_protection": "this write's target is on the deployment's write-protection table (the agent's own configuration is guarded one look per write) — it is cleared by confirming this call, never by a standing allow rule",
|
|
374
|
+
"tool_marks_mcp": "this tool carries egress/irreversibility/interaction marks (a mandated confirmation a rule cannot clear)",
|
|
375
|
+
"tool_marks_a2a": "this tool carries egress/irreversibility/interaction marks (a mandated confirmation a rule cannot clear)",
|
|
376
|
+
"policy_rra": "the deployment's policy requires a real approval for this call",
|
|
377
|
+
"artifact_shared_read": "this read targets another task's shared artifact — it is cleared by confirming this call",
|
|
378
|
+
"mode": "the permission mode puts this question to a person",
|
|
379
|
+
"unstated": "this call arrived already marked as requiring confirmation (an earlier layer of this run, or the task that delegated it, judged it so) — it is cleared by confirming this call, never by a standing allow rule",
|
|
380
|
+
"ordinary": "this call arrived already marked as requiring confirmation (an earlier layer of this run, or the task that delegated it, judged it so) — it is cleared by confirming this call, never by a standing allow rule",
|
|
381
|
+
});
|
|
330
382
|
export const CORE_USER_ATTACHMENT_KINDS = Object.freeze([
|
|
331
383
|
"text",
|
|
332
384
|
"notebook",
|
|
@@ -26,6 +26,8 @@ export const CORE_ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
26
26
|
"config.peer_lane_unmounted",
|
|
27
27
|
"config.secret_env_scrubbed",
|
|
28
28
|
"config.credential_not_withheld",
|
|
29
|
+
"config.cross_boundary_posture_undeclared",
|
|
30
|
+
"config.cross_boundary_record_unwritten",
|
|
29
31
|
"config.permission_mode_unavailable",
|
|
30
32
|
"permission.ask_released_by_mode",
|
|
31
33
|
"permission.read_deny_unapplied",
|
|
@@ -67,6 +69,8 @@ export const CORE_ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
67
69
|
"memory.project_scope_absent",
|
|
68
70
|
"route.fallback_to_primary",
|
|
69
71
|
"route.classifier_unroutable",
|
|
72
|
+
"route.seat_detached",
|
|
73
|
+
"advisor.not_attached",
|
|
70
74
|
"route.credential_origin_mismatch",
|
|
71
75
|
"route.response_model_mismatch",
|
|
72
76
|
"route.tool_call_id_folded",
|
|
@@ -124,6 +128,8 @@ export const CORE_NOTICE_AUDIENCE = Object.freeze({
|
|
|
124
128
|
"config.peer_lane_unmounted": "operator",
|
|
125
129
|
"config.secret_env_scrubbed": "operator",
|
|
126
130
|
"config.credential_not_withheld": "operator",
|
|
131
|
+
"config.cross_boundary_posture_undeclared": "operator",
|
|
132
|
+
"config.cross_boundary_record_unwritten": "operator",
|
|
127
133
|
"config.permission_mode_unavailable": "user",
|
|
128
134
|
"permission.ask_released_by_mode": "user",
|
|
129
135
|
"permission.read_deny_unapplied": "user",
|
|
@@ -165,6 +171,8 @@ export const CORE_NOTICE_AUDIENCE = Object.freeze({
|
|
|
165
171
|
"memory.project_scope_absent": "operator",
|
|
166
172
|
"route.fallback_to_primary": "operator",
|
|
167
173
|
"route.classifier_unroutable": "operator",
|
|
174
|
+
"route.seat_detached": "operator",
|
|
175
|
+
"advisor.not_attached": "user",
|
|
168
176
|
"route.credential_origin_mismatch": "user",
|
|
169
177
|
"route.response_model_mismatch": "operator",
|
|
170
178
|
"route.tool_call_id_folded": "operator",
|
|
@@ -228,6 +236,8 @@ export const CORE_NOTICE_MINTER = Object.freeze({
|
|
|
228
236
|
"config.peer_lane_unmounted": "engine",
|
|
229
237
|
"config.secret_env_scrubbed": "engine",
|
|
230
238
|
"config.credential_not_withheld": "engine",
|
|
239
|
+
"config.cross_boundary_posture_undeclared": "engine",
|
|
240
|
+
"config.cross_boundary_record_unwritten": "engine",
|
|
231
241
|
"config.permission_mode_unavailable": "engine",
|
|
232
242
|
"permission.ask_released_by_mode": "engine",
|
|
233
243
|
"permission.read_deny_unapplied": "engine",
|
|
@@ -269,6 +279,8 @@ export const CORE_NOTICE_MINTER = Object.freeze({
|
|
|
269
279
|
"memory.project_scope_absent": "engine",
|
|
270
280
|
"route.fallback_to_primary": "engine",
|
|
271
281
|
"route.classifier_unroutable": "engine",
|
|
282
|
+
"route.seat_detached": "engine",
|
|
283
|
+
"advisor.not_attached": "engine",
|
|
272
284
|
"route.credential_origin_mismatch": "engine",
|
|
273
285
|
"route.response_model_mismatch": "engine",
|
|
274
286
|
"route.tool_call_id_folded": "engine",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SETTINGS_ACTIVE_TIERS_CLOSURE: () => any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const SETTINGS_ACTIVE_TIERS_CLOSURE = () => {
|
|
2
|
+
function resolveActiveTiers(models) {
|
|
3
|
+
if (!models.activeTierGroup)
|
|
4
|
+
return undefined;
|
|
5
|
+
const group = (models.tierGroups ?? []).find((g) => g.name === models.activeTierGroup);
|
|
6
|
+
if (!group)
|
|
7
|
+
return undefined;
|
|
8
|
+
const bound = Object.entries(group.tiers).filter((e) => typeof e[1] === "string" && e[1].length > 0);
|
|
9
|
+
if (bound.length === 0)
|
|
10
|
+
return undefined;
|
|
11
|
+
return Object.fromEntries(bound);
|
|
12
|
+
}
|
|
13
|
+
return { resolveActiveTiers };
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SETTINGS_CALLER_TEXT_ECHO_CLOSURE: (stripControlAndBidi: (text: string) => string) => any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const SETTINGS_CALLER_TEXT_ECHO_CLOSURE = (stripControlAndBidi) => {
|
|
2
|
+
const CALLER_TEXT_ECHO_MAX_CHARS = 64;
|
|
3
|
+
function echoCallerText(text) {
|
|
4
|
+
const clean = stripControlAndBidi(text);
|
|
5
|
+
return clean.length > CALLER_TEXT_ECHO_MAX_CHARS ? `${clean.slice(0, CALLER_TEXT_ECHO_MAX_CHARS)}…` : clean;
|
|
6
|
+
}
|
|
7
|
+
return { echoCallerText };
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SETTINGS_CONTROL_AND_BIDI_CLOSURE: () => any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const SETTINGS_CONTROL_AND_BIDI_CLOSURE = () => {
|
|
2
|
+
const CONTROL_AND_BIDI_CHARS = "\\u0000-\\u001f\\u007f\\u061c\\u200e\\u200f\\u202a-\\u202e\\u2066-\\u2069";
|
|
3
|
+
const STRIP_RE = new RegExp(`[${CONTROL_AND_BIDI_CHARS}]`, "g");
|
|
4
|
+
function stripControlAndBidi(text) {
|
|
5
|
+
return text.replace(STRIP_RE, "");
|
|
6
|
+
}
|
|
7
|
+
return { stripControlAndBidi, CONTROL_AND_BIDI_CHARS };
|
|
8
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const SETTINGS_DEFAULT_MODEL_CLOSURE: (resolveActiveTiers: (models: {
|
|
2
|
+
readonly tierGroups?: readonly {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly tiers?: {
|
|
5
|
+
readonly [tier: string]: string | undefined;
|
|
6
|
+
} | undefined;
|
|
7
|
+
}[] | undefined;
|
|
8
|
+
readonly activeTierGroup?: string | undefined;
|
|
9
|
+
}) => {
|
|
10
|
+
[tier: string]: string;
|
|
11
|
+
} | undefined) => any;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const SETTINGS_DEFAULT_MODEL_CLOSURE = (resolveActiveTiers) => {
|
|
2
|
+
const DEFAULT_ROLE_TIER_LADDER = ["pro", "flash", "lite"];
|
|
3
|
+
function resolveCatalogDefaultModel(models, has, fallback) {
|
|
4
|
+
const target = models.roles?.default;
|
|
5
|
+
const named = target !== undefined && "model" in target ? target.model : undefined;
|
|
6
|
+
const select = target !== undefined && "select" in target ? target.select : undefined;
|
|
7
|
+
if (!named && select)
|
|
8
|
+
return { kind: "select", select };
|
|
9
|
+
const tiers = resolveActiveTiers(models) ?? {};
|
|
10
|
+
const candidates = [
|
|
11
|
+
{ source: "roles.default", name: named },
|
|
12
|
+
...DEFAULT_ROLE_TIER_LADDER.map((t) => ({ source: `tierGroup.${t}`, name: tiers[t] })),
|
|
13
|
+
];
|
|
14
|
+
const dangling = [];
|
|
15
|
+
for (const c of candidates) {
|
|
16
|
+
if (c.name === undefined || c.name === "")
|
|
17
|
+
continue;
|
|
18
|
+
if (has(c.name))
|
|
19
|
+
return { kind: "named", name: c.name, source: c.source, dangling };
|
|
20
|
+
dangling.push({ source: c.source, name: c.name });
|
|
21
|
+
}
|
|
22
|
+
return { kind: "named", name: fallback, source: "fallback", dangling };
|
|
23
|
+
}
|
|
24
|
+
return { resolveCatalogDefaultModel, DEFAULT_ROLE_TIER_LADDER };
|
|
25
|
+
};
|
|
@@ -19,6 +19,9 @@ export declare const SETTINGS_HOOKS_CLASSIFICATION_OUTCOMES: readonly ["loaded",
|
|
|
19
19
|
export declare const SETTINGS_HOOKS_DROPPED_PIECE_CODES: readonly ["hooks-not-object", "unknown-event", "event-not-array", "matcher-invalid", "entry-invalid"];
|
|
20
20
|
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"];
|
|
21
21
|
export declare const SETTINGS_CLASSIFY_HOOKS_CONFIG: (settingsDoc: unknown) => HooksClassification;
|
|
22
|
+
export declare const SETTINGS_STRIP_CONTROL_AND_BIDI: (text: string) => string;
|
|
23
|
+
export declare const SETTINGS_CONTROL_AND_BIDI_CHARS: string;
|
|
24
|
+
export declare const SETTINGS_ECHO_CALLER_TEXT: (text: string) => string;
|
|
22
25
|
export declare const SETTINGS_READ_REQUEST_MCP_TRANSPORT: (t: unknown) => RequestMcpTransportRead;
|
|
23
26
|
export declare const SETTINGS_READ_MCP_IDENTITY_HEADERS: (transport: Record<string, unknown>) => {
|
|
24
27
|
principalHeader?: string;
|
|
@@ -29,3 +32,54 @@ export declare const SETTINGS_DESCRIBE_BAD_WIRE_NAME: (v: unknown) => string;
|
|
|
29
32
|
export declare const SETTINGS_IS_CONTENT_ORIGIN_WORD: (v: unknown) => v is McpContentOrigin;
|
|
30
33
|
export declare const SETTINGS_DESCRIBE_BAD_CONTENT_ORIGIN: (v: unknown) => string;
|
|
31
34
|
export declare const SETTINGS_TOOL_WIRE_NAME_MAX_CHARS: 128;
|
|
35
|
+
export declare const SETTINGS_URL_ALLOW_PATTERN_MATCHES: (url: string, pattern: string) => boolean;
|
|
36
|
+
export declare const SETTINGS_IS_AT_LEAST: (layer: string, minTrust: string) => boolean;
|
|
37
|
+
export declare const SETTINGS_MEMBER_ADMISSION: (category: string, member: string) => object;
|
|
38
|
+
export declare const SETTINGS_SAFETY_MERGE_SPEC: object;
|
|
39
|
+
export declare const SETTINGS_LAYER_ADMISSION: (source: string, workspace: string, category: string, member?: string) => string;
|
|
40
|
+
export declare const SETTINGS_RESOLVE_ACTIVE_TIERS: (models: {
|
|
41
|
+
readonly tierGroups?: readonly {
|
|
42
|
+
readonly name: string;
|
|
43
|
+
readonly tiers?: {
|
|
44
|
+
readonly [tier: string]: string | undefined;
|
|
45
|
+
} | undefined;
|
|
46
|
+
}[] | undefined;
|
|
47
|
+
readonly activeTierGroup?: string | undefined;
|
|
48
|
+
}) => {
|
|
49
|
+
[tier: string]: string;
|
|
50
|
+
} | undefined;
|
|
51
|
+
export declare const SETTINGS_RESOLVE_CATALOG_DEFAULT_MODEL: (models: {
|
|
52
|
+
readonly roles?: {
|
|
53
|
+
readonly default?: {
|
|
54
|
+
readonly model?: string | undefined;
|
|
55
|
+
readonly select?: {
|
|
56
|
+
readonly tier?: string | undefined;
|
|
57
|
+
readonly needs?: readonly string[] | undefined;
|
|
58
|
+
readonly prefer?: string | undefined;
|
|
59
|
+
} | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
} | undefined;
|
|
62
|
+
readonly tierGroups?: readonly {
|
|
63
|
+
readonly name: string;
|
|
64
|
+
readonly tiers?: {
|
|
65
|
+
readonly [tier: string]: string | undefined;
|
|
66
|
+
} | undefined;
|
|
67
|
+
}[] | undefined;
|
|
68
|
+
readonly activeTierGroup?: string | undefined;
|
|
69
|
+
}, has: (name: string) => boolean, fallback: string) => {
|
|
70
|
+
readonly kind: "named";
|
|
71
|
+
readonly name: string;
|
|
72
|
+
readonly source: string;
|
|
73
|
+
readonly dangling: readonly {
|
|
74
|
+
readonly source: string;
|
|
75
|
+
readonly name: string;
|
|
76
|
+
}[];
|
|
77
|
+
} | {
|
|
78
|
+
readonly kind: "select";
|
|
79
|
+
readonly select: {
|
|
80
|
+
readonly tier?: string | undefined;
|
|
81
|
+
readonly needs?: readonly string[] | undefined;
|
|
82
|
+
readonly prefer?: string | undefined;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export declare const SETTINGS_DEFAULT_ROLE_TIER_LADDER: readonly ["pro", "flash", "lite"];
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { SETTINGS_CLASSIFY_HOOKS_CONFIG_CLOSURE } from './settingsSchemaHooksClassifier.js';
|
|
2
|
+
import { SETTINGS_CONTROL_AND_BIDI_CLOSURE } from './settingsSchemaControlAndBidi.js';
|
|
3
|
+
import { SETTINGS_CALLER_TEXT_ECHO_CLOSURE } from './settingsSchemaCallerTextEcho.js';
|
|
2
4
|
import { SETTINGS_MCP_REQUEST_ENTRY_CLOSURE } from './settingsSchemaMcpRequestEntry.js';
|
|
3
5
|
import { SETTINGS_MCP_CONTENT_ORIGINS } from './settingsSchemaTables.js';
|
|
6
|
+
import { SETTINGS_URL_ALLOW_PATTERN_MATCHES_CLOSURE } from './settingsSchemaUrlPattern.js';
|
|
7
|
+
import { SETTINGS_SAFETY_MERGE_CLOSURE } from './settingsSchemaSafetyMergeSpec.js';
|
|
8
|
+
import { SETTINGS_MIN_TRUST_WORDS } from './settingsSchemaTables.js';
|
|
9
|
+
import { SETTINGS_LAYER_SOURCES_CLOSURE } from './settingsSchemaSettingsSources.js';
|
|
10
|
+
import { SETTINGS_ACTIVE_TIERS_CLOSURE } from './settingsSchemaActiveTiers.js';
|
|
11
|
+
import { SETTINGS_DEFAULT_MODEL_CLOSURE } from './settingsSchemaDefaultModel.js';
|
|
4
12
|
export const SETTINGS_AT_MENTION_MODES = Object.freeze([
|
|
5
13
|
"all",
|
|
6
14
|
"none",
|
|
@@ -135,7 +143,12 @@ export const SETTINGS_HOOKS_REJECTION_CODES = Object.freeze([
|
|
|
135
143
|
"guard-entry-invalid",
|
|
136
144
|
]);
|
|
137
145
|
export const SETTINGS_CLASSIFY_HOOKS_CONFIG = SETTINGS_CLASSIFY_HOOKS_CONFIG_CLOSURE(SETTINGS_HOOK_EVENTS);
|
|
138
|
-
const
|
|
146
|
+
const SETTINGS_CONTROL_AND_BIDI = SETTINGS_CONTROL_AND_BIDI_CLOSURE();
|
|
147
|
+
export const SETTINGS_STRIP_CONTROL_AND_BIDI = SETTINGS_CONTROL_AND_BIDI.stripControlAndBidi;
|
|
148
|
+
export const SETTINGS_CONTROL_AND_BIDI_CHARS = SETTINGS_CONTROL_AND_BIDI.CONTROL_AND_BIDI_CHARS;
|
|
149
|
+
const SETTINGS_CALLER_TEXT_ECHO = SETTINGS_CALLER_TEXT_ECHO_CLOSURE(SETTINGS_STRIP_CONTROL_AND_BIDI);
|
|
150
|
+
export const SETTINGS_ECHO_CALLER_TEXT = SETTINGS_CALLER_TEXT_ECHO.echoCallerText;
|
|
151
|
+
const SETTINGS_MCP_REQUEST_ENTRY = SETTINGS_MCP_REQUEST_ENTRY_CLOSURE(SETTINGS_MCP_CONTENT_ORIGINS, SETTINGS_STARTS_WITH_HTTP_SCHEME, SETTINGS_ECHO_CALLER_TEXT);
|
|
139
152
|
export const SETTINGS_READ_REQUEST_MCP_TRANSPORT = SETTINGS_MCP_REQUEST_ENTRY.readRequestMcpTransport;
|
|
140
153
|
export const SETTINGS_READ_MCP_IDENTITY_HEADERS = SETTINGS_MCP_REQUEST_ENTRY.readMcpIdentityHeaders;
|
|
141
154
|
export const SETTINGS_IS_USABLE_WIRE_NAME = SETTINGS_MCP_REQUEST_ENTRY.isUsableWireName;
|
|
@@ -143,3 +156,15 @@ export const SETTINGS_DESCRIBE_BAD_WIRE_NAME = SETTINGS_MCP_REQUEST_ENTRY.descri
|
|
|
143
156
|
export const SETTINGS_IS_CONTENT_ORIGIN_WORD = SETTINGS_MCP_REQUEST_ENTRY.isContentOriginWord;
|
|
144
157
|
export const SETTINGS_DESCRIBE_BAD_CONTENT_ORIGIN = SETTINGS_MCP_REQUEST_ENTRY.describeBadContentOrigin;
|
|
145
158
|
export const SETTINGS_TOOL_WIRE_NAME_MAX_CHARS = SETTINGS_MCP_REQUEST_ENTRY.TOOL_WIRE_NAME_MAX_CHARS;
|
|
159
|
+
export const SETTINGS_URL_ALLOW_PATTERN_MATCHES = SETTINGS_URL_ALLOW_PATTERN_MATCHES_CLOSURE();
|
|
160
|
+
const SETTINGS_SAFETY_MERGE = SETTINGS_SAFETY_MERGE_CLOSURE(SETTINGS_MIN_TRUST_WORDS);
|
|
161
|
+
export const SETTINGS_IS_AT_LEAST = SETTINGS_SAFETY_MERGE.isAtLeast;
|
|
162
|
+
export const SETTINGS_MEMBER_ADMISSION = SETTINGS_SAFETY_MERGE.memberAdmission;
|
|
163
|
+
export const SETTINGS_SAFETY_MERGE_SPEC = SETTINGS_SAFETY_MERGE.SAFETY_MERGE_SPEC;
|
|
164
|
+
const SETTINGS_LAYER_SOURCES = SETTINGS_LAYER_SOURCES_CLOSURE(SETTINGS_SAFETY_MERGE_SPEC, SETTINGS_IS_AT_LEAST, SETTINGS_MEMBER_ADMISSION);
|
|
165
|
+
export const SETTINGS_LAYER_ADMISSION = SETTINGS_LAYER_SOURCES.layerAdmission;
|
|
166
|
+
const SETTINGS_ACTIVE_TIERS = SETTINGS_ACTIVE_TIERS_CLOSURE();
|
|
167
|
+
export const SETTINGS_RESOLVE_ACTIVE_TIERS = SETTINGS_ACTIVE_TIERS.resolveActiveTiers;
|
|
168
|
+
const SETTINGS_DEFAULT_MODEL = SETTINGS_DEFAULT_MODEL_CLOSURE(SETTINGS_RESOLVE_ACTIVE_TIERS);
|
|
169
|
+
export const SETTINGS_RESOLVE_CATALOG_DEFAULT_MODEL = SETTINGS_DEFAULT_MODEL.resolveCatalogDefaultModel;
|
|
170
|
+
export const SETTINGS_DEFAULT_ROLE_TIER_LADDER = SETTINGS_DEFAULT_MODEL.DEFAULT_ROLE_TIER_LADDER;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SETTINGS_MCP_REQUEST_ENTRY_CLOSURE: (MCP_CONTENT_ORIGINS: readonly ["local", "execution", "external"], startsWithHttpScheme: (raw: string) => boolean) => any;
|
|
1
|
+
export declare const SETTINGS_MCP_REQUEST_ENTRY_CLOSURE: (MCP_CONTENT_ORIGINS: readonly ["local", "execution", "external"], startsWithHttpScheme: (raw: string) => boolean, echoCallerText: (text: string) => string) => any;
|