@mondaydotcomorg/atp-server 0.24.4 → 0.25.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/dist/index.js CHANGED
@@ -11450,10 +11450,10 @@ async function handleSearchQuery(ctx, searchEngine, config) {
11450
11450
  __name(handleSearchQuery, "handleSearchQuery");
11451
11451
 
11452
11452
  // src/handlers/explorer.handler.ts
11453
- async function handleExplore(ctx, explorerService) {
11453
+ async function handleExplore(ctx, explorerService, toolRulesProvider) {
11454
11454
  const body = ctx.body;
11455
11455
  const path = body.path || "/";
11456
- const { toolRules } = body;
11456
+ const effectiveToolRules = body.toolRules ?? (toolRulesProvider ? toolRulesProvider(ctx) : void 0);
11457
11457
  const executeExplore = /* @__PURE__ */ __name(() => {
11458
11458
  const result = explorerService.explore(path);
11459
11459
  if (!result) {
@@ -11461,9 +11461,9 @@ async function handleExplore(ctx, explorerService) {
11461
11461
  }
11462
11462
  return result;
11463
11463
  }, "executeExplore");
11464
- if (toolRules && !getRequestScope()?.toolRules) {
11464
+ if (effectiveToolRules && !getRequestScope()?.toolRules) {
11465
11465
  return runInRequestScope({
11466
- toolRules
11466
+ toolRules: effectiveToolRules
11467
11467
  }, executeExplore);
11468
11468
  }
11469
11469
  return executeExplore();
@@ -11633,7 +11633,7 @@ function cleanProvenanceIds(value) {
11633
11633
  return cleaned;
11634
11634
  }
11635
11635
  __name(cleanProvenanceIds, "cleanProvenanceIds");
11636
- async function handleExecute(ctx, executor, stateManager, config, auditSink, sessionManager) {
11636
+ async function handleExecute(ctx, executor, stateManager, config, auditSink, sessionManager, toolRulesProvider) {
11637
11637
  const request = ctx.body;
11638
11638
  const code = request.code || "";
11639
11639
  const requestConfig = request.config || request.options || {};
@@ -11712,7 +11712,10 @@ async function handleExecute(ctx, executor, stateManager, config, auditSink, ses
11712
11712
  },
11713
11713
  onToolCall,
11714
11714
  eventCallback: requestConfig.eventCallback,
11715
- toolRules: requestConfig.toolRules
11715
+ // Rule source precedence: explicit requestConfig.toolRules first, then
11716
+ // server-level provider (e.g. reads a header). Lets in-process callers
11717
+ // and HTTP callers converge on the same provider mechanism.
11718
+ toolRules: requestConfig.toolRules ?? toolRulesProvider?.(ctx)
11716
11719
  };
11717
11720
  let hintMap;
11718
11721
  const prelimExecutionId = crypto.randomUUID();
@@ -22166,13 +22169,13 @@ var AgentToolProtocolServer = class {
22166
22169
  }
22167
22170
  async handleExplore(ctx) {
22168
22171
  if (!this.explorerService) ctx.throw(503, "Explorer not initialized");
22169
- return await handleExplore(ctx, this.explorerService);
22172
+ return await handleExplore(ctx, this.explorerService, this.toolRulesProvider);
22170
22173
  }
22171
22174
  async handleExecute(ctx) {
22172
22175
  if (!this.executor || !this.validator || !this.stateManager) {
22173
22176
  ctx.throw(503, "Execution not initialized");
22174
22177
  }
22175
- return await handleExecute(ctx, this.executor, this.stateManager, this.config, this.auditSink, this.sessionManager);
22178
+ return await handleExecute(ctx, this.executor, this.stateManager, this.config, this.auditSink, this.sessionManager, this.toolRulesProvider);
22176
22179
  }
22177
22180
  async handleResume(ctx, executionId) {
22178
22181
  if (!this.executor || !this.stateManager) {