@elevasis/sdk 1.3.0 → 1.5.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/cli.cjs +75 -8
- package/dist/index.d.ts +1464 -749
- package/dist/index.js +74 -7
- package/dist/types/worker/adapters/crm.d.ts +20 -0
- package/dist/types/worker/adapters/index.d.ts +2 -0
- package/dist/types/worker/adapters/projects.d.ts +20 -0
- package/dist/worker/index.js +41 -1
- package/package.json +2 -2
- package/reference/_navigation.md +103 -5
- package/reference/_reference-manifest.json +72 -0
- package/reference/deployment/provided-features.mdx +64 -25
- package/reference/framework/index.mdx +2 -2
- package/reference/framework/project-structure.mdx +10 -8
- package/reference/index.mdx +3 -3
- package/reference/packages/core/src/README.md +34 -0
- package/reference/packages/core/src/organization-model/README.md +94 -0
- package/reference/packages/ui/src/api/README.md +18 -0
- package/reference/packages/ui/src/auth/README.md +18 -0
- package/reference/packages/ui/src/components/README.md +24 -0
- package/reference/packages/ui/src/execution/README.md +16 -0
- package/reference/packages/ui/src/features/README.md +28 -0
- package/reference/packages/ui/src/graph/README.md +16 -0
- package/reference/packages/ui/src/hooks/README.md +24 -0
- package/reference/packages/ui/src/initialization/README.md +19 -0
- package/reference/packages/ui/src/organization/README.md +18 -0
- package/reference/packages/ui/src/profile/README.md +19 -0
- package/reference/packages/ui/src/provider/README.md +31 -0
- package/reference/packages/ui/src/router/README.md +18 -0
- package/reference/packages/ui/src/sse/README.md +13 -0
- package/reference/packages/ui/src/theme/README.md +23 -0
- package/reference/packages/ui/src/types/README.md +16 -0
- package/reference/packages/ui/src/utils/README.md +18 -0
- package/reference/packages/ui/src/zustand/README.md +18 -0
- package/reference/resources/patterns.mdx +54 -8
- package/reference/scaffold/core/organization-graph.mdx +262 -0
- package/reference/scaffold/core/organization-model.mdx +257 -0
- package/reference/scaffold/index.mdx +59 -0
- package/reference/scaffold/operations/workflow-recipes.md +419 -0
- package/reference/scaffold/recipes/add-a-feature.md +142 -0
- package/reference/scaffold/recipes/add-a-resource.md +163 -0
- package/reference/scaffold/recipes/gate-by-feature-or-admin.md +152 -0
- package/reference/scaffold/recipes/index.md +32 -0
- package/reference/scaffold/reference/contracts.md +1044 -0
- package/reference/scaffold/reference/feature-registry.md +30 -0
- package/reference/scaffold/reference/glossary.md +88 -0
- package/reference/scaffold/ui/composition-extensibility.mdx +216 -0
- package/reference/scaffold/ui/customization.md +239 -0
- package/reference/scaffold/ui/feature-flags-and-gating.md +265 -0
- package/reference/scaffold/ui/feature-shell.mdx +241 -0
- package/reference/scaffold/ui/recipes.md +418 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Provider
|
|
2
|
+
|
|
3
|
+
The provider surface composes the shared Elevasis service, feature, appearance, notification, and UI providers.
|
|
4
|
+
|
|
5
|
+
## Exports
|
|
6
|
+
|
|
7
|
+
- `ElevasisCoreProvider`
|
|
8
|
+
- `ElevasisFeaturesProvider`
|
|
9
|
+
- `useElevasisFeatures`
|
|
10
|
+
- `useOptionalElevasisFeatures`
|
|
11
|
+
- `FeatureShell`
|
|
12
|
+
- `AppearanceProvider`
|
|
13
|
+
- `useAppearance`
|
|
14
|
+
- `ElevasisServiceProvider`
|
|
15
|
+
- `useElevasisServices`
|
|
16
|
+
- `NotificationProvider`
|
|
17
|
+
- `useNotificationAdapter`
|
|
18
|
+
- `ElevasisUIProvider`
|
|
19
|
+
- Related provider and service types
|
|
20
|
+
|
|
21
|
+
## Related Published Subpaths
|
|
22
|
+
|
|
23
|
+
- `./provider`
|
|
24
|
+
- `./provider/ui`
|
|
25
|
+
- `./provider/ElevasisServiceContext`
|
|
26
|
+
|
|
27
|
+
## Notes
|
|
28
|
+
|
|
29
|
+
- `published.ts` is the external consumer surface.
|
|
30
|
+
- `ElevasisUIProvider` is the Mantine-facing visual layer; `ElevasisCoreProvider` and `ElevasisFeaturesProvider` handle the platform shell.
|
|
31
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Router
|
|
2
|
+
|
|
3
|
+
The router surface provides the shared TanStack Router bridge and router context helpers.
|
|
4
|
+
|
|
5
|
+
## Exports
|
|
6
|
+
|
|
7
|
+
- `RouterProvider`
|
|
8
|
+
- `useRouterContext`
|
|
9
|
+
- `RouterAdapter`
|
|
10
|
+
- `LinkProps`
|
|
11
|
+
- `TanStackRouterBridge`
|
|
12
|
+
- `ScrollToTop`
|
|
13
|
+
|
|
14
|
+
## Use When
|
|
15
|
+
|
|
16
|
+
- You need the shared routing abstraction for Elevasis apps.
|
|
17
|
+
- You need a small adapter layer around TanStack Router in a consuming app.
|
|
18
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# SSE
|
|
2
|
+
|
|
3
|
+
The SSE surface provides connection management and token-refresh helpers for server-sent events.
|
|
4
|
+
|
|
5
|
+
## Exports
|
|
6
|
+
|
|
7
|
+
- `SSEConnectionManager`
|
|
8
|
+
- `fetchEventSourceWithTokenRefresh`
|
|
9
|
+
|
|
10
|
+
## Use When
|
|
11
|
+
|
|
12
|
+
- You need a shared SSE client with auth-aware reconnect behavior.
|
|
13
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Theme
|
|
2
|
+
|
|
3
|
+
The theme surface provides the preset system, CSS variable bridge, and Mantine theme integration.
|
|
4
|
+
|
|
5
|
+
## Exports
|
|
6
|
+
|
|
7
|
+
- `getPreset`
|
|
8
|
+
- `generateShades`
|
|
9
|
+
- `presets`
|
|
10
|
+
- Theme preset types
|
|
11
|
+
- `createCssVariablesResolver`
|
|
12
|
+
- `TOKEN_VAR_MAP`
|
|
13
|
+
- `mantineThemeOverride`
|
|
14
|
+
- `componentThemes`
|
|
15
|
+
- `PresetsProvider`
|
|
16
|
+
- `usePresetsContext`
|
|
17
|
+
- `useAvailablePresets`
|
|
18
|
+
|
|
19
|
+
## Use When
|
|
20
|
+
|
|
21
|
+
- You need to build or customize the Elevasis visual theme.
|
|
22
|
+
- You need access to the shared preset registry or CSS variable mapping.
|
|
23
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Types
|
|
2
|
+
|
|
3
|
+
The types surface re-exports the shared platform types that UI consumers need without a direct `@repo/core` dependency.
|
|
4
|
+
|
|
5
|
+
## Exports
|
|
6
|
+
|
|
7
|
+
- Execution and resource types
|
|
8
|
+
- Command queue and scheduling types
|
|
9
|
+
- Monitoring, observability, and notification types
|
|
10
|
+
- Session, feature-access, and webhook types
|
|
11
|
+
- Multi-tenancy, deployment, and CRM acquisition types
|
|
12
|
+
|
|
13
|
+
## Notes
|
|
14
|
+
|
|
15
|
+
- This is a type-only bridge. It should stay aligned with the current platform contracts.
|
|
16
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Utils
|
|
2
|
+
|
|
3
|
+
The utils surface groups shared date, formatting, validation, error, and resource helper functions.
|
|
4
|
+
|
|
5
|
+
## Exports
|
|
6
|
+
|
|
7
|
+
- Date formatting helpers
|
|
8
|
+
- Relative time helpers
|
|
9
|
+
- Email validation
|
|
10
|
+
- Error helpers
|
|
11
|
+
- Resource icon helpers
|
|
12
|
+
- Shared constants
|
|
13
|
+
- Warning suppression helpers
|
|
14
|
+
|
|
15
|
+
## Use When
|
|
16
|
+
|
|
17
|
+
- You need lightweight shared helpers that do not belong in a feature barrel.
|
|
18
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Zustand
|
|
2
|
+
|
|
3
|
+
The Zustand surface exposes the shared slice creators used by the UI package.
|
|
4
|
+
|
|
5
|
+
## Exports
|
|
6
|
+
|
|
7
|
+
- `createSSESlice`
|
|
8
|
+
- `resetSSEState`
|
|
9
|
+
- `createThemeSlice`
|
|
10
|
+
- `resetThemeState`
|
|
11
|
+
- `createTimeRangeSlice`
|
|
12
|
+
- `resetTimeRangeState`
|
|
13
|
+
- Slice state and configuration types
|
|
14
|
+
|
|
15
|
+
## Use When
|
|
16
|
+
|
|
17
|
+
- You need the shared state slices used by the UI package internals or a compatible consumer.
|
|
18
|
+
|
|
@@ -101,7 +101,7 @@ const scoreStep: WorkflowStep = {
|
|
|
101
101
|
|
|
102
102
|
## Using Platform Tools in Steps
|
|
103
103
|
|
|
104
|
-
Platform tools let your steps call integrations managed by Elevasis (email, CRM, databases, etc.). Import `platform` from `@elevasis/sdk/worker` and call it with the tool name, method, parameters, and
|
|
104
|
+
Platform tools let your steps call integrations managed by Elevasis (email, CRM, databases, etc.). Import `platform` from `@elevasis/sdk/worker` and call it with the tool name, method, parameters, and an optional credential reference when the tool requires one.
|
|
105
105
|
|
|
106
106
|
```typescript
|
|
107
107
|
import { platform, PlatformToolError } from '@elevasis/sdk/worker';
|
|
@@ -132,7 +132,7 @@ const sendEmailStep: WorkflowStep = {
|
|
|
132
132
|
**Key points:**
|
|
133
133
|
|
|
134
134
|
- `platform.call()` is async and times out after 60 seconds
|
|
135
|
-
- `credential` is the name of a platform environment variable set via `elevasis-sdk env set`
|
|
135
|
+
- `credential` is the name of a platform environment variable set via `elevasis-sdk env set` when the tool needs one
|
|
136
136
|
- On failure, `platform.call()` throws `PlatformToolError` (not `ToolingError`)
|
|
137
137
|
- Always log success so executions are easy to debug in the dashboard
|
|
138
138
|
|
|
@@ -149,18 +149,64 @@ import { platform, PlatformToolError } from '@elevasis/sdk/worker';
|
|
|
149
149
|
|
|
150
150
|
const step = async (input) => {
|
|
151
151
|
try {
|
|
152
|
-
const
|
|
152
|
+
const deals = await platform.call({
|
|
153
153
|
tool: 'crm',
|
|
154
|
-
method: '
|
|
155
|
-
params: {
|
|
156
|
-
credential: 'CRM_API_KEY',
|
|
154
|
+
method: 'listDeals',
|
|
155
|
+
params: { stage: 'proposal', limit: 10 },
|
|
157
156
|
});
|
|
158
|
-
|
|
157
|
+
|
|
158
|
+
const deal = deals[0]
|
|
159
|
+
? await platform.call({
|
|
160
|
+
tool: 'crm',
|
|
161
|
+
method: 'getDeal',
|
|
162
|
+
params: { dealId: deals[0].id },
|
|
163
|
+
})
|
|
164
|
+
: null;
|
|
165
|
+
|
|
166
|
+
if (deal) {
|
|
167
|
+
await platform.call({
|
|
168
|
+
tool: 'crm',
|
|
169
|
+
method: 'updateDealStage',
|
|
170
|
+
params: { dealId: deal.id, stage: 'closing' },
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
await platform.call({
|
|
174
|
+
tool: 'crm',
|
|
175
|
+
method: 'createDealNote',
|
|
176
|
+
params: {
|
|
177
|
+
dealId: deal.id,
|
|
178
|
+
body: 'Reviewed proposal and moved the deal forward.',
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
await platform.call({
|
|
183
|
+
tool: 'crm',
|
|
184
|
+
method: 'createDealTask',
|
|
185
|
+
params: {
|
|
186
|
+
dealId: deal.id,
|
|
187
|
+
title: 'Send updated proposal',
|
|
188
|
+
dueAt: input.followUpAt ?? null,
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
await platform.call({
|
|
193
|
+
tool: 'crm',
|
|
194
|
+
method: 'recordActivity',
|
|
195
|
+
params: {
|
|
196
|
+
dealId: deal.id,
|
|
197
|
+
type: 'stage_changed',
|
|
198
|
+
title: 'Deal moved to closing',
|
|
199
|
+
description: 'Reviewed the proposal and moved the deal forward.',
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return { dealId: deal?.id ?? null, dealCount: deals.length };
|
|
159
205
|
} catch (err) {
|
|
160
206
|
if (err instanceof PlatformToolError) {
|
|
161
207
|
// Tool failed -- log it and return a degraded result
|
|
162
208
|
console.error('CRM tool failed:', err.message);
|
|
163
|
-
return {
|
|
209
|
+
return { dealId: null, error: err.message };
|
|
164
210
|
}
|
|
165
211
|
throw err; // re-throw unexpected errors
|
|
166
212
|
}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Organization Graph
|
|
3
|
+
description: Organization OS Graph layer documentation for the Cytoscape-based organization graph, derived from the organization model and bridged with Command View runtime topology through the shared feature provider.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
Within Organization OS, the organization graph is the dedicated **Graph** layer. It treats the organization model as the top-level ontology and bridges in Command View runtime topology so one graph can support semantic exploration and operations-oriented tracing. It is not a replacement renderer for Command View; it is a shared graph product that subsumes Command View as one operational lens.
|
|
9
|
+
|
|
10
|
+
Graph contracts live in `@repo/core` alongside the organization model. Rendering lives in `@repo/ui` with Cytoscape.js. The command-center route is a thin wrapper over the shared page.
|
|
11
|
+
|
|
12
|
+
## Status
|
|
13
|
+
|
|
14
|
+
First implementation slices are live end-to-end. Command View now delegates to the graph through a command-view lens preset. Layout iteration on the one-panel graph + command surface is ongoing; graph contracts and provider bridge are stable.
|
|
15
|
+
|
|
16
|
+
Graph types are intentionally **not** part of the published `@elevasis/core` surface yet. Graph adoption remains monorepo-first.
|
|
17
|
+
|
|
18
|
+
## Source of Truth
|
|
19
|
+
|
|
20
|
+
- `packages/core/src/organization-model/graph/types.ts` -- node/edge DTO shapes
|
|
21
|
+
- `packages/core/src/organization-model/graph/schema.ts` -- runtime validation
|
|
22
|
+
- `packages/core/src/organization-model/graph/build.ts` -- `buildOrganizationGraph(...)` derivation
|
|
23
|
+
- `packages/core/src/organization-model/__tests__/graph.test.ts` -- derivation and bridge tests
|
|
24
|
+
- `packages/ui/src/features/operations/OrganizationGraphPage.tsx` -- shared Cytoscape page
|
|
25
|
+
- `packages/ui/src/features/operations/CommandViewPage.tsx` -- command-view lens delegating to the graph
|
|
26
|
+
- `packages/ui/src/features/operations/organization-graph/` -- filter helpers, detail-state helpers, path tracing, operational summary
|
|
27
|
+
- `packages/ui/src/features/operations/manifest.ts` -- `organizationGraph.surfaceId = 'operations.organization-graph'`
|
|
28
|
+
- `apps/command-center/src/routes/operations/organization-graph.index.tsx` -- route wrapper
|
|
29
|
+
|
|
30
|
+
## Product Jobs
|
|
31
|
+
|
|
32
|
+
The graph helps users:
|
|
33
|
+
|
|
34
|
+
- orient themselves in the organization model
|
|
35
|
+
- discover how domains, capabilities, surfaces, entities, resources, and workflows connect
|
|
36
|
+
- trace upstream/downstream dependencies
|
|
37
|
+
- understand ownership and implementation boundaries
|
|
38
|
+
- assess blast radius before changing a workflow, agent, feature, or integration
|
|
39
|
+
- operate across strategy, operations, and debugging through different lenses on the same graph
|
|
40
|
+
|
|
41
|
+
The graph does not replace workflow editors, execution-run visualizers, or builder-style authoring canvases. React Flow remains the better fit for editor/execution visuals; Cytoscape fits the exploration-oriented ontology graph.
|
|
42
|
+
|
|
43
|
+
## Architecture
|
|
44
|
+
|
|
45
|
+
### Unified graph model
|
|
46
|
+
|
|
47
|
+
The implementation uses one typed graph, not separate semantic and implementation taxonomies.
|
|
48
|
+
|
|
49
|
+
- Node kinds: `organization`, `feature`, `domain`, `surface`, `entity`, `capability`, `resource`
|
|
50
|
+
- Edge kinds: `contains`, `references`, `exposes`, `maps_to`
|
|
51
|
+
- `resource` nodes carry `resourceType` metadata: `workflow`, `agent`, `trigger`, `integration`, `external`, or `human_checkpoint`
|
|
52
|
+
- `references` edges may also carry `relationshipType`: `triggers`, `uses`, or `approval`
|
|
53
|
+
|
|
54
|
+
This means runtime topology is represented as bridged `resource` nodes plus relationship metadata on shared edge types, rather than as a second disconnected edge/node vocabulary.
|
|
55
|
+
|
|
56
|
+
### Compatibility rules with the organization model
|
|
57
|
+
|
|
58
|
+
- `OrganizationModelSchema` is the source of truth for semantic structure. The graph does not introduce a second ontology.
|
|
59
|
+
- Graph node IDs and references reuse organization-model IDs wherever those IDs already exist.
|
|
60
|
+
- `domain` nodes derive from `organizationModel.domains`.
|
|
61
|
+
- `surface` nodes derive from `organizationModel.navigation.surfaces`; graph routing respects surface `path` and `defaultSurfaceId`.
|
|
62
|
+
- Feature gating and labels respect `organizationModel.features.enabled` and `.labels`.
|
|
63
|
+
- Implementation-resource bridging prefers `organizationModel.resourceMappings`.
|
|
64
|
+
- Graph defaults remain valid when produced by `resolveOrganizationModel()`.
|
|
65
|
+
- If the graph needs a concept the model cannot express, extend the model first.
|
|
66
|
+
|
|
67
|
+
### Shared DTO
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
type OrganizationGraphNodeKind =
|
|
71
|
+
| 'organization'
|
|
72
|
+
| 'feature'
|
|
73
|
+
| 'domain'
|
|
74
|
+
| 'surface'
|
|
75
|
+
| 'entity'
|
|
76
|
+
| 'capability'
|
|
77
|
+
| 'resource'
|
|
78
|
+
|
|
79
|
+
type OrganizationGraphEdgeKind = 'contains' | 'references' | 'exposes' | 'maps_to'
|
|
80
|
+
|
|
81
|
+
interface OrganizationGraph {
|
|
82
|
+
version: 1
|
|
83
|
+
organizationModelVersion: OrganizationModel['version']
|
|
84
|
+
nodes: OrganizationGraphNode[]
|
|
85
|
+
edges: OrganizationGraphEdge[]
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
`OrganizationGraphNode` also includes optional `sourceId`, `description`, `enabled`, `featureKey`, `surfaceType`, and `resourceType`. `OrganizationGraphEdge` includes optional `label` and `relationshipType`.
|
|
90
|
+
|
|
91
|
+
### Build pipeline
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
interface BuildOrganizationGraphInput {
|
|
95
|
+
organizationModel: OrganizationModel
|
|
96
|
+
commandViewData?: CommandViewData
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
`buildOrganizationGraph` accepts optional topology input so the semantic graph still renders when operational bridging is sparse. The derivation flow is additive and upsert-oriented:
|
|
101
|
+
|
|
102
|
+
1. Resolve the active organization model.
|
|
103
|
+
2. Derive semantic nodes and edges from domains, features, surfaces, entities, capabilities, and resource mappings.
|
|
104
|
+
3. Upsert bridged runtime resources from Command View data into shared `resource` nodes.
|
|
105
|
+
4. Merge topology relationships onto the same DTO using `references` or `maps_to` edges plus optional `relationshipType`.
|
|
106
|
+
5. Hand the resulting graph to UI-level lensing, filtering, and Cytoscape projection.
|
|
107
|
+
|
|
108
|
+
Keeping assembly outside the renderer keeps graph semantics testable without UI and prevents Cytoscape concepts from leaking into business logic.
|
|
109
|
+
|
|
110
|
+
### Ownership split
|
|
111
|
+
|
|
112
|
+
- `@repo/core` owns normalized node/edge types, schemas, and build/derivation helpers.
|
|
113
|
+
- `@repo/ui` owns Cytoscape element conversion, layout presets, selection/hover/expansion/viewport state, detail panels, and presentation helpers.
|
|
114
|
+
- `apps/command-center` owns route wiring and page-level integration.
|
|
115
|
+
|
|
116
|
+
## Interaction Model
|
|
117
|
+
|
|
118
|
+
### Lenses
|
|
119
|
+
|
|
120
|
+
The graph ships with two lens presets in UI code:
|
|
121
|
+
|
|
122
|
+
- `default` -- title "Organization Graph", initial mode `map`, no preset filters
|
|
123
|
+
- `command-view` -- title "Command View", initial mode `trace`, filters preset to `nodeKinds: ['resource']` and `topologyPresence: 'topology-only'`
|
|
124
|
+
|
|
125
|
+
Lenses do not change the core DTO. They configure how the shared graph is initially presented.
|
|
126
|
+
|
|
127
|
+
### Modes
|
|
128
|
+
|
|
129
|
+
- **Map mode** -- clustered for broad graph orientation
|
|
130
|
+
- **Trace mode** -- directed layout that privileges path readability
|
|
131
|
+
- **Impact mode** -- centered radial/concentric layout around the current focus
|
|
132
|
+
|
|
133
|
+
Layouts are deterministic presets, not unconstrained force simulation:
|
|
134
|
+
|
|
135
|
+
- `map` uses Cytoscape `cose`
|
|
136
|
+
- `trace` uses directed `breadthfirst`
|
|
137
|
+
- `impact` uses degree-based `concentric`
|
|
138
|
+
|
|
139
|
+
### Interactions
|
|
140
|
+
|
|
141
|
+
Primary set, kept small and high-value:
|
|
142
|
+
|
|
143
|
+
- click node for detail panel
|
|
144
|
+
- click edge for relationship meaning
|
|
145
|
+
- hover for adjacency preview
|
|
146
|
+
- search and jump to node
|
|
147
|
+
- expand immediate neighbors
|
|
148
|
+
- isolate selected node + N-hop neighborhood
|
|
149
|
+
- switch mode
|
|
150
|
+
- pin selected nodes
|
|
151
|
+
- highlight shortest or most relevant path between two nodes
|
|
152
|
+
- filter by node kind, domain, capability, feature, status, environment
|
|
153
|
+
|
|
154
|
+
Deferred: freeform node placement, collaborative annotations, graph editing/authoring, arbitrary canvas drawing.
|
|
155
|
+
|
|
156
|
+
### Filtering
|
|
157
|
+
|
|
158
|
+
The filter state lives in `useOrganizationGraphFilters()` and the toolbar UI in `OrganizationGraphFilterToolbar`.
|
|
159
|
+
|
|
160
|
+
Filter inputs:
|
|
161
|
+
|
|
162
|
+
- `search`
|
|
163
|
+
- `nodeKinds`
|
|
164
|
+
- `topologyPresence: 'all' | 'semantic-only' | 'topology-only'`
|
|
165
|
+
|
|
166
|
+
Presence is derived per node:
|
|
167
|
+
|
|
168
|
+
- `resource` nodes are `topology-only`
|
|
169
|
+
- nodes with only semantic edges are `semantic-only`
|
|
170
|
+
- nodes with both semantic and topology edges are treated as bridge nodes internally
|
|
171
|
+
|
|
172
|
+
Search matches node IDs, labels, descriptions, source IDs, feature keys, surface/resource types, edge labels, edge kinds, and `relationshipType`.
|
|
173
|
+
|
|
174
|
+
The page applies `useDeferredValue()` to the active filters so graph search stays responsive while typing.
|
|
175
|
+
|
|
176
|
+
### Path tracing
|
|
177
|
+
|
|
178
|
+
The visible Cytoscape surface projects a **filtered** shared graph DTO rather than rendering the full graph unconditionally. Path tracing resolves and highlights directed paths inside the current visible projection, so filtering and tracing stay coherent.
|
|
179
|
+
|
|
180
|
+
Renderer-agnostic helpers under `packages/ui/src/features/operations/organization-graph/path-tracing/` implement shortest-path logic independent of Cytoscape.
|
|
181
|
+
|
|
182
|
+
## Provider Integration
|
|
183
|
+
|
|
184
|
+
The graph is exposed through `ElevasisFeaturesProvider` rather than as app-local glue:
|
|
185
|
+
|
|
186
|
+
- `FeatureModule.organizationGraph.surfaceId` declares a manifest's bridge point.
|
|
187
|
+
- `operationsManifest` declares `organizationGraph.surfaceId = 'operations.organization-graph'`.
|
|
188
|
+
- The provider resolves that against `organizationModel.navigation.surfaces` and exposes the result as `organizationGraph` in context.
|
|
189
|
+
- Shared UI/operations code stays manifest-driven while remaining aware of semantic organization topology.
|
|
190
|
+
|
|
191
|
+
## Command View Integration
|
|
192
|
+
|
|
193
|
+
`CommandViewPage` now delegates to `OrganizationGraphPage` through a command-view lens preset. The lens restores high-value operational context through:
|
|
194
|
+
|
|
195
|
+
- route-level execution-health cards
|
|
196
|
+
- selection-aware resource and human-checkpoint summaries inside the shared graph detail panel
|
|
197
|
+
- follow-up actions for recent executions and pending tasks inside the detail panel
|
|
198
|
+
- dedicated command-view sidebar content (`Command View` labeling and node filters live in the subshell sidebar, not on the graph canvas)
|
|
199
|
+
|
|
200
|
+
Operational summary and drill-down derivation is covered by tests under `packages/ui/src/features/operations/organization-graph/__tests__/`.
|
|
201
|
+
|
|
202
|
+
The detail experience is shared through `OrganizationGraphDetailPanel`, which can render both semantic context and command-view-specific follow-up sections.
|
|
203
|
+
|
|
204
|
+
## Cytoscape Responsibility Split
|
|
205
|
+
|
|
206
|
+
Cytoscape owns:
|
|
207
|
+
|
|
208
|
+
- element rendering
|
|
209
|
+
- compound/group visualization
|
|
210
|
+
- neighborhood traversal and selection state
|
|
211
|
+
- path highlighting
|
|
212
|
+
- collapsed/expanded cluster behavior
|
|
213
|
+
- layout execution
|
|
214
|
+
- viewport mechanics (pan, zoom, fit, focus)
|
|
215
|
+
|
|
216
|
+
React owns:
|
|
217
|
+
|
|
218
|
+
- mode switching
|
|
219
|
+
- side panels and inspectors
|
|
220
|
+
- search and command-palette entry
|
|
221
|
+
- route state and deep-linking
|
|
222
|
+
- server data fetching
|
|
223
|
+
- persistence of saved filters and views
|
|
224
|
+
|
|
225
|
+
## Package Boundary
|
|
226
|
+
|
|
227
|
+
- `packages/ui/package.json` declares Cytoscape on the published UI surface.
|
|
228
|
+
- `packages/ui/tsup.config.ts` and `packages/ui/rollup.dts.config.mjs` keep Cytoscape **externalized** for publish output.
|
|
229
|
+
- Graph DTO types are internal to `@repo/core`. The published `@elevasis/core` wrapper still exposes only the narrow organization-model API. External graph adoption should not be assumed.
|
|
230
|
+
|
|
231
|
+
## Theming
|
|
232
|
+
|
|
233
|
+
The shared Cytoscape page reads CSS custom properties at runtime via `window.getComputedStyle(document.documentElement)`. Nodes, edges, overlays, and glass panels stay aligned with the active UI theme instead of relying on a fixed graph-only palette.
|
|
234
|
+
|
|
235
|
+
## Cytoscape States
|
|
236
|
+
|
|
237
|
+
The renderer applies CSS-class-style state markers to highlight context and traces:
|
|
238
|
+
|
|
239
|
+
- `.is-faded`
|
|
240
|
+
- `.is-context`
|
|
241
|
+
- `.is-selected`
|
|
242
|
+
- `.is-connected`
|
|
243
|
+
- `.is-trace-node`
|
|
244
|
+
- `.is-trace-endpoint`
|
|
245
|
+
- `.is-trace-edge`
|
|
246
|
+
|
|
247
|
+
These classes drive neighborhood focus, selection emphasis, and trace-path highlighting without changing the underlying DTO.
|
|
248
|
+
|
|
249
|
+
## Migration Guardrails
|
|
250
|
+
|
|
251
|
+
- Do not move canonical graph interfaces into `packages/ui`.
|
|
252
|
+
- Do not redefine organization-model semantics in app-local graph config.
|
|
253
|
+
- Do not make the graph contract depend on Cytoscape-specific types.
|
|
254
|
+
- Existing Command View relationships bridge into `relationshipType = triggers | uses | approval` -- do not overload those operational labels with new semantic meaning.
|
|
255
|
+
|
|
256
|
+
## Verification
|
|
257
|
+
|
|
258
|
+
- `pnpm --filter @repo/core test -- organization-model graph`
|
|
259
|
+
- `pnpm --filter @repo/ui test -- commandViewDrillDown commandViewOperationalSummary organizationGraphDetail`
|
|
260
|
+
- `pnpm --filter @repo/ui build`
|
|
261
|
+
- `pnpm --filter @repo/ui build:publish`
|
|
262
|
+
- `pnpm --filter command-center build`
|