@elevasis/ui 2.25.5 → 2.25.6
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/app/index.css +3 -24
- package/dist/app/index.d.ts +63 -56
- package/dist/app/index.js +3 -2
- package/dist/chunk-5RLYII6P.js +314 -0
- package/dist/chunk-6U7AIIHF.js +880 -0
- package/dist/{chunk-NHHCUECV.js → chunk-7F3IQMLI.js} +1 -1
- package/dist/{chunk-N2AP4I5N.js → chunk-ARJPZ66V.js} +39 -757
- package/dist/{chunk-IS53MXE4.js → chunk-BDKM56TP.js} +1 -1
- package/dist/{chunk-KINQW4JT.js → chunk-C7IBFI5B.js} +1 -1
- package/dist/{chunk-5BJXMZN4.js → chunk-CPAJXBTL.js} +9 -5
- package/dist/chunk-HAEJ4M54.js +94 -0
- package/dist/{chunk-QNCVK3ZF.js → chunk-JXSBOG2R.js} +1 -1
- package/dist/{chunk-3KY2GNPE.js → chunk-KNISO652.js} +1 -1
- package/dist/{chunk-VMAWXEVG.js → chunk-L7D6KNHV.js} +457 -290
- package/dist/{chunk-JMI7L7Y7.js → chunk-LPM7O6XM.js} +2 -233
- package/dist/{chunk-FVKLHLF4.js → chunk-QARSVM7Q.js} +1 -1
- package/dist/{chunk-F7JDHS2I.js → chunk-SBQ4MYQV.js} +3 -2
- package/dist/{chunk-MU4VPAMR.js → chunk-YRKQNPK2.js} +1 -1
- package/dist/components/index.css +3 -24
- package/dist/components/index.d.ts +11 -2
- package/dist/components/index.js +18 -16
- package/dist/components/navigation/index.css +3 -24
- package/dist/features/auth/index.css +3 -24
- package/dist/features/crm/index.css +3 -24
- package/dist/features/crm/index.js +5 -4
- package/dist/features/dashboard/index.css +3 -24
- package/dist/features/dashboard/index.js +5 -4
- package/dist/features/delivery/index.css +3 -24
- package/dist/features/delivery/index.js +5 -4
- package/dist/features/knowledge/index.js +397 -1
- package/dist/features/lead-gen/index.css +3 -24
- package/dist/features/lead-gen/index.d.ts +158 -151
- package/dist/features/lead-gen/index.js +6 -5
- package/dist/features/monitoring/index.css +3 -24
- package/dist/features/monitoring/index.js +6 -5
- package/dist/features/monitoring/requests/index.css +3 -24
- package/dist/features/monitoring/requests/index.js +4 -3
- package/dist/features/operations/index.css +3 -24
- package/dist/features/operations/index.js +9 -7
- package/dist/features/settings/index.css +3 -24
- package/dist/features/settings/index.js +5 -4
- package/dist/hooks/delivery/index.css +3 -24
- package/dist/hooks/index.css +3 -24
- package/dist/hooks/index.d.ts +14 -3
- package/dist/hooks/index.js +4 -3
- package/dist/hooks/published.css +3 -24
- package/dist/hooks/published.d.ts +14 -3
- package/dist/hooks/published.js +4 -3
- package/dist/index.css +3 -24
- package/dist/index.d.ts +611 -593
- package/dist/index.js +4 -3
- package/dist/knowledge/index.d.ts +14 -4
- package/dist/knowledge/index.js +20 -119
- package/dist/organization/index.css +3 -24
- package/dist/provider/index.css +3 -24
- package/dist/provider/index.d.ts +346 -339
- package/dist/provider/index.js +3 -2
- package/dist/provider/published.css +3 -24
- package/dist/provider/published.d.ts +346 -339
- package/dist/provider/published.js +2 -1
- package/package.json +33 -33
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { SubshellSidebarLoader, SubshellLoader } from './chunk-N55DVMAG.js';
|
|
2
2
|
import { ChatHeader, ChatSidebar } from './chunk-ROSMICXG.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ResourceHealthPanel } from './chunk-
|
|
3
|
+
import { buildOrganizationGraph } from './chunk-6U7AIIHF.js';
|
|
4
|
+
import { BaseNode, useGraphTheme, BaseEdge, FormFieldRenderer, ExecutionStats, UnifiedWorkflowGraph, WorkflowExecutionTimeline, AgentExecutionVisualizer, AgentExecutionTimeline, GraphBackground, GraphFitViewButton, GraphFitViewHandler } from './chunk-7F3IQMLI.js';
|
|
5
|
+
import { ResourceHealthPanel } from './chunk-QARSVM7Q.js';
|
|
6
6
|
import { useCyberColors, CyberDonut } from './chunk-KMAXFJPH.js';
|
|
7
7
|
import { AppShellLoader } from './chunk-RYTEQBAO.js';
|
|
8
8
|
import { PageContainer } from './chunk-BZZCNLT6.js';
|
|
9
9
|
import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
|
|
10
10
|
import { CustomModal, ConfirmationModal } from './chunk-KVJ3LFH2.js';
|
|
11
11
|
import { getResourceStatusColor, useTimelineData, useAgentIterationData, getStatusIcon } from './chunk-E4WQGJNS.js';
|
|
12
|
-
import { useErrorDetail, useExecution, useArchivedLogs, useDeleteExecution, useRetryExecution, useCancelExecution, useCommandQueueTotals, useStatusFilter, useResourceSearch, useResourcesDomainFilters, usePaginationState, useResources, useRecentExecutionsByResource, filterByDomainFilters, collectResourceFilterFacets, useExecuteAsync, useResourceDefinition, isSessionCapable, useDeleteTask, useCommandQueue, useSubmitAction, useCommandViewData, useCommandViewStats, useCommandViewStore, useResourceExecutions, useCheckpointTasks, COMMAND_VIEW_VISUALIZATION_MODES, useExecutionPanelState, useDeleteSession, useCreateSession, useSessions, useSessionExecutions, useSession, useBulkDeleteExecutions, getCommandViewGraphPositions } from './chunk-
|
|
12
|
+
import { useErrorDetail, useExecution, useArchivedLogs, useDeleteExecution, useRetryExecution, useCancelExecution, useCommandQueueTotals, useStatusFilter, useResourceSearch, useResourcesDomainFilters, usePaginationState, useResources, useRecentExecutionsByResource, filterByDomainFilters, collectResourceFilterFacets, useExecuteAsync, useResourceDefinition, isSessionCapable, useDeleteTask, useCommandQueue, useSubmitAction, useCommandViewData, useCommandViewStats, useCommandViewStore, useResourceExecutions, useCheckpointTasks, COMMAND_VIEW_VISUALIZATION_MODES, useExecutionPanelState, useDeleteSession, useCreateSession, useSessions, useSessionExecutions, useSession, useBulkDeleteExecutions, getCommandViewGraphPositions } from './chunk-CPAJXBTL.js';
|
|
13
13
|
import { showApiErrorNotification, showSuccessNotification } from './chunk-HKBEURCV.js';
|
|
14
14
|
import { useGraphHighlighting, calculateGraphHeight, Graph_module_css_default, GRAPH_CONSTANTS } from './chunk-22UVE3RA.js';
|
|
15
15
|
import { useMergedExecution } from './chunk-3ZMAGTWF.js';
|
|
16
16
|
import { SubshellContentContainer } from './chunk-TKAYX2SP.js';
|
|
17
17
|
import { JsonViewer, CardHeader, PageTitleCaption, CollapsibleSection, TabCountBadge, ResourceCard, ContextViewer, EmptyState, APIErrorAlert } from './chunk-U36X6NZM.js';
|
|
18
18
|
import { NavigationButton } from './chunk-NYBEU5TE.js';
|
|
19
|
-
import { LabelSchema, ColorTokenSchema, IconNameSchema, PathSchema, DescriptionSchema, DisplayMetadataSchema, ModelIdSchema, ReferenceIdsSchema, OrganizationModelSalesSchema } from './chunk-JMI7L7Y7.js';
|
|
20
19
|
import { useOptionalElevasisFeatures, useElevasisFeatures } from './chunk-V3HUIZJX.js';
|
|
21
20
|
import { StyledMarkdown } from './chunk-3KMDHCAR.js';
|
|
22
21
|
import { useRouterContext } from './chunk-Q7DJKLEN.js';
|
|
@@ -26,7 +25,6 @@ import { getErrorInfo, formatErrorMessage, getResourceIcon, formatRelativeTime,
|
|
|
26
25
|
import { ResourceStatusColors, toWorkflowLogMessages } from './chunk-KRWALB24.js';
|
|
27
26
|
import { useInitialization } from './chunk-WKJ47GIW.js';
|
|
28
27
|
import { useOrganization } from './chunk-DD3CCMCZ.js';
|
|
29
|
-
import { z } from 'zod';
|
|
30
28
|
import { Stack, Group, Text, Badge, Title, Textarea, Alert, Button, ActionIcon, Collapse, Card, ThemeIcon, SimpleGrid, Divider, Paper, Space, CopyButton, Center, Tooltip, Code, Menu, useMantineTheme, UnstyledButton, Select, RangeSlider, Box, Progress, Tabs, Pagination, TextInput, Modal, LoadingOverlay, Loader, SegmentedControl, ScrollArea, Checkbox, NumberInput, MultiSelect, Switch } from '@mantine/core';
|
|
31
29
|
import { IconBrain, IconFileText, IconMail, IconSend, IconClock, IconArrowUp, IconMessageCircle, IconRocket, IconEye, IconEdit, IconAlertTriangle, IconRefresh, IconX, IconCheck, IconCode, IconAlertCircle, IconChevronRight, IconTool, IconSettings, IconCpu, IconClockHour4, IconVersions, IconPlayerPlay, IconNetwork, IconSitemap, IconCopy, IconPlayerStop, IconReload, IconTrash, IconTerminal2, IconBug, IconChevronDown, IconMessage, IconArrowLeft, IconRobot, IconGitBranch, IconDotsVertical, IconFilter, IconCircleCheck, IconCategory, IconDatabase, IconApps, IconRoute, IconAdjustmentsHorizontal, IconSearch, IconCircleX, IconCircleDashed, IconExternalLink, IconFolders, IconBraces, IconBolt, IconTopologyStar3, IconInfoCircle, IconPlus, IconLayoutSidebarRightExpand, IconNote, IconArchive, IconDownload, IconTimeline, IconActivityHeartbeat, IconClockPause, IconArrowsMaximize, IconShare2, IconHistory } from '@tabler/icons-react';
|
|
32
30
|
import { useForm } from '@mantine/form';
|
|
@@ -42,722 +40,6 @@ import cytoscape from 'cytoscape';
|
|
|
42
40
|
import { create } from 'zustand';
|
|
43
41
|
import { formatDistanceToNow } from 'date-fns';
|
|
44
42
|
|
|
45
|
-
var NodeIdPathSchema = z.string().trim().min(1).max(100).regex(/^([a-z0-9-]+)(\.[a-z0-9-]+)*$/, "Node IDs must be lowercase dotted paths");
|
|
46
|
-
var NodeIdStringSchema = z.string().trim().min(1).max(200).regex(/^[a-z]+:([a-z0-9-]+)(\.[a-z0-9-]+)*$/, "Node references must use kind:dotted-path");
|
|
47
|
-
var UiPositionSchema = z.enum(["sidebar-primary", "sidebar-bottom"]);
|
|
48
|
-
var FeatureSchema = z.object({
|
|
49
|
-
id: NodeIdPathSchema,
|
|
50
|
-
label: LabelSchema,
|
|
51
|
-
description: DescriptionSchema.optional(),
|
|
52
|
-
enabled: z.boolean().default(true),
|
|
53
|
-
path: PathSchema.optional(),
|
|
54
|
-
icon: IconNameSchema.optional(),
|
|
55
|
-
color: ColorTokenSchema.optional(),
|
|
56
|
-
uiPosition: UiPositionSchema.optional(),
|
|
57
|
-
requiresAdmin: z.boolean().optional(),
|
|
58
|
-
devOnly: z.boolean().optional()
|
|
59
|
-
});
|
|
60
|
-
var OrganizationModelBrandingSchema = z.object({
|
|
61
|
-
organizationName: LabelSchema,
|
|
62
|
-
productName: LabelSchema,
|
|
63
|
-
shortName: z.string().trim().min(1).max(40),
|
|
64
|
-
description: DescriptionSchema.optional(),
|
|
65
|
-
logos: z.object({
|
|
66
|
-
light: z.string().trim().min(1).max(2048).optional(),
|
|
67
|
-
dark: z.string().trim().min(1).max(2048).optional()
|
|
68
|
-
}).default({})
|
|
69
|
-
});
|
|
70
|
-
var ProjectsDomainStateSchema = DisplayMetadataSchema.extend({
|
|
71
|
-
id: ModelIdSchema,
|
|
72
|
-
order: z.number().int().min(0)
|
|
73
|
-
});
|
|
74
|
-
var OrganizationModelProjectsSchema = z.object({
|
|
75
|
-
projectEntityId: ModelIdSchema,
|
|
76
|
-
milestoneEntityId: ModelIdSchema,
|
|
77
|
-
taskEntityId: ModelIdSchema,
|
|
78
|
-
projectStatuses: z.array(ProjectsDomainStateSchema).min(1),
|
|
79
|
-
milestoneStatuses: z.array(ProjectsDomainStateSchema).min(1),
|
|
80
|
-
taskStatuses: z.array(ProjectsDomainStateSchema).min(1)
|
|
81
|
-
});
|
|
82
|
-
var SurfaceTypeSchema = z.enum(["page", "dashboard", "graph", "detail", "list", "settings"]);
|
|
83
|
-
var SurfaceDefinitionSchema = z.object({
|
|
84
|
-
id: ModelIdSchema,
|
|
85
|
-
label: LabelSchema,
|
|
86
|
-
path: PathSchema,
|
|
87
|
-
surfaceType: SurfaceTypeSchema,
|
|
88
|
-
description: DescriptionSchema.optional(),
|
|
89
|
-
enabled: z.boolean().default(true),
|
|
90
|
-
devOnly: z.boolean().optional(),
|
|
91
|
-
icon: IconNameSchema.optional(),
|
|
92
|
-
featureId: ModelIdSchema.optional(),
|
|
93
|
-
featureIds: ReferenceIdsSchema,
|
|
94
|
-
entityIds: ReferenceIdsSchema,
|
|
95
|
-
resourceIds: ReferenceIdsSchema,
|
|
96
|
-
capabilityIds: ReferenceIdsSchema,
|
|
97
|
-
parentId: ModelIdSchema.optional()
|
|
98
|
-
});
|
|
99
|
-
var NavigationGroupSchema = z.object({
|
|
100
|
-
id: ModelIdSchema,
|
|
101
|
-
label: LabelSchema,
|
|
102
|
-
placement: z.string().trim().min(1).max(50),
|
|
103
|
-
surfaceIds: z.array(ModelIdSchema).default([])
|
|
104
|
-
});
|
|
105
|
-
var OrganizationModelNavigationSchema = z.object({
|
|
106
|
-
defaultSurfaceId: ModelIdSchema.optional(),
|
|
107
|
-
surfaces: z.array(SurfaceDefinitionSchema).default([]),
|
|
108
|
-
groups: z.array(NavigationGroupSchema).default([])
|
|
109
|
-
});
|
|
110
|
-
var BusinessHoursDaySchema = z.object({
|
|
111
|
-
open: z.string().trim().regex(/^\d{2}:\d{2}$/, "Expected HH:MM format"),
|
|
112
|
-
close: z.string().trim().regex(/^\d{2}:\d{2}$/, "Expected HH:MM format")
|
|
113
|
-
});
|
|
114
|
-
var BusinessHoursSchema = z.object({
|
|
115
|
-
monday: BusinessHoursDaySchema.optional(),
|
|
116
|
-
tuesday: BusinessHoursDaySchema.optional(),
|
|
117
|
-
wednesday: BusinessHoursDaySchema.optional(),
|
|
118
|
-
thursday: BusinessHoursDaySchema.optional(),
|
|
119
|
-
friday: BusinessHoursDaySchema.optional(),
|
|
120
|
-
saturday: BusinessHoursDaySchema.optional(),
|
|
121
|
-
sunday: BusinessHoursDaySchema.optional()
|
|
122
|
-
}).default({});
|
|
123
|
-
var IdentityDomainSchema = z.object({
|
|
124
|
-
/** Why the organization exists — one or two plain-language sentences. */
|
|
125
|
-
mission: z.string().trim().max(1e3).default(""),
|
|
126
|
-
/** Long-term direction the organization is moving toward. */
|
|
127
|
-
vision: z.string().trim().max(1e3).default(""),
|
|
128
|
-
/** Legal registered name of the entity. */
|
|
129
|
-
legalName: z.string().trim().max(200).default(""),
|
|
130
|
-
/**
|
|
131
|
-
* Type of legal entity (e.g. "LLC", "Corporation", "Sole Proprietor",
|
|
132
|
-
* "Non-profit"). Free-form string so it covers any jurisdiction.
|
|
133
|
-
*/
|
|
134
|
-
entityType: z.string().trim().max(100).default(""),
|
|
135
|
-
/**
|
|
136
|
-
* Primary jurisdiction of registration or operation
|
|
137
|
-
* (e.g. "United States – Delaware", "Canada – Ontario").
|
|
138
|
-
*/
|
|
139
|
-
jurisdiction: z.string().trim().max(200).default(""),
|
|
140
|
-
/**
|
|
141
|
-
* Industry category — broad classification (e.g. "Marketing Agency",
|
|
142
|
-
* "Software / SaaS", "Professional Services").
|
|
143
|
-
*/
|
|
144
|
-
industryCategory: z.string().trim().max(200).default(""),
|
|
145
|
-
/**
|
|
146
|
-
* Geographic focus — where the organization primarily operates or serves
|
|
147
|
-
* (e.g. "North America", "Global", "Southeast Asia").
|
|
148
|
-
*/
|
|
149
|
-
geographicFocus: z.string().trim().max(200).default(""),
|
|
150
|
-
/**
|
|
151
|
-
* IANA timezone identifier for the organization's primary operating timezone
|
|
152
|
-
* (e.g. "America/Los_Angeles", "Europe/London", "UTC").
|
|
153
|
-
*/
|
|
154
|
-
timeZone: z.string().trim().max(100).default("UTC"),
|
|
155
|
-
/** Typical operating hours per day of week. Empty object means not configured. */
|
|
156
|
-
businessHours: BusinessHoursSchema,
|
|
157
|
-
/**
|
|
158
|
-
* Long-form markdown capturing client context, problem narrative, and domain
|
|
159
|
-
* background. Populated by /setup; surfaced to agents as organizational context.
|
|
160
|
-
* Optional — many projects have no external client.
|
|
161
|
-
*/
|
|
162
|
-
clientBrief: z.string().trim().default("")
|
|
163
|
-
});
|
|
164
|
-
var DEFAULT_ORGANIZATION_MODEL_IDENTITY = {
|
|
165
|
-
mission: "",
|
|
166
|
-
vision: "",
|
|
167
|
-
legalName: "",
|
|
168
|
-
entityType: "",
|
|
169
|
-
jurisdiction: "",
|
|
170
|
-
industryCategory: "",
|
|
171
|
-
geographicFocus: "",
|
|
172
|
-
timeZone: "UTC",
|
|
173
|
-
businessHours: {},
|
|
174
|
-
clientBrief: ""
|
|
175
|
-
};
|
|
176
|
-
var FirmographicsSchema = z.object({
|
|
177
|
-
/** Industry vertical (e.g. "Marketing Agency", "Legal", "Real Estate"). */
|
|
178
|
-
industry: z.string().trim().max(200).optional(),
|
|
179
|
-
/**
|
|
180
|
-
* Company headcount band (e.g. "1–10", "11–50", "51–200", "200+").
|
|
181
|
-
* Free-form string to accommodate any band notation.
|
|
182
|
-
*/
|
|
183
|
-
companySize: z.string().trim().max(100).optional(),
|
|
184
|
-
/**
|
|
185
|
-
* Primary geographic region the segment operates in or is targeted from
|
|
186
|
-
* (e.g. "North America", "Europe", "Global").
|
|
187
|
-
*/
|
|
188
|
-
region: z.string().trim().max(200).optional()
|
|
189
|
-
});
|
|
190
|
-
var CustomerSegmentSchema = z.object({
|
|
191
|
-
/** Stable unique identifier for the segment (e.g. "segment-smb-agencies"). */
|
|
192
|
-
id: z.string().trim().min(1).max(100),
|
|
193
|
-
/** Human-readable name shown to agents and in UI (e.g. "SMB Marketing Agencies"). */
|
|
194
|
-
name: z.string().trim().max(200).default(""),
|
|
195
|
-
/** One or two sentences describing who this segment is. */
|
|
196
|
-
description: z.string().trim().max(2e3).default(""),
|
|
197
|
-
/**
|
|
198
|
-
* The primary job(s) this segment is trying to get done — the goal they hire
|
|
199
|
-
* a product/service to accomplish. Plain-language narrative or bullet list.
|
|
200
|
-
*/
|
|
201
|
-
jobsToBeDone: z.string().trim().max(2e3).default(""),
|
|
202
|
-
/**
|
|
203
|
-
* Pains — frustrations, obstacles, and risks the segment experiences
|
|
204
|
-
* when trying to accomplish their jobs-to-be-done.
|
|
205
|
-
*/
|
|
206
|
-
pains: z.array(z.string().trim().max(500)).default([]),
|
|
207
|
-
/**
|
|
208
|
-
* Gains — outcomes and benefits the segment desires; positive motivators
|
|
209
|
-
* beyond merely resolving pains.
|
|
210
|
-
*/
|
|
211
|
-
gains: z.array(z.string().trim().max(500)).default([]),
|
|
212
|
-
/** Firmographic profile for targeting and filtering. */
|
|
213
|
-
firmographics: FirmographicsSchema.default({}),
|
|
214
|
-
/**
|
|
215
|
-
* Value proposition — one or two sentences stating why this organization's
|
|
216
|
-
* offering is uniquely suited for this segment's needs.
|
|
217
|
-
*/
|
|
218
|
-
valueProp: z.string().trim().max(2e3).default("")
|
|
219
|
-
});
|
|
220
|
-
var CustomersDomainSchema = z.object({
|
|
221
|
-
segments: z.array(CustomerSegmentSchema).default([])
|
|
222
|
-
});
|
|
223
|
-
var DEFAULT_ORGANIZATION_MODEL_CUSTOMERS = {
|
|
224
|
-
segments: []
|
|
225
|
-
};
|
|
226
|
-
var PricingModelSchema = z.enum(["one-time", "subscription", "usage-based", "custom"]);
|
|
227
|
-
var ProductSchema = z.object({
|
|
228
|
-
/** Stable unique identifier for the product (e.g. "product-starter-plan"). */
|
|
229
|
-
id: z.string().trim().min(1).max(100),
|
|
230
|
-
/** Human-readable name shown to agents and in UI (e.g. "Starter Plan"). */
|
|
231
|
-
name: z.string().trim().max(200).default(""),
|
|
232
|
-
/** One or two sentences describing what this product/service delivers. */
|
|
233
|
-
description: z.string().trim().max(2e3).default(""),
|
|
234
|
-
/**
|
|
235
|
-
* How this product is priced:
|
|
236
|
-
* - "one-time" — single purchase (setup fee, project fee)
|
|
237
|
-
* - "subscription" — recurring (monthly/annual SaaS, retainer)
|
|
238
|
-
* - "usage-based" — metered by consumption (API calls, seats)
|
|
239
|
-
* - "custom" — negotiated or bespoke pricing
|
|
240
|
-
*/
|
|
241
|
-
pricingModel: PricingModelSchema.default("custom"),
|
|
242
|
-
/** Base price amount (≥ 0). Currency unit defined by `currency`. */
|
|
243
|
-
price: z.number().min(0).default(0),
|
|
244
|
-
/**
|
|
245
|
-
* ISO 4217 currency code (e.g. "USD", "EUR", "GBP").
|
|
246
|
-
* Free-form string to accommodate any currency; defaults to "USD".
|
|
247
|
-
*/
|
|
248
|
-
currency: z.string().trim().max(10).default("USD"),
|
|
249
|
-
/**
|
|
250
|
-
* IDs of customer segments this product targets.
|
|
251
|
-
* Each id must reference a declared `customers.segments[].id`.
|
|
252
|
-
* Cross-reference enforced in `OrganizationModelSchema.superRefine()`.
|
|
253
|
-
*/
|
|
254
|
-
targetSegmentIds: z.array(z.string().trim().min(1)).default([]),
|
|
255
|
-
/**
|
|
256
|
-
* Optional: ID of the platform feature responsible for delivering this product.
|
|
257
|
-
* When present, must reference a declared `features[].id`.
|
|
258
|
-
* Cross-reference enforced in `OrganizationModelSchema.superRefine()`.
|
|
259
|
-
*/
|
|
260
|
-
deliveryFeatureId: z.string().trim().min(1).optional()
|
|
261
|
-
});
|
|
262
|
-
var OfferingsDomainSchema = z.object({
|
|
263
|
-
products: z.array(ProductSchema).default([])
|
|
264
|
-
});
|
|
265
|
-
var DEFAULT_ORGANIZATION_MODEL_OFFERINGS = {
|
|
266
|
-
products: []
|
|
267
|
-
};
|
|
268
|
-
var RoleSchema = z.object({
|
|
269
|
-
/** Stable unique identifier for the role (e.g. "role-ceo", "role-head-of-sales"). */
|
|
270
|
-
id: z.string().trim().min(1).max(100),
|
|
271
|
-
/** Human-readable title shown to agents and in UI (e.g. "CEO", "Head of Sales"). */
|
|
272
|
-
title: z.string().trim().min(1).max(200),
|
|
273
|
-
/**
|
|
274
|
-
* List of responsibilities this role owns — plain-language descriptions of
|
|
275
|
-
* what the person in this role is accountable for delivering.
|
|
276
|
-
* Defaults to empty array so minimal role definitions stay concise.
|
|
277
|
-
*/
|
|
278
|
-
responsibilities: z.array(z.string().trim().max(500)).default([]),
|
|
279
|
-
/**
|
|
280
|
-
* Optional: ID of another role this role reports to.
|
|
281
|
-
* When present, must reference another `roles[].id` in the same organization.
|
|
282
|
-
* Cross-reference enforced in `OrganizationModelSchema.superRefine()`.
|
|
283
|
-
* Absence indicates a top-level role (no reporting line).
|
|
284
|
-
*/
|
|
285
|
-
reportsToId: z.string().trim().min(1).max(100).optional(),
|
|
286
|
-
/**
|
|
287
|
-
* Optional: name or email of the person currently holding this role.
|
|
288
|
-
* Free-form string — supports "Alice Johnson", "alice@example.com", or
|
|
289
|
-
* any human-readable identifier. Not validated against any user registry.
|
|
290
|
-
*/
|
|
291
|
-
heldBy: z.string().trim().max(200).optional()
|
|
292
|
-
});
|
|
293
|
-
var RolesDomainSchema = z.object({
|
|
294
|
-
roles: z.array(RoleSchema).default([])
|
|
295
|
-
});
|
|
296
|
-
var DEFAULT_ORGANIZATION_MODEL_ROLES = {
|
|
297
|
-
roles: []
|
|
298
|
-
};
|
|
299
|
-
var KeyResultSchema = z.object({
|
|
300
|
-
/** Stable unique identifier for the measurable outcome (e.g. "kr-revenue-q1"). */
|
|
301
|
-
id: z.string().trim().min(1).max(100),
|
|
302
|
-
/** Plain-language description of this measurable outcome (e.g. "Increase trial-to-paid conversion"). */
|
|
303
|
-
description: z.string().trim().min(1).max(500),
|
|
304
|
-
/**
|
|
305
|
-
* What is being measured — the metric name (e.g. "monthly revenue", "NPS score",
|
|
306
|
-
* "trial-to-paid conversion rate"). Free-form string.
|
|
307
|
-
*/
|
|
308
|
-
targetMetric: z.string().trim().min(1).max(200),
|
|
309
|
-
/** Current measured value. Defaults to 0 when not yet tracked. */
|
|
310
|
-
currentValue: z.number().default(0),
|
|
311
|
-
/**
|
|
312
|
-
* Target value to reach for this measurable outcome to be considered achieved.
|
|
313
|
-
* Optional — omit if the outcome is directional (e.g. "reduce churn") without
|
|
314
|
-
* a hard numeric target.
|
|
315
|
-
*/
|
|
316
|
-
targetValue: z.number().optional()
|
|
317
|
-
});
|
|
318
|
-
var ISO_DATE_REGEX = /^\d{4}-\d{2}-\d{2}$/;
|
|
319
|
-
var ObjectiveSchema = z.object({
|
|
320
|
-
/** Stable unique identifier for the goal (e.g. "goal-grow-arr-q1-2026"). */
|
|
321
|
-
id: z.string().trim().min(1).max(100),
|
|
322
|
-
/** Plain-language description of what the organization wants to achieve. */
|
|
323
|
-
description: z.string().trim().min(1).max(1e3),
|
|
324
|
-
/**
|
|
325
|
-
* Start of the period this goal is active for — ISO 8601 date string (YYYY-MM-DD).
|
|
326
|
-
* Must be strictly before `periodEnd`.
|
|
327
|
-
*/
|
|
328
|
-
periodStart: z.string().regex(ISO_DATE_REGEX, "periodStart must be an ISO date string (YYYY-MM-DD)"),
|
|
329
|
-
/**
|
|
330
|
-
* End of the period this goal is active for — ISO 8601 date string (YYYY-MM-DD).
|
|
331
|
-
* Must be strictly after `periodStart`.
|
|
332
|
-
* Enforced via `OrganizationModelSchema.superRefine()`.
|
|
333
|
-
*/
|
|
334
|
-
periodEnd: z.string().regex(ISO_DATE_REGEX, "periodEnd must be an ISO date string (YYYY-MM-DD)"),
|
|
335
|
-
/**
|
|
336
|
-
* List of measurable outcomes that define success for this goal.
|
|
337
|
-
* Defaults to empty array so goals can be declared before outcomes are defined.
|
|
338
|
-
*/
|
|
339
|
-
keyResults: z.array(KeyResultSchema).default([])
|
|
340
|
-
});
|
|
341
|
-
var GoalsDomainSchema = z.object({
|
|
342
|
-
objectives: z.array(ObjectiveSchema).default([])
|
|
343
|
-
});
|
|
344
|
-
var DEFAULT_ORGANIZATION_MODEL_GOALS = {
|
|
345
|
-
objectives: []
|
|
346
|
-
};
|
|
347
|
-
var OperationSemanticClassSchema = z.enum(["queue", "executions", "sessions", "notifications", "schedules"]);
|
|
348
|
-
var OperationEntrySchema = z.object({
|
|
349
|
-
id: z.string().trim().min(1).max(100),
|
|
350
|
-
label: z.string().trim().min(1).max(120),
|
|
351
|
-
semanticClass: OperationSemanticClassSchema,
|
|
352
|
-
/** Optional reference to the feature that owns this runtime entity. */
|
|
353
|
-
featureId: z.string().trim().min(1).max(100).optional(),
|
|
354
|
-
/**
|
|
355
|
-
* Optional pointer to the status semanticClass values that apply to this
|
|
356
|
-
* entity — ties operations back to the statuses domain for vibe rendering.
|
|
357
|
-
*/
|
|
358
|
-
supportedStatusSemanticClass: z.array(z.string().trim().min(1).max(80)).optional()
|
|
359
|
-
});
|
|
360
|
-
var OperationsDomainSchema = z.object({
|
|
361
|
-
entries: z.array(OperationEntrySchema).default([])
|
|
362
|
-
});
|
|
363
|
-
var StatusSemanticClassSchema = z.enum([
|
|
364
|
-
"delivery.task",
|
|
365
|
-
"delivery.project",
|
|
366
|
-
"delivery.milestone",
|
|
367
|
-
"queue",
|
|
368
|
-
"execution",
|
|
369
|
-
"schedule",
|
|
370
|
-
"schedule.run",
|
|
371
|
-
"request"
|
|
372
|
-
]);
|
|
373
|
-
var StatusEntrySchema = z.object({
|
|
374
|
-
id: z.string().trim().min(1).max(100),
|
|
375
|
-
label: z.string().trim().min(1).max(120),
|
|
376
|
-
semanticClass: StatusSemanticClassSchema,
|
|
377
|
-
category: z.string().trim().min(1).max(80).optional()
|
|
378
|
-
});
|
|
379
|
-
var StatusesDomainSchema = z.object({
|
|
380
|
-
entries: z.array(StatusEntrySchema).default([])
|
|
381
|
-
});
|
|
382
|
-
var KnowledgeLinkSchema = z.object({
|
|
383
|
-
nodeId: NodeIdStringSchema
|
|
384
|
-
});
|
|
385
|
-
var OrgKnowledgeKindSchema = z.enum(["playbook", "strategy", "reference"]);
|
|
386
|
-
var OrgKnowledgeNodeSchema = z.object({
|
|
387
|
-
id: ModelIdSchema,
|
|
388
|
-
kind: OrgKnowledgeKindSchema,
|
|
389
|
-
title: z.string().trim().min(1).max(200),
|
|
390
|
-
summary: z.string().trim().min(1).max(1e3),
|
|
391
|
-
/** Raw MDX string. Phase 2 will introduce a structured block format. */
|
|
392
|
-
body: z.string().trim().min(1),
|
|
393
|
-
/**
|
|
394
|
-
* Graph links to other OM nodes this knowledge node governs.
|
|
395
|
-
* Each link emits a `governs` edge: knowledge-node -> target node.
|
|
396
|
-
*/
|
|
397
|
-
links: z.array(KnowledgeLinkSchema).default([]),
|
|
398
|
-
/** Identifiers of the roles or members who own this knowledge node. */
|
|
399
|
-
ownerIds: z.array(ModelIdSchema).default([]),
|
|
400
|
-
/** ISO date string (YYYY-MM-DD or full ISO 8601) of last meaningful update. */
|
|
401
|
-
updatedAt: z.string().trim().min(1).max(50)
|
|
402
|
-
});
|
|
403
|
-
var KnowledgeDomainSchema = z.object({
|
|
404
|
-
nodes: z.array(OrgKnowledgeNodeSchema).default([])
|
|
405
|
-
});
|
|
406
|
-
|
|
407
|
-
// ../core/src/organization-model/schema.ts
|
|
408
|
-
var OrganizationModelSchemaBase = z.object({
|
|
409
|
-
version: z.literal(1).default(1),
|
|
410
|
-
features: z.array(FeatureSchema).default([]),
|
|
411
|
-
branding: OrganizationModelBrandingSchema,
|
|
412
|
-
navigation: OrganizationModelNavigationSchema.default({ surfaces: [], groups: [] }),
|
|
413
|
-
sales: OrganizationModelSalesSchema,
|
|
414
|
-
prospecting: OrganizationModelProspectingSchema,
|
|
415
|
-
projects: OrganizationModelProjectsSchema,
|
|
416
|
-
identity: IdentityDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_IDENTITY),
|
|
417
|
-
customers: CustomersDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_CUSTOMERS),
|
|
418
|
-
offerings: OfferingsDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_OFFERINGS),
|
|
419
|
-
roles: RolesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_ROLES),
|
|
420
|
-
goals: GoalsDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_GOALS),
|
|
421
|
-
statuses: StatusesDomainSchema.default({ entries: [] }),
|
|
422
|
-
operations: OperationsDomainSchema.default({ entries: [] }),
|
|
423
|
-
knowledge: KnowledgeDomainSchema.default({ nodes: [] })
|
|
424
|
-
});
|
|
425
|
-
function addIssue(ctx, path, message) {
|
|
426
|
-
ctx.addIssue({
|
|
427
|
-
code: z.ZodIssueCode.custom,
|
|
428
|
-
path,
|
|
429
|
-
message
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
function collectIds(items, ctx, collectionPath, label) {
|
|
433
|
-
const itemsById = /* @__PURE__ */ new Map();
|
|
434
|
-
items.forEach((item, index) => {
|
|
435
|
-
if (itemsById.has(item.id)) {
|
|
436
|
-
addIssue(ctx, [...collectionPath, index, "id"], `${label} id "${item.id}" must be unique`);
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
itemsById.set(item.id, item);
|
|
440
|
-
});
|
|
441
|
-
return itemsById;
|
|
442
|
-
}
|
|
443
|
-
var LEGACY_FEATURE_ALIASES = /* @__PURE__ */ new Map([
|
|
444
|
-
["crm", "sales.crm"],
|
|
445
|
-
["lead-gen", "sales.lead-gen"],
|
|
446
|
-
["submitted-requests", "monitoring.submitted-requests"]
|
|
447
|
-
]);
|
|
448
|
-
function hasFeature(featuresById, featureId) {
|
|
449
|
-
return featuresById.has(featureId) || featuresById.has(LEGACY_FEATURE_ALIASES.get(featureId) ?? "");
|
|
450
|
-
}
|
|
451
|
-
var OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ctx) => {
|
|
452
|
-
const featuresById = collectIds(model.features, ctx, ["features"], "Feature");
|
|
453
|
-
model.features.forEach((feature, featureIndex) => {
|
|
454
|
-
const segments = feature.id.split(".");
|
|
455
|
-
if (segments.length > 1) {
|
|
456
|
-
const parentId = segments.slice(0, -1).join(".");
|
|
457
|
-
if (!featuresById.has(parentId)) {
|
|
458
|
-
addIssue(
|
|
459
|
-
ctx,
|
|
460
|
-
["features", featureIndex, "id"],
|
|
461
|
-
`Feature "${feature.id}" references unknown parent "${parentId}"`
|
|
462
|
-
);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
const hasChildren = model.features.some(
|
|
466
|
-
(candidate) => candidate.id.startsWith(`${feature.id}.`) && candidate.id !== feature.id
|
|
467
|
-
);
|
|
468
|
-
if (hasChildren && feature.enabled) {
|
|
469
|
-
const hasEnabledDescendant = model.features.some(
|
|
470
|
-
(candidate) => candidate.id.startsWith(`${feature.id}.`) && candidate.enabled
|
|
471
|
-
);
|
|
472
|
-
if (!hasEnabledDescendant) {
|
|
473
|
-
addIssue(
|
|
474
|
-
ctx,
|
|
475
|
-
["features", featureIndex, "enabled"],
|
|
476
|
-
`Feature "${feature.id}" is enabled but has no enabled descendants`
|
|
477
|
-
);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
});
|
|
481
|
-
const segmentsById = new Map(model.customers.segments.map((seg) => [seg.id, seg]));
|
|
482
|
-
model.offerings.products.forEach((product, productIndex) => {
|
|
483
|
-
product.targetSegmentIds.forEach((segmentId, segmentIndex) => {
|
|
484
|
-
if (!segmentsById.has(segmentId)) {
|
|
485
|
-
addIssue(
|
|
486
|
-
ctx,
|
|
487
|
-
["offerings", "products", productIndex, "targetSegmentIds", segmentIndex],
|
|
488
|
-
`Product "${product.id}" references unknown customer segment "${segmentId}"`
|
|
489
|
-
);
|
|
490
|
-
}
|
|
491
|
-
});
|
|
492
|
-
if (product.deliveryFeatureId !== void 0 && !hasFeature(featuresById, product.deliveryFeatureId)) {
|
|
493
|
-
addIssue(
|
|
494
|
-
ctx,
|
|
495
|
-
["offerings", "products", productIndex, "deliveryFeatureId"],
|
|
496
|
-
`Product "${product.id}" references unknown delivery feature "${product.deliveryFeatureId}"`
|
|
497
|
-
);
|
|
498
|
-
}
|
|
499
|
-
});
|
|
500
|
-
model.goals.objectives.forEach((objective, index) => {
|
|
501
|
-
if (objective.periodEnd <= objective.periodStart) {
|
|
502
|
-
addIssue(
|
|
503
|
-
ctx,
|
|
504
|
-
["goals", "objectives", index, "periodEnd"],
|
|
505
|
-
`Goal "${objective.id}" has periodEnd "${objective.periodEnd}" which must be strictly after periodStart "${objective.periodStart}"`
|
|
506
|
-
);
|
|
507
|
-
}
|
|
508
|
-
});
|
|
509
|
-
const rolesById = new Map(model.roles.roles.map((role) => [role.id, role]));
|
|
510
|
-
model.roles.roles.forEach((role, roleIndex) => {
|
|
511
|
-
if (role.reportsToId !== void 0 && !rolesById.has(role.reportsToId)) {
|
|
512
|
-
addIssue(
|
|
513
|
-
ctx,
|
|
514
|
-
["roles", "roles", roleIndex, "reportsToId"],
|
|
515
|
-
`Role "${role.id}" references unknown reportsToId "${role.reportsToId}"`
|
|
516
|
-
);
|
|
517
|
-
}
|
|
518
|
-
});
|
|
519
|
-
});
|
|
520
|
-
|
|
521
|
-
// ../core/src/organization-model/graph/schema.ts
|
|
522
|
-
var OrganizationGraphNodeKindSchema = z.enum([
|
|
523
|
-
"organization",
|
|
524
|
-
"feature",
|
|
525
|
-
"surface",
|
|
526
|
-
"entity",
|
|
527
|
-
"capability",
|
|
528
|
-
"resource",
|
|
529
|
-
"knowledge"
|
|
530
|
-
]);
|
|
531
|
-
var OrganizationGraphEdgeKindSchema = z.enum([
|
|
532
|
-
"contains",
|
|
533
|
-
"references",
|
|
534
|
-
"exposes",
|
|
535
|
-
"maps_to",
|
|
536
|
-
"operates-on",
|
|
537
|
-
"uses",
|
|
538
|
-
"governs"
|
|
539
|
-
]);
|
|
540
|
-
var OrganizationGraphNodeSchema = z.object({
|
|
541
|
-
id: z.string().trim().min(1).max(200),
|
|
542
|
-
kind: OrganizationGraphNodeKindSchema,
|
|
543
|
-
label: LabelSchema,
|
|
544
|
-
sourceId: z.string().trim().min(1).max(255).optional(),
|
|
545
|
-
description: DescriptionSchema.optional(),
|
|
546
|
-
enabled: z.boolean().optional(),
|
|
547
|
-
featureId: z.string().trim().min(1).max(100).optional(),
|
|
548
|
-
resourceType: z.enum(["workflow", "agent", "trigger", "integration", "external", "human_checkpoint"]).optional()
|
|
549
|
-
});
|
|
550
|
-
var OrganizationGraphEdgeSchema = z.object({
|
|
551
|
-
id: z.string().trim().min(1).max(250),
|
|
552
|
-
kind: OrganizationGraphEdgeKindSchema,
|
|
553
|
-
sourceId: z.string().trim().min(1).max(200),
|
|
554
|
-
targetId: z.string().trim().min(1).max(200),
|
|
555
|
-
label: z.string().trim().min(1).max(120).optional(),
|
|
556
|
-
relationshipType: z.enum(["triggers", "uses", "approval"]).optional()
|
|
557
|
-
});
|
|
558
|
-
var OrganizationGraphSchema = z.object({
|
|
559
|
-
version: z.literal(1),
|
|
560
|
-
organizationModelVersion: OrganizationModelSchema.shape.version,
|
|
561
|
-
nodes: z.array(OrganizationGraphNodeSchema),
|
|
562
|
-
edges: z.array(OrganizationGraphEdgeSchema)
|
|
563
|
-
});
|
|
564
|
-
var BuildOrganizationGraphInputSchema = z.object({
|
|
565
|
-
organizationModel: OrganizationModelSchema,
|
|
566
|
-
commandViewData: z.unknown().optional()
|
|
567
|
-
});
|
|
568
|
-
|
|
569
|
-
// ../core/src/organization-model/graph/build.ts
|
|
570
|
-
function nodeId(kind, sourceId) {
|
|
571
|
-
return kind === "organization" ? "organization-model" : `${kind}:${sourceId ?? ""}`;
|
|
572
|
-
}
|
|
573
|
-
function edgeId(kind, sourceId, targetId, variant) {
|
|
574
|
-
return variant ? `edge:${kind}:${variant}:${sourceId}:${targetId}` : `edge:${kind}:${sourceId}:${targetId}`;
|
|
575
|
-
}
|
|
576
|
-
function pushUniqueNode(nodes, seen, node) {
|
|
577
|
-
if (seen.has(node.id)) return;
|
|
578
|
-
seen.add(node.id);
|
|
579
|
-
nodes.push(node);
|
|
580
|
-
}
|
|
581
|
-
function pushUniqueEdge(edges, seen, edge) {
|
|
582
|
-
if (seen.has(edge.id)) return;
|
|
583
|
-
seen.add(edge.id);
|
|
584
|
-
edges.push(edge);
|
|
585
|
-
}
|
|
586
|
-
function upsertResourceNode(nodes, seen, resourceNodesById, node) {
|
|
587
|
-
const existing = resourceNodesById.get(node.id);
|
|
588
|
-
if (existing) {
|
|
589
|
-
if (!existing.label || existing.label === existing.sourceId) {
|
|
590
|
-
existing.label = node.label;
|
|
591
|
-
}
|
|
592
|
-
if (!existing.description && node.description) {
|
|
593
|
-
existing.description = node.description;
|
|
594
|
-
}
|
|
595
|
-
if (!existing.sourceId && node.sourceId) {
|
|
596
|
-
existing.sourceId = node.sourceId;
|
|
597
|
-
}
|
|
598
|
-
if (!existing.resourceType && node.resourceType) {
|
|
599
|
-
existing.resourceType = node.resourceType;
|
|
600
|
-
}
|
|
601
|
-
return existing;
|
|
602
|
-
}
|
|
603
|
-
resourceNodesById.set(node.id, node);
|
|
604
|
-
pushUniqueNode(nodes, seen, node);
|
|
605
|
-
return node;
|
|
606
|
-
}
|
|
607
|
-
function ensureResourceNode(nodes, seen, resourceNodesById, resourceId) {
|
|
608
|
-
const existing = resourceNodesById.get(nodeId("resource", resourceId));
|
|
609
|
-
if (existing) return existing;
|
|
610
|
-
return upsertResourceNode(nodes, seen, resourceNodesById, {
|
|
611
|
-
id: nodeId("resource", resourceId),
|
|
612
|
-
kind: "resource",
|
|
613
|
-
label: resourceId,
|
|
614
|
-
sourceId: resourceId
|
|
615
|
-
});
|
|
616
|
-
}
|
|
617
|
-
function normalizeCommandViewResourceType(resourceType) {
|
|
618
|
-
return resourceType === "human" ? "human_checkpoint" : resourceType;
|
|
619
|
-
}
|
|
620
|
-
function collectCommandViewResources(commandViewData) {
|
|
621
|
-
return [
|
|
622
|
-
...commandViewData.workflows,
|
|
623
|
-
...commandViewData.agents,
|
|
624
|
-
...commandViewData.triggers,
|
|
625
|
-
...commandViewData.integrations,
|
|
626
|
-
...commandViewData.externalResources,
|
|
627
|
-
...commandViewData.humanCheckpoints
|
|
628
|
-
];
|
|
629
|
-
}
|
|
630
|
-
function pushResourceLinks(edges, edgeIds, resourceNodeId, links) {
|
|
631
|
-
for (const link of links ?? []) {
|
|
632
|
-
pushUniqueEdge(edges, edgeIds, {
|
|
633
|
-
id: edgeId(link.kind, resourceNodeId, link.nodeId),
|
|
634
|
-
kind: link.kind,
|
|
635
|
-
sourceId: resourceNodeId,
|
|
636
|
-
targetId: link.nodeId
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
function buildOrganizationGraph(input) {
|
|
641
|
-
const parsed = BuildOrganizationGraphInputSchema.parse(input);
|
|
642
|
-
const organizationModel = parsed.organizationModel;
|
|
643
|
-
const commandViewData = parsed.commandViewData;
|
|
644
|
-
const nodes = [];
|
|
645
|
-
const edges = [];
|
|
646
|
-
const nodeIds = /* @__PURE__ */ new Set();
|
|
647
|
-
const edgeIds = /* @__PURE__ */ new Set();
|
|
648
|
-
const resourceNodesById = /* @__PURE__ */ new Map();
|
|
649
|
-
const organizationNode = {
|
|
650
|
-
id: nodeId("organization"),
|
|
651
|
-
kind: "organization",
|
|
652
|
-
label: "Organization Model"
|
|
653
|
-
};
|
|
654
|
-
pushUniqueNode(nodes, nodeIds, organizationNode);
|
|
655
|
-
for (const feature of [...organizationModel.features].sort((a, b) => a.id.localeCompare(b.id))) {
|
|
656
|
-
const id = nodeId("feature", feature.id);
|
|
657
|
-
pushUniqueNode(nodes, nodeIds, {
|
|
658
|
-
id,
|
|
659
|
-
kind: "feature",
|
|
660
|
-
label: feature.label,
|
|
661
|
-
sourceId: feature.id,
|
|
662
|
-
description: feature.description,
|
|
663
|
-
enabled: feature.enabled,
|
|
664
|
-
featureId: feature.id
|
|
665
|
-
});
|
|
666
|
-
pushUniqueEdge(edges, edgeIds, {
|
|
667
|
-
id: edgeId("contains", organizationNode.id, id),
|
|
668
|
-
kind: "contains",
|
|
669
|
-
sourceId: organizationNode.id,
|
|
670
|
-
targetId: id
|
|
671
|
-
});
|
|
672
|
-
const parentId = feature.id.includes(".") ? feature.id.slice(0, feature.id.lastIndexOf(".")) : void 0;
|
|
673
|
-
if (parentId) {
|
|
674
|
-
pushUniqueEdge(edges, edgeIds, {
|
|
675
|
-
id: edgeId("contains", nodeId("feature", parentId), id),
|
|
676
|
-
kind: "contains",
|
|
677
|
-
sourceId: nodeId("feature", parentId),
|
|
678
|
-
targetId: id
|
|
679
|
-
});
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
for (const node of [...organizationModel.knowledge?.nodes ?? []].sort((a, b) => a.id.localeCompare(b.id))) {
|
|
683
|
-
const id = nodeId("knowledge", node.id);
|
|
684
|
-
pushUniqueNode(nodes, nodeIds, {
|
|
685
|
-
id,
|
|
686
|
-
kind: "knowledge",
|
|
687
|
-
label: node.title,
|
|
688
|
-
sourceId: node.id,
|
|
689
|
-
description: node.summary
|
|
690
|
-
});
|
|
691
|
-
pushUniqueEdge(edges, edgeIds, {
|
|
692
|
-
id: edgeId("contains", organizationNode.id, id),
|
|
693
|
-
kind: "contains",
|
|
694
|
-
sourceId: organizationNode.id,
|
|
695
|
-
targetId: id
|
|
696
|
-
});
|
|
697
|
-
for (const link of node.links) {
|
|
698
|
-
pushUniqueEdge(edges, edgeIds, {
|
|
699
|
-
id: edgeId("governs", id, link.nodeId),
|
|
700
|
-
kind: "governs",
|
|
701
|
-
sourceId: id,
|
|
702
|
-
targetId: link.nodeId
|
|
703
|
-
});
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
if (commandViewData) {
|
|
707
|
-
const commandViewResources = collectCommandViewResources(commandViewData).sort(
|
|
708
|
-
(a, b) => a.resourceId.localeCompare(b.resourceId)
|
|
709
|
-
);
|
|
710
|
-
for (const resource of commandViewResources) {
|
|
711
|
-
const id = nodeId("resource", resource.resourceId);
|
|
712
|
-
const resourceNode = upsertResourceNode(nodes, nodeIds, resourceNodesById, {
|
|
713
|
-
id,
|
|
714
|
-
kind: "resource",
|
|
715
|
-
label: resource.name,
|
|
716
|
-
sourceId: resource.resourceId,
|
|
717
|
-
description: resource.description,
|
|
718
|
-
resourceType: normalizeCommandViewResourceType(resource.type)
|
|
719
|
-
});
|
|
720
|
-
pushUniqueEdge(edges, edgeIds, {
|
|
721
|
-
id: edgeId("contains", organizationNode.id, resourceNode.id),
|
|
722
|
-
kind: "contains",
|
|
723
|
-
sourceId: organizationNode.id,
|
|
724
|
-
targetId: resourceNode.id
|
|
725
|
-
});
|
|
726
|
-
pushResourceLinks(edges, edgeIds, resourceNode.id, resource.links);
|
|
727
|
-
}
|
|
728
|
-
for (const relationship of [...commandViewData.edges].sort((a, b) => a.id.localeCompare(b.id))) {
|
|
729
|
-
const sourceNode = ensureResourceNode(nodes, nodeIds, resourceNodesById, relationship.source);
|
|
730
|
-
const targetNode = ensureResourceNode(nodes, nodeIds, resourceNodesById, relationship.target);
|
|
731
|
-
pushUniqueEdge(edges, edgeIds, {
|
|
732
|
-
id: edgeId("contains", organizationNode.id, sourceNode.id),
|
|
733
|
-
kind: "contains",
|
|
734
|
-
sourceId: organizationNode.id,
|
|
735
|
-
targetId: sourceNode.id
|
|
736
|
-
});
|
|
737
|
-
pushUniqueEdge(edges, edgeIds, {
|
|
738
|
-
id: edgeId("contains", organizationNode.id, targetNode.id),
|
|
739
|
-
kind: "contains",
|
|
740
|
-
sourceId: organizationNode.id,
|
|
741
|
-
targetId: targetNode.id
|
|
742
|
-
});
|
|
743
|
-
pushUniqueEdge(edges, edgeIds, {
|
|
744
|
-
id: edgeId("references", sourceNode.id, targetNode.id, relationship.relationship),
|
|
745
|
-
kind: "references",
|
|
746
|
-
sourceId: sourceNode.id,
|
|
747
|
-
targetId: targetNode.id,
|
|
748
|
-
label: relationship.relationship,
|
|
749
|
-
relationshipType: relationship.relationship
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
const graph = {
|
|
754
|
-
version: 1,
|
|
755
|
-
organizationModelVersion: organizationModel.version,
|
|
756
|
-
nodes,
|
|
757
|
-
edges
|
|
758
|
-
};
|
|
759
|
-
return OrganizationGraphSchema.parse(graph);
|
|
760
|
-
}
|
|
761
43
|
var iconMap = {
|
|
762
44
|
IconCheck,
|
|
763
45
|
IconX,
|
|
@@ -4980,8 +4262,8 @@ function isTopologyEdge(edge) {
|
|
|
4980
4262
|
function isSemanticEdge(edge) {
|
|
4981
4263
|
return !isTopologyEdge(edge);
|
|
4982
4264
|
}
|
|
4983
|
-
function getIncidentEdges(graph,
|
|
4984
|
-
return graph.edges.filter((edge) => edge.sourceId ===
|
|
4265
|
+
function getIncidentEdges(graph, nodeId) {
|
|
4266
|
+
return graph.edges.filter((edge) => edge.sourceId === nodeId || edge.targetId === nodeId);
|
|
4985
4267
|
}
|
|
4986
4268
|
function createOrganizationGraphFilters(partial) {
|
|
4987
4269
|
return {
|
|
@@ -5205,14 +4487,14 @@ function filterOrganizationGraph(graph, filters, options) {
|
|
|
5205
4487
|
function getCommandViewResourceCategory(node, commandViewData) {
|
|
5206
4488
|
return getCommandViewNodeForGraphNode(node, commandViewData)?.category ?? null;
|
|
5207
4489
|
}
|
|
5208
|
-
function getConnectedHiddenResourceIds(graph,
|
|
5209
|
-
if (!
|
|
4490
|
+
function getConnectedHiddenResourceIds(graph, nodeId, hiddenIds) {
|
|
4491
|
+
if (!nodeId) {
|
|
5210
4492
|
return /* @__PURE__ */ new Set();
|
|
5211
4493
|
}
|
|
5212
4494
|
const nodesById = new Map(graph.nodes.map((node) => [node.id, node]));
|
|
5213
4495
|
const connectedIds = /* @__PURE__ */ new Set();
|
|
5214
4496
|
for (const edge of graph.edges) {
|
|
5215
|
-
const neighborId = edge.sourceId ===
|
|
4497
|
+
const neighborId = edge.sourceId === nodeId ? edge.targetId : edge.targetId === nodeId ? edge.sourceId : null;
|
|
5216
4498
|
if (!neighborId || !hiddenIds.has(neighborId)) {
|
|
5217
4499
|
continue;
|
|
5218
4500
|
}
|
|
@@ -6134,18 +5416,18 @@ function getOppositeNodeId(edge, currentNodeId) {
|
|
|
6134
5416
|
}
|
|
6135
5417
|
return null;
|
|
6136
5418
|
}
|
|
6137
|
-
function getCandidateEdges(index,
|
|
5419
|
+
function getCandidateEdges(index, nodeId, direction) {
|
|
6138
5420
|
if (direction === "outgoing") {
|
|
6139
|
-
return index.outgoingEdgesByNodeId.get(
|
|
5421
|
+
return index.outgoingEdgesByNodeId.get(nodeId) ?? [];
|
|
6140
5422
|
}
|
|
6141
5423
|
if (direction === "incoming") {
|
|
6142
|
-
return index.incomingEdgesByNodeId.get(
|
|
5424
|
+
return index.incomingEdgesByNodeId.get(nodeId) ?? [];
|
|
6143
5425
|
}
|
|
6144
5426
|
const seenEdgeIds = /* @__PURE__ */ new Set();
|
|
6145
5427
|
const edges = [];
|
|
6146
5428
|
for (const edge of [
|
|
6147
|
-
...index.outgoingEdgesByNodeId.get(
|
|
6148
|
-
...index.incomingEdgesByNodeId.get(
|
|
5429
|
+
...index.outgoingEdgesByNodeId.get(nodeId) ?? [],
|
|
5430
|
+
...index.incomingEdgesByNodeId.get(nodeId) ?? []
|
|
6149
5431
|
]) {
|
|
6150
5432
|
if (seenEdgeIds.has(edge.id)) {
|
|
6151
5433
|
continue;
|
|
@@ -6301,7 +5583,7 @@ function expandAroundGraph(graph, request, options = {}) {
|
|
|
6301
5583
|
queue.push({ nodeId: nextNode.id, depth: nextDepth });
|
|
6302
5584
|
}
|
|
6303
5585
|
}
|
|
6304
|
-
const expandedNodes = [...expandedNodeIds].map((
|
|
5586
|
+
const expandedNodes = [...expandedNodeIds].map((nodeId) => index.nodesById.get(nodeId)).filter((node) => Boolean(node));
|
|
6305
5587
|
const hiddenResourceNodes = expandedNodes.filter((node) => hiddenResourceNodeIds.has(node.id)).length;
|
|
6306
5588
|
const alreadyVisibleNodes = expandedNodes.filter((node) => alreadyVisibleNodeIds.has(node.id)).length;
|
|
6307
5589
|
const newNodes = expandedNodes.filter(
|
|
@@ -6329,7 +5611,7 @@ function expandAroundGraph(graph, request, options = {}) {
|
|
|
6329
5611
|
maxResults: resolved.maxResults,
|
|
6330
5612
|
expandedNodeIds: [...expandedNodeIds],
|
|
6331
5613
|
expandedEdgeIds: [...expandedEdgeIds],
|
|
6332
|
-
frontierNodeIds: [...frontierNodeIds].filter((
|
|
5614
|
+
frontierNodeIds: [...frontierNodeIds].filter((nodeId) => nodeId !== resolved.rootNodeId),
|
|
6333
5615
|
truncated,
|
|
6334
5616
|
counts,
|
|
6335
5617
|
summaryMessages,
|
|
@@ -7499,14 +6781,14 @@ function syncGraphClasses(cy, selectedElement, traceResult, hiddenIds, hiddenEdg
|
|
|
7499
6781
|
cy.elements().removeClass(
|
|
7500
6782
|
"is-hidden is-faded is-context is-selected is-connected is-trace-node is-trace-edge is-trace-endpoint is-expanded-node is-expanded-edge"
|
|
7501
6783
|
);
|
|
7502
|
-
for (const
|
|
7503
|
-
const node = cy.getElementById(
|
|
6784
|
+
for (const nodeId of hiddenIds) {
|
|
6785
|
+
const node = cy.getElementById(nodeId);
|
|
7504
6786
|
if (!node.empty()) {
|
|
7505
6787
|
node.addClass("is-hidden");
|
|
7506
6788
|
}
|
|
7507
6789
|
}
|
|
7508
|
-
for (const
|
|
7509
|
-
const edge2 = cy.getElementById(
|
|
6790
|
+
for (const edgeId of hiddenEdgeIds) {
|
|
6791
|
+
const edge2 = cy.getElementById(edgeId);
|
|
7510
6792
|
if (!edge2.empty()) {
|
|
7511
6793
|
edge2.addClass("is-hidden");
|
|
7512
6794
|
}
|
|
@@ -7515,14 +6797,14 @@ function syncGraphClasses(cy, selectedElement, traceResult, hiddenIds, hiddenEdg
|
|
|
7515
6797
|
traceResult && (traceResult.highlightNodeIds.length > 0 || traceResult.highlightEdgeIds.length > 0)
|
|
7516
6798
|
);
|
|
7517
6799
|
if (!selectedElement && !hasTrace) {
|
|
7518
|
-
for (const
|
|
7519
|
-
const node = cy.getElementById(
|
|
6800
|
+
for (const nodeId of expandedNodeIds) {
|
|
6801
|
+
const node = cy.getElementById(nodeId);
|
|
7520
6802
|
if (!node.empty()) {
|
|
7521
6803
|
node.addClass("is-expanded-node");
|
|
7522
6804
|
}
|
|
7523
6805
|
}
|
|
7524
|
-
for (const
|
|
7525
|
-
const edge2 = cy.getElementById(
|
|
6806
|
+
for (const edgeId of expandedEdgeIds) {
|
|
6807
|
+
const edge2 = cy.getElementById(edgeId);
|
|
7526
6808
|
if (!edge2.empty()) {
|
|
7527
6809
|
edge2.addClass("is-expanded-edge");
|
|
7528
6810
|
}
|
|
@@ -7530,27 +6812,27 @@ function syncGraphClasses(cy, selectedElement, traceResult, hiddenIds, hiddenEdg
|
|
|
7530
6812
|
return;
|
|
7531
6813
|
}
|
|
7532
6814
|
cy.elements().addClass("is-faded");
|
|
7533
|
-
for (const
|
|
7534
|
-
const node = cy.getElementById(
|
|
6815
|
+
for (const nodeId of expandedNodeIds) {
|
|
6816
|
+
const node = cy.getElementById(nodeId);
|
|
7535
6817
|
if (!node.empty()) {
|
|
7536
6818
|
node.removeClass("is-faded").addClass("is-context is-expanded-node");
|
|
7537
6819
|
}
|
|
7538
6820
|
}
|
|
7539
|
-
for (const
|
|
7540
|
-
const edge2 = cy.getElementById(
|
|
6821
|
+
for (const edgeId of expandedEdgeIds) {
|
|
6822
|
+
const edge2 = cy.getElementById(edgeId);
|
|
7541
6823
|
if (!edge2.empty()) {
|
|
7542
6824
|
edge2.removeClass("is-faded").addClass("is-connected is-expanded-edge");
|
|
7543
6825
|
}
|
|
7544
6826
|
}
|
|
7545
6827
|
if (traceResult) {
|
|
7546
|
-
for (const
|
|
7547
|
-
const node = cy.getElementById(
|
|
6828
|
+
for (const nodeId of traceResult.highlightNodeIds) {
|
|
6829
|
+
const node = cy.getElementById(nodeId);
|
|
7548
6830
|
if (!node.empty()) {
|
|
7549
6831
|
node.removeClass("is-faded").addClass("is-context is-trace-node");
|
|
7550
6832
|
}
|
|
7551
6833
|
}
|
|
7552
|
-
for (const
|
|
7553
|
-
const edge2 = cy.getElementById(
|
|
6834
|
+
for (const edgeId of traceResult.highlightEdgeIds) {
|
|
6835
|
+
const edge2 = cy.getElementById(edgeId);
|
|
7554
6836
|
if (!edge2.empty()) {
|
|
7555
6837
|
edge2.removeClass("is-faded").addClass("is-connected is-trace-edge");
|
|
7556
6838
|
}
|
|
@@ -8031,9 +7313,9 @@ function OrganizationGraphPage({ lens = "default", timeRange = "30d" }) {
|
|
|
8031
7313
|
})).sort((left, right) => left.label.localeCompare(right.label)),
|
|
8032
7314
|
[visibleGraph]
|
|
8033
7315
|
);
|
|
8034
|
-
const focusGraphNode = useEffectEvent((
|
|
7316
|
+
const focusGraphNode = useEffectEvent((nodeId) => {
|
|
8035
7317
|
setFocusRequest({
|
|
8036
|
-
nodeId
|
|
7318
|
+
nodeId,
|
|
8037
7319
|
nonce: Date.now()
|
|
8038
7320
|
});
|
|
8039
7321
|
});
|
|
@@ -8154,7 +7436,7 @@ function OrganizationGraphPage({ lens = "default", timeRange = "30d" }) {
|
|
|
8154
7436
|
return;
|
|
8155
7437
|
}
|
|
8156
7438
|
const graphNodeIds = new Set(graph.nodes.map((node) => node.id));
|
|
8157
|
-
const expansionStillExists = [...appliedExpandAroundNodeIds].some((
|
|
7439
|
+
const expansionStillExists = [...appliedExpandAroundNodeIds].some((nodeId) => graphNodeIds.has(nodeId));
|
|
8158
7440
|
if (!expansionStillExists) {
|
|
8159
7441
|
clearExpandAroundState();
|
|
8160
7442
|
}
|
|
@@ -8758,8 +8040,8 @@ function CommandViewSidebarContent({ timeRange }) {
|
|
|
8758
8040
|
...dataWithStats.humanCheckpoints || []
|
|
8759
8041
|
];
|
|
8760
8042
|
return allNodes.find((node) => {
|
|
8761
|
-
const
|
|
8762
|
-
return
|
|
8043
|
+
const nodeId = getNodeId(node);
|
|
8044
|
+
return nodeId === selectedNodeId || node.name === selectedNodeId;
|
|
8763
8045
|
}) || null;
|
|
8764
8046
|
}, [selectedNodeId, dataWithStats]);
|
|
8765
8047
|
const isNavigable = selectedNode?.type === "agent" || selectedNode?.type === "workflow";
|
|
@@ -10248,10 +9530,10 @@ var defaultOperationsSidebarWidth = 250;
|
|
|
10248
9530
|
var operationsManifest = {
|
|
10249
9531
|
key: "operations",
|
|
10250
9532
|
featureId: "operations",
|
|
10251
|
-
capabilityIds: ["
|
|
9533
|
+
capabilityIds: ["knowledge.command-view"],
|
|
10252
9534
|
icon: IconCode,
|
|
10253
9535
|
sidebar: OperationsSidebar,
|
|
10254
|
-
sidebarWidth: ({ currentPath }) => currentPath.startsWith("/
|
|
9536
|
+
sidebarWidth: ({ currentPath }) => currentPath.startsWith("/knowledge/command-view") ? commandViewSidebarWidth : defaultOperationsSidebarWidth
|
|
10255
9537
|
};
|
|
10256
9538
|
|
|
10257
9539
|
export { ActionModal, AgentDefinitionDisplay, AgentExecutionLogs, AgentExecutionPanel, AgentSessionGroup, BaseExecutionLogs, BaseExecutionLogsHeader, BaseExecutionLogsStates, CheckpointGroup, CollapsibleJsonSection, CommandQueueDetailPage, CommandQueuePage, CommandQueueShell, CommandQueueSidebar, CommandQueueSidebarMiddle, CommandQueueSidebarTop, CommandQueueTaskRow, CommandViewPage, CommandViewSidebarContent, ConfigCard, ContentSections, ContextUsageBadge, ContractDisplay, ExecuteWorkflowModal, ExecutionErrorSection, ExecutionPanel, LogEntry, LogGroup, NewKnowledgeMapEdge, NewKnowledgeMapGraph, NewKnowledgeMapNode, OperationsSidebar, OperationsSidebarMiddle, OperationsSidebarTop, OrganizationGraphPage, ResourceDefinitionSection, ResourceDetailPage, ResourceErrorState, ResourceExecuteDialog, ResourceExecuteForm, ResourceFilter, ResourceHeader, ResourceNotFoundState, ResourcesPage, ResourcesSidebar, SessionChatArea, SessionChatInterface, SessionChatPage, SessionDetailsSidebar, SessionExecutionLogs, SessionHeader, SessionListItem, SessionMemory, SessionsPage, SessionsSidebar, ToolsListDisplay, WorkflowDefinitionDisplay, WorkflowExecutionLogs, WorkflowExecutionPanel, getExecutionStatusConfig, getIcon, getLogLevelConfig, iconMap, operationsManifest, useNewKnowledgeMapLayout };
|