@mondaydotcomorg/atp-server 0.19.11 → 0.19.12

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
@@ -5,7 +5,7 @@ import { createServer as createServer$1 } from 'http';
5
5
  import { ProvenanceMode, ToolOperationType, ToolSensitivityLevel, CallbackType, ToolOperation, ExecutionStatus, sanitizeInput, MAX_CODE_SIZE, ExecutionErrorCode } from '@mondaydotcomorg/atp-protocol';
6
6
  import { getProvenance, createProvenanceProxy, ProvenanceSource, setProvenanceExecutionId, SecurityPolicyEngine, createTrackingRuntime, registerProvenanceMetadata, instrumentCode, captureProvenanceSnapshot, cleanupProvenanceForExecution, clearProvenanceExecutionId, DynamicPolicyRegistry, getProvenanceForPrimitive, computeDigest, verifyProvenanceHints, restoreProvenanceSnapshot, markPrimitiveTainted, ProvenanceMode as ProvenanceMode$1, issueProvenanceToken } from '@mondaydotcomorg/atp-provenance';
7
7
  export { ProvenanceMode, ProvenanceSecurityError, ProvenanceSource, SecurityPolicyEngine, auditSensitiveAccess, blockLLMRecipients, blockLLMRecipientsWithApproval, canRead, captureProvenanceState, cleanupProvenanceForExecution, clearProvenanceExecutionId, createCustomPolicy, createProvenanceProxy, createTrackingRuntime, getAllProvenance, getBuiltInPolicies, getBuiltInPoliciesWithApproval, getProvenance, getProvenanceForPrimitive, hasProvenance, instrumentCode, isPrimitiveTainted, markPrimitiveTainted, preventDataExfiltration, preventDataExfiltrationWithApproval, requireUserOrigin, requireUserOriginWithApproval, restoreProvenanceState, setProvenanceExecutionId } from '@mondaydotcomorg/atp-provenance';
8
- import { randomBytes } from 'crypto';
8
+ import crypto, { randomBytes } from 'crypto';
9
9
  import { nanoid } from 'nanoid';
10
10
  import jwt from 'jsonwebtoken';
11
11
  import ivm from 'isolated-vm';
@@ -11200,7 +11200,7 @@ async function handleExecute(ctx, executor, stateManager, config, auditSink, ses
11200
11200
  }
11201
11201
  const onToolCall = auditSink ? (event) => {
11202
11202
  const auditEvent = {
11203
- eventId: nanoid(),
11203
+ eventId: crypto.randomUUID(),
11204
11204
  timestamp: Date.now(),
11205
11205
  clientId: ctx.clientId || "anonymous",
11206
11206
  eventType: "tool_call",
@@ -11231,11 +11231,16 @@ async function handleExecute(ctx, executor, stateManager, config, auditSink, ses
11231
11231
  provenanceMode: requestConfig.provenanceMode || config.execution.provenanceMode || ProvenanceMode.NONE,
11232
11232
  securityPolicies: config.execution.securityPolicies || [],
11233
11233
  provenanceHints: requestConfig.provenanceHints,
11234
- requestContext: requestConfig.requestContext,
11234
+ requestContext: {
11235
+ ...requestConfig.requestContext,
11236
+ headers: ctx.headers,
11237
+ path: ctx.path,
11238
+ method: ctx.method
11239
+ },
11235
11240
  onToolCall
11236
11241
  };
11237
11242
  let hintMap;
11238
- const prelimExecutionId = nanoid();
11243
+ const prelimExecutionId = crypto.randomUUID();
11239
11244
  if (executionConfig.provenanceHints && executionConfig.provenanceHints.length > 0 && executionConfig.provenanceMode !== ProvenanceMode.NONE && ctx.cache) {
11240
11245
  try {
11241
11246
  if (executionConfig.provenanceHints.length > 1e3) {
@@ -11270,7 +11275,7 @@ async function handleExecute(ctx, executor, stateManager, config, auditSink, ses
11270
11275
  const startTime = Date.now();
11271
11276
  if (auditSink) {
11272
11277
  const startEvent = {
11273
- eventId: nanoid(),
11278
+ eventId: crypto.randomUUID(),
11274
11279
  timestamp: startTime,
11275
11280
  clientId: ctx.clientId || "anonymous",
11276
11281
  eventType: "execution",
@@ -11336,7 +11341,7 @@ async function handleExecute(ctx, executor, stateManager, config, auditSink, ses
11336
11341
  }
11337
11342
  if (auditSink) {
11338
11343
  const endEvent = {
11339
- eventId: nanoid(),
11344
+ eventId: crypto.randomUUID(),
11340
11345
  timestamp: Date.now(),
11341
11346
  clientId: ctx.clientId || "anonymous",
11342
11347
  eventType: "execution",
@@ -21767,9 +21772,12 @@ var AgentToolProtocolServer = class {
21767
21772
  targetGroup = {
21768
21773
  name: groupName,
21769
21774
  type: "custom",
21775
+ description: definition.groupDescription,
21770
21776
  functions: []
21771
21777
  };
21772
21778
  this.apiGroups.push(targetGroup);
21779
+ } else if (definition.groupDescription && !targetGroup.description) {
21780
+ targetGroup.description = definition.groupDescription;
21773
21781
  }
21774
21782
  targetGroup.functions.push({
21775
21783
  name,