@elevasis/core 0.24.1 → 0.25.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 (32) hide show
  1. package/dist/index.d.ts +75 -3
  2. package/dist/index.js +332 -4
  3. package/dist/knowledge/index.d.ts +30 -1
  4. package/dist/organization-model/index.d.ts +75 -3
  5. package/dist/organization-model/index.js +332 -4
  6. package/dist/test-utils/index.d.ts +1 -0
  7. package/dist/test-utils/index.js +4 -3
  8. package/package.json +1 -1
  9. package/src/_gen/__tests__/__snapshots__/contracts.md.snap +94 -94
  10. package/src/execution/engine/llm/adapters/__tests__/openrouter.integration.test.ts +10 -10
  11. package/src/knowledge/__tests__/queries.test.ts +960 -546
  12. package/src/knowledge/format.ts +322 -100
  13. package/src/knowledge/index.ts +18 -5
  14. package/src/knowledge/queries.ts +1004 -239
  15. package/src/organization-model/__tests__/deprecate-helpers.test.ts +71 -0
  16. package/src/organization-model/__tests__/resolve.test.ts +9 -7
  17. package/src/organization-model/__tests__/scaffolders.test.ts +93 -0
  18. package/src/organization-model/defaults.ts +3 -3
  19. package/src/organization-model/helpers.ts +76 -9
  20. package/src/organization-model/icons.ts +1 -0
  21. package/src/organization-model/index.ts +3 -2
  22. package/src/organization-model/published.ts +15 -2
  23. package/src/organization-model/scaffolders/helpers.ts +84 -0
  24. package/src/organization-model/scaffolders/index.ts +19 -0
  25. package/src/organization-model/scaffolders/scaffoldKnowledgeNode.ts +48 -0
  26. package/src/organization-model/scaffolders/scaffoldOntologyRecord.ts +38 -0
  27. package/src/organization-model/scaffolders/scaffoldResource.ts +59 -0
  28. package/src/organization-model/scaffolders/scaffoldSystem.ts +110 -0
  29. package/src/organization-model/scaffolders/types.ts +81 -0
  30. package/src/platform/constants/versions.ts +1 -1
  31. package/src/reference/_generated/contracts.md +94 -94
  32. package/src/reference/glossary.md +71 -69
@@ -634,8 +634,8 @@ export type DeepPartial<T> =
634
634
  ### `ElevasisOrganizationModel`
635
635
 
636
636
  ```typescript
637
- export type ElevasisOrganizationModel = Omit<OrganizationModel, 'knowledge'> & {
638
- knowledge?: OrganizationModel['knowledge']
637
+ export type ElevasisOrganizationModel = Omit<OrganizationModel, 'knowledge'> & {
638
+ knowledge?: OrganizationModel['knowledge']
639
639
  }
640
640
  ```
641
641
 
@@ -660,107 +660,107 @@ export type SystemSidebarWidthResolver = number | ((context: { currentPath: stri
660
660
  ### `SystemModule`
661
661
 
662
662
  ```typescript
663
- export interface SystemModule {
664
- /** Unique stable identifier for this UI system module. */
665
- key: string
666
- /** Organization Model system id this module presents. Omit for navigation-only app surfaces. */
667
- systemId?: string
668
- /** Route prefixes owned by navigation-only app surfaces. */
669
- routePrefixes?: string[]
670
- /** Capability identifiers contributed by this system module. */
671
- capabilityIds?: string[]
672
- /** Icon used when this system node appears in shell navigation. */
673
- icon?: SystemIconComponent
674
- /** Sidebar component rendered when this system's subtree route is active. */
675
- sidebar?: SystemSidebarComponent
676
- /** Optional shell sidebar width override. Defaults to 250px. */
677
- sidebarWidth?: SystemSidebarWidthResolver
678
- /** Operations-only bridge connecting this system to the organization graph node. */
679
- organizationGraph?: OrganizationGraphSystemBridge
663
+ export interface SystemModule {
664
+ /** Unique stable identifier for this UI system module. */
665
+ key: string
666
+ /** Organization Model system id this module presents. Omit for navigation-only app surfaces. */
667
+ systemId?: string
668
+ /** Route prefixes owned by navigation-only app surfaces. */
669
+ routePrefixes?: string[]
670
+ /** Capability identifiers contributed by this system module. */
671
+ capabilityIds?: string[]
672
+ /** Icon used when this system node appears in shell navigation. */
673
+ icon?: SystemIconComponent
674
+ /** Sidebar component rendered when this system's subtree route is active. */
675
+ sidebar?: SystemSidebarComponent
676
+ /** Optional shell sidebar width override. Defaults to 250px. */
677
+ sidebarWidth?: SystemSidebarWidthResolver
678
+ /** Operations-only bridge connecting this system to the organization graph node. */
679
+ organizationGraph?: OrganizationGraphSystemBridge
680
680
  }
681
681
  ```
682
682
 
683
683
  ### `ResolvedSystemAccess`
684
684
 
685
685
  ```typescript
686
- export interface ResolvedSystemAccess {
687
- featureKey: string
688
- systemId?: string
689
- enabled: boolean
686
+ export interface ResolvedSystemAccess {
687
+ systemKey: string
688
+ systemId?: string
689
+ enabled: boolean
690
690
  }
691
691
  ```
692
692
 
693
693
  ### `ResolvedSystemSemantics`
694
694
 
695
695
  ```typescript
696
- export interface ResolvedSystemSemantics {
697
- capabilityIds: string[]
696
+ export interface ResolvedSystemSemantics {
697
+ capabilityIds: string[]
698
698
  }
699
699
  ```
700
700
 
701
701
  ### `ResolvedSystemModule`
702
702
 
703
703
  ```typescript
704
- export interface ResolvedSystemModule extends SystemModule {
705
- access: ResolvedSystemAccess
706
- semantics: ResolvedSystemSemantics
704
+ export interface ResolvedSystemModule extends SystemModule {
705
+ access: ResolvedSystemAccess
706
+ semantics: ResolvedSystemSemantics
707
707
  }
708
708
  ```
709
709
 
710
710
  ### `ResolvedShellSystem`
711
711
 
712
712
  ```typescript
713
- export type ResolvedShellSystem = OrganizationModelSystemEntry & {
714
- label: string
715
- iconComponent?: SystemIconComponent
713
+ export type ResolvedShellSystem = OrganizationModelSystemEntry & {
714
+ label: string
715
+ iconComponent?: SystemIconComponent
716
716
  }
717
717
  ```
718
718
 
719
719
  ### `ResolvedShellModel`
720
720
 
721
721
  ```typescript
722
- export interface ResolvedShellModel {
723
- systems: readonly ResolvedShellSystem[]
724
- findByPath: (path: string) => ResolvedShellSystem | undefined
725
- findById: (id: string) => ResolvedShellSystem | undefined
726
- childrenOf: (id: string) => ResolvedShellSystem[]
727
- ancestorsOf: (id: string) => ResolvedShellSystem[]
728
- parentOf: (id: string) => ResolvedShellSystem | undefined
729
- topLevel: () => ResolvedShellSystem[]
730
- requiresAdminFor: (id: string) => boolean
731
- devOnlyFor: (id: string) => boolean
722
+ export interface ResolvedShellModel {
723
+ systems: readonly ResolvedShellSystem[]
724
+ findByPath: (path: string) => ResolvedShellSystem | undefined
725
+ findById: (id: string) => ResolvedShellSystem | undefined
726
+ childrenOf: (id: string) => ResolvedShellSystem[]
727
+ ancestorsOf: (id: string) => ResolvedShellSystem[]
728
+ parentOf: (id: string) => ResolvedShellSystem | undefined
729
+ topLevel: () => ResolvedShellSystem[]
730
+ requiresAdminFor: (id: string) => boolean
731
+ devOnlyFor: (id: string) => boolean
732
732
  }
733
733
  ```
734
734
 
735
735
  ### `ShellSidebarLinkItem`
736
736
 
737
737
  ```typescript
738
- export interface ShellSidebarLinkItem {
739
- label: string
740
- link: string
741
- exact?: boolean
742
- activeMatchPaths?: string[]
738
+ export interface ShellSidebarLinkItem {
739
+ label: string
740
+ link: string
741
+ exact?: boolean
742
+ activeMatchPaths?: string[]
743
743
  }
744
744
  ```
745
745
 
746
746
  ### `ShellSidebarLinkGroup`
747
747
 
748
748
  ```typescript
749
- export interface ShellSidebarLinkGroup {
750
- icon: SystemIconComponent
751
- label: string
752
- links?: ShellSidebarLinkItem[]
753
- link?: string
749
+ export interface ShellSidebarLinkGroup {
750
+ icon: SystemIconComponent
751
+ label: string
752
+ links?: ShellSidebarLinkItem[]
753
+ link?: string
754
754
  }
755
755
  ```
756
756
 
757
757
  ### `ShellSidebarProjectionOptions`
758
758
 
759
759
  ```typescript
760
- export interface ShellSidebarProjectionOptions {
761
- isPlatformAdmin?: boolean
762
- isDev?: boolean
763
- section?: 'primary' | 'bottom'
760
+ export interface ShellSidebarProjectionOptions {
761
+ isPlatformAdmin?: boolean
762
+ isDev?: boolean
763
+ section?: 'primary' | 'bottom'
764
764
  }
765
765
  ```
766
766
 
@@ -773,75 +773,75 @@ export type ShellRouteMatchStatus = 'matched' | 'hidden' | 'unmatched'
773
773
  ### `ResolvedShellRouteMatch`
774
774
 
775
775
  ```typescript
776
- export interface ResolvedShellRouteMatch {
777
- status: ShellRouteMatchStatus
778
- path: string
779
- system?: ResolvedSystemModule
780
- node?: ResolvedShellSystem
776
+ export interface ResolvedShellRouteMatch {
777
+ status: ShellRouteMatchStatus
778
+ path: string
779
+ system?: ResolvedSystemModule
780
+ node?: ResolvedShellSystem
781
781
  }
782
782
  ```
783
783
 
784
784
  ### `ShellRuntime`
785
785
 
786
786
  ```typescript
787
- export interface ShellRuntime {
788
- resolveRoute: (path: string) => ResolvedShellRouteMatch
787
+ export interface ShellRuntime {
788
+ resolveRoute: (path: string) => ResolvedShellRouteMatch
789
789
  }
790
790
  ```
791
791
 
792
792
  ### `OrganizationGraphSystemBridge`
793
793
 
794
794
  ```typescript
795
- export interface OrganizationGraphSystemBridge {
796
- systemId?: string
795
+ export interface OrganizationGraphSystemBridge {
796
+ systemId?: string
797
797
  }
798
798
  ```
799
799
 
800
800
  ### `OrganizationGraphContextValue`
801
801
 
802
802
  ```typescript
803
- export interface OrganizationGraphContextValue {
804
- available: boolean
805
- systemId?: string
806
- systemPath?: string
803
+ export interface OrganizationGraphContextValue {
804
+ available: boolean
805
+ systemId?: string
806
+ systemPath?: string
807
807
  }
808
808
  ```
809
809
 
810
810
  ### `ElevasisSystemsProviderProps`
811
811
 
812
812
  ```typescript
813
- export interface ElevasisSystemsProviderProps {
814
- systems?: SystemModule[]
815
- organizationModel?: ElevasisOrganizationModel
816
- timeRange?: TimeRange
817
- operationsApiUrl?: string
818
- operationsSSEManager?: SSEConnectionManagerLike
819
- deliveryApiUrl?: string
820
- deliverySSEManager?: SSEConnectionManagerLike
821
- disabledSubsectionPaths?: string[]
822
- children: ReactNode
813
+ export interface ElevasisSystemsProviderProps {
814
+ systems?: SystemModule[]
815
+ organizationModel?: ElevasisOrganizationModel
816
+ timeRange?: TimeRange
817
+ operationsApiUrl?: string
818
+ operationsSSEManager?: SSEConnectionManagerLike
819
+ deliveryApiUrl?: string
820
+ deliverySSEManager?: SSEConnectionManagerLike
821
+ disabledSubsectionPaths?: string[]
822
+ children: ReactNode
823
823
  }
824
824
  ```
825
825
 
826
826
  ### `ElevasisSystemsContextValue`
827
827
 
828
828
  ```typescript
829
- export interface ElevasisSystemsContextValue {
830
- shellModel: ResolvedShellModel
831
- shellRuntime: ShellRuntime
832
- getSidebarLinks: (options?: ShellSidebarProjectionOptions) => ShellSidebarLinkGroup[]
833
- enabledResolvedSystems: ResolvedSystemModule[]
834
- resolvedSystems: ResolvedSystemModule[]
835
- organizationGraph: OrganizationGraphContextValue
836
- organizationModel?: OrganizationModel
837
- timeRange?: TimeRange
838
- operationsApiUrl?: string
839
- operationsSSEManager?: SSEConnectionManagerLike
840
- deliveryApiUrl?: string
841
- deliverySSEManager?: SSEConnectionManagerLike
842
- disabledSubsectionPaths: string[]
843
- isSystemEnabled: (key: string) => boolean
844
- getResolvedSystem: (key: string) => ResolvedSystemModule | undefined
829
+ export interface ElevasisSystemsContextValue {
830
+ shellModel: ResolvedShellModel
831
+ shellRuntime: ShellRuntime
832
+ getSidebarLinks: (options?: ShellSidebarProjectionOptions) => ShellSidebarLinkGroup[]
833
+ enabledResolvedSystems: ResolvedSystemModule[]
834
+ resolvedSystems: ResolvedSystemModule[]
835
+ organizationGraph: OrganizationGraphContextValue
836
+ organizationModel?: OrganizationModel
837
+ timeRange?: TimeRange
838
+ operationsApiUrl?: string
839
+ operationsSSEManager?: SSEConnectionManagerLike
840
+ deliveryApiUrl?: string
841
+ deliverySSEManager?: SSEConnectionManagerLike
842
+ disabledSubsectionPaths: string[]
843
+ isSystemEnabled: (key: string) => boolean
844
+ getResolvedSystem: (key: string) => ResolvedSystemModule | undefined
845
845
  }
846
846
  ```
847
847
 
@@ -20,8 +20,8 @@ import { createLLMAdapter } from '../server/adapter-factory'
20
20
  import type { ModelConfig } from '../../model-info'
21
21
  import type { LLMGenerateRequest } from '../../types'
22
22
 
23
- // Skip if OPENROUTER_API_KEY not available
24
- const SKIP_TESTS = !process.env.OPENROUTER_API_KEY
23
+ // Skip by default: real OpenRouter model behavior can change independently of this repo.
24
+ const SKIP_TESTS = process.env.RUN_OPENROUTER_INTEGRATION !== 'true' || !process.env.OPENROUTER_API_KEY
25
25
 
26
26
  describe.skipIf(SKIP_TESTS)('OpenRouter Adapter Integration', () => {
27
27
  let apiKey: string
@@ -47,14 +47,14 @@ describe.skipIf(SKIP_TESTS)('OpenRouter Adapter Integration', () => {
47
47
  maxOutputTokens: 500
48
48
  })
49
49
 
50
- describe('Grok via OpenRouter', () => {
51
- it('generates structured output with accurate token counts', async () => {
52
- const config: ModelConfig = {
53
- provider: 'openrouter',
54
- model: 'openrouter/x-ai/grok-4.1-fast',
55
- apiKey,
56
- temperature: 0.7,
57
- maxOutputTokens: 500
50
+ describe('OpenRouter hosted model', () => {
51
+ it('generates structured output with accurate token counts', async () => {
52
+ const config: ModelConfig = {
53
+ provider: 'openrouter',
54
+ model: 'openrouter/z-ai/glm-5',
55
+ apiKey,
56
+ temperature: 0.7,
57
+ maxOutputTokens: 500
58
58
  }
59
59
 
60
60
  const adapter = createLLMAdapter(config)