@elevasis/core 0.15.0 → 0.16.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/index.d.ts +1718 -19
- package/dist/index.js +369 -25
- package/dist/organization-model/index.d.ts +1718 -19
- package/dist/organization-model/index.js +369 -25
- package/dist/test-utils/index.d.ts +1108 -371
- package/dist/test-utils/index.js +357 -17
- package/package.json +5 -1
- package/src/__tests__/publish.test.ts +14 -13
- package/src/__tests__/template-core-compatibility.test.ts +4 -4
- package/src/_gen/__tests__/__snapshots__/contracts.md.snap +1109 -882
- package/src/auth/multi-tenancy/index.ts +3 -0
- package/src/auth/multi-tenancy/theme-presets.ts +45 -0
- package/src/auth/multi-tenancy/types.ts +57 -83
- package/src/auth/multi-tenancy/users/api-schemas.ts +165 -194
- package/src/business/acquisition/activity-events.ts +13 -4
- package/src/business/acquisition/api-schemas.test.ts +315 -4
- package/src/business/acquisition/api-schemas.ts +122 -8
- package/src/business/acquisition/build-templates.ts +44 -0
- package/src/business/acquisition/crm-next-action.test.ts +262 -0
- package/src/business/acquisition/crm-next-action.ts +220 -0
- package/src/business/acquisition/crm-priority.test.ts +216 -0
- package/src/business/acquisition/crm-priority.ts +349 -0
- package/src/business/acquisition/crm-state-actions.test.ts +151 -160
- package/src/business/acquisition/deal-ownership.test.ts +351 -0
- package/src/business/acquisition/deal-ownership.ts +120 -0
- package/src/business/acquisition/derive-actions.test.ts +101 -37
- package/src/business/acquisition/derive-actions.ts +102 -87
- package/src/business/acquisition/index.ts +10 -0
- package/src/business/acquisition/types.ts +400 -366
- package/src/business/crm/api-schemas.ts +40 -0
- package/src/business/crm/index.ts +1 -0
- package/src/business/deals/api-schemas.ts +79 -0
- package/src/business/deals/index.ts +1 -0
- package/src/business/projects/types.ts +124 -88
- package/src/execution/core/runner-types.ts +61 -80
- package/src/execution/engine/index.ts +4 -3
- package/src/execution/engine/tools/integration/server/adapters/gmail/gmail-tools.ts +105 -104
- package/src/execution/engine/tools/integration/server/adapters/instantly/instantly-tools.ts +1474 -1473
- package/src/execution/engine/tools/integration/server/adapters/millionverifier/millionverifier-tools.ts +103 -102
- package/src/execution/engine/tools/integration/server/adapters/signature-api/signature-api-tools.ts +182 -179
- package/src/execution/engine/tools/integration/server/adapters/stripe/stripe-tools.ts +310 -309
- package/src/execution/engine/tools/integration/tool.ts +255 -253
- package/src/execution/engine/tools/lead-service-types.ts +939 -924
- package/src/execution/engine/tools/messages.ts +43 -0
- package/src/execution/engine/tools/platform/acquisition/list-tools.ts +6 -5
- package/src/execution/engine/tools/platform/acquisition/types.ts +5 -2
- package/src/execution/engine/tools/platform/email/types.ts +97 -96
- package/src/execution/engine/tools/registry.ts +4 -3
- package/src/execution/engine/tools/tool-maps.ts +3 -1
- package/src/execution/engine/tools/types.ts +234 -233
- package/src/execution/engine/workflow/types.ts +195 -193
- package/src/execution/external/api-schemas.ts +40 -0
- package/src/execution/external/index.ts +1 -0
- package/src/knowledge/README.md +32 -0
- package/src/knowledge/__tests__/queries.test.ts +504 -0
- package/src/knowledge/format.ts +99 -0
- package/src/knowledge/index.ts +5 -0
- package/src/knowledge/queries.ts +256 -0
- package/src/organization-model/__tests__/defaults.test.ts +172 -172
- package/src/organization-model/__tests__/foundation.test.ts +7 -7
- package/src/organization-model/__tests__/icons.test.ts +27 -0
- package/src/organization-model/__tests__/knowledge.test.ts +214 -0
- package/src/organization-model/contracts.ts +17 -15
- package/src/organization-model/defaults.ts +74 -19
- package/src/organization-model/domains/knowledge.ts +53 -0
- package/src/organization-model/domains/navigation.ts +416 -399
- package/src/organization-model/domains/prospecting.ts +204 -1
- package/src/organization-model/domains/sales.test.ts +29 -0
- package/src/organization-model/domains/sales.ts +102 -0
- package/src/organization-model/domains/shared.ts +6 -5
- package/src/organization-model/foundation.ts +10 -6
- package/src/organization-model/graph/build.ts +209 -182
- package/src/organization-model/graph/schema.ts +37 -34
- package/src/organization-model/graph/types.ts +47 -31
- package/src/organization-model/icons.ts +81 -0
- package/src/organization-model/index.ts +8 -3
- package/src/organization-model/organization-model.mdx +1 -1
- package/src/organization-model/published.ts +103 -86
- package/src/organization-model/schema.ts +90 -85
- package/src/organization-model/types.ts +42 -35
- package/src/platform/constants/versions.ts +1 -1
- package/src/platform/index.ts +23 -27
- package/src/platform/registry/index.ts +0 -4
- package/src/platform/registry/resource-registry.ts +0 -77
- package/src/platform/registry/serialized-types.ts +148 -219
- package/src/platform/registry/stats-types.ts +60 -60
- package/src/reference/_generated/contracts.md +829 -595
- package/src/supabase/database.types.ts +2978 -2958
|
@@ -1,399 +1,416 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
import {
|
|
3
|
-
OPERATIONS_COMMAND_VIEW_SURFACE_ID,
|
|
4
|
-
PROJECTS_VIEW_CAPABILITY_ID,
|
|
5
|
-
PROJECTS_FEATURE_ID,
|
|
6
|
-
PROJECTS_INDEX_SURFACE_ID,
|
|
7
|
-
SETTINGS_ROLES_SURFACE_ID
|
|
8
|
-
} from '../contracts'
|
|
9
|
-
import { DescriptionSchema, IconNameSchema, LabelSchema, ModelIdSchema, PathSchema, ReferenceIdsSchema } from './shared'
|
|
10
|
-
|
|
11
|
-
export const SurfaceTypeSchema = z.enum(['page', 'dashboard', 'graph', 'detail', 'list', 'settings'])
|
|
12
|
-
|
|
13
|
-
export const SurfaceDefinitionSchema = z.object({
|
|
14
|
-
id: ModelIdSchema,
|
|
15
|
-
label: LabelSchema,
|
|
16
|
-
path: PathSchema,
|
|
17
|
-
surfaceType: SurfaceTypeSchema,
|
|
18
|
-
description: DescriptionSchema.optional(),
|
|
19
|
-
enabled: z.boolean().default(true),
|
|
20
|
-
devOnly: z.boolean().optional(),
|
|
21
|
-
icon: IconNameSchema.optional(),
|
|
22
|
-
featureId: ModelIdSchema.optional(),
|
|
23
|
-
featureIds: ReferenceIdsSchema,
|
|
24
|
-
entityIds: ReferenceIdsSchema,
|
|
25
|
-
resourceIds: ReferenceIdsSchema,
|
|
26
|
-
capabilityIds: ReferenceIdsSchema,
|
|
27
|
-
parentId: ModelIdSchema.optional()
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Core placement values: 'primary' | 'secondary' | 'bottom'.
|
|
32
|
-
*
|
|
33
|
-
* `placement` is intentionally open (`z.string()`) so that per-project adapters can
|
|
34
|
-
* introduce additional placement IDs (e.g. 'pinned', 'spotlight', 'contextual') without
|
|
35
|
-
* forking core. Extension pattern: add the new string literal to the project's
|
|
36
|
-
* `foundations/config/organization-model.ts` adapter — no changes to this file required.
|
|
37
|
-
*
|
|
38
|
-
* `surfaceType` and `resourceType` remain closed enums (UI/runtime invariants).
|
|
39
|
-
*/
|
|
40
|
-
export const CORE_PLACEMENT_VALUES = ['primary', 'secondary', 'bottom'] as const
|
|
41
|
-
export type CorePlacement = (typeof CORE_PLACEMENT_VALUES)[number]
|
|
42
|
-
|
|
43
|
-
export const NavigationGroupSchema = z.object({
|
|
44
|
-
id: ModelIdSchema,
|
|
45
|
-
label: LabelSchema,
|
|
46
|
-
placement: z.string().trim().min(1).max(50),
|
|
47
|
-
surfaceIds: z.array(ModelIdSchema).default([])
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
export const OrganizationModelNavigationSchema = z.object({
|
|
51
|
-
defaultSurfaceId: ModelIdSchema.optional(),
|
|
52
|
-
surfaces: z.array(SurfaceDefinitionSchema).default([]),
|
|
53
|
-
groups: z.array(NavigationGroupSchema).default([])
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
export const DEFAULT_ORGANIZATION_MODEL_NAVIGATION: z.infer<typeof OrganizationModelNavigationSchema> = {
|
|
57
|
-
defaultSurfaceId: 'crm.pipeline',
|
|
58
|
-
surfaces: [
|
|
59
|
-
{
|
|
60
|
-
id: 'crm.pipeline',
|
|
61
|
-
label: 'Pipeline',
|
|
62
|
-
path: '/crm/pipeline',
|
|
63
|
-
surfaceType: 'graph',
|
|
64
|
-
enabled: true,
|
|
65
|
-
featureId: 'crm',
|
|
66
|
-
featureIds: ['crm'],
|
|
67
|
-
entityIds: ['crm.deal'],
|
|
68
|
-
resourceIds: [],
|
|
69
|
-
capabilityIds: ['crm.pipeline.manage']
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: 'lead-gen.lists',
|
|
73
|
-
label: 'Lists',
|
|
74
|
-
path: '/lead-gen/lists',
|
|
75
|
-
surfaceType: 'list',
|
|
76
|
-
enabled: true,
|
|
77
|
-
featureId: 'lead-gen',
|
|
78
|
-
featureIds: ['lead-gen'],
|
|
79
|
-
entityIds: ['leadgen.list'],
|
|
80
|
-
resourceIds: [],
|
|
81
|
-
capabilityIds: ['leadgen.lists.manage']
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
id: PROJECTS_INDEX_SURFACE_ID,
|
|
85
|
-
label: 'Projects',
|
|
86
|
-
path: '/projects',
|
|
87
|
-
surfaceType: 'list',
|
|
88
|
-
enabled: true,
|
|
89
|
-
featureId: PROJECTS_FEATURE_ID,
|
|
90
|
-
featureIds: [PROJECTS_FEATURE_ID],
|
|
91
|
-
entityIds: ['delivery.project'],
|
|
92
|
-
resourceIds: [],
|
|
93
|
-
capabilityIds: [PROJECTS_VIEW_CAPABILITY_ID]
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
id:
|
|
97
|
-
label: '
|
|
98
|
-
path: '/
|
|
99
|
-
surfaceType: '
|
|
100
|
-
enabled: true,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
featureId: '
|
|
115
|
-
featureIds: ['
|
|
116
|
-
entityIds: [],
|
|
117
|
-
resourceIds: [],
|
|
118
|
-
capabilityIds: []
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
id: 'operations.
|
|
122
|
-
label: '
|
|
123
|
-
path: '/operations
|
|
124
|
-
surfaceType: '
|
|
125
|
-
enabled: true,
|
|
126
|
-
featureId: 'operations',
|
|
127
|
-
featureIds: ['operations'],
|
|
128
|
-
entityIds: [],
|
|
129
|
-
resourceIds: [],
|
|
130
|
-
capabilityIds: []
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
id: 'operations.
|
|
134
|
-
label: '
|
|
135
|
-
path: '/operations/
|
|
136
|
-
surfaceType: 'list',
|
|
137
|
-
enabled: true,
|
|
138
|
-
featureId: 'operations',
|
|
139
|
-
featureIds: ['operations'],
|
|
140
|
-
entityIds: [],
|
|
141
|
-
resourceIds: [],
|
|
142
|
-
capabilityIds: []
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
id: 'operations.
|
|
146
|
-
label: '
|
|
147
|
-
path: '/operations/
|
|
148
|
-
surfaceType: '
|
|
149
|
-
enabled:
|
|
150
|
-
featureId: 'operations',
|
|
151
|
-
featureIds: ['operations'],
|
|
152
|
-
entityIds: [],
|
|
153
|
-
resourceIds: [],
|
|
154
|
-
capabilityIds: []
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
id: 'operations.
|
|
158
|
-
label: '
|
|
159
|
-
path: '/operations/
|
|
160
|
-
surfaceType: 'page',
|
|
161
|
-
enabled:
|
|
162
|
-
featureId: 'operations',
|
|
163
|
-
featureIds: ['operations'],
|
|
164
|
-
entityIds: [],
|
|
165
|
-
resourceIds: [],
|
|
166
|
-
capabilityIds: []
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
id: '
|
|
170
|
-
label: '
|
|
171
|
-
path: '/
|
|
172
|
-
surfaceType: '
|
|
173
|
-
enabled: true,
|
|
174
|
-
featureId: '
|
|
175
|
-
featureIds: ['
|
|
176
|
-
entityIds: [],
|
|
177
|
-
resourceIds: [],
|
|
178
|
-
capabilityIds: []
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
id: 'monitoring.
|
|
182
|
-
label: '
|
|
183
|
-
path: '/monitoring/
|
|
184
|
-
surfaceType: 'list',
|
|
185
|
-
enabled: true,
|
|
186
|
-
featureId: 'monitoring',
|
|
187
|
-
featureIds: ['monitoring'],
|
|
188
|
-
entityIds: [],
|
|
189
|
-
resourceIds: [],
|
|
190
|
-
capabilityIds: []
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
id: 'monitoring.execution-
|
|
194
|
-
label: 'Execution
|
|
195
|
-
path: '/monitoring/execution-
|
|
196
|
-
surfaceType: '
|
|
197
|
-
enabled: true,
|
|
198
|
-
featureId: 'monitoring',
|
|
199
|
-
featureIds: ['monitoring'],
|
|
200
|
-
entityIds: [],
|
|
201
|
-
resourceIds: [],
|
|
202
|
-
capabilityIds: []
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
id: 'monitoring.
|
|
206
|
-
label: '
|
|
207
|
-
path: '/monitoring/
|
|
208
|
-
surfaceType: 'dashboard',
|
|
209
|
-
enabled:
|
|
210
|
-
featureId: 'monitoring',
|
|
211
|
-
featureIds: ['monitoring'],
|
|
212
|
-
entityIds: [],
|
|
213
|
-
resourceIds: [],
|
|
214
|
-
capabilityIds: []
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
id: 'monitoring.
|
|
218
|
-
label: '
|
|
219
|
-
path: '/monitoring/
|
|
220
|
-
surfaceType: '
|
|
221
|
-
enabled:
|
|
222
|
-
featureId: 'monitoring',
|
|
223
|
-
featureIds: ['monitoring'],
|
|
224
|
-
entityIds: [],
|
|
225
|
-
resourceIds: [],
|
|
226
|
-
capabilityIds: []
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
id: '
|
|
230
|
-
label: '
|
|
231
|
-
path: '/monitoring/
|
|
232
|
-
surfaceType: '
|
|
233
|
-
enabled: true,
|
|
234
|
-
featureId: '
|
|
235
|
-
featureIds: ['
|
|
236
|
-
entityIds: [
|
|
237
|
-
resourceIds: [],
|
|
238
|
-
capabilityIds: []
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
id: 'submitted-requests.
|
|
242
|
-
label: '
|
|
243
|
-
path: '/monitoring/requests
|
|
244
|
-
surfaceType: '
|
|
245
|
-
enabled: true,
|
|
246
|
-
featureId: 'submitted-requests',
|
|
247
|
-
featureIds: ['submitted-requests'],
|
|
248
|
-
entityIds: ['reported_request'],
|
|
249
|
-
resourceIds: [],
|
|
250
|
-
capabilityIds: []
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
id: '
|
|
254
|
-
label: '
|
|
255
|
-
path: '/
|
|
256
|
-
surfaceType: '
|
|
257
|
-
enabled: true,
|
|
258
|
-
featureId: '
|
|
259
|
-
featureIds: ['
|
|
260
|
-
entityIds: [],
|
|
261
|
-
resourceIds: [],
|
|
262
|
-
capabilityIds: []
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
id: 'settings.
|
|
266
|
-
label: '
|
|
267
|
-
path: '/settings/
|
|
268
|
-
surfaceType: 'settings',
|
|
269
|
-
enabled: true,
|
|
270
|
-
featureId: 'settings',
|
|
271
|
-
featureIds: ['settings'],
|
|
272
|
-
entityIds: [],
|
|
273
|
-
resourceIds: [],
|
|
274
|
-
capabilityIds: []
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
id:
|
|
278
|
-
label: '
|
|
279
|
-
path: '/settings/
|
|
280
|
-
surfaceType: 'settings',
|
|
281
|
-
enabled: true,
|
|
282
|
-
featureId: 'settings',
|
|
283
|
-
featureIds: ['settings'],
|
|
284
|
-
entityIds: [],
|
|
285
|
-
resourceIds: [],
|
|
286
|
-
capabilityIds: []
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
id:
|
|
290
|
-
label: '
|
|
291
|
-
path: '/settings/
|
|
292
|
-
surfaceType: 'settings',
|
|
293
|
-
enabled: true,
|
|
294
|
-
featureId: 'settings',
|
|
295
|
-
featureIds: ['settings'],
|
|
296
|
-
entityIds: [],
|
|
297
|
-
resourceIds: [],
|
|
298
|
-
capabilityIds: []
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
id: 'settings.
|
|
302
|
-
label: '
|
|
303
|
-
path: '/settings/
|
|
304
|
-
surfaceType: 'settings',
|
|
305
|
-
enabled: true,
|
|
306
|
-
featureId: 'settings',
|
|
307
|
-
featureIds: ['settings'],
|
|
308
|
-
entityIds: [],
|
|
309
|
-
resourceIds: [],
|
|
310
|
-
capabilityIds: []
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
id: 'settings.
|
|
314
|
-
label: '
|
|
315
|
-
path: '/settings/
|
|
316
|
-
surfaceType: 'settings',
|
|
317
|
-
enabled: true,
|
|
318
|
-
featureId: 'settings',
|
|
319
|
-
featureIds: ['settings'],
|
|
320
|
-
entityIds: [],
|
|
321
|
-
resourceIds: [],
|
|
322
|
-
capabilityIds: []
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
id: 'settings.
|
|
326
|
-
label: '
|
|
327
|
-
path: '/settings/
|
|
328
|
-
surfaceType: 'settings',
|
|
329
|
-
enabled: true,
|
|
330
|
-
featureId: 'settings',
|
|
331
|
-
featureIds: ['settings'],
|
|
332
|
-
entityIds: [],
|
|
333
|
-
resourceIds: [],
|
|
334
|
-
capabilityIds: []
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
id: 'settings.
|
|
338
|
-
label: '
|
|
339
|
-
path: '/settings/
|
|
340
|
-
surfaceType: 'settings',
|
|
341
|
-
enabled: true,
|
|
342
|
-
featureId: 'settings',
|
|
343
|
-
featureIds: ['settings'],
|
|
344
|
-
entityIds: [],
|
|
345
|
-
resourceIds: [],
|
|
346
|
-
capabilityIds: []
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
'
|
|
375
|
-
'
|
|
376
|
-
'
|
|
377
|
-
'
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
'
|
|
389
|
-
'
|
|
390
|
-
|
|
391
|
-
'
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
}
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import {
|
|
3
|
+
OPERATIONS_COMMAND_VIEW_SURFACE_ID,
|
|
4
|
+
PROJECTS_VIEW_CAPABILITY_ID,
|
|
5
|
+
PROJECTS_FEATURE_ID,
|
|
6
|
+
PROJECTS_INDEX_SURFACE_ID,
|
|
7
|
+
SETTINGS_ROLES_SURFACE_ID
|
|
8
|
+
} from '../contracts'
|
|
9
|
+
import { DescriptionSchema, IconNameSchema, LabelSchema, ModelIdSchema, PathSchema, ReferenceIdsSchema } from './shared'
|
|
10
|
+
|
|
11
|
+
export const SurfaceTypeSchema = z.enum(['page', 'dashboard', 'graph', 'detail', 'list', 'settings'])
|
|
12
|
+
|
|
13
|
+
export const SurfaceDefinitionSchema = z.object({
|
|
14
|
+
id: ModelIdSchema,
|
|
15
|
+
label: LabelSchema,
|
|
16
|
+
path: PathSchema,
|
|
17
|
+
surfaceType: SurfaceTypeSchema,
|
|
18
|
+
description: DescriptionSchema.optional(),
|
|
19
|
+
enabled: z.boolean().default(true),
|
|
20
|
+
devOnly: z.boolean().optional(),
|
|
21
|
+
icon: IconNameSchema.optional(),
|
|
22
|
+
featureId: ModelIdSchema.optional(),
|
|
23
|
+
featureIds: ReferenceIdsSchema,
|
|
24
|
+
entityIds: ReferenceIdsSchema,
|
|
25
|
+
resourceIds: ReferenceIdsSchema,
|
|
26
|
+
capabilityIds: ReferenceIdsSchema,
|
|
27
|
+
parentId: ModelIdSchema.optional()
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Core placement values: 'primary' | 'secondary' | 'bottom'.
|
|
32
|
+
*
|
|
33
|
+
* `placement` is intentionally open (`z.string()`) so that per-project adapters can
|
|
34
|
+
* introduce additional placement IDs (e.g. 'pinned', 'spotlight', 'contextual') without
|
|
35
|
+
* forking core. Extension pattern: add the new string literal to the project's
|
|
36
|
+
* `foundations/config/organization-model.ts` adapter — no changes to this file required.
|
|
37
|
+
*
|
|
38
|
+
* `surfaceType` and `resourceType` remain closed enums (UI/runtime invariants).
|
|
39
|
+
*/
|
|
40
|
+
export const CORE_PLACEMENT_VALUES = ['primary', 'secondary', 'bottom'] as const
|
|
41
|
+
export type CorePlacement = (typeof CORE_PLACEMENT_VALUES)[number]
|
|
42
|
+
|
|
43
|
+
export const NavigationGroupSchema = z.object({
|
|
44
|
+
id: ModelIdSchema,
|
|
45
|
+
label: LabelSchema,
|
|
46
|
+
placement: z.string().trim().min(1).max(50),
|
|
47
|
+
surfaceIds: z.array(ModelIdSchema).default([])
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
export const OrganizationModelNavigationSchema = z.object({
|
|
51
|
+
defaultSurfaceId: ModelIdSchema.optional(),
|
|
52
|
+
surfaces: z.array(SurfaceDefinitionSchema).default([]),
|
|
53
|
+
groups: z.array(NavigationGroupSchema).default([])
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
export const DEFAULT_ORGANIZATION_MODEL_NAVIGATION: z.infer<typeof OrganizationModelNavigationSchema> = {
|
|
57
|
+
defaultSurfaceId: 'crm.pipeline',
|
|
58
|
+
surfaces: [
|
|
59
|
+
{
|
|
60
|
+
id: 'crm.pipeline',
|
|
61
|
+
label: 'Pipeline',
|
|
62
|
+
path: '/crm/pipeline',
|
|
63
|
+
surfaceType: 'graph',
|
|
64
|
+
enabled: true,
|
|
65
|
+
featureId: 'crm',
|
|
66
|
+
featureIds: ['crm'],
|
|
67
|
+
entityIds: ['crm.deal'],
|
|
68
|
+
resourceIds: [],
|
|
69
|
+
capabilityIds: ['crm.pipeline.manage']
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 'lead-gen.lists',
|
|
73
|
+
label: 'Lists',
|
|
74
|
+
path: '/lead-gen/lists',
|
|
75
|
+
surfaceType: 'list',
|
|
76
|
+
enabled: true,
|
|
77
|
+
featureId: 'lead-gen',
|
|
78
|
+
featureIds: ['lead-gen'],
|
|
79
|
+
entityIds: ['leadgen.list'],
|
|
80
|
+
resourceIds: [],
|
|
81
|
+
capabilityIds: ['leadgen.lists.manage']
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: PROJECTS_INDEX_SURFACE_ID,
|
|
85
|
+
label: 'Projects',
|
|
86
|
+
path: '/projects',
|
|
87
|
+
surfaceType: 'list',
|
|
88
|
+
enabled: true,
|
|
89
|
+
featureId: PROJECTS_FEATURE_ID,
|
|
90
|
+
featureIds: [PROJECTS_FEATURE_ID],
|
|
91
|
+
entityIds: ['delivery.project'],
|
|
92
|
+
resourceIds: [],
|
|
93
|
+
capabilityIds: [PROJECTS_VIEW_CAPABILITY_ID]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: 'knowledge.base',
|
|
97
|
+
label: 'Knowledge Base',
|
|
98
|
+
path: '/knowledge',
|
|
99
|
+
surfaceType: 'page',
|
|
100
|
+
enabled: true,
|
|
101
|
+
featureId: 'knowledge',
|
|
102
|
+
featureIds: ['knowledge'],
|
|
103
|
+
entityIds: [],
|
|
104
|
+
resourceIds: [],
|
|
105
|
+
capabilityIds: []
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: OPERATIONS_COMMAND_VIEW_SURFACE_ID,
|
|
109
|
+
label: 'Command View',
|
|
110
|
+
path: '/knowledge/command-view',
|
|
111
|
+
surfaceType: 'graph',
|
|
112
|
+
enabled: true,
|
|
113
|
+
devOnly: true,
|
|
114
|
+
featureId: 'knowledge',
|
|
115
|
+
featureIds: ['knowledge'],
|
|
116
|
+
entityIds: [],
|
|
117
|
+
resourceIds: [],
|
|
118
|
+
capabilityIds: ['knowledge.command-view']
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: 'operations.overview',
|
|
122
|
+
label: 'Overview',
|
|
123
|
+
path: '/operations',
|
|
124
|
+
surfaceType: 'dashboard',
|
|
125
|
+
enabled: true,
|
|
126
|
+
featureId: 'operations',
|
|
127
|
+
featureIds: ['operations'],
|
|
128
|
+
entityIds: [],
|
|
129
|
+
resourceIds: [],
|
|
130
|
+
capabilityIds: []
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: 'operations.resources',
|
|
134
|
+
label: 'Resources',
|
|
135
|
+
path: '/operations/resources',
|
|
136
|
+
surfaceType: 'list',
|
|
137
|
+
enabled: true,
|
|
138
|
+
featureId: 'operations',
|
|
139
|
+
featureIds: ['operations'],
|
|
140
|
+
entityIds: [],
|
|
141
|
+
resourceIds: [],
|
|
142
|
+
capabilityIds: []
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: 'operations.command-queue',
|
|
146
|
+
label: 'Command Queue',
|
|
147
|
+
path: '/operations/command-queue',
|
|
148
|
+
surfaceType: 'list',
|
|
149
|
+
enabled: true,
|
|
150
|
+
featureId: 'operations',
|
|
151
|
+
featureIds: ['operations'],
|
|
152
|
+
entityIds: [],
|
|
153
|
+
resourceIds: [],
|
|
154
|
+
capabilityIds: []
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: 'operations.sessions',
|
|
158
|
+
label: 'Sessions',
|
|
159
|
+
path: '/operations/sessions',
|
|
160
|
+
surfaceType: 'page',
|
|
161
|
+
enabled: false,
|
|
162
|
+
featureId: 'operations',
|
|
163
|
+
featureIds: ['operations'],
|
|
164
|
+
entityIds: [],
|
|
165
|
+
resourceIds: [],
|
|
166
|
+
capabilityIds: []
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: 'operations.task-scheduler',
|
|
170
|
+
label: 'Task Scheduler',
|
|
171
|
+
path: '/operations/task-scheduler',
|
|
172
|
+
surfaceType: 'page',
|
|
173
|
+
enabled: true,
|
|
174
|
+
featureId: 'operations',
|
|
175
|
+
featureIds: ['operations'],
|
|
176
|
+
entityIds: [],
|
|
177
|
+
resourceIds: [],
|
|
178
|
+
capabilityIds: []
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: 'monitoring.activity-log',
|
|
182
|
+
label: 'Activity Log',
|
|
183
|
+
path: '/monitoring/activity-log',
|
|
184
|
+
surfaceType: 'list',
|
|
185
|
+
enabled: true,
|
|
186
|
+
featureId: 'monitoring',
|
|
187
|
+
featureIds: ['monitoring'],
|
|
188
|
+
entityIds: [],
|
|
189
|
+
resourceIds: [],
|
|
190
|
+
capabilityIds: []
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: 'monitoring.execution-logs',
|
|
194
|
+
label: 'Execution Logs',
|
|
195
|
+
path: '/monitoring/execution-logs',
|
|
196
|
+
surfaceType: 'list',
|
|
197
|
+
enabled: true,
|
|
198
|
+
featureId: 'monitoring',
|
|
199
|
+
featureIds: ['monitoring'],
|
|
200
|
+
entityIds: [],
|
|
201
|
+
resourceIds: [],
|
|
202
|
+
capabilityIds: []
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
id: 'monitoring.execution-health',
|
|
206
|
+
label: 'Execution Health',
|
|
207
|
+
path: '/monitoring/execution-health',
|
|
208
|
+
surfaceType: 'dashboard',
|
|
209
|
+
enabled: true,
|
|
210
|
+
featureId: 'monitoring',
|
|
211
|
+
featureIds: ['monitoring'],
|
|
212
|
+
entityIds: [],
|
|
213
|
+
resourceIds: [],
|
|
214
|
+
capabilityIds: []
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: 'monitoring.cost-analytics',
|
|
218
|
+
label: 'Cost Analytics',
|
|
219
|
+
path: '/monitoring/cost-analytics',
|
|
220
|
+
surfaceType: 'dashboard',
|
|
221
|
+
enabled: false,
|
|
222
|
+
featureId: 'monitoring',
|
|
223
|
+
featureIds: ['monitoring'],
|
|
224
|
+
entityIds: [],
|
|
225
|
+
resourceIds: [],
|
|
226
|
+
capabilityIds: []
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
id: 'monitoring.notifications',
|
|
230
|
+
label: 'Notifications',
|
|
231
|
+
path: '/monitoring/notifications',
|
|
232
|
+
surfaceType: 'page',
|
|
233
|
+
enabled: true,
|
|
234
|
+
featureId: 'monitoring',
|
|
235
|
+
featureIds: ['monitoring'],
|
|
236
|
+
entityIds: [],
|
|
237
|
+
resourceIds: [],
|
|
238
|
+
capabilityIds: []
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: 'submitted-requests.list',
|
|
242
|
+
label: 'Submitted Requests',
|
|
243
|
+
path: '/monitoring/requests',
|
|
244
|
+
surfaceType: 'list',
|
|
245
|
+
enabled: true,
|
|
246
|
+
featureId: 'submitted-requests',
|
|
247
|
+
featureIds: ['submitted-requests'],
|
|
248
|
+
entityIds: ['reported_request'],
|
|
249
|
+
resourceIds: [],
|
|
250
|
+
capabilityIds: []
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
id: 'submitted-requests.detail',
|
|
254
|
+
label: 'Request Detail',
|
|
255
|
+
path: '/monitoring/requests/:requestId',
|
|
256
|
+
surfaceType: 'detail',
|
|
257
|
+
enabled: true,
|
|
258
|
+
featureId: 'submitted-requests',
|
|
259
|
+
featureIds: ['submitted-requests'],
|
|
260
|
+
entityIds: ['reported_request'],
|
|
261
|
+
resourceIds: [],
|
|
262
|
+
capabilityIds: []
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
id: 'settings.account',
|
|
266
|
+
label: 'Account',
|
|
267
|
+
path: '/settings/account',
|
|
268
|
+
surfaceType: 'settings',
|
|
269
|
+
enabled: true,
|
|
270
|
+
featureId: 'settings',
|
|
271
|
+
featureIds: ['settings'],
|
|
272
|
+
entityIds: [],
|
|
273
|
+
resourceIds: [],
|
|
274
|
+
capabilityIds: []
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
id: 'settings.appearance',
|
|
278
|
+
label: 'Appearance',
|
|
279
|
+
path: '/settings/appearance',
|
|
280
|
+
surfaceType: 'settings',
|
|
281
|
+
enabled: true,
|
|
282
|
+
featureId: 'settings',
|
|
283
|
+
featureIds: ['settings'],
|
|
284
|
+
entityIds: [],
|
|
285
|
+
resourceIds: [],
|
|
286
|
+
capabilityIds: []
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
id: SETTINGS_ROLES_SURFACE_ID,
|
|
290
|
+
label: 'My Roles',
|
|
291
|
+
path: '/settings/roles',
|
|
292
|
+
surfaceType: 'settings',
|
|
293
|
+
enabled: true,
|
|
294
|
+
featureId: 'settings',
|
|
295
|
+
featureIds: ['settings'],
|
|
296
|
+
entityIds: [],
|
|
297
|
+
resourceIds: [],
|
|
298
|
+
capabilityIds: []
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
id: 'settings.organization',
|
|
302
|
+
label: 'Organization',
|
|
303
|
+
path: '/settings/organization',
|
|
304
|
+
surfaceType: 'settings',
|
|
305
|
+
enabled: true,
|
|
306
|
+
featureId: 'settings',
|
|
307
|
+
featureIds: ['settings'],
|
|
308
|
+
entityIds: [],
|
|
309
|
+
resourceIds: [],
|
|
310
|
+
capabilityIds: []
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
id: 'settings.credentials',
|
|
314
|
+
label: 'Credentials',
|
|
315
|
+
path: '/settings/credentials',
|
|
316
|
+
surfaceType: 'settings',
|
|
317
|
+
enabled: true,
|
|
318
|
+
featureId: 'settings',
|
|
319
|
+
featureIds: ['settings'],
|
|
320
|
+
entityIds: [],
|
|
321
|
+
resourceIds: [],
|
|
322
|
+
capabilityIds: []
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
id: 'settings.api-keys',
|
|
326
|
+
label: 'API Keys',
|
|
327
|
+
path: '/settings/api-keys',
|
|
328
|
+
surfaceType: 'settings',
|
|
329
|
+
enabled: true,
|
|
330
|
+
featureId: 'settings',
|
|
331
|
+
featureIds: ['settings'],
|
|
332
|
+
entityIds: [],
|
|
333
|
+
resourceIds: [],
|
|
334
|
+
capabilityIds: []
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
id: 'settings.webhooks',
|
|
338
|
+
label: 'Webhooks',
|
|
339
|
+
path: '/settings/webhooks',
|
|
340
|
+
surfaceType: 'settings',
|
|
341
|
+
enabled: true,
|
|
342
|
+
featureId: 'settings',
|
|
343
|
+
featureIds: ['settings'],
|
|
344
|
+
entityIds: [],
|
|
345
|
+
resourceIds: [],
|
|
346
|
+
capabilityIds: []
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
id: 'settings.deployments',
|
|
350
|
+
label: 'Deployments',
|
|
351
|
+
path: '/settings/deployments',
|
|
352
|
+
surfaceType: 'settings',
|
|
353
|
+
enabled: true,
|
|
354
|
+
featureId: 'settings',
|
|
355
|
+
featureIds: ['settings'],
|
|
356
|
+
entityIds: [],
|
|
357
|
+
resourceIds: [],
|
|
358
|
+
capabilityIds: []
|
|
359
|
+
}
|
|
360
|
+
],
|
|
361
|
+
groups: [
|
|
362
|
+
{
|
|
363
|
+
id: 'primary-workspace',
|
|
364
|
+
label: 'Workspace',
|
|
365
|
+
placement: 'primary',
|
|
366
|
+
surfaceIds: ['crm.pipeline', 'lead-gen.lists', PROJECTS_INDEX_SURFACE_ID]
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
id: 'primary-operations',
|
|
370
|
+
label: 'Operations',
|
|
371
|
+
placement: 'primary',
|
|
372
|
+
surfaceIds: [
|
|
373
|
+
'operations.overview',
|
|
374
|
+
'operations.resources',
|
|
375
|
+
'operations.command-queue',
|
|
376
|
+
'operations.sessions',
|
|
377
|
+
'operations.task-scheduler'
|
|
378
|
+
]
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
id: 'primary-monitoring',
|
|
382
|
+
label: 'Monitoring',
|
|
383
|
+
placement: 'primary',
|
|
384
|
+
surfaceIds: [
|
|
385
|
+
'monitoring.activity-log',
|
|
386
|
+
'monitoring.execution-logs',
|
|
387
|
+
'monitoring.execution-health',
|
|
388
|
+
'monitoring.cost-analytics',
|
|
389
|
+
'monitoring.notifications',
|
|
390
|
+
'submitted-requests.list',
|
|
391
|
+
'submitted-requests.detail'
|
|
392
|
+
]
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
id: 'primary-knowledge',
|
|
396
|
+
label: 'Knowledge',
|
|
397
|
+
placement: 'primary',
|
|
398
|
+
surfaceIds: ['knowledge.base', OPERATIONS_COMMAND_VIEW_SURFACE_ID]
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
id: 'primary-settings',
|
|
402
|
+
label: 'Settings',
|
|
403
|
+
placement: 'bottom',
|
|
404
|
+
surfaceIds: [
|
|
405
|
+
'settings.account',
|
|
406
|
+
'settings.appearance',
|
|
407
|
+
SETTINGS_ROLES_SURFACE_ID,
|
|
408
|
+
'settings.organization',
|
|
409
|
+
'settings.credentials',
|
|
410
|
+
'settings.api-keys',
|
|
411
|
+
'settings.webhooks',
|
|
412
|
+
'settings.deployments'
|
|
413
|
+
]
|
|
414
|
+
}
|
|
415
|
+
]
|
|
416
|
+
}
|