@sema-agent/core 7.42.0 → 7.43.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 (89) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/dist/agents/send-message-tool.js +1 -0
  3. package/dist/agents/subagent.d.ts +1 -0
  4. package/dist/agents/subagent.js +5 -3
  5. package/dist/agents/teacher.js +1 -1
  6. package/dist/agents/verify.js +2 -0
  7. package/dist/core/allow-entry.d.ts +50 -31
  8. package/dist/core/allow-entry.js +100 -37
  9. package/dist/core/ask-origin.d.ts +16 -5
  10. package/dist/core/ask-origin.js +11 -3
  11. package/dist/core/ask-unresolvable-notice.d.ts +3 -2
  12. package/dist/core/ask-unresolvable-notice.js +1 -1
  13. package/dist/core/auto-mode.d.ts +5 -4
  14. package/dist/core/auto-mode.js +3 -1
  15. package/dist/core/checkpoint-store.d.ts +19 -8
  16. package/dist/core/checkpoint-store.js +8 -4
  17. package/dist/core/child-clamp-seats.d.ts +15 -1
  18. package/dist/core/child-clamp-seats.js +6 -2
  19. package/dist/core/classifier-unavailable-arm.d.ts +42 -23
  20. package/dist/core/classifier-unavailable-arm.js +14 -3
  21. package/dist/core/decision-receipt.js +2 -0
  22. package/dist/core/gate-lanes.js +37 -29
  23. package/dist/core/hooks.d.ts +6 -1
  24. package/dist/core/hooks.js +3 -0
  25. package/dist/core/mode-policy.d.ts +5 -4
  26. package/dist/core/mode-policy.js +4 -0
  27. package/dist/core/permission-rule-consent.d.ts +3 -2
  28. package/dist/core/permission-rule-consent.js +25 -20
  29. package/dist/core/permission-rule-model.d.ts +47 -7
  30. package/dist/core/permission-rule-model.js +80 -6
  31. package/dist/core/permission-rules.d.ts +8 -2
  32. package/dist/core/permission-rules.js +26 -9
  33. package/dist/core/runner/classifier-ladder.d.ts +10 -8
  34. package/dist/core/runner/classifier-ladder.js +3 -1
  35. package/dist/core/runner/denial-limit-arms.d.ts +25 -8
  36. package/dist/core/runner/denial-limit-arms.js +24 -10
  37. package/dist/core/runner/gate-exit.js +2 -1
  38. package/dist/core/runner/permission-rule-lanes.d.ts +2 -2
  39. package/dist/core/runner/permission-rule-lanes.js +8 -2
  40. package/dist/core/runner/prepare-ask-lane.d.ts +3 -0
  41. package/dist/core/runner/prepare-ask-lane.js +2 -1
  42. package/dist/core/runner/prepare-caps-and-workflow.d.ts +2 -3
  43. package/dist/core/runner/prepare-caps-and-workflow.js +3 -2
  44. package/dist/core/runner/prepare-config-doors.d.ts +3 -0
  45. package/dist/core/runner/prepare-config-doors.js +6 -5
  46. package/dist/core/runner/prepare-gate-stations.js +1 -1
  47. package/dist/core/runner/prepare-inherited-gate.d.ts +7 -5
  48. package/dist/core/runner/prepare-inherited-gate.js +5 -3
  49. package/dist/core/runner/prepare-park-ask.d.ts +4 -4
  50. package/dist/core/runner/prepare-park-ask.js +2 -4
  51. package/dist/core/runner/prepare-policy-chain.d.ts +7 -1
  52. package/dist/core/runner/prepare-policy-chain.js +59 -38
  53. package/dist/core/runner/prepare-project-context.js +6 -2
  54. package/dist/core/runner/prepare-task.js +6 -6
  55. package/dist/core/runner/prepare-wiring-manifest.d.ts +6 -5
  56. package/dist/core/runner/prepare-wiring-manifest.js +8 -9
  57. package/dist/core/runner/resume-checkpoint-screen.js +1 -1
  58. package/dist/core/runner/steer-admission.js +2 -1
  59. package/dist/core/runner/stream-steer-verb.js +2 -2
  60. package/dist/core/runner/synthetic-tools.d.ts +3 -2
  61. package/dist/core/runner/synthetic-tools.js +1 -1
  62. package/dist/core/session-policy-store.d.ts +3 -3
  63. package/dist/core/session-policy-store.js +18 -4
  64. package/dist/core/skill-grant-binding.d.ts +44 -0
  65. package/dist/core/skill-grant-binding.js +22 -0
  66. package/dist/core/skill-grant.d.ts +59 -28
  67. package/dist/core/skill-grant.js +96 -23
  68. package/dist/core/task-notification.d.ts +6 -0
  69. package/dist/core/task-notification.js +3 -0
  70. package/dist/core/task-spec.d.ts +14 -1
  71. package/dist/core/tighten-task-spec.d.ts +2 -0
  72. package/dist/core/tighten-task-spec.js +3 -0
  73. package/dist/core/tool-name-aliases.d.ts +35 -5
  74. package/dist/core/tool-name-aliases.js +29 -4
  75. package/dist/core/tool-policy.d.ts +10 -0
  76. package/dist/core/tool-policy.js +9 -2
  77. package/dist/core/tool-spec.d.ts +7 -0
  78. package/dist/core/wiring-manifest.d.ts +56 -14
  79. package/dist/core/wiring-manifest.js +29 -4
  80. package/dist/index.d.ts +4 -3
  81. package/dist/index.js +3 -3
  82. package/dist/orchestration/run-workflow-tool.d.ts +4 -0
  83. package/dist/orchestration/run-workflow-tool.js +1 -1
  84. package/dist/orchestration/workflow-primitives.d.ts +3 -1
  85. package/dist/orchestration/workflow-primitives.js +6 -6
  86. package/package.json +1 -1
  87. package/test/export-surface.snapshot.json +13 -1
  88. package/wire-changes/core@7.42.1.json +56 -0
  89. package/wire-changes/core@7.43.0.json +985 -0
@@ -5,6 +5,22 @@ import { canonicalize } from "./canonical-json.js";
5
5
  import { resolveCheckpointStore } from "./checkpoint-store.js";
6
6
  import { isLiveQuestionFace } from "./ask-question.js";
7
7
  import { AUTO_MODE_DENY_SOURCES, isAutoModeDenySource } from "./runtime-caps.js";
8
+ import { describeRejectedValue } from "./tool-search-setting.js";
9
+ export const APPROVAL_REACH = Object.freeze(["none"]);
10
+ const APPROVAL_REACH_SET = new Set(APPROVAL_REACH);
11
+ export function isApprovalReach(v) {
12
+ return APPROVAL_REACH_SET.has(v);
13
+ }
14
+ export function screenApprovalReach(v) {
15
+ if (v === undefined)
16
+ return undefined;
17
+ if (isApprovalReach(v))
18
+ return v;
19
+ const e = new Error(`approvalReach ${describeRejectedValue(v)} is not a recognized declaration (${APPROVAL_REACH.map((w) => JSON.stringify(w)).join(" | ")}) — ` +
20
+ `omit it when a person may be asked; an unreadable declaration is refused, never folded to either reading.`);
21
+ e.code = "config.approval_reach_invalid";
22
+ throw e;
23
+ }
8
24
  export const AUTO_MODE_ARM_REASONS = Object.freeze(["armed", "no_intent", "no_face", "denied", "resolver_fault"]);
9
25
  export const LSP_LANES = Object.freeze(["tool", "diagnostics", "tool_and_diagnostics"]);
10
26
  export function deriveHandsSeam(handsMounted) {
@@ -53,6 +69,7 @@ export function deriveAskEffective(form, parkEffective, mode) {
53
69
  case "deny":
54
70
  return parkEffective === true ? "park_only" : parkEffective === "unresolved" ? "unresolved" : "auto_deny";
55
71
  case "absent":
72
+ case "declared_none":
56
73
  return parkEffective === true ? "park_only" : parkEffective === "unresolved" ? "unresolved" : "auto_deny";
57
74
  default: {
58
75
  const _exhaustive = form;
@@ -211,10 +228,12 @@ export function deriveWiringManifest(facts) {
211
228
  }
212
229
  return manifest;
213
230
  }
214
- export function resolveAskSeamForm(spec, deps) {
215
- const seat = spec.onAsk !== undefined ? { value: spec.onAsk, provenance: "spec" } : deps.onAsk !== undefined ? { value: deps.onAsk, provenance: "deps" } : undefined;
231
+ export function resolveAskSeat(spec, deps) {
232
+ const specValue = spec.onAsk;
233
+ const seat = specValue !== undefined ? { value: specValue, provenance: "spec" } : ((v) => (v !== undefined ? { value: v, provenance: "deps" } : undefined))(deps.onAsk);
234
+ const reach = screenApprovalReach(spec.approvalReach);
216
235
  if (seat === undefined)
217
- return { form: "absent" };
236
+ return Object.freeze(reach === undefined ? { value: undefined, form: "absent" } : { value: undefined, form: "declared_none", reach });
218
237
  const v = seat.value;
219
238
  const form = typeof v === "function" ? "callback" : v === "allow" ? "allow" : v === "deny" ? "deny" : undefined;
220
239
  if (form === undefined) {
@@ -223,7 +242,13 @@ export function resolveAskSeamForm(spec, deps) {
223
242
  e.code = "config.interaction_wiring";
224
243
  throw e;
225
244
  }
226
- return { form, provenance: seat.provenance };
245
+ if (reach !== undefined && form === "callback")
246
+ return Object.freeze({ value: undefined, form: "declared_none", provenance: seat.provenance, reach });
247
+ return Object.freeze({ value: v, form, provenance: seat.provenance, ...(reach !== undefined ? { reach } : {}) });
248
+ }
249
+ export function resolveAskSeamForm(spec, deps) {
250
+ const seat = resolveAskSeat(spec, deps);
251
+ return { form: seat.form, ...(seat.provenance !== undefined ? { provenance: seat.provenance } : {}) };
227
252
  }
228
253
  export function resolveQuestionSeam(spec, deps) {
229
254
  const seat = spec.onQuestion !== undefined ? { value: spec.onQuestion, provenance: "spec" } : deps.onQuestion !== undefined ? { value: deps.onQuestion, provenance: "deps" } : undefined;
package/dist/index.d.ts CHANGED
@@ -145,7 +145,7 @@ export { judgeRuleToolName, RULE_TOOL_NAME_VERDICTS, type RuleToolNameVerdict }
145
145
  export { DEFAULT_SUBAGENT_TOOL_NAME } from "./agents/subagent.js";
146
146
  export { renderTaskNotificationXml, RESUPPLIED_FRAME_PREAMBLE, taskNotificationDedupKey, isDelegatedAgentTerminal, isTerminalTaskNotification, SystemInjectionQueue, type TaskNotificationPayload, type TaskNotificationStatus, type ExternalNotificationInput, type SystemInjection, type SystemInjectionPriority, type NotificationInjectionOutcome, // the injector's outcome words (`parked_durably` = the session's durable box took the frame)
147
147
  NOTIFICATION_INJECTION_OUTCOMES, // …and their value half + guard, so a host wiring its own uplink validates a reported outcome without duplicating the vocabulary
148
- isNotificationInjectionOutcome, SYSTEM_INJECTION_PRIORITIES, isSystemInjectionPriority, AGENT_MESSAGE_TAG, renderAgentMessageFrame, type SemaProvenance, HANDBACK_STATES, type HandbackState, COMPACTION_KINDS, type CompactionKind, handbackStateOf, terminalFrameFacets, } from "./core/task-notification.js";
148
+ isNotificationInjectionOutcome, SYSTEM_INJECTION_PRIORITIES, isSystemInjectionPriority, steerPriorityOf, AGENT_MESSAGE_TAG, renderAgentMessageFrame, type SemaProvenance, HANDBACK_STATES, type HandbackState, COMPACTION_KINDS, type CompactionKind, handbackStateOf, terminalFrameFacets, } from "./core/task-notification.js";
149
149
  export { TOOL_FAMILIES, TOOL_MOUNT_TAGS, TOOL_APPROVAL_CARDS, TOOL_PATH_ACCESSES, TOOL_PATH_BASES, TOOL_PATH_ABSENCES, TOOL_WIRE_NAME_MAX_CHARS, TOOL_CONTRACT_MAX_CHARS, TOOL_CARD_ID_MAX_CHARS, TOOL_KEY_MAX_CHARS, TOOL_KEYS_MAX, RENDER_HINT_MAX_CHARS, RENDER_HINT_ACTIVITY_MAX_CHARS, RENDER_HINT_MAX_LIST, type ToolFamily, type ToolMountTag, type ToolApprovalCard, type ToolPathAccess, type ToolPathBase, type ToolPathAbsence, type ToolPathTarget, type ToolCallPathTarget, type ToolRosterPathTarget, pathTargetSlotOnly, type ToolRuleFace, type ToolRenderHints, type ToolFaceDeclaration, type ToolCatalogEntry, } from "./core/tool-face.js";
150
150
  export { describeToolCatalog, catalogEntriesNamed, catalogToolNames, catalogRuleFaceOf, pathTargetOf, pathTargetValue, protectivePathTargetOf, declaredPathTargetOf, BARE_REQUEST_CODE, isProtectedWrite, isDeclaredWrite, fileOpAccessOf, type ToolCallLike, pathConfinableWriteToolNames, pathTargetingToolNames, compactableToolNames, budgetExemptToolNames, handBandEffects, engineCardTypes, predictMountedToolNames, HANDS_BAND_TAGS, MOUNT_TAG_IN_HANDS_BAND, } from "./core/tool-registry.js";
151
151
  export { ToolRosterEntry, ToolRoster, ToolRosterDelta, ToolRosterRenderHints, ROSTER_SOURCES, type RosterSource, type ToolIdentity, toolIdentityOf, mintCapabilityId, diffToolRoster, judgeParkedToolIdentity, ruleFacesFromRoster, toolCallFaceOf, rosterToolName, ruleNamesOf, inputKeysOf, ruleFaceOfInstance, rosterMemberBoundProblem, type RosterBoundMembers, type RosterBoundCode, ToolRosterDeltaSeat, } from "./core/tool-roster.js";
@@ -162,7 +162,7 @@ export { parkedToolIdentity } from "./core/tool-roster.js";
162
162
  export { type ToolCallIdentity } from "./core/fs-write-gate-policy.js";
163
163
  export { type RuleFaceView, catalogRuleFaceView } from "./core/permission-rules.js";
164
164
  export { DURABLE_HISTORY_NAMES } from "./engine/compaction/utils.js";
165
- export { describeStaticWiring, deriveWiringManifest, deriveAskEffective, resolveDeclaredDurability, resolveSubagentTranscriptTier, type SubagentTranscriptTier, resolveAskSeamForm, resolveQuestionSeam, countElicitOptIns, AUTO_MODE_ARM_REASONS, type AutoModeArmReason, type AutoModeArmFact, type WiringManifest, type WiringManifestMcpEntry, LSP_LANES, type LspLane, type WiringFacts, type WiringLegKind, type AskSeamForm, type AskEffective, type QuestionChannelState, type SeamProvenance, type ParkLaneReason, type ManifestDurability, type StaticWiringDeps, type StaticWiringSpec, } from "./core/wiring-manifest.js";
165
+ export { describeStaticWiring, deriveWiringManifest, deriveAskEffective, resolveDeclaredDurability, resolveSubagentTranscriptTier, type SubagentTranscriptTier, resolveAskSeamForm, resolveQuestionSeam, countElicitOptIns, AUTO_MODE_ARM_REASONS, type AutoModeArmReason, type AutoModeArmFact, type WiringManifest, type WiringManifestMcpEntry, LSP_LANES, type LspLane, type WiringFacts, type WiringLegKind, type AskSeamForm, APPROVAL_REACH, type ApprovalReach, isApprovalReach, type AskEffective, type QuestionChannelState, type SeamProvenance, type ParkLaneReason, type ManifestDurability, type StaticWiringDeps, type StaticWiringSpec, } from "./core/wiring-manifest.js";
166
166
  export { probeParkRoundTrip, durableParkGapOf, durableParkGapFor, PARK_SELFCHECK_SCOPE_PREFIX, type ParkSelfCheckResult, type ParkProbeFinding, type ParkProbeFindingCode, } from "./core/park-selfcheck.js";
167
167
  export { type StoreDurability } from "./core/checkpoint-store.js";
168
168
  export { type StoreFidelity } from "./core/checkpoint-store.js";
@@ -192,7 +192,7 @@ export { createAllowDenyPolicy, createApprovalPolicy,
192
192
  * members that seat has no lane for (`"unavailable"`, a routing answer; `updatedInput`, an operator edit a
193
193
  * policy verdict cannot get re-adjudicated). Exported so a host can NAME it instead of deriving it through
194
194
  * `Parameters<typeof createApprovalPolicy>[0]["approve"]`. */
195
- type ApprovalSeatOutcome, COARSE_SHELL_TOOLS, createCoarseCommandNamePolicy, createTranscriptIntegrityPolicy, createUnverifiableDeletePolicy, findUnverifiableRecursiveDelete, combinePolicies, receiveHookResult, isEngineRefusal, wrapToolPolicy, decisionText, resolveAsk, toolPolicyNameSets, toolPolicyPathDenyRules, type ToolPolicyNameSets, type NamedToolPolicy, type ToolPolicyProjection, type ToolPolicyProjectionComponent, type ConstraintChainEntry, checkToolPolicyProjection, constraintChainEntryOf, constraintChainDigest, type ToolPolicy, type ToolCallRequest, type PermissionResult, type DecisionReason, screenApproverAttribution, APPROVER_ATTRIBUTION_MAX_CHARS, type OnAsk, type AskOutcome, type ResolvedAsk, type AskRequest, type AskDelegationProvenance, type AskRuleEvidence, type AskEvidenceAbsence, ASK_EVIDENCE_ABSENCE_VALUES, } from "./core/tool-policy.js";
195
+ type ApprovalSeatOutcome, COARSE_SHELL_TOOLS, createCoarseCommandNamePolicy, createTranscriptIntegrityPolicy, createUnverifiableDeletePolicy, findUnverifiableRecursiveDelete, combinePolicies, abortedSeatDeny, receiveHookResult, isEngineRefusal, wrapToolPolicy, decisionText, resolveAsk, toolPolicyNameSets, toolPolicyPathDenyRules, type ToolPolicyNameSets, type NamedToolPolicy, type ToolPolicyProjection, type ToolPolicyProjectionComponent, type ConstraintChainEntry, checkToolPolicyProjection, constraintChainEntryOf, constraintChainDigest, type ToolPolicy, type ToolCallRequest, type PermissionResult, type DecisionReason, screenApproverAttribution, APPROVER_ATTRIBUTION_MAX_CHARS, type OnAsk, type AskOutcome, type ResolvedAsk, type AskRequest, type AskDelegationProvenance, type AskRuleEvidence, type AskEvidenceAbsence, ASK_EVIDENCE_ABSENCE_VALUES, } from "./core/tool-policy.js";
196
196
  export { type ReadRootGrantScreen } from "./core/read-root-grant-screen.js";
197
197
  export { type AskOrigin, ASK_ORIGINS, isAskOrigin, ORIGIN_IMPLIES_REAL_APPROVAL, PERSISTED_RULE_MANDATES, type PersistedRuleMandate, isPersistedRuleMandate, screenAskClassMembers } from "./core/ask-origin.js";
198
198
  export { PERMISSION_MODES, type PermissionMode, isPermissionMode, PERMISSION_MODE_RANK, clampPermissionMode, ASK_CLASSES, type AskClass, isAskClass, MODE_ARBITRATION, type ModeArbitrationRow, RELEASABLE_ASK_CLASSES, MODE_RELEASE_REASONS, type ModeReleaseReason, isModeReleaseReason, RRA_EXPLAINERS, classifyAsk, foldArbitrationRow, type AskClassification, type AskClassFacts, type ToolMarkSource, arbitrateByMode, type Arbitration, fileCommandOptionsSentence } from "./core/ask-origin.js";
@@ -200,6 +200,7 @@ export { modePolicyOf, type ModePolicy, PERMISSION_MODE_FOLD_REASONS, type Permi
200
200
  export type { PermissionSeatInputs, PermissionSeatReading } from "./core/mode-policy.js";
201
201
  export type { SkillGateSeats, SkillGrantHit, SkillGrantLane, SkillGrantOrigin, SkillGrantRecord } from "./core/skill-grant.js";
202
202
  export { SKILL_GRANT_ORIGINS } from "./core/skill-grant.js";
203
+ export type { BoundSkillGrants } from "./core/skill-grant-binding.js";
203
204
  export { ALLOW_ENTRY_INERT_REASONS, compileAllowEntry, compileAllowList, type AllowEntryInertReason, type CompiledAllowEntry, type AllowEntryGateSeats, type AllowEntryLane, type AllowEntryHit } from "./core/allow-entry.js";
204
205
  export { ALLOW_RULE_MEMBERS, type AllowRuleMember, type AllowRuleShadow } from "./core/allow-rule-shadow.js";
205
206
  export { mintNamespacePrefix } from "./core/protocol-naming.js";
package/dist/index.js CHANGED
@@ -117,7 +117,7 @@ export { createFsWriteGatePolicy, WRITE_EXEMPT_DIR_COVERS_ROOT_CODE } from "./co
117
117
  export { RETIRED_TOOL_NAMES } from "./core/tool-name-aliases.js";
118
118
  export { judgeRuleToolName, RULE_TOOL_NAME_VERDICTS } from "./core/tool-name-aliases.js";
119
119
  export { DEFAULT_SUBAGENT_TOOL_NAME } from "./agents/subagent.js";
120
- export { renderTaskNotificationXml, RESUPPLIED_FRAME_PREAMBLE, taskNotificationDedupKey, isDelegatedAgentTerminal, isTerminalTaskNotification, SystemInjectionQueue, NOTIFICATION_INJECTION_OUTCOMES, isNotificationInjectionOutcome, SYSTEM_INJECTION_PRIORITIES, isSystemInjectionPriority, AGENT_MESSAGE_TAG, renderAgentMessageFrame, HANDBACK_STATES, COMPACTION_KINDS, handbackStateOf, terminalFrameFacets, } from "./core/task-notification.js";
120
+ export { renderTaskNotificationXml, RESUPPLIED_FRAME_PREAMBLE, taskNotificationDedupKey, isDelegatedAgentTerminal, isTerminalTaskNotification, SystemInjectionQueue, NOTIFICATION_INJECTION_OUTCOMES, isNotificationInjectionOutcome, SYSTEM_INJECTION_PRIORITIES, isSystemInjectionPriority, steerPriorityOf, AGENT_MESSAGE_TAG, renderAgentMessageFrame, HANDBACK_STATES, COMPACTION_KINDS, handbackStateOf, terminalFrameFacets, } from "./core/task-notification.js";
121
121
  export { TOOL_FAMILIES, TOOL_MOUNT_TAGS, TOOL_APPROVAL_CARDS, TOOL_PATH_ACCESSES, TOOL_PATH_BASES, TOOL_PATH_ABSENCES, TOOL_WIRE_NAME_MAX_CHARS, TOOL_CONTRACT_MAX_CHARS, TOOL_CARD_ID_MAX_CHARS, TOOL_KEY_MAX_CHARS, TOOL_KEYS_MAX, RENDER_HINT_MAX_CHARS, RENDER_HINT_ACTIVITY_MAX_CHARS, RENDER_HINT_MAX_LIST, pathTargetSlotOnly, } from "./core/tool-face.js";
122
122
  export { describeToolCatalog, catalogEntriesNamed, catalogToolNames, catalogRuleFaceOf, pathTargetOf, pathTargetValue, protectivePathTargetOf, declaredPathTargetOf, BARE_REQUEST_CODE, isProtectedWrite, isDeclaredWrite, fileOpAccessOf, pathConfinableWriteToolNames, pathTargetingToolNames, compactableToolNames, budgetExemptToolNames, handBandEffects, engineCardTypes, predictMountedToolNames, HANDS_BAND_TAGS, MOUNT_TAG_IN_HANDS_BAND, } from "./core/tool-registry.js";
123
123
  export { ToolRosterEntry, ToolRoster, ToolRosterDelta, ToolRosterRenderHints, ROSTER_SOURCES, toolIdentityOf, mintCapabilityId, diffToolRoster, judgeParkedToolIdentity, ruleFacesFromRoster, toolCallFaceOf, rosterToolName, ruleNamesOf, inputKeysOf, ruleFaceOfInstance, rosterMemberBoundProblem, ToolRosterDeltaSeat, } from "./core/tool-roster.js";
@@ -134,7 +134,7 @@ export { parkedToolIdentity } from "./core/tool-roster.js";
134
134
  export {} from "./core/fs-write-gate-policy.js";
135
135
  export { catalogRuleFaceView } from "./core/permission-rules.js";
136
136
  export { DURABLE_HISTORY_NAMES } from "./engine/compaction/utils.js";
137
- export { describeStaticWiring, deriveWiringManifest, deriveAskEffective, resolveDeclaredDurability, resolveSubagentTranscriptTier, resolveAskSeamForm, resolveQuestionSeam, countElicitOptIns, AUTO_MODE_ARM_REASONS, LSP_LANES, } from "./core/wiring-manifest.js";
137
+ export { describeStaticWiring, deriveWiringManifest, deriveAskEffective, resolveDeclaredDurability, resolveSubagentTranscriptTier, resolveAskSeamForm, resolveQuestionSeam, countElicitOptIns, AUTO_MODE_ARM_REASONS, LSP_LANES, APPROVAL_REACH, isApprovalReach, } from "./core/wiring-manifest.js";
138
138
  export { probeParkRoundTrip, durableParkGapOf, durableParkGapFor, PARK_SELFCHECK_SCOPE_PREFIX, } from "./core/park-selfcheck.js";
139
139
  export {} from "./core/checkpoint-store.js";
140
140
  export {} from "./core/checkpoint-store.js";
@@ -157,7 +157,7 @@ export { hasScheduler, isValidCronExpr, SchedulerError } from "./core/scheduler.
157
157
  export { createSchedulerTools, SCHEDULE_WAKEUP_TOOL_NAME, AUTONOMOUS_LOOP_SENTINEL, AUTONOMOUS_LOOP_DYNAMIC_SENTINEL, } from "./tools/scheduler-tools.js";
158
158
  export { resolveAutonomousLoopPrompt, AUTONOMOUS_LOOP_PREAMBLE, AUTONOMOUS_LOOP_PREAMBLE_PERSISTENT, } from "./tools/loop-tick.js";
159
159
  export { tightenTaskSpec, TaskSpecTightenError } from "./core/tighten-task-spec.js";
160
- export { createAllowDenyPolicy, createApprovalPolicy, COARSE_SHELL_TOOLS, createCoarseCommandNamePolicy, createTranscriptIntegrityPolicy, createUnverifiableDeletePolicy, findUnverifiableRecursiveDelete, combinePolicies, receiveHookResult, isEngineRefusal, wrapToolPolicy, decisionText, resolveAsk, toolPolicyNameSets, toolPolicyPathDenyRules, checkToolPolicyProjection, constraintChainEntryOf, constraintChainDigest, screenApproverAttribution, APPROVER_ATTRIBUTION_MAX_CHARS, ASK_EVIDENCE_ABSENCE_VALUES, } from "./core/tool-policy.js";
160
+ export { createAllowDenyPolicy, createApprovalPolicy, COARSE_SHELL_TOOLS, createCoarseCommandNamePolicy, createTranscriptIntegrityPolicy, createUnverifiableDeletePolicy, findUnverifiableRecursiveDelete, combinePolicies, abortedSeatDeny, receiveHookResult, isEngineRefusal, wrapToolPolicy, decisionText, resolveAsk, toolPolicyNameSets, toolPolicyPathDenyRules, checkToolPolicyProjection, constraintChainEntryOf, constraintChainDigest, screenApproverAttribution, APPROVER_ATTRIBUTION_MAX_CHARS, ASK_EVIDENCE_ABSENCE_VALUES, } from "./core/tool-policy.js";
161
161
  export {} from "./core/read-root-grant-screen.js";
162
162
  export { ASK_ORIGINS, isAskOrigin, ORIGIN_IMPLIES_REAL_APPROVAL, PERSISTED_RULE_MANDATES, isPersistedRuleMandate, screenAskClassMembers } from "./core/ask-origin.js";
163
163
  export { PERMISSION_MODES, isPermissionMode, PERMISSION_MODE_RANK, clampPermissionMode, ASK_CLASSES, isAskClass, MODE_ARBITRATION, RELEASABLE_ASK_CLASSES, MODE_RELEASE_REASONS, isModeReleaseReason, RRA_EXPLAINERS, classifyAsk, foldArbitrationRow, arbitrateByMode, fileCommandOptionsSentence } from "./core/ask-origin.js";
@@ -293,6 +293,10 @@ export interface RunWorkflowToolDeps {
293
293
  * `ToolExecuteContext.interactiveTools` seat — without it a headless-clamped host's workflow
294
294
  * children could re-mount the interactive tool the host run disabled. */
295
295
  parentInteractiveTools?: false;
296
+ /** The HOST task's declaration that nobody on it can be asked to approve (`TaskSpec.approvalReach: "none"`), same
297
+ * carriage rules as the two clamps above: only `"none"` travels, and the auto-mount's minimal ctx makes this dep its one
298
+ * carrier — without it a declared-none host's workflow children fell back to the deployment's live approver. */
299
+ parentApprovalReach?: "none";
296
300
  /** Call-time getter for the HOST task's RESOLVED model AND the word that chose it: a spawned agent whose
297
301
  * fold chain produced no model inherits the object on its spec and the word on its trusted channel
298
302
  * (the subagent lane's `ctx.model` / `ctx.modelRef` pair). Word-less ⇒ the object alone, i.e. a pin. */
@@ -509,7 +509,7 @@ export async function createRunWorkflowTool(d) {
509
509
  const childParkSeat = ctx.checkpointStoreForChildren ?? d.parentCheckpointStore;
510
510
  const parkStore = checkpointStoreOfSeat(childParkSeat);
511
511
  const scriptFn = (wfCtx) => {
512
- const primitives = buildWorkflowPrimitives(wfCtx, runGovernance, d.onAgentSpawn, childParkSeat, parentFaceSeat(ctx.readFace, d.parentReadFace), parentFaceSeat(ctx.writeFace, d.parentWriteFace), d.parentReadDenyPatterns, ctx.handsReadOnly === true || d.parentHandsReadOnly === true, ctx.interactiveTools === false || d.parentInteractiveTools === false);
512
+ const primitives = buildWorkflowPrimitives(wfCtx, runGovernance, d.onAgentSpawn, childParkSeat, parentFaceSeat(ctx.readFace, d.parentReadFace), parentFaceSeat(ctx.writeFace, d.parentWriteFace), d.parentReadDenyPatterns, ctx.handsReadOnly === true || d.parentHandsReadOnly === true, ctx.interactiveTools === false || d.parentInteractiveTools === false, ctx.approvalReach === "none" || d.parentApprovalReach === "none");
513
513
  return d.scriptRunner.run({ scriptSource: script, primitives, scriptArgs: effectiveArgs, signal: wfCtx.signal }).then((r) => r.result);
514
514
  };
515
515
  if (ctx.signal?.aborted) {
@@ -60,4 +60,6 @@ parentReadDenyPatterns?: () => TaskSpec["readDenyPatterns"],
60
60
  parentHandsReadOnly?: boolean,
61
61
  /** #345 ③ — the HOST task's hard-headless clamp is ON (`spec.interactiveTools === false`).
62
62
  * Same tighten-only injection; only the disabling value ever arrives here as `true`. */
63
- parentInteractiveToolsOff?: boolean): WorkflowPrimitives;
63
+ parentInteractiveToolsOff?: boolean,
64
+ /** The HOST task declared that nobody on it can be asked (`approvalReach: "none"`). Same tighten-only injection. */
65
+ parentApprovalReachNone?: boolean): WorkflowPrimitives;
@@ -1,5 +1,5 @@
1
1
  import { assertSupportedAgentIsolation } from "./workflow.js";
2
- import { childClampSeats } from "../core/child-clamp-seats.js";
2
+ import { childClampSeats, postureUnderClamps } from "../core/child-clamp-seats.js";
3
3
  import { WorkflowScriptError } from "./workflow-meta.js";
4
4
  import { buildGovernedChildSpec, emitIgnoredAgentOptionsNotice, overlayWorktreeBaseline, MAX_ANNOUNCED_KEYS, SPEC_KEY_ALIASES, WHITELIST_KEYS, } from "./workflow-governance.js";
5
5
  const ACCEPTED_AGENT_OPTION_KEYS = ["label", "phase", "schema", "agentType", "isolation"];
@@ -66,7 +66,7 @@ function formatResourceClampNote(notes) {
66
66
  const parts = notes.map((n) => `${n.field}: requested ${n.requested === undefined ? "unset" : n.requested} → applied ${n.applied}`);
67
67
  return `workflow governance tightened this agent's resource limits (${parts.join("; ")})`;
68
68
  }
69
- export function buildWorkflowPrimitives(ctx, governance, onAgentSpawn, parentCheckpointStore, parentReadFace, parentWriteFace, parentReadDenyPatterns, parentHandsReadOnly, parentInteractiveToolsOff) {
69
+ export function buildWorkflowPrimitives(ctx, governance, onAgentSpawn, parentCheckpointStore, parentReadFace, parentWriteFace, parentReadDenyPatterns, parentHandsReadOnly, parentInteractiveToolsOff, parentApprovalReachNone) {
70
70
  const agent = (spec, opts) => {
71
71
  if (typeof spec === "string")
72
72
  spec = { objective: spec };
@@ -82,15 +82,15 @@ export function buildWorkflowPrimitives(ctx, governance, onAgentSpawn, parentChe
82
82
  const workflowChildClamps = childClampSeats({
83
83
  handsReadOnly: parentHandsReadOnly,
84
84
  interactiveTools: parentInteractiveToolsOff === true ? false : undefined,
85
+ approvalReach: parentApprovalReachNone === true ? "none" : undefined,
85
86
  readFace: parentReadFace?.() === "roots" ? "roots" : childSpec.readFace,
86
87
  writeFace: parentWriteFace?.() === "roots" ? "roots" : childSpec.writeFace,
87
88
  readDenyPatterns: pd !== undefined && pd.length > 0 ? [...(childSpec.readDenyPatterns ?? []), ...pd] : childSpec.readDenyPatterns,
88
89
  });
89
90
  Object.assign(childSpec, workflowChildClamps);
90
- if (parentInteractiveToolsOff === true) {
91
- if (childSpec.interactionPosture === "interactive")
92
- delete childSpec.interactionPosture;
93
- }
91
+ const posture = postureUnderClamps(childSpec.interactionPosture, { interactiveTools: parentInteractiveToolsOff === true ? false : undefined, approvalReach: parentApprovalReachNone === true ? "none" : undefined });
92
+ if (posture !== undefined)
93
+ childSpec.interactionPosture = posture;
94
94
  if (onAgentSpawn) {
95
95
  return ctx.agentStream(childSpec, agentOpts).then((handle) => {
96
96
  onAgentSpawn(handle);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/core",
3
- "version": "7.42.0",
3
+ "version": "7.43.0",
4
4
  "description": "Stateless, task-oriented AI agent core",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "_comment": "design/87 L3 — frozen public export surface of src/index.ts (name -> kind). DO NOT edit by hand to silence a red test. A removed/changed entry = a SemVer-BREAKING change; bump MAJOR and update this fixture in the SAME commit (design/87 §4.2 / §5.2). Regenerate via REGEN in test/export-surface.test.ts.",
3
3
  "_tierComment": "#435 v1 — machine-readable layering of the public surface: stable = demonstrated by README.md / src/examples; internal = an `Internal`-marked name or a runner/engine deep-subtree declaration (the model seam src/engine/llm is excluded — it is the BYOM contract, not an engine internal); advanced = a supported export the front door does not walk you through. THIS IS AN INITIAL HEURISTIC, derived mechanically and expected to be refined ticket by ticket: no human reviewed these 1700+ entries one by one, and nothing here claims otherwise. Known bias: a short or English-word export name (ok, err, Result, Usage) can match ordinary prose in README.md and land `stable` on a coincidence. Every export MUST carry a tier — a new export with no row fails the gate in export-surface.test.ts.",
4
- "count": 2592,
4
+ "count": 2598,
5
5
  "exports": {
6
6
  "A2ATaskState": "type",
7
7
  "A2ATaskStateReversal": "type",
@@ -24,6 +24,7 @@
24
24
  "ALLOW_RULE_MEMBERS": "variable",
25
25
  "ANNOUNCEMENTS_FILE": "variable",
26
26
  "APPROVAL_CARD_REQUIRED_KEYS": "variable",
27
+ "APPROVAL_REACH": "variable",
27
28
  "APPROVER_ATTRIBUTION_MAX_CHARS": "variable",
28
29
  "ARTIFACT_ACTIONS": "variable",
29
30
  "ARTIFACT_ACTION_CONCURRENCY_SAFE": "variable",
@@ -100,6 +101,7 @@
100
101
  "AllowRuleShadow": "interface",
101
102
  "AnthropicBrainConfig": "interface",
102
103
  "AppendLog": "class",
104
+ "ApprovalReach": "type",
103
105
  "ApprovalSeatOutcome": "type",
104
106
  "Arbitration": "type",
105
107
  "ArtifactAction": "type",
@@ -210,6 +212,7 @@
210
212
  "BeforeWriteHook": "type",
211
213
  "BeforeWriteRequest": "interface",
212
214
  "BeforeWriteResult": "type",
215
+ "BoundSkillGrants": "interface",
213
216
  "Brain": "interface",
214
217
  "BrainError": "class",
215
218
  "BrainErrorCode": "type",
@@ -1767,6 +1770,7 @@
1767
1770
  "WriteProtectionViewAbsence": "interface",
1768
1771
  "WriteReceipt": "interface",
1769
1772
  "XARGS_READ_ONLY_TARGETS": "variable",
1773
+ "abortedSeatDeny": "function",
1770
1774
  "ackAdoptionConfig": "function",
1771
1775
  "acquireCcLock": "function",
1772
1776
  "addDotsOf": "function",
@@ -2123,6 +2127,7 @@
2123
2127
  "inspectDegenerate": "function",
2124
2128
  "isAbsoluteForFamily": "function",
2125
2129
  "isAliasModelId": "function",
2130
+ "isApprovalReach": "function",
2126
2131
  "isAskClass": "function",
2127
2132
  "isAskOrigin": "function",
2128
2133
  "isAutoModeClassifierFallback": "function",
@@ -2524,6 +2529,7 @@
2524
2529
  "splitWorkflowMeta": "function",
2525
2530
  "sqliteQuery": "function",
2526
2531
  "startWorkflow": "function",
2532
+ "steerPriorityOf": "function",
2527
2533
  "storeReadBackShapeContract": "function",
2528
2534
  "stripEngineMetadata": "function",
2529
2535
  "stripFormatCharacters": "function",
@@ -2618,6 +2624,7 @@
2618
2624
  "ALLOW_RULE_MEMBERS": "advanced",
2619
2625
  "ANNOUNCEMENTS_FILE": "advanced",
2620
2626
  "APPROVAL_CARD_REQUIRED_KEYS": "internal",
2627
+ "APPROVAL_REACH": "advanced",
2621
2628
  "APPROVER_ATTRIBUTION_MAX_CHARS": "advanced",
2622
2629
  "ARTIFACT_ACTIONS": "advanced",
2623
2630
  "ARTIFACT_ACTION_CONCURRENCY_SAFE": "advanced",
@@ -2694,6 +2701,7 @@
2694
2701
  "AllowRuleShadow": "advanced",
2695
2702
  "AnthropicBrainConfig": "advanced",
2696
2703
  "AppendLog": "advanced",
2704
+ "ApprovalReach": "advanced",
2697
2705
  "ApprovalSeatOutcome": "advanced",
2698
2706
  "Arbitration": "advanced",
2699
2707
  "ArtifactAction": "advanced",
@@ -2804,6 +2812,7 @@
2804
2812
  "BeforeWriteHook": "stable",
2805
2813
  "BeforeWriteRequest": "advanced",
2806
2814
  "BeforeWriteResult": "advanced",
2815
+ "BoundSkillGrants": "advanced",
2807
2816
  "Brain": "stable",
2808
2817
  "BrainError": "advanced",
2809
2818
  "BrainErrorCode": "advanced",
@@ -4361,6 +4370,7 @@
4361
4370
  "WriteProtectionViewAbsence": "advanced",
4362
4371
  "WriteReceipt": "internal",
4363
4372
  "XARGS_READ_ONLY_TARGETS": "advanced",
4373
+ "abortedSeatDeny": "advanced",
4364
4374
  "ackAdoptionConfig": "advanced",
4365
4375
  "acquireCcLock": "advanced",
4366
4376
  "addDotsOf": "advanced",
@@ -4717,6 +4727,7 @@
4717
4727
  "inspectDegenerate": "advanced",
4718
4728
  "isAbsoluteForFamily": "advanced",
4719
4729
  "isAliasModelId": "advanced",
4730
+ "isApprovalReach": "advanced",
4720
4731
  "isAskClass": "advanced",
4721
4732
  "isAskOrigin": "advanced",
4722
4733
  "isAutoModeClassifierFallback": "advanced",
@@ -5118,6 +5129,7 @@
5118
5129
  "splitWorkflowMeta": "advanced",
5119
5130
  "sqliteQuery": "advanced",
5120
5131
  "startWorkflow": "advanced",
5132
+ "steerPriorityOf": "advanced",
5121
5133
  "storeReadBackShapeContract": "advanced",
5122
5134
  "stripEngineMetadata": "advanced",
5123
5135
  "stripFormatCharacters": "advanced",
@@ -0,0 +1,56 @@
1
+ {
2
+ "repo": "core",
3
+ "version": "7.42.1",
4
+ "from": "708c57d238eecad4d143d7a168159c144a0a5c4c",
5
+ "to": "ee419e2ab4cffe5151da255f4f91ddfa1f475ada",
6
+ "added": [
7
+ {
8
+ "name": "steerPriorityOf",
9
+ "kind": "function",
10
+ "tier": "advanced",
11
+ "at": [
12
+ "src/core/task-notification.ts:49",
13
+ "src/index.ts:1004"
14
+ ],
15
+ "criteriaCovered": false,
16
+ "breaking": false
17
+ }
18
+ ],
19
+ "removed": [],
20
+ "changed": [],
21
+ "narrowed": [],
22
+ "closedSetMembers": [],
23
+ "closedSetsUnreadable": [],
24
+ "typeKeys": [],
25
+ "typeKeysUnreadableArms": [],
26
+ "typeKeysFlattenedCount": 225,
27
+ "signatures": [],
28
+ "declarationMoves": [],
29
+ "mintMoves": [],
30
+ "criteriaObserves": [
31
+ {
32
+ "kind": "typeMember",
33
+ "name": "PendingSteerEntry.inputId",
34
+ "assertions": [
35
+ "G1.b"
36
+ ]
37
+ },
38
+ {
39
+ "kind": "typeMember",
40
+ "name": "PendingSteerEntry.priority",
41
+ "assertions": [
42
+ "G1.a"
43
+ ]
44
+ }
45
+ ],
46
+ "consumersHint": {
47
+ "cli": [],
48
+ "server": [
49
+ "steerPriorityOf"
50
+ ],
51
+ "sdk": [],
52
+ "note": "scanned cli@bf15b2f9 server@72e966f3 sdk@e3a5370 — a name listed is MENTIONED there today, which is evidence of consumption, not proof of it"
53
+ },
54
+ "breakingCount": 0,
55
+ "breakingItems": []
56
+ }