@mondaydotcomorg/atp-runtime 0.17.16 → 0.18.4-rc.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.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * AUTO-GENERATED - DO NOT EDIT
3
3
  * Generated by scripts/generate-metadata.ts
4
- *
4
+ *
5
5
  * Hybrid approach:
6
6
  * - ts-json-schema-generator (OSS) for most types
7
7
  * - ts-morph fallback for types OSS can't handle (generics)
@@ -10,284 +10,297 @@
10
10
  import type { RuntimeAPIMetadata } from './types';
11
11
 
12
12
  export const GENERATED_METADATA: RuntimeAPIMetadata[] = [
13
- {
14
- "name": "approval",
15
- "description": "Approval API - Request explicit human approval for sensitive operations",
16
- "methods": [
17
- {
18
- "name": "request",
19
- "description": "Request approval from a human",
20
- "params": [
21
- {
22
- "name": "message",
23
- "type": "string",
24
- "description": "The message to display to the user",
25
- "optional": false
26
- },
27
- {
28
- "name": "context",
29
- "type": "Record<string, unknown>",
30
- "description": "Optional context information about what needs approval",
31
- "optional": true
32
- }
33
- ],
34
- "returns": "Promise<ApprovalResponse>"
35
- }
36
- ]
37
- },
38
- {
39
- "name": "cache",
40
- "description": "Cache API - Store and retrieve data with optional TTL",
41
- "methods": [
42
- {
43
- "name": "get",
44
- "description": "Get a value from cache by key",
45
- "params": [
46
- {
47
- "name": "key",
48
- "type": "string",
49
- "description": "Cache key",
50
- "optional": false
51
- }
52
- ],
53
- "returns": "Promise<T | null>"
54
- },
55
- {
56
- "name": "set",
57
- "description": "Set a value in cache with optional TTL",
58
- "params": [
59
- {
60
- "name": "key",
61
- "type": "string",
62
- "description": "Cache key",
63
- "optional": false
64
- },
65
- {
66
- "name": "value",
67
- "type": "unknown",
68
- "description": "Value to cache",
69
- "optional": false
70
- },
71
- {
72
- "name": "ttl",
73
- "type": "number",
74
- "description": "Time to live in seconds",
75
- "optional": true
76
- }
77
- ],
78
- "returns": "Promise<void>"
79
- },
80
- {
81
- "name": "delete",
82
- "description": "Delete a value from cache",
83
- "params": [
84
- {
85
- "name": "key",
86
- "type": "string",
87
- "description": "Cache key to delete",
88
- "optional": false
89
- }
90
- ],
91
- "returns": "Promise<void>"
92
- },
93
- {
94
- "name": "has",
95
- "description": "Check if a key exists in cache",
96
- "params": [
97
- {
98
- "name": "key",
99
- "type": "string",
100
- "description": "Cache key to check",
101
- "optional": false
102
- }
103
- ],
104
- "returns": "Promise<boolean>"
105
- },
106
- {
107
- "name": "clear",
108
- "description": "Clear all cache entries",
109
- "params": [],
110
- "returns": "Promise<void>"
111
- }
112
- ]
113
- },
114
- {
115
- "name": "embedding",
116
- "description": "Embedding API - Client-side embedding with server-side vector storage",
117
- "methods": [
118
- {
119
- "name": "embed",
120
- "description": "Request client to generate and store embeddings",
121
- "params": [
122
- {
123
- "name": "input",
124
- "type": "string | string[]",
125
- "description": "Text(s) to embed",
126
- "optional": false
127
- },
128
- {
129
- "name": "metadata",
130
- "type": "Record<string, unknown>",
131
- "description": "Optional metadata to store with embeddings",
132
- "optional": true
133
- }
134
- ],
135
- "returns": "Promise<string | string[]>"
136
- },
137
- {
138
- "name": "search",
139
- "description": "Search stored embeddings by similarity",
140
- "params": [
141
- {
142
- "name": "query",
143
- "type": "string",
144
- "description": "Search query text (will be embedded by client)",
145
- "optional": false
146
- },
147
- {
148
- "name": "options",
149
- "type": "Omit<SearchOptions, 'query'>",
150
- "description": "Search options (topK, minSimilarity, filter)",
151
- "optional": true
152
- }
153
- ],
154
- "returns": "Promise<SearchResult[]>"
155
- },
156
- {
157
- "name": "similarity",
158
- "description": "Calculate cosine similarity between two embedding vectors",
159
- "params": [
160
- {
161
- "name": "embedding1",
162
- "type": "number[]",
163
- "description": "First embedding vector",
164
- "optional": false
165
- },
166
- {
167
- "name": "embedding2",
168
- "type": "number[]",
169
- "description": "Second embedding vector",
170
- "optional": false
171
- }
172
- ],
173
- "returns": "number"
174
- },
175
- {
176
- "name": "getAll",
177
- "description": "Get all stored embeddings",
178
- "params": [],
179
- "returns": "EmbeddingRecord[]"
180
- },
181
- {
182
- "name": "count",
183
- "description": "Get count of stored embeddings",
184
- "params": [],
185
- "returns": "number"
186
- }
187
- ]
188
- },
189
- {
190
- "name": "llm",
191
- "description": "LLM API - Large Language Model calls using client-provided LLM (requires client.provideLLM())",
192
- "methods": [
193
- {
194
- "name": "call",
195
- "description": "Make an LLM call with a prompt",
196
- "params": [
197
- {
198
- "name": "options",
199
- "type": "LLMCallOptions",
200
- "description": "LLM call options including prompt",
201
- "optional": false
202
- }
203
- ],
204
- "returns": "Promise<string>"
205
- },
206
- {
207
- "name": "extract",
208
- "description": "Extract structured data from text using an LLM",
209
- "params": [
210
- {
211
- "name": "options",
212
- "type": "LLMExtractOptions",
213
- "description": "Extraction options with JSON schema",
214
- "optional": false
215
- }
216
- ],
217
- "returns": "Promise<T>"
218
- },
219
- {
220
- "name": "classify",
221
- "description": "Classify text into one of the provided categories",
222
- "params": [
223
- {
224
- "name": "options",
225
- "type": "LLMClassifyOptions",
226
- "description": "Classification options with categories",
227
- "optional": false
228
- }
229
- ],
230
- "returns": "Promise<string>"
231
- }
232
- ]
233
- },
234
- {
235
- "name": "progress",
236
- "description": "Progress API - Report execution progress to clients",
237
- "methods": [
238
- {
239
- "name": "report",
240
- "description": "Report progress with message and completion fraction",
241
- "params": [
242
- {
243
- "name": "message",
244
- "type": "string",
245
- "description": "Progress message",
246
- "optional": false
247
- },
248
- {
249
- "name": "fraction",
250
- "type": "number",
251
- "description": "Completion fraction (0-1)",
252
- "optional": false
253
- }
254
- ],
255
- "returns": "void"
256
- }
257
- ]
258
- }
13
+ {
14
+ name: 'approval',
15
+ description: 'Approval API - Request explicit human approval for sensitive operations',
16
+ methods: [
17
+ {
18
+ name: 'request',
19
+ description: 'Request approval from a human',
20
+ params: [
21
+ {
22
+ name: 'message',
23
+ type: 'string',
24
+ description: 'The message to display to the user',
25
+ optional: false,
26
+ },
27
+ {
28
+ name: 'context',
29
+ type: 'Record<string, unknown>',
30
+ description: 'Optional context information about what needs approval',
31
+ optional: true,
32
+ },
33
+ ],
34
+ returns: 'Promise<ApprovalResponse>',
35
+ },
36
+ ],
37
+ },
38
+ {
39
+ name: 'cache',
40
+ description: 'Cache API - Store and retrieve data with optional TTL',
41
+ methods: [
42
+ {
43
+ name: 'get',
44
+ description: 'Get a value from cache by key',
45
+ params: [
46
+ {
47
+ name: 'key',
48
+ type: 'string',
49
+ description: 'Cache key',
50
+ optional: false,
51
+ },
52
+ ],
53
+ returns: 'Promise<T | null>',
54
+ },
55
+ {
56
+ name: 'set',
57
+ description: 'Set a value in cache with optional TTL',
58
+ params: [
59
+ {
60
+ name: 'key',
61
+ type: 'string',
62
+ description: 'Cache key',
63
+ optional: false,
64
+ },
65
+ {
66
+ name: 'value',
67
+ type: 'unknown',
68
+ description: 'Value to cache',
69
+ optional: false,
70
+ },
71
+ {
72
+ name: 'ttl',
73
+ type: 'number',
74
+ description: 'Time to live in seconds',
75
+ optional: true,
76
+ },
77
+ ],
78
+ returns: 'Promise<void>',
79
+ },
80
+ {
81
+ name: 'delete',
82
+ description: 'Delete a value from cache',
83
+ params: [
84
+ {
85
+ name: 'key',
86
+ type: 'string',
87
+ description: 'Cache key to delete',
88
+ optional: false,
89
+ },
90
+ ],
91
+ returns: 'Promise<void>',
92
+ },
93
+ {
94
+ name: 'has',
95
+ description: 'Check if a key exists in cache',
96
+ params: [
97
+ {
98
+ name: 'key',
99
+ type: 'string',
100
+ description: 'Cache key to check',
101
+ optional: false,
102
+ },
103
+ ],
104
+ returns: 'Promise<boolean>',
105
+ },
106
+ {
107
+ name: 'clear',
108
+ description: 'Clear all cache entries',
109
+ params: [],
110
+ returns: 'Promise<void>',
111
+ },
112
+ ],
113
+ },
114
+ {
115
+ name: 'embedding',
116
+ description: 'Embedding API - Client-side embedding with server-side vector storage',
117
+ methods: [
118
+ {
119
+ name: 'embed',
120
+ description: 'Request client to generate and store embeddings',
121
+ params: [
122
+ {
123
+ name: 'input',
124
+ type: 'string | string[]',
125
+ description: 'Text(s) to embed',
126
+ optional: false,
127
+ },
128
+ {
129
+ name: 'metadata',
130
+ type: 'Record<string, unknown>',
131
+ description: 'Optional metadata to store with embeddings',
132
+ optional: true,
133
+ },
134
+ ],
135
+ returns: 'Promise<string | string[]>',
136
+ },
137
+ {
138
+ name: 'search',
139
+ description: 'Search stored embeddings by similarity',
140
+ params: [
141
+ {
142
+ name: 'query',
143
+ type: 'string',
144
+ description: 'Search query text (will be embedded by client)',
145
+ optional: false,
146
+ },
147
+ {
148
+ name: 'options',
149
+ type: "Omit<SearchOptions, 'query'>",
150
+ description: 'Search options (topK, minSimilarity, filter)',
151
+ optional: true,
152
+ },
153
+ ],
154
+ returns: 'Promise<SearchResult[]>',
155
+ },
156
+ {
157
+ name: 'similarity',
158
+ description: 'Calculate cosine similarity between two embedding vectors',
159
+ params: [
160
+ {
161
+ name: 'embedding1',
162
+ type: 'number[]',
163
+ description: 'First embedding vector',
164
+ optional: false,
165
+ },
166
+ {
167
+ name: 'embedding2',
168
+ type: 'number[]',
169
+ description: 'Second embedding vector',
170
+ optional: false,
171
+ },
172
+ ],
173
+ returns: 'number',
174
+ },
175
+ {
176
+ name: 'getAll',
177
+ description: 'Get all stored embeddings',
178
+ params: [],
179
+ returns: 'EmbeddingRecord[]',
180
+ },
181
+ {
182
+ name: 'count',
183
+ description: 'Get count of stored embeddings',
184
+ params: [],
185
+ returns: 'number',
186
+ },
187
+ ],
188
+ },
189
+ {
190
+ name: 'llm',
191
+ description:
192
+ 'LLM API - Large Language Model calls using client-provided LLM (requires client.provideLLM())',
193
+ methods: [
194
+ {
195
+ name: 'call',
196
+ description: 'Make an LLM call with a prompt',
197
+ params: [
198
+ {
199
+ name: 'options',
200
+ type: 'LLMCallOptions',
201
+ description: 'LLM call options including prompt',
202
+ optional: false,
203
+ },
204
+ ],
205
+ returns: 'Promise<string>',
206
+ },
207
+ {
208
+ name: 'extract',
209
+ description: 'Extract structured data from text using an LLM',
210
+ params: [
211
+ {
212
+ name: 'options',
213
+ type: 'LLMExtractOptions',
214
+ description: 'Extraction options with JSON schema',
215
+ optional: false,
216
+ },
217
+ ],
218
+ returns: 'Promise<T>',
219
+ },
220
+ {
221
+ name: 'classify',
222
+ description: 'Classify text into one of the provided categories',
223
+ params: [
224
+ {
225
+ name: 'options',
226
+ type: 'LLMClassifyOptions',
227
+ description: 'Classification options with categories',
228
+ optional: false,
229
+ },
230
+ ],
231
+ returns: 'Promise<string>',
232
+ },
233
+ ],
234
+ },
235
+ {
236
+ name: 'progress',
237
+ description: 'Progress API - Report execution progress to clients',
238
+ methods: [
239
+ {
240
+ name: 'report',
241
+ description: 'Report progress with message and completion fraction',
242
+ params: [
243
+ {
244
+ name: 'message',
245
+ type: 'string',
246
+ description: 'Progress message',
247
+ optional: false,
248
+ },
249
+ {
250
+ name: 'fraction',
251
+ type: 'number',
252
+ description: 'Completion fraction (0-1)',
253
+ optional: false,
254
+ },
255
+ ],
256
+ returns: 'void',
257
+ },
258
+ ],
259
+ },
259
260
  ];
260
261
 
262
+ /**
263
+ * Runtime API names - specific literal types for type-safe API filtering
264
+ */
265
+ export type RuntimeAPIName = 'approval' | 'cache' | 'embedding' | 'llm' | 'progress';
266
+
261
267
  /**
262
268
  * Type definitions extracted using ts-json-schema-generator
263
269
  */
264
270
  export const TYPE_REGISTRY = [
265
- {
266
- "name": "ApprovalResponse",
267
- "definition": "export interface ApprovalResponse<T = unknown> {\n\tapproved: boolean;\n\tresponse?: T;\n\ttimestamp: number;\n}"
268
- },
269
- {
270
- "name": "SearchOptions",
271
- "definition": "interface SearchOptions {\n query: string;\n topK?: number;\n minSimilarity?: number;\n filter?: Record<string, unknown>;\n}"
272
- },
273
- {
274
- "name": "SearchResult",
275
- "definition": "interface SearchResult {\n id: string;\n text: string;\n similarity: number;\n metadata?: Record<string, unknown>;\n}"
276
- },
277
- {
278
- "name": "EmbeddingRecord",
279
- "definition": "interface EmbeddingRecord {\n id: string;\n text: string;\n embedding: number[];\n metadata?: Record<string, unknown>;\n}"
280
- },
281
- {
282
- "name": "LLMCallOptions",
283
- "definition": "interface LLMCallOptions {\n prompt: string;\n context?: Record<string, unknown>;\n model?: string;\n maxTokens?: number;\n temperature?: number;\n systemPrompt?: string;\n}"
284
- },
285
- {
286
- "name": "LLMExtractOptions",
287
- "definition": "interface LLMExtractOptions {\n prompt: string;\n context?: Record<string, unknown>;\n schema: unknown;\n}"
288
- },
289
- {
290
- "name": "LLMClassifyOptions",
291
- "definition": "interface LLMClassifyOptions {\n text: string;\n categories: string[];\n context?: Record<string, unknown>;\n}"
292
- }
271
+ {
272
+ name: 'ApprovalResponse',
273
+ definition:
274
+ 'export interface ApprovalResponse<T = unknown> {\n\tapproved: boolean;\n\tresponse?: T;\n\ttimestamp: number;\n}',
275
+ },
276
+ {
277
+ name: 'SearchOptions',
278
+ definition:
279
+ 'interface SearchOptions {\n query: string;\n topK?: number;\n minSimilarity?: number;\n filter?: Record<string, unknown>;\n}',
280
+ },
281
+ {
282
+ name: 'SearchResult',
283
+ definition:
284
+ 'interface SearchResult {\n id: string;\n text: string;\n similarity: number;\n metadata?: Record<string, unknown>;\n}',
285
+ },
286
+ {
287
+ name: 'EmbeddingRecord',
288
+ definition:
289
+ 'interface EmbeddingRecord {\n id: string;\n text: string;\n embedding: number[];\n metadata?: Record<string, unknown>;\n}',
290
+ },
291
+ {
292
+ name: 'LLMCallOptions',
293
+ definition:
294
+ 'interface LLMCallOptions {\n prompt: string;\n context?: Record<string, unknown>;\n model?: string;\n maxTokens?: number;\n temperature?: number;\n systemPrompt?: string;\n}',
295
+ },
296
+ {
297
+ name: 'LLMExtractOptions',
298
+ definition:
299
+ 'interface LLMExtractOptions {\n prompt: string;\n context?: Record<string, unknown>;\n schema: unknown;\n}',
300
+ },
301
+ {
302
+ name: 'LLMClassifyOptions',
303
+ definition:
304
+ 'interface LLMClassifyOptions {\n text: string;\n categories: string[];\n context?: Record<string, unknown>;\n}',
305
+ },
293
306
  ];