@theokit/sdk 3.2.3 → 3.3.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e81e994: SE1 — the permission model is now resolved PER RUN. `SendOptions.permissionMode` (per-send) and `AgentOptions.permissionMode` (creation-time default) thread a `PermissionMode` (`default | plan | acceptEdits | bypass`, with `bypassPermissions` as the Anthropic-exact alias of `bypass`) into a registered `PermissionPlugin`'s pre-tool gate, with documented precedence (send > create > plugin construction > `default`). Also: the `canUseTool` gate is now fail-CLOSED on any non-`allow` decision (was fail-open — a malformed/undefined return previously allowed); a `g`/`y`-flag `RegExp` arg matcher is reset before each test (deterministic authorization). Full `PermissionMode` + `canUseTool` surface documented in docs.md.
8
+
3
9
  ## 3.2.3
4
10
 
5
11
  ### Patch Changes
@@ -8845,7 +8845,9 @@ async function vetoFromPluginPreHook(inputs, call, callId, events) {
8845
8845
  name: call.name,
8846
8846
  args: call.input,
8847
8847
  agentId: inputs.agentId,
8848
- runId: inputs.runId
8848
+ runId: inputs.runId,
8849
+ // SE1 — thread the run's permission mode so a PermissionPlugin gates per-run.
8850
+ ...inputs.permissionMode !== void 0 ? { permissionMode: inputs.permissionMode } : {}
8849
8851
  });
8850
8852
  if (pluginVeto === void 0) return void 0;
8851
8853
  emitRunEvent(inputs.runEventSink, {
@@ -13256,6 +13258,10 @@ function buildLoopInputs(options, runId, userText) {
13256
13258
  ...options.onDelta !== void 0 ? { onDelta: options.onDelta } : {},
13257
13259
  ...options.sendOptions.toolChoice !== void 0 ? { toolChoice: options.sendOptions.toolChoice } : {},
13258
13260
  ...options.sendOptions.activeTools !== void 0 ? { activeTools: options.sendOptions.activeTools } : {},
13261
+ // SE1 — resolve the run's permission mode: per-send wins over creation-time.
13262
+ ...(options.sendOptions.permissionMode ?? options.agentOptions.permissionMode) !== void 0 ? {
13263
+ permissionMode: options.sendOptions.permissionMode ?? options.agentOptions.permissionMode
13264
+ } : {},
13259
13265
  ...options.priorMessages !== void 0 ? { priorMessages: options.priorMessages } : {},
13260
13266
  ...options.memoryTools !== void 0 && options.memoryTools.length > 0 ? { memoryTools: options.memoryTools } : {},
13261
13267
  ...buildCustomToolsInput(