@elevasis/ui 1.3.6 → 1.4.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/types/index.d.ts +555 -116
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { z } from 'zod';
|
|
|
4
4
|
* Workflow-specific logging types and utilities
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
interface WorkflowExecutionContext {
|
|
7
|
+
interface WorkflowExecutionContext$1 {
|
|
8
8
|
type: 'workflow';
|
|
9
9
|
contextType: 'workflow-execution';
|
|
10
10
|
executionId: string;
|
|
@@ -13,14 +13,14 @@ interface WorkflowExecutionContext {
|
|
|
13
13
|
organizationId: string;
|
|
14
14
|
executionPath?: string[];
|
|
15
15
|
}
|
|
16
|
-
interface WorkflowFailureContext {
|
|
16
|
+
interface WorkflowFailureContext$1 {
|
|
17
17
|
type: 'workflow';
|
|
18
18
|
contextType: 'workflow-failure';
|
|
19
19
|
executionId: string;
|
|
20
20
|
workflowId: string;
|
|
21
21
|
error: string;
|
|
22
22
|
}
|
|
23
|
-
interface StepStartedContext {
|
|
23
|
+
interface StepStartedContext$1 {
|
|
24
24
|
type: 'workflow';
|
|
25
25
|
contextType: 'step-started';
|
|
26
26
|
stepId: string;
|
|
@@ -28,7 +28,7 @@ interface StepStartedContext {
|
|
|
28
28
|
input: unknown;
|
|
29
29
|
startTime: number;
|
|
30
30
|
}
|
|
31
|
-
interface StepCompletedContext {
|
|
31
|
+
interface StepCompletedContext$1 {
|
|
32
32
|
type: 'workflow';
|
|
33
33
|
contextType: 'step-completed';
|
|
34
34
|
stepId: string;
|
|
@@ -39,7 +39,7 @@ interface StepCompletedContext {
|
|
|
39
39
|
startTime: number;
|
|
40
40
|
endTime: number;
|
|
41
41
|
}
|
|
42
|
-
interface StepFailedContext {
|
|
42
|
+
interface StepFailedContext$1 {
|
|
43
43
|
type: 'workflow';
|
|
44
44
|
contextType: 'step-failed';
|
|
45
45
|
stepId: string;
|
|
@@ -49,19 +49,19 @@ interface StepFailedContext {
|
|
|
49
49
|
startTime: number;
|
|
50
50
|
endTime: number;
|
|
51
51
|
}
|
|
52
|
-
interface ConditionalRouteContext {
|
|
52
|
+
interface ConditionalRouteContext$1 {
|
|
53
53
|
type: 'workflow';
|
|
54
54
|
contextType: 'conditional-route';
|
|
55
55
|
stepId: string;
|
|
56
56
|
target: string;
|
|
57
57
|
error?: string;
|
|
58
58
|
}
|
|
59
|
-
interface ExecutionPathContext {
|
|
59
|
+
interface ExecutionPathContext$1 {
|
|
60
60
|
type: 'workflow';
|
|
61
61
|
contextType: 'execution-path';
|
|
62
62
|
executionPath: string[];
|
|
63
63
|
}
|
|
64
|
-
type WorkflowLogContext = WorkflowExecutionContext | WorkflowFailureContext | StepStartedContext | StepCompletedContext | StepFailedContext | ConditionalRouteContext | ExecutionPathContext;
|
|
64
|
+
type WorkflowLogContext$1 = WorkflowExecutionContext$1 | WorkflowFailureContext$1 | StepStartedContext$1 | StepCompletedContext$1 | StepFailedContext$1 | ConditionalRouteContext$1 | ExecutionPathContext$1;
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* Agent-specific logging types
|
|
@@ -76,26 +76,26 @@ type WorkflowLogContext = WorkflowExecutionContext | WorkflowFailureContext | St
|
|
|
76
76
|
* Agent lifecycle stages
|
|
77
77
|
* Universal checkpoints that apply to all agent executions
|
|
78
78
|
*/
|
|
79
|
-
type AgentLifecycle = 'initialization' | 'iteration' | 'completion';
|
|
79
|
+
type AgentLifecycle$1 = 'initialization' | 'iteration' | 'completion';
|
|
80
80
|
/**
|
|
81
81
|
* Iteration event types
|
|
82
82
|
* Activities that occur during agent iterations
|
|
83
83
|
*/
|
|
84
|
-
type IterationEventType = 'reasoning' | 'action' | 'tool-call';
|
|
84
|
+
type IterationEventType$1 = 'reasoning' | 'action' | 'tool-call';
|
|
85
85
|
/**
|
|
86
86
|
* Base fields shared by all lifecycle events
|
|
87
87
|
*/
|
|
88
|
-
interface AgentLifecycleEventBase {
|
|
88
|
+
interface AgentLifecycleEventBase$1 {
|
|
89
89
|
type: 'agent';
|
|
90
90
|
agentId: string;
|
|
91
|
-
lifecycle: AgentLifecycle;
|
|
91
|
+
lifecycle: AgentLifecycle$1;
|
|
92
92
|
sessionId?: string;
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
95
|
* Lifecycle started event - emitted when a phase begins
|
|
96
96
|
* REQUIRED: startTime (phase has started, no end yet)
|
|
97
97
|
*/
|
|
98
|
-
interface AgentLifecycleStartedEvent extends AgentLifecycleEventBase {
|
|
98
|
+
interface AgentLifecycleStartedEvent$1 extends AgentLifecycleEventBase$1 {
|
|
99
99
|
stage: 'started';
|
|
100
100
|
startTime: number;
|
|
101
101
|
iteration?: number;
|
|
@@ -104,7 +104,7 @@ interface AgentLifecycleStartedEvent extends AgentLifecycleEventBase {
|
|
|
104
104
|
* Lifecycle completed event - emitted when a phase succeeds
|
|
105
105
|
* REQUIRED: startTime, endTime, duration (phase has finished successfully)
|
|
106
106
|
*/
|
|
107
|
-
interface AgentLifecycleCompletedEvent extends AgentLifecycleEventBase {
|
|
107
|
+
interface AgentLifecycleCompletedEvent$1 extends AgentLifecycleEventBase$1 {
|
|
108
108
|
stage: 'completed';
|
|
109
109
|
startTime: number;
|
|
110
110
|
endTime: number;
|
|
@@ -120,7 +120,7 @@ interface AgentLifecycleCompletedEvent extends AgentLifecycleEventBase {
|
|
|
120
120
|
* Lifecycle failed event - emitted when a phase fails
|
|
121
121
|
* REQUIRED: startTime, endTime, duration, error (phase has finished with error)
|
|
122
122
|
*/
|
|
123
|
-
interface AgentLifecycleFailedEvent extends AgentLifecycleEventBase {
|
|
123
|
+
interface AgentLifecycleFailedEvent$1 extends AgentLifecycleEventBase$1 {
|
|
124
124
|
stage: 'failed';
|
|
125
125
|
startTime: number;
|
|
126
126
|
endTime: number;
|
|
@@ -132,23 +132,23 @@ interface AgentLifecycleFailedEvent extends AgentLifecycleEventBase {
|
|
|
132
132
|
* Union type for all lifecycle events
|
|
133
133
|
* Discriminated by 'stage' field for type narrowing
|
|
134
134
|
*/
|
|
135
|
-
type AgentLifecycleEvent = AgentLifecycleStartedEvent | AgentLifecycleCompletedEvent | AgentLifecycleFailedEvent;
|
|
135
|
+
type AgentLifecycleEvent$1 = AgentLifecycleStartedEvent$1 | AgentLifecycleCompletedEvent$1 | AgentLifecycleFailedEvent$1;
|
|
136
136
|
/**
|
|
137
137
|
* Placeholder data for MVP
|
|
138
138
|
* Will be typed per actionType in future
|
|
139
139
|
*/
|
|
140
|
-
interface ActionPlaceholderData {
|
|
140
|
+
interface ActionPlaceholderData$1 {
|
|
141
141
|
message: string;
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
144
|
* Iteration event - captures activities during agent iterations
|
|
145
145
|
* Consolidates reasoning (LLM thought process) and actions (tool use, memory ops, etc.)
|
|
146
146
|
*/
|
|
147
|
-
interface AgentIterationEvent {
|
|
147
|
+
interface AgentIterationEvent$1 {
|
|
148
148
|
type: 'agent';
|
|
149
149
|
agentId: string;
|
|
150
150
|
lifecycle: 'iteration';
|
|
151
|
-
eventType: IterationEventType;
|
|
151
|
+
eventType: IterationEventType$1;
|
|
152
152
|
iteration: number;
|
|
153
153
|
sessionId?: string;
|
|
154
154
|
startTime: number;
|
|
@@ -156,13 +156,13 @@ interface AgentIterationEvent {
|
|
|
156
156
|
duration: number;
|
|
157
157
|
output?: string;
|
|
158
158
|
actionType?: string;
|
|
159
|
-
data?: ActionPlaceholderData;
|
|
159
|
+
data?: ActionPlaceholderData$1;
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
162
|
* Tool call event - captures individual tool executions during iterations
|
|
163
163
|
* Provides granular timing for each tool invocation
|
|
164
164
|
*/
|
|
165
|
-
interface AgentToolCallEvent {
|
|
165
|
+
interface AgentToolCallEvent$1 {
|
|
166
166
|
type: 'agent';
|
|
167
167
|
agentId: string;
|
|
168
168
|
lifecycle: 'iteration';
|
|
@@ -182,19 +182,19 @@ interface AgentToolCallEvent {
|
|
|
182
182
|
* Union type for all agent log contexts
|
|
183
183
|
* 3 event types total (lifecycle, iteration, tool-call)
|
|
184
184
|
*/
|
|
185
|
-
type AgentLogContext = AgentLifecycleEvent | AgentIterationEvent | AgentToolCallEvent;
|
|
185
|
+
type AgentLogContext$1 = AgentLifecycleEvent$1 | AgentIterationEvent$1 | AgentToolCallEvent$1;
|
|
186
186
|
|
|
187
187
|
/**
|
|
188
188
|
* Base execution logger for Execution Engine
|
|
189
189
|
*/
|
|
190
|
-
type ExecutionLogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
190
|
+
type ExecutionLogLevel$1 = 'debug' | 'info' | 'warn' | 'error';
|
|
191
191
|
|
|
192
|
-
type LogContext = WorkflowLogContext | AgentLogContext;
|
|
193
|
-
interface ExecutionLogMessage {
|
|
194
|
-
level: ExecutionLogLevel;
|
|
192
|
+
type LogContext$1 = WorkflowLogContext$1 | AgentLogContext$1;
|
|
193
|
+
interface ExecutionLogMessage$1 {
|
|
194
|
+
level: ExecutionLogLevel$1;
|
|
195
195
|
message: string;
|
|
196
196
|
timestamp: number;
|
|
197
|
-
context?: LogContext;
|
|
197
|
+
context?: LogContext$1;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
/**
|
|
@@ -2483,6 +2483,9 @@ type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables
|
|
|
2483
2483
|
} ? R : never : never;
|
|
2484
2484
|
|
|
2485
2485
|
type SupabaseUserProfile = Tables<'users'>;
|
|
2486
|
+
type SupabaseApiKey = Tables<'api_keys'>;
|
|
2487
|
+
/** API response type for API key list items (omits sensitive key_hash) */
|
|
2488
|
+
type ApiKeyListItem = Omit<SupabaseApiKey, 'key_hash'>;
|
|
2486
2489
|
|
|
2487
2490
|
/**
|
|
2488
2491
|
* Origin resource type - where an execution/task originated from.
|
|
@@ -2825,16 +2828,16 @@ declare const DOMAINS: {
|
|
|
2825
2828
|
*/
|
|
2826
2829
|
type ResourceDomain = (typeof DOMAINS)[keyof typeof DOMAINS];
|
|
2827
2830
|
|
|
2828
|
-
type ExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'warning';
|
|
2831
|
+
type ExecutionStatus$1 = 'pending' | 'running' | 'completed' | 'failed' | 'warning';
|
|
2829
2832
|
interface APIExecutionSummary {
|
|
2830
2833
|
id: string;
|
|
2831
|
-
status: ExecutionStatus;
|
|
2834
|
+
status: ExecutionStatus$1;
|
|
2832
2835
|
startTime: number;
|
|
2833
2836
|
endTime?: number;
|
|
2834
2837
|
resourceStatus?: ResourceStatus;
|
|
2835
2838
|
}
|
|
2836
2839
|
interface APIExecutionDetail extends APIExecutionSummary {
|
|
2837
|
-
executionLogs: ExecutionLogMessage[];
|
|
2840
|
+
executionLogs: ExecutionLogMessage$1[];
|
|
2838
2841
|
input?: unknown;
|
|
2839
2842
|
result?: unknown;
|
|
2840
2843
|
error?: string;
|
|
@@ -2847,6 +2850,290 @@ interface APIExecutionListResponse {
|
|
|
2847
2850
|
executions: APIExecutionSummary[];
|
|
2848
2851
|
}
|
|
2849
2852
|
|
|
2853
|
+
/**
|
|
2854
|
+
* Deployment types — browser-safe
|
|
2855
|
+
*
|
|
2856
|
+
* Canonical API response types for the deployment resource.
|
|
2857
|
+
* The API's transformRow converts snake_case DB columns to these camelCase fields.
|
|
2858
|
+
*/
|
|
2859
|
+
type DeploymentStatus = 'deploying' | 'active' | 'failed' | 'rolled_back' | 'stopped';
|
|
2860
|
+
interface Deployment {
|
|
2861
|
+
id: string;
|
|
2862
|
+
organizationId: string;
|
|
2863
|
+
status: DeploymentStatus;
|
|
2864
|
+
sdkVersion: string;
|
|
2865
|
+
deploymentVersion: string | null;
|
|
2866
|
+
port: number | null;
|
|
2867
|
+
pid: number | null;
|
|
2868
|
+
tarballPath: string | null;
|
|
2869
|
+
errorMessage: string | null;
|
|
2870
|
+
createdAt: string;
|
|
2871
|
+
updatedAt: string;
|
|
2872
|
+
}
|
|
2873
|
+
|
|
2874
|
+
/**
|
|
2875
|
+
* Workflow-specific logging types and utilities
|
|
2876
|
+
*/
|
|
2877
|
+
|
|
2878
|
+
|
|
2879
|
+
|
|
2880
|
+
// Workflow start/end log context
|
|
2881
|
+
interface WorkflowExecutionContext {
|
|
2882
|
+
type: 'workflow'
|
|
2883
|
+
contextType: 'workflow-execution'
|
|
2884
|
+
executionId: string
|
|
2885
|
+
workflowId: string
|
|
2886
|
+
workflowName?: string
|
|
2887
|
+
organizationId: string
|
|
2888
|
+
executionPath?: string[]
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2891
|
+
// Workflow failure log context
|
|
2892
|
+
interface WorkflowFailureContext {
|
|
2893
|
+
type: 'workflow'
|
|
2894
|
+
contextType: 'workflow-failure'
|
|
2895
|
+
executionId: string
|
|
2896
|
+
workflowId: string
|
|
2897
|
+
error: string
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2900
|
+
// Step started log context
|
|
2901
|
+
interface StepStartedContext {
|
|
2902
|
+
type: 'workflow'
|
|
2903
|
+
contextType: 'step-started'
|
|
2904
|
+
stepId: string
|
|
2905
|
+
stepStatus: 'started'
|
|
2906
|
+
input: unknown
|
|
2907
|
+
startTime: number // Explicit start timestamp for timeline
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2910
|
+
// Step completed log context
|
|
2911
|
+
interface StepCompletedContext {
|
|
2912
|
+
type: 'workflow'
|
|
2913
|
+
contextType: 'step-completed'
|
|
2914
|
+
stepId: string
|
|
2915
|
+
stepStatus: 'completed'
|
|
2916
|
+
output: unknown
|
|
2917
|
+
duration: number
|
|
2918
|
+
isTerminal: boolean
|
|
2919
|
+
startTime: number // Explicit start timestamp for timeline
|
|
2920
|
+
endTime: number // Explicit end timestamp for timeline
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
// Step failed log context
|
|
2924
|
+
interface StepFailedContext {
|
|
2925
|
+
type: 'workflow'
|
|
2926
|
+
contextType: 'step-failed'
|
|
2927
|
+
stepId: string
|
|
2928
|
+
stepStatus: 'failed'
|
|
2929
|
+
error: string
|
|
2930
|
+
duration: number
|
|
2931
|
+
startTime: number // Explicit start timestamp for timeline
|
|
2932
|
+
endTime: number // Explicit end timestamp for timeline
|
|
2933
|
+
}
|
|
2934
|
+
|
|
2935
|
+
// Conditional routing log context
|
|
2936
|
+
interface ConditionalRouteContext {
|
|
2937
|
+
type: 'workflow'
|
|
2938
|
+
contextType: 'conditional-route'
|
|
2939
|
+
stepId: string
|
|
2940
|
+
target: string
|
|
2941
|
+
error?: string
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
// Execution path log context
|
|
2945
|
+
interface ExecutionPathContext {
|
|
2946
|
+
type: 'workflow'
|
|
2947
|
+
contextType: 'execution-path'
|
|
2948
|
+
executionPath: string[]
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
// Union of all workflow log contexts
|
|
2952
|
+
type WorkflowLogContext =
|
|
2953
|
+
| WorkflowExecutionContext
|
|
2954
|
+
| WorkflowFailureContext
|
|
2955
|
+
| StepStartedContext
|
|
2956
|
+
| StepCompletedContext
|
|
2957
|
+
| StepFailedContext
|
|
2958
|
+
| ConditionalRouteContext
|
|
2959
|
+
| ExecutionPathContext
|
|
2960
|
+
|
|
2961
|
+
/**
|
|
2962
|
+
* Agent-specific logging types
|
|
2963
|
+
* Simplified 2-event model: lifecycle, iteration
|
|
2964
|
+
*
|
|
2965
|
+
* Design Philosophy:
|
|
2966
|
+
* - LIFECYCLE EVENTS: Structural checkpoints (initialization, iteration, completion)
|
|
2967
|
+
* - ITERATION EVENTS: Execution activities (reasoning, actions during iterations)
|
|
2968
|
+
*/
|
|
2969
|
+
|
|
2970
|
+
|
|
2971
|
+
|
|
2972
|
+
// ============================================================================
|
|
2973
|
+
// FORMAL TYPES
|
|
2974
|
+
// ============================================================================
|
|
2975
|
+
|
|
2976
|
+
/**
|
|
2977
|
+
* Agent lifecycle stages
|
|
2978
|
+
* Universal checkpoints that apply to all agent executions
|
|
2979
|
+
*/
|
|
2980
|
+
type AgentLifecycle = 'initialization' | 'iteration' | 'completion'
|
|
2981
|
+
|
|
2982
|
+
/**
|
|
2983
|
+
* Iteration event types
|
|
2984
|
+
* Activities that occur during agent iterations
|
|
2985
|
+
*/
|
|
2986
|
+
type IterationEventType = 'reasoning' | 'action' | 'tool-call'
|
|
2987
|
+
|
|
2988
|
+
// ============================================================================
|
|
2989
|
+
// LIFECYCLE EVENTS (Structural Checkpoints)
|
|
2990
|
+
// ============================================================================
|
|
2991
|
+
|
|
2992
|
+
/**
|
|
2993
|
+
* Base fields shared by all lifecycle events
|
|
2994
|
+
*/
|
|
2995
|
+
interface AgentLifecycleEventBase {
|
|
2996
|
+
type: 'agent'
|
|
2997
|
+
agentId: string
|
|
2998
|
+
lifecycle: AgentLifecycle
|
|
2999
|
+
sessionId?: string // Optional: only present when agent runs in session context
|
|
3000
|
+
}
|
|
3001
|
+
|
|
3002
|
+
/**
|
|
3003
|
+
* Lifecycle started event - emitted when a phase begins
|
|
3004
|
+
* REQUIRED: startTime (phase has started, no end yet)
|
|
3005
|
+
*/
|
|
3006
|
+
interface AgentLifecycleStartedEvent extends AgentLifecycleEventBase {
|
|
3007
|
+
stage: 'started'
|
|
3008
|
+
startTime: number // REQUIRED: Phase start timestamp
|
|
3009
|
+
iteration?: number // Only for 'iteration' lifecycle
|
|
3010
|
+
}
|
|
3011
|
+
|
|
3012
|
+
/**
|
|
3013
|
+
* Lifecycle completed event - emitted when a phase succeeds
|
|
3014
|
+
* REQUIRED: startTime, endTime, duration (phase has finished successfully)
|
|
3015
|
+
*/
|
|
3016
|
+
interface AgentLifecycleCompletedEvent extends AgentLifecycleEventBase {
|
|
3017
|
+
stage: 'completed'
|
|
3018
|
+
startTime: number // REQUIRED: Phase start timestamp
|
|
3019
|
+
endTime: number // REQUIRED: Phase end timestamp
|
|
3020
|
+
duration: number // REQUIRED: Calculated duration (endTime - startTime)
|
|
3021
|
+
iteration?: number // Only for 'iteration' lifecycle
|
|
3022
|
+
|
|
3023
|
+
// Optional fields specific to certain lifecycles
|
|
3024
|
+
attempts?: number // Only for 'completion' lifecycle (tracks output generation attempts: 1 or 2)
|
|
3025
|
+
memorySize?: {
|
|
3026
|
+
sessionMemoryKeys: number
|
|
3027
|
+
historyEntries: number
|
|
3028
|
+
} // Only for 'completion' lifecycle (memory snapshot metadata)
|
|
3029
|
+
}
|
|
3030
|
+
|
|
3031
|
+
/**
|
|
3032
|
+
* Lifecycle failed event - emitted when a phase fails
|
|
3033
|
+
* REQUIRED: startTime, endTime, duration, error (phase has finished with error)
|
|
3034
|
+
*/
|
|
3035
|
+
interface AgentLifecycleFailedEvent extends AgentLifecycleEventBase {
|
|
3036
|
+
stage: 'failed'
|
|
3037
|
+
startTime: number // REQUIRED: Phase start timestamp
|
|
3038
|
+
endTime: number // REQUIRED: Phase end timestamp
|
|
3039
|
+
duration: number // REQUIRED: Calculated duration (endTime - startTime)
|
|
3040
|
+
error: string // REQUIRED: Error message
|
|
3041
|
+
iteration?: number // Only for 'iteration' lifecycle
|
|
3042
|
+
}
|
|
3043
|
+
|
|
3044
|
+
/**
|
|
3045
|
+
* Union type for all lifecycle events
|
|
3046
|
+
* Discriminated by 'stage' field for type narrowing
|
|
3047
|
+
*/
|
|
3048
|
+
type AgentLifecycleEvent = AgentLifecycleStartedEvent | AgentLifecycleCompletedEvent | AgentLifecycleFailedEvent
|
|
3049
|
+
|
|
3050
|
+
// ============================================================================
|
|
3051
|
+
// ITERATION EVENTS (Execution Activities)
|
|
3052
|
+
// ============================================================================
|
|
3053
|
+
|
|
3054
|
+
/**
|
|
3055
|
+
* Placeholder data for MVP
|
|
3056
|
+
* Will be typed per actionType in future
|
|
3057
|
+
*/
|
|
3058
|
+
interface ActionPlaceholderData {
|
|
3059
|
+
message: string
|
|
3060
|
+
}
|
|
3061
|
+
|
|
3062
|
+
/**
|
|
3063
|
+
* Iteration event - captures activities during agent iterations
|
|
3064
|
+
* Consolidates reasoning (LLM thought process) and actions (tool use, memory ops, etc.)
|
|
3065
|
+
*/
|
|
3066
|
+
interface AgentIterationEvent {
|
|
3067
|
+
type: 'agent'
|
|
3068
|
+
agentId: string
|
|
3069
|
+
lifecycle: 'iteration' // Always iteration
|
|
3070
|
+
eventType: IterationEventType
|
|
3071
|
+
iteration: number
|
|
3072
|
+
sessionId?: string // Optional: only present when agent runs in session context
|
|
3073
|
+
|
|
3074
|
+
// Timeline timing fields (v2 - Clean Break)
|
|
3075
|
+
startTime: number // Activity start timestamp
|
|
3076
|
+
endTime: number // Activity end timestamp
|
|
3077
|
+
duration: number // Calculated duration (endTime - startTime)
|
|
3078
|
+
|
|
3079
|
+
// Conditional fields based on eventType
|
|
3080
|
+
output?: string // For reasoning events
|
|
3081
|
+
actionType?: string // For action events (tool-use, delegate, memory-write, etc.)
|
|
3082
|
+
data?: ActionPlaceholderData // For action events
|
|
3083
|
+
}
|
|
3084
|
+
|
|
3085
|
+
/**
|
|
3086
|
+
* Tool call event - captures individual tool executions during iterations
|
|
3087
|
+
* Provides granular timing for each tool invocation
|
|
3088
|
+
*/
|
|
3089
|
+
interface AgentToolCallEvent {
|
|
3090
|
+
type: 'agent'
|
|
3091
|
+
agentId: string
|
|
3092
|
+
lifecycle: 'iteration' // Always iteration
|
|
3093
|
+
eventType: 'tool-call' // Specific event type for tool calls
|
|
3094
|
+
iteration: number
|
|
3095
|
+
sessionId?: string // Optional: only present when agent runs in session context
|
|
3096
|
+
|
|
3097
|
+
// Tool identification and timing
|
|
3098
|
+
toolName: string // Tool identifier
|
|
3099
|
+
startTime: number // Tool call start timestamp
|
|
3100
|
+
endTime: number // Tool call end timestamp
|
|
3101
|
+
duration: number // Calculated duration
|
|
3102
|
+
|
|
3103
|
+
// Execution results
|
|
3104
|
+
success: boolean // Whether tool execution succeeded
|
|
3105
|
+
error?: string // Error message if failed
|
|
3106
|
+
input?: Record<string, unknown> // Tool input parameters
|
|
3107
|
+
output?: unknown // Tool output result
|
|
3108
|
+
}
|
|
3109
|
+
|
|
3110
|
+
// ============================================================================
|
|
3111
|
+
// UNION TYPES
|
|
3112
|
+
// ============================================================================
|
|
3113
|
+
|
|
3114
|
+
/**
|
|
3115
|
+
* Union type for all agent log contexts
|
|
3116
|
+
* 3 event types total (lifecycle, iteration, tool-call)
|
|
3117
|
+
*/
|
|
3118
|
+
type AgentLogContext = AgentLifecycleEvent | AgentIterationEvent | AgentToolCallEvent
|
|
3119
|
+
|
|
3120
|
+
/**
|
|
3121
|
+
* Base execution logger for Execution Engine
|
|
3122
|
+
*/
|
|
3123
|
+
type ExecutionLogLevel = 'debug' | 'info' | 'warn' | 'error'
|
|
3124
|
+
|
|
3125
|
+
|
|
3126
|
+
// Union type for all contexts
|
|
3127
|
+
type LogContext = WorkflowLogContext | AgentLogContext
|
|
3128
|
+
|
|
3129
|
+
// Updated interface with consolidated context
|
|
3130
|
+
interface ExecutionLogMessage {
|
|
3131
|
+
level: ExecutionLogLevel
|
|
3132
|
+
message: string
|
|
3133
|
+
timestamp: number
|
|
3134
|
+
context?: LogContext
|
|
3135
|
+
}
|
|
3136
|
+
|
|
2850
3137
|
/**
|
|
2851
3138
|
* Shared form field types for dynamic form generation
|
|
2852
3139
|
* Used by: Command Queue, Execution Runner UI, future form-based features
|
|
@@ -2918,97 +3205,12 @@ interface FormSchema {
|
|
|
2918
3205
|
fields: FormField[]
|
|
2919
3206
|
}
|
|
2920
3207
|
|
|
2921
|
-
/**
|
|
2922
|
-
* Action configuration for HITL tasks
|
|
2923
|
-
* Defines available user actions and their behavior
|
|
2924
|
-
*/
|
|
2925
|
-
interface ActionConfig {
|
|
2926
|
-
/** Unique action identifier (e.g., 'approve', 'retry', 'escalate') */
|
|
2927
|
-
id: string
|
|
2928
|
-
|
|
2929
|
-
/** Display label for UI button */
|
|
2930
|
-
label: string
|
|
2931
|
-
|
|
2932
|
-
/** Button variant/style */
|
|
2933
|
-
type: 'primary' | 'secondary' | 'danger' | 'outline'
|
|
2934
|
-
|
|
2935
|
-
/** Tabler icon name (e.g., 'IconCheck', 'IconRefresh') */
|
|
2936
|
-
icon?: string
|
|
2937
|
-
|
|
2938
|
-
/** Button color (Mantine theme colors) */
|
|
2939
|
-
color?: string
|
|
2940
|
-
|
|
2941
|
-
/** Button variant (Mantine button variant, e.g., 'light', 'filled', 'outline') */
|
|
2942
|
-
variant?: string
|
|
2943
|
-
|
|
2944
|
-
/** Execution target (agent/workflow to invoke) */
|
|
2945
|
-
target?: {
|
|
2946
|
-
resourceType: 'agent' | 'workflow'
|
|
2947
|
-
resourceId: string
|
|
2948
|
-
/**
|
|
2949
|
-
* Optional session ID for agent continuation.
|
|
2950
|
-
* If provided, invokes a new turn on the existing session instead of standalone execution.
|
|
2951
|
-
* Only valid when resourceType is 'agent'.
|
|
2952
|
-
*/
|
|
2953
|
-
sessionId?: string
|
|
2954
|
-
}
|
|
2955
|
-
|
|
2956
|
-
/** Form schema for collecting action-specific data */
|
|
2957
|
-
form?: FormSchema
|
|
2958
|
-
|
|
2959
|
-
/** Payload template for pre-filling forms */
|
|
2960
|
-
payloadTemplate?: unknown
|
|
2961
|
-
|
|
2962
|
-
/** Requires confirmation dialog */
|
|
2963
|
-
requiresConfirmation?: boolean
|
|
2964
|
-
|
|
2965
|
-
/** Confirmation message */
|
|
2966
|
-
confirmationMessage?: string
|
|
2967
|
-
|
|
2968
|
-
/** Help text / tooltip */
|
|
2969
|
-
description?: string
|
|
2970
|
-
}
|
|
2971
|
-
|
|
2972
|
-
/**
|
|
2973
|
-
* Origin resource type - where an execution/task originated from.
|
|
2974
|
-
* Used for audit trails and tracking execution lineage.
|
|
2975
|
-
*/
|
|
2976
|
-
type OriginResourceType = 'agent' | 'workflow' | 'scheduler' | 'api'
|
|
2977
|
-
|
|
2978
|
-
/**
|
|
2979
|
-
* Origin tracking metadata - who/what created this execution/task.
|
|
2980
|
-
* Used by both TaskScheduler and CommandQueue for complete audit trails.
|
|
2981
|
-
*/
|
|
2982
|
-
interface OriginTracking {
|
|
2983
|
-
originExecutionId: string
|
|
2984
|
-
originResourceType: OriginResourceType
|
|
2985
|
-
originResourceId: string
|
|
2986
|
-
}
|
|
2987
|
-
|
|
2988
3208
|
/**
|
|
2989
3209
|
* Error categories for observability grouping and classification.
|
|
2990
3210
|
* Used to categorize errors in the execution_errors table metadata.
|
|
2991
3211
|
*/
|
|
2992
3212
|
type ExecutionErrorCategory = 'llm' | 'tool' | 'workflow' | 'agent' | 'validation' | 'system'
|
|
2993
3213
|
|
|
2994
|
-
/**
|
|
2995
|
-
* Wire-format DTO for notification API responses.
|
|
2996
|
-
* Dates are ISO 8601 strings (not Date objects like the domain Notification type).
|
|
2997
|
-
* Used by frontend hooks that consume /api/notifications.
|
|
2998
|
-
*/
|
|
2999
|
-
interface NotificationDTO {
|
|
3000
|
-
id: string
|
|
3001
|
-
userId: string
|
|
3002
|
-
organizationId: string
|
|
3003
|
-
category: string
|
|
3004
|
-
title: string
|
|
3005
|
-
message: string
|
|
3006
|
-
actionUrl: string | null
|
|
3007
|
-
read: boolean
|
|
3008
|
-
readAt: string | null
|
|
3009
|
-
createdAt: string
|
|
3010
|
-
}
|
|
3011
|
-
|
|
3012
3214
|
// ============================================================================
|
|
3013
3215
|
// API Request/Response Types (Dashboard Observability)
|
|
3014
3216
|
// ============================================================================
|
|
@@ -3225,6 +3427,73 @@ interface CostByModelResponse {
|
|
|
3225
3427
|
totalCallCount: number
|
|
3226
3428
|
}
|
|
3227
3429
|
|
|
3430
|
+
/**
|
|
3431
|
+
* Action configuration for HITL tasks
|
|
3432
|
+
* Defines available user actions and their behavior
|
|
3433
|
+
*/
|
|
3434
|
+
interface ActionConfig {
|
|
3435
|
+
/** Unique action identifier (e.g., 'approve', 'retry', 'escalate') */
|
|
3436
|
+
id: string
|
|
3437
|
+
|
|
3438
|
+
/** Display label for UI button */
|
|
3439
|
+
label: string
|
|
3440
|
+
|
|
3441
|
+
/** Button variant/style */
|
|
3442
|
+
type: 'primary' | 'secondary' | 'danger' | 'outline'
|
|
3443
|
+
|
|
3444
|
+
/** Tabler icon name (e.g., 'IconCheck', 'IconRefresh') */
|
|
3445
|
+
icon?: string
|
|
3446
|
+
|
|
3447
|
+
/** Button color (Mantine theme colors) */
|
|
3448
|
+
color?: string
|
|
3449
|
+
|
|
3450
|
+
/** Button variant (Mantine button variant, e.g., 'light', 'filled', 'outline') */
|
|
3451
|
+
variant?: string
|
|
3452
|
+
|
|
3453
|
+
/** Execution target (agent/workflow to invoke) */
|
|
3454
|
+
target?: {
|
|
3455
|
+
resourceType: 'agent' | 'workflow'
|
|
3456
|
+
resourceId: string
|
|
3457
|
+
/**
|
|
3458
|
+
* Optional session ID for agent continuation.
|
|
3459
|
+
* If provided, invokes a new turn on the existing session instead of standalone execution.
|
|
3460
|
+
* Only valid when resourceType is 'agent'.
|
|
3461
|
+
*/
|
|
3462
|
+
sessionId?: string
|
|
3463
|
+
}
|
|
3464
|
+
|
|
3465
|
+
/** Form schema for collecting action-specific data */
|
|
3466
|
+
form?: FormSchema
|
|
3467
|
+
|
|
3468
|
+
/** Payload template for pre-filling forms */
|
|
3469
|
+
payloadTemplate?: unknown
|
|
3470
|
+
|
|
3471
|
+
/** Requires confirmation dialog */
|
|
3472
|
+
requiresConfirmation?: boolean
|
|
3473
|
+
|
|
3474
|
+
/** Confirmation message */
|
|
3475
|
+
confirmationMessage?: string
|
|
3476
|
+
|
|
3477
|
+
/** Help text / tooltip */
|
|
3478
|
+
description?: string
|
|
3479
|
+
}
|
|
3480
|
+
|
|
3481
|
+
/**
|
|
3482
|
+
* Origin resource type - where an execution/task originated from.
|
|
3483
|
+
* Used for audit trails and tracking execution lineage.
|
|
3484
|
+
*/
|
|
3485
|
+
type OriginResourceType = 'agent' | 'workflow' | 'scheduler' | 'api'
|
|
3486
|
+
|
|
3487
|
+
/**
|
|
3488
|
+
* Origin tracking metadata - who/what created this execution/task.
|
|
3489
|
+
* Used by both TaskScheduler and CommandQueue for complete audit trails.
|
|
3490
|
+
*/
|
|
3491
|
+
interface OriginTracking {
|
|
3492
|
+
originExecutionId: string
|
|
3493
|
+
originResourceType: OriginResourceType
|
|
3494
|
+
originResourceId: string
|
|
3495
|
+
}
|
|
3496
|
+
|
|
3228
3497
|
/**
|
|
3229
3498
|
* Command queue task with flexible action system
|
|
3230
3499
|
*/
|
|
@@ -3342,6 +3611,64 @@ interface CheckpointListResponse {
|
|
|
3342
3611
|
priorityCounts: PriorityCounts
|
|
3343
3612
|
}
|
|
3344
3613
|
|
|
3614
|
+
/**
|
|
3615
|
+
* Wire-format DTO for notification API responses.
|
|
3616
|
+
* Dates are ISO 8601 strings (not Date objects like the domain Notification type).
|
|
3617
|
+
* Used by frontend hooks that consume /api/notifications.
|
|
3618
|
+
*/
|
|
3619
|
+
interface NotificationDTO {
|
|
3620
|
+
id: string
|
|
3621
|
+
userId: string
|
|
3622
|
+
organizationId: string
|
|
3623
|
+
category: string
|
|
3624
|
+
title: string
|
|
3625
|
+
message: string
|
|
3626
|
+
actionUrl: string | null
|
|
3627
|
+
read: boolean
|
|
3628
|
+
readAt: string | null
|
|
3629
|
+
createdAt: string
|
|
3630
|
+
}
|
|
3631
|
+
|
|
3632
|
+
// Execution status type shared between API and UI
|
|
3633
|
+
type ExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'warning'
|
|
3634
|
+
|
|
3635
|
+
/**
|
|
3636
|
+
* Execution Runner Types
|
|
3637
|
+
*
|
|
3638
|
+
* Shared types for the Execution Runner UI feature.
|
|
3639
|
+
* Used by both API (apps/api) and frontend (apps/command-center).
|
|
3640
|
+
*/
|
|
3641
|
+
|
|
3642
|
+
|
|
3643
|
+
|
|
3644
|
+
// ============================================================================
|
|
3645
|
+
// EXECUTION METRICS
|
|
3646
|
+
// ============================================================================
|
|
3647
|
+
|
|
3648
|
+
interface ExecutionMetrics {
|
|
3649
|
+
tokenCount?: number
|
|
3650
|
+
stepCount?: number
|
|
3651
|
+
toolCallCount?: number
|
|
3652
|
+
}
|
|
3653
|
+
|
|
3654
|
+
// ============================================================================
|
|
3655
|
+
// EXECUTION HISTORY TYPES
|
|
3656
|
+
// ============================================================================
|
|
3657
|
+
|
|
3658
|
+
interface ExecutionSummary {
|
|
3659
|
+
id: string
|
|
3660
|
+
resourceId: string
|
|
3661
|
+
resourceName: string
|
|
3662
|
+
status: ExecutionStatus
|
|
3663
|
+
startedAt: string
|
|
3664
|
+
completedAt?: string
|
|
3665
|
+
durationMs?: number
|
|
3666
|
+
metrics?: ExecutionMetrics
|
|
3667
|
+
input?: unknown
|
|
3668
|
+
output?: unknown
|
|
3669
|
+
error?: { message: string }
|
|
3670
|
+
}
|
|
3671
|
+
|
|
3345
3672
|
/**
|
|
3346
3673
|
* Execution history item.
|
|
3347
3674
|
* Represents a single execution triggered by a schedule.
|
|
@@ -3400,4 +3727,116 @@ interface Activity {
|
|
|
3400
3727
|
createdAt: Date
|
|
3401
3728
|
}
|
|
3402
3729
|
|
|
3403
|
-
|
|
3730
|
+
/**
|
|
3731
|
+
* Webhook Endpoint Domain Types
|
|
3732
|
+
*
|
|
3733
|
+
* Browser-safe domain types for generic inbound webhook endpoints.
|
|
3734
|
+
* These are camelCase representations of the `webhook_endpoints` DB table.
|
|
3735
|
+
*
|
|
3736
|
+
* Transform from snake_case DB rows happens in the API service layer,
|
|
3737
|
+
* not here (per core-package.md conventions).
|
|
3738
|
+
*/
|
|
3739
|
+
|
|
3740
|
+
/**
|
|
3741
|
+
* Lifecycle status of a webhook endpoint.
|
|
3742
|
+
* - `active`: Endpoint accepts inbound requests and triggers the target workflow
|
|
3743
|
+
* - `paused`: Endpoint exists but rejects inbound requests with 404
|
|
3744
|
+
*/
|
|
3745
|
+
type WebhookEndpointStatus = 'active' | 'paused'
|
|
3746
|
+
|
|
3747
|
+
/**
|
|
3748
|
+
* Generic inbound webhook endpoint domain type.
|
|
3749
|
+
*
|
|
3750
|
+
* Each endpoint gets a unique opaque URL (`/api/webhooks/inbound/:key`)
|
|
3751
|
+
* that maps to a target workflow resource within an organization.
|
|
3752
|
+
*/
|
|
3753
|
+
interface WebhookEndpoint {
|
|
3754
|
+
/** UUID primary key */
|
|
3755
|
+
id: string
|
|
3756
|
+
/** Organization this endpoint belongs to */
|
|
3757
|
+
organizationId: string
|
|
3758
|
+
/**
|
|
3759
|
+
* Unique opaque key used in the inbound URL.
|
|
3760
|
+
* Format: `wh_` + 32 crypto-random hex chars (128 bits of entropy).
|
|
3761
|
+
* This key IS the credential — it must be kept secret.
|
|
3762
|
+
*/
|
|
3763
|
+
key: string
|
|
3764
|
+
/** User-facing label (e.g., "Zapier → Lead Intake") */
|
|
3765
|
+
name: string
|
|
3766
|
+
/** Optional description for the endpoint */
|
|
3767
|
+
description: string | null
|
|
3768
|
+
/** Target workflow resourceId to invoke on inbound request, or null if not yet assigned */
|
|
3769
|
+
resourceId: string | null
|
|
3770
|
+
/** Whether the endpoint is accepting requests */
|
|
3771
|
+
status: WebhookEndpointStatus
|
|
3772
|
+
/** Timestamp of the most recent successful inbound request, or null */
|
|
3773
|
+
lastTriggeredAt: string | null
|
|
3774
|
+
/** Running total of inbound requests received */
|
|
3775
|
+
requestCount: number
|
|
3776
|
+
/** ISO 8601 creation timestamp */
|
|
3777
|
+
createdAt: string
|
|
3778
|
+
/** ISO 8601 last-updated timestamp */
|
|
3779
|
+
updatedAt: string
|
|
3780
|
+
}
|
|
3781
|
+
|
|
3782
|
+
/**
|
|
3783
|
+
* POST /api/webhook-endpoints - Create a new webhook endpoint
|
|
3784
|
+
*
|
|
3785
|
+
* The `key` and `id` are generated server-side and not accepted in the request.
|
|
3786
|
+
*/
|
|
3787
|
+
declare const CreateWebhookEndpointRequestSchema = z
|
|
3788
|
+
.object({
|
|
3789
|
+
/** User-facing label for the endpoint */
|
|
3790
|
+
name: NonEmptyStringSchema,
|
|
3791
|
+
/** Target workflow resourceId to invoke on inbound requests (can be set later) */
|
|
3792
|
+
resourceId: NonEmptyStringSchema.optional(),
|
|
3793
|
+
/** Optional description */
|
|
3794
|
+
description: z.string().optional()
|
|
3795
|
+
})
|
|
3796
|
+
.strict()
|
|
3797
|
+
|
|
3798
|
+
type CreateWebhookEndpointRequest = z.infer<typeof CreateWebhookEndpointRequestSchema>
|
|
3799
|
+
|
|
3800
|
+
/**
|
|
3801
|
+
* PATCH /api/webhook-endpoints/:id - Update an existing webhook endpoint
|
|
3802
|
+
*
|
|
3803
|
+
* At least one field must be provided.
|
|
3804
|
+
*/
|
|
3805
|
+
declare const UpdateWebhookEndpointRequestSchema = z
|
|
3806
|
+
.object({
|
|
3807
|
+
name: NonEmptyStringSchema.optional(),
|
|
3808
|
+
description: z.string().optional(),
|
|
3809
|
+
resourceId: NonEmptyStringSchema.optional(),
|
|
3810
|
+
status: WebhookEndpointStatusSchema.optional()
|
|
3811
|
+
})
|
|
3812
|
+
.strict()
|
|
3813
|
+
.refine(
|
|
3814
|
+
(data) =>
|
|
3815
|
+
data.name !== undefined ||
|
|
3816
|
+
data.description !== undefined ||
|
|
3817
|
+
data.resourceId !== undefined ||
|
|
3818
|
+
data.status !== undefined,
|
|
3819
|
+
{ message: 'At least one field (name, description, resourceId, or status) must be provided' }
|
|
3820
|
+
)
|
|
3821
|
+
|
|
3822
|
+
type UpdateWebhookEndpointRequest = z.infer<typeof UpdateWebhookEndpointRequestSchema>
|
|
3823
|
+
|
|
3824
|
+
/**
|
|
3825
|
+
* GET /api/credentials - List credentials
|
|
3826
|
+
*/
|
|
3827
|
+
declare const ListCredentialsResponseSchema = z.object({
|
|
3828
|
+
credentials: z.array(
|
|
3829
|
+
z.object({
|
|
3830
|
+
id: UuidSchema,
|
|
3831
|
+
name: z.string(),
|
|
3832
|
+
type: z.string(),
|
|
3833
|
+
provider: z.string().nullable(), // OAuth provider or null for non-OAuth
|
|
3834
|
+
createdAt: z.string().datetime()
|
|
3835
|
+
})
|
|
3836
|
+
)
|
|
3837
|
+
})
|
|
3838
|
+
|
|
3839
|
+
/** API response type for a single credential list item */
|
|
3840
|
+
type CredentialListItem = z.infer<typeof ListCredentialsResponseSchema>['credentials'][number]
|
|
3841
|
+
|
|
3842
|
+
export type { AIResourceDefinition, APIExecutionDetail, APIExecutionListResponse, Activity, ActivityType, ApiKeyListItem, ChatMessage, CheckpointListResponse, CostByModelResponse, CostSummaryResponse, CostTrendsResponse, CreateWebhookEndpointRequest, CredentialListItem, DashboardMetrics, Deployment, DeploymentStatus, ErrorAnalysisMetrics, ErrorDetailFull, ErrorDetailResponse, ErrorTrend, ExecutionHistoryItem, ExecutionHistoryResponse, ExecutionLogMessage, ExecutionStatus$1 as ExecutionStatus, ExecutionSummary, MembershipFeatureConfig, MembershipWithDetails, MessageEvent, NotificationDTO, OrgFeatureConfig, PatchTaskParams, ResourceDefinition, ResourceStatus, ResourceType, SessionDTO, SessionTokenUsage, SupabaseUserProfile, Task, TaskSchedule, TaskScheduleConfig, TaskStatus, TimeRange, UpdateWebhookEndpointRequest, UserConfig, WebhookEndpoint };
|