@kanonak-protocol/types 1.1.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 (94) hide show
  1. package/README.md +33 -0
  2. package/dist/ctl/models/enums.d.ts +58 -0
  3. package/dist/ctl/models/enums.js +1 -0
  4. package/dist/ctl/models/types.d.ts +169 -0
  5. package/dist/ctl/models/types.js +0 -0
  6. package/dist/ctl/parsing/enums.d.ts +38 -0
  7. package/dist/ctl/parsing/enums.js +1 -0
  8. package/dist/ctl/parsing/types.d.ts +89 -0
  9. package/dist/ctl/parsing/types.js +0 -0
  10. package/dist/ctl/rendering/types.d.ts +39 -0
  11. package/dist/ctl/rendering/types.js +0 -0
  12. package/dist/ctl/resolution/enums.d.ts +34 -0
  13. package/dist/ctl/resolution/enums.js +1 -0
  14. package/dist/ctl/resolution/types.d.ts +156 -0
  15. package/dist/ctl/resolution/types.js +0 -0
  16. package/dist/ctl/validation/types.d.ts +10 -0
  17. package/dist/ctl/validation/types.js +0 -0
  18. package/dist/document/constants/types.d.ts +5 -0
  19. package/dist/document/constants/types.js +0 -0
  20. package/dist/document/filtering/index.d.ts +13 -0
  21. package/dist/document/filtering/index.js +0 -0
  22. package/dist/document/filtering/types.d.ts +14 -0
  23. package/dist/document/filtering/types.js +0 -0
  24. package/dist/document/models/enums.d.ts +21 -0
  25. package/dist/document/models/enums.js +1 -0
  26. package/dist/document/models/index.d.ts +47 -0
  27. package/dist/document/models/index.js +1 -0
  28. package/dist/document/models/types.d.ts +194 -0
  29. package/dist/document/models/types.js +0 -0
  30. package/dist/document/parsing/index.d.ts +19 -0
  31. package/dist/document/parsing/index.js +1 -0
  32. package/dist/document/parsing/types.d.ts +10 -0
  33. package/dist/document/parsing/types.js +0 -0
  34. package/dist/document/repositories/enums.d.ts +17 -0
  35. package/dist/document/repositories/enums.js +1 -0
  36. package/dist/document/repositories/types.d.ts +103 -0
  37. package/dist/document/repositories/types.js +0 -0
  38. package/dist/document/storage/index.d.ts +25 -0
  39. package/dist/document/storage/index.js +0 -0
  40. package/dist/document/storage/types.d.ts +5 -0
  41. package/dist/document/storage/types.js +0 -0
  42. package/dist/exporters/ctl/markdown/types.d.ts +10 -0
  43. package/dist/exporters/ctl/markdown/types.js +0 -0
  44. package/dist/object/kanonaks/types.d.ts +17 -0
  45. package/dist/object/kanonaks/types.js +0 -0
  46. package/dist/object/parsing/index.d.ts +21 -0
  47. package/dist/object/parsing/index.js +1 -0
  48. package/dist/object/parsing/types.d.ts +43 -0
  49. package/dist/object/parsing/types.js +0 -0
  50. package/dist/object/resolution/types.d.ts +116 -0
  51. package/dist/object/resolution/types.js +0 -0
  52. package/dist/object/statements/index.d.ts +2 -0
  53. package/dist/object/statements/index.js +0 -0
  54. package/dist/object/statements/types.d.ts +20 -0
  55. package/dist/object/statements/types.js +0 -0
  56. package/dist/object/uris/types.d.ts +17 -0
  57. package/dist/object/uris/types.js +0 -0
  58. package/dist/object/validation/enums.d.ts +13 -0
  59. package/dist/object/validation/enums.js +1 -0
  60. package/dist/object/validation/index.d.ts +19 -0
  61. package/dist/object/validation/index.js +1 -0
  62. package/dist/object/validation/rules/document/index.d.ts +17 -0
  63. package/dist/object/validation/rules/document/index.js +1 -0
  64. package/dist/object/validation/rules/document/types.d.ts +52 -0
  65. package/dist/object/validation/rules/document/types.js +0 -0
  66. package/dist/object/validation/rules/repository/index.d.ts +19 -0
  67. package/dist/object/validation/rules/repository/index.js +1 -0
  68. package/dist/object/validation/rules/repository/types.d.ts +148 -0
  69. package/dist/object/validation/rules/repository/types.js +0 -0
  70. package/dist/object/validation/types.d.ts +134 -0
  71. package/dist/object/validation/types.js +0 -0
  72. package/dist/registry/models/types.d.ts +253 -0
  73. package/dist/registry/models/types.js +0 -0
  74. package/dist/registry/oauth/types.d.ts +192 -0
  75. package/dist/registry/oauth/types.js +0 -0
  76. package/dist/registry/providers/enums.d.ts +8 -0
  77. package/dist/registry/providers/enums.js +1 -0
  78. package/dist/registry/providers/git/types.d.ts +43 -0
  79. package/dist/registry/providers/git/types.js +0 -0
  80. package/dist/registry/providers/github/models/types.d.ts +35 -0
  81. package/dist/registry/providers/github/models/types.js +0 -0
  82. package/dist/registry/providers/github/types.d.ts +30 -0
  83. package/dist/registry/providers/github/types.js +0 -0
  84. package/dist/registry/providers/index.d.ts +29 -0
  85. package/dist/registry/providers/index.js +0 -0
  86. package/dist/registry/providers/oci/types.d.ts +17 -0
  87. package/dist/registry/providers/oci/types.js +0 -0
  88. package/dist/registry/providers/types.d.ts +15 -0
  89. package/dist/registry/providers/types.js +0 -0
  90. package/dist/registry/services/index.d.ts +9 -0
  91. package/dist/registry/services/index.js +0 -0
  92. package/dist/registry/services/types.d.ts +153 -0
  93. package/dist/registry/services/types.js +0 -0
  94. package/package.json +177 -0
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # @kanonak-protocol/types
2
+
3
+ TypeScript type definitions and interfaces for [Kanonak Protocol](https://kanonak.org).
4
+
5
+ This package provides the type contracts used by `@kanonak-protocol/sdk` and `@kanonak-protocol/cli`. It is auto-generated from the C# source of truth and should not be edited manually.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @kanonak-protocol/types
11
+ ```
12
+
13
+ ## What's included
14
+
15
+ - **Document types** — `KanonakDocument`, `KanonakMetadata`, `Namespace`, `Import`, `Version`
16
+ - **Object types** — `Kanonak`, `SubjectKanonak`, `EmbeddedKanonak`, `ReferenceKanonak`
17
+ - **Statement types** — `IStatement`, `ScalarStatement`, `ReferenceStatement`, `EmbeddedStatement`
18
+ - **Validation types** — `IDocumentValidationRule`, `IRepositoryValidationRule`
19
+ - **Registry types** — OAuth, credential store, and publisher configuration interfaces
20
+ - **CTL types** — Kanonak Template Language document and resolution types
21
+
22
+ ## Usage
23
+
24
+ Most consumers should use `@kanonak-protocol/sdk` which re-exports these types along with implementations. Use this package directly only if you need the type definitions without the runtime code.
25
+
26
+ ```typescript
27
+ import type { KanonakDocument, Import } from '@kanonak-protocol/types/document/models/types';
28
+ import type { SubjectKanonak } from '@kanonak-protocol/types/object/kanonaks/types';
29
+ ```
30
+
31
+ ## License
32
+
33
+ Apache-2.0
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Types of CTL validation errors.
3
+ */
4
+ export declare enum CtlValidationErrorType {
5
+ /**
6
+ * The Kanonak URI could not be parsed.
7
+ */
8
+ InvalidUri = 0,
9
+ /**
10
+ * The referenced publisher does not exist.
11
+ */
12
+ PublisherNotFound = 1,
13
+ /**
14
+ * The referenced package does not exist.
15
+ */
16
+ PackageNotFound = 2,
17
+ /**
18
+ * The referenced package version does not exist.
19
+ */
20
+ VersionNotFound = 3,
21
+ /**
22
+ * The referenced entity does not exist in the package.
23
+ */
24
+ EntityNotFound = 4,
25
+ /**
26
+ * A path segment in a deep link could not be resolved.
27
+ */
28
+ PathNotFound = 5,
29
+ /**
30
+ * An array index in a deep link is out of bounds.
31
+ */
32
+ IndexOutOfBounds = 6,
33
+ /**
34
+ * The reference is ambiguous (multiple matches).
35
+ */
36
+ AmbiguousReference = 7,
37
+ /**
38
+ * General parse error in the CTL document.
39
+ */
40
+ ParseError = 8
41
+ }
42
+ /**
43
+ * Severity levels for CTL validation issues.
44
+ */
45
+ export declare enum CtlValidationSeverity {
46
+ /**
47
+ * Error - the document is invalid.
48
+ */
49
+ Error = 0,
50
+ /**
51
+ * Warning - the document may have issues but is usable.
52
+ */
53
+ Warning = 1,
54
+ /**
55
+ * Information - advisory message.
56
+ */
57
+ Info = 2
58
+ }
@@ -0,0 +1 @@
1
+ var F=(u=>(u[u.InvalidUri=0]="InvalidUri",u[u.PublisherNotFound=1]="PublisherNotFound",u[u.PackageNotFound=2]="PackageNotFound",u[u.VersionNotFound=3]="VersionNotFound",u[u.EntityNotFound=4]="EntityNotFound",u[u.PathNotFound=5]="PathNotFound",u[u.IndexOutOfBounds=6]="IndexOutOfBounds",u[u.AmbiguousReference=7]="AmbiguousReference",u[u.ParseError=8]="ParseError",u))(F||{}),N=(s=>(s[s.Error=0]="Error",s[s.Warning=1]="Warning",s[s.Info=2]="Info",s))(N||{});export{F as CtlValidationErrorType,N as CtlValidationSeverity};
@@ -0,0 +1,169 @@
1
+ import { CtlValidationErrorType, CtlValidationSeverity } from '../../ctl/models/enums';
2
+ import { CtlKanonakUri } from '../../ctl/parsing/types';
3
+ import { KanonakMetadata } from '../../document/models/types';
4
+ import { SubjectKanonak } from '../../object/kanonaks/types';
5
+ /**
6
+ * Represents a reference to a Kanonak entity found in a CTL document. Corresponds to a markdown link: [DisplayText](kanonak://...)
7
+ */
8
+ export interface KanonakReference {
9
+ /**
10
+ * The display text shown to the user (the link text). Example: "Agent" in [Agent](kanonak://mycompany.com/models@1.0.0/Agent)
11
+ */
12
+ displayText: string;
13
+ /**
14
+ * The raw Kanonak URI string from the markdown link. Example: "kanonak://mycompany.com/models@1.0.0/Agent"
15
+ */
16
+ rawUri: string;
17
+ /**
18
+ * The parsed Kanonak URI. Null if the URI failed to parse.
19
+ */
20
+ parsedUri?: CtlKanonakUri | null | undefined;
21
+ /**
22
+ * The character offset where this reference starts in the source markdown.
23
+ */
24
+ startOffset: number;
25
+ /**
26
+ * The character offset where this reference ends in the source markdown.
27
+ */
28
+ endOffset: number;
29
+ /**
30
+ * The line number (1-based) where this reference appears.
31
+ */
32
+ line: number;
33
+ /**
34
+ * The column number (1-based) where this reference starts.
35
+ */
36
+ column: number;
37
+ /**
38
+ * Whether this reference has been successfully resolved.
39
+ */
40
+ isResolved: boolean;
41
+ /**
42
+ * The resolved entity (for entity-level URIs). Null if not resolved or not an entity URI.
43
+ */
44
+ resolvedResource?: SubjectKanonak | null | undefined;
45
+ /**
46
+ * The resolved value for deep link URIs (could be a scalar, EmbeddedKanonak, etc.). Null if not resolved or not a deep link URI.
47
+ */
48
+ resolvedValue?: any | null | undefined;
49
+ /**
50
+ * Error message if parsing or resolution failed.
51
+ */
52
+ error?: string | null | undefined;
53
+ /**
54
+ * The full markdown link text: [DisplayText](RawUri)
55
+ */
56
+ readonly fullMarkdownLink: string;
57
+ }
58
+ /**
59
+ * Represents a parsed CTL document (markdown with embedded Kanonak URI references). Supports two modes: - CTL Inline: No frontmatter, full kanonak:// URIs (for chat/responses) - CTL Document: Kanonak YAML frontmatter with import aliases (for templates)
60
+ */
61
+ export interface CtlDocument {
62
+ /**
63
+ * Kanonak metadata from YAML frontmatter (if present). Contains publisher/package/version and imports with aliases. Null for CTL Inline mode (no frontmatter).
64
+ */
65
+ metadata?: KanonakMetadata | null | undefined;
66
+ /**
67
+ * Whether this document has Kanonak frontmatter (CTL Document mode).
68
+ */
69
+ readonly hasFrontmatter: boolean;
70
+ /**
71
+ * The raw markdown content of the document (body only, without frontmatter).
72
+ */
73
+ rawMarkdown: string;
74
+ /**
75
+ * The length of the frontmatter section (including delimiters). Used to calculate reference positions within the body. Zero if no frontmatter.
76
+ */
77
+ frontmatterLength: number;
78
+ /**
79
+ * The file path of the document, if loaded from a file.
80
+ */
81
+ filePath?: string | null | undefined;
82
+ /**
83
+ * All Kanonak references found in the document. URIs are fully resolved (alias links expanded to full kanonak:// URIs).
84
+ */
85
+ references: readonly KanonakReference[];
86
+ /**
87
+ * The number of references in the document.
88
+ */
89
+ readonly referenceCount: number;
90
+ /**
91
+ * Whether all references have been resolved successfully.
92
+ */
93
+ readonly allReferencesResolved: boolean;
94
+ /**
95
+ * References that failed to resolve.
96
+ */
97
+ readonly unresolvedReferences: Array<KanonakReference>;
98
+ /**
99
+ * References that have errors (parsing or resolution).
100
+ */
101
+ readonly errorReferences: Array<KanonakReference>;
102
+ }
103
+ /**
104
+ * A validation error or warning for a CTL document.
105
+ */
106
+ export interface CtlValidationError {
107
+ /**
108
+ * The type of validation error.
109
+ */
110
+ errorType: CtlValidationErrorType;
111
+ /**
112
+ * The severity of the error.
113
+ */
114
+ severity: CtlValidationSeverity;
115
+ /**
116
+ * Human-readable error message.
117
+ */
118
+ message: string;
119
+ /**
120
+ * The reference that caused the error, if applicable.
121
+ */
122
+ reference?: KanonakReference | null | undefined;
123
+ /**
124
+ * Line number (1-based) where the error occurred.
125
+ */
126
+ line?: number | null | undefined;
127
+ /**
128
+ * Column number (1-based) where the error occurred.
129
+ */
130
+ column?: number | null | undefined;
131
+ /**
132
+ * Suggestion for how to fix the error.
133
+ */
134
+ suggestion?: string | null | undefined;
135
+ toString(): string;
136
+ }
137
+ /**
138
+ * The result of validating a CTL document.
139
+ */
140
+ export interface CtlValidationResult {
141
+ /**
142
+ * Whether the document is valid (all references resolved).
143
+ */
144
+ isValid: boolean;
145
+ /**
146
+ * The validated CTL document.
147
+ */
148
+ document: CtlDocument;
149
+ /**
150
+ * Validation errors (unresolved references, parse errors, etc.).
151
+ */
152
+ errors: readonly CtlValidationError[];
153
+ /**
154
+ * Validation warnings (non-fatal issues).
155
+ */
156
+ warnings: readonly CtlValidationError[];
157
+ /**
158
+ * Total number of references in the document.
159
+ */
160
+ readonly totalReferences: number;
161
+ /**
162
+ * Number of successfully resolved references.
163
+ */
164
+ readonly resolvedReferences: number;
165
+ /**
166
+ * Summary string for display.
167
+ */
168
+ readonly summary: string;
169
+ }
File without changes
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The type of Kanonak URI supported in CTL. CTL only supports resource-level references (not package or publisher).
3
+ */
4
+ export declare enum CtlKanonakUriType {
5
+ /**
6
+ * Publisher-level URI: kanonak://publisher NOTE: Not supported in CTL - will throw during parsing.
7
+ */
8
+ Publisher = 0,
9
+ /**
10
+ * Package-level URI without version: kanonak://publisher/package NOTE: Not supported in CTL - will throw during parsing.
11
+ */
12
+ Package = 1,
13
+ /**
14
+ * Package-level URI with version: kanonak://publisher/package@version NOTE: Not supported in CTL - will throw during parsing.
15
+ */
16
+ VersionedPackage = 2,
17
+ /**
18
+ * Resource-level URI: kanonak://publisher/package[@version]/resource
19
+ */
20
+ Resource = 3,
21
+ /**
22
+ * Deep link URI with path: kanonak://publisher/package[@version]/resource#path.to[0].field
23
+ */
24
+ DeepLink = 4
25
+ }
26
+ /**
27
+ * The type of a path segment.
28
+ */
29
+ export declare enum PathSegmentType {
30
+ /**
31
+ * A property access: .propertyName
32
+ */
33
+ Property = 0,
34
+ /**
35
+ * An array index access: [0]
36
+ */
37
+ Index = 1
38
+ }
@@ -0,0 +1 @@
1
+ var s=(u=>(u[u.Publisher=0]="Publisher",u[u.Package=1]="Package",u[u.VersionedPackage=2]="VersionedPackage",u[u.Resource=3]="Resource",u[u.DeepLink=4]="DeepLink",u))(s||{}),x=(c=>(c[c.Property=0]="Property",c[c.Index=1]="Index",c))(x||{});export{s as CtlKanonakUriType,x as PathSegmentType};
@@ -0,0 +1,89 @@
1
+ import { CtlDocument } from '../../ctl/models/types';
2
+ import { CtlKanonakUriType, PathSegmentType } from '../../ctl/parsing/enums';
3
+ import { Version } from '../../document/models/types';
4
+ /**
5
+ * Represents a Kanonak URI used in CTL documents. CTL supports resource-level references with optional deep linking: - Resource: kanonak://publisher/package@version/resource - Resource (latest): kanonak://publisher/package/resource - Deep Link: kanonak://publisher/package@version/resource#path.to[0].field Package and publisher-level URIs are NOT supported in CTL. Use full resource URIs (kanonak://) or short URIs (kan://) resolved via imports.
6
+ */
7
+ export interface CtlKanonakUri {
8
+ /**
9
+ * The URI scheme (always "kanonak").
10
+ */
11
+ readonly scheme: string;
12
+ /**
13
+ * The publisher/organization (e.g., "mycompany.com").
14
+ */
15
+ publisher: string;
16
+ /**
17
+ * The package name (e.g., "models"). Null for publisher-only URIs.
18
+ */
19
+ package_?: string | null | undefined;
20
+ /**
21
+ * The semantic version (e.g., "1.0.0"). Null for latest version.
22
+ */
23
+ version?: Version | null | undefined;
24
+ /**
25
+ * The resource name (e.g., "Agent"). Null for package-level URIs.
26
+ */
27
+ resourceName?: string | null | undefined;
28
+ /**
29
+ * The deep link path segments (e.g., ["address", "city"] or ["skills", "[0]", "name"]). Empty for resource-level URIs without deep linking.
30
+ */
31
+ path: readonly PathSegment[];
32
+ /**
33
+ * The type of this URI based on its specificity.
34
+ */
35
+ readonly uriType: CtlKanonakUriType;
36
+ /**
37
+ * Returns the namespace string (publisher/package[@version]) if applicable.
38
+ */
39
+ readonly namespace_?: string | null | undefined;
40
+ /**
41
+ * The original raw URI string.
42
+ */
43
+ rawUri: string;
44
+ /**
45
+ * Converts the URI to its canonical string representation.
46
+ */
47
+ toString(): string;
48
+ equals(obj: any | null): boolean;
49
+ getHashCode(): number;
50
+ }
51
+ /**
52
+ * Parses CTL documents (markdown with embedded Kanonak URI references). Supports two modes: - CTL Inline: No frontmatter, full kanonak:// URIs (for chat/responses) - CTL Document: Kanonak YAML frontmatter with import aliases (for templates)
53
+ */
54
+ export interface CtlParser {
55
+ /**
56
+ * Parses a CTL markdown string into a CtlDocument. Auto-detects mode based on frontmatter presence.
57
+ */
58
+ parse(content: string, filePath?: string | null): CtlDocument;
59
+ /**
60
+ * Parses a CTL document from a file.
61
+ */
62
+ parseFileAsync(filePath: string): Promise<CtlDocument>;
63
+ }
64
+ /**
65
+ * A segment in a deep link path.
66
+ */
67
+ export interface PathSegment {
68
+ /**
69
+ * The type of path segment.
70
+ */
71
+ type_: PathSegmentType;
72
+ /**
73
+ * The property name (for Property segments).
74
+ */
75
+ name?: string | null | undefined;
76
+ /**
77
+ * The array index (for Index segments).
78
+ */
79
+ index?: number | null | undefined;
80
+ toString(): string;
81
+ }
82
+ /**
83
+ * Represents a resolved import with publisher, package, and version.
84
+ */
85
+ export interface ResolvedImport {
86
+ publisher: string;
87
+ package_: string;
88
+ version: Version;
89
+ }
File without changes
@@ -0,0 +1,39 @@
1
+ import { CtlDocument, CtlValidationResult } from '../../ctl/models/types';
2
+ /**
3
+ * Renders CTL documents in various formats. - Preview: Human-readable view with Kanonak references shown as display text - Source: Original markdown (useful for display with syntax highlighting)
4
+ */
5
+ export interface CtlPreviewRenderer {
6
+ /**
7
+ * Renders a CTL document as a preview (Kanonak links replaced with display text).
8
+ */
9
+ renderPreview(document: CtlDocument, options?: CtlRenderOptions | null): string;
10
+ /**
11
+ * Renders a CTL document as a summary showing all references.
12
+ */
13
+ renderReferenceSummary(document: CtlDocument): string;
14
+ /**
15
+ * Renders validation errors in a human-readable format.
16
+ */
17
+ renderValidationErrors(result: CtlValidationResult): string;
18
+ /**
19
+ * Exports a CTL document as JSON with resolved reference information.
20
+ */
21
+ exportAsJson(document: CtlDocument): string;
22
+ }
23
+ /**
24
+ * Options for rendering CTL documents.
25
+ */
26
+ export interface CtlRenderOptions {
27
+ /**
28
+ * Whether to indicate Kanonak references with markers.
29
+ */
30
+ indicateReferences: boolean;
31
+ /**
32
+ * Marker format for resolved references. Use {text} as placeholder. Default: "«{text}»"
33
+ */
34
+ resolvedMarker?: string | null | undefined;
35
+ /**
36
+ * Marker format for unresolved references. Use {text} as placeholder. Default: "⚠{text}⚠"
37
+ */
38
+ unresolvedMarker?: string | null | undefined;
39
+ }
File without changes
@@ -0,0 +1,34 @@
1
+ export declare enum EntityTier {
2
+ Direct = 0,
3
+ Inherited = 1,
4
+ Foundation = 2
5
+ }
6
+ /**
7
+ * Semantic type classification for resolved entities.
8
+ */
9
+ export declare enum ResolvedResourceType {
10
+ /**
11
+ * An rdfs:Class or owl:Class definition.
12
+ */
13
+ Class = 0,
14
+ /**
15
+ * An owl:AnnotationProperty definition.
16
+ */
17
+ AnnotationProperty = 1,
18
+ /**
19
+ * An owl:DatatypeProperty definition.
20
+ */
21
+ DatatypeProperty = 2,
22
+ /**
23
+ * An owl:ObjectProperty definition.
24
+ */
25
+ ObjectProperty = 3,
26
+ /**
27
+ * An instance of a class (not a schema definition).
28
+ */
29
+ Instance = 4,
30
+ /**
31
+ * Unknown or unclassifiable entity type.
32
+ */
33
+ Other = 5
34
+ }
@@ -0,0 +1 @@
1
+ var t=(n=>(n[n.Direct=0]="Direct",n[n.Inherited=1]="Inherited",n[n.Foundation=2]="Foundation",n))(t||{}),P=(a=>(a[a.Class=0]="Class",a[a.AnnotationProperty=1]="AnnotationProperty",a[a.DatatypeProperty=2]="DatatypeProperty",a[a.ObjectProperty=3]="ObjectProperty",a[a.Instance=4]="Instance",a[a.Other=5]="Other",a))(P||{});export{t as EntityTier,P as ResolvedResourceType};
@@ -0,0 +1,156 @@
1
+ import { CtlDocument } from '../../ctl/models/types';
2
+ import { ResolvedResourceType } from '../../ctl/resolution/enums';
3
+ import { SubjectKanonak } from '../../object/kanonaks/types';
4
+ /**
5
+ * Resolves the complete entity graph for a CTL document. Recursively resolves all referenced entities and their dependencies, organizing them into tiers by importance. Uses ResourceResolver from Kanonak.Object for proper transitive alias resolution.
6
+ */
7
+ export interface CtlGraphResolver {
8
+ /**
9
+ * Resolves the complete entity graph for a CTL document.
10
+ */
11
+ resolveAsync(document: CtlDocument, maxDepth?: number): Promise<ResolvedResourceGraph>;
12
+ }
13
+ /**
14
+ * A property of a resolved Class entity.
15
+ */
16
+ export interface ResolvedProperty {
17
+ /**
18
+ * The property name.
19
+ */
20
+ name: string;
21
+ /**
22
+ * The property's range types (supports RDF union types like range: [string, anyURI]).
23
+ */
24
+ rangeTypes: Array<string>;
25
+ /**
26
+ * The property's domain types (supports multiple domains like domain: [ClassA, ClassB]).
27
+ */
28
+ domains: Array<string>;
29
+ /**
30
+ * Convenience property for single range type (first in list, or "unknown" if empty).
31
+ */
32
+ readonly rangeType: string;
33
+ /**
34
+ * Whether this is an object property (reference to another entity).
35
+ */
36
+ isObjectProperty: boolean;
37
+ /**
38
+ * Whether this property is a collection.
39
+ */
40
+ isCollection: boolean;
41
+ /**
42
+ * The rdfs:comment or description of this property.
43
+ */
44
+ comment?: string | null | undefined;
45
+ }
46
+ /**
47
+ * A resolved Kanonak resource with metadata for documentation rendering.
48
+ */
49
+ export interface ResolvedResource {
50
+ /**
51
+ * The resource name (e.g., "Farm", "tableName").
52
+ */
53
+ name: string;
54
+ /**
55
+ * The full Kanonak URI (e.g., "kanonak://spec.farm/models.farming@1.1.0/Farm").
56
+ */
57
+ kanonakUri: string;
58
+ /**
59
+ * The parsed SubjectKanonak resource (contains all statements/properties).
60
+ */
61
+ resource: SubjectKanonak;
62
+ /**
63
+ * The semantic type of this resource.
64
+ */
65
+ resourceType: ResolvedResourceType;
66
+ /**
67
+ * Parent class name (for Class entities with subClassOf).
68
+ */
69
+ parentClass?: string | null | undefined;
70
+ /**
71
+ * Multiple parent classes (for Class entities with multiple inheritance).
72
+ */
73
+ parentClasses: Array<string>;
74
+ /**
75
+ * The rdfs:comment or description of this entity.
76
+ */
77
+ comment?: string | null | undefined;
78
+ /**
79
+ * Properties defined on this entity (for Class entities).
80
+ */
81
+ properties: Array<ResolvedProperty>;
82
+ /**
83
+ * The namespace this entity belongs to.
84
+ */
85
+ namespace_: string;
86
+ /**
87
+ * The depth at which this entity was resolved (0 = direct reference).
88
+ */
89
+ resolutionDepth: number;
90
+ /**
91
+ * For Instance resources, the type/class this is an instance of.
92
+ */
93
+ instanceOf_?: string | null | undefined;
94
+ }
95
+ /**
96
+ * Represents a fully resolved entity graph from a CTL document. Entities are organized into tiers by importance/proximity to the source document.
97
+ */
98
+ export interface ResolvedResourceGraph {
99
+ /**
100
+ * The source file path (if available).
101
+ */
102
+ sourceFile?: string | null | undefined;
103
+ /**
104
+ * The original markdown content of the CTL document.
105
+ */
106
+ originalContent: string;
107
+ /**
108
+ * The title extracted from the first H1 heading, if present.
109
+ */
110
+ title?: string | null | undefined;
111
+ /**
112
+ * Direct references - entities explicitly referenced in the template via kan:// links. These are the most important and appear first in output.
113
+ */
114
+ directReferences: Array<ResolvedResource>;
115
+ /**
116
+ * Inherited references - parent classes (subClassOf), property ranges, etc. These are referenced by direct entities but not explicitly in the template.
117
+ */
118
+ inheritedReferences: Array<ResolvedResource>;
119
+ /**
120
+ * Foundation types - core ontology types (rdf:Class, rdfs:Resource, owl:Thing, etc.). These form the base of the type hierarchy.
121
+ */
122
+ foundationTypes: Array<ResolvedResource>;
123
+ /**
124
+ * Total number of resolved resources across all tiers.
125
+ */
126
+ readonly totalResourceCount: number;
127
+ /**
128
+ * All resolved resources across all tiers (for iteration).
129
+ */
130
+ readonly allResources: Array<ResolvedResource>;
131
+ /**
132
+ * Maximum depth reached during resolution.
133
+ */
134
+ maxDepthReached: number;
135
+ /**
136
+ * Whether resolution was truncated due to depth limit.
137
+ */
138
+ wasTruncated: boolean;
139
+ /**
140
+ * Resources that failed to resolve (for diagnostic purposes).
141
+ */
142
+ unresolvedResources: Array<UnresolvedResource>;
143
+ }
144
+ /**
145
+ * An entity that failed to resolve.
146
+ */
147
+ export interface UnresolvedResource {
148
+ /**
149
+ * The entity name or URI that failed to resolve.
150
+ */
151
+ reference: string;
152
+ /**
153
+ * The reason for failure.
154
+ */
155
+ reason: string;
156
+ }
File without changes
@@ -0,0 +1,10 @@
1
+ import { CtlDocument, CtlValidationResult } from '../../ctl/models/types';
2
+ /**
3
+ * Validates CTL documents by resolving all Kanonak URI references. CTL only supports entity-level references (Entity and DeepLink URIs). Package and publisher-level URIs are not supported.
4
+ */
5
+ export interface CtlValidator {
6
+ /**
7
+ * Validates a CTL document by resolving all Kanonak URI references.
8
+ */
9
+ validateAsync(document: CtlDocument): Promise<CtlValidationResult>;
10
+ }
File without changes
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Centralized constants for core Kanonak Protocol package names and identifiers. All package name references should use these constants for maintainability.
3
+ */
4
+ export interface CorePackageConstants {
5
+ }
File without changes
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Interface for filtering files based on .gitignore rules
3
+ */
4
+ export interface IGitIgnoreFilter {
5
+ /**
6
+ * Checks if a file path should be ignored based on gitignore rules
7
+ */
8
+ shouldIgnore(absolutePath: string): boolean;
9
+ /**
10
+ * Checks if a directory path should be ignored based on gitignore rules. Used to skip entire directory trees before traversing them.
11
+ */
12
+ shouldIgnoreDirectory(absoluteDirectoryPath: string): boolean;
13
+ }
File without changes