@elevasis/ui 2.15.0 → 2.17.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 +3 -2
- package/dist/app/index.js +9 -7
- package/dist/auth/index.js +4 -3
- package/dist/charts/index.js +11 -10
- package/dist/{chunk-C7BX547M.js → chunk-2TDZBYXI.js} +9 -3
- package/dist/{chunk-5IBTTMWX.js → chunk-34NQLV2W.js} +2 -2
- package/dist/{chunk-FL67C3WY.js → chunk-6IA2OMAE.js} +1 -1
- package/dist/{chunk-L4XXM55J.js → chunk-7YQKVWSD.js} +1 -1
- package/dist/{chunk-XJ7KC54A.js → chunk-ABUDMATM.js} +7 -8
- package/dist/{chunk-TUXTSEAF.js → chunk-DK2HVHCY.js} +1 -1
- package/dist/{chunk-GHIPBT5V.js → chunk-E4WQGJNS.js} +1 -1
- package/dist/{chunk-5SXYCICG.js → chunk-FNWWVX5N.js} +8 -6
- package/dist/{chunk-IOKL7BKE.js → chunk-GCBWGGI6.js} +133 -1
- package/dist/chunk-GRGRBWIO.js +383 -0
- package/dist/{chunk-SLVC5OJ2.js → chunk-HQ7M6PBW.js} +1 -1
- package/dist/chunk-IRW7JMQ4.js +28 -0
- package/dist/{chunk-YNPVQDNB.js → chunk-JU6UB4YA.js} +4 -4
- package/dist/{chunk-SFW573HS.js → chunk-MDO4UCEJ.js} +4 -4
- package/dist/{chunk-STZJ7SY5.js → chunk-MJ6YV2B5.js} +3 -2
- package/dist/{chunk-D7HBX5US.js → chunk-MUZIYL5Q.js} +5 -4
- package/dist/{chunk-DKQQK3WX.js → chunk-OCCZRPER.js} +1 -1
- package/dist/{chunk-FFXHKADZ.js → chunk-OXWQQCDR.js} +13 -32
- package/dist/{chunk-ZB5GAV7J.js → chunk-P3TFNFZS.js} +6 -5
- package/dist/{chunk-QEPXAWE2.js → chunk-QHSW4WHM.js} +3 -26
- package/dist/{chunk-LXHZYSMQ.js → chunk-QSTH6T77.js} +2 -52
- package/dist/{chunk-U2RXVZGY.js → chunk-R7GKX4HW.js} +66 -461
- package/dist/{chunk-X75JEGHS.js → chunk-S6CYH4RI.js} +7 -6
- package/dist/{chunk-MTJ43R2E.js → chunk-SLH2QLKV.js} +1 -1
- package/dist/{chunk-32NXXCQU.js → chunk-TP5NMF6K.js} +6 -7
- package/dist/{chunk-SQQGLGHW.js → chunk-TTP62HWW.js} +3 -3
- package/dist/{chunk-NVOCKXUQ.js → chunk-VDM6DQES.js} +1 -1
- package/dist/chunk-ZTWA5H77.js +94 -0
- package/dist/components/index.d.ts +2640 -2640
- package/dist/components/index.js +38 -35
- package/dist/execution/index.js +2 -2
- package/dist/features/auth/index.js +5 -4
- package/dist/features/crm/index.d.ts +51 -51
- package/dist/features/crm/index.js +21 -19
- package/dist/features/dashboard/index.js +23 -21
- package/dist/features/delivery/index.d.ts +2604 -2604
- package/dist/features/delivery/index.js +21 -19
- package/dist/features/lead-gen/index.js +29 -26
- package/dist/features/monitoring/index.js +26 -24
- package/dist/features/monitoring/requests/index.d.ts +26 -26
- package/dist/features/monitoring/requests/index.js +21 -19
- package/dist/features/operations/index.d.ts +10 -10
- package/dist/features/operations/index.js +28 -25
- package/dist/features/seo/index.js +1 -1
- package/dist/features/settings/index.d.ts +34 -34
- package/dist/features/settings/index.js +22 -20
- package/dist/hooks/delivery/index.css +589 -0
- package/dist/hooks/delivery/index.d.ts +3044 -0
- package/dist/hooks/delivery/index.js +4 -0
- package/dist/hooks/index.d.ts +3103 -3120
- package/dist/hooks/index.js +20 -18
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +506 -0
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +1 -0
- package/dist/hooks/published.d.ts +3103 -3120
- package/dist/hooks/published.js +20 -18
- package/dist/index.d.ts +3409 -3361
- package/dist/index.js +21 -19
- package/dist/initialization/index.js +4 -3
- package/dist/layout/index.js +3 -3
- package/dist/organization/index.js +4 -3
- package/dist/profile/index.js +2 -1
- package/dist/provider/ElevasisServiceContext.d.ts +54 -0
- package/dist/provider/ElevasisServiceContext.js +1 -0
- package/dist/provider/index.d.ts +244 -240
- package/dist/provider/index.js +17 -16
- package/dist/provider/published.d.ts +244 -240
- package/dist/provider/published.js +15 -14
- package/dist/types/index.d.ts +2349 -2332
- package/dist/utils/index.d.ts +73 -1
- package/dist/utils/index.js +2 -1
- package/dist/zustand/index.d.ts +7 -7
- package/package.json +3 -3
- package/dist/{chunk-4BF74JVD.js → chunk-6GUW5GGF.js} +1 -1
- package/dist/{chunk-ELJIFLCB.js → chunk-KRWALB24.js} +6 -6
package/dist/hooks/index.js
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
import '../chunk-7M2VOCYN.js';
|
|
2
|
-
export { ApiKeyService, CredentialService, DeploymentService, OperationsService, OrganizationMembershipService, WebhookEndpointService, acquisitionListKeys, companyKeys, contactKeys, dealKeys, dealNoteKeys, dealTaskKeys, executionsKeys, filterByDomainFilters, isSessionCapable,
|
|
3
|
-
export { observabilityKeys, useErrorTrends } from '../chunk-LXHZYSMQ.js';
|
|
2
|
+
export { ApiKeyService, CredentialService, DeploymentService, OperationsService, OrganizationMembershipService, WebhookEndpointService, acquisitionListKeys, companyKeys, contactKeys, dealKeys, dealNoteKeys, dealTaskKeys, executionsKeys, filterByDomainFilters, isSessionCapable, operationsKeys, projectActivityKeys, requestsKeys, scheduleKeys, sessionsKeys, sortData, useActivateDeployment, useActivities, useActivitiesRealtime, useActivityFilters, useActivityTrend, useArchiveSession, useArchivedLogs, useBatchDelete, useBatchTelemetry, useBatchedResourcesHealth, useBulkDeleteExecutions, useBusinessImpact, useCancelExecution, useCancelSchedule, useCheckpointTasks, useCommandQueue, useCommandQueueTotals, useCommandViewData, useCommandViewDomainFilters, useCommandViewLayout, useCommandViewStats, useCommandViewStore, useCompanies, useCompany, useCompleteDealTask, useContact, useContacts, useCostBreakdown, useCostByModel, useCostSummary, useCostTrends, useCreateApiKey, useCreateCompany, useCreateContact, useCreateCredential, useCreateDealNote, useCreateDealTask, useCreateList, useCreateSchedule, useCreateSession, useCreateWebhookEndpoint, useCredentials, useDashboardMetrics, useDeactivateDeployment, useDeactivateMembership, useDealDetail, useDealNotes, useDealTasks, useDealTasksDue, useDeals, useDeleteApiKey, useDeleteCompanies, useDeleteContacts, useDeleteCredential, useDeleteDeal, useDeleteDeployment, useDeleteExecution, useDeleteList, useDeleteSchedule, useDeleteSession, useDeleteTask, useDeleteWebhookEndpoint, useErrorAnalysis, useErrorDetail, useErrorDetails, useErrorDistribution, useErrorNotification, useExecuteAsync, useExecuteResource, useExecution, useExecutionHealth, useExecutionLogSSE, useExecutionLogs, useExecutionLogsFilters, useExecutionPanelState, useExecutions, useGetExecutionHistory, useGetSchedule, useGraphStats, useList, useListApiKeys, useListDeployments, useListExecutions, useListProgress, useListSchedules, useListWebhookEndpoints, useLists, useListsTelemetry, useMarkAllAsRead, useMarkAsRead, useNotificationCount as useNotificationCountSSE, useNotifications, useOrganizationMembers, usePaginationState, usePatchTask, usePauseSchedule, useProjectActivities, useProjectRealtime, useReactivateMembership, useRecentExecutionsByResource, useRequest, useRequestsList, useResolveAllErrors, useResolveError, useResolveErrorsByExecution, useResourceDefinition, useResourceErrors, useResourceExecutions, useResourceSearch, useResources, useResourcesDomainFilters, useResourcesHealth, useResumeSchedule, useRetryExecution, useSSEConnection, useScheduledTasks, useSession, useSessionExecution, useSessionExecutions, useSessionMessages, useSessionWebSocket, useSessions, useSortedData, useStatusFilter, useSubmitAction, useSuccessNotification, useSyncDealStage, useTableSelection, useTableSort, useTestNotification, useTimeRangeDates, useTopFailingResources, useUnresolveError, useUnresolvedErrors, useUpdateAnchor, useUpdateApiKey, useUpdateCompany, useUpdateContact, useUpdateCredential, useUpdateList, useUpdateListConfig, useUpdateMemberConfig, useUpdateRequestStatus, useUpdateSchedule, useUpdateWebhookEndpoint, useUserMemberships, useVisibleResources, useWarningNotification } from '../chunk-R7GKX4HW.js';
|
|
4
3
|
import '../chunk-BRXELOHC.js';
|
|
4
|
+
export { observabilityKeys, useErrorTrends } from '../chunk-QSTH6T77.js';
|
|
5
|
+
export { milestoneKeys, noteKeys, projectKeys, taskKeys, useCreateProject as useCreateDeliveryProject, useCreateMilestone, useCreateNote, useCreateTask, useDeleteProject as useDeleteDeliveryProject, useDeleteTask as useDeleteDeliveryTask, useDeleteMilestone, useMilestones, useProject, useProjectMilestones, useProjectNotes, useProjectTasks, useProjects, useTasks, useUpdateProject as useUpdateDeliveryProject, useUpdateMilestone, useUpdateTask } from '../chunk-GRGRBWIO.js';
|
|
5
6
|
import '../chunk-22UVE3RA.js';
|
|
6
7
|
export { useMergedExecution } from '../chunk-3ZMAGTWF.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
8
|
+
import '../chunk-OCCZRPER.js';
|
|
9
|
+
import '../chunk-34NQLV2W.js';
|
|
9
10
|
import '../chunk-R73EHHPN.js';
|
|
10
11
|
import '../chunk-WLOQ4IBG.js';
|
|
11
|
-
export { createFeatureAccessHook, createUseFeatureAccess } from '../chunk-
|
|
12
|
+
export { createFeatureAccessHook, createUseFeatureAccess } from '../chunk-2TDZBYXI.js';
|
|
13
|
+
import '../chunk-P3TFNFZS.js';
|
|
12
14
|
import '../chunk-RX4UWZZR.js';
|
|
13
|
-
import '../chunk-
|
|
15
|
+
import '../chunk-TTP62HWW.js';
|
|
16
|
+
import '../chunk-SZHARWKU.js';
|
|
14
17
|
import '../chunk-3KMDHCAR.js';
|
|
15
18
|
import '../chunk-NYBEU5TE.js';
|
|
16
|
-
import '../chunk-
|
|
17
|
-
import '../chunk-SZHARWKU.js';
|
|
18
|
-
import '../chunk-NVOCKXUQ.js';
|
|
19
|
+
import '../chunk-VDM6DQES.js';
|
|
19
20
|
import '../chunk-2IFYDILW.js';
|
|
20
|
-
import '../chunk-
|
|
21
|
-
import '../chunk-
|
|
22
|
-
import '../chunk-
|
|
21
|
+
import '../chunk-Q7DJKLEN.js';
|
|
22
|
+
import '../chunk-7YQKVWSD.js';
|
|
23
|
+
import '../chunk-6IA2OMAE.js';
|
|
23
24
|
import '../chunk-QJ2KCHKX.js';
|
|
24
|
-
import '../chunk-
|
|
25
|
+
import '../chunk-HQ7M6PBW.js';
|
|
25
26
|
import '../chunk-DT3QYZVU.js';
|
|
26
27
|
import '../chunk-RNP5R5I3.js';
|
|
27
|
-
export { REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY } from '../chunk-
|
|
28
|
-
import '../chunk-
|
|
29
|
-
import '../chunk-
|
|
28
|
+
export { REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY } from '../chunk-GCBWGGI6.js';
|
|
29
|
+
import '../chunk-KRWALB24.js';
|
|
30
|
+
import '../chunk-SLH2QLKV.js';
|
|
31
|
+
import '../chunk-DK2HVHCY.js';
|
|
30
32
|
import '../chunk-DD3CCMCZ.js';
|
|
31
|
-
import '../chunk-
|
|
33
|
+
import '../chunk-QHSW4WHM.js';
|
|
34
|
+
import '../chunk-IRW7JMQ4.js';
|
|
32
35
|
import '../chunk-BRJ3QZ4E.js';
|
|
33
|
-
import '../chunk-Q7DJKLEN.js';
|
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command View Types
|
|
3
|
+
*
|
|
4
|
+
* Unified type definitions for the Command View graph visualization.
|
|
5
|
+
* These types are used by both backend serialization and frontend rendering.
|
|
6
|
+
*
|
|
7
|
+
* Command View shows the resource graph: agents, workflows, triggers, integrations,
|
|
8
|
+
* external resources, and human checkpoints with their relationships.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Extended agent metadata for Command View
|
|
13
|
+
* Includes model and capability information for graph display
|
|
14
|
+
*/
|
|
15
|
+
interface CommandViewAgent extends ResourceDefinition {
|
|
16
|
+
type: 'agent';
|
|
17
|
+
modelProvider: string;
|
|
18
|
+
modelId: string;
|
|
19
|
+
toolCount: number;
|
|
20
|
+
hasKnowledgeMap: boolean;
|
|
21
|
+
hasMemory: boolean;
|
|
22
|
+
sessionCapable: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Extended workflow metadata for Command View
|
|
26
|
+
* Includes step information for graph display
|
|
27
|
+
*/
|
|
28
|
+
interface CommandViewWorkflow extends ResourceDefinition {
|
|
29
|
+
type: 'workflow';
|
|
30
|
+
stepCount: number;
|
|
31
|
+
entryPoint: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Relationship types between resources
|
|
35
|
+
*
|
|
36
|
+
* - triggers: Resource initiates/starts another resource (orange)
|
|
37
|
+
* - uses: Resource uses an integration (teal)
|
|
38
|
+
* - approval: Resource requires human approval (yellow)
|
|
39
|
+
*/
|
|
40
|
+
type RelationshipType$1 = 'triggers' | 'uses' | 'approval';
|
|
41
|
+
/**
|
|
42
|
+
* Command View edge (relationship between resources)
|
|
43
|
+
*/
|
|
44
|
+
interface CommandViewEdge$1 {
|
|
45
|
+
id: string;
|
|
46
|
+
source: string;
|
|
47
|
+
target: string;
|
|
48
|
+
relationship: RelationshipType$1;
|
|
49
|
+
label?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Command View data structure
|
|
53
|
+
* Complete graph data for visualization
|
|
54
|
+
*
|
|
55
|
+
* Backend serializes this once at startup and serves it via /command-view endpoint.
|
|
56
|
+
* Frontend consumes this directly for graph rendering.
|
|
57
|
+
*/
|
|
58
|
+
interface CommandViewData {
|
|
59
|
+
workflows: CommandViewWorkflow[];
|
|
60
|
+
agents: CommandViewAgent[];
|
|
61
|
+
triggers: TriggerDefinition[];
|
|
62
|
+
integrations: IntegrationDefinition[];
|
|
63
|
+
externalResources: ExternalResourceDefinition[];
|
|
64
|
+
humanCheckpoints: HumanCheckpointDefinition[];
|
|
65
|
+
edges: CommandViewEdge$1[];
|
|
66
|
+
domainDefinitions?: DomainDefinition[];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Supported integration types
|
|
71
|
+
*
|
|
72
|
+
* These represent the available integration adapters that can be used with tools.
|
|
73
|
+
* Each integration type corresponds to an adapter implementation.
|
|
74
|
+
*
|
|
75
|
+
* Note: Concrete adapter implementations are deferred until needed.
|
|
76
|
+
* This type provides compile-time safety and auto-completion for tool definitions.
|
|
77
|
+
*/
|
|
78
|
+
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';
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Resource Registry type definitions
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Environment/deployment status for resources
|
|
86
|
+
*/
|
|
87
|
+
type ResourceStatus = 'dev' | 'prod';
|
|
88
|
+
/**
|
|
89
|
+
* All resource types in the platform
|
|
90
|
+
* Used as the discriminator field in ResourceDefinition
|
|
91
|
+
*/
|
|
92
|
+
type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'external' | 'human';
|
|
93
|
+
/**
|
|
94
|
+
* Base interface for ALL platform resources
|
|
95
|
+
* Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
|
|
96
|
+
*/
|
|
97
|
+
interface ResourceDefinition {
|
|
98
|
+
/** Unique resource identifier */
|
|
99
|
+
resourceId: string;
|
|
100
|
+
/** Display name */
|
|
101
|
+
name: string;
|
|
102
|
+
/** Purpose and functionality description */
|
|
103
|
+
description: string;
|
|
104
|
+
/** Version for change tracking and evolution */
|
|
105
|
+
version: string;
|
|
106
|
+
/** Resource type discriminator */
|
|
107
|
+
type: ResourceType;
|
|
108
|
+
/** Environment/deployment status */
|
|
109
|
+
status: ResourceStatus;
|
|
110
|
+
/** Domain tags for filtering and organization */
|
|
111
|
+
domains?: ResourceDomain[];
|
|
112
|
+
/** Whether the agent supports multi-turn sessions (agents only) */
|
|
113
|
+
sessionCapable?: boolean;
|
|
114
|
+
/** Whether the resource is local (monorepo) or remote (externally deployed) */
|
|
115
|
+
origin?: 'local' | 'remote';
|
|
116
|
+
/** Whether this resource is archived and should be excluded from registration and deployment */
|
|
117
|
+
archived?: boolean;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Domain definition for Command View filtering
|
|
121
|
+
*
|
|
122
|
+
* Domains are organizational metadata for UI filtering/grouping.
|
|
123
|
+
* No execution impact - purely for visualization.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* {
|
|
127
|
+
* id: 'support',
|
|
128
|
+
* name: 'Customer Support',
|
|
129
|
+
* description: 'Ticket triage, knowledge base, escalations',
|
|
130
|
+
* color: 'green',
|
|
131
|
+
* icon: 'IconHeadset'
|
|
132
|
+
* }
|
|
133
|
+
*/
|
|
134
|
+
interface DomainDefinition {
|
|
135
|
+
/** Unique identifier (e.g., 'support') */
|
|
136
|
+
id: string;
|
|
137
|
+
/** Display name (e.g., 'Customer Support') */
|
|
138
|
+
name: string;
|
|
139
|
+
/** Purpose description */
|
|
140
|
+
description: string;
|
|
141
|
+
/** Optional Mantine color for UI (e.g., 'blue', 'green', 'orange') */
|
|
142
|
+
color?: string;
|
|
143
|
+
/** Optional Tabler icon name (e.g., 'IconHeadset') */
|
|
144
|
+
icon?: string;
|
|
145
|
+
}
|
|
146
|
+
/** Webhook provider identifiers */
|
|
147
|
+
type WebhookProviderType = 'cal-com' | 'stripe' | 'signature-api' | 'instantly' | 'apify' | 'test';
|
|
148
|
+
/** Webhook trigger configuration */
|
|
149
|
+
interface WebhookTriggerConfig {
|
|
150
|
+
/** Provider identifier */
|
|
151
|
+
provider: WebhookProviderType;
|
|
152
|
+
/** Event type for documentation (not used for matching - workflow handles routing) */
|
|
153
|
+
event?: string;
|
|
154
|
+
/** Optional filtering (e.g., specific form ID for Fillout) */
|
|
155
|
+
filter?: Record<string, string>;
|
|
156
|
+
/** References credential in credentials table for per-org webhook secrets */
|
|
157
|
+
credentialName?: string;
|
|
158
|
+
}
|
|
159
|
+
/** Schedule trigger configuration */
|
|
160
|
+
interface ScheduleTriggerConfig {
|
|
161
|
+
/** Cron expression (e.g., '0 6 * * *') */
|
|
162
|
+
cron: string;
|
|
163
|
+
/** Optional timezone (default: UTC) */
|
|
164
|
+
timezone?: string;
|
|
165
|
+
}
|
|
166
|
+
/** Event trigger configuration */
|
|
167
|
+
interface EventTriggerConfig {
|
|
168
|
+
/** Internal event type */
|
|
169
|
+
eventType: string;
|
|
170
|
+
/** Event source */
|
|
171
|
+
source?: string;
|
|
172
|
+
}
|
|
173
|
+
/** Union of all trigger configs */
|
|
174
|
+
type TriggerConfig = WebhookTriggerConfig | ScheduleTriggerConfig | EventTriggerConfig;
|
|
175
|
+
/**
|
|
176
|
+
* Trigger metadata - entry points that initiate resource execution
|
|
177
|
+
*
|
|
178
|
+
* Triggers represent how executions start: webhooks from external services,
|
|
179
|
+
* scheduled cron jobs, platform events, or manual user actions.
|
|
180
|
+
*
|
|
181
|
+
* BREAKING CHANGES (2025-11-30):
|
|
182
|
+
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
|
|
183
|
+
* - Field renames: `id` -> `resourceId` (inherited), `type` -> `triggerType`
|
|
184
|
+
* - Relationship rename: `invokes` -> `triggers` (unified vocabulary)
|
|
185
|
+
* - New required fields: `version` (inherited), `type: 'trigger'` (inherited)
|
|
186
|
+
* - triggers object now includes `externalResources` option
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* // TriggerDefinition - metadata only
|
|
190
|
+
* {
|
|
191
|
+
* resourceId: 'trigger-new-order',
|
|
192
|
+
* type: 'trigger',
|
|
193
|
+
* triggerType: 'webhook',
|
|
194
|
+
* name: 'New Order',
|
|
195
|
+
* description: 'Webhook from Shopify on new orders',
|
|
196
|
+
* version: '1.0.0',
|
|
197
|
+
* status: 'prod',
|
|
198
|
+
* webhookPath: '/webhooks/shopify/orders'
|
|
199
|
+
* }
|
|
200
|
+
*
|
|
201
|
+
* // Relationships declared in ResourceRelationships (not on TriggerDefinition):
|
|
202
|
+
* // relationships: {
|
|
203
|
+
* // 'trigger-new-order': { triggers: { workflows: ['order-fulfillment-workflow'] } }
|
|
204
|
+
* // }
|
|
205
|
+
*/
|
|
206
|
+
interface TriggerDefinition extends ResourceDefinition {
|
|
207
|
+
/** Resource type discriminator (narrowed from base union) */
|
|
208
|
+
type: 'trigger';
|
|
209
|
+
/** Trigger mechanism type (renamed from 'type' to avoid collision with base type discriminator) */
|
|
210
|
+
triggerType: 'webhook' | 'schedule' | 'manual' | 'event';
|
|
211
|
+
/** Type-specific configuration */
|
|
212
|
+
config?: TriggerConfig;
|
|
213
|
+
/** For webhook triggers: path like '/webhooks/shopify/orders' */
|
|
214
|
+
webhookPath?: string;
|
|
215
|
+
/** For schedule triggers: cron expression like '0 6 * * *' */
|
|
216
|
+
schedule?: string;
|
|
217
|
+
/** For event triggers: event type like 'low-stock-alert' */
|
|
218
|
+
eventType?: string;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Integration metadata - external service connections
|
|
222
|
+
*
|
|
223
|
+
* References credentials table for actual connection. No connection status
|
|
224
|
+
* stored here (queried at runtime from credentials table).
|
|
225
|
+
*
|
|
226
|
+
* BREAKING CHANGES (2025-11-30):
|
|
227
|
+
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
|
|
228
|
+
* - Field renames: `id` -> `resourceId` (inherited)
|
|
229
|
+
* - New required field: `status` (inherited) - organizations must add status to all integrations
|
|
230
|
+
* - New required field: `version` (inherited) - organizations must add version to all integrations
|
|
231
|
+
* - New required field: `type: 'integration'` (inherited) - resource type discriminator
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* {
|
|
235
|
+
* resourceId: 'integration-shopify-prod',
|
|
236
|
+
* type: 'integration',
|
|
237
|
+
* provider: 'shopify',
|
|
238
|
+
* credentialName: 'shopify-prod',
|
|
239
|
+
* name: 'Shopify Production',
|
|
240
|
+
* description: 'E-commerce platform',
|
|
241
|
+
* version: '1.0.0',
|
|
242
|
+
* status: 'prod'
|
|
243
|
+
* }
|
|
244
|
+
*/
|
|
245
|
+
interface IntegrationDefinition extends ResourceDefinition {
|
|
246
|
+
/** Resource type discriminator (narrowed from base union) */
|
|
247
|
+
type: 'integration';
|
|
248
|
+
/** Integration provider type */
|
|
249
|
+
provider: IntegrationType;
|
|
250
|
+
/** References credentials table (e.g., 'shopify-prod', 'zendesk-api') */
|
|
251
|
+
credentialName: string;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* External platform type
|
|
255
|
+
* Supported third-party automation platforms
|
|
256
|
+
*/
|
|
257
|
+
type ExternalPlatform = 'n8n' | 'make' | 'zapier' | 'other';
|
|
258
|
+
/**
|
|
259
|
+
* External automation resource metadata
|
|
260
|
+
*
|
|
261
|
+
* Represents workflows/automations running on third-party platforms
|
|
262
|
+
* (n8n, Make, Zapier, etc.) for visualization in Command View.
|
|
263
|
+
*
|
|
264
|
+
* NOTE: This is metadata ONLY for visualization. No execution logic,
|
|
265
|
+
* no API integration with external platforms, no status syncing.
|
|
266
|
+
*
|
|
267
|
+
* BREAKING CHANGES (2025-11-30):
|
|
268
|
+
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
|
|
269
|
+
* - Field renames: `id` -> `resourceId` (inherited)
|
|
270
|
+
* - New required field: `version` (inherited) - organizations must add version to all external resources
|
|
271
|
+
* - New required field: `type: 'external'` (inherited) - resource type discriminator
|
|
272
|
+
* - REMOVED FIELD: `triggeredBy` - per relationship-consolidation design, all relationships are forward-only declarations
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* {
|
|
276
|
+
* resourceId: 'external-n8n-order-sync',
|
|
277
|
+
* type: 'external',
|
|
278
|
+
* version: '1.0.0',
|
|
279
|
+
* platform: 'n8n',
|
|
280
|
+
* name: 'Shopify Order Sync',
|
|
281
|
+
* description: 'Legacy n8n workflow for syncing Shopify orders',
|
|
282
|
+
* status: 'prod',
|
|
283
|
+
* platformUrl: 'https://n8n.client.com/workflow/123',
|
|
284
|
+
* triggers: { workflows: ['order-fulfillment-workflow'] },
|
|
285
|
+
* uses: { integrations: ['integration-shopify-prod'] }
|
|
286
|
+
* }
|
|
287
|
+
*/
|
|
288
|
+
interface ExternalResourceDefinition extends ResourceDefinition {
|
|
289
|
+
/** Resource type discriminator (narrowed from base union) */
|
|
290
|
+
type: 'external';
|
|
291
|
+
/** Platform type */
|
|
292
|
+
platform: ExternalPlatform;
|
|
293
|
+
/** Link to external platform (e.g., n8n workflow editor URL) */
|
|
294
|
+
platformUrl?: string;
|
|
295
|
+
/** Platform's internal ID/reference */
|
|
296
|
+
externalId?: string;
|
|
297
|
+
/** What this external resource triggers (external -> internal) */
|
|
298
|
+
triggers?: {
|
|
299
|
+
/** Elevasis workflow resourceIds this external automation triggers */
|
|
300
|
+
workflows?: string[];
|
|
301
|
+
/** Elevasis agent resourceIds this external automation triggers */
|
|
302
|
+
agents?: string[];
|
|
303
|
+
};
|
|
304
|
+
/** Integrations this external resource uses (shared credentials) */
|
|
305
|
+
uses?: {
|
|
306
|
+
/** Integration IDs this external automation uses */
|
|
307
|
+
integrations?: string[];
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Human Checkpoint definition - human decision points in automation
|
|
312
|
+
*
|
|
313
|
+
* Represents where human judgment is deployed in the automation landscape.
|
|
314
|
+
* Tasks with matching command_queue_group are routed to this checkpoint.
|
|
315
|
+
*
|
|
316
|
+
* BREAKING CHANGES (2025-11-30):
|
|
317
|
+
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
|
|
318
|
+
* - Field renames: `id` -> `resourceId` (inherited)
|
|
319
|
+
* - description is now REQUIRED (was optional) - organizations must add description to all human checkpoints
|
|
320
|
+
* - New required field: `version` (inherited) - organizations must add version to all human checkpoints
|
|
321
|
+
* - New required field: `type: 'human'` (inherited) - resource type discriminator
|
|
322
|
+
*
|
|
323
|
+
* @example
|
|
324
|
+
* {
|
|
325
|
+
* resourceId: 'sales-approval',
|
|
326
|
+
* type: 'human',
|
|
327
|
+
* name: 'Sales Approval Queue',
|
|
328
|
+
* description: 'High-value order approvals for sales team',
|
|
329
|
+
* version: '1.0.0',
|
|
330
|
+
* status: 'prod',
|
|
331
|
+
* requestedBy: { agents: ['order-processor-agent'] },
|
|
332
|
+
* routesTo: { agents: ['order-fulfillment-agent'] }
|
|
333
|
+
* }
|
|
334
|
+
*/
|
|
335
|
+
interface HumanCheckpointDefinition extends ResourceDefinition {
|
|
336
|
+
/** Resource type discriminator (narrowed from base union) */
|
|
337
|
+
type: 'human';
|
|
338
|
+
/** Resources that create tasks for this checkpoint */
|
|
339
|
+
requestedBy?: {
|
|
340
|
+
/** Agent resourceIds that request approval here */
|
|
341
|
+
agents?: string[];
|
|
342
|
+
/** Workflow resourceIds that request approval here */
|
|
343
|
+
workflows?: string[];
|
|
344
|
+
};
|
|
345
|
+
/** Resources that receive approved decisions */
|
|
346
|
+
routesTo?: {
|
|
347
|
+
/** Agent resourceIds that handle approved tasks */
|
|
348
|
+
agents?: string[];
|
|
349
|
+
/** Workflow resourceIds that handle approved tasks */
|
|
350
|
+
workflows?: string[];
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Standard Domain Definitions
|
|
356
|
+
* Centralized domain constants and definitions for all organization resources.
|
|
357
|
+
*/
|
|
358
|
+
|
|
359
|
+
declare const DOMAINS: {
|
|
360
|
+
readonly INBOUND_PIPELINE: "inbound-pipeline";
|
|
361
|
+
readonly LEAD_GEN_PIPELINE: "lead-gen-pipeline";
|
|
362
|
+
readonly SUPPORT: "support";
|
|
363
|
+
readonly CLIENT_SUPPORT: "client-support";
|
|
364
|
+
readonly DELIVERY: "delivery";
|
|
365
|
+
readonly OPERATIONS: "operations";
|
|
366
|
+
readonly FINANCE: "finance";
|
|
367
|
+
readonly EXECUTIVE: "executive";
|
|
368
|
+
readonly INSTANTLY: "instantly";
|
|
369
|
+
readonly TESTING: "testing";
|
|
370
|
+
readonly INTERNAL: "internal";
|
|
371
|
+
readonly INTEGRATION: "integration";
|
|
372
|
+
readonly UTILITY: "utility";
|
|
373
|
+
readonly DIAGNOSTIC: "diagnostic";
|
|
374
|
+
};
|
|
375
|
+
/**
|
|
376
|
+
* ResourceDomain - Strongly typed domain identifier
|
|
377
|
+
* Use this type for all domain references to ensure compile-time validation.
|
|
378
|
+
*/
|
|
379
|
+
type ResourceDomain = (typeof DOMAINS)[keyof typeof DOMAINS];
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Command View Types
|
|
383
|
+
*
|
|
384
|
+
* Frontend graph types for React Flow rendering.
|
|
385
|
+
*
|
|
386
|
+
* Backend API returns CommandViewData with separate arrays (workflows[], agents[], etc.)
|
|
387
|
+
* Frontend transforms this to CommandViewGraph with unified nodes[] array.
|
|
388
|
+
*
|
|
389
|
+
* @see transformCommandViewData for the mapping logic
|
|
390
|
+
* @see CommandViewData from @repo/core for backend type
|
|
391
|
+
*/
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Base resource node - common fields for all resources
|
|
395
|
+
*/
|
|
396
|
+
interface BaseResourceNode {
|
|
397
|
+
id: string;
|
|
398
|
+
name: string;
|
|
399
|
+
description: string;
|
|
400
|
+
status: ResourceStatus;
|
|
401
|
+
stats?: {
|
|
402
|
+
totalRuns: number;
|
|
403
|
+
successCount: number;
|
|
404
|
+
failureCount: number;
|
|
405
|
+
warningCount: number;
|
|
406
|
+
lastRunAt: string | null;
|
|
407
|
+
} | null;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Agent node - autonomous AI agents
|
|
411
|
+
*/
|
|
412
|
+
interface AgentNode extends BaseResourceNode {
|
|
413
|
+
type: 'agent';
|
|
414
|
+
modelProvider: string;
|
|
415
|
+
modelId: string;
|
|
416
|
+
toolCount: number;
|
|
417
|
+
hasKnowledgeMap: boolean;
|
|
418
|
+
hasMemory: boolean;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Workflow node - multi-step orchestrations
|
|
422
|
+
*/
|
|
423
|
+
interface WorkflowNode extends BaseResourceNode {
|
|
424
|
+
type: 'workflow';
|
|
425
|
+
stepCount: number;
|
|
426
|
+
entryPoint: string;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Integration node - external service connections
|
|
430
|
+
*/
|
|
431
|
+
interface IntegrationNode extends BaseResourceNode {
|
|
432
|
+
type: 'integration';
|
|
433
|
+
provider: string;
|
|
434
|
+
connectionStatus: 'connected' | 'disconnected' | 'error';
|
|
435
|
+
credentialName?: string;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Trigger node - what initiates executions
|
|
439
|
+
*/
|
|
440
|
+
interface TriggerNode extends BaseResourceNode {
|
|
441
|
+
type: 'trigger';
|
|
442
|
+
triggerType: 'webhook' | 'schedule' | 'manual' | 'event';
|
|
443
|
+
schedule?: string;
|
|
444
|
+
webhookPath?: string;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* External resource node - third-party automation platforms
|
|
448
|
+
*/
|
|
449
|
+
interface ExternalResourceNode extends BaseResourceNode {
|
|
450
|
+
type: 'external';
|
|
451
|
+
platform: 'n8n' | 'make' | 'zapier' | 'other';
|
|
452
|
+
platformUrl?: string;
|
|
453
|
+
externalId?: string;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Human node - approval points requiring human decisions
|
|
457
|
+
*/
|
|
458
|
+
interface HumanNode extends Omit<BaseResourceNode, 'stats'> {
|
|
459
|
+
type: 'human';
|
|
460
|
+
stats?: {
|
|
461
|
+
pendingCount: number;
|
|
462
|
+
completedCount: number;
|
|
463
|
+
expiredCount: number;
|
|
464
|
+
lastDecisionAt: string | null;
|
|
465
|
+
} | null;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Union type for all node types
|
|
469
|
+
*/
|
|
470
|
+
type CommandViewNode = AgentNode | WorkflowNode | IntegrationNode | TriggerNode | ExternalResourceNode | HumanNode;
|
|
471
|
+
/**
|
|
472
|
+
* Relationship types between resources
|
|
473
|
+
*/
|
|
474
|
+
type RelationshipType = 'triggers' | 'uses' | 'approval';
|
|
475
|
+
/**
|
|
476
|
+
* Edge representing a relationship
|
|
477
|
+
*/
|
|
478
|
+
interface CommandViewEdge {
|
|
479
|
+
id: string;
|
|
480
|
+
source: string;
|
|
481
|
+
target: string;
|
|
482
|
+
relationship: RelationshipType;
|
|
483
|
+
label?: string;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Complete graph data for visualization
|
|
487
|
+
*/
|
|
488
|
+
interface CommandViewGraph {
|
|
489
|
+
nodes: CommandViewNode[];
|
|
490
|
+
edges: CommandViewEdge[];
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Transform backend CommandViewData to frontend CommandViewGraph
|
|
495
|
+
*
|
|
496
|
+
* Backend returns separate arrays (workflows[], agents[], triggers[], integrations[])
|
|
497
|
+
* Frontend needs unified nodes[] array with consistent id field.
|
|
498
|
+
*
|
|
499
|
+
* Key mappings:
|
|
500
|
+
* - Agent/Workflow: resourceId -> id
|
|
501
|
+
* - Trigger/Integration/External/Human: resourceId -> id (updated to use resourceId after base interface refactor)
|
|
502
|
+
* - connectionStatus: defaulted to 'connected' (runtime status not yet available)
|
|
503
|
+
*/
|
|
504
|
+
declare function transformCommandViewData(data: CommandViewData): CommandViewGraph;
|
|
505
|
+
|
|
506
|
+
export { transformCommandViewData };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { transformCommandViewData } from '../../../../chunk-ZTWA5H77.js';
|