@canon-protocol/types 8.0.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/ctl/models/enums.d.ts +58 -0
- package/dist/ctl/models/enums.js +64 -0
- package/dist/ctl/models/types.d.ts +169 -0
- package/dist/ctl/models/types.js +5 -0
- package/dist/ctl/parsing/enums.d.ts +38 -0
- package/dist/ctl/parsing/enums.js +44 -0
- package/dist/ctl/parsing/types.d.ts +89 -0
- package/dist/ctl/parsing/types.js +5 -0
- package/dist/ctl/rendering/types.d.ts +39 -0
- package/dist/ctl/rendering/types.js +5 -0
- package/dist/ctl/resolution/enums.d.ts +34 -0
- package/dist/ctl/resolution/enums.js +40 -0
- package/dist/ctl/resolution/types.d.ts +156 -0
- package/dist/ctl/resolution/types.js +5 -0
- package/dist/ctl/validation/types.d.ts +10 -0
- package/dist/ctl/validation/types.js +5 -0
- package/dist/document/constants/types.d.ts +5 -0
- package/dist/document/constants/types.js +5 -0
- package/dist/document/filtering/index.d.ts +13 -0
- package/dist/document/filtering/index.js +5 -0
- package/dist/document/filtering/types.d.ts +14 -0
- package/dist/document/filtering/types.js +5 -0
- package/dist/document/models/enums.d.ts +21 -0
- package/dist/document/models/enums.js +26 -0
- package/dist/document/models/index.d.ts +47 -0
- package/dist/document/models/index.js +5 -0
- package/dist/document/models/types.d.ts +194 -0
- package/dist/document/models/types.js +5 -0
- package/dist/document/parsing/index.d.ts +19 -0
- package/dist/document/parsing/index.js +5 -0
- package/dist/document/parsing/types.d.ts +10 -0
- package/dist/document/parsing/types.js +5 -0
- package/dist/document/repositories/enums.d.ts +17 -0
- package/dist/document/repositories/enums.js +22 -0
- package/dist/document/repositories/types.d.ts +103 -0
- package/dist/document/repositories/types.js +5 -0
- package/dist/document/storage/index.d.ts +25 -0
- package/dist/document/storage/index.js +5 -0
- package/dist/document/storage/types.d.ts +5 -0
- package/dist/document/storage/types.js +5 -0
- package/dist/exporters/ctl/markdown/types.d.ts +10 -0
- package/dist/exporters/ctl/markdown/types.js +5 -0
- package/dist/object/canons/types.d.ts +17 -0
- package/dist/object/canons/types.js +5 -0
- package/dist/object/parsing/index.d.ts +21 -0
- package/dist/object/parsing/index.js +5 -0
- package/dist/object/parsing/types.d.ts +43 -0
- package/dist/object/parsing/types.js +5 -0
- package/dist/object/resolution/types.d.ts +116 -0
- package/dist/object/resolution/types.js +5 -0
- package/dist/object/statements/index.d.ts +2 -0
- package/dist/object/statements/index.js +5 -0
- package/dist/object/statements/types.d.ts +20 -0
- package/dist/object/statements/types.js +5 -0
- package/dist/object/uris/types.d.ts +17 -0
- package/dist/object/uris/types.js +5 -0
- package/dist/object/validation/enums.d.ts +13 -0
- package/dist/object/validation/enums.js +18 -0
- package/dist/object/validation/index.d.ts +19 -0
- package/dist/object/validation/index.js +5 -0
- package/dist/object/validation/rules/document/index.d.ts +17 -0
- package/dist/object/validation/rules/document/index.js +5 -0
- package/dist/object/validation/rules/document/types.d.ts +52 -0
- package/dist/object/validation/rules/document/types.js +5 -0
- package/dist/object/validation/rules/repository/index.d.ts +19 -0
- package/dist/object/validation/rules/repository/index.js +5 -0
- package/dist/object/validation/rules/repository/types.d.ts +148 -0
- package/dist/object/validation/rules/repository/types.js +5 -0
- package/dist/object/validation/types.d.ts +134 -0
- package/dist/object/validation/types.js +5 -0
- package/dist/registry/models/types.d.ts +253 -0
- package/dist/registry/models/types.js +5 -0
- package/dist/registry/oauth/types.d.ts +192 -0
- package/dist/registry/oauth/types.js +5 -0
- package/dist/registry/providers/enums.d.ts +8 -0
- package/dist/registry/providers/enums.js +13 -0
- package/dist/registry/providers/git/types.d.ts +43 -0
- package/dist/registry/providers/git/types.js +5 -0
- package/dist/registry/providers/github/models/types.d.ts +35 -0
- package/dist/registry/providers/github/models/types.js +5 -0
- package/dist/registry/providers/github/types.d.ts +30 -0
- package/dist/registry/providers/github/types.js +5 -0
- package/dist/registry/providers/index.d.ts +29 -0
- package/dist/registry/providers/index.js +5 -0
- package/dist/registry/providers/oci/types.d.ts +17 -0
- package/dist/registry/providers/oci/types.js +5 -0
- package/dist/registry/providers/types.d.ts +15 -0
- package/dist/registry/providers/types.js +5 -0
- package/dist/registry/services/index.d.ts +9 -0
- package/dist/registry/services/index.js +5 -0
- package/dist/registry/services/types.d.ts +153 -0
- package/dist/registry/services/types.js +5 -0
- package/package.json +99 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types of CTL validation errors.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum CtlValidationErrorType {
|
|
5
|
+
/**
|
|
6
|
+
* The Canon 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,64 @@
|
|
|
1
|
+
// This file was auto-generated by Canon SDK Transpiler v1.0.0
|
|
2
|
+
// Source: canon-sdk-csharp\Canon.CTL\Models\CtlValidationResult.cs
|
|
3
|
+
// SourceHash: sha256-711e1203192988518a0c03dcb43f8dc38e2fecb2e71a364bad73f5acfe9ae38b
|
|
4
|
+
// DO NOT EDIT - changes will be overwritten
|
|
5
|
+
/**
|
|
6
|
+
* Types of CTL validation errors.
|
|
7
|
+
*/
|
|
8
|
+
export var CtlValidationErrorType;
|
|
9
|
+
(function (CtlValidationErrorType) {
|
|
10
|
+
/**
|
|
11
|
+
* The Canon URI could not be parsed.
|
|
12
|
+
*/
|
|
13
|
+
CtlValidationErrorType[CtlValidationErrorType["InvalidUri"] = 0] = "InvalidUri";
|
|
14
|
+
/**
|
|
15
|
+
* The referenced publisher does not exist.
|
|
16
|
+
*/
|
|
17
|
+
CtlValidationErrorType[CtlValidationErrorType["PublisherNotFound"] = 1] = "PublisherNotFound";
|
|
18
|
+
/**
|
|
19
|
+
* The referenced package does not exist.
|
|
20
|
+
*/
|
|
21
|
+
CtlValidationErrorType[CtlValidationErrorType["PackageNotFound"] = 2] = "PackageNotFound";
|
|
22
|
+
/**
|
|
23
|
+
* The referenced package version does not exist.
|
|
24
|
+
*/
|
|
25
|
+
CtlValidationErrorType[CtlValidationErrorType["VersionNotFound"] = 3] = "VersionNotFound";
|
|
26
|
+
/**
|
|
27
|
+
* The referenced entity does not exist in the package.
|
|
28
|
+
*/
|
|
29
|
+
CtlValidationErrorType[CtlValidationErrorType["EntityNotFound"] = 4] = "EntityNotFound";
|
|
30
|
+
/**
|
|
31
|
+
* A path segment in a deep link could not be resolved.
|
|
32
|
+
*/
|
|
33
|
+
CtlValidationErrorType[CtlValidationErrorType["PathNotFound"] = 5] = "PathNotFound";
|
|
34
|
+
/**
|
|
35
|
+
* An array index in a deep link is out of bounds.
|
|
36
|
+
*/
|
|
37
|
+
CtlValidationErrorType[CtlValidationErrorType["IndexOutOfBounds"] = 6] = "IndexOutOfBounds";
|
|
38
|
+
/**
|
|
39
|
+
* The reference is ambiguous (multiple matches).
|
|
40
|
+
*/
|
|
41
|
+
CtlValidationErrorType[CtlValidationErrorType["AmbiguousReference"] = 7] = "AmbiguousReference";
|
|
42
|
+
/**
|
|
43
|
+
* General parse error in the CTL document.
|
|
44
|
+
*/
|
|
45
|
+
CtlValidationErrorType[CtlValidationErrorType["ParseError"] = 8] = "ParseError";
|
|
46
|
+
})(CtlValidationErrorType || (CtlValidationErrorType = {}));
|
|
47
|
+
/**
|
|
48
|
+
* Severity levels for CTL validation issues.
|
|
49
|
+
*/
|
|
50
|
+
export var CtlValidationSeverity;
|
|
51
|
+
(function (CtlValidationSeverity) {
|
|
52
|
+
/**
|
|
53
|
+
* Error - the document is invalid.
|
|
54
|
+
*/
|
|
55
|
+
CtlValidationSeverity[CtlValidationSeverity["Error"] = 0] = "Error";
|
|
56
|
+
/**
|
|
57
|
+
* Warning - the document may have issues but is usable.
|
|
58
|
+
*/
|
|
59
|
+
CtlValidationSeverity[CtlValidationSeverity["Warning"] = 1] = "Warning";
|
|
60
|
+
/**
|
|
61
|
+
* Information - advisory message.
|
|
62
|
+
*/
|
|
63
|
+
CtlValidationSeverity[CtlValidationSeverity["Info"] = 2] = "Info";
|
|
64
|
+
})(CtlValidationSeverity || (CtlValidationSeverity = {}));
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { CtlValidationErrorType, CtlValidationSeverity } from '../../ctl/models/enums';
|
|
2
|
+
import { CtlCanonUri } from '../../ctl/parsing/types';
|
|
3
|
+
import { CanonMetadata } from '../../document/models/types';
|
|
4
|
+
import { SubjectCanon } from '../../object/canons/types';
|
|
5
|
+
/**
|
|
6
|
+
* Represents a reference to a Canon entity found in a CTL document. Corresponds to a markdown link: [DisplayText](canon://...)
|
|
7
|
+
*/
|
|
8
|
+
export interface CanonReference {
|
|
9
|
+
/**
|
|
10
|
+
* The display text shown to the user (the link text). Example: "Agent" in [Agent](canon://mycompany.com/models@1.0.0/Agent)
|
|
11
|
+
*/
|
|
12
|
+
displayText: string;
|
|
13
|
+
/**
|
|
14
|
+
* The raw Canon URI string from the markdown link. Example: "canon://mycompany.com/models@1.0.0/Agent"
|
|
15
|
+
*/
|
|
16
|
+
rawUri: string;
|
|
17
|
+
/**
|
|
18
|
+
* The parsed Canon URI. Null if the URI failed to parse.
|
|
19
|
+
*/
|
|
20
|
+
parsedUri?: CtlCanonUri | 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?: SubjectCanon | null | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* The resolved value for deep link URIs (could be a scalar, EmbeddedCanon, 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 Canon URI references). Supports two modes: - CTL Inline: No frontmatter, full canon:// URIs (for chat/responses) - CTL Document: Canon YAML frontmatter with import aliases (for templates)
|
|
60
|
+
*/
|
|
61
|
+
export interface CtlDocument {
|
|
62
|
+
/**
|
|
63
|
+
* Canon metadata from YAML frontmatter (if present). Contains publisher/package/version and imports with aliases. Null for CTL Inline mode (no frontmatter).
|
|
64
|
+
*/
|
|
65
|
+
metadata?: CanonMetadata | null | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Whether this document has Canon 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 Canon references found in the document. URIs are fully resolved (alias links expanded to full canon:// URIs).
|
|
84
|
+
*/
|
|
85
|
+
references: readonly CanonReference[];
|
|
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<CanonReference>;
|
|
98
|
+
/**
|
|
99
|
+
* References that have errors (parsing or resolution).
|
|
100
|
+
*/
|
|
101
|
+
readonly errorReferences: Array<CanonReference>;
|
|
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?: CanonReference | 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
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The type of Canon URI supported in CTL. CTL only supports resource-level references (not package or publisher).
|
|
3
|
+
*/
|
|
4
|
+
export declare enum CtlCanonUriType {
|
|
5
|
+
/**
|
|
6
|
+
* Publisher-level URI: canon://publisher NOTE: Not supported in CTL - will throw during parsing.
|
|
7
|
+
*/
|
|
8
|
+
Publisher = 0,
|
|
9
|
+
/**
|
|
10
|
+
* Package-level URI without version: canon://publisher/package NOTE: Not supported in CTL - will throw during parsing.
|
|
11
|
+
*/
|
|
12
|
+
Package = 1,
|
|
13
|
+
/**
|
|
14
|
+
* Package-level URI with version: canon://publisher/package@version NOTE: Not supported in CTL - will throw during parsing.
|
|
15
|
+
*/
|
|
16
|
+
VersionedPackage = 2,
|
|
17
|
+
/**
|
|
18
|
+
* Resource-level URI: canon://publisher/package[@version]/resource
|
|
19
|
+
*/
|
|
20
|
+
Resource = 3,
|
|
21
|
+
/**
|
|
22
|
+
* Deep link URI with path: canon://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,44 @@
|
|
|
1
|
+
// This file was auto-generated by Canon SDK Transpiler v1.0.0
|
|
2
|
+
// Source: canon-sdk-csharp\Canon.CTL\Parsing\CtlCanonUri.cs
|
|
3
|
+
// SourceHash: sha256-ba23d35173efc106f00ee6850fb7586ca9335de6df38859ad1b065bc20fcb0e3
|
|
4
|
+
// DO NOT EDIT - changes will be overwritten
|
|
5
|
+
/**
|
|
6
|
+
* The type of Canon URI supported in CTL. CTL only supports resource-level references (not package or publisher).
|
|
7
|
+
*/
|
|
8
|
+
export var CtlCanonUriType;
|
|
9
|
+
(function (CtlCanonUriType) {
|
|
10
|
+
/**
|
|
11
|
+
* Publisher-level URI: canon://publisher NOTE: Not supported in CTL - will throw during parsing.
|
|
12
|
+
*/
|
|
13
|
+
CtlCanonUriType[CtlCanonUriType["Publisher"] = 0] = "Publisher";
|
|
14
|
+
/**
|
|
15
|
+
* Package-level URI without version: canon://publisher/package NOTE: Not supported in CTL - will throw during parsing.
|
|
16
|
+
*/
|
|
17
|
+
CtlCanonUriType[CtlCanonUriType["Package"] = 1] = "Package";
|
|
18
|
+
/**
|
|
19
|
+
* Package-level URI with version: canon://publisher/package@version NOTE: Not supported in CTL - will throw during parsing.
|
|
20
|
+
*/
|
|
21
|
+
CtlCanonUriType[CtlCanonUriType["VersionedPackage"] = 2] = "VersionedPackage";
|
|
22
|
+
/**
|
|
23
|
+
* Resource-level URI: canon://publisher/package[@version]/resource
|
|
24
|
+
*/
|
|
25
|
+
CtlCanonUriType[CtlCanonUriType["Resource"] = 3] = "Resource";
|
|
26
|
+
/**
|
|
27
|
+
* Deep link URI with path: canon://publisher/package[@version]/resource#path.to[0].field
|
|
28
|
+
*/
|
|
29
|
+
CtlCanonUriType[CtlCanonUriType["DeepLink"] = 4] = "DeepLink";
|
|
30
|
+
})(CtlCanonUriType || (CtlCanonUriType = {}));
|
|
31
|
+
/**
|
|
32
|
+
* The type of a path segment.
|
|
33
|
+
*/
|
|
34
|
+
export var PathSegmentType;
|
|
35
|
+
(function (PathSegmentType) {
|
|
36
|
+
/**
|
|
37
|
+
* A property access: .propertyName
|
|
38
|
+
*/
|
|
39
|
+
PathSegmentType[PathSegmentType["Property"] = 0] = "Property";
|
|
40
|
+
/**
|
|
41
|
+
* An array index access: [0]
|
|
42
|
+
*/
|
|
43
|
+
PathSegmentType[PathSegmentType["Index"] = 1] = "Index";
|
|
44
|
+
})(PathSegmentType || (PathSegmentType = {}));
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { CtlDocument } from '../../ctl/models/types';
|
|
2
|
+
import { CtlCanonUriType, PathSegmentType } from '../../ctl/parsing/enums';
|
|
3
|
+
import { Version } from '../../document/models/types';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a Canon URI used in CTL documents. CTL supports resource-level references with optional deep linking: - Resource: canon://publisher/package@version/resource - Resource (latest): canon://publisher/package/resource - Deep Link: canon://publisher/package@version/resource#path.to[0].field Package and publisher-level URIs are NOT supported in CTL. Use full resource URIs (canon://) or short URIs (can://) resolved via imports.
|
|
6
|
+
*/
|
|
7
|
+
export interface CtlCanonUri {
|
|
8
|
+
/**
|
|
9
|
+
* The URI scheme (always "canon").
|
|
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: CtlCanonUriType;
|
|
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 Canon URI references). Supports two modes: - CTL Inline: No frontmatter, full canon:// URIs (for chat/responses) - CTL Document: Canon 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
|
+
}
|
|
@@ -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 Canon 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 (Canon 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 Canon 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
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// This file was auto-generated by Canon SDK Transpiler v1.0.0
|
|
2
|
+
// Source: canon-sdk-csharp\Canon.CTL\Rendering\CtlPreviewRenderer.cs
|
|
3
|
+
// SourceHash: sha256-fb0110494c5d79eb0a011bbb139a228b9e5d22175d0fdbb7b6f897790737c1b8
|
|
4
|
+
// DO NOT EDIT - changes will be overwritten
|
|
5
|
+
export {};
|
|
@@ -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,40 @@
|
|
|
1
|
+
// This file was auto-generated by Canon SDK Transpiler v1.0.0
|
|
2
|
+
// Source: 2 files in namespace
|
|
3
|
+
// SourceHash: sha256-e8d0e7bd29c93f972dd742211e808362e50f44937f3ac3f58183c4e80ff1d915
|
|
4
|
+
// DO NOT EDIT - changes will be overwritten
|
|
5
|
+
export var EntityTier;
|
|
6
|
+
(function (EntityTier) {
|
|
7
|
+
EntityTier[EntityTier["Direct"] = 0] = "Direct";
|
|
8
|
+
EntityTier[EntityTier["Inherited"] = 1] = "Inherited";
|
|
9
|
+
EntityTier[EntityTier["Foundation"] = 2] = "Foundation";
|
|
10
|
+
})(EntityTier || (EntityTier = {}));
|
|
11
|
+
/**
|
|
12
|
+
* Semantic type classification for resolved entities.
|
|
13
|
+
*/
|
|
14
|
+
export var ResolvedResourceType;
|
|
15
|
+
(function (ResolvedResourceType) {
|
|
16
|
+
/**
|
|
17
|
+
* An rdfs:Class or owl:Class definition.
|
|
18
|
+
*/
|
|
19
|
+
ResolvedResourceType[ResolvedResourceType["Class"] = 0] = "Class";
|
|
20
|
+
/**
|
|
21
|
+
* An owl:AnnotationProperty definition.
|
|
22
|
+
*/
|
|
23
|
+
ResolvedResourceType[ResolvedResourceType["AnnotationProperty"] = 1] = "AnnotationProperty";
|
|
24
|
+
/**
|
|
25
|
+
* An owl:DatatypeProperty definition.
|
|
26
|
+
*/
|
|
27
|
+
ResolvedResourceType[ResolvedResourceType["DatatypeProperty"] = 2] = "DatatypeProperty";
|
|
28
|
+
/**
|
|
29
|
+
* An owl:ObjectProperty definition.
|
|
30
|
+
*/
|
|
31
|
+
ResolvedResourceType[ResolvedResourceType["ObjectProperty"] = 3] = "ObjectProperty";
|
|
32
|
+
/**
|
|
33
|
+
* An instance of a class (not a schema definition).
|
|
34
|
+
*/
|
|
35
|
+
ResolvedResourceType[ResolvedResourceType["Instance"] = 4] = "Instance";
|
|
36
|
+
/**
|
|
37
|
+
* Unknown or unclassifiable entity type.
|
|
38
|
+
*/
|
|
39
|
+
ResolvedResourceType[ResolvedResourceType["Other"] = 5] = "Other";
|
|
40
|
+
})(ResolvedResourceType || (ResolvedResourceType = {}));
|