@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.
Files changed (335) hide show
  1. package/CHANGELOG.md +395 -0
  2. package/README.md +164 -117
  3. package/dist/adapt/arms.js +51 -16
  4. package/dist/adapt/textStream.js +7 -4
  5. package/dist/adapt/toolCards.js +9 -8
  6. package/dist/adapt.js +7 -1
  7. package/dist/adapter/activeRunSelfHeal.d.ts +24 -2
  8. package/dist/adapter/activeRunSelfHeal.js +108 -6
  9. package/dist/adapter/downstream/eventToSdkMessage.js +33 -12
  10. package/dist/adapter/downstream/terminalToSdkResult.d.ts +60 -1
  11. package/dist/adapter/downstream/terminalToSdkResult.js +209 -39
  12. package/dist/adapter/runStream.d.ts +4 -4
  13. package/dist/adapter/runStream.js +158 -43
  14. package/dist/agentsWireCaps.d.ts +2 -7
  15. package/dist/agentsWireCaps.js +1 -2
  16. package/dist/approvalDecidedByCapability.js +2 -2
  17. package/dist/approvalFrameFamilies.d.ts +33 -0
  18. package/dist/approvalFrameFamilies.js +120 -0
  19. package/dist/approvalsStreamLiveCapability.js +2 -2
  20. package/dist/attachmentsWireCaps.js +41 -13
  21. package/dist/callerCwdCapability.js +2 -2
  22. package/dist/centerWiringCapability.js +2 -2
  23. package/dist/clockReading.d.ts +2 -0
  24. package/dist/clockReading.js +4 -0
  25. package/dist/cloudConfigWireCaps.d.ts +19 -5
  26. package/dist/cloudConfigWireCaps.js +193 -56
  27. package/dist/coreValuePorts.d.ts +12 -2
  28. package/dist/coreValuePorts.js +9 -0
  29. package/dist/decideFailureNote.js +5 -3
  30. package/dist/decideReceipt.js +2 -2
  31. package/dist/deviceExecutorManagementCapability.js +2 -2
  32. package/dist/deviceFlowPolling.js +1 -1
  33. package/dist/disableSkillsWire.d.ts +1 -1
  34. package/dist/disableSkillsWire.js +4 -3
  35. package/dist/displayUntrusted.d.ts +1 -0
  36. package/dist/displayUntrusted.js +65 -8
  37. package/dist/engineCapReader.js +1 -1
  38. package/dist/engineConfigDrift.js +1 -1
  39. package/dist/engineErrorCodes.d.ts +14 -5
  40. package/dist/engineErrorCodes.js +27 -6
  41. package/dist/engineGenerationConvergence.d.ts +39 -0
  42. package/dist/engineGenerationConvergence.js +95 -0
  43. package/dist/engineGenerationPort.d.ts +61 -0
  44. package/dist/engineGenerationPort.js +144 -0
  45. package/dist/engineHealthFacts.d.ts +23 -0
  46. package/dist/engineHealthFacts.js +92 -0
  47. package/dist/engineIdentity.d.ts +4 -0
  48. package/dist/engineIdentity.js +11 -0
  49. package/dist/engineNoticeCodes.d.ts +2 -5
  50. package/dist/engineRowRef.js +3 -0
  51. package/dist/engineSessionMessages.js +2 -2
  52. package/dist/engineToolDirectory.js +2 -2
  53. package/dist/engineWireFor.d.ts +99 -0
  54. package/dist/engineWireFor.js +248 -6
  55. package/dist/engineWireTarget.d.ts +1 -0
  56. package/dist/engineWireTarget.js +8 -0
  57. package/dist/env/uiLanguage.js +1 -1
  58. package/dist/errorSupplementRoles.d.ts +3 -0
  59. package/dist/errorSupplementRoles.js +37 -0
  60. package/dist/executionLaneCapability.js +2 -2
  61. package/dist/fileHistoryCaptureCapability.js +3 -3
  62. package/dist/finalVerifyWire.d.ts +6 -3
  63. package/dist/finalVerifyWire.js +6 -23
  64. package/dist/flagInput.d.ts +4 -0
  65. package/dist/flagInput.js +24 -0
  66. package/dist/fleet/fleetLedger.js +5 -2
  67. package/dist/fleet/fleetProjection.d.ts +1 -0
  68. package/dist/fleet/fleetProjection.js +15 -2
  69. package/dist/gateVocabulary.js +3 -0
  70. package/dist/generated/engineFactTables.d.ts +7 -3
  71. package/dist/generated/engineFactTables.js +52 -0
  72. package/dist/generated/engineNoticeTables.js +12 -0
  73. package/dist/generated/settingsSchemaActiveTiers.d.ts +1 -0
  74. package/dist/generated/settingsSchemaActiveTiers.js +14 -0
  75. package/dist/generated/settingsSchemaCallerTextEcho.d.ts +1 -0
  76. package/dist/generated/settingsSchemaCallerTextEcho.js +8 -0
  77. package/dist/generated/settingsSchemaControlAndBidi.d.ts +1 -0
  78. package/dist/generated/settingsSchemaControlAndBidi.js +8 -0
  79. package/dist/generated/settingsSchemaDefaultModel.d.ts +11 -0
  80. package/dist/generated/settingsSchemaDefaultModel.js +25 -0
  81. package/dist/generated/settingsSchemaFns.d.ts +54 -0
  82. package/dist/generated/settingsSchemaFns.js +26 -1
  83. package/dist/generated/settingsSchemaMcpRequestEntry.d.ts +1 -1
  84. package/dist/generated/settingsSchemaMcpRequestEntry.js +1 -7
  85. package/dist/generated/settingsSchemaSafetyMergeSpec.d.ts +1 -0
  86. package/dist/generated/settingsSchemaSafetyMergeSpec.js +95 -0
  87. package/dist/generated/settingsSchemaSettingsSources.d.ts +1 -0
  88. package/dist/generated/settingsSchemaSettingsSources.js +58 -0
  89. package/dist/generated/settingsSchemaTables.d.ts +2 -0
  90. package/dist/generated/settingsSchemaTables.js +13 -0
  91. package/dist/generated/settingsSchemaUrlPattern.d.ts +1 -0
  92. package/dist/generated/settingsSchemaUrlPattern.js +183 -0
  93. package/dist/headlessPermissionModeWire.d.ts +18 -2
  94. package/dist/headlessPermissionModeWire.js +30 -19
  95. package/dist/hitl/allowRuleShadow.js +7 -5
  96. package/dist/hitl/approvalCardReading.d.ts +3 -0
  97. package/dist/hitl/approvalCardReading.js +17 -0
  98. package/dist/hitl/approvalCompleteParked.js +1 -1
  99. package/dist/hitl/approvalDelivery.d.ts +87 -0
  100. package/dist/hitl/approvalDelivery.js +193 -0
  101. package/dist/hitl/approvalResolution.d.ts +11 -0
  102. package/dist/hitl/approvalResolution.js +50 -11
  103. package/dist/hitl/askClassPair.d.ts +6 -0
  104. package/dist/hitl/askClassPair.js +30 -3
  105. package/dist/hitl/askParkAutoReopenBlock.d.ts +30 -0
  106. package/dist/hitl/askParkAutoReopenBlock.js +117 -0
  107. package/dist/hitl/askParkRowRouting.js +4 -1
  108. package/dist/hitl/attributionLadder.d.ts +42 -3
  109. package/dist/hitl/attributionLadder.js +79 -8
  110. package/dist/hitl/automaticAnswerVerdict.d.ts +6 -1
  111. package/dist/hitl/automaticAnswerVerdict.js +46 -11
  112. package/dist/hitl/crashConverged.js +2 -2
  113. package/dist/hitl/decisionConflict.d.ts +6 -2
  114. package/dist/hitl/decisionConflict.js +24 -9
  115. package/dist/hitl/decisionRefusal.d.ts +20 -10
  116. package/dist/hitl/decisionRefusal.js +99 -54
  117. package/dist/hitl/decisionSend.d.ts +3 -0
  118. package/dist/hitl/decisionSend.js +87 -103
  119. package/dist/hitl/frameRouter.d.ts +1 -0
  120. package/dist/hitl/frameRouter.js +9 -2
  121. package/dist/hitl/hitlBridge.d.ts +18 -6
  122. package/dist/hitl/hitlBridge.js +41 -37
  123. package/dist/hitl/livePendingAsk.js +4 -3
  124. package/dist/hitl/noAllowCause.js +1 -1
  125. package/dist/hitl/parkResolver.js +3 -2
  126. package/dist/hitl/persistedRulesWire.js +1 -0
  127. package/dist/hitl/planReviewWire.d.ts +4 -0
  128. package/dist/hitl/planReviewWire.js +59 -30
  129. package/dist/hitl/resumeRunningCard.d.ts +3 -2
  130. package/dist/hitl/resumeRunningCard.js +17 -11
  131. package/dist/hitl/sessionPolicyDeliverable.d.ts +5 -2
  132. package/dist/hitl/sessionPolicyDeliverable.js +62 -29
  133. package/dist/hitl/sessionPolicyWire.d.ts +13 -3
  134. package/dist/hitl/sessionPolicyWire.js +81 -16
  135. package/dist/hitl/standingRows.js +1 -1
  136. package/dist/hitl/toolApprovalWire.d.ts +9 -10
  137. package/dist/hitl/toolApprovalWire.js +72 -54
  138. package/dist/hookMatcherVerdict.d.ts +2 -0
  139. package/dist/hookMatcherVerdict.js +12 -0
  140. package/dist/hooksCompactTransition.d.ts +19 -0
  141. package/dist/hooksCompactTransition.js +41 -0
  142. package/dist/hooksWireCaps.d.ts +1 -1
  143. package/dist/hooksWireCaps.js +202 -203
  144. package/dist/host.d.ts +1 -14
  145. package/dist/host.js +0 -8
  146. package/dist/hostCallbackGuard.d.ts +1 -0
  147. package/dist/hostCallbackGuard.js +1 -1
  148. package/dist/hostSettingsSource.d.ts +172 -0
  149. package/dist/hostSettingsSource.js +675 -0
  150. package/dist/hostTurnSettings.d.ts +73 -17
  151. package/dist/hostTurnSettings.js +594 -97
  152. package/dist/httpHookPolicy.d.ts +37 -0
  153. package/dist/httpHookPolicy.js +176 -0
  154. package/dist/humanTurn.d.ts +2 -1
  155. package/dist/humanTurn.js +37 -7
  156. package/dist/humanTurnRead.js +4 -3
  157. package/dist/humanTurnSentences.d.ts +10 -0
  158. package/dist/humanTurnSentences.js +74 -0
  159. package/dist/i18n/messages.en.d.ts +184 -2
  160. package/dist/i18n/messages.en.js +187 -5
  161. package/dist/i18n/messages.zh.js +197 -5
  162. package/dist/i18n/translate.js +3 -3
  163. package/dist/index.d.ts +69 -15
  164. package/dist/index.js +45 -13
  165. package/dist/inheritEnvCapability.d.ts +3 -1
  166. package/dist/inheritEnvCapability.js +31 -17
  167. package/dist/inheritEnvWire.d.ts +2 -1
  168. package/dist/inheritEnvWire.js +11 -5
  169. package/dist/interactiveToolsWire.d.ts +4 -2
  170. package/dist/interactiveToolsWire.js +5 -5
  171. package/dist/jsonFaithful.d.ts +20 -0
  172. package/dist/jsonFaithful.js +152 -0
  173. package/dist/limitsWire.d.ts +7 -2
  174. package/dist/limitsWire.js +19 -13
  175. package/dist/liveInitToolFace.d.ts +6 -1
  176. package/dist/liveInitToolFace.js +5 -3
  177. package/dist/liveModelCatalog.d.ts +22 -0
  178. package/dist/liveModelCatalog.js +132 -18
  179. package/dist/mcpPanel.js +1 -1
  180. package/dist/mcpProbeCapability.js +2 -2
  181. package/dist/mcpStatusSupersetKeys.d.ts +24 -0
  182. package/dist/mcpStatusSupersetKeys.js +45 -0
  183. package/dist/mcpToolToggles.js +2 -1
  184. package/dist/mcpWireCaps.d.ts +39 -1
  185. package/dist/mcpWireCaps.js +254 -50
  186. package/dist/memoryComplianceCapability.js +2 -2
  187. package/dist/memoryOriginCapability.js +2 -2
  188. package/dist/model/catalogDefault.d.ts +24 -0
  189. package/dist/model/catalogDefault.js +4 -0
  190. package/dist/model/liveCatalogShape.js +5 -4
  191. package/dist/model/modelsPolicy.js +4 -3
  192. package/dist/model/onboardJudgement.d.ts +1 -0
  193. package/dist/model/onboardJudgement.js +1 -1
  194. package/dist/model/subagentModelWord.js +2 -2
  195. package/dist/modelCapabilityProbe.js +6 -6
  196. package/dist/modelIdentityResolvability.d.ts +10 -1
  197. package/dist/modelIdentityResolvability.js +62 -39
  198. package/dist/modsKernelIdentity.d.ts +10 -0
  199. package/dist/modsKernelIdentity.js +103 -0
  200. package/dist/modsKernelTransit.d.ts +8 -0
  201. package/dist/modsKernelTransit.js +6 -0
  202. package/dist/notifications.d.ts +30 -12
  203. package/dist/notifications.js +241 -53
  204. package/dist/outputStyleSeatCapability.js +2 -2
  205. package/dist/ownKey.d.ts +11 -0
  206. package/dist/ownKey.js +164 -3
  207. package/dist/panelReduce.js +1 -1
  208. package/dist/peerFrames.d.ts +1 -1
  209. package/dist/peerFrames.js +6 -2
  210. package/dist/peerLaneCapability.js +2 -2
  211. package/dist/permissionModesCapability.js +4 -4
  212. package/dist/permissionRuleIssue.js +2 -0
  213. package/dist/permissionRulesWriteCapability.js +2 -2
  214. package/dist/permissionsAllowGrantCapability.js +2 -2
  215. package/dist/permissionsDeclaration.d.ts +43 -4
  216. package/dist/permissionsDeclaration.js +102 -35
  217. package/dist/pluginHooksWire.d.ts +20 -4
  218. package/dist/pluginHooksWire.js +92 -53
  219. package/dist/prepareRefusal.d.ts +3 -2
  220. package/dist/prepareRefusal.js +27 -9
  221. package/dist/printInitToolFace.js +2 -2
  222. package/dist/printModelStatus.js +1 -1
  223. package/dist/projectMemory.d.ts +32 -0
  224. package/dist/projectMemory.js +70 -0
  225. package/dist/promptBlockedCopy.d.ts +2 -1
  226. package/dist/promptBlockedCopy.js +2 -1
  227. package/dist/promptDelivery.d.ts +23 -3
  228. package/dist/promptDelivery.js +169 -30
  229. package/dist/providerRejection.d.ts +19 -1
  230. package/dist/providerRejection.js +75 -4
  231. package/dist/queuedDelivery.d.ts +48 -0
  232. package/dist/queuedDelivery.js +233 -0
  233. package/dist/reattachWindow.d.ts +94 -0
  234. package/dist/reattachWindow.js +127 -0
  235. package/dist/request/printNotification.d.ts +1 -1
  236. package/dist/request/printNotification.js +5 -1
  237. package/dist/request/submissionIdentity.d.ts +37 -0
  238. package/dist/request/submissionIdentity.js +65 -0
  239. package/dist/request/taskRequest.d.ts +12 -4
  240. package/dist/request/taskRequest.js +221 -152
  241. package/dist/resultFrameKeys.d.ts +1 -0
  242. package/dist/resultFrameKeys.js +4 -1
  243. package/dist/retryStatus.d.ts +8 -0
  244. package/dist/retryStatus.js +57 -9
  245. package/dist/rewindArchiveCapability.js +2 -2
  246. package/dist/rewindEngineAction.d.ts +2 -0
  247. package/dist/rewindEngineAction.js +23 -1
  248. package/dist/rowKind.d.ts +36 -0
  249. package/dist/rowKind.js +97 -0
  250. package/dist/ruleCompileVerdict.d.ts +18 -0
  251. package/dist/ruleCompileVerdict.js +67 -2
  252. package/dist/ruleReadings.d.ts +58 -0
  253. package/dist/ruleReadings.js +132 -0
  254. package/dist/ruleRefusalSentence.d.ts +4 -0
  255. package/dist/ruleRefusalSentence.js +9 -3
  256. package/dist/runCancelContext.d.ts +0 -1
  257. package/dist/runCancelContext.js +1 -2
  258. package/dist/runTerminal.d.ts +5 -0
  259. package/dist/runTerminal.js +52 -17
  260. package/dist/sandboxWire.d.ts +1 -1
  261. package/dist/sandboxWire.js +4 -6
  262. package/dist/scenarioRefusal.js +1 -1
  263. package/dist/scenarioSkills.d.ts +20 -0
  264. package/dist/scenarioSkills.js +72 -0
  265. package/dist/scenarioWire.d.ts +5 -2
  266. package/dist/scenarioWire.js +9 -9
  267. package/dist/sealedKeyCapability.js +2 -2
  268. package/dist/seam.d.ts +2 -0
  269. package/dist/seam.js +2 -2
  270. package/dist/seatContract.d.ts +46 -1
  271. package/dist/seatContract.js +49 -19
  272. package/dist/selfOrchestrationDenial.js +1 -1
  273. package/dist/sessionPolicyCapability.js +2 -2
  274. package/dist/sessionRulesChildrenReadLive.d.ts +6 -0
  275. package/dist/sessionRulesChildrenReadLive.js +5 -0
  276. package/dist/sessionRulesNamespaceFormsCapability.d.ts +12 -0
  277. package/dist/sessionRulesNamespaceFormsCapability.js +29 -0
  278. package/dist/sessionSyncFileHistoryCapability.js +2 -2
  279. package/dist/settingsCredentialKeyPaths.js +60 -5
  280. package/dist/settingsHooksSalvage.d.ts +1 -0
  281. package/dist/settingsHooksSalvage.js +7 -1
  282. package/dist/settingsLayerAdmission.d.ts +4 -0
  283. package/dist/settingsLayerAdmission.js +16 -0
  284. package/dist/skillToolListsCapability.js +6 -5
  285. package/dist/skillsWireCaps.d.ts +14 -0
  286. package/dist/skillsWireCaps.js +47 -16
  287. package/dist/slashCommandGate.d.ts +24 -0
  288. package/dist/slashCommandGate.js +74 -0
  289. package/dist/slashCommandTable.d.ts +14 -0
  290. package/dist/slashCommandTable.js +99 -0
  291. package/dist/sqlEngineCapability.js +2 -2
  292. package/dist/steerPriorityCapability.js +2 -2
  293. package/dist/storePostureCapability.js +2 -2
  294. package/dist/subagent/agentStateDetail.js +1 -1
  295. package/dist/subagent/engineDelegatedPrompt.d.ts +9 -0
  296. package/dist/subagent/engineDelegatedPrompt.js +38 -7
  297. package/dist/subagent/engineRowStopGate.js +2 -2
  298. package/dist/subagent/engineSubagentResume.js +3 -3
  299. package/dist/subagent/engineTaskHandleWire.d.ts +1 -0
  300. package/dist/subagent/engineTaskHandleWire.js +10 -0
  301. package/dist/submitFailure.d.ts +8 -0
  302. package/dist/submitFailure.js +17 -0
  303. package/dist/supportFloor.d.ts +1 -0
  304. package/dist/supportFloor.js +7 -0
  305. package/dist/terminationIntent.d.ts +55 -0
  306. package/dist/terminationIntent.js +352 -0
  307. package/dist/toolHistoryMismatch.d.ts +8 -0
  308. package/dist/toolHistoryMismatch.js +37 -6
  309. package/dist/toolResult.d.ts +13 -3
  310. package/dist/toolResult.js +158 -9
  311. package/dist/toolResultContent.d.ts +13 -0
  312. package/dist/toolResultContent.js +82 -7
  313. package/dist/toolRoster.d.ts +18 -0
  314. package/dist/toolRoster.js +64 -0
  315. package/dist/turnFailurePresentation.js +27 -90
  316. package/dist/usageLimitAutoResume.d.ts +74 -0
  317. package/dist/usageLimitAutoResume.js +227 -0
  318. package/dist/userAttachmentEnvelope.js +1 -1
  319. package/dist/userAttachmentSeat.js +5 -5
  320. package/dist/userInvokedSkillsCapability.js +2 -2
  321. package/dist/webSearchBackendCapability.js +2 -2
  322. package/dist/wireErrorTriage.js +99 -50
  323. package/dist/wireFailureShape.d.ts +25 -1
  324. package/dist/wireFailureShape.js +92 -5
  325. package/dist/wireRefusalCopy.d.ts +24 -1
  326. package/dist/wireRefusalCopy.js +253 -32
  327. package/dist/wiringFleetDoctor.d.ts +3 -0
  328. package/dist/wiringFleetDoctor.js +21 -0
  329. package/dist/workflow.d.ts +2 -1
  330. package/dist/workflow.js +38 -1
  331. package/dist/workflowClient.d.ts +2 -7
  332. package/dist/workflowsJournalCapability.js +2 -2
  333. package/dist/writeProtectionCapability.js +2 -2
  334. package/docs/INTEGRATION-CLIENTS.md +607 -181
  335. package/package.json +14 -3
@@ -1,5 +1,5 @@
1
- import { mcpAssertionHeaderNotSentNotice, mcpElicitationVerdict, mcpToolAxesVerdict, readMcpHttpIdentityHeaders } from './mcpWireCaps.js';
2
- import { toCappedSpec } from './skillsWireCaps.js';
1
+ import { mcpAllowToolsVerdict, mcpAssertionHeaderNotSentNotice, mcpElicitationVerdict, mcpToolAxesVerdict, mcpToolFacesVerdict, readMcpHttpIdentityHeaders } from './mcpWireCaps.js';
2
+ import { skillToolListsVerdict, toCappedSpec } from './skillsWireCaps.js';
3
3
  import { SETTINGS_DESCRIBE_BAD_WIRE_NAME, SETTINGS_IS_USABLE_WIRE_NAME, SETTINGS_READ_REQUEST_MCP_TRANSPORT } from './generated/settingsSchemaFns.js';
4
4
  import { snapshotArgs, wireTransportOf } from './mcpWireTransport.js';
5
5
  import { msg, renderMessage } from './i18n/translate.js';
@@ -18,23 +18,56 @@ export function cloudMcpToSpecs(servers, env) {
18
18
  const missingEnv = [];
19
19
  const droppedServers = [];
20
20
  const degradedServers = [];
21
- const drop = (name, reason, path) => {
22
- droppedServers.push({ ...(name ? { name } : {}), reason, ...(path !== undefined ? { path } : {}) });
21
+ const recordDrop = (name, reason, path, problem) => {
22
+ droppedServers.push({ ...(name ? { name } : {}), reason, ...(path !== undefined ? { path } : {}), ...(problem !== undefined ? { problem } : {}) });
23
23
  };
24
24
  for (const raw of asArr(servers)) {
25
- const s = asRec(raw);
26
- const name = s ? asStr(s.name) : undefined;
27
- if (!s || s.enabled === false) {
28
- drop(name, s?.enabled === false ? 'disabled' : 'missing-field');
25
+ let s;
26
+ try {
27
+ s = asRec(raw);
28
+ }
29
+ catch {
30
+ recordDrop(undefined, 'entry-unreadable');
31
+ continue;
32
+ }
33
+ let name;
34
+ try {
35
+ name = s ? asStr(s.name) : undefined;
36
+ }
37
+ catch {
38
+ recordDrop(undefined, 'entry-unreadable');
39
+ continue;
40
+ }
41
+ if (!s) {
42
+ recordDrop(name, 'missing-field');
43
+ continue;
44
+ }
45
+ let enabled;
46
+ try {
47
+ enabled = s.enabled;
48
+ }
49
+ catch {
50
+ recordDrop(name, 'entry-unreadable');
51
+ continue;
52
+ }
53
+ if (enabled === false) {
54
+ recordDrop(name, 'disabled');
55
+ continue;
56
+ }
57
+ let t;
58
+ try {
59
+ t = asRec(s.transport);
60
+ }
61
+ catch {
62
+ recordDrop(name, 'entry-unreadable');
29
63
  continue;
30
64
  }
31
- const t = asRec(s.transport);
32
65
  if (!name || !t) {
33
- drop(name, 'missing-field');
66
+ recordDrop(name, 'missing-field');
34
67
  continue;
35
68
  }
36
69
  if (!SETTINGS_IS_USABLE_WIRE_NAME(name)) {
37
- drop(name, 'name-unusable');
70
+ recordDrop(name, 'name-unusable');
38
71
  continue;
39
72
  }
40
73
  let candidate;
@@ -57,9 +90,9 @@ export function cloudMcpToSpecs(servers, env) {
57
90
  const dropHard = (issue, raw) => {
58
91
  const missing = (issue.path === 'transport.command' || issue.path === 'transport.url') && asStr(raw) === undefined;
59
92
  if (missing)
60
- drop(name, 'missing-field');
93
+ recordDrop(name, 'missing-field');
61
94
  else
62
- drop(name, 'transport-invalid', issue.path);
95
+ recordDrop(name, 'transport-invalid', issue.path);
63
96
  };
64
97
  try {
65
98
  if (t.kind === 'stdio') {
@@ -84,60 +117,103 @@ export function cloudMcpToSpecs(servers, env) {
84
117
  const principalHeader = t.principalHeader;
85
118
  const assertionHeader = t.assertionHeader;
86
119
  if (readMcpHttpIdentityHeaders({ principalHeader, assertionHeader }).kind === 'both_set') {
87
- drop(name, 'principal-and-assertion-header');
120
+ recordDrop(name, 'principal-and-assertion-header');
88
121
  continue;
89
122
  }
90
123
  const headerEntries = resolveRefs(t.headerRefs);
91
124
  candidate = { kind: 'http', url, headers: headerEntries.length > 0 ? Object.fromEntries(headerEntries) : undefined, principalHeader, assertionHeader };
92
125
  }
93
126
  else {
94
- drop(name, 'unknown-transport');
127
+ recordDrop(name, 'unknown-transport');
95
128
  continue;
96
129
  }
97
130
  }
98
131
  catch {
99
- drop(name, 'transport-invalid', 'transport');
132
+ recordDrop(name, 'transport-invalid', 'transport');
133
+ continue;
134
+ }
135
+ let read;
136
+ try {
137
+ read = SETTINGS_READ_REQUEST_MCP_TRANSPORT(candidate);
138
+ }
139
+ catch {
140
+ recordDrop(name, 'transport-invalid', 'transport');
100
141
  continue;
101
142
  }
102
- const read = SETTINGS_READ_REQUEST_MCP_TRANSPORT(candidate);
103
143
  if (!read.ok) {
104
144
  dropHard(read.issue, requiredRaw);
105
145
  continue;
106
146
  }
107
- missingEnv.push(...missingHere);
108
147
  const transport = wireTransportOf(read.transport);
109
- const axesDeclared = s.toolAxes;
148
+ let axesDeclared;
149
+ let elicitationDeclared;
150
+ let allowDeclared;
151
+ try {
152
+ axesDeclared = s.toolAxes;
153
+ elicitationDeclared = s.elicitation;
154
+ allowDeclared = s.allowTools;
155
+ }
156
+ catch {
157
+ recordDrop(name, 'entry-unreadable');
158
+ continue;
159
+ }
110
160
  const axesVerdict = mcpToolAxesVerdict(axesDeclared);
111
161
  if (axesVerdict.kind === 'bad') {
112
- drop(name, 'tool-axes-invalid');
162
+ recordDrop(name, 'tool-axes-invalid');
113
163
  continue;
114
164
  }
115
165
  const axesShipped = axesVerdict.kind === 'ok' ? axesVerdict.toolAxes : axesDeclared;
116
- const elVerdict = mcpElicitationVerdict(s.elicitation);
166
+ let facesDeclared;
167
+ let facesUnreadable = false;
168
+ try {
169
+ facesDeclared = s.toolFaces;
170
+ }
171
+ catch {
172
+ facesUnreadable = true;
173
+ }
174
+ const facesVerdict = facesUnreadable
175
+ ? Object.freeze({ kind: 'bad', problem: renderMessage(msg('config.mcp.toolFacesUnreadable')) })
176
+ : mcpToolFacesVerdict(facesDeclared);
177
+ if (facesVerdict.kind === 'bad') {
178
+ recordDrop(name, 'tool-faces-invalid', undefined, facesVerdict.problem);
179
+ continue;
180
+ }
181
+ const facesShipped = facesVerdict.kind === 'ok' ? facesVerdict.toolFaces : facesDeclared;
182
+ const elVerdict = mcpElicitationVerdict(elicitationDeclared);
117
183
  if (elVerdict.kind === 'bad') {
118
- drop(name, 'elicitation-invalid');
184
+ recordDrop(name, 'elicitation-invalid');
119
185
  continue;
120
186
  }
121
- const allowToolsWritten = Array.isArray(s.allowTools);
122
- const allowTools = asArr(s.allowTools).filter((a) => typeof a === 'string');
187
+ const allowVerdict = mcpAllowToolsVerdict(() => allowDeclared, `config.mcp.servers.${capForDisplay(name, DEGRADED_NAME_SHOWN)}.`);
188
+ if (allowVerdict.kind === 'bad') {
189
+ recordDrop(name, 'allow-tools-invalid', allowVerdict.path, allowVerdict.problem);
190
+ continue;
191
+ }
192
+ missingEnv.push(...missingHere);
123
193
  if (read.lost.length > 0)
124
194
  degradedServers.push({ name, lost: Object.freeze([...read.lost]) });
125
195
  specs.push({
126
196
  name,
127
197
  transport,
128
- ...(allowToolsWritten ? { allowTools } : {}),
198
+ ...(allowVerdict.allowTools !== undefined ? { allowTools: allowVerdict.allowTools } : {}),
129
199
  ...(elVerdict.elicitation !== undefined ? { elicitation: elVerdict.elicitation } : {}),
130
- ...(s.toolFaces !== undefined ? { toolFaces: s.toolFaces } : {}),
200
+ ...(facesShipped !== undefined ? { toolFaces: facesShipped } : {}),
131
201
  ...(axesShipped !== undefined ? { toolAxes: axesShipped } : {}),
132
202
  });
133
203
  }
134
204
  return { specs, missingEnv: [...new Set(missingEnv)], droppedServers, degradedServers };
135
205
  }
136
- export function cloudSkillsToSpecs(manifestSkills, resolveBody) {
206
+ export function cloudSkillsToSpecs(manifestSkills, resolveBody, opts) {
207
+ return projectCloudSkills(manifestSkills, resolveBody, opts).specs;
208
+ }
209
+ function projectCloudSkills(manifestSkills, resolveBody, opts) {
137
210
  const specs = [];
211
+ const dropped = [];
138
212
  const seen = new Set();
139
- for (const raw of asArr(manifestSkills)) {
140
- const s = asRec(raw);
213
+ const reading = opts?.skillToolLists;
214
+ const entries = asArr(manifestSkills);
215
+ for (let i = 0; i < entries.length; i++) {
216
+ const s = asRec(entries[i]);
141
217
  if (!s || s.enabled === false)
142
218
  continue;
143
219
  const name = asStr(s.name);
@@ -151,9 +227,14 @@ export function cloudSkillsToSpecs(manifestSkills, resolveBody) {
151
227
  if (!spec || seen.has(spec.name))
152
228
  continue;
153
229
  seen.add(spec.name);
154
- specs.push(spec);
230
+ const verdict = skillToolListsVerdict(s, reading);
231
+ if (verdict.kind === 'bad') {
232
+ dropped.push({ name: spec.name, reason: 'tool-list-invalid', path: `skills[${i}].${verdict.key}${verdict.index !== undefined ? `[${verdict.index}]` : ''}` });
233
+ continue;
234
+ }
235
+ specs.push({ ...spec, ...verdict.lists });
155
236
  }
156
- return specs;
237
+ return { specs, dropped };
157
238
  }
158
239
  const REGISTRY_ENTRY_ANNOTATION_KEYS = ['origin', 'overridesTeam'];
159
240
  function withoutRegistryAnnotations(e) {
@@ -237,7 +318,7 @@ function modelsDocOf(models, opts) {
237
318
  const acceptedFlags = accept ? stripped.map(acceptedName) : undefined;
238
319
  const names = acceptedFlags ? new Set(stripped.filter((_, i) => acceptedFlags[i]).map((e) => e.name)) : allNames;
239
320
  const issues = [...copyFailures];
240
- const drop = (i) => {
321
+ const recordDrop = (i) => {
241
322
  issues.push({ ...i, outcome: 'dropped' });
242
323
  };
243
324
  const refOf = (v) => (typeof v === 'string' && v !== '' ? { target: v } : {});
@@ -258,13 +339,13 @@ function modelsDocOf(models, opts) {
258
339
  const doc = { models: written };
259
340
  const policy = modelsPolicyOf(m);
260
341
  if (policy.unreadable) {
261
- drop({ key: 'roles', at: 'default', reason: 'unreadable' });
262
- drop({ key: 'atMention', at: 'models', reason: 'unreadable' });
342
+ recordDrop({ key: 'roles', at: 'default', reason: 'unreadable' });
343
+ recordDrop({ key: 'atMention', at: 'models', reason: 'unreadable' });
263
344
  }
264
345
  const rolesRead = guarded(() => ({ value: m.roles }));
265
346
  const roleEntries = rolesRead === undefined ? undefined : guarded(() => Object.entries(asRec(rolesRead.value) ?? {}));
266
347
  if (roleEntries === undefined)
267
- drop({ key: 'roles', at: 'models', reason: 'unreadable' });
348
+ recordDrop({ key: 'roles', at: 'models', reason: 'unreadable' });
268
349
  const keptRoles = {};
269
350
  for (const [role, t] of roleEntries ?? []) {
270
351
  const first = guarded(() => {
@@ -273,20 +354,20 @@ function modelsDocOf(models, opts) {
273
354
  return { tr: r, has, model: has ? r.model : undefined };
274
355
  });
275
356
  if (first === undefined) {
276
- drop({ key: 'roles', at: role, reason: 'unreadable' });
357
+ recordDrop({ key: 'roles', at: role, reason: 'unreadable' });
277
358
  continue;
278
359
  }
279
360
  const { tr, has, model } = first;
280
361
  if (typeof model === 'string') {
281
362
  const verdict = modelRefVerdict(model);
282
363
  if (verdict !== 'accepted') {
283
- drop({ key: 'roles', at: role, ...refOf(model), reason: verdict });
364
+ recordDrop({ key: 'roles', at: role, ...refOf(model), reason: verdict });
284
365
  continue;
285
366
  }
286
367
  }
287
368
  const copy = writtenCopyOf(t, tr !== undefined && has ? { key: 'model', value: model } : undefined);
288
369
  if (copy === undefined) {
289
- drop({ key: 'roles', at: role, ...refOf(model), reason: 'unreadable' });
370
+ recordDrop({ key: 'roles', at: role, ...refOf(model), reason: 'unreadable' });
290
371
  continue;
291
372
  }
292
373
  setOwn(keptRoles, role, copy.value);
@@ -301,14 +382,14 @@ function modelsDocOf(models, opts) {
301
382
  doc.roles = rolesOut;
302
383
  const am = policy.atMention;
303
384
  if (am?.kind === 'unreadable') {
304
- drop({ key: 'atMention', at: 'atMention', reason: 'unreadable' });
385
+ recordDrop({ key: 'atMention', at: 'atMention', reason: 'unreadable' });
305
386
  }
306
387
  else if (am !== undefined) {
307
388
  const v = am.value;
308
389
  if (v.mode === 'only') {
309
390
  for (const n of v.models)
310
391
  if (!names.has(n))
311
- drop({ key: 'atMention', target: n, reason: reasonOf(n) });
392
+ recordDrop({ key: 'atMention', target: n, reason: reasonOf(n) });
312
393
  const narrowed = SETTINGS_NARROW_AT_MENTION(v, names);
313
394
  if (narrowed.mode === 'only') {
314
395
  doc.atMention = { mode: 'only', models: [...narrowed.models] };
@@ -316,7 +397,7 @@ function modelsDocOf(models, opts) {
316
397
  else {
317
398
  doc.atMention = { mode: narrowed.mode };
318
399
  if (narrowed.mode === 'none' && !catalogKept)
319
- drop({ key: 'atMention', at: 'atMention', reason: 'dangling' });
400
+ recordDrop({ key: 'atMention', at: 'atMention', reason: 'dangling' });
320
401
  }
321
402
  }
322
403
  else if (v.mode === 'none') {
@@ -330,11 +411,11 @@ function modelsDocOf(models, opts) {
330
411
  const tgValue = typeof tg === 'object' ? tg.value : undefined;
331
412
  const rawGroupNames = new Set((Array.isArray(tgValue) ? tgValue : []).map((g) => asStr(asRec(g)?.name)).filter((n) => !!n));
332
413
  if (tg === 'unreadable') {
333
- drop({ key: 'tierGroups', at: 'models', reason: 'unreadable' });
414
+ recordDrop({ key: 'tierGroups', at: 'models', reason: 'unreadable' });
334
415
  }
335
416
  else if (tg !== 'absent') {
336
417
  if (!Array.isArray(tgValue)) {
337
- drop({ key: 'tierGroups', reason: 'unreadable' });
418
+ recordDrop({ key: 'tierGroups', reason: 'unreadable' });
338
419
  }
339
420
  else {
340
421
  const groups = [];
@@ -343,11 +424,11 @@ function modelsDocOf(models, opts) {
343
424
  const g = asRec(raw);
344
425
  const name = g ? asStr(g.name) : undefined;
345
426
  if (!g || !name || !TIER_GROUP_NAME.test(name)) {
346
- drop({ key: 'tierGroups', ...(name ? { at: name } : {}), reason: 'unreadable' });
427
+ recordDrop({ key: 'tierGroups', ...(name ? { at: name } : {}), reason: 'unreadable' });
347
428
  continue;
348
429
  }
349
430
  if (groupNames.has(name)) {
350
- drop({ key: 'tierGroups', at: name, reason: 'duplicate' });
431
+ recordDrop({ key: 'tierGroups', at: name, reason: 'duplicate' });
351
432
  continue;
352
433
  }
353
434
  groupNames.add(name);
@@ -355,15 +436,15 @@ function modelsDocOf(models, opts) {
355
436
  if (Object.hasOwn(g, 'tiers')) {
356
437
  const t = asRec(g.tiers);
357
438
  if (!t)
358
- drop({ key: 'tierGroups', at: `${name}.tiers`, reason: 'unreadable' });
439
+ recordDrop({ key: 'tierGroups', at: `${name}.tiers`, reason: 'unreadable' });
359
440
  else {
360
441
  for (const [tier, model] of Object.entries(t)) {
361
442
  if (!TIER_WORDS.includes(tier))
362
- drop({ key: 'tierGroups', at: `${name}.${tier}`, ...refOf(model), reason: 'unsupported' });
443
+ recordDrop({ key: 'tierGroups', at: `${name}.${tier}`, ...refOf(model), reason: 'unsupported' });
363
444
  else if (typeof model === 'string' && names.has(model))
364
445
  setOwn(tiers, tier, model);
365
446
  else
366
- drop({ key: 'tierGroups', at: `${name}.${tier}`, ...refOf(model), reason: reasonOf(model) });
447
+ recordDrop({ key: 'tierGroups', at: `${name}.${tier}`, ...refOf(model), reason: reasonOf(model) });
367
448
  }
368
449
  }
369
450
  }
@@ -373,14 +454,14 @@ function modelsDocOf(models, opts) {
373
454
  }
374
455
  }
375
456
  if (atg === 'unreadable') {
376
- drop({ key: 'activeTierGroup', at: 'models', reason: 'unreadable' });
457
+ recordDrop({ key: 'activeTierGroup', at: 'models', reason: 'unreadable' });
377
458
  }
378
459
  else if (atg !== 'absent') {
379
460
  const a = atg.value;
380
461
  if (typeof a === 'string' && groupNames?.has(a))
381
462
  doc.activeTierGroup = a;
382
463
  else
383
- drop({ key: 'activeTierGroup', ...refOf(a), reason: typeof a === 'string' && a !== '' ? (rawGroupNames.has(a) ? 'rejected' : 'dangling') : 'unreadable' });
464
+ recordDrop({ key: 'activeTierGroup', ...refOf(a), reason: typeof a === 'string' && a !== '' ? (rawGroupNames.has(a) ? 'rejected' : 'dangling') : 'unreadable' });
384
465
  }
385
466
  }
386
467
  return { doc, issues, entriesRead: copied };
@@ -577,14 +658,14 @@ function runtimeCapsOf(b, mode) {
577
658
  }
578
659
  return { kind: 'configured', caps, uninterpretedKeys: uninterpreted };
579
660
  }
580
- export function projectEffectiveBody(body, skillBodies, env, rostersValue, opts) {
661
+ export function projectEffectiveBody(body, skillBodies, env, rostersValue, opts, skills) {
581
662
  const b = asRec(body) ?? {};
582
663
  const config = asRec(b.config) ?? {};
583
664
  const mcpDomain = asRec(config.mcp);
584
665
  const skillsDomain = asRec(config.skills);
585
666
  const { specs: mcp, missingEnv: mcpMissing, droppedServers: droppedMcpServers, degradedServers: degradedMcpServers } = cloudMcpToSpecs(mcpDomain?.servers, env);
586
667
  const manifest = asArr(skillsDomain?.skills);
587
- const skills = cloudSkillsToSpecs(manifest, (hash) => skillBodies[hash] ?? null);
668
+ const { specs: skillSpecs, dropped: droppedSkills } = projectCloudSkills(manifest, (hash) => skillBodies[hash] ?? null, skills);
588
669
  const skillsMissingBody = manifest
589
670
  .map((raw) => {
590
671
  const s = asRec(raw);
@@ -599,13 +680,14 @@ export function projectEffectiveBody(body, skillBodies, env, rostersValue, opts)
599
680
  const view = viewModeOf(b);
600
681
  return {
601
682
  mcp,
602
- skills,
683
+ skills: skillSpecs,
603
684
  modelsDoc,
604
685
  modelNames: cloudModelNames(modelsDoc),
605
686
  rosterNames: cloudRosterNames(rostersValue),
606
687
  missingEnv: [...new Set([...mcpMissing, ...cloudModelMissingKeyEnv(modelsDoc, env)])],
607
688
  scope: asStr(b.scope) ?? 'global',
608
689
  skillsMissingBody,
690
+ droppedSkills,
609
691
  droppedMcpServers,
610
692
  degradedMcpServers,
611
693
  droppedModels: entriesRead === undefined ? [] : cloudModelsDropped({ models: entriesRead }),
@@ -688,10 +770,22 @@ const MCP_DROP_SENTENCES = {
688
770
  level: 'warn',
689
771
  text: (who) => renderMessage(msg('config.mcp.cloudToolAxesInvalid', { who })),
690
772
  },
773
+ 'tool-faces-invalid': {
774
+ level: 'warn',
775
+ text: (who) => renderMessage(msg('config.mcp.cloudToolFacesInvalid', { who })),
776
+ },
691
777
  'elicitation-invalid': {
692
778
  level: 'warn',
693
779
  text: (who) => renderMessage(msg('config.mcp.cloudElicitationInvalid', { who })),
694
780
  },
781
+ 'allow-tools-invalid': {
782
+ level: 'warn',
783
+ text: (who) => renderMessage(msg('config.mcp.cloudAllowToolsInvalid', { who })),
784
+ },
785
+ 'entry-unreadable': {
786
+ level: 'warn',
787
+ text: (who) => renderMessage(msg('config.mcp.cloudEntryUnreadable', { who })),
788
+ },
695
789
  'name-unusable': {
696
790
  level: 'warn',
697
791
  text: (who) => renderMessage(msg('config.mcp.cloudNameUnusable', { who })),
@@ -760,13 +854,13 @@ function droppedMcpNotices(carrier) {
760
854
  return typeof raw === 'string' && Object.hasOwn(MCP_DROP_SENTENCES, raw) ? raw : undefined;
761
855
  });
762
856
  const name = guarded(() => readOwnDataNonEmptyString(rowObj, 'name'));
763
- const path = reason === 'transport-invalid' ? guarded(() => readOwnDataNonEmptyString(rowObj, 'path')) : undefined;
764
- const pathLabel = path !== undefined && /^transport(\.[A-Za-z]{1,32})?$/.test(path) ? ` (${path})` : '';
857
+ const path = reason === 'transport-invalid' || reason === 'allow-tools-invalid' ? guarded(() => readOwnDataNonEmptyString(rowObj, 'path')) : undefined;
858
+ const pathLabel = path !== undefined && (reason === 'allow-tools-invalid' ? /^allowTools(\[\d{1,9}\])?$/ : /^transport(\.[A-Za-z]{1,32})?$/).test(path) ? ` (${path})` : '';
765
859
  const label = name === undefined
766
860
  ? undefined
767
861
  : reason === 'name-unusable'
768
862
  ? SETTINGS_DESCRIBE_BAD_WIRE_NAME(name)
769
- : reason === 'transport-invalid'
863
+ : reason === 'transport-invalid' || reason === 'allow-tools-invalid' || reason === 'entry-unreadable'
770
864
  ? `"${capForDisplay(name, DEGRADED_NAME_SHOWN)}"${pathLabel}`
771
865
  : `"${name}"${pathLabel}`;
772
866
  let bucket = unrecognised;
@@ -854,6 +948,48 @@ function degradedMcpNotices(carrier) {
854
948
  return [];
855
949
  return [{ level: 'warn', text: renderMessage(msg('config.mcp.cloudTransportDegraded', { who: mcpDropWho(labels, unnamed) })) }];
856
950
  }
951
+ function droppedSkillNotices(carrier) {
952
+ const unreadable = [{ level: 'warn', text: renderMessage(msg('config.skills.cloudDroppedUnreadable')) }];
953
+ let desc;
954
+ try {
955
+ desc = Object.getOwnPropertyDescriptor(carrier, 'droppedSkills');
956
+ }
957
+ catch {
958
+ return unreadable;
959
+ }
960
+ if (desc === undefined)
961
+ return [];
962
+ if (!Object.hasOwn(desc, 'value'))
963
+ return unreadable;
964
+ const rows = desc.value;
965
+ let count = 0;
966
+ try {
967
+ if (!Array.isArray(rows))
968
+ return unreadable;
969
+ count = rows.length;
970
+ }
971
+ catch {
972
+ return unreadable;
973
+ }
974
+ if (typeof count !== 'number' || !Number.isSafeInteger(count) || count < 0)
975
+ return unreadable;
976
+ const labels = [];
977
+ let unnamed = 0;
978
+ for (let i = 0; i < count; i++) {
979
+ const row = guarded(() => readOwnDataValue(rows, String(i)));
980
+ const rowObj = typeof row === 'object' && row !== null ? row : undefined;
981
+ const name = guarded(() => readOwnDataNonEmptyString(rowObj, 'name'));
982
+ if (name === undefined) {
983
+ unnamed++;
984
+ continue;
985
+ }
986
+ const path = guarded(() => readOwnDataNonEmptyString(rowObj, 'path'));
987
+ labels.push(`"${capForDisplay(name, DEGRADED_NAME_SHOWN)}"${path !== undefined && /^skills\[\d{1,10}\]\.(?:allowedTools|disallowedTools)(?:\[\d{1,10}\])?$/.test(path) ? ` (${path})` : ''}`);
988
+ }
989
+ if (labels.length + unnamed === 0)
990
+ return [];
991
+ return [{ level: 'warn', text: renderMessage(msg('config.skills.cloudToolListInvalid', { who: mcpDropWho(labels, unnamed) })) }];
992
+ }
857
993
  function budgetNotice(r) {
858
994
  switch (r.kind) {
859
995
  case 'configured': {
@@ -923,6 +1059,7 @@ export function cloudEffectiveNotices(p) {
923
1059
  }
924
1060
  out.push(...droppedMcpNotices(p));
925
1061
  out.push(...degradedMcpNotices(p));
1062
+ out.push(...droppedSkillNotices(p));
926
1063
  const assertionLine = mcpAssertionHeaderNotSentNotice(guarded(() => readOwnDataValue(p, 'mcp')) ?? []);
927
1064
  if (assertionLine !== undefined)
928
1065
  out.push({ level: 'warn', text: `cloud config: ${assertionLine}` });
@@ -16,7 +16,6 @@ export interface AllowDenyPolicyOptionsView {
16
16
  deny?: string[];
17
17
  onInvalidName?: 'throw' | 'skip';
18
18
  onInvalidNameIssue?: (issue: AllowDenyInvalidNameIssueView) => void;
19
- scope?: 'grant' | 'narrowing';
20
19
  }
21
20
  export interface AllowDenyInvalidNameIssueView {
22
21
  entry: string;
@@ -118,6 +117,13 @@ export type McpToolAxesReadView = {
118
117
  readonly ok: false;
119
118
  readonly problem: string;
120
119
  };
120
+ export type McpToolFacesReadView = {
121
+ readonly ok: true;
122
+ readonly faces?: Readonly<Record<string, object>>;
123
+ } | {
124
+ readonly ok: false;
125
+ readonly problem: string;
126
+ };
121
127
  export interface CoreValuePorts {
122
128
  resolveAutonomousLoopPrompt: (prompt: string, opts?: AutonomousLoopPromptOptionsView) => string | null;
123
129
  loosenReasons: (prior: SessionPermissionRules, next: SessionPermissionRules) => string[];
@@ -141,8 +147,10 @@ export interface CoreValuePorts {
141
147
  judgeRuleToolName(name: string, roster: ReadonlySet<string>): RuleToolNameVerdictView;
142
148
  readRuleEntry(raw: {} | null | undefined, behavior: 'allow' | 'deny', roster?: ReadonlySet<string>): RuleEntryReadingView;
143
149
  readMcpToolAxes(declared: {} | null | undefined): McpToolAxesReadView;
150
+ ANTHROPIC_DEFAULT_BASE_URL: string;
151
+ readToolFaces(declared: {} | null | undefined): McpToolFacesReadView;
144
152
  }
145
- export declare const CORE_VALUE_PORT_NAMES: readonly ["resolveAutonomousLoopPrompt", "loosenReasons", "combinePolicies", "createAllowDenyPolicy", "MCP_NAMESPACE", "protocolOf", "ruleToolGrammarOf", "validatePermissionRules", "mintNamespacePrefix", "compileAllowList", "routeKeyOf", "joinRequestUrl", "resolveRouteCredential", "adjudicateModelRoute", "routePairingStatus", "judgeRuleToolName", "readRuleEntry", "readMcpToolAxes"];
153
+ export declare const CORE_VALUE_PORT_NAMES: readonly ["resolveAutonomousLoopPrompt", "loosenReasons", "combinePolicies", "createAllowDenyPolicy", "MCP_NAMESPACE", "protocolOf", "ruleToolGrammarOf", "validatePermissionRules", "mintNamespacePrefix", "compileAllowList", "routeKeyOf", "joinRequestUrl", "resolveRouteCredential", "adjudicateModelRoute", "routePairingStatus", "judgeRuleToolName", "readRuleEntry", "readMcpToolAxes", "ANTHROPIC_DEFAULT_BASE_URL", "readToolFaces"];
146
154
  export type CoreValuePortName = (typeof CORE_VALUE_PORT_NAMES)[number];
147
155
  export declare function installCoreValuePorts(ports: Partial<CoreValuePorts> | null): () => void;
148
156
  export declare function hasCoreValuePorts(): boolean;
@@ -170,3 +178,5 @@ export declare function routePairingStatus(brain: {
170
178
  }, model: RouteModelView, perModelAuth?: PerModelAuthView): RoutePairingStatusView | undefined;
171
179
  export declare function readRuleEntry(raw: {} | null | undefined, behavior: 'allow' | 'deny', roster?: ReadonlySet<string>): RuleEntryReadingView | undefined;
172
180
  export declare function readMcpToolAxes(declared: {} | null | undefined): McpToolAxesReadView | undefined;
181
+ export declare function anthropicDefaultBaseUrl(): string | undefined;
182
+ export declare function readToolFaces(declared: {} | null | undefined): McpToolFacesReadView | undefined;
@@ -17,6 +17,8 @@ export const CORE_VALUE_PORT_NAMES = Object.freeze([
17
17
  'judgeRuleToolName',
18
18
  'readRuleEntry',
19
19
  'readMcpToolAxes',
20
+ 'ANTHROPIC_DEFAULT_BASE_URL',
21
+ 'readToolFaces',
20
22
  ]);
21
23
  let installed = null;
22
24
  export function installCoreValuePorts(ports) {
@@ -109,3 +111,10 @@ export function readMcpToolAxes(declared) {
109
111
  const fn = port('readMcpToolAxes');
110
112
  return fn === undefined ? undefined : fn(declared);
111
113
  }
114
+ export function anthropicDefaultBaseUrl() {
115
+ return port('ANTHROPIC_DEFAULT_BASE_URL');
116
+ }
117
+ export function readToolFaces(declared) {
118
+ const fn = port('readToolFaces');
119
+ return fn === undefined ? undefined : fn(declared);
120
+ }
@@ -2,7 +2,7 @@ import { corruptStoredRowContent, corruptStoredRowWhere, scenarioDenyFromError,
2
2
  import { checkpointUnsupportedVersionContent, checkpointUnsupportedVersionFromError, parkedResumeStartupContent, parkedResumeStartupFromError, resumePolicyBlockContent, resumePolicyBlockFromError, } from './resumeRefusalCopy.js';
3
3
  import { askGoneContent, askGoneFromError, decideParkMovedContent, decideParkMovedFromError } from './decideReceipt.js';
4
4
  import { fieldLimitRefusalContent, fieldLimitRefusalFromError } from './wireRefusalCopy.js';
5
- import { DECISION_ANSWER_INVALID_CONTENT, decisionConflictOf } from './hitl/decisionConflict.js';
5
+ import { DECISION_ANSWER_INVALID_CONTENT, decisionConflictOf, decisionGrantChangedContent } from './hitl/decisionConflict.js';
6
6
  export function decideFailureNote(err, decision) {
7
7
  const where = corruptStoredRowWhere(err);
8
8
  const fold = resumePolicyBlockFromError(err);
@@ -12,7 +12,8 @@ export function decideFailureNote(err, decision) {
12
12
  const scenario = scenarioDenyFromError(err);
13
13
  const unsupported = checkpointUnsupportedVersionFromError(err);
14
14
  const gone = askGoneFromError(err);
15
- const answerInvalid = decisionConflictOf(err) === 'answer_invalid';
15
+ const conflict = decisionConflictOf(err);
16
+ const answerInvalid = conflict === 'answer_invalid';
16
17
  return ((where === undefined ? '' : ` — ${corruptStoredRowContent(where)}`) +
17
18
  (fold === null ? '' : ` — ${resumePolicyBlockContent(fold)}`) +
18
19
  (bucket === null ? '' : ` — ${fieldLimitRefusalContent(bucket)}`) +
@@ -21,5 +22,6 @@ export function decideFailureNote(err, decision) {
21
22
  (moved === null ? '' : ` — ${decideParkMovedContent(moved)}`) +
22
23
  (unsupported === null ? '' : ` — ${checkpointUnsupportedVersionContent(unsupported)}`) +
23
24
  (gone === null ? '' : ` — ${askGoneContent(gone)}`) +
24
- (answerInvalid ? ` — ${DECISION_ANSWER_INVALID_CONTENT}` : ''));
25
+ (answerInvalid ? ` — ${DECISION_ANSWER_INVALID_CONTENT}` : '') +
26
+ (conflict === 'grant_changed' ? ` — ${decisionGrantChangedContent()}` : ''));
25
27
  }
@@ -3,7 +3,7 @@ import { readOwnDataValue } from './ownKey.js';
3
3
  import { resumeReopenFromError } from './hitl/suspendedReopen.js';
4
4
  import { ASK_GONE, DECIDE_CLAIM_LOST, CONFLICT_NOT_RESUMABLE, GATE_NOT_TOOL_APPROVAL, DECIDE_GATE_MOVED, DECIDE_NOT_PARKED, DECIDE_WORKFLOW_HOST_UNKNOWN, DECIDE_WORKFLOW_LANE_CODES, DECIDE_WORKFLOW_PARK_FORKED, DECIDE_WORKFLOW_PARKS_UNREADABLE, DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, isDecideParkMovedCode, } from './engineErrorCodes.js';
5
5
  import { effectiveWireErrorCode } from './wireErrorTriage.js';
6
- import { readErrorString, readErrorStrictStringList, readThrownExtra } from './wireFailureShape.js';
6
+ import { isSlotCarrier, readErrorString, readErrorStrictStringList, readThrownExtra } from './wireFailureShape.js';
7
7
  import { isCrashConvergedCause } from './hitl/crashConverged.js';
8
8
  import { askRowEndingCauseFor } from './hitl/approvalEndingCause.js';
9
9
  const STATUS_RESUMING = 'resuming';
@@ -166,7 +166,7 @@ function askGoneRawCause(e) {
166
166
  return undefined;
167
167
  }
168
168
  export function askGoneFromError(e) {
169
- if (typeof e !== 'object' || e === null)
169
+ if (!isSlotCarrier(e))
170
170
  return null;
171
171
  if (effectiveWireErrorCode(e) !== ASK_GONE)
172
172
  return null;
@@ -1,4 +1,4 @@
1
- import { engineWireTarget } from './engineWireTarget.js';
1
+ import { engineWireTargetBaseUrl } from './engineWireTarget.js';
2
2
  import { createEngineCapReader, unreadableReadingDetail } from './engineCapReader.js';
3
3
  import { ownDataField } from './ownKey.js';
4
4
  import { capForDisplay } from './fleetTaskDesc.js';
@@ -44,7 +44,7 @@ const reader = createEngineCapReader({
44
44
  name: 'deviceExecutor.management',
45
45
  project: projectDeviceExecutorManagementCapability,
46
46
  });
47
- export function observedDeviceExecutorManagement(baseUrl = engineWireTarget()?.baseUrl) {
47
+ export function observedDeviceExecutorManagement(baseUrl = engineWireTargetBaseUrl()) {
48
48
  return reader.observed(baseUrl);
49
49
  }
50
50
  export function deviceManagementVerbsAvailable(reading) {
@@ -2,7 +2,7 @@ import { SETTINGS_DEVICE_CODE_TTL_SECONDS, SETTINGS_DEVICE_POLL_INTERVAL_SECONDS
2
2
  function positiveSecondsOf(reading, key) {
3
3
  try {
4
4
  const desc = Object.getOwnPropertyDescriptor(reading, key);
5
- if (desc === undefined || !('value' in desc))
5
+ if (desc === undefined || !Object.hasOwn(desc, 'value'))
6
6
  return undefined;
7
7
  const v = desc.value;
8
8
  return typeof v === 'number' && Number.isFinite(v) && v > 0 ? v : undefined;
@@ -1,5 +1,5 @@
1
1
  export declare function refuseBadDisableSkills(v: unknown, who: string): void;
2
- export declare function refuseDisableSkillsConflict(disableSkills: unknown, skills: unknown, agents: unknown, who: string): void;
2
+ export declare function refuseDisableSkillsConflict(disableSkills: unknown, skills: unknown, agents: unknown, who: string, userInvokedSkills?: readonly string[] | null): void;
3
3
  type DisableSkillsWithheldCause = 'not_reported' | 'unsupported' | 'unprobed' | 'unreadable';
4
4
  export type DisableSkillsDeclaration = {
5
5
  readonly field: {
@@ -17,14 +17,15 @@ export function refuseBadDisableSkills(v, who) {
17
17
  }
18
18
  const nonEmptyArray = (v) => Array.isArray(v) && v.length > 0;
19
19
  const anyAgentCarriesSkills = (agents) => Array.isArray(agents) && agents.some((a) => typeof a === 'object' && a !== null && nonEmptyArray(a.skills));
20
- export function refuseDisableSkillsConflict(disableSkills, skills, agents, who) {
20
+ export function refuseDisableSkillsConflict(disableSkills, skills, agents, who, userInvokedSkills) {
21
21
  if (disableSkills !== true)
22
22
  return;
23
23
  const inSkills = nonEmptyArray(skills);
24
24
  const inAgents = anyAgentCarriesSkills(agents);
25
- if (!inSkills && !inAgents)
25
+ const inNamed = nonEmptyArray(userInvokedSkills);
26
+ if (!inSkills && !inAgents && !inNamed)
26
27
  return;
27
- const which = inSkills && inAgents ? 'skills 与 agents[].skills' : inSkills ? 'skills' : 'agents[].skills';
28
+ const which = [inSkills ? 'skills' : '', inAgents ? 'agents[].skills' : '', inNamed ? 'userInvokedSkills' : ''].filter((x) => x !== '').join(' 与 ');
28
29
  throw new TypeError(`${who}: disableSkills: true(这一发一只技能都不装)与非空的 ${which} 同在 —— 二选一:要关技能就别交技能,要交技能就别带 disableSkills。` +
29
30
  '上游对这一组合同样拒收(在任何东西跑起来之前);本层在装配前拒,不让它走一次往返。错误文本只报键名,不回显技能名。');
30
31
  }