@mondaydotcomorg/atp-server 0.19.12 → 0.19.14

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 (36) hide show
  1. package/dist/callback/index.d.ts +2 -2
  2. package/dist/callback/index.d.ts.map +1 -1
  3. package/dist/callback/index.js +2 -0
  4. package/dist/callback/index.js.map +1 -1
  5. package/dist/client-sessions.d.ts.map +1 -1
  6. package/dist/client-sessions.js +2 -3
  7. package/dist/client-sessions.js.map +1 -1
  8. package/dist/controllers/execute.controller.js +2 -2
  9. package/dist/controllers/execute.controller.js.map +1 -1
  10. package/dist/controllers/stream.controller.js +2 -2
  11. package/dist/controllers/stream.controller.js.map +1 -1
  12. package/dist/executor/execution-error-handler.js +2 -2
  13. package/dist/executor/execution-error-handler.js.map +1 -1
  14. package/dist/executor/executor.js +2 -2
  15. package/dist/executor/executor.js.map +1 -1
  16. package/dist/handlers/init.handler.js +2 -2
  17. package/dist/handlers/init.handler.js.map +1 -1
  18. package/dist/handlers/resume.handler.js +2 -2
  19. package/dist/handlers/resume.handler.js.map +1 -1
  20. package/dist/http/request-handler.js +2 -2
  21. package/dist/http/request-handler.js.map +1 -1
  22. package/dist/index.cjs +6 -7
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.js +7 -8
  25. package/dist/index.js.map +1 -1
  26. package/package.json +6 -7
  27. package/src/callback/index.ts +4 -2
  28. package/src/client-sessions.ts +2 -3
  29. package/src/controllers/execute.controller.ts +2 -2
  30. package/src/controllers/stream.controller.ts +2 -2
  31. package/src/core/request-scope.ts +1 -0
  32. package/src/executor/execution-error-handler.ts +2 -2
  33. package/src/executor/executor.ts +2 -2
  34. package/src/handlers/init.handler.ts +2 -2
  35. package/src/handlers/resume.handler.ts +2 -2
  36. package/src/http/request-handler.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mondaydotcomorg/atp-server",
3
- "version": "0.19.12",
3
+ "version": "0.19.14",
4
4
  "description": "Server implementation for Agent Tool Protocol",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -49,11 +49,11 @@
49
49
  "@babel/parser": "^7.26.0",
50
50
  "@babel/traverse": "^7.26.0",
51
51
  "@babel/types": "^7.26.0",
52
- "@mondaydotcomorg/atp-compiler": "0.19.11",
53
- "@mondaydotcomorg/atp-protocol": "0.19.10",
54
- "@mondaydotcomorg/atp-provenance": "0.19.9",
55
- "@mondaydotcomorg/atp-providers": "0.19.10",
56
- "@mondaydotcomorg/atp-runtime": "0.19.9",
52
+ "@mondaydotcomorg/atp-compiler": "0.19.13",
53
+ "@mondaydotcomorg/atp-protocol": "0.19.11",
54
+ "@mondaydotcomorg/atp-provenance": "0.19.10",
55
+ "@mondaydotcomorg/atp-providers": "0.19.11",
56
+ "@mondaydotcomorg/atp-runtime": "0.19.10",
57
57
  "@opentelemetry/api": "^1.9.0",
58
58
  "@opentelemetry/auto-instrumentations-node": "^0.66.0",
59
59
  "@opentelemetry/core": "^2.2.0",
@@ -73,7 +73,6 @@
73
73
  "isolated-vm": "5.0.4",
74
74
  "js-yaml": "^4.1.0",
75
75
  "jsonwebtoken": "^9.0.2",
76
- "nanoid": "^5.1.6",
77
76
  "rate-limiter-flexible": "*"
78
77
  },
79
78
  "devDependencies": {
@@ -9,7 +9,7 @@ import { log } from '@mondaydotcomorg/atp-runtime';
9
9
  /**
10
10
  * Callback request types
11
11
  */
12
- export type CallbackType = 'llm' | 'approval' | 'embedding';
12
+ export type CallbackType = 'llm' | 'approval' | 'embedding' | 'tool';
13
13
 
14
14
  /**
15
15
  * Callback request payload
@@ -95,7 +95,7 @@ export class ClientCallbackManager {
95
95
  * @param serviceType - Type of service
96
96
  * @returns Whether client provides this service
97
97
  */
98
- hasClientService(clientId: string, serviceType: 'llm' | 'approval' | 'embedding'): boolean {
98
+ hasClientService(clientId: string, serviceType: CallbackType): boolean {
99
99
  const client = this.clients.get(clientId);
100
100
  if (!client) return false;
101
101
 
@@ -106,6 +106,8 @@ export class ClientCallbackManager {
106
106
  return client.services.hasApproval;
107
107
  case 'embedding':
108
108
  return client.services.hasEmbedding;
109
+ case 'tool':
110
+ return client.services.hasTools;
109
111
  default:
110
112
  return false;
111
113
  }
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * Client Session Management
3
3
  */
4
- import { randomBytes } from 'node:crypto';
5
- import { nanoid } from 'nanoid';
4
+ import { randomBytes, randomUUID } from 'node:crypto';
6
5
  import jwt from 'jsonwebtoken';
7
6
  import { log } from '@mondaydotcomorg/atp-runtime';
8
7
  import type {
@@ -189,7 +188,7 @@ export class ClientSessionManager {
189
188
  {
190
189
  clientId,
191
190
  type: 'client',
192
- jti: nanoid(),
191
+ jti: randomUUID(),
193
192
  },
194
193
  this.jwtSecret,
195
194
  {
@@ -7,7 +7,7 @@ import type { ExecutionStateManager } from '../execution-state/index.js';
7
7
  import type { AuditConfig } from '../middleware/audit.js';
8
8
  import { auditExecution } from '../middleware/audit.js';
9
9
  import { clientCallbackManager } from '../callback/index.js';
10
- import { nanoid } from 'nanoid';
10
+ import { randomUUID } from 'node:crypto';
11
11
  import type { log } from '@mondaydotcomorg/atp-runtime';
12
12
 
13
13
  interface ExecuteContext {
@@ -90,7 +90,7 @@ export async function handleExecute(
90
90
  res.writeHead(200, { 'Content-Type': 'application/json' });
91
91
  res.end(
92
92
  JSON.stringify({
93
- executionId: nanoid(),
93
+ executionId: randomUUID(),
94
94
  status: hasSecurityIssues ? 'security_violation' : 'validation_failed',
95
95
  error: {
96
96
  message: 'Code validation failed',
@@ -9,7 +9,7 @@ import {
9
9
  import type { CodeValidator } from '../validator/index.js';
10
10
  import type { SandboxExecutor } from '../executor/index.js';
11
11
  import type { ExecutionStateManager } from '../execution-state/index.js';
12
- import { nanoid } from 'nanoid';
12
+ import { randomUUID } from 'node:crypto';
13
13
  import type { log } from '@mondaydotcomorg/atp-runtime';
14
14
 
15
15
  interface StreamContext {
@@ -110,7 +110,7 @@ export async function handleExecuteStream(
110
110
  validationResult.securityIssues && validationResult.securityIssues.length > 0;
111
111
 
112
112
  sendEvent('result', {
113
- executionId: nanoid(),
113
+ executionId: randomUUID(),
114
114
  status: hasSecurityIssues ? 'security_violation' : 'validation_failed',
115
115
  error: {
116
116
  message: 'Code validation failed',
@@ -129,3 +129,4 @@ export function filterApiGroups(
129
129
  .filter((group): group is APIGroupConfig => group !== null);
130
130
  }
131
131
 
132
+
@@ -14,7 +14,7 @@ import {
14
14
  type PauseExecutionError,
15
15
  } from '@mondaydotcomorg/atp-runtime';
16
16
  import { isBatchPauseError, type BatchPauseExecutionError } from '@mondaydotcomorg/atp-compiler';
17
- import { nanoid } from 'nanoid';
17
+ import { randomUUID } from 'node:crypto';
18
18
  import type { CallbackRecord } from '../execution-state/index.js';
19
19
  import type { RuntimeContext } from './types.js';
20
20
  import { categorizeError } from './error-handler.js';
@@ -92,7 +92,7 @@ export function handleExecutionError(
92
92
  executionId,
93
93
  status: ExecutionStatus.PAUSED,
94
94
  needsCallbacks: batchErr.calls.map((call: any) => ({
95
- id: nanoid(),
95
+ id: randomUUID(),
96
96
  type: call.type as any,
97
97
  operation: call.operation,
98
98
  payload: call.payload,
@@ -20,7 +20,7 @@ import {
20
20
  setReplayMode,
21
21
  setVectorStoreExecutionId,
22
22
  } from '@mondaydotcomorg/atp-runtime';
23
- import { nanoid } from 'nanoid';
23
+ import { randomUUID } from 'node:crypto';
24
24
  import type { CallbackRecord } from '../execution-state/index.js';
25
25
  import type { ClientSessionManager } from '../client-sessions.js';
26
26
  import { BOOTSTRAP_CODE } from './bootstrap-generated.js';
@@ -86,7 +86,7 @@ export class SandboxExecutor {
86
86
  executionId?: string;
87
87
  }
88
88
  ): Promise<ExecutionResult> {
89
- const executionId = resumeData?.executionId || nanoid();
89
+ const executionId = resumeData?.executionId || randomUUID();
90
90
 
91
91
  return runInExecutionContext(executionId, async () => {
92
92
  return await this.executeInContext(
@@ -1,7 +1,7 @@
1
1
  import type { RequestContext } from '../core/config.js';
2
2
  import type { ClientSessionManager } from '../client-sessions.js';
3
3
  import type { AuditSink, AuditEvent } from '@mondaydotcomorg/atp-protocol';
4
- import { nanoid } from 'nanoid';
4
+ import { randomUUID } from 'node:crypto';
5
5
  import { log } from '@mondaydotcomorg/atp-runtime';
6
6
 
7
7
  export async function handleInit(
@@ -34,7 +34,7 @@ export async function handleInit(
34
34
 
35
35
  if (auditSink) {
36
36
  const event: AuditEvent = {
37
- eventId: nanoid(),
37
+ eventId: randomUUID(),
38
38
  timestamp: Date.now(),
39
39
  clientId: (result as any).clientId,
40
40
  eventType: 'client_init',
@@ -14,7 +14,7 @@ import {
14
14
  type ProvenanceState,
15
15
  type SourceMetadata,
16
16
  } from '@mondaydotcomorg/atp-provenance';
17
- import { nanoid } from 'nanoid';
17
+ import { randomUUID } from 'node:crypto';
18
18
 
19
19
  /**
20
20
  * Tag a callback result with provenance metadata
@@ -42,7 +42,7 @@ function tagCallbackResult(
42
42
  // Primitive: taint it
43
43
  if (typeof value === 'string' || typeof value === 'number') {
44
44
  const metadata = {
45
- id: nanoid(),
45
+ id: randomUUID(),
46
46
  source,
47
47
  readers: { type: 'public' as const },
48
48
  dependencies: [],
@@ -1,5 +1,5 @@
1
1
  import { IncomingMessage, ServerResponse } from 'node:http';
2
- import { nanoid } from 'nanoid';
2
+ import { randomUUID } from 'node:crypto';
3
3
  import { log } from '@mondaydotcomorg/atp-runtime';
4
4
  import type { CacheProvider, AuthProvider, AuditSink } from '@mondaydotcomorg/atp-protocol';
5
5
  import { parseBody } from '../core/http.js';
@@ -102,7 +102,7 @@ export async function handleHTTPRequest(
102
102
  });
103
103
  }
104
104
 
105
- handleError(res, error as Error, nanoid(), headers);
105
+ handleError(res, error as Error, randomUUID(), headers);
106
106
  } catch (handlerError) {
107
107
  try {
108
108
  if (!res.headersSent) {