@elevasis/ui 2.31.0 → 2.33.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/{CoreAuthKitInner-KSEGSB67.js → CoreAuthKitInner-QC62UHTZ.js} +1 -1
- package/dist/api/index.js +3 -3
- package/dist/app/index.css +38 -0
- package/dist/app/index.d.ts +69 -9
- package/dist/app/index.js +7 -6
- package/dist/auth/context.js +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/charts/index.js +5 -6
- package/dist/{chunk-JKSUN5GN.js → chunk-2GMF5IRF.js} +81 -746
- package/dist/{chunk-XQHZBA65.js → chunk-2RJMVWFJ.js} +1 -6
- package/dist/{chunk-CW3UNAF2.js → chunk-4DYOXEH6.js} +410 -5
- package/dist/{chunk-HQGF4ATG.js → chunk-52NLZN6Z.js} +118 -141
- package/dist/chunk-AHCKOU2M.js +13 -0
- package/dist/chunk-CLDCYJQT.js +1 -0
- package/dist/chunk-DWXDNT7P.js +145 -0
- package/dist/chunk-E4T2N7P7.js +124 -0
- package/dist/{chunk-HYNYEBHM.js → chunk-E7C4XEWH.js} +3 -3
- package/dist/{chunk-L3BVJWML.js → chunk-EPTHX4VZ.js} +1 -1
- package/dist/{chunk-QDEETKYT.js → chunk-FFPHJBJC.js} +9 -9
- package/dist/chunk-GNRMB6DC.js +5126 -0
- package/dist/{chunk-DZTG5IAC.js → chunk-I2KLQ2HA.js} +1 -7
- package/dist/{chunk-Q6OYNEGR.js → chunk-IUKFNASA.js} +5 -6
- package/dist/{chunk-QHEWXU7I.js → chunk-JFL3GRD4.js} +1 -1
- package/dist/{chunk-T3IPHEYJ.js → chunk-JHT5JIJ3.js} +4410 -566
- package/dist/{chunk-L2NVFLXU.js → chunk-MHLZ4F4N.js} +4 -4
- package/dist/{chunk-XQQEKWTL.js → chunk-N55DVMAG.js} +6 -2
- package/dist/{chunk-TOIXUWR6.js → chunk-ND5TDV2J.js} +1 -1
- package/dist/{chunk-5LJAEZMA.js → chunk-NOIRGGW2.js} +5 -6
- package/dist/{chunk-7KC4P3AU.js → chunk-QNOVUCSV.js} +2 -12
- package/dist/{chunk-3BAPR3KA.js → chunk-RQA2EVN3.js} +5 -15
- package/dist/{chunk-ND42LPY4.js → chunk-TKF5S4XP.js} +6 -6
- package/dist/{chunk-DWK2QIAK.js → chunk-TYRUKGGD.js} +1 -1
- package/dist/{chunk-Y4FWCG7Y.js → chunk-UVFOURXR.js} +8 -7
- package/dist/chunk-UW7IV2Y3.js +447 -0
- package/dist/{chunk-P55BJZZW.js → chunk-V6SZ4ECN.js} +20 -5
- package/dist/{chunk-6YT4IKJ7.js → chunk-VNAZTCHA.js} +15 -0
- package/dist/chunk-XG57WXOL.js +85 -0
- package/dist/{chunk-SHQXMW4F.js → chunk-XOFSMJLF.js} +46 -28
- package/dist/{chunk-7HMCB26R.js → chunk-XZGSCABI.js} +1 -1
- package/dist/chunk-YAQ25UNM.js +2126 -0
- package/dist/chunk-ZGTDKH3P.js +467 -0
- package/dist/components/chat/index.js +1 -1
- package/dist/components/index.css +38 -0
- package/dist/components/index.d.ts +262 -51
- package/dist/components/index.js +37 -39
- package/dist/components/navigation/index.css +38 -0
- package/dist/components/navigation/index.js +5 -3
- package/dist/execution/index.d.ts +11 -2
- package/dist/execution/index.js +1 -1
- package/dist/features/auth/index.css +38 -0
- package/dist/features/auth/index.d.ts +91 -14
- package/dist/features/auth/index.js +42 -10
- package/dist/features/clients/index.css +38 -0
- package/dist/features/clients/index.d.ts +1 -1
- package/dist/features/clients/index.js +17 -15
- package/dist/features/crm/index.css +38 -0
- package/dist/features/crm/index.d.ts +80 -18
- package/dist/features/crm/index.js +17 -15
- package/dist/features/dashboard/index.css +38 -0
- package/dist/features/dashboard/index.d.ts +174 -25
- package/dist/features/dashboard/index.js +17 -16
- package/dist/features/delivery/index.css +38 -0
- package/dist/features/delivery/index.d.ts +80 -18
- package/dist/features/delivery/index.js +16 -15
- package/dist/features/knowledge/index.css +38 -0
- package/dist/features/knowledge/index.d.ts +20 -18
- package/dist/features/knowledge/index.js +114 -609
- package/dist/features/lead-gen/index.css +38 -0
- package/dist/features/lead-gen/index.d.ts +45 -43
- package/dist/features/lead-gen/index.js +17 -16
- package/dist/features/monitoring/index.css +38 -0
- package/dist/features/monitoring/index.d.ts +20 -18
- package/dist/features/monitoring/index.js +18 -17
- package/dist/features/monitoring/requests/index.css +38 -0
- package/dist/features/monitoring/requests/index.d.ts +23 -21
- package/dist/features/monitoring/requests/index.js +16 -14
- package/dist/features/operations/index.css +38 -0
- package/dist/features/operations/index.d.ts +1299 -66
- package/dist/features/operations/index.js +22 -24
- package/dist/features/seo/index.d.ts +20 -18
- package/dist/features/seo/index.js +2 -2
- package/dist/features/settings/index.css +38 -0
- package/dist/features/settings/index.d.ts +80 -18
- package/dist/features/settings/index.js +17 -15
- package/dist/graph/index.js +1 -1
- package/dist/hooks/delivery/index.css +38 -0
- package/dist/hooks/delivery/index.d.ts +60 -0
- package/dist/hooks/delivery/index.js +3 -3
- package/dist/hooks/index.css +38 -0
- package/dist/hooks/index.d.ts +492 -89
- package/dist/hooks/index.js +15 -13
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +332 -33
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +1 -1
- package/dist/hooks/published.css +38 -0
- package/dist/hooks/published.d.ts +492 -89
- package/dist/hooks/published.js +15 -13
- package/dist/index.css +38 -0
- package/dist/index.d.ts +1353 -1349
- package/dist/index.js +16 -14
- package/dist/initialization/index.d.ts +60 -0
- package/dist/initialization/index.js +1 -1
- package/dist/knowledge/index.d.ts +1217 -1292
- package/dist/knowledge/index.js +6538 -2198
- package/dist/knowledge-search-index-P7PR626V.js +1514 -0
- package/dist/layout/index.js +3 -4
- package/dist/organization/index.css +38 -0
- package/dist/organization/index.js +1 -1
- package/dist/profile/index.d.ts +60 -0
- package/dist/profile/index.js +1 -1
- package/dist/provider/ElevasisServiceContext.js +1 -1
- package/dist/provider/index.css +38 -0
- package/dist/provider/index.d.ts +1068 -1246
- package/dist/provider/index.js +12 -10
- package/dist/provider/published.css +38 -0
- package/dist/provider/published.d.ts +1065 -1243
- package/dist/provider/published.js +9 -7
- package/dist/router/context.js +1 -1
- package/dist/router/index.js +1 -1
- package/dist/sse/index.js +1 -1
- package/dist/supabase/index.d.ts +117 -0
- package/dist/supabase/index.js +1 -1
- package/dist/test-utils/index.d.ts +16 -9
- package/dist/test-utils/index.js +40 -33
- package/dist/test-utils/setup-integration.js +1 -1
- package/dist/test-utils/setup.js +1 -1
- package/dist/theme/index.js +3 -3
- package/dist/theme/presets/index.js +1 -1
- package/dist/typeform/index.js +1 -1
- package/dist/typeform/schemas.js +1 -1
- package/dist/types/index.d.ts +394 -35
- package/dist/utils/index.d.ts +174 -25
- package/dist/utils/index.js +2 -2
- package/dist/vite/index.js +1 -1
- package/dist/vite-plugin-knowledge/index.js +1 -1
- package/dist/zustand/index.js +1 -1
- package/package.json +10 -9
- package/src/README.md +29 -29
- package/src/api/README.md +18 -18
- package/src/app/README.md +24 -24
- package/src/auth/README.md +18 -18
- package/src/components/README.md +24 -24
- package/src/execution/README.md +16 -16
- package/src/features/README.md +28 -28
- package/src/graph/README.md +16 -16
- package/src/hooks/README.md +23 -23
- package/src/initialization/README.md +19 -19
- package/src/knowledge/README.md +31 -31
- package/src/organization/README.md +18 -18
- package/src/profile/README.md +19 -19
- package/src/provider/README.md +32 -32
- package/src/router/README.md +18 -18
- package/src/sse/README.md +13 -13
- package/src/test-utils/README.md +7 -7
- package/src/theme/README.md +23 -23
- package/src/theme/presets/README.md +19 -19
- package/src/types/README.md +16 -16
- package/src/utils/README.md +18 -18
- package/src/zustand/README.md +18 -18
- package/dist/chunk-542WPQU2.js +0 -413
- package/dist/chunk-6IXOKUBC.js +0 -347
- package/dist/chunk-CQZ3DNQY.js +0 -740
- package/dist/chunk-ECNNI3NT.js +0 -6
- package/dist/chunk-GRDLB6LM.js +0 -160
- package/dist/chunk-JDNEWB5F.js +0 -10
- package/dist/chunk-MVFCLZSK.js +0 -4337
- package/dist/chunk-O2QOPJI5.js +0 -2235
- package/dist/chunk-OAVTMITG.js +0 -13
- package/dist/chunk-TVRQ6AQI.js +0 -476
- package/dist/chunk-WF227UBV.js +0 -48
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { observabilityKeys } from './chunk-
|
|
2
|
-
import { showApiErrorNotification, showSuccessNotification, projectKeys, noteKeys, taskKeys, milestoneKeys } from './chunk-
|
|
1
|
+
import { observabilityKeys } from './chunk-VNAZTCHA.js';
|
|
2
|
+
import { showApiErrorNotification, showSuccessNotification, projectKeys, noteKeys, taskKeys, milestoneKeys } from './chunk-XZGSCABI.js';
|
|
3
3
|
import { useSupabase } from './chunk-BRXELOHC.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { HTTP_HEADERS } from './chunk-
|
|
7
|
-
import { ResourceTypeSchema, NonEmptyStringSchema, OriginResourceTypeSchema, UuidSchema, CredentialNameSchema, STALE_TIME_DEFAULT, REFETCH_INTERVAL_DASHBOARD, STALE_TIME_MONITORING, getTimeRangeDates, REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, STALE_TIME_ADMIN, APIClientError, GC_TIME_MEDIUM, GC_TIME_SHORT } from './chunk-
|
|
4
|
+
import { useNotificationAdapter, deriveActions } from './chunk-UW7IV2Y3.js';
|
|
5
|
+
import { useOptionalElevasisSystems } from './chunk-ZGTDKH3P.js';
|
|
6
|
+
import { HTTP_HEADERS } from './chunk-ND5TDV2J.js';
|
|
7
|
+
import { ResourceTypeSchema, NonEmptyStringSchema, OriginResourceTypeSchema, UuidSchema, CredentialNameSchema, STALE_TIME_DEFAULT, REFETCH_INTERVAL_DASHBOARD, STALE_TIME_MONITORING, getTimeRangeDates, REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, STALE_TIME_ADMIN, APIClientError, GC_TIME_MEDIUM, GC_TIME_SHORT } from './chunk-2RJMVWFJ.js';
|
|
8
8
|
import { useStableAccessToken } from './chunk-VKIZUUPM.js';
|
|
9
9
|
import { useInitialization } from './chunk-533DUEQY.js';
|
|
10
10
|
import { useOrganization } from './chunk-DD3CCMCZ.js';
|
|
@@ -2346,733 +2346,13 @@ function useResourceExecutions({
|
|
|
2346
2346
|
staleTime: STALE_TIME_MONITORING
|
|
2347
2347
|
});
|
|
2348
2348
|
}
|
|
2349
|
-
|
|
2350
|
-
// src/features/operations/organization-graph/commandViewVisualizationModes.ts
|
|
2351
|
-
var DEFAULT_CLUSTER_PARAMETERS = {
|
|
2352
|
-
zonePadding: 86,
|
|
2353
|
-
interZoneGap: 325
|
|
2354
|
-
};
|
|
2355
|
-
var DEFAULT_SWIMLANE_PARAMETERS = {
|
|
2356
|
-
laneHeight: 140,
|
|
2357
|
-
sortKey: "kind"
|
|
2358
|
-
};
|
|
2359
|
-
var DEFAULT_FOCUS_PARAMETERS = {
|
|
2360
|
-
depth: 2,
|
|
2361
|
-
radius: 390
|
|
2362
|
-
};
|
|
2363
|
-
var DEFAULT_NETWORK_PARAMETERS = {
|
|
2364
|
-
linkLength: 82,
|
|
2365
|
-
repulsion: 150
|
|
2366
|
-
};
|
|
2367
|
-
var DEFAULT_FORCE_PARAMETERS = {
|
|
2368
|
-
nodeRepulsion: 4500,
|
|
2369
|
-
idealEdgeLength: 80,
|
|
2370
|
-
gravity: 0.25
|
|
2371
|
-
};
|
|
2372
|
-
var COMMAND_VIEW_VISUALIZATION_MODES = [
|
|
2373
|
-
{ label: "Explore", value: "explore" },
|
|
2374
|
-
{ label: "Cluster", value: "cluster" },
|
|
2375
|
-
{ label: "Swimlane", value: "swimlane" },
|
|
2376
|
-
{ label: "Focus", value: "focus" },
|
|
2377
|
-
{ label: "Network", value: "network" },
|
|
2378
|
-
{ label: "Force", value: "force" }
|
|
2379
|
-
];
|
|
2380
|
-
var DOMAIN_ORDER = [
|
|
2381
|
-
"operations",
|
|
2382
|
-
"runtime",
|
|
2383
|
-
"business",
|
|
2384
|
-
"delivery",
|
|
2385
|
-
"knowledge",
|
|
2386
|
-
"admin",
|
|
2387
|
-
"system",
|
|
2388
|
-
"platform",
|
|
2389
|
-
"other"
|
|
2390
|
-
];
|
|
2391
|
-
var DOMAIN_KEYWORDS = {
|
|
2392
|
-
operations: [
|
|
2393
|
-
"operation",
|
|
2394
|
-
"command",
|
|
2395
|
-
"queue",
|
|
2396
|
-
"scheduler",
|
|
2397
|
-
"resource",
|
|
2398
|
-
"agent",
|
|
2399
|
-
"workflow",
|
|
2400
|
-
"checkpoint",
|
|
2401
|
-
"organization graph"
|
|
2402
|
-
],
|
|
2403
|
-
runtime: ["execution", "runner", "log", "session", "deploy", "webhook", "api key", "credential", "activity"],
|
|
2404
|
-
business: ["sales", "crm", "lead", "seo", "analytics", "cost", "account"],
|
|
2405
|
-
delivery: ["project", "task", "submission", "request", "design"],
|
|
2406
|
-
knowledge: [],
|
|
2407
|
-
admin: ["admin", "user", "organization", "notification", "archive"],
|
|
2408
|
-
system: ["setting", "appearance", "debug", "monitoring", "health"],
|
|
2409
|
-
platform: ["surface", "capability", "entity", "feature"],
|
|
2410
|
-
other: []
|
|
2411
|
-
};
|
|
2412
|
-
function spread(index, count, spacing) {
|
|
2413
|
-
return (index - (count - 1) / 2) * spacing;
|
|
2414
|
-
}
|
|
2415
|
-
function getNodeSortValue(node) {
|
|
2416
|
-
return `${node.kind}:${node.label}:${node.id}`;
|
|
2417
|
-
}
|
|
2418
|
-
function getCommandViewNodeDomain(node) {
|
|
2419
|
-
return getNodeDomain(node);
|
|
2420
|
-
}
|
|
2421
|
-
function getNodeDomain(node) {
|
|
2422
|
-
if (node.kind === "organization" || node.kind === "surface" || node.kind === "capability" || node.kind === "entity") {
|
|
2423
|
-
return "platform";
|
|
2424
|
-
}
|
|
2425
|
-
if (node.kind === "knowledge") {
|
|
2426
|
-
return "knowledge";
|
|
2427
|
-
}
|
|
2428
|
-
if (node.kind === "stage") {
|
|
2429
|
-
return "business";
|
|
2430
|
-
}
|
|
2431
|
-
const searchable = `${node.id} ${node.sourceId ?? ""} ${node.featureId ?? ""} ${node.resourceType ?? ""} ${node.label}`.toLowerCase();
|
|
2432
|
-
for (const domain of DOMAIN_ORDER) {
|
|
2433
|
-
if (DOMAIN_KEYWORDS[domain].length === 0) {
|
|
2434
|
-
continue;
|
|
2435
|
-
}
|
|
2436
|
-
if (DOMAIN_KEYWORDS[domain].some((keyword) => searchable.includes(keyword))) {
|
|
2437
|
-
return domain;
|
|
2438
|
-
}
|
|
2439
|
-
}
|
|
2440
|
-
return "other";
|
|
2441
|
-
}
|
|
2442
|
-
function groupNodesByDomain(graph) {
|
|
2443
|
-
const groups = /* @__PURE__ */ new Map();
|
|
2444
|
-
for (const domain of DOMAIN_ORDER) {
|
|
2445
|
-
groups.set(domain, []);
|
|
2446
|
-
}
|
|
2447
|
-
for (const node of graph.nodes) {
|
|
2448
|
-
groups.get(getNodeDomain(node))?.push(node);
|
|
2449
|
-
}
|
|
2450
|
-
for (const nodes of groups.values()) {
|
|
2451
|
-
nodes.sort((left, right) => getNodeSortValue(left).localeCompare(getNodeSortValue(right)));
|
|
2452
|
-
}
|
|
2453
|
-
return groups;
|
|
2454
|
-
}
|
|
2455
|
-
function getNodeDegree(graph, nodeId) {
|
|
2456
|
-
return graph.edges.filter((edge) => edge.sourceId === nodeId || edge.targetId === nodeId).length;
|
|
2457
|
-
}
|
|
2458
|
-
function getNeighbors(graph, nodeId) {
|
|
2459
|
-
const neighbors = /* @__PURE__ */ new Set();
|
|
2460
|
-
for (const edge of graph.edges) {
|
|
2461
|
-
if (edge.sourceId === nodeId) {
|
|
2462
|
-
neighbors.add(edge.targetId);
|
|
2463
|
-
} else if (edge.targetId === nodeId) {
|
|
2464
|
-
neighbors.add(edge.sourceId);
|
|
2465
|
-
}
|
|
2466
|
-
}
|
|
2467
|
-
return neighbors;
|
|
2468
|
-
}
|
|
2469
|
-
var CLUSTER_ZONE_ORIGINS = {
|
|
2470
|
-
operations: { x: -520, y: -270, columns: 3, xGap: 188, yGap: 86 },
|
|
2471
|
-
runtime: { x: 130, y: -270, columns: 3, xGap: 188, yGap: 86 },
|
|
2472
|
-
business: { x: -520, y: 95, columns: 3, xGap: 188, yGap: 86 },
|
|
2473
|
-
delivery: { x: 130, y: 95, columns: 3, xGap: 188, yGap: 86 },
|
|
2474
|
-
knowledge: { x: 0, y: 605, columns: 4, xGap: 200, yGap: 86 },
|
|
2475
|
-
admin: { x: -520, y: 420, columns: 3, xGap: 188, yGap: 86 },
|
|
2476
|
-
system: { x: 130, y: 420, columns: 3, xGap: 188, yGap: 86 },
|
|
2477
|
-
platform: { x: 0, y: -520, columns: 4, xGap: 205, yGap: 90 },
|
|
2478
|
-
other: { x: 0, y: 800, columns: 6, xGap: 176, yGap: 78 }
|
|
2479
|
-
};
|
|
2480
|
-
function getClusterGraphPositions(graph, params) {
|
|
2481
|
-
const positions = /* @__PURE__ */ new Map();
|
|
2482
|
-
const groups = groupNodesByDomain(graph);
|
|
2483
|
-
const zoneConfig = params === void 0 ? CLUSTER_ZONE_ORIGINS : (() => {
|
|
2484
|
-
const yGapScale = params.zonePadding / DEFAULT_CLUSTER_PARAMETERS.zonePadding;
|
|
2485
|
-
const yOriginScale = params.interZoneGap / DEFAULT_CLUSTER_PARAMETERS.interZoneGap;
|
|
2486
|
-
return Object.fromEntries(
|
|
2487
|
-
Object.entries(CLUSTER_ZONE_ORIGINS).map(([domain, cfg]) => [
|
|
2488
|
-
domain,
|
|
2489
|
-
{
|
|
2490
|
-
...cfg,
|
|
2491
|
-
y: Math.round(cfg.y * yOriginScale),
|
|
2492
|
-
yGap: Math.round(cfg.yGap * yGapScale)
|
|
2493
|
-
}
|
|
2494
|
-
])
|
|
2495
|
-
);
|
|
2496
|
-
})();
|
|
2497
|
-
for (const domain of DOMAIN_ORDER) {
|
|
2498
|
-
const nodes = groups.get(domain) ?? [];
|
|
2499
|
-
const zone = zoneConfig[domain];
|
|
2500
|
-
for (const [index, node] of nodes.entries()) {
|
|
2501
|
-
const row = Math.floor(index / zone.columns);
|
|
2502
|
-
const column = index % zone.columns;
|
|
2503
|
-
const rowCount = Math.min(zone.columns, nodes.length - row * zone.columns);
|
|
2504
|
-
positions.set(node.id, {
|
|
2505
|
-
x: zone.x + spread(column, rowCount, zone.xGap),
|
|
2506
|
-
y: zone.y + row * zone.yGap
|
|
2507
|
-
});
|
|
2508
|
-
}
|
|
2509
|
-
}
|
|
2510
|
-
return positions;
|
|
2511
|
-
}
|
|
2512
|
-
var SWIMLANE_BASE_LANE_Y = {
|
|
2513
|
-
platform: -360,
|
|
2514
|
-
operations: -220,
|
|
2515
|
-
runtime: -80,
|
|
2516
|
-
business: 60,
|
|
2517
|
-
delivery: 200,
|
|
2518
|
-
knowledge: 340,
|
|
2519
|
-
admin: 480,
|
|
2520
|
-
system: 620,
|
|
2521
|
-
other: 760
|
|
2522
|
-
};
|
|
2523
|
-
function getSwimlaneGraphPositions(graph, params) {
|
|
2524
|
-
const positions = /* @__PURE__ */ new Map();
|
|
2525
|
-
const rawGroups = groupNodesByDomain(graph);
|
|
2526
|
-
if (params !== void 0 && params.sortKey !== "kind") {
|
|
2527
|
-
for (const [, nodes] of rawGroups) {
|
|
2528
|
-
nodes.sort((left, right) => {
|
|
2529
|
-
if (params.sortKey === "domain") {
|
|
2530
|
-
return left.label.localeCompare(right.label);
|
|
2531
|
-
}
|
|
2532
|
-
return left.kind.localeCompare(right.kind) || left.label.localeCompare(right.label);
|
|
2533
|
-
});
|
|
2534
|
-
}
|
|
2535
|
-
}
|
|
2536
|
-
const laneY = params === void 0 ? SWIMLANE_BASE_LANE_Y : (() => {
|
|
2537
|
-
const scale = params.laneHeight / DEFAULT_SWIMLANE_PARAMETERS.laneHeight;
|
|
2538
|
-
return Object.fromEntries(
|
|
2539
|
-
Object.keys(SWIMLANE_BASE_LANE_Y).map((domain) => [
|
|
2540
|
-
domain,
|
|
2541
|
-
Math.round(SWIMLANE_BASE_LANE_Y[domain] * scale)
|
|
2542
|
-
])
|
|
2543
|
-
);
|
|
2544
|
-
})();
|
|
2545
|
-
for (const domain of DOMAIN_ORDER) {
|
|
2546
|
-
const nodes = rawGroups.get(domain) ?? [];
|
|
2547
|
-
const columns = Math.min(8, Math.max(1, Math.ceil(Math.sqrt(nodes.length) * 1.6)));
|
|
2548
|
-
for (const [index, node] of nodes.entries()) {
|
|
2549
|
-
const column = index % columns;
|
|
2550
|
-
const row = Math.floor(index / columns);
|
|
2551
|
-
const rowCount = Math.min(columns, nodes.length - row * columns);
|
|
2552
|
-
positions.set(node.id, {
|
|
2553
|
-
x: spread(column, rowCount, 178),
|
|
2554
|
-
y: laneY[domain] + row * 74
|
|
2555
|
-
});
|
|
2556
|
-
}
|
|
2557
|
-
}
|
|
2558
|
-
return positions;
|
|
2559
|
-
}
|
|
2560
|
-
function getFocusGraphPositions(graph, selectedNodeId, params) {
|
|
2561
|
-
if (!selectedNodeId || !graph.nodes.some((node) => node.id === selectedNodeId)) {
|
|
2562
|
-
return getNetworkGraphPositions(graph);
|
|
2563
|
-
}
|
|
2564
|
-
const positions = /* @__PURE__ */ new Map();
|
|
2565
|
-
const firstDegree = getNeighbors(graph, selectedNodeId);
|
|
2566
|
-
const secondDegree = /* @__PURE__ */ new Set();
|
|
2567
|
-
for (const nodeId of firstDegree) {
|
|
2568
|
-
for (const neighborId of getNeighbors(graph, nodeId)) {
|
|
2569
|
-
if (neighborId !== selectedNodeId && !firstDegree.has(neighborId)) {
|
|
2570
|
-
secondDegree.add(neighborId);
|
|
2571
|
-
}
|
|
2572
|
-
}
|
|
2573
|
-
}
|
|
2574
|
-
positions.set(selectedNodeId, { x: 0, y: 0 });
|
|
2575
|
-
const ring1RadiusX = params === void 0 ? 390 : params.radius;
|
|
2576
|
-
const ring1RadiusY = params === void 0 ? 210 : Math.round(params.radius * (210 / 390));
|
|
2577
|
-
const ring2RadiusX = params === void 0 ? 680 : Math.round(params.radius * (680 / 390));
|
|
2578
|
-
const ring2RadiusY = params === void 0 ? 360 : Math.round(params.radius * (360 / 390));
|
|
2579
|
-
const placeRing = (ids, radiusX, radiusY, yOffset = 0) => {
|
|
2580
|
-
ids.forEach((id, index) => {
|
|
2581
|
-
const angle = -Math.PI / 2 + index / Math.max(1, ids.length) * Math.PI * 2;
|
|
2582
|
-
positions.set(id, {
|
|
2583
|
-
x: Math.cos(angle) * radiusX,
|
|
2584
|
-
y: yOffset + Math.sin(angle) * radiusY
|
|
2585
|
-
});
|
|
2586
|
-
});
|
|
2587
|
-
};
|
|
2588
|
-
placeRing([...firstDegree].sort(), ring1RadiusX, ring1RadiusY);
|
|
2589
|
-
const effectiveDepth = params === void 0 ? DEFAULT_FOCUS_PARAMETERS.depth : params.depth;
|
|
2590
|
-
if (effectiveDepth >= 2) {
|
|
2591
|
-
placeRing([...secondDegree].sort(), ring2RadiusX, ring2RadiusY);
|
|
2592
|
-
}
|
|
2593
|
-
const remaining = graph.nodes.filter((node) => !positions.has(node.id)).sort((left, right) => left.label.localeCompare(right.label));
|
|
2594
|
-
for (const [index, node] of remaining.entries()) {
|
|
2595
|
-
const column = index % 8;
|
|
2596
|
-
const row = Math.floor(index / 8);
|
|
2597
|
-
positions.set(node.id, {
|
|
2598
|
-
x: spread(column, Math.min(8, remaining.length - row * 8), 160),
|
|
2599
|
-
y: 560 + row * 78
|
|
2600
|
-
});
|
|
2601
|
-
}
|
|
2602
|
-
return positions;
|
|
2603
|
-
}
|
|
2604
|
-
function getNetworkGraphPositions(graph, params) {
|
|
2605
|
-
const positions = /* @__PURE__ */ new Map();
|
|
2606
|
-
const nodes = [...graph.nodes].sort((left, right) => {
|
|
2607
|
-
const degreeDelta = getNodeDegree(graph, right.id) - getNodeDegree(graph, left.id);
|
|
2608
|
-
return degreeDelta || left.label.localeCompare(right.label);
|
|
2609
|
-
});
|
|
2610
|
-
const baseRepulsion = params === void 0 ? 150 : params.repulsion;
|
|
2611
|
-
const linkLength = params === void 0 ? 82 : params.linkLength;
|
|
2612
|
-
for (const [index, node] of nodes.entries()) {
|
|
2613
|
-
if (index === 0) {
|
|
2614
|
-
positions.set(node.id, { x: 0, y: 0 });
|
|
2615
|
-
continue;
|
|
2616
|
-
}
|
|
2617
|
-
const radius = baseRepulsion + Math.sqrt(index) * linkLength;
|
|
2618
|
-
const angle = index * 2.399963229728653;
|
|
2619
|
-
positions.set(node.id, {
|
|
2620
|
-
x: Math.cos(angle) * radius,
|
|
2621
|
-
y: Math.sin(angle) * radius * 0.72
|
|
2622
|
-
});
|
|
2623
|
-
}
|
|
2624
|
-
return positions;
|
|
2625
|
-
}
|
|
2626
|
-
function getDefaultParameters(mode) {
|
|
2627
|
-
switch (mode) {
|
|
2628
|
-
case "swimlane":
|
|
2629
|
-
return { mode: "swimlane", ...DEFAULT_SWIMLANE_PARAMETERS };
|
|
2630
|
-
case "focus":
|
|
2631
|
-
return { mode: "focus", ...DEFAULT_FOCUS_PARAMETERS };
|
|
2632
|
-
case "network":
|
|
2633
|
-
return { mode: "network", ...DEFAULT_NETWORK_PARAMETERS };
|
|
2634
|
-
case "force":
|
|
2635
|
-
return { mode: "force", ...DEFAULT_FORCE_PARAMETERS };
|
|
2636
|
-
case "cluster":
|
|
2637
|
-
return { mode: "cluster", ...DEFAULT_CLUSTER_PARAMETERS, zonePadding: 110, interZoneGap: 400 };
|
|
2638
|
-
case "explore":
|
|
2639
|
-
return { mode: "explore" };
|
|
2640
|
-
}
|
|
2641
|
-
}
|
|
2642
|
-
var EXPLORE_ZONE_ORDER = [
|
|
2643
|
-
"platform",
|
|
2644
|
-
"operations",
|
|
2645
|
-
"runtime",
|
|
2646
|
-
"business",
|
|
2647
|
-
"delivery",
|
|
2648
|
-
"knowledge",
|
|
2649
|
-
"admin",
|
|
2650
|
-
"system",
|
|
2651
|
-
"other"
|
|
2652
|
-
];
|
|
2653
|
-
var EXPLORE_ZONE_DISPLAY_NAME = {
|
|
2654
|
-
platform: "Platform",
|
|
2655
|
-
operations: "Operations",
|
|
2656
|
-
runtime: "Runtime",
|
|
2657
|
-
business: "Business",
|
|
2658
|
-
delivery: "Delivery",
|
|
2659
|
-
knowledge: "Knowledge",
|
|
2660
|
-
admin: "Admin",
|
|
2661
|
-
system: "System",
|
|
2662
|
-
other: "Other"
|
|
2663
|
-
};
|
|
2664
|
-
var EXPLORE_OM_ROOT_ID = "explore-om-root";
|
|
2665
|
-
function getExploreProjection() {
|
|
2666
|
-
const CENTROID_RADIUS = 340;
|
|
2667
|
-
const count = EXPLORE_ZONE_ORDER.length;
|
|
2668
|
-
const positions = /* @__PURE__ */ new Map();
|
|
2669
|
-
const syntheticNodes = [];
|
|
2670
|
-
const backboneEdges = [];
|
|
2671
|
-
syntheticNodes.push({
|
|
2672
|
-
id: EXPLORE_OM_ROOT_ID,
|
|
2673
|
-
kind: "organization",
|
|
2674
|
-
label: "Organization Model",
|
|
2675
|
-
isCentroid: "false",
|
|
2676
|
-
domainZone: null,
|
|
2677
|
-
zoneTint: null,
|
|
2678
|
-
isOmRoot: true
|
|
2679
|
-
});
|
|
2680
|
-
positions.set(EXPLORE_OM_ROOT_ID, { x: 0, y: 0 });
|
|
2681
|
-
for (const [index, zone] of EXPLORE_ZONE_ORDER.entries()) {
|
|
2682
|
-
const angle = -Math.PI / 2 + index / count * Math.PI * 2;
|
|
2683
|
-
const x = Math.cos(angle) * CENTROID_RADIUS;
|
|
2684
|
-
const y = Math.sin(angle) * CENTROID_RADIUS;
|
|
2685
|
-
const centroidId = `centroid:${zone}`;
|
|
2686
|
-
syntheticNodes.push({
|
|
2687
|
-
id: centroidId,
|
|
2688
|
-
kind: "centroid",
|
|
2689
|
-
label: EXPLORE_ZONE_DISPLAY_NAME[zone],
|
|
2690
|
-
isCentroid: "true",
|
|
2691
|
-
domainZone: zone,
|
|
2692
|
-
zoneTint: DOMAIN_ZONE_TINT_COLOR[zone] ?? null
|
|
2693
|
-
});
|
|
2694
|
-
positions.set(centroidId, { x, y });
|
|
2695
|
-
backboneEdges.push({ source: EXPLORE_OM_ROOT_ID, target: centroidId });
|
|
2696
|
-
}
|
|
2697
|
-
return { syntheticNodes, backboneEdges, positions };
|
|
2698
|
-
}
|
|
2699
|
-
function buildCommandViewGraphIndex(graph) {
|
|
2700
|
-
const nodesByDomain = /* @__PURE__ */ new Map();
|
|
2701
|
-
const nodeById = /* @__PURE__ */ new Map();
|
|
2702
|
-
const containsChildrenByParentId = /* @__PURE__ */ new Map();
|
|
2703
|
-
const containsParentIdsByChildId = /* @__PURE__ */ new Map();
|
|
2704
|
-
const childBearingNodeIds = /* @__PURE__ */ new Set();
|
|
2705
|
-
const degreeByNodeId = /* @__PURE__ */ new Map();
|
|
2706
|
-
for (const node of graph.nodes) {
|
|
2707
|
-
const zone = getNodeDomain(node);
|
|
2708
|
-
nodeById.set(node.id, node);
|
|
2709
|
-
degreeByNodeId.set(node.id, 0);
|
|
2710
|
-
const existing = nodesByDomain.get(zone);
|
|
2711
|
-
if (existing) {
|
|
2712
|
-
existing.push(node.id);
|
|
2713
|
-
} else {
|
|
2714
|
-
nodesByDomain.set(zone, [node.id]);
|
|
2715
|
-
}
|
|
2716
|
-
}
|
|
2717
|
-
for (const edge of graph.edges) {
|
|
2718
|
-
degreeByNodeId.set(edge.sourceId, (degreeByNodeId.get(edge.sourceId) ?? 0) + 1);
|
|
2719
|
-
degreeByNodeId.set(edge.targetId, (degreeByNodeId.get(edge.targetId) ?? 0) + 1);
|
|
2720
|
-
if (edge.kind !== "contains") continue;
|
|
2721
|
-
childBearingNodeIds.add(edge.sourceId);
|
|
2722
|
-
const children = containsChildrenByParentId.get(edge.sourceId);
|
|
2723
|
-
if (children) {
|
|
2724
|
-
children.push(edge.targetId);
|
|
2725
|
-
} else {
|
|
2726
|
-
containsChildrenByParentId.set(edge.sourceId, [edge.targetId]);
|
|
2727
|
-
}
|
|
2728
|
-
const parents = containsParentIdsByChildId.get(edge.targetId);
|
|
2729
|
-
if (parents) {
|
|
2730
|
-
parents.push(edge.sourceId);
|
|
2731
|
-
} else {
|
|
2732
|
-
containsParentIdsByChildId.set(edge.targetId, [edge.sourceId]);
|
|
2733
|
-
}
|
|
2734
|
-
}
|
|
2735
|
-
return {
|
|
2736
|
-
nodesByDomain,
|
|
2737
|
-
nodeById,
|
|
2738
|
-
containsChildrenByParentId,
|
|
2739
|
-
containsParentIdsByChildId,
|
|
2740
|
-
childBearingNodeIds,
|
|
2741
|
-
degreeByNodeId
|
|
2742
|
-
};
|
|
2743
|
-
}
|
|
2744
|
-
function getIndexedDomainNodeIds(graph, zone, lookup) {
|
|
2745
|
-
if (lookup instanceof Map) {
|
|
2746
|
-
return lookup.get(zone) ?? graph.nodes.filter((node) => getNodeDomain(node) === zone).map((node) => node.id);
|
|
2747
|
-
}
|
|
2748
|
-
return lookup?.nodesByDomain.get(zone) ?? graph.nodes.filter((node) => getNodeDomain(node) === zone).map((node) => node.id);
|
|
2749
|
-
}
|
|
2750
|
-
function getIndexedContainsChildIds(graph, parentId, lookup) {
|
|
2751
|
-
if (lookup && !(lookup instanceof Map)) {
|
|
2752
|
-
return lookup.containsChildrenByParentId.get(parentId) ?? [];
|
|
2753
|
-
}
|
|
2754
|
-
return graph.edges.filter((e) => e.kind === "contains" && e.sourceId === parentId).map((e) => e.targetId);
|
|
2755
|
-
}
|
|
2756
|
-
function getRadialFromAnchorProjection(graph, anchorId, anchorPos, level, lookup) {
|
|
2757
|
-
const RADIUS_BY_LEVEL = {
|
|
2758
|
-
1: 260,
|
|
2759
|
-
2: 170,
|
|
2760
|
-
3: 110
|
|
2761
|
-
};
|
|
2762
|
-
const radius = RADIUS_BY_LEVEL[level] ?? 110;
|
|
2763
|
-
const positions = /* @__PURE__ */ new Map();
|
|
2764
|
-
let childIds;
|
|
2765
|
-
if (anchorId.startsWith("centroid:")) {
|
|
2766
|
-
const zone = anchorId.slice("centroid:".length);
|
|
2767
|
-
childIds = getIndexedDomainNodeIds(graph, zone, lookup);
|
|
2768
|
-
} else {
|
|
2769
|
-
childIds = getIndexedContainsChildIds(graph, anchorId, lookup);
|
|
2770
|
-
}
|
|
2771
|
-
const outwardAngle = anchorPos.x === 0 && anchorPos.y === 0 ? -Math.PI / 2 : Math.atan2(anchorPos.y, anchorPos.x);
|
|
2772
|
-
const NODE_SLOT = 92;
|
|
2773
|
-
const BASE_ARC = Math.PI / 2.5;
|
|
2774
|
-
const PREFERRED_ARC = Math.PI / 1.8;
|
|
2775
|
-
const MAX_ARC = Math.PI * 0.95;
|
|
2776
|
-
const n = childIds.length;
|
|
2777
|
-
let effectiveRadius = radius;
|
|
2778
|
-
let arcSpan;
|
|
2779
|
-
if (n <= 1) {
|
|
2780
|
-
arcSpan = BASE_ARC;
|
|
2781
|
-
} else {
|
|
2782
|
-
const minArcAtBase = n * NODE_SLOT / effectiveRadius;
|
|
2783
|
-
if (minArcAtBase <= BASE_ARC) {
|
|
2784
|
-
arcSpan = BASE_ARC;
|
|
2785
|
-
} else if (minArcAtBase <= PREFERRED_ARC) {
|
|
2786
|
-
arcSpan = minArcAtBase;
|
|
2787
|
-
} else {
|
|
2788
|
-
arcSpan = PREFERRED_ARC;
|
|
2789
|
-
effectiveRadius = Math.max(effectiveRadius, n * NODE_SLOT / PREFERRED_ARC);
|
|
2790
|
-
const MAX_RADIUS = radius * 2.4;
|
|
2791
|
-
if (effectiveRadius > MAX_RADIUS) {
|
|
2792
|
-
effectiveRadius = MAX_RADIUS;
|
|
2793
|
-
arcSpan = Math.min(MAX_ARC, n * NODE_SLOT / effectiveRadius);
|
|
2794
|
-
}
|
|
2795
|
-
}
|
|
2796
|
-
}
|
|
2797
|
-
for (const [index, childId] of childIds.entries()) {
|
|
2798
|
-
const t = n === 1 ? 0.5 : (index + 0.5) / n;
|
|
2799
|
-
const angle = outwardAngle - arcSpan / 2 + t * arcSpan;
|
|
2800
|
-
positions.set(childId, {
|
|
2801
|
-
x: anchorPos.x + Math.cos(angle) * effectiveRadius,
|
|
2802
|
-
y: anchorPos.y + Math.sin(angle) * effectiveRadius
|
|
2803
|
-
});
|
|
2804
|
-
}
|
|
2805
|
-
return positions;
|
|
2806
|
-
}
|
|
2807
|
-
function getCommandViewGraphPositions({
|
|
2808
|
-
graph,
|
|
2809
|
-
visualizationMode,
|
|
2810
|
-
selectedNodeId,
|
|
2811
|
-
parameters,
|
|
2812
|
-
expandedNodeIds
|
|
2813
|
-
}) {
|
|
2814
|
-
switch (visualizationMode) {
|
|
2815
|
-
case "swimlane": {
|
|
2816
|
-
const p = parameters?.mode === "swimlane" ? parameters : void 0;
|
|
2817
|
-
return getSwimlaneGraphPositions(graph, p);
|
|
2818
|
-
}
|
|
2819
|
-
case "focus": {
|
|
2820
|
-
const p = parameters?.mode === "focus" ? parameters : void 0;
|
|
2821
|
-
return getFocusGraphPositions(graph, selectedNodeId, p);
|
|
2822
|
-
}
|
|
2823
|
-
case "network": {
|
|
2824
|
-
const p = parameters?.mode === "network" ? parameters : void 0;
|
|
2825
|
-
return getNetworkGraphPositions(graph, p);
|
|
2826
|
-
}
|
|
2827
|
-
case "force":
|
|
2828
|
-
return /* @__PURE__ */ new Map();
|
|
2829
|
-
case "explore": {
|
|
2830
|
-
const { positions: explorePositions } = getExploreProjection();
|
|
2831
|
-
if (expandedNodeIds && expandedNodeIds.size > 0) {
|
|
2832
|
-
const graphIndex = buildCommandViewGraphIndex(graph);
|
|
2833
|
-
for (const nodeId of expandedNodeIds) {
|
|
2834
|
-
const isCentroid = nodeId.startsWith("centroid:");
|
|
2835
|
-
const level = isCentroid ? 1 : getExpandDepthForNode(graph, nodeId, expandedNodeIds, graphIndex);
|
|
2836
|
-
if (level >= 3) {
|
|
2837
|
-
continue;
|
|
2838
|
-
}
|
|
2839
|
-
const anchorPos = explorePositions.get(nodeId);
|
|
2840
|
-
if (!anchorPos) continue;
|
|
2841
|
-
const childPositions = getRadialFromAnchorProjection(graph, nodeId, anchorPos, level + 1, graphIndex);
|
|
2842
|
-
for (const [id, pos] of childPositions) {
|
|
2843
|
-
explorePositions.set(id, pos);
|
|
2844
|
-
}
|
|
2845
|
-
}
|
|
2846
|
-
}
|
|
2847
|
-
return explorePositions;
|
|
2848
|
-
}
|
|
2849
|
-
case "cluster":
|
|
2850
|
-
default: {
|
|
2851
|
-
const p = parameters?.mode === "cluster" ? parameters : void 0;
|
|
2852
|
-
return getClusterGraphPositions(graph, p);
|
|
2853
|
-
}
|
|
2854
|
-
}
|
|
2855
|
-
}
|
|
2856
|
-
function getExpandDepthForNode(graph, nodeId, expandedNodeIds, graphIndex) {
|
|
2857
|
-
const node = graphIndex?.nodeById.get(nodeId) ?? graph.nodes.find((n) => n.id === nodeId);
|
|
2858
|
-
for (const expandedId of expandedNodeIds) {
|
|
2859
|
-
if (!expandedId.startsWith("centroid:")) continue;
|
|
2860
|
-
const zone = expandedId.slice("centroid:".length);
|
|
2861
|
-
const isDirectChild = node ? getNodeDomain(node) === zone : false;
|
|
2862
|
-
if (isDirectChild) return 2;
|
|
2863
|
-
}
|
|
2864
|
-
for (const expandedId of expandedNodeIds) {
|
|
2865
|
-
if (expandedId.startsWith("centroid:")) continue;
|
|
2866
|
-
const isContainsChild = getIndexedContainsChildIds(graph, expandedId, graphIndex).includes(nodeId);
|
|
2867
|
-
if (isContainsChild) return 3;
|
|
2868
|
-
}
|
|
2869
|
-
return 2;
|
|
2870
|
-
}
|
|
2871
|
-
function exploreNodeHasChildren(graph, nodeId, graphIndex) {
|
|
2872
|
-
if (nodeId.startsWith("centroid:")) return true;
|
|
2873
|
-
return graphIndex?.childBearingNodeIds.has(nodeId) ?? graph.edges.some((e) => e.kind === "contains" && e.sourceId === nodeId);
|
|
2874
|
-
}
|
|
2875
|
-
function findExploreParent(graph, childId, expandedNodeIds, graphIndex) {
|
|
2876
|
-
if (childId.startsWith("centroid:")) {
|
|
2877
|
-
return EXPLORE_OM_ROOT_ID;
|
|
2878
|
-
}
|
|
2879
|
-
for (const parentId2 of expandedNodeIds) {
|
|
2880
|
-
if (parentId2.startsWith("centroid:")) continue;
|
|
2881
|
-
const hasEdge = getIndexedContainsChildIds(graph, parentId2, graphIndex).includes(childId);
|
|
2882
|
-
if (hasEdge) return parentId2;
|
|
2883
|
-
}
|
|
2884
|
-
const childNode = graphIndex?.nodeById.get(childId) ?? graph.nodes.find((n) => n.id === childId);
|
|
2885
|
-
if (childNode) {
|
|
2886
|
-
const childCentroidId = `centroid:${getNodeDomain(childNode)}`;
|
|
2887
|
-
if (expandedNodeIds.has(childCentroidId)) {
|
|
2888
|
-
return childCentroidId;
|
|
2889
|
-
}
|
|
2890
|
-
}
|
|
2891
|
-
const parentId = graphIndex?.containsParentIdsByChildId.get(childId)?.[0];
|
|
2892
|
-
if (parentId) return parentId;
|
|
2893
|
-
const parentEdge = graph.edges.find((e) => e.kind === "contains" && e.targetId === childId);
|
|
2894
|
-
if (parentEdge) return parentEdge.sourceId;
|
|
2895
|
-
if (childNode) return `centroid:${getNodeDomain(childNode)}`;
|
|
2896
|
-
return null;
|
|
2897
|
-
}
|
|
2898
|
-
function getExploreFocusSet(graph, selectedId, expandedNodeIds, graphIndex) {
|
|
2899
|
-
const nodeIds = /* @__PURE__ */ new Set();
|
|
2900
|
-
const edgeIds = /* @__PURE__ */ new Set();
|
|
2901
|
-
nodeIds.add(EXPLORE_OM_ROOT_ID);
|
|
2902
|
-
if (selectedId === EXPLORE_OM_ROOT_ID) {
|
|
2903
|
-
return { nodeIds, edgeIds };
|
|
2904
|
-
}
|
|
2905
|
-
const ancestorChain = [selectedId];
|
|
2906
|
-
let cursor = selectedId;
|
|
2907
|
-
for (let i = 0; i < 8 && cursor !== EXPLORE_OM_ROOT_ID; i++) {
|
|
2908
|
-
if (cursor.startsWith("centroid:")) {
|
|
2909
|
-
ancestorChain.push(EXPLORE_OM_ROOT_ID);
|
|
2910
|
-
break;
|
|
2911
|
-
}
|
|
2912
|
-
const parentId = findExploreParent(graph, cursor, expandedNodeIds, graphIndex);
|
|
2913
|
-
if (!parentId) break;
|
|
2914
|
-
ancestorChain.push(parentId);
|
|
2915
|
-
cursor = parentId;
|
|
2916
|
-
}
|
|
2917
|
-
for (let i = 0; i < ancestorChain.length; i++) {
|
|
2918
|
-
nodeIds.add(ancestorChain[i]);
|
|
2919
|
-
if (i > 0) {
|
|
2920
|
-
const child = ancestorChain[i - 1];
|
|
2921
|
-
const parent = ancestorChain[i];
|
|
2922
|
-
if (parent === EXPLORE_OM_ROOT_ID && child.startsWith("centroid:")) {
|
|
2923
|
-
edgeIds.add(`backbone:${parent}:${child}`);
|
|
2924
|
-
} else {
|
|
2925
|
-
edgeIds.add(`expand:${parent}:${child}`);
|
|
2926
|
-
}
|
|
2927
|
-
}
|
|
2928
|
-
}
|
|
2929
|
-
if (expandedNodeIds.has(selectedId)) {
|
|
2930
|
-
const queue = [selectedId];
|
|
2931
|
-
while (queue.length > 0) {
|
|
2932
|
-
const id = queue.shift();
|
|
2933
|
-
let children;
|
|
2934
|
-
if (id.startsWith("centroid:")) {
|
|
2935
|
-
const zone = id.slice("centroid:".length);
|
|
2936
|
-
children = getIndexedDomainNodeIds(graph, zone, graphIndex);
|
|
2937
|
-
} else {
|
|
2938
|
-
children = getIndexedContainsChildIds(graph, id, graphIndex);
|
|
2939
|
-
}
|
|
2940
|
-
for (const c of children) {
|
|
2941
|
-
nodeIds.add(c);
|
|
2942
|
-
edgeIds.add(`expand:${id}:${c}`);
|
|
2943
|
-
if (expandedNodeIds.has(c)) queue.push(c);
|
|
2944
|
-
}
|
|
2945
|
-
}
|
|
2946
|
-
}
|
|
2947
|
-
return { nodeIds, edgeIds };
|
|
2948
|
-
}
|
|
2949
|
-
function getNextExpandedSetForToggle(graph, toggleId, currentExpanded, graphIndex) {
|
|
2950
|
-
if (currentExpanded.has(toggleId)) {
|
|
2951
|
-
return removeExpandedSubtree(graph, toggleId, currentExpanded, graphIndex);
|
|
2952
|
-
}
|
|
2953
|
-
const siblings = getSameParentExpandedSiblings(graph, toggleId, currentExpanded, graphIndex);
|
|
2954
|
-
let next = new Set(currentExpanded);
|
|
2955
|
-
for (const siblingId of siblings) {
|
|
2956
|
-
next = removeExpandedSubtree(graph, siblingId, next, graphIndex);
|
|
2957
|
-
}
|
|
2958
|
-
next.add(toggleId);
|
|
2959
|
-
return next;
|
|
2960
|
-
}
|
|
2961
|
-
function removeExpandedSubtree(graph, rootId, set, graphIndex) {
|
|
2962
|
-
const result = new Set(set);
|
|
2963
|
-
if (!result.has(rootId)) return result;
|
|
2964
|
-
result.delete(rootId);
|
|
2965
|
-
const queue = [rootId];
|
|
2966
|
-
while (queue.length > 0) {
|
|
2967
|
-
const id = queue.shift();
|
|
2968
|
-
let children;
|
|
2969
|
-
if (id.startsWith("centroid:")) {
|
|
2970
|
-
const zone = id.slice("centroid:".length);
|
|
2971
|
-
children = getIndexedDomainNodeIds(graph, zone, graphIndex);
|
|
2972
|
-
} else {
|
|
2973
|
-
children = getIndexedContainsChildIds(graph, id, graphIndex);
|
|
2974
|
-
}
|
|
2975
|
-
for (const c of children) {
|
|
2976
|
-
if (result.has(c)) {
|
|
2977
|
-
result.delete(c);
|
|
2978
|
-
queue.push(c);
|
|
2979
|
-
}
|
|
2980
|
-
}
|
|
2981
|
-
}
|
|
2982
|
-
return result;
|
|
2983
|
-
}
|
|
2984
|
-
function getSameParentExpandedSiblings(graph, nodeId, expandedSet, graphIndex) {
|
|
2985
|
-
if (nodeId.startsWith("centroid:")) {
|
|
2986
|
-
return Array.from(expandedSet).filter((id) => id !== nodeId && id.startsWith("centroid:"));
|
|
2987
|
-
}
|
|
2988
|
-
let parentId = null;
|
|
2989
|
-
const directParents = graphIndex?.containsParentIdsByChildId.get(nodeId) ?? graph.edges.filter((e) => e.kind === "contains" && e.targetId === nodeId).map((e) => e.sourceId);
|
|
2990
|
-
parentId = directParents.find((p) => expandedSet.has(p)) ?? null;
|
|
2991
|
-
if (!parentId) {
|
|
2992
|
-
const node = graphIndex?.nodeById.get(nodeId) ?? graph.nodes.find((n) => n.id === nodeId);
|
|
2993
|
-
if (node) {
|
|
2994
|
-
const centroidId = `centroid:${getNodeDomain(node)}`;
|
|
2995
|
-
if (expandedSet.has(centroidId)) parentId = centroidId;
|
|
2996
|
-
}
|
|
2997
|
-
}
|
|
2998
|
-
if (!parentId) return [];
|
|
2999
|
-
if (parentId.startsWith("centroid:")) {
|
|
3000
|
-
const zone = parentId.slice("centroid:".length);
|
|
3001
|
-
return Array.from(expandedSet).filter((id) => {
|
|
3002
|
-
if (id === nodeId || id.startsWith("centroid:")) return false;
|
|
3003
|
-
const n = graphIndex?.nodeById.get(id) ?? graph.nodes.find((nn) => nn.id === id);
|
|
3004
|
-
return n ? getNodeDomain(n) === zone : false;
|
|
3005
|
-
});
|
|
3006
|
-
}
|
|
3007
|
-
const childrenOfParent = new Set(getIndexedContainsChildIds(graph, parentId, graphIndex));
|
|
3008
|
-
return Array.from(expandedSet).filter((id) => id !== nodeId && childrenOfParent.has(id));
|
|
3009
|
-
}
|
|
3010
|
-
var DOMAIN_ZONE_TINT_COLOR = {
|
|
3011
|
-
operations: "#3b82a0",
|
|
3012
|
-
runtime: "#7c6ea8",
|
|
3013
|
-
business: "#3f8f7a",
|
|
3014
|
-
delivery: "#4b97a6",
|
|
3015
|
-
knowledge: "#6673a6",
|
|
3016
|
-
admin: "#7b838a",
|
|
3017
|
-
system: "#536b9a",
|
|
3018
|
-
platform: "#8d679b",
|
|
3019
|
-
other: "#6f757b"
|
|
3020
|
-
};
|
|
3021
|
-
var DOMAIN_DISPLAY_NAME = {
|
|
3022
|
-
operations: "Operations",
|
|
3023
|
-
runtime: "Runtime",
|
|
3024
|
-
business: "Business",
|
|
3025
|
-
delivery: "Delivery",
|
|
3026
|
-
knowledge: "Knowledge",
|
|
3027
|
-
admin: "Admin",
|
|
3028
|
-
system: "System",
|
|
3029
|
-
platform: "Platform",
|
|
3030
|
-
other: "Other"
|
|
3031
|
-
};
|
|
3032
|
-
function getCommandViewSwimlaneLaneLabels() {
|
|
3033
|
-
const laneY = {
|
|
3034
|
-
platform: -360,
|
|
3035
|
-
operations: -220,
|
|
3036
|
-
runtime: -80,
|
|
3037
|
-
business: 60,
|
|
3038
|
-
delivery: 200,
|
|
3039
|
-
knowledge: 340,
|
|
3040
|
-
admin: 480,
|
|
3041
|
-
system: 620,
|
|
3042
|
-
other: 760
|
|
3043
|
-
};
|
|
3044
|
-
return DOMAIN_ORDER.map((domain) => ({
|
|
3045
|
-
domain,
|
|
3046
|
-
text: DOMAIN_DISPLAY_NAME[domain],
|
|
3047
|
-
y: laneY[domain],
|
|
3048
|
-
x: 0
|
|
3049
|
-
}));
|
|
3050
|
-
}
|
|
3051
|
-
function getCommandViewClusterZoneLabels() {
|
|
3052
|
-
const zoneOrigins = {
|
|
3053
|
-
operations: { x: -520, y: -270 },
|
|
3054
|
-
runtime: { x: 130, y: -270 },
|
|
3055
|
-
business: { x: -520, y: 95 },
|
|
3056
|
-
delivery: { x: 130, y: 95 },
|
|
3057
|
-
knowledge: { x: 0, y: 605 },
|
|
3058
|
-
admin: { x: -520, y: 420 },
|
|
3059
|
-
system: { x: 130, y: 420 },
|
|
3060
|
-
platform: { x: 0, y: -520 },
|
|
3061
|
-
other: { x: 0, y: 800 }
|
|
3062
|
-
};
|
|
3063
|
-
return DOMAIN_ORDER.map((domain) => ({
|
|
3064
|
-
domain,
|
|
3065
|
-
text: DOMAIN_DISPLAY_NAME[domain],
|
|
3066
|
-
x: zoneOrigins[domain].x,
|
|
3067
|
-
y: zoneOrigins[domain].y
|
|
3068
|
-
}));
|
|
3069
|
-
}
|
|
3070
|
-
|
|
3071
|
-
// src/hooks/operations/command-view/useCommandViewStore.ts
|
|
3072
|
-
var VALID_VISUALIZATION_MODES = new Set(
|
|
3073
|
-
COMMAND_VIEW_VISUALIZATION_MODES.map((entry) => entry.value)
|
|
3074
|
-
);
|
|
3075
2349
|
var NEW_SESSION_VISUALIZATION_MODE = "explore";
|
|
2350
|
+
var LEGACY_VISUALIZATION_MODES = /* @__PURE__ */ new Set(["overview", "cluster", "swimlane", "focus", "network", "force"]);
|
|
2351
|
+
function normalizePersistedVisualizationMode(value) {
|
|
2352
|
+
if (value === "explore") return "explore";
|
|
2353
|
+
if (LEGACY_VISUALIZATION_MODES.has(String(value))) return NEW_SESSION_VISUALIZATION_MODE;
|
|
2354
|
+
return NEW_SESSION_VISUALIZATION_MODE;
|
|
2355
|
+
}
|
|
3076
2356
|
var DEFAULT_DIAGNOSTIC_CATEGORIES = ["diagnostic", "testing"];
|
|
3077
2357
|
var useCommandViewStore = create()(
|
|
3078
2358
|
persist(
|
|
@@ -3142,16 +2422,12 @@ var useCommandViewStore = create()(
|
|
|
3142
2422
|
const stored = persisted;
|
|
3143
2423
|
const storedMode = stored.visualizationMode;
|
|
3144
2424
|
const storedLastUsed = stored.lastUsedVisualizationMode;
|
|
3145
|
-
const migratedMode = storedMode === "overview" ? "explore" : storedMode;
|
|
3146
|
-
const migratedLastUsed = storedLastUsed === "overview" ? "explore" : storedLastUsed;
|
|
3147
2425
|
const { expandedZonesArray: _dropped, ...restStored } = stored;
|
|
3148
2426
|
return {
|
|
3149
2427
|
...current,
|
|
3150
2428
|
...restStored,
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
// Validate lastUsedVisualizationMode the same way.
|
|
3154
|
-
lastUsedVisualizationMode: migratedLastUsed !== void 0 && migratedLastUsed !== null && VALID_VISUALIZATION_MODES.has(migratedLastUsed) ? migratedLastUsed : current.lastUsedVisualizationMode
|
|
2429
|
+
visualizationMode: normalizePersistedVisualizationMode(storedMode),
|
|
2430
|
+
lastUsedVisualizationMode: storedLastUsed === null || storedLastUsed === void 0 ? current.lastUsedVisualizationMode : normalizePersistedVisualizationMode(storedLastUsed)
|
|
3155
2431
|
};
|
|
3156
2432
|
}
|
|
3157
2433
|
}
|
|
@@ -3522,6 +2798,65 @@ function useSortedData(data, defaultColumn, accessors, defaultDirection = "desc"
|
|
|
3522
2798
|
const sorted = useMemo(() => sortData(data, sort, accessors), [data, sort, accessors]);
|
|
3523
2799
|
return { sorted, sort, toggleSort };
|
|
3524
2800
|
}
|
|
2801
|
+
function toDescriptor(resource) {
|
|
2802
|
+
return {
|
|
2803
|
+
id: resource.id,
|
|
2804
|
+
kind: resource.kind,
|
|
2805
|
+
systemPath: resource.systemPath,
|
|
2806
|
+
executable: resource.kind !== "integration"
|
|
2807
|
+
};
|
|
2808
|
+
}
|
|
2809
|
+
function buildResourceSetKey(directResources, descendantResources) {
|
|
2810
|
+
return [
|
|
2811
|
+
...directResources.map((resource) => `d:${resource.kind}:${resource.id}:${resource.executable ? "x" : "p"}`),
|
|
2812
|
+
...descendantResources.map((resource) => `c:${resource.kind}:${resource.id}:${resource.executable ? "x" : "p"}`)
|
|
2813
|
+
].sort().join(",");
|
|
2814
|
+
}
|
|
2815
|
+
function useSystemHealth({
|
|
2816
|
+
systemPath,
|
|
2817
|
+
timeRange,
|
|
2818
|
+
includeDescendants = true,
|
|
2819
|
+
directResources,
|
|
2820
|
+
descendantResources
|
|
2821
|
+
}) {
|
|
2822
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
2823
|
+
const { startDate, endDate } = useMemo(() => getTimeRangeDates(timeRange), [timeRange]);
|
|
2824
|
+
const directDescriptors = useMemo(() => directResources.map(toDescriptor), [directResources]);
|
|
2825
|
+
const descendantDescriptors = useMemo(() => descendantResources.map(toDescriptor), [descendantResources]);
|
|
2826
|
+
const resourceSetKey = useMemo(
|
|
2827
|
+
() => buildResourceSetKey(directDescriptors, descendantDescriptors),
|
|
2828
|
+
[directDescriptors, descendantDescriptors]
|
|
2829
|
+
);
|
|
2830
|
+
return useQuery({
|
|
2831
|
+
queryKey: observabilityKeys.systemHealth(
|
|
2832
|
+
workOSOrganizationId,
|
|
2833
|
+
systemPath,
|
|
2834
|
+
timeRange,
|
|
2835
|
+
includeDescendants,
|
|
2836
|
+
includeDescendants ? "descendants" : "direct",
|
|
2837
|
+
resourceSetKey,
|
|
2838
|
+
startDate,
|
|
2839
|
+
endDate,
|
|
2840
|
+
directDescriptors,
|
|
2841
|
+
descendantDescriptors
|
|
2842
|
+
),
|
|
2843
|
+
queryFn: async () => {
|
|
2844
|
+
return apiRequest("/observability/system-health", {
|
|
2845
|
+
method: "POST",
|
|
2846
|
+
body: JSON.stringify({
|
|
2847
|
+
systemPath,
|
|
2848
|
+
includeDescendants,
|
|
2849
|
+
startDate,
|
|
2850
|
+
endDate,
|
|
2851
|
+
directResources: directDescriptors,
|
|
2852
|
+
descendantResources: descendantDescriptors
|
|
2853
|
+
})
|
|
2854
|
+
});
|
|
2855
|
+
},
|
|
2856
|
+
enabled: isReady,
|
|
2857
|
+
staleTime: 3e4
|
|
2858
|
+
});
|
|
2859
|
+
}
|
|
3525
2860
|
function useActivityTrend(params = {}) {
|
|
3526
2861
|
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
3527
2862
|
return useQuery({
|
|
@@ -4155,7 +3490,7 @@ function createDisabledManager() {
|
|
|
4155
3490
|
}
|
|
4156
3491
|
function useExecutionSSE(resourceId, options = {}) {
|
|
4157
3492
|
const queryClient = useQueryClient();
|
|
4158
|
-
const
|
|
3493
|
+
const systems = useOptionalElevasisSystems();
|
|
4159
3494
|
const { currentMembership } = useOrganization();
|
|
4160
3495
|
const { isReady, workOSOrganizationId: serviceWorkOSOrganizationId } = useElevasisServices();
|
|
4161
3496
|
const { enabled = true, apiUrl: apiUrlOverride, manager: managerOverride, listId, onEvent } = options;
|
|
@@ -4163,8 +3498,8 @@ function useExecutionSSE(resourceId, options = {}) {
|
|
|
4163
3498
|
const [liveExecutions, setLiveExecutions] = useState(/* @__PURE__ */ new Set());
|
|
4164
3499
|
const [streamingLogs, setStreamingLogs] = useState(/* @__PURE__ */ new Map());
|
|
4165
3500
|
const disabledManager = useMemo(() => createDisabledManager(), []);
|
|
4166
|
-
const apiUrl = apiUrlOverride ??
|
|
4167
|
-
const manager = managerOverride ??
|
|
3501
|
+
const apiUrl = apiUrlOverride ?? systems?.operationsApiUrl;
|
|
3502
|
+
const manager = managerOverride ?? systems?.operationsSSEManager ?? disabledManager;
|
|
4168
3503
|
const workOSOrganizationId = currentMembership?.organization?.workos_org_id ?? serviceWorkOSOrganizationId;
|
|
4169
3504
|
const connectionKey = `execution-sse-${workOSOrganizationId ?? "unknown"}-${resourceId}`;
|
|
4170
3505
|
const headers = useMemo(() => {
|
|
@@ -5803,11 +5138,11 @@ var noopSSEManager = {
|
|
|
5803
5138
|
};
|
|
5804
5139
|
function useProjectRealtime(projectId) {
|
|
5805
5140
|
const queryClient = useQueryClient();
|
|
5806
|
-
const
|
|
5141
|
+
const systems = useOptionalElevasisSystems();
|
|
5807
5142
|
const { isReady, workOSOrganizationId } = useElevasisServices();
|
|
5808
5143
|
const { currentMembership } = useOrganization();
|
|
5809
|
-
const deliveryApiUrl =
|
|
5810
|
-
const deliverySSEManager =
|
|
5144
|
+
const deliveryApiUrl = systems?.deliveryApiUrl;
|
|
5145
|
+
const deliverySSEManager = systems?.deliverySSEManager ?? noopSSEManager;
|
|
5811
5146
|
const currentWorkOSOrganizationId = currentMembership?.organization?.workos_org_id;
|
|
5812
5147
|
const headers = useMemo(() => {
|
|
5813
5148
|
if (!currentWorkOSOrganizationId) {
|
|
@@ -5853,11 +5188,11 @@ function useProjectRealtime(projectId) {
|
|
|
5853
5188
|
manager: deliverySSEManager,
|
|
5854
5189
|
connectionKey: `delivery-${currentWorkOSOrganizationId ?? workOSOrganizationId ?? projectId ?? "unknown"}`,
|
|
5855
5190
|
url: deliveryApiUrl ? `${deliveryApiUrl}/api/projects/sse` : "",
|
|
5856
|
-
enabled: Boolean(deliveryApiUrl &&
|
|
5191
|
+
enabled: Boolean(deliveryApiUrl && systems?.deliverySSEManager && currentWorkOSOrganizationId && isReady),
|
|
5857
5192
|
headers,
|
|
5858
5193
|
onmessage: handleMessage,
|
|
5859
5194
|
onopen: (response) => response.status === 403 ? "Organization access denied" : void 0
|
|
5860
5195
|
});
|
|
5861
5196
|
}
|
|
5862
5197
|
|
|
5863
|
-
export { ApiKeyService,
|
|
5198
|
+
export { ApiKeyService, CredentialSchemas, CredentialService, DeploymentService, MEMBERSHIP_STATUS_COLORS, OperationsService, OrganizationMembershipService, WebhookEndpointService, acquisitionListKeys, clientsKeys, collectResourceFilterFacets, companyKeys, contactKeys, dealKeys, dealNoteKeys, dealTaskKeys, executionsKeys, filterByDomainFilters, getResourceFilterFacetIds, isSessionCapable, labelResourceFilterFacet, leadGenArtifactKeys, leadGenListCompanyKeys, leadGenListMemberKeys, operationsKeys, projectActivityKeys, requestsKeys, scheduleKeys, sessionsKeys, sortData, transformMembershipToTableRow, useActivateDeployment, useActivities, useActivitiesRealtime, useActivityFilters, useActivityTrend, useAddCompaniesToList, useAddContactsToList, useArchiveSession, useArchivedLogs, useArtifacts, useAssignRole, useBatchDelete, useBatchTelemetry, useBatchedResourcesHealth, useBulkDeleteExecutions, useBusinessImpact, useCancelExecution, useCancelSchedule, useCheckpointTasks, useClient, useClientStatus, useClients, useCommandQueue, useCommandQueueTotals, useCommandViewData, useCommandViewDomainFilters, useCommandViewStats, useCommandViewStore, useCompanies, useCompany, useCompanyFacets, useCompleteDealTask, useContact, useContacts, useCostBreakdown, useCostByModel, useCostSummary, useCostTrends, useCreateApiKey, useCreateArtifact, useCreateClient, useCreateCompany, useCreateContact, useCreateCredential, useCreateDealNote, useCreateDealTask, useCreateList, useCreateOrgRole, useCreateSchedule, useCreateSession, useCreateWebhookEndpoint, useCredentials, useDashboardMetrics, useDeactivateDeployment, useDeactivateMembership, useDealDetail, useDealNotes, useDealTasks, useDealTasksDue, useDeals, useDealsLookup, useDealsSummary, useDeleteApiKey, useDeleteClient, useDeleteCompanies, useDeleteContacts, useDeleteCredential, useDeleteDeal, useDeleteDeployment, useDeleteExecution, useDeleteList, useDeleteOrgRole, useDeleteRequest, useDeleteSchedule, useDeleteSession, useDeleteTask, useDeleteWebhookEndpoint, useDeriveActions, useEffectivePermissions, useErrorAnalysis, useErrorDetail, useErrorDetails, useErrorDistribution, useErrorNotification, useExecuteAction, useExecuteAsync, useExecuteResource, useExecution, useExecutionHealth, useExecutionLogSSE, useExecutionLogs, useExecutionLogsFilters, useExecutionPanelState, useExecutionSSE, useExecutions, useGetExecutionHistory, useGetSchedule, useHasPermission, useInFlightExecutions, useList, useListApiKeys, useListDeployments, useListExecutions, useListMember, useListMembers, useListProgress, useListRecords, useListSchedules, useListWebhookEndpoints, useLists, useListsTelemetry, useMarkAllAsRead, useMarkAsRead, useNotificationCount, useNotifications, useOrgRoles, useOrganizationMembers, useOrganizationPermissions, usePaginationState, usePatchTask, usePauseSchedule, usePermissionCatalog, useProjectActivities, useProjectRealtime, useReactivateMembership, useRecentExecutionsByResource, useRemoveCompaniesFromList, useRequest, useRequestsList, useResolveAllErrors, useResolveError, useResolveErrorsByExecution, useResourceDefinition, useResourceErrors, useResourceExecutions, useResourceSearch, useResources, useResourcesDomainFilters, useResourcesHealth, useResumeSchedule, useRetryExecution, useRevokeRole, useSSEConnection, useScheduledTasks, useSession, useSessionExecution, useSessionExecutions, useSessionMessages, useSessionWebSocket, useSessions, useSortedData, useStatusFilter, useSubmitAction, useSuccessNotification, useSystemHealth, useTableSelection, useTableSort, useTestNotification, useTimeRangeDates, useTopFailingResources, useTransitionItem, useTransitionListCompany, useTransitionListMember, useTransitionState, useUnresolveError, useUnresolvedErrors, useUpdateAnchor, useUpdateApiKey, useUpdateClient, useUpdateCompany, useUpdateContact, useUpdateCredential, useUpdateList, useUpdateListConfig, useUpdateListStatus, useUpdateMemberConfig, useUpdateOrgRole, useUpdateRequestStatus, useUpdateSchedule, useUpdateWebhookEndpoint, useUserMemberships, useVerifyCredential, useVisibleResources, useWarningNotification, useWorkflowExecution };
|