@elevasis/core 0.42.1 → 0.44.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/auth/index.d.ts +8 -3
- package/dist/auth/index.js +6 -0
- package/dist/business/entities-published.d.ts +1 -1
- package/dist/index.d.ts +12 -13
- package/dist/index.js +48 -29
- package/dist/knowledge/index.d.ts +94 -6
- package/dist/knowledge/index.js +172 -8
- package/dist/organization-model/index.d.ts +12 -13
- package/dist/organization-model/index.js +48 -29
- package/dist/test-utils/index.d.ts +5 -6
- package/dist/test-utils/index.js +21 -18
- package/package.json +3 -3
- package/src/auth/access-keys.ts +6 -0
- package/src/business/acquisition/api-schemas.ts +1 -1
- package/src/business/base-entities.ts +1 -1
- package/src/knowledge/cli-helpers.ts +211 -0
- package/src/knowledge/index.ts +13 -0
- package/src/knowledge/published.ts +18 -5
- package/src/knowledge/queries.ts +5 -5
- package/src/organization-model/__tests__/cross-ref.test.ts +11 -1
- package/src/organization-model/__tests__/domains/systems.test.ts +34 -8
- package/src/organization-model/__tests__/scaffolders.test.ts +30 -1
- package/src/organization-model/__tests__/schema-refinements.test.ts +178 -0
- package/src/organization-model/cross-ref.ts +43 -7
- package/src/organization-model/defaults.ts +2 -2
- package/src/organization-model/domains/actions.ts +1 -1
- package/src/organization-model/domains/resources.ts +1 -1
- package/src/organization-model/domains/systems.ts +0 -4
- package/src/organization-model/ontology.ts +13 -18
- package/src/organization-model/organization-graph.mdx +9 -8
- package/src/organization-model/published.ts +9 -3
- package/src/organization-model/resolve.ts +9 -7
- package/src/organization-model/scaffolders/helpers.ts +1 -1
- package/src/organization-model/scaffolders/scaffoldKnowledgeNode.ts +1 -0
- package/src/organization-model/scaffolders/scaffoldOntologyRecord.ts +28 -6
- package/src/organization-model/scaffolders/scaffoldResource.ts +1 -0
- package/src/organization-model/scaffolders/scaffoldSystem.ts +2 -1
- package/src/organization-model/schema-refinements.ts +3 -5
- package/src/platform/registry/__tests__/validation.test.ts +28 -0
- package/src/platform/registry/validation.ts +20 -2
- package/src/scaffold-registry/__tests__/index.test.ts +380 -206
- package/src/scaffold-registry/index.ts +392 -381
- package/src/test-utils/mocks/supabase.ts +1 -1
- package/src/test-utils/mocks/workos.ts +2 -2
package/dist/auth/index.d.ts
CHANGED
|
@@ -4278,7 +4278,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
|
|
|
4278
4278
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4279
4279
|
members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
4280
4280
|
}, z.core.$loose>>>>;
|
|
4281
|
-
|
|
4281
|
+
endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4282
4282
|
id: z.ZodString;
|
|
4283
4283
|
label: z.ZodOptional<z.ZodString>;
|
|
4284
4284
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -4337,7 +4337,6 @@ interface SystemEntry {
|
|
|
4337
4337
|
status?: 'active' | 'deprecated' | 'archived';
|
|
4338
4338
|
path?: string;
|
|
4339
4339
|
icon?: string;
|
|
4340
|
-
color?: string;
|
|
4341
4340
|
uiPosition?: 'sidebar-primary' | 'sidebar-bottom';
|
|
4342
4341
|
enabled?: boolean;
|
|
4343
4342
|
devOnly?: boolean;
|
|
@@ -4920,7 +4919,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
4920
4919
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4921
4920
|
members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
4922
4921
|
}, z.core.$loose>>>>;
|
|
4923
|
-
|
|
4922
|
+
endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4924
4923
|
id: z.ZodString;
|
|
4925
4924
|
label: z.ZodOptional<z.ZodString>;
|
|
4926
4925
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -5516,6 +5515,7 @@ declare const AccessKeys: {
|
|
|
5516
5515
|
readonly systemPath: "permission.roles";
|
|
5517
5516
|
readonly action: "manage";
|
|
5518
5517
|
};
|
|
5518
|
+
/** @reserved Reserved for first-class secret administration routes and command surfaces. */
|
|
5519
5519
|
readonly secretsManage: {
|
|
5520
5520
|
readonly systemPath: "permission.secrets";
|
|
5521
5521
|
readonly action: "manage";
|
|
@@ -5524,6 +5524,7 @@ declare const AccessKeys: {
|
|
|
5524
5524
|
readonly systemPath: "permission.operations";
|
|
5525
5525
|
readonly action: "view";
|
|
5526
5526
|
};
|
|
5527
|
+
/** @reserved Reserved for write-level operations administration beyond read-only monitoring. */
|
|
5527
5528
|
readonly operationsManage: {
|
|
5528
5529
|
readonly systemPath: "permission.operations";
|
|
5529
5530
|
readonly action: "manage";
|
|
@@ -5532,14 +5533,17 @@ declare const AccessKeys: {
|
|
|
5532
5533
|
readonly systemPath: "sales.lead-gen";
|
|
5533
5534
|
readonly action: "manage";
|
|
5534
5535
|
};
|
|
5536
|
+
/** @reserved Reserved for acquisition administration once that permission namespace is wired. */
|
|
5535
5537
|
readonly acquisitionManage: {
|
|
5536
5538
|
readonly systemPath: "permission.acquisition";
|
|
5537
5539
|
readonly action: "manage";
|
|
5538
5540
|
};
|
|
5541
|
+
/** @reserved Reserved for project administration permission catalog compatibility. */
|
|
5539
5542
|
readonly projectsManage: {
|
|
5540
5543
|
readonly systemPath: "permission.projects";
|
|
5541
5544
|
readonly action: "manage";
|
|
5542
5545
|
};
|
|
5546
|
+
/** @reserved Reserved for client administration permission catalog compatibility. */
|
|
5543
5547
|
readonly clientsManage: {
|
|
5544
5548
|
readonly systemPath: "permission.clients";
|
|
5545
5549
|
readonly action: "manage";
|
|
@@ -5548,6 +5552,7 @@ declare const AccessKeys: {
|
|
|
5548
5552
|
readonly systemPath: "diagnostic.operations.overview";
|
|
5549
5553
|
readonly action: "view";
|
|
5550
5554
|
};
|
|
5555
|
+
/** @reserved Reserved for a diagnostics surface that lists recent operations executions. */
|
|
5551
5556
|
readonly operationsRecentExecutions: {
|
|
5552
5557
|
readonly systemPath: "diagnostic.operations.recent-executions";
|
|
5553
5558
|
readonly action: "view";
|
package/dist/auth/index.js
CHANGED
|
@@ -474,14 +474,20 @@ var AccessKeys = {
|
|
|
474
474
|
organizationManage: { systemPath: "permission.org", action: "manage" },
|
|
475
475
|
membersManage: { systemPath: "permission.members", action: "manage" },
|
|
476
476
|
rolesManage: { systemPath: "permission.roles", action: "manage" },
|
|
477
|
+
/** @reserved Reserved for first-class secret administration routes and command surfaces. */
|
|
477
478
|
secretsManage: { systemPath: "permission.secrets", action: "manage" },
|
|
478
479
|
operationsRead: { systemPath: "permission.operations", action: DEFAULT_ACCESS_ACTION },
|
|
480
|
+
/** @reserved Reserved for write-level operations administration beyond read-only monitoring. */
|
|
479
481
|
operationsManage: { systemPath: "permission.operations", action: "manage" },
|
|
480
482
|
leadGenManage: { systemPath: "sales.lead-gen", action: "manage" },
|
|
483
|
+
/** @reserved Reserved for acquisition administration once that permission namespace is wired. */
|
|
481
484
|
acquisitionManage: { systemPath: "permission.acquisition", action: "manage" },
|
|
485
|
+
/** @reserved Reserved for project administration permission catalog compatibility. */
|
|
482
486
|
projectsManage: { systemPath: "permission.projects", action: "manage" },
|
|
487
|
+
/** @reserved Reserved for client administration permission catalog compatibility. */
|
|
483
488
|
clientsManage: { systemPath: "permission.clients", action: "manage" },
|
|
484
489
|
operationsOverview: { systemPath: "diagnostic.operations.overview", action: DEFAULT_ACCESS_ACTION },
|
|
490
|
+
/** @reserved Reserved for a diagnostics surface that lists recent operations executions. */
|
|
485
491
|
operationsRecentExecutions: { systemPath: "diagnostic.operations.recent-executions", action: DEFAULT_ACCESS_ACTION },
|
|
486
492
|
monitoringExecutionLogs: { systemPath: "diagnostic.monitoring.execution-logs", action: DEFAULT_ACCESS_ACTION },
|
|
487
493
|
monitoringNotifications: { systemPath: "diagnostic.monitoring.notifications", action: DEFAULT_ACCESS_ACTION }
|
|
@@ -12,7 +12,7 @@ import { z } from 'zod';
|
|
|
12
12
|
* layer; use the row types internally for direct Supabase access.
|
|
13
13
|
*
|
|
14
14
|
* Usage in a client project:
|
|
15
|
-
* import { BaseProject } from '@elevasis/core'
|
|
15
|
+
* import { BaseProject } from '@elevasis/core'
|
|
16
16
|
* type Project = BaseProject<{ budget: number; riskScore: 'low' | 'medium' | 'high' }>
|
|
17
17
|
*
|
|
18
18
|
* Extending a Zod schema in a client project:
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { z, ZodType } from 'zod';
|
|
|
3
3
|
declare const OntologyKindSchema: z.ZodEnum<{
|
|
4
4
|
object: "object";
|
|
5
5
|
action: "action";
|
|
6
|
-
surface: "surface";
|
|
7
6
|
group: "group";
|
|
8
7
|
link: "link";
|
|
9
8
|
catalog: "catalog";
|
|
@@ -11,6 +10,7 @@ declare const OntologyKindSchema: z.ZodEnum<{
|
|
|
11
10
|
interface: "interface";
|
|
12
11
|
"value-type": "value-type";
|
|
13
12
|
property: "property";
|
|
13
|
+
endpoint: "endpoint";
|
|
14
14
|
}>;
|
|
15
15
|
type OntologyKind = z.infer<typeof OntologyKindSchema>;
|
|
16
16
|
declare const OntologyIdSchema: z.ZodString;
|
|
@@ -110,7 +110,7 @@ declare const OntologyGroupSchema: z.ZodObject<{
|
|
|
110
110
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
111
111
|
members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
112
112
|
}, z.core.$loose>;
|
|
113
|
-
declare const
|
|
113
|
+
declare const OntologyEndpointTypeSchema: z.ZodObject<{
|
|
114
114
|
id: z.ZodString;
|
|
115
115
|
label: z.ZodOptional<z.ZodString>;
|
|
116
116
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -201,7 +201,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
|
|
|
201
201
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
202
202
|
members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
203
203
|
}, z.core.$loose>>>>;
|
|
204
|
-
|
|
204
|
+
endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
205
205
|
id: z.ZodString;
|
|
206
206
|
label: z.ZodOptional<z.ZodString>;
|
|
207
207
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -220,7 +220,7 @@ type OntologyInterfaceType = z.infer<typeof OntologyInterfaceTypeSchema>;
|
|
|
220
220
|
type OntologyValueType = z.infer<typeof OntologyValueTypeSchema>;
|
|
221
221
|
type OntologySharedProperty = z.infer<typeof OntologySharedPropertySchema>;
|
|
222
222
|
type OntologyGroup = z.infer<typeof OntologyGroupSchema>;
|
|
223
|
-
type
|
|
223
|
+
type OntologyEndpointType = z.infer<typeof OntologyEndpointTypeSchema>;
|
|
224
224
|
type OntologyScope = z.infer<typeof OntologyScopeSchema>;
|
|
225
225
|
type ResolvedOntologyIndex = {
|
|
226
226
|
objectTypes: Record<OntologyId, ResolvedOntologyRecord<OntologyObjectType>>;
|
|
@@ -232,7 +232,7 @@ type ResolvedOntologyIndex = {
|
|
|
232
232
|
valueTypes: Record<OntologyId, ResolvedOntologyRecord<OntologyValueType>>;
|
|
233
233
|
sharedProperties: Record<OntologyId, ResolvedOntologyRecord<OntologySharedProperty>>;
|
|
234
234
|
groups: Record<OntologyId, ResolvedOntologyRecord<OntologyGroup>>;
|
|
235
|
-
|
|
235
|
+
endpoints: Record<OntologyId, ResolvedOntologyRecord<OntologyEndpointType>>;
|
|
236
236
|
};
|
|
237
237
|
type OntologyRecordOrigin = {
|
|
238
238
|
kind: 'authored' | 'projected';
|
|
@@ -261,7 +261,7 @@ type OntologyCompilation = {
|
|
|
261
261
|
type ResolvedOntologyRecordEntry = {
|
|
262
262
|
id: OntologyId;
|
|
263
263
|
kind: OntologyKind;
|
|
264
|
-
record: ResolvedOntologyRecord<OntologyObjectType | OntologyLinkType | OntologyActionType | OntologyCatalogType | OntologyEventType | OntologyInterfaceType | OntologyValueType | OntologySharedProperty | OntologyGroup |
|
|
264
|
+
record: ResolvedOntologyRecord<OntologyObjectType | OntologyLinkType | OntologyActionType | OntologyCatalogType | OntologyEventType | OntologyInterfaceType | OntologyValueType | OntologySharedProperty | OntologyGroup | OntologyEndpointType>;
|
|
265
265
|
};
|
|
266
266
|
declare function ontologyGraphNodeId(id: OntologyId | string): string;
|
|
267
267
|
declare function ontologyIdFromGraphNodeId(nodeId: string): OntologyId | undefined;
|
|
@@ -918,7 +918,6 @@ interface SystemEntry {
|
|
|
918
918
|
status?: 'active' | 'deprecated' | 'archived';
|
|
919
919
|
path?: string;
|
|
920
920
|
icon?: string;
|
|
921
|
-
color?: string;
|
|
922
921
|
uiPosition?: 'sidebar-primary' | 'sidebar-bottom';
|
|
923
922
|
enabled?: boolean;
|
|
924
923
|
devOnly?: boolean;
|
|
@@ -1091,7 +1090,7 @@ declare const ActionsDomainSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodOb
|
|
|
1091
1090
|
* Generic empty default for the actions domain.
|
|
1092
1091
|
* Elevasis-specific action entries (LEAD_GEN_ACTION_ENTRIES, CRM_ACTION_ENTRIES,
|
|
1093
1092
|
* DEFAULT_ORGANIZATION_MODEL_ACTIONS) have been relocated to
|
|
1094
|
-
*
|
|
1093
|
+
* the tenant-owned organization model package.
|
|
1095
1094
|
* Tenant OM configs supply their own action entries via `resolveOrganizationModel`.
|
|
1096
1095
|
*/
|
|
1097
1096
|
declare const DEFAULT_ORGANIZATION_MODEL_ACTIONS: z.infer<typeof ActionsDomainSchema>;
|
|
@@ -3809,11 +3808,11 @@ declare const SETTINGS_ROLES_SURFACE_ID: "settings.roles";
|
|
|
3809
3808
|
*
|
|
3810
3809
|
* It does NOT contain Elevasis-specific identity, systems, or action entries.
|
|
3811
3810
|
* Runtime consumers that need the full Elevasis canonical model should import
|
|
3812
|
-
* `canonicalOrganizationModel` from
|
|
3811
|
+
* `canonicalOrganizationModel` from the tenant-owned organization model package instead.
|
|
3813
3812
|
*
|
|
3814
3813
|
* Elevasis-specific systems, actions (LEAD_GEN_ACTION_ENTRIES, CRM_ACTION_ENTRIES,
|
|
3815
3814
|
* DEFAULT_ORGANIZATION_MODEL_ACTIONS), and the platform system description have been
|
|
3816
|
-
* relocated to
|
|
3815
|
+
* relocated to the tenant-owned organization model package.
|
|
3817
3816
|
*/
|
|
3818
3817
|
|
|
3819
3818
|
declare const DEFAULT_ORGANIZATION_MODEL: OrganizationModel;
|
|
@@ -4930,7 +4929,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
4930
4929
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4931
4930
|
members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
4932
4931
|
}, z.core.$loose>>>>;
|
|
4933
|
-
|
|
4932
|
+
endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4934
4933
|
id: z.ZodString;
|
|
4935
4934
|
label: z.ZodOptional<z.ZodString>;
|
|
4936
4935
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -5456,5 +5455,5 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
5456
5455
|
}, z.core.$strip>>>>;
|
|
5457
5456
|
}, z.core.$strip>;
|
|
5458
5457
|
|
|
5459
|
-
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, ClientProfileBrandingSchema, ClientProfileIdentitySchema, ClientProfileLinksSchema, ClientProfilePromptsSchema, ClientProfileSchema, ClientProfileSourceSchema, ClientProfileStatusSchema, ClientProfileWorkspaceSchema, ClientProfilesDomainSchema, CodeReferenceRoleSchema, CodeReferenceSchema, ContractRefSchema, CustomerSegmentSchema, CustomersDomainSchema, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA, DEFAULT_ORGANIZATION_MODEL_GOALS, DEFAULT_ORGANIZATION_MODEL_NAVIGATION, DEFAULT_ORGANIZATION_MODEL_OFFERINGS, DEFAULT_ORGANIZATION_MODEL_POLICIES, DEFAULT_ORGANIZATION_MODEL_RESOURCES, DEFAULT_ORGANIZATION_MODEL_ROLES, DEFAULT_ORGANIZATION_MODEL_STATUSES, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DEFAULT_ORGANIZATION_MODEL_TOPOLOGY, EntitiesDomainSchema, EntityIdSchema, EntityLinkKindSchema, EntityLinkSchema, EntitySchema, EventDescriptorSchema, EventEmissionDescriptorSchema, EventIdSchema, FirmographicsSchema, GoalsDomainSchema, HumanRoleHolderSchema, IconNameSchema, IntegrationResourceEntrySchema, KNOWLEDGE_FEATURE_ID, KNOWLEDGE_SYSTEM_ID, KeyResultSchema, KnowledgeDomainSchema, KnowledgeLinkSchema, KnowledgeTargetKindSchema, KnowledgeTargetRefSchema, LinkSchema, MONITORING_FEATURE_ID, MONITORING_SYSTEM_ID, McpToolInvocationSchema, NavigationGroupSchema, NodeIdPathSchema, NodeIdStringSchema, OPERATIONS_COMMAND_VIEW_SURFACE_ID, OPERATIONS_FEATURE_ID, OPERATIONS_SYSTEM_ID, ORGANIZATION_MODEL_ICON_TOKENS, ObjectiveSchema, OfferingsDomainSchema, OmTopologyDomainSchema, OmTopologyMetadataSchema, OmTopologyNodeKindSchema, OmTopologyNodeRefSchema, OmTopologyRelationshipKindSchema, OmTopologyRelationshipSchema, OmTopologySystemInterfaceGrantMetadataSchema, OmTopologySystemInterfaceGrantSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEventTypeSchema, OntologyGroupSchema, OntologyIdSchema, OntologyInterfaceTypeSchema, OntologyKindSchema, OntologyLinkTypeSchema, OntologyObjectTypeSchema, OntologyScopeSchema, OntologySharedPropertySchema,
|
|
5460
|
-
export type { BaseOmScaffoldSpec, ClientProfile, ClientProfileBranding, ClientProfileIdentity, ClientProfileLinks, ClientProfilePrompts, ClientProfileSource, ClientProfileStatus, ClientProfileWorkspace, DeepPartial, Entity, EntityId, EntityLink, EventDescriptor, EventEmissionDescriptor, EventId, FoundationBranding, FoundationNavigationSurface, FoundationOrganizationModel, FoundationSurfaceIcon, FoundationSurfaceType, KnowledgeLink, KnowledgeNodeScaffoldSpec, KnowledgeTargetKind, KnowledgeTargetRef, LeadGenStageCatalogEntry, NodeIdPath, NodeIdString, OmScaffoldEdit, OmScaffoldIntent, OmScaffoldPlan, OmScaffoldSpec, OmScaffoldWrite, OntologyActionType, OntologyCatalogType, OntologyCompilation, OntologyDiagnostic, OntologyEventType, OntologyGroup, OntologyId, OntologyInterfaceType, OntologyKind, OntologyLinkType, OntologyObjectType, OntologyRecordOrigin, OntologyRecordScaffoldSpec, OntologyScope, OntologySharedProperty,
|
|
5458
|
+
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, ClientProfileBrandingSchema, ClientProfileIdentitySchema, ClientProfileLinksSchema, ClientProfilePromptsSchema, ClientProfileSchema, ClientProfileSourceSchema, ClientProfileStatusSchema, ClientProfileWorkspaceSchema, ClientProfilesDomainSchema, CodeReferenceRoleSchema, CodeReferenceSchema, ContractRefSchema, CustomerSegmentSchema, CustomersDomainSchema, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA, DEFAULT_ORGANIZATION_MODEL_GOALS, DEFAULT_ORGANIZATION_MODEL_NAVIGATION, DEFAULT_ORGANIZATION_MODEL_OFFERINGS, DEFAULT_ORGANIZATION_MODEL_POLICIES, DEFAULT_ORGANIZATION_MODEL_RESOURCES, DEFAULT_ORGANIZATION_MODEL_ROLES, DEFAULT_ORGANIZATION_MODEL_STATUSES, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DEFAULT_ORGANIZATION_MODEL_TOPOLOGY, EntitiesDomainSchema, EntityIdSchema, EntityLinkKindSchema, EntityLinkSchema, EntitySchema, EventDescriptorSchema, EventEmissionDescriptorSchema, EventIdSchema, FirmographicsSchema, GoalsDomainSchema, HumanRoleHolderSchema, IconNameSchema, IntegrationResourceEntrySchema, KNOWLEDGE_FEATURE_ID, KNOWLEDGE_SYSTEM_ID, KeyResultSchema, KnowledgeDomainSchema, KnowledgeLinkSchema, KnowledgeTargetKindSchema, KnowledgeTargetRefSchema, LinkSchema, MONITORING_FEATURE_ID, MONITORING_SYSTEM_ID, McpToolInvocationSchema, NavigationGroupSchema, NodeIdPathSchema, NodeIdStringSchema, OPERATIONS_COMMAND_VIEW_SURFACE_ID, OPERATIONS_FEATURE_ID, OPERATIONS_SYSTEM_ID, ORGANIZATION_MODEL_ICON_TOKENS, ObjectiveSchema, OfferingsDomainSchema, OmTopologyDomainSchema, OmTopologyMetadataSchema, OmTopologyNodeKindSchema, OmTopologyNodeRefSchema, OmTopologyRelationshipKindSchema, OmTopologyRelationshipSchema, OmTopologySystemInterfaceGrantMetadataSchema, OmTopologySystemInterfaceGrantSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEndpointTypeSchema, OntologyEventTypeSchema, OntologyGroupSchema, OntologyIdSchema, OntologyInterfaceTypeSchema, OntologyKindSchema, OntologyLinkTypeSchema, OntologyObjectTypeSchema, OntologyScopeSchema, OntologySharedPropertySchema, OntologyValueTypeSchema, OrgKnowledgeKindSchema, OrgKnowledgeNodeSchema, OrganizationModelBuiltinIconTokenSchema, OrganizationModelDomainKeySchema, OrganizationModelDomainMetadataByDomainSchema, OrganizationModelDomainMetadataSchema, OrganizationModelIconTokenSchema, OrganizationModelNavigationSchema, OrganizationModelSchema, PROJECTS_FEATURE_ID, PROJECTS_INDEX_SURFACE_ID, PROJECTS_SYSTEM_ID, PROJECTS_VIEW_ACTION_ID, PROSPECTING_FEATURE_ID, PROSPECTING_LISTS_SURFACE_ID, PROSPECTING_SYSTEM_ID, PoliciesDomainSchema, PolicyApplicabilitySchema, PolicyEffectSchema, PolicyIdSchema, PolicyPredicateSchema, PolicySchema, PolicyTriggerSchema, PricingModelSchema, ProductSchema, ResourceEntrySchema, ResourceGovernanceStatusSchema, ResourceIdSchema, ResourceKindSchema, ResourceOntologyBindingSchema, ResourcesDomainSchema, RoleHolderSchema, RoleHoldersSchema, RoleIdSchema, RoleSchema, RolesDomainSchema, SALES_FEATURE_ID, SALES_PIPELINE_SURFACE_ID, SALES_SYSTEM_ID, SEO_FEATURE_ID, SEO_SYSTEM_ID, SETTINGS_FEATURE_ID, SETTINGS_ROLES_SURFACE_ID, SETTINGS_SYSTEM_ID, SYSTEM_INTERFACE_PROFILES, SYSTEM_INTERFACE_READINESS_PROFILES, ScriptExecutionInvocationSchema, ScriptResourceEntrySchema, ScriptResourceLanguageSchema, ScriptResourceSourceSchema, SidebarNavigationSchema, SidebarNodeSchema, SidebarSectionSchema, SidebarSurfaceTargetsSchema, SlashCommandInvocationSchema, StatusEntrySchema, StatusSemanticClassSchema, StatusesDomainSchema, SurfaceDefinitionSchema, SurfaceTypeSchema, SystemApiInterfaceSchema, SystemEntrySchema, SystemIdSchema, SystemInterfaceKeySchema, SystemInterfaceLifecycleSchema, SystemInterfaceReadinessProfileSchema, SystemInterfaceRefSchema, SystemKindSchema, SystemLifecycleSchema, SystemPathSchema, SystemStatusSchema, SystemUiSchema, SystemsDomainSchema, TeamRoleHolderSchema, TechStackEntrySchema, TopbarActionNodeSchema, TopbarSectionSchema, UiPositionSchema, WorkflowResourceEntrySchema, compileOrganizationOntology, compileTopologyNodeRef, createFoundationOrganizationModel, defineAction, defineActions, defineCustomer, defineCustomers, defineDomainRecord, defineEntities, defineEntity, defineGoal, defineGoals, defineKnowledgeNode, defineKnowledgeNodes, defineOffering, defineOfferings, defineOrganizationModel, definePolicies, definePolicy, defineResource, defineResourceOntology, defineResources, defineRole, defineRoles, defineStatus, defineStatuses, defineSystem, defineSystems, defineTopology, defineTopologyRelationship, findOrganizationActionById, formatOntologyId, getClientProfile, getClientProfileBySlug, getOntologyDiagnostics, getSortedSidebarEntries, isOntologyGraphNodeId, isOntologyTopologyRef, listAllSystems, listClientProfiles, listResolvedOntologyRecords, ontologyGraphNodeId, ontologyIdFromGraphNodeId, parseContractRef, parseOntologyId, parseTopologyNodeRef, projectOrganizationSurfaces, resolveOrganizationModel, resolveOrganizationModelWithResources, scaffoldOrganizationModel, topologyRef, topologyRelationship, validateOrganizationSurfaceProjection };
|
|
5459
|
+
export type { BaseOmScaffoldSpec, ClientProfile, ClientProfileBranding, ClientProfileIdentity, ClientProfileLinks, ClientProfilePrompts, ClientProfileSource, ClientProfileStatus, ClientProfileWorkspace, DeepPartial, Entity, EntityId, EntityLink, EventDescriptor, EventEmissionDescriptor, EventId, FoundationBranding, FoundationNavigationSurface, FoundationOrganizationModel, FoundationSurfaceIcon, FoundationSurfaceType, KnowledgeLink, KnowledgeNodeScaffoldSpec, KnowledgeTargetKind, KnowledgeTargetRef, LeadGenStageCatalogEntry, NodeIdPath, NodeIdString, OmScaffoldEdit, OmScaffoldIntent, OmScaffoldPlan, OmScaffoldSpec, OmScaffoldWrite, OntologyActionType, OntologyCatalogType, OntologyCompilation, OntologyDiagnostic, OntologyEndpointType, OntologyEventType, OntologyGroup, OntologyId, OntologyInterfaceType, OntologyKind, OntologyLinkType, OntologyObjectType, OntologyRecordOrigin, OntologyRecordScaffoldSpec, OntologyScope, OntologySharedProperty, OntologyValueType, OrgKnowledgeKind, OrgKnowledgeNode, OrgKnowledgeNodeInput, OrganizationModel, OrganizationModelAction, OrganizationModelActionId, OrganizationModelActionInvocation, OrganizationModelActionInvocationKind, OrganizationModelActionRef, OrganizationModelActionScope, OrganizationModelActions, OrganizationModelAgentKind, OrganizationModelAgentResourceEntry, OrganizationModelAgentRoleHolder, OrganizationModelBranding, OrganizationModelBuiltinIconToken, OrganizationModelClients, OrganizationModelCodeReference, OrganizationModelCodeReferenceRole, OrganizationModelContractRef, OrganizationModelCustomerFirmographics, OrganizationModelCustomerSegment, OrganizationModelCustomers, OrganizationModelDomainKey, OrganizationModelDomainMetadata, OrganizationModelDomainMetadataByDomain, OrganizationModelEntities, OrganizationModelEntity, OrganizationModelGoals, OrganizationModelHumanRoleHolder, OrganizationModelIconToken, OrganizationModelIntegrationResourceEntry, OrganizationModelKeyResult, OrganizationModelKnowledge, OrganizationModelNavigation, OrganizationModelObjective, OrganizationModelOfferings, OrganizationModelPolicies, OrganizationModelPolicy, OrganizationModelPolicyApplicability, OrganizationModelPolicyEffect, OrganizationModelPolicyId, OrganizationModelPolicyPredicate, OrganizationModelPolicyTrigger, OrganizationModelPricingModel, OrganizationModelProduct, OrganizationModelResourceEntry, OrganizationModelResourceGovernanceStatus, OrganizationModelResourceId, OrganizationModelResourceKind, OrganizationModelResourceOntologyBinding, OrganizationModelResourceOntologyBindingContract, OrganizationModelResources, OrganizationModelRole, OrganizationModelRoleHolder, OrganizationModelRoleId, OrganizationModelRoles, OrganizationModelScriptResourceEntry, OrganizationModelScriptResourceLanguage, OrganizationModelScriptResourceSource, OrganizationModelSidebar, OrganizationModelSidebarGroupNode, OrganizationModelSidebarNode, OrganizationModelSidebarSection, OrganizationModelSidebarSurfaceNode, OrganizationModelSidebarSurfaceTargets, OrganizationModelStatusEntry, OrganizationModelStatusSemanticClass, OrganizationModelStatuses, OrganizationModelSystemApiInterface, OrganizationModelSystemEntry, OrganizationModelSystemId, OrganizationModelSystemInterfaceKey, OrganizationModelSystemInterfaceLifecycle, OrganizationModelSystemInterfaceReadinessProfile, OrganizationModelSystemInterfaceRef, OrganizationModelSystemKind, OrganizationModelSystemLifecycle, OrganizationModelSystemStatus, OrganizationModelSystems, OrganizationModelTeamRoleHolder, OrganizationModelTechStackEntry, OrganizationModelTopbarActionNode, OrganizationModelTopbarSection, OrganizationModelTopology, OrganizationModelTopologyMetadata, OrganizationModelTopologyNodeKind, OrganizationModelTopologyNodeRef, OrganizationModelTopologyRelationship, OrganizationModelTopologyRelationshipKind, OrganizationModelTopologySystemInterfaceGrant, OrganizationModelTopologySystemInterfaceGrantMetadata, OrganizationModelWorkflowResourceEntry, OrganizationSurfaceProjection, OrganizationSurfaceProjectionIssue, OrganizationSurfaceProjectionIssueCode, ParsedContractRef, ParsedOntologyId, ResolvedOntologyIndex, ResolvedOntologyRecord, ResolvedOntologyRecordEntry, ResolvedOrganizationModel, ResolvedSystemEntry, ResourceScaffoldSpec, SystemEntryWithTree, SystemScaffoldSpec };
|
package/dist/index.js
CHANGED
|
@@ -11,16 +11,13 @@ var OntologyKindSchema = z.enum([
|
|
|
11
11
|
"value-type",
|
|
12
12
|
"property",
|
|
13
13
|
"group",
|
|
14
|
-
"
|
|
14
|
+
"endpoint"
|
|
15
15
|
]);
|
|
16
16
|
var SYSTEM_PATH_PATTERN = "[a-z0-9][a-z0-9-]*(?:\\.[a-z0-9][a-z0-9-]*)*";
|
|
17
17
|
var LOCAL_ID_PATTERN = "[a-z0-9][a-z0-9._-]*";
|
|
18
18
|
var ONTOLOGY_ID_PATTERN = `^(global|${SYSTEM_PATH_PATTERN}):(${OntologyKindSchema.options.join("|")})\\/(${LOCAL_ID_PATTERN})$`;
|
|
19
19
|
var ONTOLOGY_ID_REGEX = new RegExp(ONTOLOGY_ID_PATTERN);
|
|
20
|
-
var OntologyIdSchema = z.string().trim().min(1).max(300).regex(
|
|
21
|
-
ONTOLOGY_ID_REGEX,
|
|
22
|
-
"Ontology IDs must use <system-path>:<kind>/<local-id> or global:<kind>/<local-id>"
|
|
23
|
-
);
|
|
20
|
+
var OntologyIdSchema = z.string().trim().min(1).max(300).regex(ONTOLOGY_ID_REGEX, "Ontology IDs must use <system-path>:<kind>/<local-id> or global:<kind>/<local-id>");
|
|
24
21
|
function parseOntologyId(id) {
|
|
25
22
|
const normalized = OntologyIdSchema.parse(id);
|
|
26
23
|
const match = ONTOLOGY_ID_REGEX.exec(normalized);
|
|
@@ -83,7 +80,7 @@ var OntologySharedPropertySchema = OntologyRecordBaseSchema.extend({
|
|
|
83
80
|
var OntologyGroupSchema = OntologyRecordBaseSchema.extend({
|
|
84
81
|
members: OntologyReferenceListSchema
|
|
85
82
|
});
|
|
86
|
-
var
|
|
83
|
+
var OntologyEndpointTypeSchema = OntologyRecordBaseSchema.extend({
|
|
87
84
|
route: z.string().trim().min(1).max(500).optional()
|
|
88
85
|
});
|
|
89
86
|
var OntologyScopeSchema = z.object({
|
|
@@ -96,7 +93,7 @@ var OntologyScopeSchema = z.object({
|
|
|
96
93
|
valueTypes: z.record(OntologyIdSchema, OntologyValueTypeSchema).default({}).optional(),
|
|
97
94
|
sharedProperties: z.record(OntologyIdSchema, OntologySharedPropertySchema).default({}).optional(),
|
|
98
95
|
groups: z.record(OntologyIdSchema, OntologyGroupSchema).default({}).optional(),
|
|
99
|
-
|
|
96
|
+
endpoints: z.record(OntologyIdSchema, OntologyEndpointTypeSchema).default({}).optional()
|
|
100
97
|
}).default({});
|
|
101
98
|
var DEFAULT_ONTOLOGY_SCOPE = {
|
|
102
99
|
valueTypes: {
|
|
@@ -132,7 +129,7 @@ var SCOPE_KIND = {
|
|
|
132
129
|
valueTypes: "value-type",
|
|
133
130
|
sharedProperties: "property",
|
|
134
131
|
groups: "group",
|
|
135
|
-
|
|
132
|
+
endpoints: "endpoint"
|
|
136
133
|
};
|
|
137
134
|
var SCOPE_KEYS = Object.keys(SCOPE_KIND);
|
|
138
135
|
function ontologyGraphNodeId(id) {
|
|
@@ -176,7 +173,7 @@ function createEmptyIndex() {
|
|
|
176
173
|
valueTypes: {},
|
|
177
174
|
sharedProperties: {},
|
|
178
175
|
groups: {},
|
|
179
|
-
|
|
176
|
+
endpoints: {}
|
|
180
177
|
};
|
|
181
178
|
}
|
|
182
179
|
function sortResolvedOntologyIndex(index) {
|
|
@@ -1101,8 +1098,6 @@ var SystemEntrySchema = z.object({
|
|
|
1101
1098
|
path: PathSchema.optional(),
|
|
1102
1099
|
/** @deprecated Use ui.icon. Kept for one-cycle Feature compatibility. */
|
|
1103
1100
|
icon: IconNameSchema.optional(),
|
|
1104
|
-
/** @deprecated Feature color token, retained for one-cycle compatibility. */
|
|
1105
|
-
color: ColorTokenSchema.optional(),
|
|
1106
1101
|
/** @deprecated UI placement hint, retained for one-cycle compatibility. */
|
|
1107
1102
|
uiPosition: UiPositionSchema.optional(),
|
|
1108
1103
|
/** @deprecated Use lifecycle. */
|
|
@@ -1205,7 +1200,7 @@ var ResourceOntologyBindingSchema = z.object({
|
|
|
1205
1200
|
/**
|
|
1206
1201
|
* Optional typed contract binding for this resource's workflow I/O.
|
|
1207
1202
|
* Each ref is a `package/subpath#ExportName` string that resolves to a
|
|
1208
|
-
* Zod schema in
|
|
1203
|
+
* Zod schema in the tenant-owned organization model package.
|
|
1209
1204
|
*
|
|
1210
1205
|
* Absence of this field preserves all existing behavior — it is additive + optional.
|
|
1211
1206
|
* Tier-1 validation (schema.ts): ref-string shape only (browser-safe, no imports).
|
|
@@ -1800,10 +1795,11 @@ var ONTOLOGY_REFERENCE_KEY_KINDS = {
|
|
|
1800
1795
|
interfaceType: "interface",
|
|
1801
1796
|
propertyType: "property",
|
|
1802
1797
|
groupType: "group",
|
|
1803
|
-
|
|
1798
|
+
endpointType: "endpoint",
|
|
1804
1799
|
stepCatalog: "catalog"
|
|
1805
1800
|
};
|
|
1806
|
-
|
|
1801
|
+
var omCompilationContextCache = /* @__PURE__ */ new WeakMap();
|
|
1802
|
+
function buildOmCrossRefIndexFromOntology(model, ontologyCompilation) {
|
|
1807
1803
|
const systemsById = /* @__PURE__ */ new Map();
|
|
1808
1804
|
for (const { path, system } of listAllSystems(model)) {
|
|
1809
1805
|
systemsById.set(path, system);
|
|
@@ -1817,7 +1813,6 @@ function buildOmCrossRefIndex(model) {
|
|
|
1817
1813
|
const actionIds = new Set(Object.keys(model.actions ?? {}));
|
|
1818
1814
|
const customerSegmentIds = new Set(Object.keys(model.customers ?? {}));
|
|
1819
1815
|
const offeringIds = new Set(Object.keys(model.offerings ?? {}));
|
|
1820
|
-
const ontologyCompilation = compileOrganizationOntology(model);
|
|
1821
1816
|
const ontologyIndexByKind = {
|
|
1822
1817
|
object: ontologyCompilation.ontology.objectTypes,
|
|
1823
1818
|
link: ontologyCompilation.ontology.linkTypes,
|
|
@@ -1828,7 +1823,7 @@ function buildOmCrossRefIndex(model) {
|
|
|
1828
1823
|
"value-type": ontologyCompilation.ontology.valueTypes,
|
|
1829
1824
|
property: ontologyCompilation.ontology.sharedProperties,
|
|
1830
1825
|
group: ontologyCompilation.ontology.groups,
|
|
1831
|
-
|
|
1826
|
+
endpoint: ontologyCompilation.ontology.endpoints
|
|
1832
1827
|
};
|
|
1833
1828
|
const ontologyIds = new Set(Object.values(ontologyIndexByKind).flatMap((index) => Object.keys(index)));
|
|
1834
1829
|
const stageIds = /* @__PURE__ */ new Set();
|
|
@@ -1856,6 +1851,15 @@ function buildOmCrossRefIndex(model) {
|
|
|
1856
1851
|
stageIds
|
|
1857
1852
|
};
|
|
1858
1853
|
}
|
|
1854
|
+
function buildOmCompilationContext(model) {
|
|
1855
|
+
const cached = omCompilationContextCache.get(model);
|
|
1856
|
+
if (cached !== void 0) return cached;
|
|
1857
|
+
const ontologyCompilation = compileOrganizationOntology(model);
|
|
1858
|
+
const crossRefIndex = buildOmCrossRefIndexFromOntology(model, ontologyCompilation);
|
|
1859
|
+
const context = { crossRefIndex, ontologyCompilation };
|
|
1860
|
+
omCompilationContextCache.set(model, context);
|
|
1861
|
+
return context;
|
|
1862
|
+
}
|
|
1859
1863
|
function knowledgeTargetExists(index, kind, id) {
|
|
1860
1864
|
if (kind === "system") return index.systemsById.has(id);
|
|
1861
1865
|
if (kind === "client") return index.clientIds.has(id);
|
|
@@ -2192,9 +2196,8 @@ function refineOrganizationModel(model, ctx) {
|
|
|
2192
2196
|
}
|
|
2193
2197
|
});
|
|
2194
2198
|
});
|
|
2195
|
-
const idx =
|
|
2199
|
+
const { crossRefIndex: idx, ontologyCompilation } = buildOmCompilationContext(model);
|
|
2196
2200
|
const { ontologyIndexByKind, ontologyIds } = idx;
|
|
2197
|
-
const ontologyCompilation = compileOrganizationOntology(model);
|
|
2198
2201
|
function topologyTargetExists(ref) {
|
|
2199
2202
|
if (ref.kind === "system") return systemsById.has(ref.id);
|
|
2200
2203
|
if (ref.kind === "resource") return resourcesById.has(ref.id);
|
|
@@ -3298,7 +3301,7 @@ function ontologyMapName(kind) {
|
|
|
3298
3301
|
"value-type": "valueTypes",
|
|
3299
3302
|
property: "sharedProperties",
|
|
3300
3303
|
group: "groups",
|
|
3301
|
-
|
|
3304
|
+
endpoint: "endpoints"
|
|
3302
3305
|
};
|
|
3303
3306
|
return map[kind];
|
|
3304
3307
|
}
|
|
@@ -3369,12 +3372,34 @@ Capture the durable operating knowledge here.
|
|
|
3369
3372
|
}
|
|
3370
3373
|
|
|
3371
3374
|
// src/organization-model/scaffolders/scaffoldOntologyRecord.ts
|
|
3375
|
+
function kindSpecificFields(spec) {
|
|
3376
|
+
if (spec.kind === "link") {
|
|
3377
|
+
return {
|
|
3378
|
+
from: makeOntologyId(spec.systemPath, "object", "source-object"),
|
|
3379
|
+
to: makeOntologyId(spec.systemPath, "object", "target-object")
|
|
3380
|
+
};
|
|
3381
|
+
}
|
|
3382
|
+
if (spec.kind === "action") {
|
|
3383
|
+
return { actsOn: [] };
|
|
3384
|
+
}
|
|
3385
|
+
if (spec.kind === "group") {
|
|
3386
|
+
return { members: [] };
|
|
3387
|
+
}
|
|
3388
|
+
return {};
|
|
3389
|
+
}
|
|
3372
3390
|
function scaffoldOntologyRecord(model, spec) {
|
|
3373
3391
|
assertSystemExists(model, spec.systemPath);
|
|
3374
3392
|
const localId = spec.localId ?? spec.id;
|
|
3375
3393
|
const ontologyId = makeOntologyId(spec.systemPath, spec.kind, localId);
|
|
3376
3394
|
const label = spec.label ?? titleize(localId);
|
|
3377
3395
|
const mapName = ontologyMapName(spec.kind);
|
|
3396
|
+
const snippetRecord = {
|
|
3397
|
+
id: ontologyId,
|
|
3398
|
+
label,
|
|
3399
|
+
ownerSystemId: spec.systemPath,
|
|
3400
|
+
...spec.description === void 0 ? {} : { description: spec.description },
|
|
3401
|
+
...kindSpecificFields(spec)
|
|
3402
|
+
};
|
|
3378
3403
|
return {
|
|
3379
3404
|
intent: "ontology",
|
|
3380
3405
|
id: ontologyId,
|
|
@@ -3384,12 +3409,7 @@ function scaffoldOntologyRecord(model, spec) {
|
|
|
3384
3409
|
{
|
|
3385
3410
|
path: "packages/elevasis-core/src/organization-model/systems.ts",
|
|
3386
3411
|
description: `Add this record under ${spec.systemPath}.ontology.${mapName}.`,
|
|
3387
|
-
snippet: `${JSON.stringify(ontologyId)}: {
|
|
3388
|
-
id: ${JSON.stringify(ontologyId)},
|
|
3389
|
-
label: ${JSON.stringify(label)},
|
|
3390
|
-
ownerSystemId: ${JSON.stringify(spec.systemPath)}${spec.description === void 0 ? "" : `,
|
|
3391
|
-
description: ${JSON.stringify(spec.description)}`}
|
|
3392
|
-
}`
|
|
3412
|
+
snippet: `${JSON.stringify(ontologyId)}: ${JSON.stringify(snippetRecord, null, 2)}`
|
|
3393
3413
|
}
|
|
3394
3414
|
],
|
|
3395
3415
|
warnings: [],
|
|
@@ -3503,9 +3523,8 @@ function scaffoldSystem(model, spec) {
|
|
|
3503
3523
|
content: `import type { SystemModule } from '@repo/ui'
|
|
3504
3524
|
|
|
3505
3525
|
export const ${featureSlug.replaceAll("-", "_")}Manifest: SystemModule = {
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
routes: []
|
|
3526
|
+
key: ${JSON.stringify(featureSlug)},
|
|
3527
|
+
systemId: ${JSON.stringify(systemPath)}
|
|
3509
3528
|
}
|
|
3510
3529
|
`
|
|
3511
3530
|
},
|
|
@@ -3581,4 +3600,4 @@ function scaffoldOrganizationModel(model, spec) {
|
|
|
3581
3600
|
return scaffoldKnowledgeNode(model, spec);
|
|
3582
3601
|
}
|
|
3583
3602
|
|
|
3584
|
-
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, ClientProfileBrandingSchema, ClientProfileIdentitySchema, ClientProfileLinksSchema, ClientProfilePromptsSchema, ClientProfileSchema, ClientProfileSourceSchema, ClientProfileStatusSchema, ClientProfileWorkspaceSchema, ClientProfilesDomainSchema, CodeReferenceRoleSchema, CodeReferenceSchema, ContractRefSchema, CustomerSegmentSchema, CustomersDomainSchema, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA, DEFAULT_ORGANIZATION_MODEL_GOALS, DEFAULT_ORGANIZATION_MODEL_NAVIGATION, DEFAULT_ORGANIZATION_MODEL_OFFERINGS, DEFAULT_ORGANIZATION_MODEL_POLICIES, DEFAULT_ORGANIZATION_MODEL_RESOURCES, DEFAULT_ORGANIZATION_MODEL_ROLES, DEFAULT_ORGANIZATION_MODEL_STATUSES, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DEFAULT_ORGANIZATION_MODEL_TOPOLOGY, EntitiesDomainSchema, EntityIdSchema, EntityLinkKindSchema, EntityLinkSchema, EntitySchema, EventDescriptorSchema, EventEmissionDescriptorSchema, EventIdSchema, FirmographicsSchema, GoalsDomainSchema, HumanRoleHolderSchema, IconNameSchema, IntegrationResourceEntrySchema, KNOWLEDGE_FEATURE_ID, KNOWLEDGE_SYSTEM_ID, KeyResultSchema, KnowledgeDomainSchema, KnowledgeLinkSchema, KnowledgeTargetKindSchema, KnowledgeTargetRefSchema, LinkSchema, MONITORING_FEATURE_ID, MONITORING_SYSTEM_ID, McpToolInvocationSchema, NavigationGroupSchema, NodeIdPathSchema, NodeIdStringSchema, OPERATIONS_COMMAND_VIEW_SURFACE_ID, OPERATIONS_FEATURE_ID, OPERATIONS_SYSTEM_ID, ORGANIZATION_MODEL_ICON_TOKENS, ObjectiveSchema, OfferingsDomainSchema, OmTopologyDomainSchema, OmTopologyMetadataSchema, OmTopologyNodeKindSchema, OmTopologyNodeRefSchema, OmTopologyRelationshipKindSchema, OmTopologyRelationshipSchema, OmTopologySystemInterfaceGrantMetadataSchema, OmTopologySystemInterfaceGrantSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEventTypeSchema, OntologyGroupSchema, OntologyIdSchema, OntologyInterfaceTypeSchema, OntologyKindSchema, OntologyLinkTypeSchema, OntologyObjectTypeSchema, OntologyScopeSchema, OntologySharedPropertySchema,
|
|
3603
|
+
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, ClientProfileBrandingSchema, ClientProfileIdentitySchema, ClientProfileLinksSchema, ClientProfilePromptsSchema, ClientProfileSchema, ClientProfileSourceSchema, ClientProfileStatusSchema, ClientProfileWorkspaceSchema, ClientProfilesDomainSchema, CodeReferenceRoleSchema, CodeReferenceSchema, ContractRefSchema, CustomerSegmentSchema, CustomersDomainSchema, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA, DEFAULT_ORGANIZATION_MODEL_GOALS, DEFAULT_ORGANIZATION_MODEL_NAVIGATION, DEFAULT_ORGANIZATION_MODEL_OFFERINGS, DEFAULT_ORGANIZATION_MODEL_POLICIES, DEFAULT_ORGANIZATION_MODEL_RESOURCES, DEFAULT_ORGANIZATION_MODEL_ROLES, DEFAULT_ORGANIZATION_MODEL_STATUSES, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DEFAULT_ORGANIZATION_MODEL_TOPOLOGY, EntitiesDomainSchema, EntityIdSchema, EntityLinkKindSchema, EntityLinkSchema, EntitySchema, EventDescriptorSchema, EventEmissionDescriptorSchema, EventIdSchema, FirmographicsSchema, GoalsDomainSchema, HumanRoleHolderSchema, IconNameSchema, IntegrationResourceEntrySchema, KNOWLEDGE_FEATURE_ID, KNOWLEDGE_SYSTEM_ID, KeyResultSchema, KnowledgeDomainSchema, KnowledgeLinkSchema, KnowledgeTargetKindSchema, KnowledgeTargetRefSchema, LinkSchema, MONITORING_FEATURE_ID, MONITORING_SYSTEM_ID, McpToolInvocationSchema, NavigationGroupSchema, NodeIdPathSchema, NodeIdStringSchema, OPERATIONS_COMMAND_VIEW_SURFACE_ID, OPERATIONS_FEATURE_ID, OPERATIONS_SYSTEM_ID, ORGANIZATION_MODEL_ICON_TOKENS, ObjectiveSchema, OfferingsDomainSchema, OmTopologyDomainSchema, OmTopologyMetadataSchema, OmTopologyNodeKindSchema, OmTopologyNodeRefSchema, OmTopologyRelationshipKindSchema, OmTopologyRelationshipSchema, OmTopologySystemInterfaceGrantMetadataSchema, OmTopologySystemInterfaceGrantSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEndpointTypeSchema, OntologyEventTypeSchema, OntologyGroupSchema, OntologyIdSchema, OntologyInterfaceTypeSchema, OntologyKindSchema, OntologyLinkTypeSchema, OntologyObjectTypeSchema, OntologyScopeSchema, OntologySharedPropertySchema, OntologyValueTypeSchema, OrgKnowledgeKindSchema, OrgKnowledgeNodeSchema, OrganizationModelBuiltinIconTokenSchema, OrganizationModelDomainKeySchema, OrganizationModelDomainMetadataByDomainSchema, OrganizationModelDomainMetadataSchema, OrganizationModelIconTokenSchema, OrganizationModelNavigationSchema, OrganizationModelSchema, PROJECTS_FEATURE_ID, PROJECTS_INDEX_SURFACE_ID, PROJECTS_SYSTEM_ID, PROJECTS_VIEW_ACTION_ID, PROSPECTING_FEATURE_ID, PROSPECTING_LISTS_SURFACE_ID, PROSPECTING_SYSTEM_ID, PoliciesDomainSchema, PolicyApplicabilitySchema, PolicyEffectSchema, PolicyIdSchema, PolicyPredicateSchema, PolicySchema, PolicyTriggerSchema, PricingModelSchema, ProductSchema, ResourceEntrySchema, ResourceGovernanceStatusSchema, ResourceIdSchema, ResourceKindSchema, ResourceOntologyBindingSchema, ResourcesDomainSchema, RoleHolderSchema, RoleHoldersSchema, RoleIdSchema, RoleSchema, RolesDomainSchema, SALES_FEATURE_ID, SALES_PIPELINE_SURFACE_ID, SALES_SYSTEM_ID, SEO_FEATURE_ID, SEO_SYSTEM_ID, SETTINGS_FEATURE_ID, SETTINGS_ROLES_SURFACE_ID, SETTINGS_SYSTEM_ID, SYSTEM_INTERFACE_PROFILES, SYSTEM_INTERFACE_READINESS_PROFILES, ScriptExecutionInvocationSchema, ScriptResourceEntrySchema, ScriptResourceLanguageSchema, ScriptResourceSourceSchema, SidebarNavigationSchema, SidebarNodeSchema, SidebarSectionSchema, SidebarSurfaceTargetsSchema, SlashCommandInvocationSchema, StatusEntrySchema, StatusSemanticClassSchema, StatusesDomainSchema, SurfaceDefinitionSchema, SurfaceTypeSchema, SystemApiInterfaceSchema, SystemEntrySchema, SystemIdSchema, SystemInterfaceKeySchema, SystemInterfaceLifecycleSchema, SystemInterfaceReadinessProfileSchema, SystemInterfaceRefSchema, SystemKindSchema, SystemLifecycleSchema, SystemPathSchema, SystemStatusSchema, SystemUiSchema, SystemsDomainSchema, TeamRoleHolderSchema, TechStackEntrySchema, TopbarActionNodeSchema, TopbarSectionSchema, UiPositionSchema, WorkflowResourceEntrySchema, compileOrganizationOntology, compileTopologyNodeRef, createFoundationOrganizationModel, defineAction, defineActions, defineCustomer, defineCustomers, defineDomainRecord, defineEntities, defineEntity, defineGoal, defineGoals, defineKnowledgeNode, defineKnowledgeNodes, defineOffering, defineOfferings, defineOrganizationModel, definePolicies, definePolicy, defineResource, defineResourceOntology, defineResources, defineRole, defineRoles, defineStatus, defineStatuses, defineSystem, defineSystems, defineTopology, defineTopologyRelationship, findOrganizationActionById, formatOntologyId, getClientProfile, getClientProfileBySlug, getOntologyDiagnostics, getSortedSidebarEntries, isOntologyGraphNodeId, isOntologyTopologyRef, listAllSystems, listClientProfiles, listResolvedOntologyRecords, ontologyGraphNodeId, ontologyIdFromGraphNodeId, parseContractRef, parseOntologyId, parseTopologyNodeRef, projectOrganizationSurfaces, resolveOrganizationModel, resolveOrganizationModelWithResources, scaffoldOrganizationModel, topologyRef, topologyRelationship, validateOrganizationSurfaceProjection };
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z, ZodType } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const ActionInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4
|
+
kind: z.ZodLiteral<"slash-command">;
|
|
5
|
+
command: z.ZodString;
|
|
6
|
+
toolFactory: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
kind: z.ZodLiteral<"mcp-tool">;
|
|
9
|
+
server: z.ZodString;
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
|
+
kind: z.ZodLiteral<"api-endpoint">;
|
|
13
|
+
method: z.ZodEnum<{
|
|
14
|
+
GET: "GET";
|
|
15
|
+
POST: "POST";
|
|
16
|
+
PATCH: "PATCH";
|
|
17
|
+
DELETE: "DELETE";
|
|
18
|
+
}>;
|
|
19
|
+
path: z.ZodString;
|
|
20
|
+
requestSchema: z.ZodOptional<z.ZodString>;
|
|
21
|
+
responseSchema: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
+
kind: z.ZodLiteral<"script-execution">;
|
|
24
|
+
resourceId: z.ZodString;
|
|
25
|
+
}, z.core.$strip>], "kind">;
|
|
2
26
|
|
|
3
27
|
declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
|
|
4
28
|
objectTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -83,7 +107,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
|
|
|
83
107
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
84
108
|
members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
85
109
|
}, z.core.$loose>>>>;
|
|
86
|
-
|
|
110
|
+
endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
87
111
|
id: z.ZodString;
|
|
88
112
|
label: z.ZodOptional<z.ZodString>;
|
|
89
113
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -142,7 +166,6 @@ interface SystemEntry {
|
|
|
142
166
|
status?: 'active' | 'deprecated' | 'archived';
|
|
143
167
|
path?: string;
|
|
144
168
|
icon?: string;
|
|
145
|
-
color?: string;
|
|
146
169
|
uiPosition?: 'sidebar-primary' | 'sidebar-bottom';
|
|
147
170
|
enabled?: boolean;
|
|
148
171
|
devOnly?: boolean;
|
|
@@ -153,6 +176,7 @@ interface SystemEntry {
|
|
|
153
176
|
systems?: Record<string, SystemEntry>;
|
|
154
177
|
subsystems?: Record<string, SystemEntry>;
|
|
155
178
|
}
|
|
179
|
+
declare const SystemEntrySchema: ZodType<SystemEntry>;
|
|
156
180
|
|
|
157
181
|
declare const SurfaceTypeSchema: z.ZodEnum<{
|
|
158
182
|
dashboard: "dashboard";
|
|
@@ -373,6 +397,25 @@ declare const OrganizationModelIconTokenSchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
|
373
397
|
}>, z.ZodString]>;
|
|
374
398
|
type OrganizationModelIconToken = z.infer<typeof OrganizationModelIconTokenSchema>;
|
|
375
399
|
|
|
400
|
+
/**
|
|
401
|
+
* SystemEntry extended with the recursive tree slots (`systems`, `subsystems`).
|
|
402
|
+
* `OrganizationModelSystemEntry` is inferred from `SystemEntrySchema: ZodType<SystemEntry>`
|
|
403
|
+
* so it already carries these fields; this alias re-exports it under the tree-walker name
|
|
404
|
+
* for clarity at call sites.
|
|
405
|
+
*/
|
|
406
|
+
type SystemEntryWithTree = OrganizationModelSystemEntry;
|
|
407
|
+
/**
|
|
408
|
+
* Flat depth-first enumeration of every system in the model tree.
|
|
409
|
+
* Each entry carries the computed full path and the system node.
|
|
410
|
+
* Order: parent before children (pre-order DFS).
|
|
411
|
+
*
|
|
412
|
+
* Example result paths: `'sales'`, `'sales.crm'`, `'sales.crm.dispositions'`
|
|
413
|
+
*/
|
|
414
|
+
declare function listAllSystems(model: OrganizationModel): Array<{
|
|
415
|
+
path: string;
|
|
416
|
+
system: SystemEntryWithTree;
|
|
417
|
+
}>;
|
|
418
|
+
|
|
376
419
|
declare const OrganizationModelSchema: z.ZodObject<{
|
|
377
420
|
version: z.ZodDefault<z.ZodLiteral<1>>;
|
|
378
421
|
snapshotHash: z.ZodOptional<z.ZodString>;
|
|
@@ -909,7 +952,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
909
952
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
910
953
|
members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
911
954
|
}, z.core.$loose>>>>;
|
|
912
|
-
|
|
955
|
+
endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
913
956
|
id: z.ZodString;
|
|
914
957
|
label: z.ZodOptional<z.ZodString>;
|
|
915
958
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1436,6 +1479,8 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
1436
1479
|
}, z.core.$strip>;
|
|
1437
1480
|
|
|
1438
1481
|
type OrganizationModel = z.infer<typeof OrganizationModelSchema>;
|
|
1482
|
+
type OrganizationModelSystemEntry = z.infer<typeof SystemEntrySchema>;
|
|
1483
|
+
type OrganizationModelActionInvocation = z.infer<typeof ActionInvocationSchema>;
|
|
1439
1484
|
|
|
1440
1485
|
/**
|
|
1441
1486
|
* Command View Types
|
|
@@ -1531,6 +1576,26 @@ declare function governs(graph: OrganizationGraph, nodeId: string): string[];
|
|
|
1531
1576
|
* @returns Array of source graph node IDs (e.g. `['knowledge:knowledge.outreach-playbook', ...]`).
|
|
1532
1577
|
*/
|
|
1533
1578
|
declare function governedBy(graph: OrganizationGraph, nodeId: string): string[];
|
|
1579
|
+
/**
|
|
1580
|
+
* Returns all systems flattened from the recursive OM tree via `listAllSystems`.
|
|
1581
|
+
*
|
|
1582
|
+
* Each entry is `{ path, system }` — the same shape produced by `listAllSystems`.
|
|
1583
|
+
*
|
|
1584
|
+
* @param model - The resolved OrganizationModel.
|
|
1585
|
+
*/
|
|
1586
|
+
declare function listAllSystemsFlat(model: OrganizationModel): ReturnType<typeof listAllSystems>;
|
|
1587
|
+
/**
|
|
1588
|
+
* Returns every resource from the model as a flat array, sorted by id.
|
|
1589
|
+
*
|
|
1590
|
+
* @param model - The resolved OrganizationModel.
|
|
1591
|
+
*/
|
|
1592
|
+
declare function listAllResources(model: OrganizationModel): NonNullable<OrganizationModel['resources']>[string][];
|
|
1593
|
+
/**
|
|
1594
|
+
* Returns every role from the model as a flat array, sorted by id.
|
|
1595
|
+
*
|
|
1596
|
+
* @param model - The resolved OrganizationModel.
|
|
1597
|
+
*/
|
|
1598
|
+
declare function listAllRoles(model: OrganizationModel): NonNullable<OrganizationModel['roles']>[string][];
|
|
1534
1599
|
/** The recognized mount axes for Knowledge Map paths. */
|
|
1535
1600
|
type KnowledgeMount = 'by-system' | 'by-ontology' | 'by-kind' | 'by-owner' | 'graph' | 'node' | 'all-systems' | 'all-resources' | 'all-roles';
|
|
1536
1601
|
/**
|
|
@@ -1653,5 +1718,28 @@ declare function formatJson(input: {
|
|
|
1653
1718
|
*/
|
|
1654
1719
|
declare function formatIdsOnly(results: OrgKnowledgeNode[] | string[] | OmSearchHit[]): string;
|
|
1655
1720
|
|
|
1656
|
-
|
|
1657
|
-
|
|
1721
|
+
declare const OM_SEARCH_HIT_KINDS: OmSearchHitKind[];
|
|
1722
|
+
declare function parseKnowledgeSearchLimit(raw: string | undefined, commandName?: string): number;
|
|
1723
|
+
declare function parseKnowledgeSearchKinds(raw: string | undefined, commandName?: string): OmSearchHitKind[] | undefined;
|
|
1724
|
+
declare function formatKnowledgeSystemsList(entries: ReturnType<typeof listAllSystemsFlat>): string;
|
|
1725
|
+
declare function formatKnowledgeResourcesList(resources: ReturnType<typeof listAllResources>): string;
|
|
1726
|
+
declare function formatKnowledgeRolesList(roles: ReturnType<typeof listAllRoles>): string;
|
|
1727
|
+
interface KnowledgeInvocationSource {
|
|
1728
|
+
kind: 'action' | 'agent-resource';
|
|
1729
|
+
id: string;
|
|
1730
|
+
label: string;
|
|
1731
|
+
targetNodeId: string;
|
|
1732
|
+
invocations: OrganizationModelActionInvocation[];
|
|
1733
|
+
}
|
|
1734
|
+
interface KnowledgeInvocationNeighborsResult {
|
|
1735
|
+
id: string;
|
|
1736
|
+
title: string;
|
|
1737
|
+
invocationSources: KnowledgeInvocationSource[];
|
|
1738
|
+
}
|
|
1739
|
+
declare function normalizeKnowledgeNodeId(id: string): string;
|
|
1740
|
+
declare function formatKnowledgeInvocationLabel(invocation: OrganizationModelActionInvocation): string;
|
|
1741
|
+
declare function resolveKnowledgeInvocationNeighbors(model: OrganizationModel, id: string): KnowledgeInvocationNeighborsResult | undefined;
|
|
1742
|
+
declare function formatKnowledgeInvocationNeighbors(result: KnowledgeInvocationNeighborsResult): string;
|
|
1743
|
+
|
|
1744
|
+
export { OM_SEARCH_HIT_KINDS, byKind, byOwner, bySystem, formatIdsOnly, formatJson, formatKnowledgeInvocationLabel, formatKnowledgeInvocationNeighbors, formatKnowledgeResourcesList, formatKnowledgeRolesList, formatKnowledgeSystemsList, formatText, governedBy, governs, normalizeKnowledgeNodeId, parseKnowledgeSearchKinds, parseKnowledgeSearchLimit, parsePath, resolveKnowledgeInvocationNeighbors };
|
|
1745
|
+
export type { KnowledgeInvocationNeighborsResult, KnowledgeInvocationSource, KnowledgeJsonEnvelope, KnowledgeMount, OmSearchHitKind, ParsedKnowledgePath };
|