@elevasis/ui 2.30.0 → 2.32.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.
Files changed (130) hide show
  1. package/dist/api/index.js +2 -2
  2. package/dist/app/index.css +38 -0
  3. package/dist/app/index.d.ts +190 -9
  4. package/dist/app/index.js +7 -6
  5. package/dist/charts/index.js +4 -5
  6. package/dist/{chunk-HXZQWMKE.js → chunk-2RJMVWFJ.js} +1 -6
  7. package/dist/{chunk-4VQ2PXMI.js → chunk-3FV6HBXS.js} +4 -4
  8. package/dist/{chunk-CW3UNAF2.js → chunk-4DYOXEH6.js} +410 -5
  9. package/dist/{chunk-JKTPRYGV.js → chunk-4MFNGNHF.js} +123 -192
  10. package/dist/{chunk-HYLERWRO.js → chunk-4QK76KIF.js} +7 -7
  11. package/dist/chunk-5FJJ72HU.js +13 -0
  12. package/dist/chunk-5J4PDX26.js +112 -0
  13. package/dist/{chunk-4SY6BTVZ.js → chunk-6DWD423K.js} +12 -9
  14. package/dist/{chunk-3GV5NHSS.js → chunk-7KZINJLP.js} +78 -232
  15. package/dist/{chunk-6WXDE5LZ.js → chunk-EPTHX4VZ.js} +1 -1
  16. package/dist/{chunk-6EFVZV6X.js → chunk-GCOQ3TBG.js} +243 -254
  17. package/dist/{chunk-LRZFLK2F.js → chunk-IQHU7O5Y.js} +4 -4
  18. package/dist/{chunk-X2SUMO3P.js → chunk-IZWTVFJ2.js} +16 -3
  19. package/dist/{chunk-IKQ42WHU.js → chunk-JFL3GRD4.js} +1 -1
  20. package/dist/{chunk-4FZYEEPK.js → chunk-LLRXA7D7.js} +5 -6
  21. package/dist/chunk-MOY4VOHF.js +347 -0
  22. package/dist/{chunk-XQQEKWTL.js → chunk-N55DVMAG.js} +6 -2
  23. package/dist/{chunk-7E3FUTND.js → chunk-ND5TDV2J.js} +1 -1
  24. package/dist/{chunk-WF227UBV.js → chunk-QQHOKTJA.js} +4 -4
  25. package/dist/{chunk-A7B7HLDF.js → chunk-QTI3KC7D.js} +5884 -515
  26. package/dist/chunk-QXCDKE2O.js +486 -0
  27. package/dist/chunk-R2XR4FCV.js +48 -0
  28. package/dist/chunk-R66W5UDG.js +26 -0
  29. package/dist/{chunk-T5Z7G2J2.js → chunk-RQA2EVN3.js} +6 -16
  30. package/dist/{chunk-SKXXT3E2.js → chunk-RQTWIXJ5.js} +4 -4
  31. package/dist/chunk-T35FWDAB.js +4342 -0
  32. package/dist/{chunk-DWK2QIAK.js → chunk-TYRUKGGD.js} +1 -1
  33. package/dist/{chunk-CN2HC4D4.js → chunk-UFTM5SZZ.js} +2 -2
  34. package/dist/{chunk-JCGD4GM6.js → chunk-UROTM5OR.js} +14 -1
  35. package/dist/{chunk-6YT4IKJ7.js → chunk-VNAZTCHA.js} +15 -0
  36. package/dist/{chunk-KVJ3LFH2.js → chunk-VNFR57DF.js} +4 -24
  37. package/dist/{chunk-SBCIB5TZ.js → chunk-VRNMNB3O.js} +6 -7
  38. package/dist/chunk-WQPX44YM.js +1626 -0
  39. package/dist/{chunk-T2PAD63Y.js → chunk-XZGSCABI.js} +1 -1
  40. package/dist/chunk-YLQEVSOR.js +299 -0
  41. package/dist/{chunk-P5WYW2GI.js → chunk-ZQOKIGZP.js} +152 -306
  42. package/dist/components/index.css +38 -0
  43. package/dist/components/index.d.ts +334 -38
  44. package/dist/components/index.js +42 -42
  45. package/dist/components/navigation/index.css +38 -0
  46. package/dist/components/navigation/index.js +3 -2
  47. package/dist/execution/index.d.ts +9 -3
  48. package/dist/features/auth/index.css +38 -0
  49. package/dist/features/auth/index.d.ts +212 -14
  50. package/dist/features/auth/index.js +41 -9
  51. package/dist/features/clients/index.css +649 -0
  52. package/dist/features/clients/index.d.ts +86 -0
  53. package/dist/features/clients/index.js +720 -0
  54. package/dist/features/crm/index.css +38 -0
  55. package/dist/features/crm/index.d.ts +228 -20
  56. package/dist/features/crm/index.js +20 -17
  57. package/dist/features/dashboard/index.css +38 -0
  58. package/dist/features/dashboard/index.d.ts +78 -3
  59. package/dist/features/dashboard/index.js +16 -16
  60. package/dist/features/delivery/index.css +38 -0
  61. package/dist/features/delivery/index.d.ts +201 -18
  62. package/dist/features/delivery/index.js +20 -18
  63. package/dist/features/knowledge/index.css +38 -0
  64. package/dist/features/knowledge/index.d.ts +20 -18
  65. package/dist/features/knowledge/index.js +116 -578
  66. package/dist/features/lead-gen/index.css +38 -0
  67. package/dist/features/lead-gen/index.d.ts +59 -51
  68. package/dist/features/lead-gen/index.js +20 -18
  69. package/dist/features/monitoring/index.css +38 -0
  70. package/dist/features/monitoring/index.d.ts +20 -18
  71. package/dist/features/monitoring/index.js +19 -18
  72. package/dist/features/monitoring/requests/index.css +38 -0
  73. package/dist/features/monitoring/requests/index.d.ts +21 -19
  74. package/dist/features/monitoring/requests/index.js +17 -15
  75. package/dist/features/operations/index.css +38 -0
  76. package/dist/features/operations/index.d.ts +945 -45
  77. package/dist/features/operations/index.js +24 -26
  78. package/dist/features/seo/index.d.ts +20 -18
  79. package/dist/features/seo/index.js +1 -1
  80. package/dist/features/settings/index.css +38 -0
  81. package/dist/features/settings/index.d.ts +201 -18
  82. package/dist/features/settings/index.js +18 -16
  83. package/dist/hooks/delivery/index.css +38 -0
  84. package/dist/hooks/delivery/index.d.ts +200 -0
  85. package/dist/hooks/delivery/index.js +2 -2
  86. package/dist/hooks/index.css +38 -0
  87. package/dist/hooks/index.d.ts +825 -47
  88. package/dist/hooks/index.js +14 -13
  89. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +194 -3
  90. package/dist/hooks/published.css +38 -0
  91. package/dist/hooks/published.d.ts +825 -47
  92. package/dist/hooks/published.js +14 -13
  93. package/dist/index.css +38 -0
  94. package/dist/index.d.ts +1506 -1212
  95. package/dist/index.js +15 -14
  96. package/dist/initialization/index.d.ts +181 -0
  97. package/dist/knowledge/index.d.ts +813 -1068
  98. package/dist/knowledge/index.js +7370 -2869
  99. package/dist/{chunk-CLUP5H3C.js → knowledge-search-index-5KYPO746.js} +441 -963
  100. package/dist/layout/index.d.ts +6 -0
  101. package/dist/layout/index.js +4 -5
  102. package/dist/organization/index.css +38 -0
  103. package/dist/profile/index.d.ts +181 -0
  104. package/dist/provider/index.css +38 -0
  105. package/dist/provider/index.d.ts +909 -1156
  106. package/dist/provider/index.js +11 -10
  107. package/dist/provider/published.css +38 -0
  108. package/dist/provider/published.d.ts +906 -1153
  109. package/dist/provider/published.js +7 -6
  110. package/dist/supabase/index.d.ts +349 -0
  111. package/dist/test-utils/index.d.ts +16 -9
  112. package/dist/test-utils/index.js +39 -32
  113. package/dist/test-utils/setup.js +1 -1
  114. package/dist/theme/index.js +3 -3
  115. package/dist/theme/presets/index.js +1 -1
  116. package/dist/types/index.d.ts +378 -5
  117. package/dist/utils/index.d.ts +78 -3
  118. package/dist/utils/index.js +1 -1
  119. package/dist/vite/index.js +2 -2
  120. package/dist/vite-plugin-knowledge/index.js +1 -1
  121. package/package.json +47 -37
  122. package/src/provider/README.md +5 -5
  123. package/dist/chunk-2DIYILF7.js +0 -413
  124. package/dist/chunk-3MDNBHVB.js +0 -3868
  125. package/dist/chunk-6IXOKUBC.js +0 -347
  126. package/dist/chunk-AKOD52HS.js +0 -739
  127. package/dist/chunk-ECNNI3NT.js +0 -6
  128. package/dist/chunk-JDNEWB5F.js +0 -10
  129. package/dist/chunk-NITGGYH2.js +0 -476
  130. package/dist/chunk-OAVTMITG.js +0 -13
@@ -1,421 +1,65 @@
1
- import { KnowledgeSearchBar, KnowledgeTree, getKnowledgeIconToken, byKind } from '../../chunk-CLUP5H3C.js';
2
- import { CommandViewSidebarContent, OrganizationModelSchema, buildOrganizationGraph, DEFAULT_ORGANIZATION_MODEL_OPERATIONS, DEFAULT_ORGANIZATION_MODEL_STATUSES, DEFAULT_ORGANIZATION_MODEL_GOALS, DEFAULT_ORGANIZATION_MODEL_ROLES, DEFAULT_ORGANIZATION_MODEL_OFFERINGS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_IDENTITY, DEFAULT_ORGANIZATION_MODEL_PROJECTS, DEFAULT_ORGANIZATION_MODEL_BRANDING } from '../../chunk-3MDNBHVB.js';
3
- import '../../chunk-ZTWA5H77.js';
4
- import { SemanticIcon } from '../../chunk-JCGD4GM6.js';
5
- import '../../chunk-XQQEKWTL.js';
6
- import { KNOWLEDGE_FEATURE_ID } from '../../chunk-ECNNI3NT.js';
7
- import { DEFAULT_ORGANIZATION_MODEL_PROSPECTING } from '../../chunk-NITGGYH2.js';
8
- import '../../chunk-CW3UNAF2.js';
1
+ import { getSharedOrganizationGraph, KnowledgeSearchBar, KnowledgeTree, getKnowledgeIconToken } from '../../chunk-WQPX44YM.js';
2
+ import { ORGANIZATION_GRAPH_NODE_KIND_LABELS } from '../../chunk-5J4PDX26.js';
3
+ import { SemanticIcon } from '../../chunk-UROTM5OR.js';
9
4
  import { SubshellSidebarSection } from '../../chunk-IIMU5YAJ.js';
10
- import '../../chunk-7M2VOCYN.js';
11
- import '../../chunk-6EFVZV6X.js';
12
- import '../../chunk-6YT4IKJ7.js';
13
- import '../../chunk-T2PAD63Y.js';
14
- import '../../chunk-BRXELOHC.js';
15
- import '../../chunk-3ZMAGTWF.js';
16
- import '../../chunk-OAVTMITG.js';
17
- import '../../chunk-SKXXT3E2.js';
18
- import '../../chunk-T5Z7G2J2.js';
19
- import '../../chunk-4VQ2PXMI.js';
20
- import '../../chunk-WLOQ4IBG.js';
21
- import '../../chunk-4SY6BTVZ.js';
22
- import '../../chunk-6WXDE5LZ.js';
23
- import '../../chunk-3KMDHCAR.js';
24
- import { DEFAULT_ORGANIZATION_MODEL_SALES } from '../../chunk-AKOD52HS.js';
25
- import '../../chunk-SZHARWKU.js';
26
- import { useElevasisFeatures } from '../../chunk-6IXOKUBC.js';
27
- import '../../chunk-TKAYX2SP.js';
28
- import '../../chunk-NYBEU5TE.js';
29
- import '../../chunk-7E3FUTND.js';
5
+ import { useElevasisSystems } from '../../chunk-QXCDKE2O.js';
6
+ import { resolveOrganizationModel } from '../../chunk-T35FWDAB.js';
30
7
  import '../../chunk-2IFYDILW.js';
31
8
  import { useRouterContext } from '../../chunk-Q7DJKLEN.js';
32
9
  import '../../chunk-JA5ECJJB.js';
33
10
  import '../../chunk-HUJCU55S.js';
34
- import '../../chunk-E565XMTQ.js';
35
11
  import '../../chunk-JBWJ6WHZ.js';
36
12
  import '../../chunk-DT3QYZVU.js';
37
13
  import '../../chunk-RNP5R5I3.js';
38
- import '../../chunk-HXZQWMKE.js';
39
- import '../../chunk-KRWALB24.js';
40
- import '../../chunk-VKIZUUPM.js';
41
14
  import '../../chunk-533DUEQY.js';
42
15
  import '../../chunk-DD3CCMCZ.js';
43
16
  import '../../chunk-2Q2JQSQO.js';
44
17
  import '../../chunk-KJ3QUBNU.js';
45
18
  import '../../chunk-BRJ3QZ4E.js';
46
19
  import '../../chunk-I2KLQ2HA.js';
47
- import { IconBrain, IconCheck, IconCopy } from '@tabler/icons-react';
48
- import { Stack, Box, SegmentedControl, Text, UnstyledButton, Group, Badge } from '@mantine/core';
20
+ import { IconBrain, IconCircleCheckFilled, IconCircleDashed, IconCheck, IconCopy } from '@tabler/icons-react';
21
+ import { Stack, Box, Group, Popover, Button, Badge, Divider, Text, UnstyledButton } from '@mantine/core';
49
22
  import { useClipboard } from '@mantine/hooks';
50
23
  import { useMemo, useState } from 'react';
51
24
  import { jsx, jsxs } from 'react/jsx-runtime';
52
25
 
53
- // ../core/src/organization-model/defaults.ts
54
- var DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE = {
55
- nodes: []
56
- };
57
- var DEFAULT_ORGANIZATION_MODEL = {
58
- version: 1,
59
- features: [
60
- {
61
- id: "dashboard",
62
- label: "Dashboard",
63
- enabled: true,
64
- path: "/",
65
- icon: "feature.dashboard",
66
- uiPosition: "sidebar-primary"
67
- },
68
- {
69
- id: "identity",
70
- label: "Identity",
71
- description: "Company identity, positioning, and market context",
72
- enabled: true,
73
- color: "indigo"
74
- },
75
- {
76
- id: "platform",
77
- label: "Platform",
78
- description: "Elevasis platform architecture, capabilities, and implementation patterns",
79
- enabled: true,
80
- color: "cyan",
81
- icon: "feature.platform"
82
- },
83
- {
84
- id: "finance",
85
- label: "Finance",
86
- description: "Finance operations, accounting, billing, reconciliation, and tax prep",
87
- enabled: true,
88
- color: "green",
89
- icon: "feature.finance"
90
- },
91
- {
92
- id: "sales",
93
- label: "Sales",
94
- description: "Revenue workflows and customer acquisition",
95
- enabled: true,
96
- color: "blue",
97
- icon: "feature.sales",
98
- uiPosition: "sidebar-primary"
99
- },
100
- {
101
- id: "sales.crm",
102
- label: "CRM",
103
- description: "Relationship pipeline and deal management",
104
- enabled: true,
105
- color: "blue",
106
- icon: "feature.crm",
107
- path: "/crm"
108
- },
109
- {
110
- id: "sales.lead-gen",
111
- label: "Lead Gen",
112
- description: "Prospecting, qualification, and outreach preparation",
113
- enabled: true,
114
- color: "cyan",
115
- icon: "feature.lead-gen",
116
- path: "/lead-gen"
117
- },
118
- {
119
- id: "projects",
120
- label: "Projects",
121
- description: "Projects, milestones, and client work execution",
122
- enabled: true,
123
- color: "orange",
124
- icon: "feature.projects",
125
- path: "/projects",
126
- uiPosition: "sidebar-primary"
127
- },
128
- {
129
- id: "operations",
130
- label: "Operations",
131
- description: "Operational resources, topology, and orchestration visibility",
132
- enabled: true,
133
- color: "violet",
134
- icon: "feature.operations",
135
- uiPosition: "sidebar-primary"
136
- },
137
- {
138
- id: "knowledge.command-view",
139
- label: "Command View",
140
- enabled: true,
141
- path: "/knowledge/command-view",
142
- devOnly: true
143
- },
144
- {
145
- id: "operations.overview",
146
- label: "Overview",
147
- enabled: true,
148
- path: "/operations"
149
- },
150
- {
151
- id: "operations.resources",
152
- label: "Resources",
153
- enabled: true,
154
- path: "/operations/resources"
155
- },
156
- {
157
- id: "operations.command-queue",
158
- label: "Command Queue",
159
- enabled: true,
160
- path: "/operations/command-queue"
161
- },
162
- {
163
- id: "operations.sessions",
164
- label: "Sessions",
165
- enabled: false,
166
- path: "/operations/sessions"
167
- },
168
- {
169
- id: "operations.task-scheduler",
170
- label: "Task Scheduler",
171
- enabled: true,
172
- path: "/operations/task-scheduler"
173
- },
174
- {
175
- id: "monitoring",
176
- label: "Monitoring",
177
- enabled: true,
178
- uiPosition: "sidebar-primary"
179
- },
180
- {
181
- id: "monitoring.calendar",
182
- label: "Calendar",
183
- description: "Google Calendar events and agenda views",
184
- enabled: true,
185
- path: "/monitoring/calendar",
186
- icon: "feature.calendar"
187
- },
188
- {
189
- id: "monitoring.activity-log",
190
- label: "Activity Log",
191
- enabled: true,
192
- path: "/monitoring/activity-log"
193
- },
194
- {
195
- id: "monitoring.execution-logs",
196
- label: "Execution Logs",
197
- enabled: true,
198
- path: "/monitoring/execution-logs"
199
- },
200
- {
201
- id: "monitoring.execution-health",
202
- label: "Execution Health",
203
- enabled: true,
204
- path: "/monitoring/execution-health"
205
- },
206
- {
207
- id: "monitoring.cost-analytics",
208
- label: "Cost Analytics",
209
- enabled: false,
210
- path: "/monitoring/cost-analytics"
211
- },
212
- {
213
- id: "monitoring.notifications",
214
- label: "Notifications",
215
- enabled: true,
216
- path: "/monitoring/notifications"
217
- },
218
- {
219
- id: "monitoring.submitted-requests",
220
- label: "Submitted Requests",
221
- enabled: true,
222
- path: "/monitoring/requests"
223
- },
224
- {
225
- id: "settings",
226
- label: "Settings",
227
- enabled: true,
228
- icon: "feature.settings",
229
- uiPosition: "sidebar-bottom"
230
- },
231
- {
232
- id: "settings.account",
233
- label: "Account",
234
- enabled: true,
235
- path: "/settings/account"
236
- },
237
- {
238
- id: "settings.appearance",
239
- label: "Appearance",
240
- enabled: true,
241
- path: "/settings/appearance"
242
- },
243
- {
244
- id: "settings.roles",
245
- label: "My Roles",
246
- enabled: true,
247
- path: "/settings/roles"
248
- },
249
- {
250
- id: "settings.organization",
251
- label: "Organization",
252
- enabled: true,
253
- path: "/settings/organization"
254
- },
255
- {
256
- id: "settings.credentials",
257
- label: "Credentials",
258
- enabled: true,
259
- path: "/settings/credentials"
260
- },
261
- {
262
- id: "settings.api-keys",
263
- label: "API Keys",
264
- enabled: true,
265
- path: "/settings/api-keys"
266
- },
267
- {
268
- id: "settings.webhooks",
269
- label: "Webhooks",
270
- enabled: true,
271
- path: "/settings/webhooks"
272
- },
273
- {
274
- id: "settings.deployments",
275
- label: "Deployments",
276
- enabled: true,
277
- path: "/settings/deployments"
278
- },
279
- {
280
- id: "admin",
281
- label: "Admin",
282
- enabled: true,
283
- path: "/admin",
284
- icon: "feature.admin",
285
- uiPosition: "sidebar-bottom",
286
- requiresAdmin: true
287
- },
288
- {
289
- id: "admin.system-health",
290
- label: "System Health",
291
- enabled: true,
292
- path: "/admin/system-health"
293
- },
294
- {
295
- id: "admin.organizations",
296
- label: "Organizations",
297
- enabled: true,
298
- path: "/admin/organizations"
299
- },
300
- {
301
- id: "admin.users",
302
- label: "Users",
303
- enabled: true,
304
- path: "/admin/users"
305
- },
306
- {
307
- id: "admin.design-showcase",
308
- label: "Design Showcase",
309
- enabled: true,
310
- path: "/admin/design-showcase"
311
- },
312
- {
313
- id: "admin.debug",
314
- label: "Debug",
315
- enabled: true,
316
- path: "/admin/debug"
317
- },
318
- {
319
- id: "archive",
320
- label: "Archive",
321
- enabled: true,
322
- path: "/archive",
323
- icon: "feature.archive",
324
- uiPosition: "sidebar-bottom",
325
- devOnly: true
326
- },
327
- {
328
- id: "archive.agent-chat",
329
- label: "Agent Chat",
330
- enabled: true,
331
- path: "/archive/agent-chat"
332
- },
333
- {
334
- id: "archive.execution-runner",
335
- label: "Execution Runner",
336
- enabled: true,
337
- path: "/archive/execution-runner"
338
- },
339
- {
340
- id: "seo",
341
- label: "SEO",
342
- enabled: false,
343
- path: "/seo"
344
- },
345
- {
346
- id: "knowledge",
347
- label: "Knowledge",
348
- description: "Operational knowledge, playbooks, and strategy docs",
349
- enabled: true,
350
- color: "teal",
351
- icon: "feature.knowledge",
352
- uiPosition: "sidebar-primary"
353
- },
354
- {
355
- id: "knowledge.base",
356
- label: "Knowledge Base",
357
- enabled: true,
358
- path: "/knowledge"
359
- }
360
- ],
361
- branding: DEFAULT_ORGANIZATION_MODEL_BRANDING,
362
- navigation: { surfaces: [], groups: [] },
363
- sales: DEFAULT_ORGANIZATION_MODEL_SALES,
364
- prospecting: DEFAULT_ORGANIZATION_MODEL_PROSPECTING,
365
- projects: DEFAULT_ORGANIZATION_MODEL_PROJECTS,
366
- identity: DEFAULT_ORGANIZATION_MODEL_IDENTITY,
367
- customers: DEFAULT_ORGANIZATION_MODEL_CUSTOMERS,
368
- offerings: DEFAULT_ORGANIZATION_MODEL_OFFERINGS,
369
- roles: DEFAULT_ORGANIZATION_MODEL_ROLES,
370
- goals: DEFAULT_ORGANIZATION_MODEL_GOALS,
371
- statuses: DEFAULT_ORGANIZATION_MODEL_STATUSES,
372
- operations: DEFAULT_ORGANIZATION_MODEL_OPERATIONS,
373
- knowledge: DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE
374
- };
375
- function deepMerge(base, override) {
376
- {
377
- return base;
378
- }
26
+ var WIRING_FACET_KINDS = ["action", "entity", "event", "resource"];
27
+ function isKnowledgeHidden(state) {
28
+ return state === "exclude";
379
29
  }
380
- function resolveOrganizationModel(override, organizationId) {
381
- const merged = deepMerge(DEFAULT_ORGANIZATION_MODEL);
382
- const model = OrganizationModelSchema.parse(merged);
383
- if (!model.sales?.pipelines || model.sales.pipelines.length === 0) {
384
- const orgLabel = "Organization";
385
- throw new Error(
386
- `${orgLabel} has no sales pipeline configuration. This indicates an incomplete provisioning state. Run org provisioning to seed defaults.`
387
- );
388
- }
389
- return model;
30
+ function isWiringFacetActive(state) {
31
+ return state === "include";
390
32
  }
391
- var SEGMENT_DATA = [
392
- { label: "By Feature", value: "by-feature" },
393
- { label: "By Kind", value: "by-kind" },
394
- { label: "Config", value: "config" }
395
- ];
396
33
  var SIDEBAR_TREE_ACCENT_COLOR = "var(--color-primary)";
397
- var SIDEBAR_TREE_ACCENT_SURFACE = "var(--surface-primary-subtle)";
398
- var SIDEBAR_TREE_ACCENT_BORDER = "color-mix(in srgb, var(--color-primary) 28%, var(--color-border))";
399
34
  var KnowledgeSidebarMiddle = () => {
400
35
  const { navigate, currentPath } = useRouterContext();
401
- const { timeRange = "30d", organizationModel } = useElevasisFeatures();
36
+ const { organizationModel } = useElevasisSystems();
402
37
  if (currentPath.startsWith("/knowledge/command-view")) {
403
- return /* @__PURE__ */ jsx(CommandViewSidebarContent, { timeRange });
38
+ return null;
404
39
  }
405
40
  const orgModel = organizationModel ?? resolveOrganizationModel();
406
41
  return /* @__PURE__ */ jsx(KnowledgeBaseSidebarBody, { navigate, currentPath, organizationModel: orgModel });
407
42
  };
408
43
  function KnowledgeBaseSidebarBody({ navigate, currentPath, organizationModel }) {
409
- const knowledgeNodes = useMemo(() => organizationModel.knowledge.nodes, [organizationModel]);
410
- const graph = useMemo(() => buildOrganizationGraph({ organizationModel }), [organizationModel]);
44
+ const knowledgeNodes = useMemo(() => Object.values(organizationModel.knowledge), [organizationModel]);
45
+ const graph = useMemo(() => getSharedOrganizationGraph(organizationModel), [organizationModel]);
411
46
  const [searchResults, setSearchResults] = useState(null);
412
- const [axis, setAxis] = useState("by-feature");
47
+ const [facetStates, setFacetStates] = useState({ knowledge: "include" });
48
+ const [facetsOpen, setFacetsOpen] = useState(false);
49
+ const activeFacetCount = useMemo(() => {
50
+ let count = 0;
51
+ if (isKnowledgeHidden(facetStates.knowledge)) count += 1;
52
+ for (const kind of WIRING_FACET_KINDS) {
53
+ if (isWiringFacetActive(facetStates[kind])) count += 1;
54
+ }
55
+ return count;
56
+ }, [facetStates]);
413
57
  const selectedNodeId = useMemo(() => {
414
58
  const match = currentPath.match(/^\/knowledge\/([^/]+)/);
415
59
  if (!match) return void 0;
416
60
  const segment = match[1];
417
- if (["by-feature", "by-kind", "config", "graph", "command-view"].includes(segment)) return void 0;
418
- return segment;
61
+ if (["system", "entity", "resource", "graph", "command-view"].includes(segment)) return void 0;
62
+ return decodeURIComponent(segment);
419
63
  }, [currentPath]);
420
64
  const handleSelect = (node) => {
421
65
  navigate(`/knowledge/${node.id}`);
@@ -423,29 +67,49 @@ function KnowledgeBaseSidebarBody({ navigate, currentPath, organizationModel })
423
67
  const handleSelectGraphNode = (node) => {
424
68
  navigate(`/knowledge/${node.id}`);
425
69
  };
70
+ const handleSelectDomain = (domainKey) => {
71
+ navigate(`/knowledge/domain:${domainKey}`);
72
+ };
73
+ const handleSelectGroup = (groupKey) => {
74
+ navigate(`/knowledge/group:${groupKey}`);
75
+ };
76
+ const handleSelectItem = (domainKey, itemId) => {
77
+ navigate(`/knowledge/item:${domainKey}:${encodeURIComponent(itemId)}`);
78
+ };
426
79
  return /* @__PURE__ */ jsxs(Stack, { gap: 0, style: { flex: 1, overflow: "hidden", display: "flex", flexDirection: "column" }, children: [
427
80
  /* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconBrain, label: "Knowledge", withTopBorder: false }),
428
- /* @__PURE__ */ jsx(Box, { px: "sm", pt: "sm", pb: 0, children: /* @__PURE__ */ jsx(
429
- SegmentedControl,
430
- {
431
- "data-testid": "knowledge-axis-control",
432
- fullWidth: true,
433
- size: "xs",
434
- value: axis,
435
- onChange: (v) => setAxis(v),
436
- data: SEGMENT_DATA
437
- }
438
- ) }),
439
- /* @__PURE__ */ jsx(Box, { p: "sm", pb: 0, children: /* @__PURE__ */ jsx(KnowledgeSearchBar, { knowledgeNodes, onResults: setSearchResults }) }),
81
+ /* @__PURE__ */ jsx(Box, { p: "sm", pb: 0, children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", align: "center", children: [
82
+ /* @__PURE__ */ jsx(Box, { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsx(KnowledgeSearchBar, { knowledgeNodes, onResults: setSearchResults }) }),
83
+ /* @__PURE__ */ jsxs(Popover, { position: "right-start", withArrow: true, shadow: "md", opened: facetsOpen, onChange: setFacetsOpen, offset: 6, children: [
84
+ /* @__PURE__ */ jsx(Popover.Target, { children: /* @__PURE__ */ jsx(
85
+ Button,
86
+ {
87
+ size: "xs",
88
+ variant: activeFacetCount > 0 ? "light" : "subtle",
89
+ color: activeFacetCount > 0 ? "blue" : "gray",
90
+ onClick: () => setFacetsOpen((o) => !o),
91
+ "aria-expanded": facetsOpen,
92
+ rightSection: activeFacetCount > 0 ? /* @__PURE__ */ jsx(Badge, { size: "xs", circle: true, variant: "filled", color: "blue", children: activeFacetCount }) : null,
93
+ children: "Filter"
94
+ }
95
+ ) }),
96
+ /* @__PURE__ */ jsx(Popover.Dropdown, { p: 6, children: /* @__PURE__ */ jsx(FacetPanel, { value: facetStates, onChange: setFacetStates }) })
97
+ ] })
98
+ ] }) }),
440
99
  /* @__PURE__ */ jsx(Stack, { gap: 0, style: { flex: 1, overflowY: "auto" }, children: searchResults ? /* @__PURE__ */ jsx(SearchResultsList, { searchResults, selectedNodeId, onSelect: handleSelect }) : /* @__PURE__ */ jsx(
441
- AxisBody,
100
+ KnowledgeTree,
442
101
  {
443
- axis,
444
102
  graph,
445
103
  knowledgeNodes,
446
- selectedNodeId,
447
- onSelect: handleSelect,
448
- onSelectGraphNode: handleSelectGraphNode
104
+ organizationModel,
105
+ omRooted: true,
106
+ facetStates,
107
+ onSelectNode: handleSelect,
108
+ onSelectGraphNode: handleSelectGraphNode,
109
+ onSelectDomain: handleSelectDomain,
110
+ onSelectGroup: handleSelectGroup,
111
+ onSelectItem: handleSelectItem,
112
+ selectedNodeId
449
113
  }
450
114
  ) })
451
115
  ] });
@@ -459,109 +123,53 @@ function SearchResultsList({ searchResults, selectedNodeId, onSelect }) {
459
123
  return /* @__PURE__ */ jsx(NodeButton, { node, isActive, onSelect }, node.id);
460
124
  }) });
461
125
  }
462
- function AxisBody({ axis, graph, knowledgeNodes, selectedNodeId, onSelect, onSelectGraphNode }) {
463
- switch (axis) {
464
- case "by-feature":
465
- return /* @__PURE__ */ jsx(
466
- KnowledgeTree,
467
- {
468
- graph,
469
- knowledgeNodes,
470
- onSelectNode: onSelect,
471
- selectedNodeId
472
- }
473
- );
474
- case "by-kind":
475
- return /* @__PURE__ */ jsx(ByKindBody, { graph, knowledgeNodes, selectedNodeId, onSelect });
476
- case "config":
477
- return /* @__PURE__ */ jsx(ConfigBody, { graph, selectedNodeId, onSelect: onSelectGraphNode });
478
- }
479
- }
480
- var KIND_ORDER = ["playbook", "strategy", "reference"];
481
- var KIND_LABELS = {
482
- playbook: "Playbook",
483
- strategy: "Strategy",
484
- reference: "Reference"
485
- };
486
- function ByKindBody({ graph, knowledgeNodes, selectedNodeId, onSelect }) {
487
- const groups = useMemo(() => {
488
- return KIND_ORDER.map((kind) => ({
489
- kind,
490
- nodes: byKind(graph, kind, knowledgeNodes)
491
- })).filter((g) => g.nodes.length > 0);
492
- }, [graph, knowledgeNodes]);
493
- if (groups.length === 0) {
494
- return /* @__PURE__ */ jsx(Box, { p: "md", children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "No knowledge nodes." }) });
495
- }
496
- return /* @__PURE__ */ jsx(Stack, { gap: "md", style: { padding: "var(--mantine-spacing-sm)" }, children: groups.map(({ kind, nodes }) => /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
497
- /* @__PURE__ */ jsx(
498
- GroupHeader,
499
- {
500
- label: KIND_LABELS[kind],
501
- count: nodes.length,
502
- command: getKnowledgeReadKindFolderCommand(kind)
503
- }
504
- ),
505
- /* @__PURE__ */ jsx(Stack, { gap: 2, children: nodes.map((node) => /* @__PURE__ */ jsx(NodeButton, { node, isActive: node.id === selectedNodeId, onSelect }, node.id)) })
506
- ] }, kind)) });
507
- }
508
- var CONFIG_KIND_ORDER = ["feature", "resource", "capability", "stage", "organization", "entity", "surface"];
509
- var CONFIG_KIND_LABELS = {
510
- feature: "Features",
511
- resource: "Resources",
512
- capability: "Capabilities",
513
- stage: "Stages",
514
- organization: "Organizations",
515
- entity: "Entities",
516
- surface: "Surfaces"
517
- };
518
- function isSelectedConfigNode(selectedNodeId, node) {
519
- if (!selectedNodeId) return false;
520
- return selectedNodeId === node.id || selectedNodeId === node.sourceId || selectedNodeId === node.id.split(":")[1];
521
- }
522
- function ConfigBody({ graph, selectedNodeId, onSelect }) {
523
- const groups = useMemo(() => {
524
- const grouped = /* @__PURE__ */ new Map();
525
- for (const node of graph.nodes) {
526
- if (node.kind === "knowledge") continue;
527
- const nodes = grouped.get(node.kind) ?? [];
528
- nodes.push(node);
529
- grouped.set(node.kind, nodes);
530
- }
531
- const knownGroups = CONFIG_KIND_ORDER.map((kind) => ({
532
- kind,
533
- label: CONFIG_KIND_LABELS[kind],
534
- nodes: grouped.get(kind)?.sort((a, b) => a.label.localeCompare(b.label)) ?? []
535
- })).filter((group) => group.nodes.length > 0);
536
- const unknownGroups = Array.from(grouped.entries()).filter(([kind]) => !CONFIG_KIND_ORDER.includes(kind)).map(([kind, nodes]) => ({
537
- kind,
538
- label: CONFIG_KIND_LABELS[kind] ?? kind,
539
- nodes: nodes.sort((a, b) => a.label.localeCompare(b.label))
540
- })).sort((a, b) => a.label.localeCompare(b.label));
541
- return [...knownGroups, ...unknownGroups];
542
- }, [graph]);
543
- if (groups.length === 0) {
544
- return /* @__PURE__ */ jsx(Box, { p: "md", children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "No configuration nodes." }) });
545
- }
546
- return /* @__PURE__ */ jsx(Stack, { gap: "md", style: { padding: "var(--mantine-spacing-sm)" }, children: groups.map(({ kind, label, nodes }) => /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
547
- /* @__PURE__ */ jsx(GroupHeader, { label, count: nodes.length }),
548
- /* @__PURE__ */ jsx(Stack, { gap: 2, children: nodes.map((node) => /* @__PURE__ */ jsx(
549
- ConfigNodeButton,
126
+ function FacetPanel({ value, onChange }) {
127
+ const knowledgeHidden = isKnowledgeHidden(value.knowledge);
128
+ const toggleKnowledge = () => {
129
+ onChange({ ...value, knowledge: knowledgeHidden ? "include" : "exclude" });
130
+ };
131
+ const toggleWiring = (kind) => {
132
+ onChange({ ...value, [kind]: isWiringFacetActive(value[kind]) ? "neutral" : "include" });
133
+ };
134
+ return /* @__PURE__ */ jsxs(Stack, { gap: 4, miw: 200, children: [
135
+ /* @__PURE__ */ jsx(FacetRow, { label: "Hide knowledge nodes", active: knowledgeHidden, onClick: toggleKnowledge }),
136
+ /* @__PURE__ */ jsx(Divider, { my: 4 }),
137
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", pl: 6, pb: 2, tt: "uppercase", style: { letterSpacing: "0.05em" }, children: "Show under systems" }),
138
+ WIRING_FACET_KINDS.map((kind) => /* @__PURE__ */ jsx(
139
+ FacetRow,
550
140
  {
551
- node,
552
- isActive: isSelectedConfigNode(selectedNodeId, node),
553
- onSelect
141
+ label: ORGANIZATION_GRAPH_NODE_KIND_LABELS[kind],
142
+ active: isWiringFacetActive(value[kind]),
143
+ onClick: () => toggleWiring(kind)
554
144
  },
555
- node.id
556
- )) })
557
- ] }, kind)) });
145
+ kind
146
+ ))
147
+ ] });
558
148
  }
559
- function GroupHeader({ label, count, command }) {
149
+ function FacetRow({ label, active, onClick }) {
560
150
  const [hovered, setHovered] = useState(false);
561
- return /* @__PURE__ */ jsxs(Group, { gap: "xs", onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), children: [
562
- /* @__PURE__ */ jsx(Text, { size: "xs", fw: 600, tt: "uppercase", c: "dimmed", style: { letterSpacing: "0.05em" }, children: label }),
563
- /* @__PURE__ */ jsx(TrailingCopySlot, { count, command, label: "Copy group knowledge commands", showCopy: hovered })
564
- ] });
151
+ const StatusIcon = active ? IconCircleCheckFilled : IconCircleDashed;
152
+ const iconColor = active ? "var(--color-primary)" : "var(--color-text-subtle)";
153
+ return /* @__PURE__ */ jsx(
154
+ UnstyledButton,
155
+ {
156
+ onClick,
157
+ onMouseEnter: () => setHovered(true),
158
+ onMouseLeave: () => setHovered(false),
159
+ "aria-pressed": active,
160
+ "aria-label": `${label} ${active ? "on" : "off"}`,
161
+ style: {
162
+ padding: "6px 10px",
163
+ borderRadius: "var(--mantine-radius-sm)",
164
+ backgroundColor: hovered ? "var(--color-surface-hover)" : "transparent",
165
+ transition: "background-color var(--duration-fast) var(--easing)"
166
+ },
167
+ children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
168
+ /* @__PURE__ */ jsx(StatusIcon, { size: 16, style: { color: iconColor, flexShrink: 0 } }),
169
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: active ? void 0 : "dimmed", children: label })
170
+ ] })
171
+ }
172
+ );
565
173
  }
566
174
  function NodeButton({ node, isActive, onSelect }) {
567
175
  const [hovered, setHovered] = useState(false);
@@ -595,63 +203,17 @@ function NodeButton({ node, isActive, onSelect }) {
595
203
  style: { color: SIDEBAR_TREE_ACCENT_COLOR }
596
204
  }
597
205
  ),
598
- /* @__PURE__ */ jsx("span", { style: { minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: node.title }),
599
- /* @__PURE__ */ jsx(
600
- CopyCommandControl,
601
- {
602
- command: getKnowledgeReadCommand(node.id),
603
- label: "Copy knowledge command",
604
- visible: hovered
605
- }
606
- )
206
+ /* @__PURE__ */ jsx("span", { style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: node.title }),
207
+ hovered ? /* @__PURE__ */ jsx(CopyCommandControl, { command: getKnowledgeReadCommand(node.id), label: "Copy knowledge command", visible: true }) : null
607
208
  ] })
608
209
  }
609
210
  )
610
211
  }
611
212
  );
612
213
  }
613
- function ConfigNodeButton({ node, isActive, onSelect }) {
614
- return /* @__PURE__ */ jsx(
615
- UnstyledButton,
616
- {
617
- onClick: () => onSelect(node),
618
- style: {
619
- padding: "6px 10px",
620
- borderRadius: "var(--mantine-radius-sm)",
621
- backgroundColor: isActive ? "color-mix(in srgb, var(--color-primary) 10%, transparent)" : "transparent",
622
- width: "100%",
623
- textAlign: "left"
624
- },
625
- children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
626
- /* @__PURE__ */ jsx(
627
- SemanticIcon,
628
- {
629
- token: node.icon,
630
- fallbackKind: node.kind === "feature" ? "feature" : node.kind === "knowledge" ? "knowledge" : "unknown",
631
- size: 15,
632
- style: { color: SIDEBAR_TREE_ACCENT_COLOR }
633
- }
634
- ),
635
- /* @__PURE__ */ jsx(
636
- Text,
637
- {
638
- size: "sm",
639
- c: isActive ? "var(--color-primary)" : void 0,
640
- fw: isActive ? 600 : 400,
641
- style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
642
- children: node.label
643
- }
644
- )
645
- ] })
646
- }
647
- );
648
- }
649
214
  function getKnowledgeReadCommand(nodeId) {
650
215
  return `/knowledge read ${nodeId}`;
651
216
  }
652
- function getKnowledgeReadKindFolderCommand(kind) {
653
- return `/knowledge read-folder kind:${kind}`;
654
- }
655
217
  function CopyCommandControl({ command, label, visible }) {
656
218
  const clipboard = useClipboard({ timeout: 1500 });
657
219
  return /* @__PURE__ */ jsx(
@@ -687,34 +249,6 @@ function CopyCommandControl({ command, label, visible }) {
687
249
  }
688
250
  );
689
251
  }
690
- function TrailingCopySlot({ count, command, label, showCopy }) {
691
- return /* @__PURE__ */ jsx(
692
- "span",
693
- {
694
- style: {
695
- display: "inline-flex",
696
- alignItems: "center",
697
- justifyContent: "center",
698
- width: 32,
699
- height: 22,
700
- flexShrink: 0
701
- },
702
- children: showCopy && command ? /* @__PURE__ */ jsx(CopyCommandControl, { command, label, visible: true }) : /* @__PURE__ */ jsx(
703
- Badge,
704
- {
705
- size: "xs",
706
- variant: "light",
707
- style: {
708
- color: SIDEBAR_TREE_ACCENT_COLOR,
709
- backgroundColor: SIDEBAR_TREE_ACCENT_SURFACE,
710
- borderColor: SIDEBAR_TREE_ACCENT_BORDER
711
- },
712
- children: count
713
- }
714
- )
715
- }
716
- );
717
- }
718
252
  var KnowledgeSidebar = () => /* @__PURE__ */ jsx(Stack, { gap: 0, style: { height: "100%", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsx(KnowledgeSidebarMiddle, {}) });
719
253
 
720
254
  // src/features/knowledge/manifest.ts
@@ -722,10 +256,14 @@ var knowledgeSidebarWidth = 320;
722
256
  var defaultSidebarWidth = 250;
723
257
  var knowledgeManifest = {
724
258
  key: "knowledge",
725
- featureId: KNOWLEDGE_FEATURE_ID,
259
+ routePrefixes: ["/knowledge"],
726
260
  icon: IconBrain,
727
261
  sidebar: KnowledgeSidebar,
728
- sidebarWidth: ({ currentPath }) => currentPath.startsWith("/knowledge") ? knowledgeSidebarWidth : defaultSidebarWidth
262
+ sidebarWidth: ({ currentPath }) => {
263
+ if (currentPath.startsWith("/knowledge/command-view")) return 0;
264
+ if (currentPath.startsWith("/knowledge")) return knowledgeSidebarWidth;
265
+ return defaultSidebarWidth;
266
+ }
729
267
  };
730
268
 
731
269
  export { knowledgeManifest };