@sema-agent/client-core 0.100.0 → 0.102.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 +452 -0
- package/README.md +172 -120
- package/dist/adapt/arms.js +51 -16
- package/dist/adapt/textStream.js +7 -4
- package/dist/adapt/toolCards.d.ts +2 -1
- package/dist/adapt/toolCards.js +28 -13
- package/dist/adapt.d.ts +1 -1
- package/dist/adapt.js +8 -2
- package/dist/adapter/activeRunSelfHeal.d.ts +24 -2
- package/dist/adapter/activeRunSelfHeal.js +108 -6
- package/dist/adapter/downstream/eventToSdkMessage.js +38 -79
- package/dist/adapter/downstream/terminalToSdkResult.d.ts +60 -1
- package/dist/adapter/downstream/terminalToSdkResult.js +209 -39
- package/dist/adapter/downstream/wiringManifestView.d.ts +1 -0
- package/dist/adapter/downstream/wiringManifestView.js +138 -0
- 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/compensations.js +1 -1
- 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 +9 -4
- package/dist/displayUntrusted.js +834 -104
- 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 +4 -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 +16 -3
- 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 +222 -2
- package/dist/i18n/messages.en.js +225 -5
- package/dist/i18n/messages.zh.js +237 -5
- package/dist/i18n/translate.js +3 -3
- package/dist/index.d.ts +77 -15
- package/dist/index.js +50 -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/interactiveHalt.d.ts +3 -1
- package/dist/interactiveHalt.js +2 -0
- package/dist/interactiveInterrupt.d.ts +2 -0
- package/dist/interactiveInterrupt.js +15 -0
- 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/modsFace.d.ts +8 -0
- package/dist/modsFace.js +59 -0
- 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 +12 -0
- package/dist/ownKey.js +179 -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/printToolResultFrame.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 +6 -2
- package/dist/request/submissionIdentity.d.ts +37 -0
- package/dist/request/submissionIdentity.js +65 -0
- package/dist/request/taskRequest.d.ts +33 -4
- package/dist/request/taskRequest.js +341 -156
- 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 +3 -3
- package/dist/seatContract.d.ts +68 -7
- package/dist/seatContract.js +84 -25
- package/dist/selfOrchestrationDenial.js +1 -1
- package/dist/sessionBackground.d.ts +165 -0
- package/dist/sessionBackground.js +781 -0
- package/dist/sessionBackgroundHandoff.d.ts +54 -0
- package/dist/sessionBackgroundHandoff.js +321 -0
- package/dist/sessionMap.js +4 -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 +55 -15
- 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/thinkingLatch.d.ts +69 -0
- package/dist/thinkingLatch.js +255 -0
- package/dist/thinkingLatchWords.d.ts +7 -0
- package/dist/thinkingLatchWords.js +4 -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 +159 -32
- 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 +907 -182
- package/package.json +14 -3
- package/dist/argvFlagValue.d.ts +0 -8
- package/dist/argvFlagValue.js +0 -37
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { hostEnv } from './hostEnv.js';
|
|
2
2
|
import { envFlagOff } from './envFlag.js';
|
|
3
3
|
import { retiredAttachmentsKeyOf } from './taskRequestWords.js';
|
|
4
|
+
import { looksLikeKnownSecret, REDACTION_MARKER_PREFIX } from './displayUntrusted.js';
|
|
5
|
+
import { msg, renderMessage } from './i18n/translate.js';
|
|
4
6
|
export const ATTACHMENTS_ENV = 'SEMA_ATTACHMENTS';
|
|
5
7
|
export const ATTACHMENTS_SPEC_KEYS = Object.freeze([
|
|
6
8
|
'todoReminder',
|
|
@@ -57,20 +59,38 @@ function refuse(token, why) {
|
|
|
57
59
|
function deny(kind, token, why, index, key) {
|
|
58
60
|
return { ok: false, refusal: { kind, token, why, entry: index + 1, key } };
|
|
59
61
|
}
|
|
60
|
-
|
|
62
|
+
const CREDENTIAL_TOKEN_PLACEHOLDER = `${REDACTION_MARKER_PREFIX}:secret\u00bb`;
|
|
63
|
+
function credentialShapedWord(original) {
|
|
64
|
+
if (original === undefined || original.length === 0)
|
|
65
|
+
return false;
|
|
66
|
+
try {
|
|
67
|
+
const bare = original.replace(/^[+-]+/, '');
|
|
68
|
+
const eq = bare.indexOf('=');
|
|
69
|
+
return looksLikeKnownSecret(original) || looksLikeKnownSecret(bare) || (eq >= 0 && looksLikeKnownSecret(bare.slice(eq + 1)));
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function judgeAttachmentsEnv(raw, original = raw) {
|
|
61
76
|
if (envFlagOff(raw))
|
|
62
77
|
return { ok: true, spec: allDefaultOnOff() };
|
|
63
78
|
const tokens = raw.split(',').map(t => t.trim()).filter(t => t.length > 0);
|
|
79
|
+
const originals = original.split(',').map(t => t.trim()).filter(t => t.length > 0);
|
|
80
|
+
const denyAt = (kind, token, why, index, key) => deny(kind, credentialShapedWord(originals[index]) ? CREDENTIAL_TOKEN_PLACEHOLDER : token, why, index, key);
|
|
64
81
|
for (const [i, token] of tokens.entries()) {
|
|
65
82
|
const named = retiredAttachmentsKeyOf(token);
|
|
66
83
|
if (named !== undefined)
|
|
67
|
-
return { ok: false, refusal: { kind: 'retired_key', token, why: named.why, entry: i + 1, key: named.key, retired: named } };
|
|
84
|
+
return { ok: false, refusal: { kind: 'retired_key', token: credentialShapedWord(originals[i]) ? CREDENTIAL_TOKEN_PLACEHOLDER : token, why: named.why, entry: i + 1, key: named.key, retired: named } };
|
|
68
85
|
}
|
|
69
86
|
if (tokens.length === 0)
|
|
70
87
|
return { ok: true, spec: productDefaultAttachments() };
|
|
71
88
|
if (tokens.length === 1 && (tokens[0] === 'full' || tokens[0] === 'all'))
|
|
72
89
|
return { ok: true, spec: allLiteralTrue() };
|
|
73
90
|
if (tokens.length === 1 && !isKnownToken(tokens[0])) {
|
|
91
|
+
if (credentialShapedWord(originals[0])) {
|
|
92
|
+
return deny('credential_shaped_word', CREDENTIAL_TOKEN_PLACEHOLDER, 'the value looks like a credential, not an attachments list', 0, undefined);
|
|
93
|
+
}
|
|
74
94
|
return { ok: true, spec: productDefaultAttachments() };
|
|
75
95
|
}
|
|
76
96
|
const spec = {};
|
|
@@ -86,9 +106,9 @@ function judgeAttachmentsEnv(raw) {
|
|
|
86
106
|
if (token.startsWith('-')) {
|
|
87
107
|
const key = canonicalKey(token.slice(1));
|
|
88
108
|
if (key === undefined)
|
|
89
|
-
return
|
|
109
|
+
return denyAt('unknown_key', token, 'unknown attachments key', i, undefined);
|
|
90
110
|
if (!isDefaultOnKey(key)) {
|
|
91
|
-
return
|
|
111
|
+
return denyAt('minus_on_literal_true_key', token, `"${key}" belongs to the literal-true family whose OFF is "delete the key", not "send false" ` +
|
|
92
112
|
'(core wire contract, board [479] ask-2) — simply do not turn it on. ' +
|
|
93
113
|
`Only the core DEFAULT-ON keys (${ATTACHMENTS_DEFAULT_ON_KEYS.join(' / ')}) accept an explicit false`, i, key);
|
|
94
114
|
}
|
|
@@ -98,34 +118,39 @@ function judgeAttachmentsEnv(raw) {
|
|
|
98
118
|
const [lhs, rhs] = splitAssign(token);
|
|
99
119
|
if (rhs !== undefined) {
|
|
100
120
|
if (canonicalKey(lhs) !== 'todoReminderMode')
|
|
101
|
-
return
|
|
121
|
+
return denyAt('value_form_on_other_key', token, 'only `todoReminderMode` takes a `key=value` form', i, canonicalKey(lhs));
|
|
102
122
|
const mode = TODO_REMINDER_MODES.find(v => v === rhs);
|
|
103
123
|
if (mode === undefined)
|
|
104
|
-
return
|
|
124
|
+
return denyAt('todo_mode_bad_value', token, `todoReminderMode must be one of ${TODO_REMINDER_MODES.join('|')}`, i, 'todoReminderMode');
|
|
105
125
|
spec.todoReminderMode = mode;
|
|
106
126
|
continue;
|
|
107
127
|
}
|
|
108
128
|
const key = canonicalKey(lhs.startsWith('+') ? lhs.slice(1) : lhs);
|
|
109
129
|
if (key === undefined)
|
|
110
|
-
return
|
|
130
|
+
return denyAt('unknown_key', token, 'unknown attachments key', i, undefined);
|
|
111
131
|
if (isDefaultOnOnlyKey(key)) {
|
|
112
|
-
return
|
|
132
|
+
return denyAt('plus_on_default_on_key', token, `"${key}" is core DEFAULT-ON — turning it "on" is a no-op that would send a redundant true; ` + `use "-${key}" to turn it OFF`, i, key);
|
|
113
133
|
}
|
|
114
134
|
if (key === 'todoReminderMode')
|
|
115
|
-
return
|
|
135
|
+
return denyAt('todo_mode_needs_value', token, 'todoReminderMode needs a value: `todoReminderMode=baseline|off`', i, key);
|
|
116
136
|
spec[key] = true;
|
|
117
137
|
}
|
|
118
138
|
return { ok: true, spec };
|
|
119
139
|
}
|
|
120
|
-
function
|
|
121
|
-
|
|
140
|
+
function envTextOf(env) {
|
|
141
|
+
const original = (env[ATTACHMENTS_ENV] ?? '').trim();
|
|
142
|
+
return { lower: original.toLowerCase(), original };
|
|
122
143
|
}
|
|
123
144
|
export function attachmentsForRequest(env = hostEnv()) {
|
|
124
|
-
const
|
|
145
|
+
const text = envTextOf(env);
|
|
146
|
+
const judged = judgeAttachmentsEnv(text.lower, text.original);
|
|
125
147
|
if (!judged.ok)
|
|
126
148
|
return refuse(judged.refusal.token, judged.refusal.why);
|
|
127
149
|
return judged.spec;
|
|
128
150
|
}
|
|
151
|
+
function headWithCatalogLine(head, catalogLine) {
|
|
152
|
+
return `${head} ${catalogLine} ${attachmentsWayOut()}`;
|
|
153
|
+
}
|
|
129
154
|
function attachmentsWayOut() {
|
|
130
155
|
const on = OPT_IN_KEYS.join(', ');
|
|
131
156
|
const off = ATTACHMENTS_DEFAULT_ON_KEYS.join(', ');
|
|
@@ -141,6 +166,8 @@ function attachmentsRefusalSentence(r) {
|
|
|
141
166
|
return `${head} names "${key}", a key that no longer exists — ${r.retired?.because ?? 'it was retired'}, and a request carrying that key is refused by the server. Remove that entry${r.retired === undefined ? '' : `; ${r.retired.remedy}`}. ${attachmentsWayOut()}`;
|
|
142
167
|
case 'unknown_key':
|
|
143
168
|
return `${head} is not an attachment this version knows. ${attachmentsWayOut()}`;
|
|
169
|
+
case 'credential_shaped_word':
|
|
170
|
+
return headWithCatalogLine(head, renderMessage(msg('config.attachments.refusal.credentialShapedWord')));
|
|
144
171
|
case 'minus_on_literal_true_key':
|
|
145
172
|
return key === 'todoReminderMode'
|
|
146
173
|
? `${head} puts a minus on todoReminderMode, which is a setting with a value rather than something to turn off — write todoReminderMode=${TODO_REMINDER_MODES.join(' or todoReminderMode=')}, or leave it out of the list. A minus only works on ${ATTACHMENTS_DEFAULT_ON_KEYS.join(', ')}, which are on by default. ${attachmentsWayOut()}`
|
|
@@ -160,7 +187,8 @@ function attachmentsUnreadableSentence() {
|
|
|
160
187
|
}
|
|
161
188
|
export function attachmentsSubmitVerdict(env = hostEnv()) {
|
|
162
189
|
try {
|
|
163
|
-
const
|
|
190
|
+
const text = envTextOf(env);
|
|
191
|
+
const judged = judgeAttachmentsEnv(text.lower, text.original);
|
|
164
192
|
if (judged.ok)
|
|
165
193
|
return { ok: true, attachments: judged.spec };
|
|
166
194
|
return { ok: false, sentence: attachmentsRefusalSentence(judged.refusal), refusedKey: judged.refusal.key };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { engineWireTargetBaseUrl } from './engineWireTarget.js';
|
|
2
2
|
import { createEngineCapReader } from './engineCapReader.js';
|
|
3
3
|
import { ownDataField, readOwnDataValue } from './ownKey.js';
|
|
4
4
|
export function projectCallerCwdCapability(caps) {
|
|
@@ -18,7 +18,7 @@ const reader = createEngineCapReader({
|
|
|
18
18
|
name: 'callerCwd',
|
|
19
19
|
project: projectCallerCwdCapability,
|
|
20
20
|
});
|
|
21
|
-
export function observedCallerCwd(baseUrl =
|
|
21
|
+
export function observedCallerCwd(baseUrl = engineWireTargetBaseUrl()) {
|
|
22
22
|
return reader.observed(baseUrl);
|
|
23
23
|
}
|
|
24
24
|
export function callerCwdAdmitted(reading) {
|
|
@@ -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
|
const nonEmpty = (v) => typeof v === 'string' && v !== '';
|
|
@@ -95,7 +95,7 @@ const reader = createEngineCapReader({
|
|
|
95
95
|
name: 'centerWiring',
|
|
96
96
|
project: projectCenterWiringForCache,
|
|
97
97
|
});
|
|
98
|
-
export function observedCenterWiring(baseUrl =
|
|
98
|
+
export function observedCenterWiring(baseUrl = engineWireTargetBaseUrl()) {
|
|
99
99
|
return reader.observed(baseUrl);
|
|
100
100
|
}
|
|
101
101
|
function guarded(reading) {
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import type { SkillSpec } from '@sema-agent/sdk';
|
|
2
2
|
import type { McpServerSpec } from './mcpWireCaps.js';
|
|
3
3
|
import type { EnvLike } from './hostEnv.js';
|
|
4
|
+
import type { SkillToolListsReading } from './skillToolListsCapability.js';
|
|
4
5
|
import type { McpEntryKeyIssue } from './generated/settingsSchemaTypes.js';
|
|
5
6
|
export type { McpServerSpec };
|
|
6
7
|
type Rec = Record<string, unknown>;
|
|
7
8
|
export type { EnvLike };
|
|
8
|
-
export type CloudMcpDropReason = 'disabled' | 'missing-field' | 'unknown-transport' | 'principal-and-assertion-header' | 'tool-axes-invalid' | 'elicitation-invalid' | 'name-unusable' | 'transport-invalid';
|
|
9
|
+
export type CloudMcpDropReason = 'disabled' | 'missing-field' | 'unknown-transport' | 'principal-and-assertion-header' | 'tool-axes-invalid' | 'tool-faces-invalid' | 'elicitation-invalid' | 'allow-tools-invalid' | 'entry-unreadable' | 'name-unusable' | 'transport-invalid';
|
|
9
10
|
export interface CloudMcpDroppedServer {
|
|
10
11
|
name?: string;
|
|
11
12
|
reason: CloudMcpDropReason;
|
|
12
13
|
path?: string;
|
|
14
|
+
problem?: string;
|
|
13
15
|
}
|
|
14
16
|
export interface CloudMcpDegradedServer {
|
|
15
17
|
name: string;
|
|
@@ -22,7 +24,16 @@ export interface CloudMcpProjection {
|
|
|
22
24
|
degradedServers: CloudMcpDegradedServer[];
|
|
23
25
|
}
|
|
24
26
|
export declare function cloudMcpToSpecs(servers: unknown, env: EnvLike): CloudMcpProjection;
|
|
25
|
-
export
|
|
27
|
+
export interface CloudSkillsOptions {
|
|
28
|
+
readonly skillToolLists?: SkillToolListsReading;
|
|
29
|
+
}
|
|
30
|
+
export type CloudSkillDropReason = 'tool-list-invalid';
|
|
31
|
+
export interface CloudSkillDropped {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly reason: CloudSkillDropReason;
|
|
34
|
+
readonly path: string;
|
|
35
|
+
}
|
|
36
|
+
export declare function cloudSkillsToSpecs(manifestSkills: unknown, resolveBody: (contentHash: string) => string | null, opts?: CloudSkillsOptions): SkillSpec[];
|
|
26
37
|
export interface CloudModelRefIssue {
|
|
27
38
|
readonly key: 'models' | 'roles' | 'atMention' | 'tierGroups' | 'activeTierGroup';
|
|
28
39
|
readonly at?: string;
|
|
@@ -117,6 +128,7 @@ export interface CloudProjection {
|
|
|
117
128
|
missingEnv: string[];
|
|
118
129
|
scope: string;
|
|
119
130
|
skillsMissingBody: string[];
|
|
131
|
+
droppedSkills: CloudSkillDropped[];
|
|
120
132
|
droppedMcpServers: CloudMcpDroppedServer[];
|
|
121
133
|
degradedMcpServers: CloudMcpDegradedServer[];
|
|
122
134
|
droppedModels: CloudDroppedModel[];
|
|
@@ -126,12 +138,14 @@ export interface CloudProjection {
|
|
|
126
138
|
runtimeCaps: CloudRuntimeCapsReading;
|
|
127
139
|
modelRefIssues: CloudModelRefIssue[];
|
|
128
140
|
}
|
|
129
|
-
export declare function projectEffectiveBody(body: unknown, skillBodies: Record<string, string>, env: EnvLike, rostersValue?: unknown, opts?: CloudModelsDocOptions): CloudProjection;
|
|
141
|
+
export declare function projectEffectiveBody(body: unknown, skillBodies: Record<string, string>, env: EnvLike, rostersValue?: unknown, opts?: CloudModelsDocOptions, skills?: CloudSkillsOptions): CloudProjection;
|
|
130
142
|
export interface CloudEffectiveNotice {
|
|
131
143
|
readonly level: 'warn' | 'info';
|
|
132
144
|
readonly text: string;
|
|
133
145
|
}
|
|
134
|
-
export
|
|
146
|
+
export interface CloudEffectiveNoticesOptionalInput {
|
|
135
147
|
readonly mcp?: readonly McpServerSpec[];
|
|
136
148
|
readonly degradedMcpServers?: readonly CloudMcpDegradedServer[];
|
|
137
|
-
|
|
149
|
+
readonly droppedSkills?: readonly CloudSkillDropped[];
|
|
150
|
+
}
|
|
151
|
+
export declare function cloudEffectiveNotices(p: Pick<CloudProjection, 'effectiveWarnings' | 'budget' | 'runtimeCaps' | 'modelRefIssues' | 'droppedMcpServers'> & CloudEffectiveNoticesOptionalInput): CloudEffectiveNotice[];
|