@elevasis/ui 2.20.0 → 2.22.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/api/index.js +2 -2
- package/dist/app/index.js +5 -5
- package/dist/charts/index.js +3 -3
- package/dist/{chunk-TO7QXDBX.js → chunk-3HEUGBOT.js} +3 -3
- package/dist/chunk-AXXTN44Z.js +26 -0
- package/dist/{chunk-FMFX4K6E.js → chunk-B4FHWKEF.js} +3390 -2929
- package/dist/{chunk-AL23U6C3.js → chunk-BIWHHWCJ.js} +1 -2
- package/dist/{chunk-MZFJWCPH.js → chunk-BSZRKBAW.js} +277 -92
- package/dist/{chunk-GP3AFJYG.js → chunk-COG4ABRI.js} +8 -13
- package/dist/chunk-DDZOHLHB.js +48 -0
- package/dist/{chunk-ZE2KQSHL.js → chunk-GJ7EIABJ.js} +4 -4
- package/dist/{chunk-YP6T426C.js → chunk-IBUYJXA3.js} +1326 -1110
- package/dist/{chunk-2CFOFSSG.js → chunk-IOTLB6ND.js} +8 -13
- package/dist/{chunk-GBMNCNHX.js → chunk-KVJ3LFH2.js} +3 -1
- package/dist/chunk-LJWV4TWV.js +335 -0
- package/dist/{chunk-PJVG3ISO.js → chunk-LKVBEE63.js} +7 -9
- package/dist/{chunk-JR5WNTLA.js → chunk-LVJGPE6H.js} +11 -24
- package/dist/{chunk-OUYH2SBS.js → chunk-LVUCBY7X.js} +2 -2
- package/dist/{chunk-TIIPYB2Z.js → chunk-QZJM3RYI.js} +1 -1
- package/dist/{chunk-OD7GWIZS.js → chunk-SGXXJE52.js} +1 -121
- package/dist/{chunk-7YQKVWSD.js → chunk-SQ5JGELM.js} +25 -5
- package/dist/{chunk-R7OJCNL3.js → chunk-T6INEVX6.js} +1 -1
- package/dist/{chunk-RX4UWZZR.js → chunk-TKAYX2SP.js} +8 -3
- package/dist/{chunk-CTTY6FUT.js → chunk-TSSKOQBX.js} +2 -2
- package/dist/{chunk-GTYUP7MB.js → chunk-WWJ6S2HQ.js} +10 -22
- package/dist/{chunk-Q5HC6ENG.js → chunk-XOTJNW4Q.js} +1 -1
- package/dist/{chunk-BHR7IV72.js → chunk-XUYBOO32.js} +1 -1
- package/dist/{chunk-M7W7CGPL.js → chunk-Z6FAH4XV.js} +1 -1
- package/dist/{chunk-Q4QJOSVS.js → chunk-ZBCTB5CA.js} +1 -1
- package/dist/components/index.css +85 -85
- package/dist/components/index.d.ts +970 -746
- package/dist/components/index.js +246 -39
- package/dist/components/navigation/index.css +589 -0
- package/dist/components/navigation/index.d.ts +1 -13
- package/dist/components/navigation/index.js +11 -1
- package/dist/execution/index.d.ts +27 -0
- package/dist/features/auth/index.css +2 -2
- package/dist/features/auth/index.d.ts +184 -3
- package/dist/features/crm/index.css +2 -2
- package/dist/features/crm/index.d.ts +201 -38
- package/dist/features/crm/index.js +15 -14
- package/dist/features/dashboard/index.css +2 -2
- package/dist/features/dashboard/index.d.ts +25 -27
- package/dist/features/dashboard/index.js +15 -14
- package/dist/features/delivery/index.css +85 -85
- package/dist/features/delivery/index.d.ts +201 -38
- package/dist/features/delivery/index.js +15 -14
- package/dist/features/lead-gen/index.css +2 -2
- package/dist/features/lead-gen/index.d.ts +19 -37
- package/dist/features/lead-gen/index.js +15 -14
- package/dist/features/monitoring/index.css +85 -85
- package/dist/features/monitoring/index.d.ts +18 -36
- package/dist/features/monitoring/index.js +17 -16
- package/dist/features/monitoring/requests/index.css +2 -2
- package/dist/features/monitoring/requests/index.d.ts +18 -36
- package/dist/features/monitoring/requests/index.js +15 -14
- package/dist/features/operations/index.css +2 -2
- package/dist/features/operations/index.d.ts +49 -67
- package/dist/features/operations/index.js +18 -17
- package/dist/features/seo/index.d.ts +17 -35
- package/dist/features/seo/index.js +1 -1
- package/dist/features/settings/index.css +2 -2
- package/dist/features/settings/index.d.ts +222 -44
- package/dist/features/settings/index.js +16 -15
- package/dist/graph/index.css +2 -2
- package/dist/hooks/delivery/index.css +2 -2
- package/dist/hooks/delivery/index.d.ts +184 -3
- package/dist/hooks/delivery/index.js +2 -2
- package/dist/hooks/index.css +85 -85
- package/dist/hooks/index.d.ts +1862 -1582
- package/dist/hooks/index.js +13 -12
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +92 -121
- package/dist/hooks/published.css +85 -85
- package/dist/hooks/published.d.ts +1862 -1582
- package/dist/hooks/published.js +13 -12
- package/dist/index.css +12 -12
- package/dist/index.d.ts +689 -470
- package/dist/index.js +14 -13
- package/dist/initialization/index.d.ts +184 -3
- package/dist/layout/index.js +2 -2
- package/dist/organization/index.css +589 -0
- package/dist/organization/index.js +1 -1
- package/dist/profile/index.d.ts +184 -3
- package/dist/provider/index.css +384 -0
- package/dist/provider/index.d.ts +68 -125
- package/dist/provider/index.js +11 -10
- package/dist/provider/published.css +463 -0
- package/dist/provider/published.d.ts +68 -125
- package/dist/provider/published.js +8 -7
- package/dist/supabase/index.d.ts +359 -6
- package/dist/test-utils/index.d.ts +46 -2
- package/dist/test-utils/index.js +104 -3
- package/dist/theme/index.js +2 -2
- package/dist/types/index.d.ts +303 -141
- package/dist/utils/index.d.ts +26 -59
- package/dist/utils/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-LR5CRY5A.js +0 -514
- package/dist/chunk-MG3NF7QL.js +0 -63
- /package/dist/{chunk-6GUW5GGF.js → chunk-6Z3G4U2R.js} +0 -0
|
@@ -7,17 +7,10 @@ import * as zustand from 'zustand';
|
|
|
7
7
|
import { Edge } from '@xyflow/react';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Error categories for observability grouping and classification.
|
|
11
|
+
* Used to categorize errors in the execution_errors table metadata.
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
all: readonly ["executions"];
|
|
15
|
-
resources: (orgId: string | null) => readonly ["executions", "resources", string | null];
|
|
16
|
-
resourceDefinition: (orgId: string | null, resourceId: string) => readonly ["executions", "definition", string | null, string];
|
|
17
|
-
executionsListBase: (orgId: string | null, resourceId: string) => readonly ["executions", "list", string | null, string];
|
|
18
|
-
executions: (orgId: string | null, resourceId: string, resourceStatus?: string, limit?: number, offset?: number) => readonly ["executions", "list", string | null, string, string, number | null, number];
|
|
19
|
-
execution: (orgId: string | null, resourceId: string, executionId: string) => readonly ["executions", "execution", string | null, string, string];
|
|
20
|
-
};
|
|
13
|
+
type ExecutionErrorCategory = 'llm' | 'tool' | 'workflow' | 'agent' | 'validation' | 'system';
|
|
21
14
|
|
|
22
15
|
/**
|
|
23
16
|
* Workflow-specific logging types and utilities
|
|
@@ -267,10 +260,170 @@ interface FormSchema {
|
|
|
267
260
|
}
|
|
268
261
|
|
|
269
262
|
/**
|
|
270
|
-
*
|
|
271
|
-
*
|
|
263
|
+
* Serialized Registry Types
|
|
264
|
+
*
|
|
265
|
+
* Pre-computed JSON-safe types for API responses and Command View.
|
|
266
|
+
* Serialization happens once at API startup, enabling instant response times.
|
|
272
267
|
*/
|
|
273
|
-
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Serialized form field for API responses
|
|
271
|
+
*/
|
|
272
|
+
interface SerializedFormField {
|
|
273
|
+
name: string;
|
|
274
|
+
label: string;
|
|
275
|
+
type: FormFieldType;
|
|
276
|
+
defaultValue?: unknown;
|
|
277
|
+
required?: boolean;
|
|
278
|
+
placeholder?: string;
|
|
279
|
+
description?: string;
|
|
280
|
+
options?: Array<{
|
|
281
|
+
label: string;
|
|
282
|
+
value: string | number;
|
|
283
|
+
}>;
|
|
284
|
+
min?: number;
|
|
285
|
+
max?: number;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Serialized form schema for API responses
|
|
289
|
+
*/
|
|
290
|
+
interface SerializedFormSchema {
|
|
291
|
+
title?: string;
|
|
292
|
+
description?: string;
|
|
293
|
+
fields: SerializedFormField[];
|
|
294
|
+
layout?: 'vertical' | 'horizontal' | 'grid';
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Serialized execution form schema for API responses
|
|
298
|
+
*/
|
|
299
|
+
interface SerializedExecutionFormSchema extends SerializedFormSchema {
|
|
300
|
+
fieldMappings?: Record<string, string>;
|
|
301
|
+
submitButton?: {
|
|
302
|
+
label?: string;
|
|
303
|
+
loadingLabel?: string;
|
|
304
|
+
confirmMessage?: string;
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Serialized schedule config for API responses
|
|
309
|
+
*/
|
|
310
|
+
interface SerializedScheduleConfig {
|
|
311
|
+
enabled: boolean;
|
|
312
|
+
defaultSchedule?: string;
|
|
313
|
+
allowedPatterns?: string[];
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Serialized webhook config for API responses
|
|
317
|
+
*/
|
|
318
|
+
interface SerializedWebhookConfig {
|
|
319
|
+
enabled: boolean;
|
|
320
|
+
payloadSchema?: unknown;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Serialized execution interface for API responses
|
|
324
|
+
*/
|
|
325
|
+
interface SerializedExecutionInterface {
|
|
326
|
+
form: SerializedExecutionFormSchema;
|
|
327
|
+
schedule?: SerializedScheduleConfig;
|
|
328
|
+
webhook?: SerializedWebhookConfig;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Serialized agent definition (JSON-safe)
|
|
332
|
+
* Result of serializeDefinition(AgentDefinition)
|
|
333
|
+
*/
|
|
334
|
+
interface SerializedAgentDefinition {
|
|
335
|
+
config: {
|
|
336
|
+
resourceId: string;
|
|
337
|
+
name: string;
|
|
338
|
+
description: string;
|
|
339
|
+
version: string;
|
|
340
|
+
type: 'agent';
|
|
341
|
+
status: 'dev' | 'prod';
|
|
342
|
+
links?: ResourceLink[];
|
|
343
|
+
category?: ResourceCategory;
|
|
344
|
+
/** Whether this resource is archived and should be excluded from registration and deployment */
|
|
345
|
+
archived?: boolean;
|
|
346
|
+
systemPrompt: string;
|
|
347
|
+
constraints?: {
|
|
348
|
+
maxIterations?: number;
|
|
349
|
+
timeout?: number;
|
|
350
|
+
maxSessionMemoryKeys?: number;
|
|
351
|
+
maxMemoryTokens?: number;
|
|
352
|
+
};
|
|
353
|
+
sessionCapable?: boolean;
|
|
354
|
+
memoryPreferences?: string;
|
|
355
|
+
};
|
|
356
|
+
modelConfig: {
|
|
357
|
+
provider: string;
|
|
358
|
+
model: string;
|
|
359
|
+
apiKey: string;
|
|
360
|
+
temperature: number;
|
|
361
|
+
maxOutputTokens: number;
|
|
362
|
+
topP?: number;
|
|
363
|
+
modelOptions?: Record<string, unknown>;
|
|
364
|
+
};
|
|
365
|
+
contract: {
|
|
366
|
+
inputSchema: object;
|
|
367
|
+
outputSchema?: object;
|
|
368
|
+
};
|
|
369
|
+
tools: Array<{
|
|
370
|
+
name: string;
|
|
371
|
+
description: string;
|
|
372
|
+
inputSchema?: object;
|
|
373
|
+
outputSchema?: object;
|
|
374
|
+
}>;
|
|
375
|
+
knowledgeMap?: {
|
|
376
|
+
nodeCount: number;
|
|
377
|
+
nodes: Array<{
|
|
378
|
+
id: string;
|
|
379
|
+
description: string;
|
|
380
|
+
loaded: boolean;
|
|
381
|
+
hasPrompt: boolean;
|
|
382
|
+
}>;
|
|
383
|
+
};
|
|
384
|
+
metricsConfig?: object;
|
|
385
|
+
interface?: SerializedExecutionInterface;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Serialized workflow definition (JSON-safe)
|
|
389
|
+
* Result of serializeDefinition(WorkflowDefinition)
|
|
390
|
+
*/
|
|
391
|
+
interface SerializedWorkflowDefinition {
|
|
392
|
+
config: {
|
|
393
|
+
resourceId: string;
|
|
394
|
+
name: string;
|
|
395
|
+
description: string;
|
|
396
|
+
version: string;
|
|
397
|
+
type: 'workflow';
|
|
398
|
+
status: 'dev' | 'prod';
|
|
399
|
+
links?: ResourceLink[];
|
|
400
|
+
category?: ResourceCategory;
|
|
401
|
+
/** Whether this resource is archived and should be excluded from registration and deployment */
|
|
402
|
+
archived?: boolean;
|
|
403
|
+
};
|
|
404
|
+
entryPoint: string;
|
|
405
|
+
steps: Array<{
|
|
406
|
+
id: string;
|
|
407
|
+
name: string;
|
|
408
|
+
description: string;
|
|
409
|
+
inputSchema?: object;
|
|
410
|
+
outputSchema?: object;
|
|
411
|
+
next: {
|
|
412
|
+
type: 'linear' | 'conditional';
|
|
413
|
+
target?: string;
|
|
414
|
+
routes?: Array<{
|
|
415
|
+
target: string;
|
|
416
|
+
}>;
|
|
417
|
+
default?: string;
|
|
418
|
+
} | null;
|
|
419
|
+
}>;
|
|
420
|
+
contract: {
|
|
421
|
+
inputSchema: object;
|
|
422
|
+
outputSchema?: object;
|
|
423
|
+
};
|
|
424
|
+
metricsConfig?: object;
|
|
425
|
+
interface?: SerializedExecutionInterface;
|
|
426
|
+
}
|
|
274
427
|
|
|
275
428
|
/**
|
|
276
429
|
* Memory type definitions
|
|
@@ -1984,6 +2137,7 @@ type Database = {
|
|
|
1984
2137
|
Row: {
|
|
1985
2138
|
config: Json;
|
|
1986
2139
|
created_at: string | null;
|
|
2140
|
+
effective_permissions: string[];
|
|
1987
2141
|
id: string;
|
|
1988
2142
|
membership_status: string | null;
|
|
1989
2143
|
organization_id: string;
|
|
@@ -1995,6 +2149,7 @@ type Database = {
|
|
|
1995
2149
|
Insert: {
|
|
1996
2150
|
config?: Json;
|
|
1997
2151
|
created_at?: string | null;
|
|
2152
|
+
effective_permissions?: string[];
|
|
1998
2153
|
id?: string;
|
|
1999
2154
|
membership_status?: string | null;
|
|
2000
2155
|
organization_id: string;
|
|
@@ -2006,6 +2161,7 @@ type Database = {
|
|
|
2006
2161
|
Update: {
|
|
2007
2162
|
config?: Json;
|
|
2008
2163
|
created_at?: string | null;
|
|
2164
|
+
effective_permissions?: string[];
|
|
2009
2165
|
id?: string;
|
|
2010
2166
|
membership_status?: string | null;
|
|
2011
2167
|
organization_id?: string;
|
|
@@ -2031,96 +2187,237 @@ type Database = {
|
|
|
2031
2187
|
}
|
|
2032
2188
|
];
|
|
2033
2189
|
};
|
|
2034
|
-
|
|
2190
|
+
org_rol_assignments: {
|
|
2035
2191
|
Row: {
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
metadata: Json;
|
|
2041
|
-
name: string;
|
|
2042
|
-
status: string;
|
|
2043
|
-
updated_at: string;
|
|
2044
|
-
workos_org_id: string;
|
|
2192
|
+
granted_at: string;
|
|
2193
|
+
granted_by: string | null;
|
|
2194
|
+
membership_id: string;
|
|
2195
|
+
role_id: string;
|
|
2045
2196
|
};
|
|
2046
2197
|
Insert: {
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
metadata?: Json;
|
|
2052
|
-
name: string;
|
|
2053
|
-
status?: string;
|
|
2054
|
-
updated_at?: string;
|
|
2055
|
-
workos_org_id: string;
|
|
2198
|
+
granted_at?: string;
|
|
2199
|
+
granted_by?: string | null;
|
|
2200
|
+
membership_id: string;
|
|
2201
|
+
role_id: string;
|
|
2056
2202
|
};
|
|
2057
2203
|
Update: {
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
metadata?: Json;
|
|
2063
|
-
name?: string;
|
|
2064
|
-
status?: string;
|
|
2065
|
-
updated_at?: string;
|
|
2066
|
-
workos_org_id?: string;
|
|
2204
|
+
granted_at?: string;
|
|
2205
|
+
granted_by?: string | null;
|
|
2206
|
+
membership_id?: string;
|
|
2207
|
+
role_id?: string;
|
|
2067
2208
|
};
|
|
2068
|
-
Relationships: [
|
|
2209
|
+
Relationships: [
|
|
2210
|
+
{
|
|
2211
|
+
foreignKeyName: "org_rol_assignments_granted_by_fkey";
|
|
2212
|
+
columns: ["granted_by"];
|
|
2213
|
+
isOneToOne: false;
|
|
2214
|
+
referencedRelation: "users";
|
|
2215
|
+
referencedColumns: ["id"];
|
|
2216
|
+
},
|
|
2217
|
+
{
|
|
2218
|
+
foreignKeyName: "org_rol_assignments_membership_id_fkey";
|
|
2219
|
+
columns: ["membership_id"];
|
|
2220
|
+
isOneToOne: false;
|
|
2221
|
+
referencedRelation: "org_memberships";
|
|
2222
|
+
referencedColumns: ["id"];
|
|
2223
|
+
},
|
|
2224
|
+
{
|
|
2225
|
+
foreignKeyName: "org_rol_assignments_role_id_fkey";
|
|
2226
|
+
columns: ["role_id"];
|
|
2227
|
+
isOneToOne: false;
|
|
2228
|
+
referencedRelation: "org_rol_definitions";
|
|
2229
|
+
referencedColumns: ["id"];
|
|
2230
|
+
}
|
|
2231
|
+
];
|
|
2069
2232
|
};
|
|
2070
|
-
|
|
2233
|
+
org_rol_definitions: {
|
|
2071
2234
|
Row: {
|
|
2072
|
-
checklist: Json | null;
|
|
2073
|
-
completed_at: string | null;
|
|
2074
2235
|
created_at: string;
|
|
2075
2236
|
description: string | null;
|
|
2076
|
-
due_date: string | null;
|
|
2077
2237
|
id: string;
|
|
2078
|
-
|
|
2238
|
+
is_system: boolean;
|
|
2079
2239
|
name: string;
|
|
2080
|
-
organization_id: string;
|
|
2081
|
-
|
|
2082
|
-
sequence: number;
|
|
2083
|
-
status: string;
|
|
2240
|
+
organization_id: string | null;
|
|
2241
|
+
slug: string;
|
|
2084
2242
|
updated_at: string;
|
|
2085
2243
|
};
|
|
2086
2244
|
Insert: {
|
|
2087
|
-
checklist?: Json | null;
|
|
2088
|
-
completed_at?: string | null;
|
|
2089
2245
|
created_at?: string;
|
|
2090
2246
|
description?: string | null;
|
|
2091
|
-
due_date?: string | null;
|
|
2092
2247
|
id?: string;
|
|
2093
|
-
|
|
2248
|
+
is_system?: boolean;
|
|
2094
2249
|
name: string;
|
|
2095
|
-
organization_id
|
|
2096
|
-
|
|
2097
|
-
sequence?: number;
|
|
2098
|
-
status?: string;
|
|
2250
|
+
organization_id?: string | null;
|
|
2251
|
+
slug: string;
|
|
2099
2252
|
updated_at?: string;
|
|
2100
2253
|
};
|
|
2101
2254
|
Update: {
|
|
2102
|
-
checklist?: Json | null;
|
|
2103
|
-
completed_at?: string | null;
|
|
2104
2255
|
created_at?: string;
|
|
2105
2256
|
description?: string | null;
|
|
2106
|
-
due_date?: string | null;
|
|
2107
2257
|
id?: string;
|
|
2108
|
-
|
|
2258
|
+
is_system?: boolean;
|
|
2109
2259
|
name?: string;
|
|
2110
|
-
organization_id?: string;
|
|
2111
|
-
|
|
2112
|
-
sequence?: number;
|
|
2113
|
-
status?: string;
|
|
2260
|
+
organization_id?: string | null;
|
|
2261
|
+
slug?: string;
|
|
2114
2262
|
updated_at?: string;
|
|
2115
2263
|
};
|
|
2116
2264
|
Relationships: [
|
|
2117
2265
|
{
|
|
2118
|
-
foreignKeyName: "
|
|
2119
|
-
columns: ["
|
|
2266
|
+
foreignKeyName: "org_rol_definitions_organization_id_fkey";
|
|
2267
|
+
columns: ["organization_id"];
|
|
2120
2268
|
isOneToOne: false;
|
|
2121
|
-
referencedRelation: "
|
|
2269
|
+
referencedRelation: "organizations";
|
|
2122
2270
|
referencedColumns: ["id"];
|
|
2123
|
-
}
|
|
2271
|
+
}
|
|
2272
|
+
];
|
|
2273
|
+
};
|
|
2274
|
+
org_rol_grants: {
|
|
2275
|
+
Row: {
|
|
2276
|
+
granted_at: string;
|
|
2277
|
+
permission_key: string;
|
|
2278
|
+
role_id: string;
|
|
2279
|
+
};
|
|
2280
|
+
Insert: {
|
|
2281
|
+
granted_at?: string;
|
|
2282
|
+
permission_key: string;
|
|
2283
|
+
role_id: string;
|
|
2284
|
+
};
|
|
2285
|
+
Update: {
|
|
2286
|
+
granted_at?: string;
|
|
2287
|
+
permission_key?: string;
|
|
2288
|
+
role_id?: string;
|
|
2289
|
+
};
|
|
2290
|
+
Relationships: [
|
|
2291
|
+
{
|
|
2292
|
+
foreignKeyName: "org_rol_grants_permission_key_fkey";
|
|
2293
|
+
columns: ["permission_key"];
|
|
2294
|
+
isOneToOne: false;
|
|
2295
|
+
referencedRelation: "org_rol_permissions";
|
|
2296
|
+
referencedColumns: ["key"];
|
|
2297
|
+
},
|
|
2298
|
+
{
|
|
2299
|
+
foreignKeyName: "org_rol_grants_role_id_fkey";
|
|
2300
|
+
columns: ["role_id"];
|
|
2301
|
+
isOneToOne: false;
|
|
2302
|
+
referencedRelation: "org_rol_definitions";
|
|
2303
|
+
referencedColumns: ["id"];
|
|
2304
|
+
}
|
|
2305
|
+
];
|
|
2306
|
+
};
|
|
2307
|
+
org_rol_permissions: {
|
|
2308
|
+
Row: {
|
|
2309
|
+
created_at: string;
|
|
2310
|
+
description: string;
|
|
2311
|
+
is_org_grantable: boolean;
|
|
2312
|
+
key: string;
|
|
2313
|
+
updated_at: string;
|
|
2314
|
+
};
|
|
2315
|
+
Insert: {
|
|
2316
|
+
created_at?: string;
|
|
2317
|
+
description: string;
|
|
2318
|
+
is_org_grantable?: boolean;
|
|
2319
|
+
key: string;
|
|
2320
|
+
updated_at?: string;
|
|
2321
|
+
};
|
|
2322
|
+
Update: {
|
|
2323
|
+
created_at?: string;
|
|
2324
|
+
description?: string;
|
|
2325
|
+
is_org_grantable?: boolean;
|
|
2326
|
+
key?: string;
|
|
2327
|
+
updated_at?: string;
|
|
2328
|
+
};
|
|
2329
|
+
Relationships: [];
|
|
2330
|
+
};
|
|
2331
|
+
organizations: {
|
|
2332
|
+
Row: {
|
|
2333
|
+
config: Json;
|
|
2334
|
+
created_at: string;
|
|
2335
|
+
id: string;
|
|
2336
|
+
is_test: boolean;
|
|
2337
|
+
metadata: Json;
|
|
2338
|
+
name: string;
|
|
2339
|
+
status: string;
|
|
2340
|
+
updated_at: string;
|
|
2341
|
+
workos_org_id: string;
|
|
2342
|
+
};
|
|
2343
|
+
Insert: {
|
|
2344
|
+
config?: Json;
|
|
2345
|
+
created_at?: string;
|
|
2346
|
+
id?: string;
|
|
2347
|
+
is_test?: boolean;
|
|
2348
|
+
metadata?: Json;
|
|
2349
|
+
name: string;
|
|
2350
|
+
status?: string;
|
|
2351
|
+
updated_at?: string;
|
|
2352
|
+
workos_org_id: string;
|
|
2353
|
+
};
|
|
2354
|
+
Update: {
|
|
2355
|
+
config?: Json;
|
|
2356
|
+
created_at?: string;
|
|
2357
|
+
id?: string;
|
|
2358
|
+
is_test?: boolean;
|
|
2359
|
+
metadata?: Json;
|
|
2360
|
+
name?: string;
|
|
2361
|
+
status?: string;
|
|
2362
|
+
updated_at?: string;
|
|
2363
|
+
workos_org_id?: string;
|
|
2364
|
+
};
|
|
2365
|
+
Relationships: [];
|
|
2366
|
+
};
|
|
2367
|
+
prj_milestones: {
|
|
2368
|
+
Row: {
|
|
2369
|
+
checklist: Json | null;
|
|
2370
|
+
completed_at: string | null;
|
|
2371
|
+
created_at: string;
|
|
2372
|
+
description: string | null;
|
|
2373
|
+
due_date: string | null;
|
|
2374
|
+
id: string;
|
|
2375
|
+
metadata: Json | null;
|
|
2376
|
+
name: string;
|
|
2377
|
+
organization_id: string;
|
|
2378
|
+
project_id: string;
|
|
2379
|
+
sequence: number;
|
|
2380
|
+
status: string;
|
|
2381
|
+
updated_at: string;
|
|
2382
|
+
};
|
|
2383
|
+
Insert: {
|
|
2384
|
+
checklist?: Json | null;
|
|
2385
|
+
completed_at?: string | null;
|
|
2386
|
+
created_at?: string;
|
|
2387
|
+
description?: string | null;
|
|
2388
|
+
due_date?: string | null;
|
|
2389
|
+
id?: string;
|
|
2390
|
+
metadata?: Json | null;
|
|
2391
|
+
name: string;
|
|
2392
|
+
organization_id: string;
|
|
2393
|
+
project_id: string;
|
|
2394
|
+
sequence?: number;
|
|
2395
|
+
status?: string;
|
|
2396
|
+
updated_at?: string;
|
|
2397
|
+
};
|
|
2398
|
+
Update: {
|
|
2399
|
+
checklist?: Json | null;
|
|
2400
|
+
completed_at?: string | null;
|
|
2401
|
+
created_at?: string;
|
|
2402
|
+
description?: string | null;
|
|
2403
|
+
due_date?: string | null;
|
|
2404
|
+
id?: string;
|
|
2405
|
+
metadata?: Json | null;
|
|
2406
|
+
name?: string;
|
|
2407
|
+
organization_id?: string;
|
|
2408
|
+
project_id?: string;
|
|
2409
|
+
sequence?: number;
|
|
2410
|
+
status?: string;
|
|
2411
|
+
updated_at?: string;
|
|
2412
|
+
};
|
|
2413
|
+
Relationships: [
|
|
2414
|
+
{
|
|
2415
|
+
foreignKeyName: "fk_milestones_project";
|
|
2416
|
+
columns: ["project_id"];
|
|
2417
|
+
isOneToOne: false;
|
|
2418
|
+
referencedRelation: "prj_projects";
|
|
2419
|
+
referencedColumns: ["id"];
|
|
2420
|
+
},
|
|
2124
2421
|
{
|
|
2125
2422
|
foreignKeyName: "prj_milestones_organization_id_fkey";
|
|
2126
2423
|
columns: ["organization_id"];
|
|
@@ -2788,7 +3085,8 @@ type Database = {
|
|
|
2788
3085
|
created_at: string;
|
|
2789
3086
|
description: string | null;
|
|
2790
3087
|
id: string;
|
|
2791
|
-
|
|
3088
|
+
key_hash: string;
|
|
3089
|
+
key_prefix: string | null;
|
|
2792
3090
|
last_triggered_at: string | null;
|
|
2793
3091
|
name: string;
|
|
2794
3092
|
organization_id: string;
|
|
@@ -2801,7 +3099,8 @@ type Database = {
|
|
|
2801
3099
|
created_at?: string;
|
|
2802
3100
|
description?: string | null;
|
|
2803
3101
|
id?: string;
|
|
2804
|
-
|
|
3102
|
+
key_hash: string;
|
|
3103
|
+
key_prefix?: string | null;
|
|
2805
3104
|
last_triggered_at?: string | null;
|
|
2806
3105
|
name: string;
|
|
2807
3106
|
organization_id: string;
|
|
@@ -2814,7 +3113,8 @@ type Database = {
|
|
|
2814
3113
|
created_at?: string;
|
|
2815
3114
|
description?: string | null;
|
|
2816
3115
|
id?: string;
|
|
2817
|
-
|
|
3116
|
+
key_hash?: string;
|
|
3117
|
+
key_prefix?: string | null;
|
|
2818
3118
|
last_triggered_at?: string | null;
|
|
2819
3119
|
name?: string;
|
|
2820
3120
|
organization_id?: string;
|
|
@@ -2860,6 +3160,13 @@ type Database = {
|
|
|
2860
3160
|
Args: never;
|
|
2861
3161
|
Returns: string;
|
|
2862
3162
|
};
|
|
3163
|
+
can_assign_role_in_org: {
|
|
3164
|
+
Args: {
|
|
3165
|
+
p_role_id: string;
|
|
3166
|
+
p_target_membership_id: string;
|
|
3167
|
+
};
|
|
3168
|
+
Returns: boolean;
|
|
3169
|
+
};
|
|
2863
3170
|
current_user_is_platform_admin: {
|
|
2864
3171
|
Args: never;
|
|
2865
3172
|
Returns: boolean;
|
|
@@ -2889,6 +3196,10 @@ type Database = {
|
|
|
2889
3196
|
user_id: string;
|
|
2890
3197
|
}[];
|
|
2891
3198
|
};
|
|
3199
|
+
get_platform_credential_kek: {
|
|
3200
|
+
Args: never;
|
|
3201
|
+
Returns: string;
|
|
3202
|
+
};
|
|
2892
3203
|
get_storage_org_id: {
|
|
2893
3204
|
Args: {
|
|
2894
3205
|
file_path: string;
|
|
@@ -2899,6 +3210,13 @@ type Database = {
|
|
|
2899
3210
|
Args: never;
|
|
2900
3211
|
Returns: string;
|
|
2901
3212
|
};
|
|
3213
|
+
has_org_permission: {
|
|
3214
|
+
Args: {
|
|
3215
|
+
org_id: string;
|
|
3216
|
+
perm_key: string;
|
|
3217
|
+
};
|
|
3218
|
+
Returns: boolean;
|
|
3219
|
+
};
|
|
2902
3220
|
is_org_admin: {
|
|
2903
3221
|
Args: {
|
|
2904
3222
|
org_id: string;
|
|
@@ -2931,6 +3249,22 @@ type Database = {
|
|
|
2931
3249
|
Args: never;
|
|
2932
3250
|
Returns: Json;
|
|
2933
3251
|
};
|
|
3252
|
+
recompute_all_memberships: {
|
|
3253
|
+
Args: never;
|
|
3254
|
+
Returns: undefined;
|
|
3255
|
+
};
|
|
3256
|
+
sync_all_memberships_with_role: {
|
|
3257
|
+
Args: {
|
|
3258
|
+
p_role_id: string;
|
|
3259
|
+
};
|
|
3260
|
+
Returns: undefined;
|
|
3261
|
+
};
|
|
3262
|
+
sync_one_membership: {
|
|
3263
|
+
Args: {
|
|
3264
|
+
p_membership_id: string;
|
|
3265
|
+
};
|
|
3266
|
+
Returns: undefined;
|
|
3267
|
+
};
|
|
2934
3268
|
upsert_user_profile: {
|
|
2935
3269
|
Args: never;
|
|
2936
3270
|
Returns: {
|
|
@@ -2963,1565 +3297,1493 @@ type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables
|
|
|
2963
3297
|
Row: infer R;
|
|
2964
3298
|
} ? R : never : never;
|
|
2965
3299
|
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
*/
|
|
2969
|
-
type
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
}>;
|
|
2987
|
-
statusCounts: {
|
|
2988
|
-
success: number;
|
|
2989
|
-
failed: number;
|
|
2990
|
-
pending: number;
|
|
2991
|
-
warning: number;
|
|
2992
|
-
};
|
|
2993
|
-
peakPeriod: string;
|
|
2994
|
-
granularity: 'hour' | 'day';
|
|
2995
|
-
}
|
|
2996
|
-
/**
|
|
2997
|
-
* Error analysis metrics response
|
|
2998
|
-
* Error categories and top failing resources
|
|
2999
|
-
*/
|
|
3000
|
-
interface ErrorAnalysisMetrics {
|
|
3001
|
-
totalErrors: number;
|
|
3002
|
-
errorsByCategory: Array<{
|
|
3003
|
-
category: string;
|
|
3004
|
-
count: number;
|
|
3005
|
-
percentage: number;
|
|
3006
|
-
}>;
|
|
3007
|
-
topFailingResources: Array<{
|
|
3008
|
-
resourceId: string;
|
|
3300
|
+
type SupabaseUserProfile = Tables<'users'>;
|
|
3301
|
+
type SupabaseApiKey = Tables<'api_keys'>;
|
|
3302
|
+
/** API response type for API key list items (omits sensitive key_hash) */
|
|
3303
|
+
type ApiKeyListItem = Omit<SupabaseApiKey, 'key_hash'>;
|
|
3304
|
+
|
|
3305
|
+
/** Raw database row type for acq_deals table */
|
|
3306
|
+
type AcqDealRow = Database['public']['Tables']['acq_deals']['Row'];
|
|
3307
|
+
type DealStage = 'interested' | 'proposal' | 'closing' | 'closed_won' | 'closed_lost' | 'nurturing';
|
|
3308
|
+
interface DealContact {
|
|
3309
|
+
id: string;
|
|
3310
|
+
first_name: string | null;
|
|
3311
|
+
last_name: string | null;
|
|
3312
|
+
email: string;
|
|
3313
|
+
title: string | null;
|
|
3314
|
+
headline: string | null;
|
|
3315
|
+
linkedin_url: string | null;
|
|
3316
|
+
pipeline_status: Record<string, unknown> | null;
|
|
3317
|
+
enrichment_data: Record<string, unknown> | null;
|
|
3318
|
+
company: {
|
|
3319
|
+
id: string;
|
|
3009
3320
|
name: string;
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3321
|
+
domain: string | null;
|
|
3322
|
+
website: string | null;
|
|
3323
|
+
linkedin_url: string | null;
|
|
3324
|
+
segment: string | null;
|
|
3325
|
+
category: string | null;
|
|
3326
|
+
num_employees: number | null;
|
|
3327
|
+
} | null;
|
|
3013
3328
|
}
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3329
|
+
interface DealFilters {
|
|
3330
|
+
stage?: DealStage;
|
|
3331
|
+
search?: string;
|
|
3332
|
+
limit?: number;
|
|
3333
|
+
offset?: number;
|
|
3334
|
+
}
|
|
3335
|
+
/** Deal list item with joined contact and company data */
|
|
3336
|
+
interface DealListItem extends AcqDealRow {
|
|
3337
|
+
contact: DealContact | null;
|
|
3023
3338
|
}
|
|
3339
|
+
type DealDetail = DealListItem;
|
|
3340
|
+
/** Task kind options for a deal task (human follow-up action type) */
|
|
3341
|
+
type AcqDealTaskKind = 'call' | 'email' | 'meeting' | 'other';
|
|
3024
3342
|
/**
|
|
3025
|
-
*
|
|
3026
|
-
*
|
|
3343
|
+
* A CRM to-do item attached to a deal representing a human follow-up action.
|
|
3344
|
+
* Transformed from AcqDealTaskRow with camelCase properties.
|
|
3027
3345
|
*/
|
|
3028
|
-
interface
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3346
|
+
interface AcqDealTask {
|
|
3347
|
+
id: string;
|
|
3348
|
+
organizationId: string;
|
|
3349
|
+
dealId: string;
|
|
3350
|
+
title: string;
|
|
3351
|
+
description: string | null;
|
|
3352
|
+
kind: AcqDealTaskKind;
|
|
3353
|
+
dueAt: string | null;
|
|
3354
|
+
assigneeUserId: string | null;
|
|
3355
|
+
completedAt: string | null;
|
|
3356
|
+
completedByUserId: string | null;
|
|
3357
|
+
createdAt: string;
|
|
3358
|
+
updatedAt: string;
|
|
3359
|
+
createdByUserId: string | null;
|
|
3035
3360
|
}
|
|
3036
3361
|
/**
|
|
3037
|
-
*
|
|
3038
|
-
*
|
|
3039
|
-
* Note: Throughput data is now included in executionHealth.trendData.executionCount
|
|
3362
|
+
* Live-scan aggregate telemetry for a single list, computed on demand from
|
|
3363
|
+
* the list junction tables and current contact deliverability state.
|
|
3040
3364
|
*/
|
|
3041
|
-
interface
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3365
|
+
interface ListTelemetry {
|
|
3366
|
+
listId: string;
|
|
3367
|
+
totalCompanies: number;
|
|
3368
|
+
totalContacts: number;
|
|
3369
|
+
stageCounts: {
|
|
3370
|
+
populated: number;
|
|
3371
|
+
extracted: number;
|
|
3372
|
+
qualified: number;
|
|
3373
|
+
discovered: number;
|
|
3374
|
+
verified: number;
|
|
3375
|
+
personalized: number;
|
|
3376
|
+
uploaded: number;
|
|
3377
|
+
};
|
|
3378
|
+
deliverability: {
|
|
3379
|
+
valid: number;
|
|
3380
|
+
risky: number;
|
|
3381
|
+
invalid: number;
|
|
3382
|
+
unknown: number;
|
|
3383
|
+
bounced: number;
|
|
3384
|
+
};
|
|
3385
|
+
/** Reserved -- active workflow IDs associated with this list. */
|
|
3386
|
+
activeWorkflows?: string[];
|
|
3049
3387
|
}
|
|
3388
|
+
|
|
3050
3389
|
/**
|
|
3051
|
-
*
|
|
3390
|
+
* Lead Service Types
|
|
3391
|
+
* CRUD operation types for the acquisition platform (lists, companies, contacts, deals)
|
|
3392
|
+
*
|
|
3393
|
+
* Implementation: apps/api/src/acquisition/lead-service.ts (LeadService class)
|
|
3052
3394
|
*/
|
|
3053
|
-
|
|
3395
|
+
|
|
3396
|
+
interface AcqDealNote {
|
|
3054
3397
|
id: string;
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
severity: 'critical' | 'warning' | 'info';
|
|
3062
|
-
category: ExecutionErrorCategory;
|
|
3063
|
-
resolved: boolean;
|
|
3064
|
-
resolvedAt: string | null;
|
|
3065
|
-
resolvedBy: string | null;
|
|
3398
|
+
dealId: string;
|
|
3399
|
+
organizationId: string;
|
|
3400
|
+
authorUserId: string | null;
|
|
3401
|
+
body: string;
|
|
3402
|
+
createdAt: string;
|
|
3403
|
+
updatedAt: string;
|
|
3066
3404
|
}
|
|
3405
|
+
|
|
3067
3406
|
/**
|
|
3068
|
-
*
|
|
3407
|
+
* Action configuration for HITL tasks
|
|
3408
|
+
* Defines available user actions and their behavior
|
|
3069
3409
|
*/
|
|
3070
|
-
interface
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3410
|
+
interface ActionConfig {
|
|
3411
|
+
/** Unique action identifier (e.g., 'approve', 'retry', 'escalate') */
|
|
3412
|
+
id: string;
|
|
3413
|
+
/** Display label for UI button */
|
|
3414
|
+
label: string;
|
|
3415
|
+
/** Button variant/style */
|
|
3416
|
+
type: 'primary' | 'secondary' | 'danger' | 'outline';
|
|
3417
|
+
/** Tabler icon name (e.g., 'IconCheck', 'IconRefresh') */
|
|
3418
|
+
icon?: string;
|
|
3419
|
+
/** Button color (Mantine theme colors) */
|
|
3420
|
+
color?: string;
|
|
3421
|
+
/** Button variant (Mantine button variant, e.g., 'light', 'filled', 'outline') */
|
|
3422
|
+
variant?: string;
|
|
3423
|
+
/** Execution target (agent/workflow to invoke) */
|
|
3424
|
+
target?: {
|
|
3425
|
+
resourceType: 'agent' | 'workflow';
|
|
3426
|
+
resourceId: string;
|
|
3427
|
+
/**
|
|
3428
|
+
* Optional session ID for agent continuation.
|
|
3429
|
+
* If provided, invokes a new turn on the existing session instead of standalone execution.
|
|
3430
|
+
* Only valid when resourceType is 'agent'.
|
|
3431
|
+
*/
|
|
3432
|
+
sessionId?: string;
|
|
3433
|
+
};
|
|
3434
|
+
/** Form schema for collecting action-specific data */
|
|
3435
|
+
form?: FormSchema;
|
|
3436
|
+
/** Payload template for pre-filling forms */
|
|
3437
|
+
payloadTemplate?: unknown;
|
|
3438
|
+
/** Requires confirmation dialog */
|
|
3439
|
+
requiresConfirmation?: boolean;
|
|
3440
|
+
/** Confirmation message */
|
|
3441
|
+
confirmationMessage?: string;
|
|
3442
|
+
/** Help text / tooltip */
|
|
3443
|
+
description?: string;
|
|
3077
3444
|
}
|
|
3445
|
+
|
|
3078
3446
|
/**
|
|
3079
|
-
*
|
|
3447
|
+
* Origin resource type - where an execution/task originated from.
|
|
3448
|
+
* Used for audit trails and tracking execution lineage.
|
|
3080
3449
|
*/
|
|
3081
|
-
|
|
3082
|
-
errors: ErrorRecord[];
|
|
3083
|
-
total: number;
|
|
3084
|
-
page: number;
|
|
3085
|
-
limit: number;
|
|
3086
|
-
}
|
|
3450
|
+
type OriginResourceType = 'agent' | 'workflow' | 'scheduler' | 'api';
|
|
3087
3451
|
/**
|
|
3088
|
-
*
|
|
3452
|
+
* Origin tracking metadata - who/what created this execution/task.
|
|
3453
|
+
* Used by both TaskScheduler and CommandQueue for complete audit trails.
|
|
3089
3454
|
*/
|
|
3090
|
-
interface
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
warningCount: number;
|
|
3095
|
-
infoCount: number;
|
|
3455
|
+
interface OriginTracking {
|
|
3456
|
+
originExecutionId: string;
|
|
3457
|
+
originResourceType: OriginResourceType;
|
|
3458
|
+
originResourceId: string;
|
|
3096
3459
|
}
|
|
3460
|
+
|
|
3097
3461
|
/**
|
|
3098
|
-
*
|
|
3099
|
-
* Used by RecentExecutionsByResource dashboard component
|
|
3462
|
+
* Command queue task with flexible action system
|
|
3100
3463
|
*/
|
|
3101
|
-
interface
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3464
|
+
interface Task extends OriginTracking {
|
|
3465
|
+
id: string;
|
|
3466
|
+
organizationId: string;
|
|
3467
|
+
actions: ActionConfig[];
|
|
3468
|
+
context: unknown;
|
|
3469
|
+
selectedAction?: string;
|
|
3470
|
+
actionPayload?: unknown;
|
|
3471
|
+
description?: string;
|
|
3472
|
+
priority: number;
|
|
3473
|
+
/** Optional checkpoint identifier for grouping related human approval tasks */
|
|
3474
|
+
humanCheckpoint?: string;
|
|
3475
|
+
status: QueueTaskStatus;
|
|
3476
|
+
/**
|
|
3477
|
+
* Target resource tracking — mirrors origin columns.
|
|
3478
|
+
* Set when task is created; patchable to redirect execution to a different resource.
|
|
3479
|
+
*/
|
|
3480
|
+
targetResourceId?: string;
|
|
3481
|
+
targetResourceType?: 'agent' | 'workflow';
|
|
3482
|
+
/**
|
|
3483
|
+
* Execution ID for the action that runs AFTER user approval.
|
|
3484
|
+
* NULL until execution starts.
|
|
3485
|
+
*
|
|
3486
|
+
* Naming distinction:
|
|
3487
|
+
* - originExecutionId = Parent execution that CREATED the HITL task
|
|
3488
|
+
* - targetExecutionId = Child execution that RUNS AFTER user approval
|
|
3489
|
+
*/
|
|
3490
|
+
targetExecutionId?: string;
|
|
3491
|
+
createdAt: Date;
|
|
3492
|
+
completedAt?: Date;
|
|
3493
|
+
completedBy?: string;
|
|
3494
|
+
expiresAt?: Date;
|
|
3495
|
+
idempotencyKey?: string | null;
|
|
3111
3496
|
}
|
|
3112
3497
|
/**
|
|
3113
|
-
*
|
|
3498
|
+
* Task status values
|
|
3499
|
+
* - pending: awaiting action
|
|
3500
|
+
* - processing: execution in progress after user approval
|
|
3501
|
+
* - completed: action was taken and execution succeeded
|
|
3502
|
+
* - failed: execution failed, task can be retried
|
|
3503
|
+
* - expired: timed out before action
|
|
3114
3504
|
*/
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
interface
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
rate: number;
|
|
3130
|
-
}
|
|
3131
|
-
/** Health data for a single resource */
|
|
3132
|
-
interface ResourceHealth {
|
|
3133
|
-
entityType: string;
|
|
3134
|
-
entityId: string;
|
|
3135
|
-
entityName: string | null;
|
|
3136
|
-
trendData: ResourceHealthDataPoint[];
|
|
3137
|
-
summary: {
|
|
3138
|
-
total: number;
|
|
3139
|
-
successRate: number;
|
|
3140
|
-
};
|
|
3505
|
+
type QueueTaskStatus = 'pending' | 'processing' | 'completed' | 'failed' | 'expired';
|
|
3506
|
+
/**
|
|
3507
|
+
* Parameters for patching mutable metadata on a task
|
|
3508
|
+
*/
|
|
3509
|
+
interface PatchTaskParams {
|
|
3510
|
+
humanCheckpoint?: string | null;
|
|
3511
|
+
description?: string;
|
|
3512
|
+
priority?: number;
|
|
3513
|
+
context?: Record<string, unknown>;
|
|
3514
|
+
actions?: unknown[];
|
|
3515
|
+
targetResourceId?: string | null;
|
|
3516
|
+
targetResourceType?: 'agent' | 'workflow' | null;
|
|
3517
|
+
targetExecutionId?: string;
|
|
3518
|
+
status?: 'pending' | 'failed' | 'completed';
|
|
3141
3519
|
}
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3520
|
+
interface CommandQueueListResponse {
|
|
3521
|
+
tasks: Task[];
|
|
3522
|
+
total: number;
|
|
3145
3523
|
}
|
|
3524
|
+
|
|
3146
3525
|
/**
|
|
3147
|
-
*
|
|
3148
|
-
*
|
|
3526
|
+
* Checkpoint list item for sidebar grouping
|
|
3527
|
+
* The id field contains the resourceId of the human checkpoint
|
|
3149
3528
|
*/
|
|
3150
|
-
interface
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
* Cost trends response (time-series data)
|
|
3158
|
-
*/
|
|
3159
|
-
interface CostTrendsResponse {
|
|
3160
|
-
trendData: CostTrendDataPoint[];
|
|
3161
|
-
granularity: 'hour' | 'day';
|
|
3162
|
-
totalCostUsd: number;
|
|
3163
|
-
totalExecutions: number;
|
|
3529
|
+
interface CheckpointListItem {
|
|
3530
|
+
/** Human checkpoint resourceId (or 'ungrouped' for tasks without checkpoint) */
|
|
3531
|
+
id: string;
|
|
3532
|
+
/** Display name (same as id, or "Ungrouped" for null) */
|
|
3533
|
+
name: string;
|
|
3534
|
+
/** Task count for this checkpoint */
|
|
3535
|
+
count: number;
|
|
3164
3536
|
}
|
|
3165
3537
|
/**
|
|
3166
|
-
*
|
|
3538
|
+
* Status counts for pie chart display
|
|
3167
3539
|
*/
|
|
3168
|
-
interface
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
};
|
|
3173
|
-
previous: {
|
|
3174
|
-
totalCostUsd: number;
|
|
3175
|
-
executionCount: number;
|
|
3176
|
-
};
|
|
3177
|
-
mtd: {
|
|
3178
|
-
totalCostUsd: number;
|
|
3179
|
-
daysElapsed: number;
|
|
3180
|
-
};
|
|
3181
|
-
projection: {
|
|
3182
|
-
monthlyCostUsd: number;
|
|
3183
|
-
confidence: 'low' | 'medium' | 'high';
|
|
3184
|
-
};
|
|
3185
|
-
trend: {
|
|
3186
|
-
changePercent: number;
|
|
3187
|
-
direction: 'up' | 'down' | 'flat';
|
|
3188
|
-
};
|
|
3540
|
+
interface StatusCounts {
|
|
3541
|
+
pending: number;
|
|
3542
|
+
completed: number;
|
|
3543
|
+
expired: number;
|
|
3189
3544
|
}
|
|
3190
3545
|
/**
|
|
3191
|
-
*
|
|
3546
|
+
* Priority counts for donut chart display
|
|
3192
3547
|
*/
|
|
3193
|
-
interface
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
totalOutputTokens: number;
|
|
3199
|
-
avgCostPerCall: number;
|
|
3548
|
+
interface PriorityCounts {
|
|
3549
|
+
critical: number;
|
|
3550
|
+
high: number;
|
|
3551
|
+
medium: number;
|
|
3552
|
+
low: number;
|
|
3200
3553
|
}
|
|
3201
3554
|
/**
|
|
3202
|
-
*
|
|
3555
|
+
* Response from GET /command-queue/checkpoints endpoint
|
|
3203
3556
|
*/
|
|
3204
|
-
interface
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3557
|
+
interface CheckpointListResponse {
|
|
3558
|
+
checkpoints: CheckpointListItem[];
|
|
3559
|
+
/** Total tasks across all checkpoints */
|
|
3560
|
+
total: number;
|
|
3561
|
+
/** Breakdown by status for donut chart */
|
|
3562
|
+
statusCounts: StatusCounts;
|
|
3563
|
+
/** Breakdown by priority for donut chart */
|
|
3564
|
+
priorityCounts: PriorityCounts;
|
|
3208
3565
|
}
|
|
3209
3566
|
|
|
3210
3567
|
/**
|
|
3211
|
-
*
|
|
3212
|
-
*
|
|
3213
|
-
*
|
|
3214
|
-
* Each integration type corresponds to an adapter implementation.
|
|
3215
|
-
*
|
|
3216
|
-
* Note: Concrete adapter implementations are deferred until needed.
|
|
3217
|
-
* This type provides compile-time safety and auto-completion for tool definitions.
|
|
3218
|
-
*/
|
|
3219
|
-
type IntegrationType = 'gmail' | 'google-sheets' | 'slack' | 'github' | 'linear' | 'attio' | 'airtable' | 'salesforce' | 'hubspot' | 'stripe' | 'twilio' | 'sendgrid' | 'mailgun' | 'zapier' | 'webhook' | 'apify' | 'instantly' | 'resend' | 'signature-api' | 'dropbox' | 'anymailfinder' | 'tomba' | 'millionverifier';
|
|
3220
|
-
|
|
3221
|
-
/**
|
|
3222
|
-
* Standard Domain Definitions
|
|
3223
|
-
* Centralized domain constants and definitions for all organization resources.
|
|
3224
|
-
*/
|
|
3225
|
-
|
|
3226
|
-
declare const DOMAINS: {
|
|
3227
|
-
readonly INBOUND_PIPELINE: "inbound-pipeline";
|
|
3228
|
-
readonly LEAD_GEN_PIPELINE: "lead-gen-pipeline";
|
|
3229
|
-
readonly SUPPORT: "support";
|
|
3230
|
-
readonly CLIENT_SUPPORT: "client-support";
|
|
3231
|
-
readonly DELIVERY: "delivery";
|
|
3232
|
-
readonly OPERATIONS: "operations";
|
|
3233
|
-
readonly FINANCE: "finance";
|
|
3234
|
-
readonly EXECUTIVE: "executive";
|
|
3235
|
-
readonly INSTANTLY: "instantly";
|
|
3236
|
-
readonly TESTING: "testing";
|
|
3237
|
-
readonly INTERNAL: "internal";
|
|
3238
|
-
readonly INTEGRATION: "integration";
|
|
3239
|
-
readonly UTILITY: "utility";
|
|
3240
|
-
readonly DIAGNOSTIC: "diagnostic";
|
|
3241
|
-
};
|
|
3242
|
-
/**
|
|
3243
|
-
* ResourceDomain - Strongly typed domain identifier
|
|
3244
|
-
* Use this type for all domain references to ensure compile-time validation.
|
|
3245
|
-
*/
|
|
3246
|
-
type ResourceDomain = (typeof DOMAINS)[keyof typeof DOMAINS];
|
|
3247
|
-
|
|
3248
|
-
/**
|
|
3249
|
-
* Resource Registry type definitions
|
|
3250
|
-
*/
|
|
3251
|
-
|
|
3252
|
-
/**
|
|
3253
|
-
* Environment/deployment status for resources
|
|
3254
|
-
*/
|
|
3255
|
-
type ResourceStatus = 'dev' | 'prod';
|
|
3256
|
-
/**
|
|
3257
|
-
* All resource types in the platform
|
|
3258
|
-
* Used as the discriminator field in ResourceDefinition
|
|
3259
|
-
*/
|
|
3260
|
-
type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'external' | 'human';
|
|
3261
|
-
/**
|
|
3262
|
-
* Base interface for ALL platform resources
|
|
3263
|
-
* Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
|
|
3568
|
+
* Target for schedule execution - identifies what resource to execute.
|
|
3569
|
+
* Unlike ExecutionTarget, payload is NOT included here because schedules
|
|
3570
|
+
* store payload in the scheduleConfig (varies per step/item).
|
|
3264
3571
|
*/
|
|
3265
|
-
interface
|
|
3266
|
-
|
|
3572
|
+
interface ScheduleTarget {
|
|
3573
|
+
resourceType: 'agent' | 'workflow';
|
|
3267
3574
|
resourceId: string;
|
|
3268
|
-
/** Display name */
|
|
3269
|
-
name: string;
|
|
3270
|
-
/** Purpose and functionality description */
|
|
3271
|
-
description: string;
|
|
3272
|
-
/** Version for change tracking and evolution */
|
|
3273
|
-
version: string;
|
|
3274
|
-
/** Resource type discriminator */
|
|
3275
|
-
type: ResourceType;
|
|
3276
|
-
/** Environment/deployment status */
|
|
3277
|
-
status: ResourceStatus;
|
|
3278
|
-
/** Domain tags for filtering and organization */
|
|
3279
|
-
domains?: ResourceDomain[];
|
|
3280
|
-
/** Whether the agent supports multi-turn sessions (agents only) */
|
|
3281
|
-
sessionCapable?: boolean;
|
|
3282
|
-
/** Whether the resource is local (monorepo) or remote (externally deployed) */
|
|
3283
|
-
origin?: 'local' | 'remote';
|
|
3284
|
-
/** Whether this resource is archived and should be excluded from registration and deployment */
|
|
3285
|
-
archived?: boolean;
|
|
3286
3575
|
}
|
|
3287
3576
|
/**
|
|
3288
|
-
*
|
|
3289
|
-
*
|
|
3290
|
-
*
|
|
3291
|
-
* No execution impact - purely for visualization.
|
|
3292
|
-
*
|
|
3293
|
-
* @example
|
|
3294
|
-
* {
|
|
3295
|
-
* id: 'support',
|
|
3296
|
-
* name: 'Customer Support',
|
|
3297
|
-
* description: 'Ticket triage, knowledge base, escalations',
|
|
3298
|
-
* color: 'green',
|
|
3299
|
-
* icon: 'IconHeadset'
|
|
3300
|
-
* }
|
|
3577
|
+
* Optional origin tracking for schedules.
|
|
3578
|
+
* Unlike OriginTracking (which is required), these fields are all optional
|
|
3579
|
+
* for schedules created directly via API (not triggered by another resource).
|
|
3301
3580
|
*/
|
|
3302
|
-
interface
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
name: string;
|
|
3307
|
-
/** Purpose description */
|
|
3308
|
-
description: string;
|
|
3309
|
-
/** Optional Mantine color for UI (e.g., 'blue', 'green', 'orange') */
|
|
3310
|
-
color?: string;
|
|
3311
|
-
/** Optional Tabler icon name (e.g., 'IconHeadset') */
|
|
3312
|
-
icon?: string;
|
|
3581
|
+
interface ScheduleOriginTracking {
|
|
3582
|
+
originExecutionId?: string;
|
|
3583
|
+
originResourceType?: OriginResourceType;
|
|
3584
|
+
originResourceId?: string;
|
|
3313
3585
|
}
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
/** References credential in credentials table for per-org webhook secrets */
|
|
3325
|
-
credentialName?: string;
|
|
3586
|
+
type TaskScheduleConfig = RecurringScheduleConfig | RelativeScheduleConfig | AbsoluteScheduleConfig;
|
|
3587
|
+
interface RecurringScheduleConfig {
|
|
3588
|
+
type: 'recurring';
|
|
3589
|
+
cron?: string;
|
|
3590
|
+
interval?: 'daily' | 'weekly' | 'monthly';
|
|
3591
|
+
time?: string;
|
|
3592
|
+
timezone: string;
|
|
3593
|
+
payload: Record<string, unknown>;
|
|
3594
|
+
endAt?: string | null;
|
|
3595
|
+
overduePolicy?: 'skip' | 'execute';
|
|
3326
3596
|
}
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3597
|
+
interface RelativeScheduleConfig {
|
|
3598
|
+
type: 'relative';
|
|
3599
|
+
anchorAt: string;
|
|
3600
|
+
anchorLabel?: string;
|
|
3601
|
+
items: RelativeScheduleItem[];
|
|
3602
|
+
overduePolicy?: 'skip' | 'execute';
|
|
3333
3603
|
}
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
/** Event source */
|
|
3339
|
-
source?: string;
|
|
3604
|
+
interface RelativeScheduleItem {
|
|
3605
|
+
offset: string;
|
|
3606
|
+
payload: Record<string, unknown>;
|
|
3607
|
+
label?: string;
|
|
3340
3608
|
}
|
|
3341
|
-
|
|
3342
|
-
type
|
|
3609
|
+
interface AbsoluteScheduleConfig {
|
|
3610
|
+
type: 'absolute';
|
|
3611
|
+
items: AbsoluteScheduleItem[];
|
|
3612
|
+
overduePolicy?: 'skip' | 'execute';
|
|
3613
|
+
}
|
|
3614
|
+
interface AbsoluteScheduleItem {
|
|
3615
|
+
runAt: string;
|
|
3616
|
+
payload: Record<string, unknown>;
|
|
3617
|
+
label?: string;
|
|
3618
|
+
}
|
|
3619
|
+
interface TaskSchedule extends ScheduleOriginTracking {
|
|
3620
|
+
id: string;
|
|
3621
|
+
organizationId: string;
|
|
3622
|
+
name: string;
|
|
3623
|
+
description?: string;
|
|
3624
|
+
target: ScheduleTarget;
|
|
3625
|
+
scheduleConfig: TaskScheduleConfig;
|
|
3626
|
+
nextRunAt?: Date;
|
|
3627
|
+
currentStep: number;
|
|
3628
|
+
status: 'active' | 'paused' | 'completed' | 'cancelled';
|
|
3629
|
+
lastRunAt?: Date;
|
|
3630
|
+
lastExecutionId?: string;
|
|
3631
|
+
maxRetries: number;
|
|
3632
|
+
idempotencyKey?: string;
|
|
3633
|
+
createdAt: Date;
|
|
3634
|
+
updatedAt: Date;
|
|
3635
|
+
}
|
|
3636
|
+
|
|
3343
3637
|
/**
|
|
3344
|
-
*
|
|
3345
|
-
*
|
|
3346
|
-
*
|
|
3347
|
-
* scheduled cron jobs, platform events, or manual user actions.
|
|
3348
|
-
*
|
|
3349
|
-
* BREAKING CHANGES (2025-11-30):
|
|
3350
|
-
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
|
|
3351
|
-
* - Field renames: `id` -> `resourceId` (inherited), `type` -> `triggerType`
|
|
3352
|
-
* - Relationship rename: `invokes` -> `triggers` (unified vocabulary)
|
|
3353
|
-
* - New required fields: `version` (inherited), `type: 'trigger'` (inherited)
|
|
3354
|
-
* - triggers object now includes `externalResources` option
|
|
3355
|
-
*
|
|
3356
|
-
* @example
|
|
3357
|
-
* // TriggerDefinition - metadata only
|
|
3358
|
-
* {
|
|
3359
|
-
* resourceId: 'trigger-new-order',
|
|
3360
|
-
* type: 'trigger',
|
|
3361
|
-
* triggerType: 'webhook',
|
|
3362
|
-
* name: 'New Order',
|
|
3363
|
-
* description: 'Webhook from Shopify on new orders',
|
|
3364
|
-
* version: '1.0.0',
|
|
3365
|
-
* status: 'prod',
|
|
3366
|
-
* webhookPath: '/webhooks/shopify/orders'
|
|
3367
|
-
* }
|
|
3368
|
-
*
|
|
3369
|
-
* // Relationships declared in ResourceRelationships (not on TriggerDefinition):
|
|
3370
|
-
* // relationships: {
|
|
3371
|
-
* // 'trigger-new-order': { triggers: { workflows: ['order-fulfillment-workflow'] } }
|
|
3372
|
-
* // }
|
|
3638
|
+
* Wire-format DTO for notification API responses.
|
|
3639
|
+
* Dates are ISO 8601 strings (not Date objects like the domain Notification type).
|
|
3640
|
+
* Used by frontend hooks that consume /api/notifications.
|
|
3373
3641
|
*/
|
|
3374
|
-
interface
|
|
3375
|
-
/** Resource type discriminator (narrowed from base union) */
|
|
3376
|
-
type: 'trigger';
|
|
3377
|
-
/** Trigger mechanism type (renamed from 'type' to avoid collision with base type discriminator) */
|
|
3378
|
-
triggerType: 'webhook' | 'schedule' | 'manual' | 'event';
|
|
3379
|
-
/** Type-specific configuration */
|
|
3380
|
-
config?: TriggerConfig;
|
|
3381
|
-
/** For webhook triggers: path like '/webhooks/shopify/orders' */
|
|
3382
|
-
webhookPath?: string;
|
|
3383
|
-
/** For schedule triggers: cron expression like '0 6 * * *' */
|
|
3384
|
-
schedule?: string;
|
|
3385
|
-
/** For event triggers: event type like 'low-stock-alert' */
|
|
3386
|
-
eventType?: string;
|
|
3387
|
-
}
|
|
3388
|
-
/**
|
|
3389
|
-
* Integration metadata - external service connections
|
|
3390
|
-
*
|
|
3391
|
-
* References credentials table for actual connection. No connection status
|
|
3392
|
-
* stored here (queried at runtime from credentials table).
|
|
3393
|
-
*
|
|
3394
|
-
* BREAKING CHANGES (2025-11-30):
|
|
3395
|
-
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
|
|
3396
|
-
* - Field renames: `id` -> `resourceId` (inherited)
|
|
3397
|
-
* - New required field: `status` (inherited) - organizations must add status to all integrations
|
|
3398
|
-
* - New required field: `version` (inherited) - organizations must add version to all integrations
|
|
3399
|
-
* - New required field: `type: 'integration'` (inherited) - resource type discriminator
|
|
3400
|
-
*
|
|
3401
|
-
* @example
|
|
3402
|
-
* {
|
|
3403
|
-
* resourceId: 'integration-shopify-prod',
|
|
3404
|
-
* type: 'integration',
|
|
3405
|
-
* provider: 'shopify',
|
|
3406
|
-
* credentialName: 'shopify-prod',
|
|
3407
|
-
* name: 'Shopify Production',
|
|
3408
|
-
* description: 'E-commerce platform',
|
|
3409
|
-
* version: '1.0.0',
|
|
3410
|
-
* status: 'prod'
|
|
3411
|
-
* }
|
|
3412
|
-
*/
|
|
3413
|
-
interface IntegrationDefinition extends ResourceDefinition {
|
|
3414
|
-
/** Resource type discriminator (narrowed from base union) */
|
|
3415
|
-
type: 'integration';
|
|
3416
|
-
/** Integration provider type */
|
|
3417
|
-
provider: IntegrationType;
|
|
3418
|
-
/** References credentials table (e.g., 'shopify-prod', 'zendesk-api') */
|
|
3419
|
-
credentialName: string;
|
|
3420
|
-
}
|
|
3421
|
-
/**
|
|
3422
|
-
* External platform type
|
|
3423
|
-
* Supported third-party automation platforms
|
|
3424
|
-
*/
|
|
3425
|
-
type ExternalPlatform = 'n8n' | 'make' | 'zapier' | 'other';
|
|
3426
|
-
/**
|
|
3427
|
-
* External automation resource metadata
|
|
3428
|
-
*
|
|
3429
|
-
* Represents workflows/automations running on third-party platforms
|
|
3430
|
-
* (n8n, Make, Zapier, etc.) for visualization in Command View.
|
|
3431
|
-
*
|
|
3432
|
-
* NOTE: This is metadata ONLY for visualization. No execution logic,
|
|
3433
|
-
* no API integration with external platforms, no status syncing.
|
|
3434
|
-
*
|
|
3435
|
-
* BREAKING CHANGES (2025-11-30):
|
|
3436
|
-
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
|
|
3437
|
-
* - Field renames: `id` -> `resourceId` (inherited)
|
|
3438
|
-
* - New required field: `version` (inherited) - organizations must add version to all external resources
|
|
3439
|
-
* - New required field: `type: 'external'` (inherited) - resource type discriminator
|
|
3440
|
-
* - REMOVED FIELD: `triggeredBy` - per relationship-consolidation design, all relationships are forward-only declarations
|
|
3441
|
-
*
|
|
3442
|
-
* @example
|
|
3443
|
-
* {
|
|
3444
|
-
* resourceId: 'external-n8n-order-sync',
|
|
3445
|
-
* type: 'external',
|
|
3446
|
-
* version: '1.0.0',
|
|
3447
|
-
* platform: 'n8n',
|
|
3448
|
-
* name: 'Shopify Order Sync',
|
|
3449
|
-
* description: 'Legacy n8n workflow for syncing Shopify orders',
|
|
3450
|
-
* status: 'prod',
|
|
3451
|
-
* platformUrl: 'https://n8n.client.com/workflow/123',
|
|
3452
|
-
* triggers: { workflows: ['order-fulfillment-workflow'] },
|
|
3453
|
-
* uses: { integrations: ['integration-shopify-prod'] }
|
|
3454
|
-
* }
|
|
3455
|
-
*/
|
|
3456
|
-
interface ExternalResourceDefinition extends ResourceDefinition {
|
|
3457
|
-
/** Resource type discriminator (narrowed from base union) */
|
|
3458
|
-
type: 'external';
|
|
3459
|
-
/** Platform type */
|
|
3460
|
-
platform: ExternalPlatform;
|
|
3461
|
-
/** Link to external platform (e.g., n8n workflow editor URL) */
|
|
3462
|
-
platformUrl?: string;
|
|
3463
|
-
/** Platform's internal ID/reference */
|
|
3464
|
-
externalId?: string;
|
|
3465
|
-
/** What this external resource triggers (external -> internal) */
|
|
3466
|
-
triggers?: {
|
|
3467
|
-
/** Elevasis workflow resourceIds this external automation triggers */
|
|
3468
|
-
workflows?: string[];
|
|
3469
|
-
/** Elevasis agent resourceIds this external automation triggers */
|
|
3470
|
-
agents?: string[];
|
|
3471
|
-
};
|
|
3472
|
-
/** Integrations this external resource uses (shared credentials) */
|
|
3473
|
-
uses?: {
|
|
3474
|
-
/** Integration IDs this external automation uses */
|
|
3475
|
-
integrations?: string[];
|
|
3476
|
-
};
|
|
3477
|
-
}
|
|
3478
|
-
/**
|
|
3479
|
-
* Human Checkpoint definition - human decision points in automation
|
|
3480
|
-
*
|
|
3481
|
-
* Represents where human judgment is deployed in the automation landscape.
|
|
3482
|
-
* Tasks with matching command_queue_group are routed to this checkpoint.
|
|
3483
|
-
*
|
|
3484
|
-
* BREAKING CHANGES (2025-11-30):
|
|
3485
|
-
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
|
|
3486
|
-
* - Field renames: `id` -> `resourceId` (inherited)
|
|
3487
|
-
* - description is now REQUIRED (was optional) - organizations must add description to all human checkpoints
|
|
3488
|
-
* - New required field: `version` (inherited) - organizations must add version to all human checkpoints
|
|
3489
|
-
* - New required field: `type: 'human'` (inherited) - resource type discriminator
|
|
3490
|
-
*
|
|
3491
|
-
* @example
|
|
3492
|
-
* {
|
|
3493
|
-
* resourceId: 'sales-approval',
|
|
3494
|
-
* type: 'human',
|
|
3495
|
-
* name: 'Sales Approval Queue',
|
|
3496
|
-
* description: 'High-value order approvals for sales team',
|
|
3497
|
-
* version: '1.0.0',
|
|
3498
|
-
* status: 'prod',
|
|
3499
|
-
* requestedBy: { agents: ['order-processor-agent'] },
|
|
3500
|
-
* routesTo: { agents: ['order-fulfillment-agent'] }
|
|
3501
|
-
* }
|
|
3502
|
-
*/
|
|
3503
|
-
interface HumanCheckpointDefinition extends ResourceDefinition {
|
|
3504
|
-
/** Resource type discriminator (narrowed from base union) */
|
|
3505
|
-
type: 'human';
|
|
3506
|
-
/** Resources that create tasks for this checkpoint */
|
|
3507
|
-
requestedBy?: {
|
|
3508
|
-
/** Agent resourceIds that request approval here */
|
|
3509
|
-
agents?: string[];
|
|
3510
|
-
/** Workflow resourceIds that request approval here */
|
|
3511
|
-
workflows?: string[];
|
|
3512
|
-
};
|
|
3513
|
-
/** Resources that receive approved decisions */
|
|
3514
|
-
routesTo?: {
|
|
3515
|
-
/** Agent resourceIds that handle approved tasks */
|
|
3516
|
-
agents?: string[];
|
|
3517
|
-
/** Workflow resourceIds that handle approved tasks */
|
|
3518
|
-
workflows?: string[];
|
|
3519
|
-
};
|
|
3520
|
-
}
|
|
3521
|
-
|
|
3522
|
-
/**
|
|
3523
|
-
* Command View Types
|
|
3524
|
-
*
|
|
3525
|
-
* Unified type definitions for the Command View graph visualization.
|
|
3526
|
-
* These types are used by both backend serialization and frontend rendering.
|
|
3527
|
-
*
|
|
3528
|
-
* Command View shows the resource graph: agents, workflows, triggers, integrations,
|
|
3529
|
-
* external resources, and human checkpoints with their relationships.
|
|
3530
|
-
*/
|
|
3531
|
-
|
|
3532
|
-
/**
|
|
3533
|
-
* Extended agent metadata for Command View
|
|
3534
|
-
* Includes model and capability information for graph display
|
|
3535
|
-
*/
|
|
3536
|
-
interface CommandViewAgent extends ResourceDefinition {
|
|
3537
|
-
type: 'agent';
|
|
3538
|
-
modelProvider: string;
|
|
3539
|
-
modelId: string;
|
|
3540
|
-
toolCount: number;
|
|
3541
|
-
hasKnowledgeMap: boolean;
|
|
3542
|
-
hasMemory: boolean;
|
|
3543
|
-
sessionCapable: boolean;
|
|
3544
|
-
}
|
|
3545
|
-
/**
|
|
3546
|
-
* Extended workflow metadata for Command View
|
|
3547
|
-
* Includes step information for graph display
|
|
3548
|
-
*/
|
|
3549
|
-
interface CommandViewWorkflow extends ResourceDefinition {
|
|
3550
|
-
type: 'workflow';
|
|
3551
|
-
stepCount: number;
|
|
3552
|
-
entryPoint: string;
|
|
3553
|
-
}
|
|
3554
|
-
/**
|
|
3555
|
-
* Relationship types between resources
|
|
3556
|
-
*
|
|
3557
|
-
* - triggers: Resource initiates/starts another resource (orange)
|
|
3558
|
-
* - uses: Resource uses an integration (teal)
|
|
3559
|
-
* - approval: Resource requires human approval (yellow)
|
|
3560
|
-
*/
|
|
3561
|
-
type RelationshipType$1 = 'triggers' | 'uses' | 'approval';
|
|
3562
|
-
/**
|
|
3563
|
-
* Command View edge (relationship between resources)
|
|
3564
|
-
*/
|
|
3565
|
-
interface CommandViewEdge$1 {
|
|
3642
|
+
interface NotificationDTO {
|
|
3566
3643
|
id: string;
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
* Backend serializes this once at startup and serves it via /command-view endpoint.
|
|
3577
|
-
* Frontend consumes this directly for graph rendering.
|
|
3578
|
-
*/
|
|
3579
|
-
interface CommandViewData {
|
|
3580
|
-
workflows: CommandViewWorkflow[];
|
|
3581
|
-
agents: CommandViewAgent[];
|
|
3582
|
-
triggers: TriggerDefinition[];
|
|
3583
|
-
integrations: IntegrationDefinition[];
|
|
3584
|
-
externalResources: ExternalResourceDefinition[];
|
|
3585
|
-
humanCheckpoints: HumanCheckpointDefinition[];
|
|
3586
|
-
edges: CommandViewEdge$1[];
|
|
3587
|
-
domainDefinitions?: DomainDefinition[];
|
|
3644
|
+
userId: string;
|
|
3645
|
+
organizationId: string;
|
|
3646
|
+
category: string;
|
|
3647
|
+
title: string;
|
|
3648
|
+
message: string;
|
|
3649
|
+
actionUrl: string | null;
|
|
3650
|
+
read: boolean;
|
|
3651
|
+
readAt: string | null;
|
|
3652
|
+
createdAt: string;
|
|
3588
3653
|
}
|
|
3589
3654
|
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
description?: string;
|
|
3608
|
-
options?: Array<{
|
|
3609
|
-
label: string;
|
|
3610
|
-
value: string | number;
|
|
3611
|
-
}>;
|
|
3612
|
-
min?: number;
|
|
3613
|
-
max?: number;
|
|
3614
|
-
}
|
|
3615
|
-
/**
|
|
3616
|
-
* Serialized form schema for API responses
|
|
3617
|
-
*/
|
|
3618
|
-
interface SerializedFormSchema {
|
|
3619
|
-
title?: string;
|
|
3620
|
-
description?: string;
|
|
3621
|
-
fields: SerializedFormField[];
|
|
3622
|
-
layout?: 'vertical' | 'horizontal' | 'grid';
|
|
3623
|
-
}
|
|
3624
|
-
/**
|
|
3625
|
-
* Serialized execution form schema for API responses
|
|
3626
|
-
*/
|
|
3627
|
-
interface SerializedExecutionFormSchema extends SerializedFormSchema {
|
|
3628
|
-
fieldMappings?: Record<string, string>;
|
|
3629
|
-
submitButton?: {
|
|
3630
|
-
label?: string;
|
|
3631
|
-
loadingLabel?: string;
|
|
3632
|
-
confirmMessage?: string;
|
|
3633
|
-
};
|
|
3655
|
+
type ProjectRow = Database['public']['Tables']['prj_projects']['Row'];
|
|
3656
|
+
type ProjectUpdate = Database['public']['Tables']['prj_projects']['Update'];
|
|
3657
|
+
type MilestoneRow = Database['public']['Tables']['prj_milestones']['Row'];
|
|
3658
|
+
type MilestoneUpdate = Database['public']['Tables']['prj_milestones']['Update'];
|
|
3659
|
+
type TaskRow = Database['public']['Tables']['prj_tasks']['Row'];
|
|
3660
|
+
type TaskUpdate = Database['public']['Tables']['prj_tasks']['Update'];
|
|
3661
|
+
type ProjectStatus = 'active' | 'on_track' | 'at_risk' | 'blocked' | 'completed' | 'paused';
|
|
3662
|
+
type ProjectKind = 'client_engagement' | 'internal' | 'research' | 'other';
|
|
3663
|
+
type MilestoneStatus = 'upcoming' | 'in_progress' | 'completed' | 'overdue' | 'blocked';
|
|
3664
|
+
type TaskStatus = 'planned' | 'in_progress' | 'blocked' | 'completed' | 'cancelled' | 'submitted' | 'approved' | 'rejected' | 'revision_requested';
|
|
3665
|
+
type TaskType = 'documentation' | 'code' | 'report' | 'design' | 'other';
|
|
3666
|
+
type NoteType = 'call_note' | 'status_update' | 'issue' | 'blocker' | 'agent_learning';
|
|
3667
|
+
interface ProjectFilters {
|
|
3668
|
+
status?: ProjectStatus;
|
|
3669
|
+
kind?: ProjectKind;
|
|
3670
|
+
companyId?: string;
|
|
3671
|
+
search?: string;
|
|
3634
3672
|
}
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
interface SerializedScheduleConfig {
|
|
3639
|
-
enabled: boolean;
|
|
3640
|
-
defaultSchedule?: string;
|
|
3641
|
-
allowedPatterns?: string[];
|
|
3673
|
+
interface MilestoneFilters {
|
|
3674
|
+
status?: MilestoneStatus;
|
|
3675
|
+
projectId?: string;
|
|
3642
3676
|
}
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
payloadSchema?: unknown;
|
|
3677
|
+
interface TaskFilters {
|
|
3678
|
+
status?: TaskStatus;
|
|
3679
|
+
type?: TaskType;
|
|
3680
|
+
milestoneId?: string;
|
|
3681
|
+
projectId?: string;
|
|
3649
3682
|
}
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
interface SerializedExecutionInterface {
|
|
3654
|
-
form: SerializedExecutionFormSchema;
|
|
3655
|
-
schedule?: SerializedScheduleConfig;
|
|
3656
|
-
webhook?: SerializedWebhookConfig;
|
|
3683
|
+
interface NoteFilters {
|
|
3684
|
+
type?: NoteType;
|
|
3685
|
+
projectId?: string;
|
|
3657
3686
|
}
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
config: {
|
|
3664
|
-
resourceId: string;
|
|
3665
|
-
name: string;
|
|
3666
|
-
description: string;
|
|
3667
|
-
version: string;
|
|
3668
|
-
type: 'agent';
|
|
3669
|
-
status: 'dev' | 'prod';
|
|
3670
|
-
/** Whether this resource is archived and should be excluded from registration and deployment */
|
|
3671
|
-
archived?: boolean;
|
|
3672
|
-
systemPrompt: string;
|
|
3673
|
-
constraints?: {
|
|
3674
|
-
maxIterations?: number;
|
|
3675
|
-
timeout?: number;
|
|
3676
|
-
maxSessionMemoryKeys?: number;
|
|
3677
|
-
maxMemoryTokens?: number;
|
|
3678
|
-
};
|
|
3679
|
-
sessionCapable?: boolean;
|
|
3680
|
-
memoryPreferences?: string;
|
|
3681
|
-
};
|
|
3682
|
-
modelConfig: {
|
|
3683
|
-
provider: string;
|
|
3684
|
-
model: string;
|
|
3685
|
-
apiKey: string;
|
|
3686
|
-
temperature: number;
|
|
3687
|
-
maxOutputTokens: number;
|
|
3688
|
-
topP?: number;
|
|
3689
|
-
modelOptions?: Record<string, unknown>;
|
|
3690
|
-
};
|
|
3691
|
-
contract: {
|
|
3692
|
-
inputSchema: object;
|
|
3693
|
-
outputSchema?: object;
|
|
3694
|
-
};
|
|
3695
|
-
tools: Array<{
|
|
3696
|
-
name: string;
|
|
3697
|
-
description: string;
|
|
3698
|
-
inputSchema?: object;
|
|
3699
|
-
outputSchema?: object;
|
|
3700
|
-
}>;
|
|
3701
|
-
knowledgeMap?: {
|
|
3702
|
-
nodeCount: number;
|
|
3703
|
-
nodes: Array<{
|
|
3704
|
-
id: string;
|
|
3705
|
-
description: string;
|
|
3706
|
-
loaded: boolean;
|
|
3707
|
-
hasPrompt: boolean;
|
|
3708
|
-
}>;
|
|
3709
|
-
};
|
|
3710
|
-
metricsConfig?: object;
|
|
3711
|
-
interface?: SerializedExecutionInterface;
|
|
3687
|
+
interface ProjectWithCounts extends ProjectRow {
|
|
3688
|
+
milestoneCount: number;
|
|
3689
|
+
taskCount: number;
|
|
3690
|
+
completedMilestones?: number;
|
|
3691
|
+
completedTasks?: number;
|
|
3712
3692
|
}
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
interface SerializedWorkflowDefinition {
|
|
3718
|
-
config: {
|
|
3719
|
-
resourceId: string;
|
|
3720
|
-
name: string;
|
|
3721
|
-
description: string;
|
|
3722
|
-
version: string;
|
|
3723
|
-
type: 'workflow';
|
|
3724
|
-
status: 'dev' | 'prod';
|
|
3725
|
-
/** Whether this resource is archived and should be excluded from registration and deployment */
|
|
3726
|
-
archived?: boolean;
|
|
3727
|
-
};
|
|
3728
|
-
entryPoint: string;
|
|
3729
|
-
steps: Array<{
|
|
3693
|
+
interface ProjectDetail extends ProjectRow {
|
|
3694
|
+
milestones: MilestoneRow[];
|
|
3695
|
+
tasks: TaskRow[];
|
|
3696
|
+
company: {
|
|
3730
3697
|
id: string;
|
|
3731
3698
|
name: string;
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
outputSchema?: object;
|
|
3735
|
-
next: {
|
|
3736
|
-
type: 'linear' | 'conditional';
|
|
3737
|
-
target?: string;
|
|
3738
|
-
routes?: Array<{
|
|
3739
|
-
target: string;
|
|
3740
|
-
}>;
|
|
3741
|
-
default?: string;
|
|
3742
|
-
} | null;
|
|
3743
|
-
}>;
|
|
3744
|
-
contract: {
|
|
3745
|
-
inputSchema: object;
|
|
3746
|
-
outputSchema?: object;
|
|
3747
|
-
};
|
|
3748
|
-
metricsConfig?: object;
|
|
3749
|
-
interface?: SerializedExecutionInterface;
|
|
3699
|
+
domain: string | null;
|
|
3700
|
+
} | null;
|
|
3750
3701
|
}
|
|
3751
3702
|
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3703
|
+
declare const ListCompaniesQuerySchema: z.ZodObject<{
|
|
3704
|
+
search: z.ZodOptional<z.ZodString>;
|
|
3705
|
+
listId: z.ZodOptional<z.ZodString>;
|
|
3706
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
3707
|
+
website: z.ZodOptional<z.ZodString>;
|
|
3708
|
+
segment: z.ZodOptional<z.ZodString>;
|
|
3709
|
+
category: z.ZodOptional<z.ZodString>;
|
|
3710
|
+
batchId: z.ZodOptional<z.ZodString>;
|
|
3711
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
3712
|
+
active: "active";
|
|
3713
|
+
invalid: "invalid";
|
|
3714
|
+
}>>;
|
|
3715
|
+
includeAll: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
3716
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
3717
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
3718
|
+
}, z.core.$strict>;
|
|
3719
|
+
declare const ListContactsQuerySchema: z.ZodObject<{
|
|
3720
|
+
search: z.ZodOptional<z.ZodString>;
|
|
3721
|
+
listId: z.ZodOptional<z.ZodString>;
|
|
3722
|
+
openingLineIsNull: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
3723
|
+
batchId: z.ZodOptional<z.ZodString>;
|
|
3724
|
+
contactStatus: z.ZodOptional<z.ZodEnum<{
|
|
3725
|
+
active: "active";
|
|
3726
|
+
invalid: "invalid";
|
|
3727
|
+
}>>;
|
|
3728
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
3729
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
3730
|
+
}, z.core.$strict>;
|
|
3731
|
+
declare const AcqCompanyResponseSchema: z.ZodObject<{
|
|
3732
|
+
id: z.ZodString;
|
|
3733
|
+
organizationId: z.ZodString;
|
|
3734
|
+
name: z.ZodString;
|
|
3735
|
+
domain: z.ZodNullable<z.ZodString>;
|
|
3736
|
+
linkedinUrl: z.ZodNullable<z.ZodString>;
|
|
3737
|
+
website: z.ZodNullable<z.ZodString>;
|
|
3738
|
+
numEmployees: z.ZodNullable<z.ZodNumber>;
|
|
3739
|
+
foundedYear: z.ZodNullable<z.ZodNumber>;
|
|
3740
|
+
locationCity: z.ZodNullable<z.ZodString>;
|
|
3741
|
+
locationState: z.ZodNullable<z.ZodString>;
|
|
3742
|
+
category: z.ZodNullable<z.ZodString>;
|
|
3743
|
+
categoryPain: z.ZodNullable<z.ZodString>;
|
|
3744
|
+
segment: z.ZodNullable<z.ZodString>;
|
|
3745
|
+
pipelineStatus: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3746
|
+
enrichmentData: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3747
|
+
source: z.ZodNullable<z.ZodString>;
|
|
3748
|
+
batchId: z.ZodNullable<z.ZodString>;
|
|
3749
|
+
status: z.ZodEnum<{
|
|
3750
|
+
active: "active";
|
|
3751
|
+
invalid: "invalid";
|
|
3752
|
+
}>;
|
|
3753
|
+
contactCount: z.ZodNumber;
|
|
3754
|
+
verticalResearch: z.ZodNullable<z.ZodString>;
|
|
3755
|
+
createdAt: z.ZodString;
|
|
3756
|
+
updatedAt: z.ZodString;
|
|
3757
|
+
}, z.core.$strip>;
|
|
3758
|
+
declare const AcqContactResponseSchema: z.ZodObject<{
|
|
3759
|
+
id: z.ZodString;
|
|
3760
|
+
organizationId: z.ZodString;
|
|
3761
|
+
companyId: z.ZodNullable<z.ZodString>;
|
|
3762
|
+
email: z.ZodString;
|
|
3763
|
+
emailValid: z.ZodNullable<z.ZodEnum<{
|
|
3764
|
+
VALID: "VALID";
|
|
3765
|
+
INVALID: "INVALID";
|
|
3766
|
+
RISKY: "RISKY";
|
|
3767
|
+
UNKNOWN: "UNKNOWN";
|
|
3768
|
+
}>>;
|
|
3769
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
3770
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
3771
|
+
linkedinUrl: z.ZodNullable<z.ZodString>;
|
|
3772
|
+
title: z.ZodNullable<z.ZodString>;
|
|
3773
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
3774
|
+
filterReason: z.ZodNullable<z.ZodString>;
|
|
3775
|
+
openingLine: z.ZodNullable<z.ZodString>;
|
|
3776
|
+
source: z.ZodNullable<z.ZodString>;
|
|
3777
|
+
sourceId: z.ZodNullable<z.ZodString>;
|
|
3778
|
+
pipelineStatus: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3779
|
+
enrichmentData: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3780
|
+
attioPersonId: z.ZodNullable<z.ZodString>;
|
|
3781
|
+
batchId: z.ZodNullable<z.ZodString>;
|
|
3782
|
+
status: z.ZodEnum<{
|
|
3783
|
+
active: "active";
|
|
3784
|
+
invalid: "invalid";
|
|
3785
|
+
}>;
|
|
3786
|
+
company: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
3787
|
+
id: z.ZodString;
|
|
3788
|
+
name: z.ZodString;
|
|
3789
|
+
domain: z.ZodNullable<z.ZodString>;
|
|
3790
|
+
website: z.ZodNullable<z.ZodString>;
|
|
3791
|
+
linkedinUrl: z.ZodNullable<z.ZodString>;
|
|
3792
|
+
segment: z.ZodNullable<z.ZodString>;
|
|
3793
|
+
category: z.ZodNullable<z.ZodString>;
|
|
3794
|
+
status: z.ZodEnum<{
|
|
3795
|
+
active: "active";
|
|
3796
|
+
invalid: "invalid";
|
|
3797
|
+
}>;
|
|
3798
|
+
}, z.core.$strip>>>;
|
|
3799
|
+
createdAt: z.ZodString;
|
|
3800
|
+
updatedAt: z.ZodString;
|
|
3801
|
+
}, z.core.$strip>;
|
|
3802
|
+
type ListCompaniesQuery = z.infer<typeof ListCompaniesQuerySchema>;
|
|
3803
|
+
type ListContactsQuery = z.infer<typeof ListContactsQuerySchema>;
|
|
3804
|
+
type AcqCompanyResponse = z.infer<typeof AcqCompanyResponseSchema>;
|
|
3805
|
+
type AcqContactResponse = z.infer<typeof AcqContactResponseSchema>;
|
|
3756
3806
|
|
|
3807
|
+
type MessageType = MessageEvent['type'];
|
|
3757
3808
|
/**
|
|
3758
|
-
*
|
|
3759
|
-
*
|
|
3760
|
-
|
|
3761
|
-
/**
|
|
3762
|
-
* Structured action metadata attached to assistant messages.
|
|
3763
|
-
* Frontend reads this instead of parsing text prefixes.
|
|
3764
|
-
*/
|
|
3765
|
-
type AssistantAction = {
|
|
3766
|
-
kind: 'navigate';
|
|
3767
|
-
path: string;
|
|
3768
|
-
reason: string;
|
|
3769
|
-
} | {
|
|
3770
|
-
kind: 'update_filters';
|
|
3771
|
-
timeRange: string | null;
|
|
3772
|
-
statusFilter: string | null;
|
|
3773
|
-
searchQuery: string | null;
|
|
3774
|
-
};
|
|
3775
|
-
type MessageEvent = {
|
|
3776
|
-
type: 'user_message';
|
|
3777
|
-
text: string;
|
|
3778
|
-
} | {
|
|
3779
|
-
type: 'assistant_message';
|
|
3780
|
-
text: string;
|
|
3781
|
-
_action?: AssistantAction;
|
|
3782
|
-
} | {
|
|
3783
|
-
type: 'agent:started';
|
|
3784
|
-
} | {
|
|
3785
|
-
type: 'agent:completed';
|
|
3786
|
-
} | {
|
|
3787
|
-
type: 'agent:error';
|
|
3788
|
-
error: string;
|
|
3789
|
-
} | {
|
|
3790
|
-
type: 'agent:reasoning';
|
|
3791
|
-
iteration: number;
|
|
3792
|
-
reasoning: string;
|
|
3793
|
-
} | {
|
|
3794
|
-
type: 'agent:tool_call';
|
|
3795
|
-
toolName: string;
|
|
3796
|
-
args: Record<string, unknown>;
|
|
3797
|
-
} | {
|
|
3798
|
-
type: 'agent:tool_result';
|
|
3799
|
-
toolName: string;
|
|
3800
|
-
success: boolean;
|
|
3801
|
-
result?: unknown;
|
|
3802
|
-
error?: string;
|
|
3803
|
-
};
|
|
3804
|
-
/**
|
|
3805
|
-
* NOTE: AIResource interface has been removed and replaced with ResourceDefinition
|
|
3806
|
-
* from registry/types.ts. All resources (executable and non-executable) now extend
|
|
3807
|
-
* the unified ResourceDefinition base interface.
|
|
3808
|
-
*
|
|
3809
|
-
* AgentConfig and WorkflowConfig now extend ResourceDefinition directly.
|
|
3810
|
-
* See packages/core/src/registry/types.ts for the base interface definition.
|
|
3809
|
+
* Session Data Transfer Object (DTO)
|
|
3810
|
+
* Transform type for API responses (snake_case DB → camelCase frontend)
|
|
3811
|
+
* Used by frontend apps to display session data
|
|
3811
3812
|
*/
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
last_name: string | null;
|
|
3826
|
-
email: string;
|
|
3827
|
-
title: string | null;
|
|
3828
|
-
headline: string | null;
|
|
3829
|
-
linkedin_url: string | null;
|
|
3830
|
-
pipeline_status: Record<string, unknown> | null;
|
|
3831
|
-
enrichment_data: Record<string, unknown> | null;
|
|
3832
|
-
company: {
|
|
3833
|
-
id: string;
|
|
3834
|
-
name: string;
|
|
3835
|
-
domain: string | null;
|
|
3836
|
-
website: string | null;
|
|
3837
|
-
linkedin_url: string | null;
|
|
3838
|
-
segment: string | null;
|
|
3839
|
-
category: string | null;
|
|
3840
|
-
num_employees: number | null;
|
|
3841
|
-
} | null;
|
|
3813
|
+
interface SessionDTO {
|
|
3814
|
+
sessionId: string;
|
|
3815
|
+
resourceId: string;
|
|
3816
|
+
organizationId: string;
|
|
3817
|
+
userId?: string | null;
|
|
3818
|
+
turnCount: number;
|
|
3819
|
+
isEnded: boolean;
|
|
3820
|
+
title?: string | null;
|
|
3821
|
+
memorySnapshot?: AgentMemory;
|
|
3822
|
+
metadata?: Record<string, unknown> | null;
|
|
3823
|
+
createdAt: Date;
|
|
3824
|
+
updatedAt: Date;
|
|
3825
|
+
endedAt?: Date | null;
|
|
3842
3826
|
}
|
|
3843
|
-
interface
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3827
|
+
interface ChatMessage {
|
|
3828
|
+
id: string;
|
|
3829
|
+
role: 'user' | 'assistant';
|
|
3830
|
+
messageType: MessageType;
|
|
3831
|
+
text: string;
|
|
3832
|
+
metadata?: MessageEvent;
|
|
3833
|
+
turnNumber: number;
|
|
3834
|
+
messageIndex?: number;
|
|
3835
|
+
createdAt: Date;
|
|
3848
3836
|
}
|
|
3849
|
-
/**
|
|
3850
|
-
interface
|
|
3851
|
-
|
|
3837
|
+
/** Token usage data sent with turn:complete WebSocket events */
|
|
3838
|
+
interface SessionTokenUsage {
|
|
3839
|
+
/** Tokens consumed by this turn's input */
|
|
3840
|
+
turnInputTokens: number;
|
|
3841
|
+
/** Tokens generated by this turn's output */
|
|
3842
|
+
turnOutputTokens: number;
|
|
3843
|
+
/** Total tokens for this turn (turnInputTokens + turnOutputTokens) */
|
|
3844
|
+
turnTotalTokens: number;
|
|
3845
|
+
/** Cumulative input tokens across all turns in this session */
|
|
3846
|
+
cumulativeInputTokens: number;
|
|
3847
|
+
/** Cumulative output tokens across all turns in this session */
|
|
3848
|
+
cumulativeOutputTokens: number;
|
|
3849
|
+
/** The model's context window size for this session (e.g., 200K) */
|
|
3850
|
+
contextWindowSize: number;
|
|
3852
3851
|
}
|
|
3853
|
-
|
|
3854
|
-
/** Task kind options for a deal task (human follow-up action type) */
|
|
3855
|
-
type AcqDealTaskKind = 'call' | 'email' | 'meeting' | 'other';
|
|
3852
|
+
|
|
3856
3853
|
/**
|
|
3857
|
-
*
|
|
3858
|
-
*
|
|
3854
|
+
* Multi-tenancy configuration types
|
|
3855
|
+
*
|
|
3856
|
+
* Config is stored in dedicated `config` columns (NOT nested in metadata):
|
|
3857
|
+
* - organizations.config: Org-level config (no feature toggles -- all features available by default)
|
|
3858
|
+
* - org_memberships.config: Per-user-per-org feature overrides
|
|
3859
|
+
* - users.config: User-global config
|
|
3859
3860
|
*/
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
dueAt: string | null;
|
|
3868
|
-
assigneeUserId: string | null;
|
|
3869
|
-
completedAt: string | null;
|
|
3870
|
-
completedByUserId: string | null;
|
|
3871
|
-
createdAt: string;
|
|
3872
|
-
updatedAt: string;
|
|
3873
|
-
createdByUserId: string | null;
|
|
3861
|
+
/**
|
|
3862
|
+
* Per-user-per-org config (stored in org_memberships.config)
|
|
3863
|
+
* Controls which features a specific member can access within their org.
|
|
3864
|
+
* Keys are feature IDs from the organization model (e.g. crm, lead-gen, projects, seo).
|
|
3865
|
+
*/
|
|
3866
|
+
interface MembershipFeatureConfig {
|
|
3867
|
+
features?: Record<string, boolean>;
|
|
3874
3868
|
}
|
|
3875
3869
|
/**
|
|
3876
|
-
*
|
|
3877
|
-
*
|
|
3870
|
+
* User-global config (stored in users.config)
|
|
3871
|
+
* Theme and onboarding are user-specific, NOT org-specific
|
|
3878
3872
|
*/
|
|
3879
|
-
interface
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
stageCounts: {
|
|
3884
|
-
populated: number;
|
|
3885
|
-
extracted: number;
|
|
3886
|
-
qualified: number;
|
|
3887
|
-
discovered: number;
|
|
3888
|
-
verified: number;
|
|
3889
|
-
personalized: number;
|
|
3890
|
-
uploaded: number;
|
|
3873
|
+
interface UserConfig {
|
|
3874
|
+
theme?: {
|
|
3875
|
+
preset?: 'default' | 'tactical' | 'regal' | 'cyber-volt' | 'aurora' | 'rose-gold' | 'midnight' | 'titanium' | 'obsidian' | 'honey' | 'abyss' | 'canopy' | 'slate' | 'cyber-strike' | 'cyber-chrome' | 'cyber-void' | 'nirvana' | 'wave' | 'synapse' | 'cortex' | 'helios' | 'graphite' | 'quarry' | 'canyon' | 'nord' | 'catppuccin' | 'tokyo-night' | 'gruvbox';
|
|
3876
|
+
colorScheme?: 'light' | 'dark' | 'auto';
|
|
3891
3877
|
};
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3878
|
+
onboarding?: {
|
|
3879
|
+
completed?: boolean;
|
|
3880
|
+
completedAt?: string;
|
|
3881
|
+
role?: string;
|
|
3882
|
+
primaryUseCase?: string[];
|
|
3883
|
+
experienceLevel?: string;
|
|
3884
|
+
/** Onboarding guide system state (set by checklist/tour system) */
|
|
3885
|
+
guides?: {
|
|
3886
|
+
completedIds?: string[];
|
|
3887
|
+
dismissed?: boolean;
|
|
3888
|
+
completedAt?: string;
|
|
3889
|
+
};
|
|
3898
3890
|
};
|
|
3899
|
-
/** Reserved -- active workflow IDs associated with this list. */
|
|
3900
|
-
activeWorkflows?: string[];
|
|
3901
3891
|
}
|
|
3902
3892
|
|
|
3903
3893
|
/**
|
|
3904
|
-
*
|
|
3905
|
-
* CRUD operation types for the acquisition platform (lists, companies, contacts, deals)
|
|
3894
|
+
* Memberships Domain - Zod Validation Schemas
|
|
3906
3895
|
*
|
|
3907
|
-
*
|
|
3896
|
+
* Validation schemas for membership management endpoints.
|
|
3897
|
+
* Includes request bodies, query params, and path params.
|
|
3898
|
+
*
|
|
3899
|
+
* Security:
|
|
3900
|
+
* - All schemas use .strict() to prevent mass assignment attacks
|
|
3901
|
+
* - UUID validation prevents invalid references
|
|
3902
|
+
* - Role enum validation prevents privilege escalation
|
|
3903
|
+
* - organizationId never accepted in body (from JWT when needed)
|
|
3908
3904
|
*/
|
|
3909
3905
|
|
|
3910
|
-
|
|
3906
|
+
/**
|
|
3907
|
+
* Membership status validation
|
|
3908
|
+
* Note: Database constraint only allows 'active' | 'inactive'
|
|
3909
|
+
*/
|
|
3910
|
+
declare const MembershipStatusSchema: z.ZodEnum<{
|
|
3911
|
+
active: "active";
|
|
3912
|
+
inactive: "inactive";
|
|
3913
|
+
}>;
|
|
3914
|
+
type MembershipStatus = z.infer<typeof MembershipStatusSchema>;
|
|
3915
|
+
|
|
3916
|
+
/**
|
|
3917
|
+
* Organization Membership types based on WorkOS API
|
|
3918
|
+
*/
|
|
3919
|
+
interface OrganizationMembership {
|
|
3920
|
+
object: 'organization_membership';
|
|
3911
3921
|
id: string;
|
|
3912
|
-
|
|
3922
|
+
userId: string;
|
|
3913
3923
|
organizationId: string;
|
|
3914
|
-
|
|
3915
|
-
|
|
3924
|
+
role: {
|
|
3925
|
+
slug: string;
|
|
3926
|
+
};
|
|
3927
|
+
status: 'active' | 'inactive';
|
|
3916
3928
|
createdAt: string;
|
|
3917
3929
|
updatedAt: string;
|
|
3918
3930
|
}
|
|
3919
|
-
|
|
3920
3931
|
/**
|
|
3921
|
-
*
|
|
3922
|
-
* Defines available user actions and their behavior
|
|
3932
|
+
* Request interfaces for membership operations
|
|
3923
3933
|
*/
|
|
3924
|
-
interface
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
resourceId: string;
|
|
3941
|
-
/**
|
|
3942
|
-
* Optional session ID for agent continuation.
|
|
3943
|
-
* If provided, invokes a new turn on the existing session instead of standalone execution.
|
|
3944
|
-
* Only valid when resourceType is 'agent'.
|
|
3945
|
-
*/
|
|
3946
|
-
sessionId?: string;
|
|
3947
|
-
};
|
|
3948
|
-
/** Form schema for collecting action-specific data */
|
|
3949
|
-
form?: FormSchema;
|
|
3950
|
-
/** Payload template for pre-filling forms */
|
|
3951
|
-
payloadTemplate?: unknown;
|
|
3952
|
-
/** Requires confirmation dialog */
|
|
3953
|
-
requiresConfirmation?: boolean;
|
|
3954
|
-
/** Confirmation message */
|
|
3955
|
-
confirmationMessage?: string;
|
|
3956
|
-
/** Help text / tooltip */
|
|
3957
|
-
description?: string;
|
|
3934
|
+
interface CreateMembershipRequest {
|
|
3935
|
+
userId: string;
|
|
3936
|
+
organizationId: string;
|
|
3937
|
+
roleSlug?: string;
|
|
3938
|
+
}
|
|
3939
|
+
interface UpdateMembershipRequest {
|
|
3940
|
+
roleSlug: string;
|
|
3941
|
+
}
|
|
3942
|
+
interface ListMembershipsParams {
|
|
3943
|
+
userId?: string;
|
|
3944
|
+
organizationId?: string;
|
|
3945
|
+
statuses?: MembershipStatus[];
|
|
3946
|
+
limit?: number;
|
|
3947
|
+
before?: string;
|
|
3948
|
+
after?: string;
|
|
3949
|
+
order?: 'asc' | 'desc';
|
|
3958
3950
|
}
|
|
3959
|
-
|
|
3960
3951
|
/**
|
|
3961
|
-
*
|
|
3962
|
-
* Used for audit trails and tracking execution lineage.
|
|
3952
|
+
* Response interfaces
|
|
3963
3953
|
*/
|
|
3964
|
-
|
|
3954
|
+
interface ListMembershipsResponse {
|
|
3955
|
+
data: OrganizationMembership[];
|
|
3956
|
+
listMetadata?: {
|
|
3957
|
+
before?: string | null;
|
|
3958
|
+
after?: string | null;
|
|
3959
|
+
};
|
|
3960
|
+
}
|
|
3965
3961
|
/**
|
|
3966
|
-
*
|
|
3967
|
-
* Used by both TaskScheduler and CommandQueue for complete audit trails.
|
|
3962
|
+
* Extended membership with user and organization details for UI
|
|
3968
3963
|
*/
|
|
3969
|
-
interface
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3964
|
+
interface MembershipWithDetails extends OrganizationMembership {
|
|
3965
|
+
user?: {
|
|
3966
|
+
id: string;
|
|
3967
|
+
email: string;
|
|
3968
|
+
firstName?: string;
|
|
3969
|
+
lastName?: string;
|
|
3970
|
+
profilePictureUrl?: string;
|
|
3971
|
+
};
|
|
3972
|
+
organization?: {
|
|
3973
|
+
id: string;
|
|
3974
|
+
name: string;
|
|
3975
|
+
workos_org_id: string;
|
|
3976
|
+
primaryDomain?: string;
|
|
3977
|
+
is_test?: boolean;
|
|
3978
|
+
status?: string;
|
|
3979
|
+
metadata?: Record<string, unknown>;
|
|
3980
|
+
config?: Record<string, unknown>;
|
|
3981
|
+
};
|
|
3982
|
+
config?: MembershipFeatureConfig;
|
|
3973
3983
|
}
|
|
3974
3984
|
|
|
3975
3985
|
/**
|
|
3976
|
-
*
|
|
3986
|
+
* Time range selector for dashboard metrics
|
|
3977
3987
|
*/
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
targetExecutionId?: string;
|
|
4005
|
-
createdAt: Date;
|
|
4006
|
-
completedAt?: Date;
|
|
4007
|
-
completedBy?: string;
|
|
4008
|
-
expiresAt?: Date;
|
|
4009
|
-
idempotencyKey?: string | null;
|
|
3988
|
+
type TimeRange = '1h' | '24h' | '7d' | '30d';
|
|
3989
|
+
/**
|
|
3990
|
+
* Execution health metrics response
|
|
3991
|
+
* Success rate, P95 duration, execution counts, and trend data
|
|
3992
|
+
* trendData includes executionCount for throughput visualization (eliminates separate API call)
|
|
3993
|
+
*/
|
|
3994
|
+
interface ExecutionHealthMetrics {
|
|
3995
|
+
successRate: number;
|
|
3996
|
+
p95Duration: number;
|
|
3997
|
+
totalExecutions: number;
|
|
3998
|
+
trendData: Array<{
|
|
3999
|
+
time: string;
|
|
4000
|
+
rate: number;
|
|
4001
|
+
successCount: number;
|
|
4002
|
+
errorCount: number;
|
|
4003
|
+
warningCount: number;
|
|
4004
|
+
executionCount: number;
|
|
4005
|
+
}>;
|
|
4006
|
+
statusCounts: {
|
|
4007
|
+
success: number;
|
|
4008
|
+
failed: number;
|
|
4009
|
+
pending: number;
|
|
4010
|
+
warning: number;
|
|
4011
|
+
};
|
|
4012
|
+
peakPeriod: string;
|
|
4013
|
+
granularity: 'hour' | 'day';
|
|
4010
4014
|
}
|
|
4011
4015
|
/**
|
|
4012
|
-
*
|
|
4013
|
-
*
|
|
4014
|
-
* - processing: execution in progress after user approval
|
|
4015
|
-
* - completed: action was taken and execution succeeded
|
|
4016
|
-
* - failed: execution failed, task can be retried
|
|
4017
|
-
* - expired: timed out before action
|
|
4016
|
+
* Error analysis metrics response
|
|
4017
|
+
* Error categories and top failing resources
|
|
4018
4018
|
*/
|
|
4019
|
-
|
|
4019
|
+
interface ErrorAnalysisMetrics {
|
|
4020
|
+
totalErrors: number;
|
|
4021
|
+
errorsByCategory: Array<{
|
|
4022
|
+
category: string;
|
|
4023
|
+
count: number;
|
|
4024
|
+
percentage: number;
|
|
4025
|
+
}>;
|
|
4026
|
+
topFailingResources: Array<{
|
|
4027
|
+
resourceId: string;
|
|
4028
|
+
name: string;
|
|
4029
|
+
errorCount: number;
|
|
4030
|
+
failureRate: number;
|
|
4031
|
+
}>;
|
|
4032
|
+
}
|
|
4020
4033
|
/**
|
|
4021
|
-
*
|
|
4034
|
+
* Business impact metrics response
|
|
4035
|
+
* ROI, labor savings, and cost analysis
|
|
4022
4036
|
*/
|
|
4023
|
-
interface
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
actions?: unknown[];
|
|
4029
|
-
targetResourceId?: string | null;
|
|
4030
|
-
targetResourceType?: 'agent' | 'workflow' | null;
|
|
4031
|
-
targetExecutionId?: string;
|
|
4032
|
-
status?: 'pending' | 'failed' | 'completed';
|
|
4037
|
+
interface BusinessImpactMetrics$1 {
|
|
4038
|
+
totalSavingsUsd: number;
|
|
4039
|
+
totalCostUsd: number;
|
|
4040
|
+
netSavingsUsd: number;
|
|
4041
|
+
roi: number;
|
|
4033
4042
|
}
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4043
|
+
/**
|
|
4044
|
+
* Cost breakdown metrics response
|
|
4045
|
+
* Per-resource cost analysis
|
|
4046
|
+
*/
|
|
4047
|
+
interface CostBreakdownMetrics {
|
|
4048
|
+
resources: Array<{
|
|
4049
|
+
resourceId: string;
|
|
4050
|
+
totalCostUsd: number;
|
|
4051
|
+
executionCount: number;
|
|
4052
|
+
avgCostUsd: number;
|
|
4053
|
+
}>;
|
|
4037
4054
|
}
|
|
4038
|
-
|
|
4039
4055
|
/**
|
|
4040
|
-
*
|
|
4041
|
-
*
|
|
4056
|
+
* Dashboard metrics response
|
|
4057
|
+
* Aggregates core observability metrics in a single response
|
|
4058
|
+
* Note: Throughput data is now included in executionHealth.trendData.executionCount
|
|
4042
4059
|
*/
|
|
4043
|
-
interface
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4060
|
+
interface DashboardMetrics {
|
|
4061
|
+
executionHealth: ExecutionHealthMetrics;
|
|
4062
|
+
costBreakdown: CostBreakdownMetrics;
|
|
4063
|
+
businessImpact: BusinessImpactMetrics$1;
|
|
4064
|
+
/** ISO timestamp of the currently active deployment, or null if none */
|
|
4065
|
+
activeDeploymentDate: string | null;
|
|
4066
|
+
/** Deployment version of the active deployment, or null if none */
|
|
4067
|
+
activeDeploymentVersion: string | null;
|
|
4050
4068
|
}
|
|
4051
4069
|
/**
|
|
4052
|
-
*
|
|
4070
|
+
* Error record for list view (ErrorBreakdownTable)
|
|
4053
4071
|
*/
|
|
4054
|
-
interface
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4072
|
+
interface ErrorRecord {
|
|
4073
|
+
id: string;
|
|
4074
|
+
timestamp: string;
|
|
4075
|
+
errorType: string;
|
|
4076
|
+
message: string;
|
|
4077
|
+
executionId: string;
|
|
4078
|
+
resourceId: string;
|
|
4079
|
+
resourceName: string;
|
|
4080
|
+
severity: 'critical' | 'warning' | 'info';
|
|
4081
|
+
category: ExecutionErrorCategory;
|
|
4082
|
+
resolved: boolean;
|
|
4083
|
+
resolvedAt: string | null;
|
|
4084
|
+
resolvedBy: string | null;
|
|
4058
4085
|
}
|
|
4059
4086
|
/**
|
|
4060
|
-
*
|
|
4087
|
+
* Full error detail for modal view (ErrorDetailsModal)
|
|
4061
4088
|
*/
|
|
4062
|
-
interface
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4089
|
+
interface ErrorDetailFull extends ErrorRecord {
|
|
4090
|
+
stackTrace?: string;
|
|
4091
|
+
retryAttempt?: number;
|
|
4092
|
+
stepName?: string;
|
|
4093
|
+
stepSequence?: number;
|
|
4094
|
+
errorContext?: Record<string, unknown>;
|
|
4095
|
+
executionContext?: Record<string, unknown>;
|
|
4067
4096
|
}
|
|
4068
4097
|
/**
|
|
4069
|
-
*
|
|
4098
|
+
* Error details API response (paginated)
|
|
4070
4099
|
*/
|
|
4071
|
-
interface
|
|
4072
|
-
|
|
4073
|
-
/** Total tasks across all checkpoints */
|
|
4100
|
+
interface ErrorDetailResponse {
|
|
4101
|
+
errors: ErrorRecord[];
|
|
4074
4102
|
total: number;
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
/** Breakdown by priority for donut chart */
|
|
4078
|
-
priorityCounts: PriorityCounts;
|
|
4103
|
+
page: number;
|
|
4104
|
+
limit: number;
|
|
4079
4105
|
}
|
|
4080
|
-
|
|
4081
4106
|
/**
|
|
4082
|
-
*
|
|
4083
|
-
* Unlike ExecutionTarget, payload is NOT included here because schedules
|
|
4084
|
-
* store payload in the scheduleConfig (varies per step/item).
|
|
4107
|
+
* Error trend data for time-series charts
|
|
4085
4108
|
*/
|
|
4086
|
-
interface
|
|
4087
|
-
|
|
4088
|
-
|
|
4109
|
+
interface ErrorTrend {
|
|
4110
|
+
time: string;
|
|
4111
|
+
errorCount: number;
|
|
4112
|
+
criticalCount: number;
|
|
4113
|
+
warningCount: number;
|
|
4114
|
+
infoCount: number;
|
|
4089
4115
|
}
|
|
4090
4116
|
/**
|
|
4091
|
-
*
|
|
4092
|
-
*
|
|
4093
|
-
* for schedules created directly via API (not triggered by another resource).
|
|
4117
|
+
* Summary of executions for a single resource
|
|
4118
|
+
* Used by RecentExecutionsByResource dashboard component
|
|
4094
4119
|
*/
|
|
4095
|
-
interface
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
time?: string;
|
|
4106
|
-
timezone: string;
|
|
4107
|
-
payload: Record<string, unknown>;
|
|
4108
|
-
endAt?: string | null;
|
|
4109
|
-
overduePolicy?: 'skip' | 'execute';
|
|
4110
|
-
}
|
|
4111
|
-
interface RelativeScheduleConfig {
|
|
4112
|
-
type: 'relative';
|
|
4113
|
-
anchorAt: string;
|
|
4114
|
-
anchorLabel?: string;
|
|
4115
|
-
items: RelativeScheduleItem[];
|
|
4116
|
-
overduePolicy?: 'skip' | 'execute';
|
|
4117
|
-
}
|
|
4118
|
-
interface RelativeScheduleItem {
|
|
4119
|
-
offset: string;
|
|
4120
|
-
payload: Record<string, unknown>;
|
|
4121
|
-
label?: string;
|
|
4120
|
+
interface ResourceExecutionSummary {
|
|
4121
|
+
resourceId: string;
|
|
4122
|
+
resourceType: string;
|
|
4123
|
+
resourceName: string | null;
|
|
4124
|
+
lastExecution: string;
|
|
4125
|
+
totalExecutions: number;
|
|
4126
|
+
successCount: number;
|
|
4127
|
+
failureCount: number;
|
|
4128
|
+
warningCount: number;
|
|
4129
|
+
successRate: number;
|
|
4122
4130
|
}
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4131
|
+
/**
|
|
4132
|
+
* Response from getRecentExecutionsByResource endpoint
|
|
4133
|
+
*/
|
|
4134
|
+
interface RecentExecutionsByResourceResponse {
|
|
4135
|
+
resources: ResourceExecutionSummary[];
|
|
4127
4136
|
}
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4137
|
+
/** Resource identifier for health queries */
|
|
4138
|
+
interface ResourceIdentifier {
|
|
4139
|
+
entityType: string;
|
|
4140
|
+
entityId: string;
|
|
4132
4141
|
}
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
nextRunAt?: Date;
|
|
4141
|
-
currentStep: number;
|
|
4142
|
-
status: 'active' | 'paused' | 'completed' | 'cancelled';
|
|
4143
|
-
lastRunAt?: Date;
|
|
4144
|
-
lastExecutionId?: string;
|
|
4145
|
-
maxRetries: number;
|
|
4146
|
-
idempotencyKey?: string;
|
|
4147
|
-
createdAt: Date;
|
|
4148
|
-
updatedAt: Date;
|
|
4142
|
+
/** Time-bucketed health data point */
|
|
4143
|
+
interface ResourceHealthDataPoint {
|
|
4144
|
+
time: string;
|
|
4145
|
+
success: number;
|
|
4146
|
+
failure: number;
|
|
4147
|
+
warning: number;
|
|
4148
|
+
rate: number;
|
|
4149
4149
|
}
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
category: string;
|
|
4161
|
-
title: string;
|
|
4162
|
-
message: string;
|
|
4163
|
-
actionUrl: string | null;
|
|
4164
|
-
read: boolean;
|
|
4165
|
-
readAt: string | null;
|
|
4166
|
-
createdAt: string;
|
|
4150
|
+
/** Health data for a single resource */
|
|
4151
|
+
interface ResourceHealth {
|
|
4152
|
+
entityType: string;
|
|
4153
|
+
entityId: string;
|
|
4154
|
+
entityName: string | null;
|
|
4155
|
+
trendData: ResourceHealthDataPoint[];
|
|
4156
|
+
summary: {
|
|
4157
|
+
total: number;
|
|
4158
|
+
successRate: number;
|
|
4159
|
+
};
|
|
4167
4160
|
}
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
type MilestoneRow = Database['public']['Tables']['prj_milestones']['Row'];
|
|
4172
|
-
type MilestoneUpdate = Database['public']['Tables']['prj_milestones']['Update'];
|
|
4173
|
-
type TaskRow = Database['public']['Tables']['prj_tasks']['Row'];
|
|
4174
|
-
type TaskUpdate = Database['public']['Tables']['prj_tasks']['Update'];
|
|
4175
|
-
type ProjectStatus = 'active' | 'on_track' | 'at_risk' | 'blocked' | 'completed' | 'paused';
|
|
4176
|
-
type ProjectKind = 'client_engagement' | 'internal' | 'research' | 'other';
|
|
4177
|
-
type MilestoneStatus = 'upcoming' | 'in_progress' | 'completed' | 'overdue' | 'blocked';
|
|
4178
|
-
type TaskStatus = 'planned' | 'in_progress' | 'blocked' | 'completed' | 'cancelled' | 'submitted' | 'approved' | 'rejected' | 'revision_requested';
|
|
4179
|
-
type TaskType = 'documentation' | 'code' | 'report' | 'design' | 'other';
|
|
4180
|
-
type NoteType = 'call_note' | 'status_update' | 'issue' | 'blocker' | 'agent_learning';
|
|
4181
|
-
interface ProjectFilters {
|
|
4182
|
-
status?: ProjectStatus;
|
|
4183
|
-
kind?: ProjectKind;
|
|
4184
|
-
companyId?: string;
|
|
4185
|
-
search?: string;
|
|
4161
|
+
/** Batch response with all requested resources */
|
|
4162
|
+
interface ResourcesHealthResponse {
|
|
4163
|
+
resources: ResourceHealth[];
|
|
4186
4164
|
}
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4165
|
+
/**
|
|
4166
|
+
* Cost trend data point for time-series charts
|
|
4167
|
+
* Represents a single time bucket (hour or day)
|
|
4168
|
+
*/
|
|
4169
|
+
interface CostTrendDataPoint {
|
|
4170
|
+
time: string;
|
|
4171
|
+
totalCostUsd: number;
|
|
4172
|
+
executionCount: number;
|
|
4173
|
+
avgCostPerExecution: number;
|
|
4190
4174
|
}
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4175
|
+
/**
|
|
4176
|
+
* Cost trends response (time-series data)
|
|
4177
|
+
*/
|
|
4178
|
+
interface CostTrendsResponse {
|
|
4179
|
+
trendData: CostTrendDataPoint[];
|
|
4180
|
+
granularity: 'hour' | 'day';
|
|
4181
|
+
totalCostUsd: number;
|
|
4182
|
+
totalExecutions: number;
|
|
4196
4183
|
}
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4184
|
+
/**
|
|
4185
|
+
* Cost summary response with MTD and projections
|
|
4186
|
+
*/
|
|
4187
|
+
interface CostSummaryResponse {
|
|
4188
|
+
current: {
|
|
4189
|
+
totalCostUsd: number;
|
|
4190
|
+
executionCount: number;
|
|
4191
|
+
};
|
|
4192
|
+
previous: {
|
|
4193
|
+
totalCostUsd: number;
|
|
4194
|
+
executionCount: number;
|
|
4195
|
+
};
|
|
4196
|
+
mtd: {
|
|
4197
|
+
totalCostUsd: number;
|
|
4198
|
+
daysElapsed: number;
|
|
4199
|
+
};
|
|
4200
|
+
projection: {
|
|
4201
|
+
monthlyCostUsd: number;
|
|
4202
|
+
confidence: 'low' | 'medium' | 'high';
|
|
4203
|
+
};
|
|
4204
|
+
trend: {
|
|
4205
|
+
changePercent: number;
|
|
4206
|
+
direction: 'up' | 'down' | 'flat';
|
|
4207
|
+
};
|
|
4200
4208
|
}
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4209
|
+
/**
|
|
4210
|
+
* Cost by model data for model-level breakdown
|
|
4211
|
+
*/
|
|
4212
|
+
interface CostByModelData {
|
|
4213
|
+
model: string;
|
|
4214
|
+
totalCostUsd: number;
|
|
4215
|
+
callCount: number;
|
|
4216
|
+
totalInputTokens: number;
|
|
4217
|
+
totalOutputTokens: number;
|
|
4218
|
+
avgCostPerCall: number;
|
|
4206
4219
|
}
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
} | null;
|
|
4220
|
+
/**
|
|
4221
|
+
* Cost by model response
|
|
4222
|
+
*/
|
|
4223
|
+
interface CostByModelResponse {
|
|
4224
|
+
models: CostByModelData[];
|
|
4225
|
+
totalCostUsd: number;
|
|
4226
|
+
totalCallCount: number;
|
|
4215
4227
|
}
|
|
4216
4228
|
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
VALID: "VALID";
|
|
4279
|
-
INVALID: "INVALID";
|
|
4280
|
-
RISKY: "RISKY";
|
|
4281
|
-
UNKNOWN: "UNKNOWN";
|
|
4282
|
-
}>>;
|
|
4283
|
-
firstName: z.ZodNullable<z.ZodString>;
|
|
4284
|
-
lastName: z.ZodNullable<z.ZodString>;
|
|
4285
|
-
linkedinUrl: z.ZodNullable<z.ZodString>;
|
|
4286
|
-
title: z.ZodNullable<z.ZodString>;
|
|
4287
|
-
headline: z.ZodNullable<z.ZodString>;
|
|
4288
|
-
filterReason: z.ZodNullable<z.ZodString>;
|
|
4289
|
-
openingLine: z.ZodNullable<z.ZodString>;
|
|
4290
|
-
source: z.ZodNullable<z.ZodString>;
|
|
4291
|
-
sourceId: z.ZodNullable<z.ZodString>;
|
|
4292
|
-
pipelineStatus: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4293
|
-
enrichmentData: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4294
|
-
attioPersonId: z.ZodNullable<z.ZodString>;
|
|
4295
|
-
batchId: z.ZodNullable<z.ZodString>;
|
|
4296
|
-
status: z.ZodEnum<{
|
|
4297
|
-
active: "active";
|
|
4298
|
-
invalid: "invalid";
|
|
4299
|
-
}>;
|
|
4300
|
-
company: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
4301
|
-
id: z.ZodString;
|
|
4302
|
-
name: z.ZodString;
|
|
4303
|
-
domain: z.ZodNullable<z.ZodString>;
|
|
4304
|
-
website: z.ZodNullable<z.ZodString>;
|
|
4305
|
-
linkedinUrl: z.ZodNullable<z.ZodString>;
|
|
4306
|
-
segment: z.ZodNullable<z.ZodString>;
|
|
4307
|
-
category: z.ZodNullable<z.ZodString>;
|
|
4308
|
-
status: z.ZodEnum<{
|
|
4309
|
-
active: "active";
|
|
4310
|
-
invalid: "invalid";
|
|
4311
|
-
}>;
|
|
4312
|
-
}, z.core.$strip>>>;
|
|
4313
|
-
createdAt: z.ZodString;
|
|
4314
|
-
updatedAt: z.ZodString;
|
|
4315
|
-
}, z.core.$strip>;
|
|
4316
|
-
type ListCompaniesQuery = z.infer<typeof ListCompaniesQuerySchema>;
|
|
4317
|
-
type ListContactsQuery = z.infer<typeof ListContactsQuerySchema>;
|
|
4318
|
-
type AcqCompanyResponse = z.infer<typeof AcqCompanyResponseSchema>;
|
|
4319
|
-
type AcqContactResponse = z.infer<typeof AcqContactResponseSchema>;
|
|
4229
|
+
/**
|
|
4230
|
+
* Base Execution Engine type definitions
|
|
4231
|
+
* Core types shared across all Execution Engine resources
|
|
4232
|
+
*/
|
|
4233
|
+
|
|
4234
|
+
/**
|
|
4235
|
+
* Unified message event type - covers all message types in sessions
|
|
4236
|
+
* Replaces separate SessionTurnMessages and AgentActivityEvent mechanisms
|
|
4237
|
+
*/
|
|
4238
|
+
/**
|
|
4239
|
+
* Structured action metadata attached to assistant messages.
|
|
4240
|
+
* Frontend reads this instead of parsing text prefixes.
|
|
4241
|
+
*/
|
|
4242
|
+
type AssistantAction = {
|
|
4243
|
+
kind: 'navigate';
|
|
4244
|
+
path: string;
|
|
4245
|
+
reason: string;
|
|
4246
|
+
} | {
|
|
4247
|
+
kind: 'update_filters';
|
|
4248
|
+
timeRange: string | null;
|
|
4249
|
+
statusFilter: string | null;
|
|
4250
|
+
searchQuery: string | null;
|
|
4251
|
+
};
|
|
4252
|
+
type MessageEvent = {
|
|
4253
|
+
type: 'user_message';
|
|
4254
|
+
text: string;
|
|
4255
|
+
} | {
|
|
4256
|
+
type: 'assistant_message';
|
|
4257
|
+
text: string;
|
|
4258
|
+
_action?: AssistantAction;
|
|
4259
|
+
} | {
|
|
4260
|
+
type: 'agent:started';
|
|
4261
|
+
} | {
|
|
4262
|
+
type: 'agent:completed';
|
|
4263
|
+
} | {
|
|
4264
|
+
type: 'agent:error';
|
|
4265
|
+
error: string;
|
|
4266
|
+
} | {
|
|
4267
|
+
type: 'agent:reasoning';
|
|
4268
|
+
iteration: number;
|
|
4269
|
+
reasoning: string;
|
|
4270
|
+
} | {
|
|
4271
|
+
type: 'agent:tool_call';
|
|
4272
|
+
toolName: string;
|
|
4273
|
+
args: Record<string, unknown>;
|
|
4274
|
+
} | {
|
|
4275
|
+
type: 'agent:tool_result';
|
|
4276
|
+
toolName: string;
|
|
4277
|
+
success: boolean;
|
|
4278
|
+
result?: unknown;
|
|
4279
|
+
error?: string;
|
|
4280
|
+
};
|
|
4281
|
+
/**
|
|
4282
|
+
* NOTE: AIResource interface has been removed and replaced with ResourceDefinition
|
|
4283
|
+
* from registry/types.ts. All resources (executable and non-executable) now extend
|
|
4284
|
+
* the unified ResourceDefinition base interface.
|
|
4285
|
+
*
|
|
4286
|
+
* AgentConfig and WorkflowConfig now extend ResourceDefinition directly.
|
|
4287
|
+
* See packages/core/src/registry/types.ts for the base interface definition.
|
|
4288
|
+
*/
|
|
4289
|
+
type AIResourceDefinition = SerializedWorkflowDefinition | SerializedAgentDefinition;
|
|
4320
4290
|
|
|
4321
|
-
type MessageType = MessageEvent['type'];
|
|
4322
4291
|
/**
|
|
4323
|
-
*
|
|
4324
|
-
*
|
|
4325
|
-
*
|
|
4292
|
+
* Supported integration types
|
|
4293
|
+
*
|
|
4294
|
+
* These represent the available integration adapters that can be used with tools.
|
|
4295
|
+
* Each integration type corresponds to an adapter implementation.
|
|
4296
|
+
*
|
|
4297
|
+
* Note: Concrete adapter implementations are deferred until needed.
|
|
4298
|
+
* This type provides compile-time safety and auto-completion for tool definitions.
|
|
4326
4299
|
*/
|
|
4327
|
-
|
|
4328
|
-
|
|
4300
|
+
type IntegrationType = 'gmail' | 'google-sheets' | 'slack' | 'github' | 'linear' | 'attio' | 'airtable' | 'salesforce' | 'hubspot' | 'stripe' | 'twilio' | 'sendgrid' | 'mailgun' | 'zapier' | 'webhook' | 'apify' | 'instantly' | 'resend' | 'signature-api' | 'dropbox' | 'anymailfinder' | 'tomba' | 'millionverifier';
|
|
4301
|
+
|
|
4302
|
+
/**
|
|
4303
|
+
* Resource Registry type definitions
|
|
4304
|
+
*/
|
|
4305
|
+
|
|
4306
|
+
/**
|
|
4307
|
+
* Environment/deployment status for resources
|
|
4308
|
+
*/
|
|
4309
|
+
type ResourceStatus = 'dev' | 'prod';
|
|
4310
|
+
/**
|
|
4311
|
+
* All resource types in the platform
|
|
4312
|
+
* Used as the discriminator field in ResourceDefinition
|
|
4313
|
+
*/
|
|
4314
|
+
type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'external' | 'human';
|
|
4315
|
+
/**
|
|
4316
|
+
* Base interface for ALL platform resources
|
|
4317
|
+
* Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
|
|
4318
|
+
*/
|
|
4319
|
+
interface ResourceDefinition {
|
|
4320
|
+
/** Unique resource identifier */
|
|
4329
4321
|
resourceId: string;
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4322
|
+
/** Display name */
|
|
4323
|
+
name: string;
|
|
4324
|
+
/** Purpose and functionality description */
|
|
4325
|
+
description: string;
|
|
4326
|
+
/** Version for change tracking and evolution */
|
|
4327
|
+
version: string;
|
|
4328
|
+
/** Resource type discriminator */
|
|
4329
|
+
type: ResourceType;
|
|
4330
|
+
/** Environment/deployment status */
|
|
4331
|
+
status: ResourceStatus;
|
|
4332
|
+
/** Graph links to Organization Model nodes */
|
|
4333
|
+
links?: ResourceLink[];
|
|
4334
|
+
/** Infrastructure category for filtering */
|
|
4335
|
+
category?: ResourceCategory;
|
|
4336
|
+
/** Whether the agent supports multi-turn sessions (agents only) */
|
|
4337
|
+
sessionCapable?: boolean;
|
|
4338
|
+
/** Whether the resource is local (monorepo) or remote (externally deployed) */
|
|
4339
|
+
origin?: 'local' | 'remote';
|
|
4340
|
+
/** Whether this resource is archived and should be excluded from registration and deployment */
|
|
4341
|
+
archived?: boolean;
|
|
4340
4342
|
}
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4343
|
+
/** Webhook provider identifiers */
|
|
4344
|
+
type WebhookProviderType = 'cal-com' | 'stripe' | 'signature-api' | 'instantly' | 'apify' | 'test';
|
|
4345
|
+
/** Webhook trigger configuration */
|
|
4346
|
+
interface WebhookTriggerConfig {
|
|
4347
|
+
/** Provider identifier */
|
|
4348
|
+
provider: WebhookProviderType;
|
|
4349
|
+
/** Event type for documentation (not used for matching - workflow handles routing) */
|
|
4350
|
+
event?: string;
|
|
4351
|
+
/** Optional filtering (e.g., specific form ID for Fillout) */
|
|
4352
|
+
filter?: Record<string, string>;
|
|
4353
|
+
/** References credential in credentials table for per-org webhook secrets */
|
|
4354
|
+
credentialName?: string;
|
|
4350
4355
|
}
|
|
4351
|
-
/**
|
|
4352
|
-
interface
|
|
4353
|
-
/**
|
|
4354
|
-
|
|
4355
|
-
/**
|
|
4356
|
-
|
|
4357
|
-
/** Total tokens for this turn (turnInputTokens + turnOutputTokens) */
|
|
4358
|
-
turnTotalTokens: number;
|
|
4359
|
-
/** Cumulative input tokens across all turns in this session */
|
|
4360
|
-
cumulativeInputTokens: number;
|
|
4361
|
-
/** Cumulative output tokens across all turns in this session */
|
|
4362
|
-
cumulativeOutputTokens: number;
|
|
4363
|
-
/** The model's context window size for this session (e.g., 200K) */
|
|
4364
|
-
contextWindowSize: number;
|
|
4356
|
+
/** Schedule trigger configuration */
|
|
4357
|
+
interface ScheduleTriggerConfig {
|
|
4358
|
+
/** Cron expression (e.g., '0 6 * * *') */
|
|
4359
|
+
cron: string;
|
|
4360
|
+
/** Optional timezone (default: UTC) */
|
|
4361
|
+
timezone?: string;
|
|
4365
4362
|
}
|
|
4366
|
-
|
|
4363
|
+
/** Event trigger configuration */
|
|
4364
|
+
interface EventTriggerConfig {
|
|
4365
|
+
/** Internal event type */
|
|
4366
|
+
eventType: string;
|
|
4367
|
+
/** Event source */
|
|
4368
|
+
source?: string;
|
|
4369
|
+
}
|
|
4370
|
+
/** Union of all trigger configs */
|
|
4371
|
+
type TriggerConfig = WebhookTriggerConfig | ScheduleTriggerConfig | EventTriggerConfig;
|
|
4367
4372
|
/**
|
|
4368
|
-
*
|
|
4373
|
+
* Trigger metadata - entry points that initiate resource execution
|
|
4369
4374
|
*
|
|
4370
|
-
*
|
|
4371
|
-
*
|
|
4372
|
-
*
|
|
4373
|
-
*
|
|
4375
|
+
* Triggers represent how executions start: webhooks from external services,
|
|
4376
|
+
* scheduled cron jobs, platform events, or manual user actions.
|
|
4377
|
+
*
|
|
4378
|
+
* BREAKING CHANGES (2025-11-30):
|
|
4379
|
+
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
|
|
4380
|
+
* - Field renames: `id` -> `resourceId` (inherited), `type` -> `triggerType`
|
|
4381
|
+
* - Relationship rename: `invokes` -> `triggers` (unified vocabulary)
|
|
4382
|
+
* - New required fields: `version` (inherited), `type: 'trigger'` (inherited)
|
|
4383
|
+
* - triggers object now includes `externalResources` option
|
|
4384
|
+
*
|
|
4385
|
+
* @example
|
|
4386
|
+
* // TriggerDefinition - metadata only
|
|
4387
|
+
* {
|
|
4388
|
+
* resourceId: 'trigger-new-order',
|
|
4389
|
+
* type: 'trigger',
|
|
4390
|
+
* triggerType: 'webhook',
|
|
4391
|
+
* name: 'New Order',
|
|
4392
|
+
* description: 'Webhook from Shopify on new orders',
|
|
4393
|
+
* version: '1.0.0',
|
|
4394
|
+
* status: 'prod',
|
|
4395
|
+
* webhookPath: '/webhooks/shopify/orders'
|
|
4396
|
+
* }
|
|
4397
|
+
*
|
|
4398
|
+
* // Relationships declared in ResourceRelationships (not on TriggerDefinition):
|
|
4399
|
+
* // relationships: {
|
|
4400
|
+
* // 'trigger-new-order': { triggers: { workflows: ['order-fulfillment-workflow'] } }
|
|
4401
|
+
* // }
|
|
4374
4402
|
*/
|
|
4403
|
+
interface TriggerDefinition extends ResourceDefinition {
|
|
4404
|
+
/** Resource type discriminator (narrowed from base union) */
|
|
4405
|
+
type: 'trigger';
|
|
4406
|
+
/** Trigger mechanism type (renamed from 'type' to avoid collision with base type discriminator) */
|
|
4407
|
+
triggerType: 'webhook' | 'schedule' | 'manual' | 'event';
|
|
4408
|
+
/** Type-specific configuration */
|
|
4409
|
+
config?: TriggerConfig;
|
|
4410
|
+
/** For webhook triggers: path like '/webhooks/shopify/orders' */
|
|
4411
|
+
webhookPath?: string;
|
|
4412
|
+
/** For schedule triggers: cron expression like '0 6 * * *' */
|
|
4413
|
+
schedule?: string;
|
|
4414
|
+
/** For event triggers: event type like 'low-stock-alert' */
|
|
4415
|
+
eventType?: string;
|
|
4416
|
+
}
|
|
4375
4417
|
/**
|
|
4376
|
-
*
|
|
4377
|
-
*
|
|
4378
|
-
*
|
|
4418
|
+
* Integration metadata - external service connections
|
|
4419
|
+
*
|
|
4420
|
+
* References credentials table for actual connection. No connection status
|
|
4421
|
+
* stored here (queried at runtime from credentials table).
|
|
4422
|
+
*
|
|
4423
|
+
* BREAKING CHANGES (2025-11-30):
|
|
4424
|
+
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
|
|
4425
|
+
* - Field renames: `id` -> `resourceId` (inherited)
|
|
4426
|
+
* - New required field: `status` (inherited) - organizations must add status to all integrations
|
|
4427
|
+
* - New required field: `version` (inherited) - organizations must add version to all integrations
|
|
4428
|
+
* - New required field: `type: 'integration'` (inherited) - resource type discriminator
|
|
4429
|
+
*
|
|
4430
|
+
* @example
|
|
4431
|
+
* {
|
|
4432
|
+
* resourceId: 'integration-shopify-prod',
|
|
4433
|
+
* type: 'integration',
|
|
4434
|
+
* provider: 'shopify',
|
|
4435
|
+
* credentialName: 'shopify-prod',
|
|
4436
|
+
* name: 'Shopify Production',
|
|
4437
|
+
* description: 'E-commerce platform',
|
|
4438
|
+
* version: '1.0.0',
|
|
4439
|
+
* status: 'prod'
|
|
4440
|
+
* }
|
|
4379
4441
|
*/
|
|
4380
|
-
interface
|
|
4381
|
-
|
|
4442
|
+
interface IntegrationDefinition extends ResourceDefinition {
|
|
4443
|
+
/** Resource type discriminator (narrowed from base union) */
|
|
4444
|
+
type: 'integration';
|
|
4445
|
+
/** Integration provider type */
|
|
4446
|
+
provider: IntegrationType;
|
|
4447
|
+
/** References credentials table (e.g., 'shopify-prod', 'zendesk-api') */
|
|
4448
|
+
credentialName: string;
|
|
4449
|
+
}
|
|
4450
|
+
/**
|
|
4451
|
+
* External platform type
|
|
4452
|
+
* Supported third-party automation platforms
|
|
4453
|
+
*/
|
|
4454
|
+
type ExternalPlatform = 'n8n' | 'make' | 'zapier' | 'other';
|
|
4455
|
+
/**
|
|
4456
|
+
* External automation resource metadata
|
|
4457
|
+
*
|
|
4458
|
+
* Represents workflows/automations running on third-party platforms
|
|
4459
|
+
* (n8n, Make, Zapier, etc.) for visualization in Command View.
|
|
4460
|
+
*
|
|
4461
|
+
* NOTE: This is metadata ONLY for visualization. No execution logic,
|
|
4462
|
+
* no API integration with external platforms, no status syncing.
|
|
4463
|
+
*
|
|
4464
|
+
* BREAKING CHANGES (2025-11-30):
|
|
4465
|
+
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
|
|
4466
|
+
* - Field renames: `id` -> `resourceId` (inherited)
|
|
4467
|
+
* - New required field: `version` (inherited) - organizations must add version to all external resources
|
|
4468
|
+
* - New required field: `type: 'external'` (inherited) - resource type discriminator
|
|
4469
|
+
* - REMOVED FIELD: `triggeredBy` - per relationship-consolidation design, all relationships are forward-only declarations
|
|
4470
|
+
*
|
|
4471
|
+
* @example
|
|
4472
|
+
* {
|
|
4473
|
+
* resourceId: 'external-n8n-order-sync',
|
|
4474
|
+
* type: 'external',
|
|
4475
|
+
* version: '1.0.0',
|
|
4476
|
+
* platform: 'n8n',
|
|
4477
|
+
* name: 'Shopify Order Sync',
|
|
4478
|
+
* description: 'Legacy n8n workflow for syncing Shopify orders',
|
|
4479
|
+
* status: 'prod',
|
|
4480
|
+
* platformUrl: 'https://n8n.client.com/workflow/123',
|
|
4481
|
+
* triggers: { workflows: ['order-fulfillment-workflow'] },
|
|
4482
|
+
* uses: { integrations: ['integration-shopify-prod'] }
|
|
4483
|
+
* }
|
|
4484
|
+
*/
|
|
4485
|
+
interface ExternalResourceDefinition extends ResourceDefinition {
|
|
4486
|
+
/** Resource type discriminator (narrowed from base union) */
|
|
4487
|
+
type: 'external';
|
|
4488
|
+
/** Platform type */
|
|
4489
|
+
platform: ExternalPlatform;
|
|
4490
|
+
/** Link to external platform (e.g., n8n workflow editor URL) */
|
|
4491
|
+
platformUrl?: string;
|
|
4492
|
+
/** Platform's internal ID/reference */
|
|
4493
|
+
externalId?: string;
|
|
4494
|
+
/** What this external resource triggers (external -> internal) */
|
|
4495
|
+
triggers?: {
|
|
4496
|
+
/** Elevasis workflow resourceIds this external automation triggers */
|
|
4497
|
+
workflows?: string[];
|
|
4498
|
+
/** Elevasis agent resourceIds this external automation triggers */
|
|
4499
|
+
agents?: string[];
|
|
4500
|
+
};
|
|
4501
|
+
/** Integrations this external resource uses (shared credentials) */
|
|
4502
|
+
uses?: {
|
|
4503
|
+
/** Integration IDs this external automation uses */
|
|
4504
|
+
integrations?: string[];
|
|
4505
|
+
};
|
|
4382
4506
|
}
|
|
4383
4507
|
/**
|
|
4384
|
-
*
|
|
4385
|
-
*
|
|
4508
|
+
* Human Checkpoint definition - human decision points in automation
|
|
4509
|
+
*
|
|
4510
|
+
* Represents where human judgment is deployed in the automation landscape.
|
|
4511
|
+
* Tasks with matching command_queue_group are routed to this checkpoint.
|
|
4512
|
+
*
|
|
4513
|
+
* BREAKING CHANGES (2025-11-30):
|
|
4514
|
+
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
|
|
4515
|
+
* - Field renames: `id` -> `resourceId` (inherited)
|
|
4516
|
+
* - description is now REQUIRED (was optional) - organizations must add description to all human checkpoints
|
|
4517
|
+
* - New required field: `version` (inherited) - organizations must add version to all human checkpoints
|
|
4518
|
+
* - New required field: `type: 'human'` (inherited) - resource type discriminator
|
|
4519
|
+
*
|
|
4520
|
+
* @example
|
|
4521
|
+
* {
|
|
4522
|
+
* resourceId: 'sales-approval',
|
|
4523
|
+
* type: 'human',
|
|
4524
|
+
* name: 'Sales Approval Queue',
|
|
4525
|
+
* description: 'High-value order approvals for sales team',
|
|
4526
|
+
* version: '1.0.0',
|
|
4527
|
+
* status: 'prod',
|
|
4528
|
+
* requestedBy: { agents: ['order-processor-agent'] },
|
|
4529
|
+
* routesTo: { agents: ['order-fulfillment-agent'] }
|
|
4530
|
+
* }
|
|
4386
4531
|
*/
|
|
4387
|
-
interface
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4532
|
+
interface HumanCheckpointDefinition extends ResourceDefinition {
|
|
4533
|
+
/** Resource type discriminator (narrowed from base union) */
|
|
4534
|
+
type: 'human';
|
|
4535
|
+
/** Resources that create tasks for this checkpoint */
|
|
4536
|
+
requestedBy?: {
|
|
4537
|
+
/** Agent resourceIds that request approval here */
|
|
4538
|
+
agents?: string[];
|
|
4539
|
+
/** Workflow resourceIds that request approval here */
|
|
4540
|
+
workflows?: string[];
|
|
4391
4541
|
};
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
/** Onboarding guide system state (set by checklist/tour system) */
|
|
4399
|
-
guides?: {
|
|
4400
|
-
completedIds?: string[];
|
|
4401
|
-
dismissed?: boolean;
|
|
4402
|
-
completedAt?: string;
|
|
4403
|
-
};
|
|
4542
|
+
/** Resources that receive approved decisions */
|
|
4543
|
+
routesTo?: {
|
|
4544
|
+
/** Agent resourceIds that handle approved tasks */
|
|
4545
|
+
agents?: string[];
|
|
4546
|
+
/** Workflow resourceIds that handle approved tasks */
|
|
4547
|
+
workflows?: string[];
|
|
4404
4548
|
};
|
|
4405
4549
|
}
|
|
4406
4550
|
|
|
4407
4551
|
/**
|
|
4408
|
-
*
|
|
4552
|
+
* Command View Types
|
|
4409
4553
|
*
|
|
4410
|
-
*
|
|
4411
|
-
*
|
|
4554
|
+
* Unified type definitions for the Command View graph visualization.
|
|
4555
|
+
* These types are used by both backend serialization and frontend rendering.
|
|
4412
4556
|
*
|
|
4413
|
-
*
|
|
4414
|
-
*
|
|
4415
|
-
* - UUID validation prevents invalid references
|
|
4416
|
-
* - Role enum validation prevents privilege escalation
|
|
4417
|
-
* - organizationId never accepted in body (from JWT when needed)
|
|
4557
|
+
* Command View shows the resource graph: agents, workflows, triggers, integrations,
|
|
4558
|
+
* external resources, and human checkpoints with their relationships.
|
|
4418
4559
|
*/
|
|
4419
4560
|
|
|
4420
4561
|
/**
|
|
4421
|
-
*
|
|
4422
|
-
*
|
|
4562
|
+
* Extended agent metadata for Command View
|
|
4563
|
+
* Includes model and capability information for graph display
|
|
4423
4564
|
*/
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4565
|
+
interface CommandViewAgent extends ResourceDefinition {
|
|
4566
|
+
type: 'agent';
|
|
4567
|
+
modelProvider: string;
|
|
4568
|
+
modelId: string;
|
|
4569
|
+
toolCount: number;
|
|
4570
|
+
hasKnowledgeMap: boolean;
|
|
4571
|
+
hasMemory: boolean;
|
|
4572
|
+
sessionCapable: boolean;
|
|
4573
|
+
}
|
|
4430
4574
|
/**
|
|
4431
|
-
*
|
|
4575
|
+
* Extended workflow metadata for Command View
|
|
4576
|
+
* Includes step information for graph display
|
|
4432
4577
|
*/
|
|
4433
|
-
interface
|
|
4434
|
-
|
|
4578
|
+
interface CommandViewWorkflow extends ResourceDefinition {
|
|
4579
|
+
type: 'workflow';
|
|
4580
|
+
stepCount: number;
|
|
4581
|
+
entryPoint: string;
|
|
4582
|
+
}
|
|
4583
|
+
/**
|
|
4584
|
+
* Relationship types between resources
|
|
4585
|
+
*
|
|
4586
|
+
* - triggers: Resource initiates/starts another resource (orange)
|
|
4587
|
+
* - uses: Resource uses an integration (teal)
|
|
4588
|
+
* - approval: Resource requires human approval (yellow)
|
|
4589
|
+
*/
|
|
4590
|
+
type RelationshipType$1 = 'triggers' | 'uses' | 'approval';
|
|
4591
|
+
/**
|
|
4592
|
+
* Command View edge (relationship between resources)
|
|
4593
|
+
*/
|
|
4594
|
+
interface CommandViewEdge$1 {
|
|
4435
4595
|
id: string;
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
};
|
|
4441
|
-
status: 'active' | 'inactive';
|
|
4442
|
-
createdAt: string;
|
|
4443
|
-
updatedAt: string;
|
|
4596
|
+
source: string;
|
|
4597
|
+
target: string;
|
|
4598
|
+
relationship: RelationshipType$1;
|
|
4599
|
+
label?: string;
|
|
4444
4600
|
}
|
|
4445
4601
|
/**
|
|
4446
|
-
*
|
|
4602
|
+
* Command View data structure
|
|
4603
|
+
* Complete graph data for visualization
|
|
4604
|
+
*
|
|
4605
|
+
* Backend serializes this once at startup and serves it via /command-view endpoint.
|
|
4606
|
+
* Frontend consumes this directly for graph rendering.
|
|
4447
4607
|
*/
|
|
4448
|
-
interface
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4608
|
+
interface CommandViewData {
|
|
4609
|
+
workflows: CommandViewWorkflow[];
|
|
4610
|
+
agents: CommandViewAgent[];
|
|
4611
|
+
triggers: TriggerDefinition[];
|
|
4612
|
+
integrations: IntegrationDefinition[];
|
|
4613
|
+
externalResources: ExternalResourceDefinition[];
|
|
4614
|
+
humanCheckpoints: HumanCheckpointDefinition[];
|
|
4615
|
+
edges: CommandViewEdge$1[];
|
|
4452
4616
|
}
|
|
4453
|
-
|
|
4454
|
-
|
|
4617
|
+
|
|
4618
|
+
declare const LinkSchema: z.ZodObject<{
|
|
4619
|
+
nodeId: z.ZodString;
|
|
4620
|
+
kind: z.ZodEnum<{
|
|
4621
|
+
contains: "contains";
|
|
4622
|
+
references: "references";
|
|
4623
|
+
exposes: "exposes";
|
|
4624
|
+
maps_to: "maps_to";
|
|
4625
|
+
"operates-on": "operates-on";
|
|
4626
|
+
uses: "uses";
|
|
4627
|
+
}>;
|
|
4628
|
+
}, z.core.$strip>;
|
|
4629
|
+
type Link = z.infer<typeof LinkSchema>;
|
|
4630
|
+
|
|
4631
|
+
declare const ResourceCategorySchema: z.ZodEnum<{
|
|
4632
|
+
production: "production";
|
|
4633
|
+
diagnostic: "diagnostic";
|
|
4634
|
+
internal: "internal";
|
|
4635
|
+
testing: "testing";
|
|
4636
|
+
}>;
|
|
4637
|
+
type ResourceCategory = z.infer<typeof ResourceCategorySchema>;
|
|
4638
|
+
type ResourceLink = Link;
|
|
4639
|
+
|
|
4640
|
+
type ExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'warning';
|
|
4641
|
+
interface APIExecutionSummary {
|
|
4642
|
+
id: string;
|
|
4643
|
+
status: ExecutionStatus;
|
|
4644
|
+
startTime: number;
|
|
4645
|
+
endTime?: number;
|
|
4646
|
+
resourceStatus?: ResourceStatus;
|
|
4455
4647
|
}
|
|
4456
|
-
interface
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4648
|
+
interface APIExecutionDetail extends APIExecutionSummary {
|
|
4649
|
+
executionLogs: ExecutionLogMessage[];
|
|
4650
|
+
input?: unknown;
|
|
4651
|
+
result?: unknown;
|
|
4652
|
+
error?: string;
|
|
4653
|
+
resourceStatus: ResourceStatus;
|
|
4654
|
+
apiVersion?: string | null;
|
|
4655
|
+
resourceVersion?: string | null;
|
|
4656
|
+
sdkVersion?: string | null;
|
|
4657
|
+
isArchived?: boolean;
|
|
4658
|
+
archivedLogCount?: number;
|
|
4659
|
+
}
|
|
4660
|
+
interface APIExecutionListResponse {
|
|
4661
|
+
executions: APIExecutionSummary[];
|
|
4662
|
+
total?: number;
|
|
4460
4663
|
limit?: number;
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
order?: 'asc' | 'desc';
|
|
4664
|
+
offset?: number;
|
|
4665
|
+
hasMore?: boolean;
|
|
4464
4666
|
}
|
|
4667
|
+
|
|
4465
4668
|
/**
|
|
4466
|
-
*
|
|
4669
|
+
* @deprecated Use TimeRange from '@repo/core' directly. Kept as alias for backward compatibility.
|
|
4467
4670
|
*/
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4671
|
+
type StatsTimeRange = TimeRange;
|
|
4672
|
+
/** Stats returned by /command-view/stats (counts only, no error details) */
|
|
4673
|
+
interface ResourceStats {
|
|
4674
|
+
resourceId: string;
|
|
4675
|
+
totalRuns: number;
|
|
4676
|
+
successCount: number;
|
|
4677
|
+
failureCount: number;
|
|
4678
|
+
warningCount: number;
|
|
4679
|
+
lastRunAt: string | null;
|
|
4474
4680
|
}
|
|
4475
|
-
/**
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4681
|
+
/** Response from /command-view/resource-errors (on-demand) */
|
|
4682
|
+
interface ResourceErrorsResponse {
|
|
4683
|
+
resourceId: string;
|
|
4684
|
+
errors: ErrorSummary[];
|
|
4685
|
+
totalErrors: number;
|
|
4686
|
+
timeRange: StatsTimeRange;
|
|
4687
|
+
}
|
|
4688
|
+
interface ErrorSummary {
|
|
4689
|
+
executionId: string;
|
|
4690
|
+
errorType: string;
|
|
4691
|
+
errorMessage: string;
|
|
4692
|
+
occurredAt: string;
|
|
4693
|
+
}
|
|
4694
|
+
/** Single execution summary for Recent Executions list in command view */
|
|
4695
|
+
interface CommandViewExecution {
|
|
4696
|
+
executionId: string;
|
|
4697
|
+
status: ExecutionStatus;
|
|
4698
|
+
startedAt: string;
|
|
4699
|
+
completedAt: string | null;
|
|
4700
|
+
errorMessage: string | null;
|
|
4701
|
+
}
|
|
4702
|
+
/** Response from /command-view/resource-executions (on-demand) */
|
|
4703
|
+
interface ResourceExecutionsResponse {
|
|
4704
|
+
resourceId: string;
|
|
4705
|
+
executions: CommandViewExecution[];
|
|
4706
|
+
totalExecutions: number;
|
|
4707
|
+
timeRange: StatsTimeRange;
|
|
4708
|
+
page: number;
|
|
4709
|
+
limit: number;
|
|
4710
|
+
}
|
|
4711
|
+
interface HumanCheckpointStats {
|
|
4712
|
+
checkpointId: string;
|
|
4713
|
+
pendingCount: number;
|
|
4714
|
+
completedCount: number;
|
|
4715
|
+
expiredCount: number;
|
|
4716
|
+
lastDecisionAt: string | null;
|
|
4717
|
+
}
|
|
4718
|
+
/** Response from /command-view/stats */
|
|
4719
|
+
interface CommandViewStatsResponse {
|
|
4720
|
+
resources: Record<string, ResourceStats>;
|
|
4721
|
+
humanCheckpoints: Record<string, HumanCheckpointStats>;
|
|
4722
|
+
timeRange: StatsTimeRange;
|
|
4723
|
+
generatedAt: string;
|
|
4497
4724
|
}
|
|
4498
4725
|
|
|
4499
|
-
type
|
|
4500
|
-
|
|
4726
|
+
type ActivityType = 'workflow_execution' | 'agent_run' | 'hitl_action' | 'webhook_received' | 'webhook_executed' | 'webhook_failed' | 'credential_change' | 'credential_read' | 'api_key_change' | 'deployment_change' | 'membership_change';
|
|
4727
|
+
type ActivityStatus = 'success' | 'failure' | 'pending' | 'approved' | 'rejected' | 'completed';
|
|
4728
|
+
interface Activity {
|
|
4501
4729
|
id: string;
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
sdkVersion?: string | null;
|
|
4516
|
-
isArchived?: boolean;
|
|
4517
|
-
archivedLogCount?: number;
|
|
4730
|
+
organizationId: string;
|
|
4731
|
+
activityType: ActivityType;
|
|
4732
|
+
status: ActivityStatus;
|
|
4733
|
+
title: string;
|
|
4734
|
+
description: string | null;
|
|
4735
|
+
entityType: string;
|
|
4736
|
+
entityId: string;
|
|
4737
|
+
entityName: string | null;
|
|
4738
|
+
metadata: Record<string, unknown> | null;
|
|
4739
|
+
actorId: string | null;
|
|
4740
|
+
actorType: string | null;
|
|
4741
|
+
occurredAt: Date;
|
|
4742
|
+
createdAt: Date;
|
|
4518
4743
|
}
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4744
|
+
|
|
4745
|
+
/**
|
|
4746
|
+
* Canonical permission catalog.
|
|
4747
|
+
*
|
|
4748
|
+
* Source of truth for the permission keys used by:
|
|
4749
|
+
* - RLS policies in Supabase (via has_org_permission(org_id, key))
|
|
4750
|
+
* - API middleware (via requireOrganizationPermission(key))
|
|
4751
|
+
* - UI hooks (via useOrganizationPermissions().hasPermission(key))
|
|
4752
|
+
*
|
|
4753
|
+
* The DB table `org_rol_permissions` mirrors this constant. Reconciliation
|
|
4754
|
+
* runs at API boot (insert-or-update only — never auto-delete; see the
|
|
4755
|
+
* deletion runbook in the auth-role-system-redesign doc).
|
|
4756
|
+
*
|
|
4757
|
+
* Adding a permission:
|
|
4758
|
+
* 1. Add an entry below.
|
|
4759
|
+
* 2. Add a row to the migration / via reconcilePermissionCatalog at boot.
|
|
4760
|
+
* 3. Reference it in RLS / middleware as needed.
|
|
4761
|
+
* 4. Optionally grant it to one or more system roles in org_rol_grants.
|
|
4762
|
+
*
|
|
4763
|
+
* Removing a permission: follow the deletion runbook — never just delete
|
|
4764
|
+
* the entry. Existing role grants and policy references must be cleared first.
|
|
4765
|
+
*/
|
|
4766
|
+
declare const PERMISSIONS: {
|
|
4767
|
+
readonly ORG_READ: "org.read";
|
|
4768
|
+
readonly ORG_MANAGE: "org.manage";
|
|
4769
|
+
readonly ORG_DELETE: "org.delete";
|
|
4770
|
+
readonly MEMBERS_MANAGE: "members.manage";
|
|
4771
|
+
readonly ROLES_MANAGE: "roles.manage";
|
|
4772
|
+
readonly SECRETS_MANAGE: "secrets.manage";
|
|
4773
|
+
readonly OPERATIONS_READ: "operations.read";
|
|
4774
|
+
readonly OPERATIONS_MANAGE: "operations.manage";
|
|
4775
|
+
readonly WORK_MANAGE: "work.manage";
|
|
4776
|
+
};
|
|
4777
|
+
type PermissionKey = (typeof PERMISSIONS)[keyof typeof PERMISSIONS];
|
|
4778
|
+
/**
|
|
4779
|
+
* Static metadata for each permission. Mirrored into org_rol_permissions on
|
|
4780
|
+
* boot reconciliation. is_org_grantable=false means the permission is reserved
|
|
4781
|
+
* to system roles only — custom roles cannot include it (privilege-escalation guard).
|
|
4782
|
+
*/
|
|
4783
|
+
interface PermissionDescriptor {
|
|
4784
|
+
key: PermissionKey;
|
|
4785
|
+
description: string;
|
|
4786
|
+
isOrgGrantable: boolean;
|
|
4525
4787
|
}
|
|
4526
4788
|
|
|
4527
4789
|
/**
|
|
@@ -4533,9 +4795,9 @@ declare const ExecutionHistoryItemSchema: z.ZodObject<{
|
|
|
4533
4795
|
createdAt: z.ZodString;
|
|
4534
4796
|
status: z.ZodEnum<{
|
|
4535
4797
|
completed: "completed";
|
|
4798
|
+
cancelled: "cancelled";
|
|
4536
4799
|
failed: "failed";
|
|
4537
4800
|
running: "running";
|
|
4538
|
-
cancelled: "cancelled";
|
|
4539
4801
|
}>;
|
|
4540
4802
|
step: z.ZodNullable<z.ZodNumber>;
|
|
4541
4803
|
itemLabel: z.ZodNullable<z.ZodString>;
|
|
@@ -4552,9 +4814,9 @@ declare const ExecutionHistoryResponseSchema: z.ZodObject<{
|
|
|
4552
4814
|
createdAt: z.ZodString;
|
|
4553
4815
|
status: z.ZodEnum<{
|
|
4554
4816
|
completed: "completed";
|
|
4817
|
+
cancelled: "cancelled";
|
|
4555
4818
|
failed: "failed";
|
|
4556
4819
|
running: "running";
|
|
4557
|
-
cancelled: "cancelled";
|
|
4558
4820
|
}>;
|
|
4559
4821
|
step: z.ZodNullable<z.ZodNumber>;
|
|
4560
4822
|
itemLabel: z.ZodNullable<z.ZodString>;
|
|
@@ -4568,6 +4830,63 @@ declare const ExecutionHistoryResponseSchema: z.ZodObject<{
|
|
|
4568
4830
|
type ExecutionHistoryItem = z.infer<typeof ExecutionHistoryItemSchema>;
|
|
4569
4831
|
type ExecutionHistoryResponse = z.infer<typeof ExecutionHistoryResponseSchema>;
|
|
4570
4832
|
|
|
4833
|
+
/**
|
|
4834
|
+
* Deployment types — browser-safe
|
|
4835
|
+
*
|
|
4836
|
+
* Canonical API response types for the deployment resource.
|
|
4837
|
+
* The API's transformRow converts snake_case DB columns to these camelCase fields.
|
|
4838
|
+
*/
|
|
4839
|
+
type DeploymentStatus = 'deploying' | 'active' | 'failed' | 'rolled_back' | 'stopped';
|
|
4840
|
+
interface Deployment {
|
|
4841
|
+
id: string;
|
|
4842
|
+
organizationId: string;
|
|
4843
|
+
status: DeploymentStatus;
|
|
4844
|
+
sdkVersion: string;
|
|
4845
|
+
deploymentVersion: string | null;
|
|
4846
|
+
port: number | null;
|
|
4847
|
+
pid: number | null;
|
|
4848
|
+
tarballPath: string | null;
|
|
4849
|
+
errorMessage: string | null;
|
|
4850
|
+
createdAt: string;
|
|
4851
|
+
updatedAt: string;
|
|
4852
|
+
}
|
|
4853
|
+
|
|
4854
|
+
/**
|
|
4855
|
+
* GET /api/credentials - List credentials
|
|
4856
|
+
*/
|
|
4857
|
+
declare const ListCredentialsResponseSchema: z.ZodObject<{
|
|
4858
|
+
credentials: z.ZodArray<z.ZodObject<{
|
|
4859
|
+
id: z.ZodString;
|
|
4860
|
+
name: z.ZodString;
|
|
4861
|
+
type: z.ZodString;
|
|
4862
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
4863
|
+
createdAt: z.ZodString;
|
|
4864
|
+
}, z.core.$strip>>;
|
|
4865
|
+
}, z.core.$strip>;
|
|
4866
|
+
/** API response type for a single credential list item */
|
|
4867
|
+
type CredentialListItem = z.infer<typeof ListCredentialsResponseSchema>['credentials'][number];
|
|
4868
|
+
|
|
4869
|
+
declare function useOrganizationPermissions(): {
|
|
4870
|
+
hasPermission: (key: PermissionKey | string) => boolean;
|
|
4871
|
+
permissions: string[];
|
|
4872
|
+
isPlatformAdmin: boolean;
|
|
4873
|
+
isReady: boolean;
|
|
4874
|
+
};
|
|
4875
|
+
declare function useHasPermission(key: PermissionKey | string): boolean;
|
|
4876
|
+
|
|
4877
|
+
/**
|
|
4878
|
+
* Query key factory for executions TanStack Query hooks.
|
|
4879
|
+
* Uses organization UUID (not name) for cache isolation.
|
|
4880
|
+
*/
|
|
4881
|
+
declare const executionsKeys: {
|
|
4882
|
+
all: readonly ["executions"];
|
|
4883
|
+
resources: (orgId: string | null) => readonly ["executions", "resources", string | null];
|
|
4884
|
+
resourceDefinition: (orgId: string | null, resourceId: string) => readonly ["executions", "definition", string | null, string];
|
|
4885
|
+
executionsListBase: (orgId: string | null, resourceId: string) => readonly ["executions", "list", string | null, string];
|
|
4886
|
+
executions: (orgId: string | null, resourceId: string, resourceStatus?: string, limit?: number, offset?: number) => readonly ["executions", "list", string | null, string, string, number | null, number];
|
|
4887
|
+
execution: (orgId: string | null, resourceId: string, executionId: string) => readonly ["executions", "execution", string | null, string, string];
|
|
4888
|
+
};
|
|
4889
|
+
|
|
4571
4890
|
/**
|
|
4572
4891
|
* Fetch the execution list for a given resource.
|
|
4573
4892
|
*
|
|
@@ -4671,119 +4990,6 @@ interface BulkDeleteExecutionsResult {
|
|
|
4671
4990
|
*/
|
|
4672
4991
|
declare function useBulkDeleteExecutions(): _tanstack_react_query.UseMutationResult<BulkDeleteExecutionsResult, Error, BulkDeleteExecutionsParams, unknown>;
|
|
4673
4992
|
|
|
4674
|
-
/**
|
|
4675
|
-
* @deprecated Use TimeRange from '@repo/core' directly. Kept as alias for backward compatibility.
|
|
4676
|
-
*/
|
|
4677
|
-
type StatsTimeRange = TimeRange;
|
|
4678
|
-
/** Stats returned by /command-view/stats (counts only, no error details) */
|
|
4679
|
-
interface ResourceStats {
|
|
4680
|
-
resourceId: string;
|
|
4681
|
-
totalRuns: number;
|
|
4682
|
-
successCount: number;
|
|
4683
|
-
failureCount: number;
|
|
4684
|
-
warningCount: number;
|
|
4685
|
-
lastRunAt: string | null;
|
|
4686
|
-
}
|
|
4687
|
-
/** Response from /command-view/resource-errors (on-demand) */
|
|
4688
|
-
interface ResourceErrorsResponse {
|
|
4689
|
-
resourceId: string;
|
|
4690
|
-
errors: ErrorSummary[];
|
|
4691
|
-
totalErrors: number;
|
|
4692
|
-
timeRange: StatsTimeRange;
|
|
4693
|
-
}
|
|
4694
|
-
interface ErrorSummary {
|
|
4695
|
-
executionId: string;
|
|
4696
|
-
errorType: string;
|
|
4697
|
-
errorMessage: string;
|
|
4698
|
-
occurredAt: string;
|
|
4699
|
-
}
|
|
4700
|
-
/** Single execution summary for Recent Executions list in command view */
|
|
4701
|
-
interface CommandViewExecution {
|
|
4702
|
-
executionId: string;
|
|
4703
|
-
status: ExecutionStatus;
|
|
4704
|
-
startedAt: string;
|
|
4705
|
-
completedAt: string | null;
|
|
4706
|
-
errorMessage: string | null;
|
|
4707
|
-
}
|
|
4708
|
-
/** Response from /command-view/resource-executions (on-demand) */
|
|
4709
|
-
interface ResourceExecutionsResponse {
|
|
4710
|
-
resourceId: string;
|
|
4711
|
-
executions: CommandViewExecution[];
|
|
4712
|
-
totalExecutions: number;
|
|
4713
|
-
timeRange: StatsTimeRange;
|
|
4714
|
-
page: number;
|
|
4715
|
-
limit: number;
|
|
4716
|
-
}
|
|
4717
|
-
interface HumanCheckpointStats {
|
|
4718
|
-
checkpointId: string;
|
|
4719
|
-
pendingCount: number;
|
|
4720
|
-
completedCount: number;
|
|
4721
|
-
expiredCount: number;
|
|
4722
|
-
lastDecisionAt: string | null;
|
|
4723
|
-
}
|
|
4724
|
-
/** Response from /command-view/stats */
|
|
4725
|
-
interface CommandViewStatsResponse {
|
|
4726
|
-
resources: Record<string, ResourceStats>;
|
|
4727
|
-
humanCheckpoints: Record<string, HumanCheckpointStats>;
|
|
4728
|
-
timeRange: StatsTimeRange;
|
|
4729
|
-
generatedAt: string;
|
|
4730
|
-
}
|
|
4731
|
-
|
|
4732
|
-
type ActivityType = 'workflow_execution' | 'agent_run' | 'hitl_action' | 'webhook_received' | 'webhook_executed' | 'webhook_failed' | 'credential_change' | 'api_key_change' | 'deployment_change' | 'membership_change';
|
|
4733
|
-
type ActivityStatus = 'success' | 'failure' | 'pending' | 'approved' | 'rejected' | 'completed';
|
|
4734
|
-
interface Activity {
|
|
4735
|
-
id: string;
|
|
4736
|
-
organizationId: string;
|
|
4737
|
-
activityType: ActivityType;
|
|
4738
|
-
status: ActivityStatus;
|
|
4739
|
-
title: string;
|
|
4740
|
-
description: string | null;
|
|
4741
|
-
entityType: string;
|
|
4742
|
-
entityId: string;
|
|
4743
|
-
entityName: string | null;
|
|
4744
|
-
metadata: Record<string, unknown> | null;
|
|
4745
|
-
actorId: string | null;
|
|
4746
|
-
actorType: string | null;
|
|
4747
|
-
occurredAt: Date;
|
|
4748
|
-
createdAt: Date;
|
|
4749
|
-
}
|
|
4750
|
-
|
|
4751
|
-
/**
|
|
4752
|
-
* Deployment types — browser-safe
|
|
4753
|
-
*
|
|
4754
|
-
* Canonical API response types for the deployment resource.
|
|
4755
|
-
* The API's transformRow converts snake_case DB columns to these camelCase fields.
|
|
4756
|
-
*/
|
|
4757
|
-
type DeploymentStatus = 'deploying' | 'active' | 'failed' | 'rolled_back' | 'stopped';
|
|
4758
|
-
interface Deployment {
|
|
4759
|
-
id: string;
|
|
4760
|
-
organizationId: string;
|
|
4761
|
-
status: DeploymentStatus;
|
|
4762
|
-
sdkVersion: string;
|
|
4763
|
-
deploymentVersion: string | null;
|
|
4764
|
-
port: number | null;
|
|
4765
|
-
pid: number | null;
|
|
4766
|
-
tarballPath: string | null;
|
|
4767
|
-
errorMessage: string | null;
|
|
4768
|
-
createdAt: string;
|
|
4769
|
-
updatedAt: string;
|
|
4770
|
-
}
|
|
4771
|
-
|
|
4772
|
-
/**
|
|
4773
|
-
* GET /api/credentials - List credentials
|
|
4774
|
-
*/
|
|
4775
|
-
declare const ListCredentialsResponseSchema: z.ZodObject<{
|
|
4776
|
-
credentials: z.ZodArray<z.ZodObject<{
|
|
4777
|
-
id: z.ZodString;
|
|
4778
|
-
name: z.ZodString;
|
|
4779
|
-
type: z.ZodString;
|
|
4780
|
-
provider: z.ZodNullable<z.ZodString>;
|
|
4781
|
-
createdAt: z.ZodString;
|
|
4782
|
-
}, z.core.$strip>>;
|
|
4783
|
-
}, z.core.$strip>;
|
|
4784
|
-
/** API response type for a single credential list item */
|
|
4785
|
-
type CredentialListItem = z.infer<typeof ListCredentialsResponseSchema>['credentials'][number];
|
|
4786
|
-
|
|
4787
4993
|
/**
|
|
4788
4994
|
* Fetch all available Execution Engine resources (workflows, agents, pipelines).
|
|
4789
4995
|
*
|
|
@@ -5005,7 +5211,7 @@ declare function useGetExecutionHistory(scheduleId: string | undefined, options?
|
|
|
5005
5211
|
executions: {
|
|
5006
5212
|
id: string;
|
|
5007
5213
|
createdAt: string;
|
|
5008
|
-
status: "completed" | "
|
|
5214
|
+
status: "completed" | "cancelled" | "failed" | "running";
|
|
5009
5215
|
step: number | null;
|
|
5010
5216
|
itemLabel: string | null;
|
|
5011
5217
|
duration: number | null;
|
|
@@ -5734,10 +5940,6 @@ declare function createFeatureAccessHook({ useInitialization, useOrganization }:
|
|
|
5734
5940
|
checkFeature: (featureKey: string) => FeatureAccessResult;
|
|
5735
5941
|
isReady: boolean;
|
|
5736
5942
|
};
|
|
5737
|
-
/**
|
|
5738
|
-
* @deprecated Use `createFeatureAccessHook` instead. This alias will be removed in a future release.
|
|
5739
|
-
*/
|
|
5740
|
-
declare const createUseFeatureAccess: typeof createFeatureAccessHook;
|
|
5741
5943
|
|
|
5742
5944
|
interface UseSSEConnectionOptions {
|
|
5743
5945
|
manager: SSEConnectionManagerLike;
|
|
@@ -5993,8 +6195,8 @@ declare const RequestSourceEnum: z.ZodEnum<{
|
|
|
5993
6195
|
cli: "cli";
|
|
5994
6196
|
}>;
|
|
5995
6197
|
declare const RequestTypeEnum: z.ZodEnum<{
|
|
5996
|
-
other: "other";
|
|
5997
6198
|
feature: "feature";
|
|
6199
|
+
other: "other";
|
|
5998
6200
|
bug: "bug";
|
|
5999
6201
|
question: "question";
|
|
6000
6202
|
}>;
|
|
@@ -6196,6 +6398,8 @@ interface UseCommandViewStatsOptions {
|
|
|
6196
6398
|
*/
|
|
6197
6399
|
declare function useCommandViewStats(timeRange?: StatsTimeRange, options?: UseCommandViewStatsOptions): _tanstack_react_query.UseQueryResult<CommandViewStatsResponse, Error>;
|
|
6198
6400
|
|
|
6401
|
+
type CommandViewVisualizationMode = 'cluster' | 'swimlane' | 'focus' | 'network' | 'spatial';
|
|
6402
|
+
|
|
6199
6403
|
/**
|
|
6200
6404
|
* Command View Types
|
|
6201
6405
|
*
|
|
@@ -6317,15 +6521,28 @@ interface CommandViewStore {
|
|
|
6317
6521
|
setShowIntegrations: (v: boolean) => void;
|
|
6318
6522
|
fitViewOnFilter: boolean;
|
|
6319
6523
|
setFitViewOnFilter: (v: boolean) => void;
|
|
6524
|
+
visualizationMode: CommandViewVisualizationMode;
|
|
6525
|
+
setVisualizationMode: (v: CommandViewVisualizationMode) => void;
|
|
6320
6526
|
selectedNodeId: string | null;
|
|
6321
6527
|
setSelectedNodeId: (id: string | null) => void;
|
|
6528
|
+
resourcesHidden: boolean;
|
|
6529
|
+
setResourcesHidden: (v: boolean) => void;
|
|
6530
|
+
diagnosticsHidden: boolean;
|
|
6531
|
+
setDiagnosticsHidden: (v: boolean) => void;
|
|
6532
|
+
diagnosticCategories: string[];
|
|
6533
|
+
revealedIds: Set<string>;
|
|
6534
|
+
setRevealedIds: (ids: Iterable<string>) => void;
|
|
6535
|
+
clearRevealedIds: () => void;
|
|
6536
|
+
hasVisibilityInteraction: boolean;
|
|
6537
|
+
markVisibilityInteraction: () => void;
|
|
6538
|
+
resetVisibilityInteraction: () => void;
|
|
6322
6539
|
}
|
|
6323
6540
|
/**
|
|
6324
6541
|
* Shared store for Command View filter/settings state.
|
|
6325
6542
|
* Allows CommandViewPage (graph) and CommandViewSidebarContent (sidebar) to share state.
|
|
6326
6543
|
*
|
|
6327
|
-
* Persisted to localStorage: showIntegrations, fitViewOnFilter
|
|
6328
|
-
* Not persisted (reset on reload): statusFilter, selectedNodeId
|
|
6544
|
+
* Persisted to localStorage: showIntegrations, fitViewOnFilter, resource/diagnostic visibility preferences.
|
|
6545
|
+
* Not persisted (reset on reload): statusFilter, selectedNodeId, revealedIds, CTA interaction state.
|
|
6329
6546
|
*/
|
|
6330
6547
|
declare const useCommandViewStore: zustand.UseBoundStore<Omit<zustand.StoreApi<CommandViewStore>, "setState" | "persist"> & {
|
|
6331
6548
|
setState(partial: CommandViewStore | Partial<CommandViewStore> | ((state: CommandViewStore) => CommandViewStore | Partial<CommandViewStore>), replace?: false | undefined): unknown;
|
|
@@ -6334,6 +6551,9 @@ declare const useCommandViewStore: zustand.UseBoundStore<Omit<zustand.StoreApi<C
|
|
|
6334
6551
|
setOptions: (options: Partial<zustand_middleware.PersistOptions<CommandViewStore, {
|
|
6335
6552
|
showIntegrations: boolean;
|
|
6336
6553
|
fitViewOnFilter: boolean;
|
|
6554
|
+
visualizationMode: CommandViewVisualizationMode;
|
|
6555
|
+
resourcesHidden: boolean;
|
|
6556
|
+
diagnosticsHidden: boolean;
|
|
6337
6557
|
}, unknown>>) => void;
|
|
6338
6558
|
clearStorage: () => void;
|
|
6339
6559
|
rehydrate: () => Promise<void> | void;
|
|
@@ -6343,6 +6563,9 @@ declare const useCommandViewStore: zustand.UseBoundStore<Omit<zustand.StoreApi<C
|
|
|
6343
6563
|
getOptions: () => Partial<zustand_middleware.PersistOptions<CommandViewStore, {
|
|
6344
6564
|
showIntegrations: boolean;
|
|
6345
6565
|
fitViewOnFilter: boolean;
|
|
6566
|
+
visualizationMode: CommandViewVisualizationMode;
|
|
6567
|
+
resourcesHidden: boolean;
|
|
6568
|
+
diagnosticsHidden: boolean;
|
|
6346
6569
|
}, unknown>>;
|
|
6347
6570
|
};
|
|
6348
6571
|
}>;
|
|
@@ -7620,10 +7843,56 @@ declare function useReactivateMembership(): _tanstack_react_query.UseMutationRes
|
|
|
7620
7843
|
previousData: unknown;
|
|
7621
7844
|
}>;
|
|
7622
7845
|
|
|
7846
|
+
type OrgRolDefinitionRow = Database['public']['Tables']['org_rol_definitions']['Row'];
|
|
7847
|
+
type OrgRole = OrgRolDefinitionRow & {
|
|
7848
|
+
grants?: string[];
|
|
7849
|
+
memberCount?: number;
|
|
7850
|
+
};
|
|
7851
|
+
type CreateOrgRoleInput = {
|
|
7852
|
+
name: string;
|
|
7853
|
+
slug: string;
|
|
7854
|
+
description?: string;
|
|
7855
|
+
permissionKeys: string[];
|
|
7856
|
+
};
|
|
7857
|
+
type UpdateOrgRoleInput = Partial<CreateOrgRoleInput>;
|
|
7858
|
+
type AssignRoleInput = {
|
|
7859
|
+
membershipId: string;
|
|
7860
|
+
roleId: string;
|
|
7861
|
+
};
|
|
7862
|
+
type RevokeRoleInput = {
|
|
7863
|
+
membershipId: string;
|
|
7864
|
+
roleId: string;
|
|
7865
|
+
};
|
|
7866
|
+
|
|
7867
|
+
declare function useOrgRoles(orgId?: string): _tanstack_react_query.UseQueryResult<{
|
|
7868
|
+
roles: OrgRole[];
|
|
7869
|
+
}, Error>;
|
|
7870
|
+
|
|
7871
|
+
declare function usePermissionCatalog(): _tanstack_react_query.UseQueryResult<{
|
|
7872
|
+
permissions: PermissionDescriptor[];
|
|
7873
|
+
}, Error>;
|
|
7874
|
+
|
|
7875
|
+
declare function useCreateOrgRole(): _tanstack_react_query.UseMutationResult<OrgRole, Error, CreateOrgRoleInput, unknown>;
|
|
7876
|
+
|
|
7877
|
+
interface UpdateOrgRoleParams {
|
|
7878
|
+
roleId: string;
|
|
7879
|
+
input: UpdateOrgRoleInput;
|
|
7880
|
+
}
|
|
7881
|
+
declare function useUpdateOrgRole(): _tanstack_react_query.UseMutationResult<OrgRole, Error, UpdateOrgRoleParams, unknown>;
|
|
7882
|
+
|
|
7883
|
+
declare function useDeleteOrgRole(): _tanstack_react_query.UseMutationResult<void, Error, string, unknown>;
|
|
7884
|
+
|
|
7885
|
+
declare function useAssignRole(): _tanstack_react_query.UseMutationResult<void, Error, AssignRoleInput, unknown>;
|
|
7886
|
+
declare function useRevokeRole(): _tanstack_react_query.UseMutationResult<void, Error, RevokeRoleInput, unknown>;
|
|
7887
|
+
|
|
7888
|
+
declare function useEffectivePermissions(membershipId: string | undefined): _tanstack_react_query.UseQueryResult<{
|
|
7889
|
+
permissions: string[];
|
|
7890
|
+
}, Error>;
|
|
7891
|
+
|
|
7623
7892
|
declare function useListWebhookEndpoints(): _tanstack_react_query.UseQueryResult<{
|
|
7624
7893
|
id: string;
|
|
7625
7894
|
organizationId: string;
|
|
7626
|
-
|
|
7895
|
+
keyPrefix: string | null;
|
|
7627
7896
|
name: string;
|
|
7628
7897
|
description: string | null;
|
|
7629
7898
|
resourceId: string | null;
|
|
@@ -7632,12 +7901,13 @@ declare function useListWebhookEndpoints(): _tanstack_react_query.UseQueryResult
|
|
|
7632
7901
|
requestCount: number;
|
|
7633
7902
|
createdAt: string;
|
|
7634
7903
|
updatedAt: string;
|
|
7904
|
+
key?: string | undefined;
|
|
7635
7905
|
}[], Error>;
|
|
7636
7906
|
|
|
7637
7907
|
declare function useCreateWebhookEndpoint(): _tanstack_react_query.UseMutationResult<{
|
|
7638
7908
|
id: string;
|
|
7639
7909
|
organizationId: string;
|
|
7640
|
-
|
|
7910
|
+
keyPrefix: string | null;
|
|
7641
7911
|
name: string;
|
|
7642
7912
|
description: string | null;
|
|
7643
7913
|
resourceId: string | null;
|
|
@@ -7646,6 +7916,7 @@ declare function useCreateWebhookEndpoint(): _tanstack_react_query.UseMutationRe
|
|
|
7646
7916
|
requestCount: number;
|
|
7647
7917
|
createdAt: string;
|
|
7648
7918
|
updatedAt: string;
|
|
7919
|
+
key?: string | undefined;
|
|
7649
7920
|
}, Error, {
|
|
7650
7921
|
name: string;
|
|
7651
7922
|
resourceId?: string | undefined;
|
|
@@ -7687,7 +7958,8 @@ type UpdateWebhookEndpointRequest = z.infer<typeof UpdateWebhookEndpointRequestS
|
|
|
7687
7958
|
declare const WebhookEndpointResponseSchema: z.ZodObject<{
|
|
7688
7959
|
id: z.ZodString;
|
|
7689
7960
|
organizationId: z.ZodString;
|
|
7690
|
-
key: z.ZodString
|
|
7961
|
+
key: z.ZodOptional<z.ZodString>;
|
|
7962
|
+
keyPrefix: z.ZodNullable<z.ZodString>;
|
|
7691
7963
|
name: z.ZodString;
|
|
7692
7964
|
description: z.ZodNullable<z.ZodString>;
|
|
7693
7965
|
resourceId: z.ZodNullable<z.ZodString>;
|
|
@@ -7705,7 +7977,7 @@ type WebhookEndpointResponse = z.infer<typeof WebhookEndpointResponseSchema>;
|
|
|
7705
7977
|
declare function useUpdateWebhookEndpoint(): _tanstack_react_query.UseMutationResult<{
|
|
7706
7978
|
id: string;
|
|
7707
7979
|
organizationId: string;
|
|
7708
|
-
|
|
7980
|
+
keyPrefix: string | null;
|
|
7709
7981
|
name: string;
|
|
7710
7982
|
description: string | null;
|
|
7711
7983
|
resourceId: string | null;
|
|
@@ -7714,6 +7986,7 @@ declare function useUpdateWebhookEndpoint(): _tanstack_react_query.UseMutationRe
|
|
|
7714
7986
|
requestCount: number;
|
|
7715
7987
|
createdAt: string;
|
|
7716
7988
|
updatedAt: string;
|
|
7989
|
+
key?: string | undefined;
|
|
7717
7990
|
}, Error, {
|
|
7718
7991
|
endpointId: string;
|
|
7719
7992
|
data: UpdateWebhookEndpointRequest;
|
|
@@ -7790,6 +8063,10 @@ declare function useVisibleResources(): {
|
|
|
7790
8063
|
};
|
|
7791
8064
|
|
|
7792
8065
|
type DomainFilterState = 'neutral' | 'include' | 'exclude';
|
|
8066
|
+
type ResourceFilterFacet = {
|
|
8067
|
+
id: string;
|
|
8068
|
+
label: string;
|
|
8069
|
+
};
|
|
7793
8070
|
interface DomainFiltersStore {
|
|
7794
8071
|
filters: Record<string, DomainFilterState>;
|
|
7795
8072
|
cycle: (domainId: string) => void;
|
|
@@ -7821,6 +8098,9 @@ declare const useCommandViewDomainFilters: zustand.UseBoundStore<Omit<zustand.St
|
|
|
7821
8098
|
getOptions: () => Partial<zustand_middleware.PersistOptions<DomainFiltersStore, DomainFiltersStore, unknown>>;
|
|
7822
8099
|
};
|
|
7823
8100
|
}>;
|
|
8101
|
+
declare function getResourceFilterFacetIds(resource: ResourceDefinition): string[];
|
|
8102
|
+
declare function labelResourceFilterFacet(id: string): string;
|
|
8103
|
+
declare function collectResourceFilterFacets(items: ResourceDefinition[]): ResourceFilterFacet[];
|
|
7824
8104
|
declare function filterByDomainFilters(items: ResourceDefinition[], filters: Record<string, DomainFilterState>): ResourceDefinition[];
|
|
7825
8105
|
|
|
7826
8106
|
/**
|
|
@@ -8275,5 +8555,5 @@ declare function useCreateNote(): _tanstack_react_query.UseMutationResult<{
|
|
|
8275
8555
|
type?: string;
|
|
8276
8556
|
}, "organization_id">, unknown>;
|
|
8277
8557
|
|
|
8278
|
-
export { ApiKeyService, CredentialService, DeploymentService, OperationsService, OrganizationMembershipService, REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, WebhookEndpointService, acquisitionListKeys, companyKeys, contactKeys, createFeatureAccessHook,
|
|
8279
|
-
export type { AcqCompanyWithCount, AcqContactWithCompany, AcqDealNote, AcqDealTask, AcqDealTaskKind, ActivityFilters, ActivityTrendResponse, BulkDeleteExecutionsParams, BulkDeleteExecutionsResult, BusinessImpactMetrics, CancelExecutionParams, CancelExecutionResult, ChatMessage, CreateApiKeyRequest, CreateApiKeyResponse, CreateCredentialRequest, CreateCredentialResponse, CreateScheduleInput, CreateSessionResponse, CredentialListItem, DealDetail, DealLookupFilters, DealLookupItem, DealSummaryStageItem, DealsSummaryResponse, DeleteExecutionParams, Deployment, ErrorDistributionItem, ErrorDistributionParams, ErrorFilters, ErrorTrendsParams, ExecuteAsyncParams, ExecuteAsyncResult, ExecutionErrorDetails, ExecutionHistoryItem, ExecutionHistoryResponse, ExecutionLogsFilters, ExecutionLogsPageResponse, FailingResource, FeatureAccessResult, GetMessagesResponse, ListActivitiesResponse, ListApiKeysResponse, ListCredentialsResponse, ListSchedulesFilters, ListSchedulesResponse, ListWebhookEndpointsResponse, MessageEvent, MessageType, RequestRow, RequestsListFilters, ResourcesResponse, RetryExecutionParams, SessionDTO, SessionExecution, SessionExecutionsResponse, SessionListItem, SessionTokenUsage, SortDirection, SortState, StaleDealSummaryItem, StatusFilter, SubmitActionRequest, SubmitActionResponse, TaskSchedule, TopFailingResourcesParams, UpdateScheduleInput, UseActivitiesParams, UseActivityTrendParams, UseBatchedResourcesHealthParams, UseExecuteResourceOptions, UseExecutionHealthParams, UseExecutionLogsParams, UseExecutionPanelStateOptions, UseExecutionPanelStateReturn, UseNotificationCountArgs, UseResourcesHealthParams, UseSSEConnectionOptions, UseScheduledTasksOptions, WebSocketState };
|
|
8558
|
+
export { ApiKeyService, CredentialService, DeploymentService, OperationsService, OrganizationMembershipService, REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, WebhookEndpointService, acquisitionListKeys, collectResourceFilterFacets, companyKeys, contactKeys, createFeatureAccessHook, dealKeys, dealNoteKeys, dealTaskKeys, executionsKeys, filterByDomainFilters, getResourceFilterFacetIds, isSessionCapable, labelResourceFilterFacet, milestoneKeys, noteKeys, observabilityKeys, operationsKeys, projectActivityKeys, projectKeys, requestsKeys, scheduleKeys, sessionsKeys, sortData, taskKeys, useActivateDeployment, useActivities, useActivitiesRealtime, useActivityFilters, useActivityTrend, useArchiveSession, useArchivedLogs, useAssignRole, useBatchDelete, useBatchTelemetry, useBatchedResourcesHealth, useBulkDeleteExecutions, useBusinessImpact, useCancelExecution, useCancelSchedule, useCheckpointTasks, useCommandQueue, useCommandQueueTotals, useCommandViewData, useCommandViewDomainFilters, useCommandViewLayout, useCommandViewStats, useCommandViewStore, useCompanies, useCompany, useCompanyFacets, useCompleteDealTask, useContact, useContacts, useCostBreakdown, useCostByModel, useCostSummary, useCostTrends, useCreateApiKey, useCreateCompany, useCreateContact, useCreateCredential, useCreateDealNote, useCreateDealTask, useCreateProject as useCreateDeliveryProject, useCreateList, useCreateMilestone, useCreateNote, useCreateOrgRole, useCreateSchedule, useCreateSession, useCreateTask, useCreateWebhookEndpoint, useCredentials, useDashboardMetrics, useDeactivateDeployment, useDeactivateMembership, useDealDetail, useDealNotes, useDealTasks, useDealTasksDue, useDeals, useDealsLookup, useDealsSummary, useDeleteApiKey, useDeleteCompanies, useDeleteContacts, useDeleteCredential, useDeleteDeal, useDeleteProject as useDeleteDeliveryProject, useDeleteTask as useDeleteDeliveryTask, useDeleteDeployment, useDeleteExecution, useDeleteList, useDeleteMilestone, useDeleteOrgRole, useDeleteRequest, useDeleteSchedule, useDeleteSession, useDeleteTask$1 as useDeleteTask, useDeleteWebhookEndpoint, useEffectivePermissions, useErrorAnalysis, useErrorDetail, useErrorDetails, useErrorDistribution, useErrorNotification, useErrorTrends, useExecuteAsync, useExecuteResource, useExecution, useExecutionHealth, useExecutionLogSSE, useExecutionLogs, useExecutionLogsFilters, useExecutionPanelState, useExecutions, useGetExecutionHistory, useGetSchedule, useGraphStats, useHasPermission, useList, useListApiKeys, useListDeployments, useListExecutions, useListProgress, useListSchedules, useListWebhookEndpoints, useLists, useListsTelemetry, useMarkAllAsRead, useMarkAsRead, useMergedExecution, useMilestones, useNotificationCount as useNotificationCountSSE, useNotifications, useOrgRoles, useOrganizationMembers, useOrganizationPermissions, usePaginationState, usePatchTask, usePauseSchedule, usePermissionCatalog, useProject, useProjectActivities, useProjectMilestones, useProjectNotes, useProjectRealtime, useProjectTasks, useProjects, useReactivateMembership, useRecentExecutionsByResource, useRequest, useRequestsList, useResolveAllErrors, useResolveError, useResolveErrorsByExecution, useResourceDefinition, useResourceErrors, useResourceExecutions, useResourceSearch, useResources, useResourcesDomainFilters, useResourcesHealth, useResumeSchedule, useRetryExecution, useRevokeRole, useSSEConnection, useScheduledTasks, useSession, useSessionExecution, useSessionExecutions, useSessionMessages, useSessionWebSocket, useSessions, useSortedData, useStatusFilter, useSubmitAction, useSuccessNotification, useSyncDealStage, useTableSelection, useTableSort, useTasks, useTestNotification, useTimeRangeDates, useTopFailingResources, useUnresolveError, useUnresolvedErrors, useUpdateAnchor, useUpdateApiKey, useUpdateCompany, useUpdateContact, useUpdateCredential, useUpdateProject as useUpdateDeliveryProject, useUpdateList, useUpdateListConfig, useUpdateMemberConfig, useUpdateMilestone, useUpdateOrgRole, useUpdateRequestStatus, useUpdateSchedule, useUpdateTask, useUpdateWebhookEndpoint, useUserMemberships, useVisibleResources, useWarningNotification };
|
|
8559
|
+
export type { AcqCompanyWithCount, AcqContactWithCompany, AcqDealNote, AcqDealTask, AcqDealTaskKind, ActivityFilters, ActivityTrendResponse, AssignRoleInput, BulkDeleteExecutionsParams, BulkDeleteExecutionsResult, BusinessImpactMetrics, CancelExecutionParams, CancelExecutionResult, ChatMessage, CreateApiKeyRequest, CreateApiKeyResponse, CreateCredentialRequest, CreateCredentialResponse, CreateOrgRoleInput, CreateScheduleInput, CreateSessionResponse, CredentialListItem, DealDetail, DealLookupFilters, DealLookupItem, DealSummaryStageItem, DealsSummaryResponse, DeleteExecutionParams, Deployment, ErrorDistributionItem, ErrorDistributionParams, ErrorFilters, ErrorTrendsParams, ExecuteAsyncParams, ExecuteAsyncResult, ExecutionErrorDetails, ExecutionHistoryItem, ExecutionHistoryResponse, ExecutionLogsFilters, ExecutionLogsPageResponse, FailingResource, FeatureAccessResult, GetMessagesResponse, ListActivitiesResponse, ListApiKeysResponse, ListCredentialsResponse, ListSchedulesFilters, ListSchedulesResponse, ListWebhookEndpointsResponse, MessageEvent, MessageType, OrgRole, RequestRow, RequestsListFilters, ResourceFilterFacet, ResourcesResponse, RetryExecutionParams, RevokeRoleInput, SessionDTO, SessionExecution, SessionExecutionsResponse, SessionListItem, SessionTokenUsage, SortDirection, SortState, StaleDealSummaryItem, StatusFilter, SubmitActionRequest, SubmitActionResponse, TaskSchedule, TopFailingResourcesParams, UpdateOrgRoleInput, UpdateScheduleInput, UseActivitiesParams, UseActivityTrendParams, UseBatchedResourcesHealthParams, UseExecuteResourceOptions, UseExecutionHealthParams, UseExecutionLogsParams, UseExecutionPanelStateOptions, UseExecutionPanelStateReturn, UseNotificationCountArgs, UseResourcesHealthParams, UseSSEConnectionOptions, UseScheduledTasksOptions, WebSocketState };
|