@habitat-ai/service 0.2.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/client.d.ts +16 -0
- package/dist/client.js +16 -0
- package/dist/service/base.d.ts +28 -0
- package/dist/service/base.js +1 -0
- package/dist/service/contract.d.ts +10 -0
- package/dist/service/contract.js +5 -0
- package/dist/service/impl.d.ts +508 -0
- package/dist/service/impl.js +7 -0
- package/dist/service/modules/catalog/contract/catalog.d.ts +252 -0
- package/dist/service/modules/catalog/contract/catalog.js +13 -0
- package/dist/service/modules/catalog/contract/index.d.ts +3 -0
- package/dist/service/modules/catalog/contract/index.js +3 -0
- package/dist/service/modules/catalog/model/dto/catalog.d.ts +276 -0
- package/dist/service/modules/catalog/model/dto/catalog.js +380 -0
- package/dist/service/modules/catalog/model/dto/check.d.ts +104 -0
- package/dist/service/modules/catalog/model/dto/check.js +305 -0
- package/dist/service/modules/catalog/model/dto/structure.d.ts +23 -0
- package/dist/service/modules/catalog/model/dto/structure.js +93 -0
- package/dist/service/modules/catalog/model/policy/catalog.d.ts +109 -0
- package/dist/service/modules/catalog/model/policy/catalog.js +607 -0
- package/dist/service/modules/catalog/model/policy/check.d.ts +57 -0
- package/dist/service/modules/catalog/model/policy/check.js +207 -0
- package/dist/service/modules/catalog/model/policy/structure.d.ts +64 -0
- package/dist/service/modules/catalog/model/policy/structure.js +249 -0
- package/dist/service/modules/catalog/module.d.ts +521 -0
- package/dist/service/modules/catalog/module.js +12 -0
- package/dist/service/modules/catalog/router/catalog.router.d.ts +266 -0
- package/dist/service/modules/catalog/router/catalog.router.js +659 -0
- package/dist/service/modules/catalog/router.d.ts +265 -0
- package/dist/service/modules/catalog/router.js +3 -0
- package/dist/service/router.d.ts +267 -0
- package/dist/service/router.js +4 -0
- package/package.json +49 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { type TypeBoxStandardSchema } from "@habitat-ai/typebox-adapter";
|
|
2
|
+
/** Catalog procedure group exposed through the module contract face. */
|
|
3
|
+
export declare const catalog: {
|
|
4
|
+
resolve: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<TypeBoxStandardSchema<import("typebox").TObject<{}>>, TypeBoxStandardSchema<import("typebox").TUnion<[import("typebox").TObject<{
|
|
5
|
+
_tag: import("typebox").TLiteral<"Resolved">;
|
|
6
|
+
catalog: import("typebox").TObject<{
|
|
7
|
+
schemaVersion: import("typebox").TLiteral<3>;
|
|
8
|
+
policyPack: import("typebox").TObject<{
|
|
9
|
+
name: import("typebox").TString;
|
|
10
|
+
version: import("typebox").TString;
|
|
11
|
+
protocolVersion: import("typebox").TLiteral<1>;
|
|
12
|
+
blueprints: import("typebox").TArray<import("typebox").TObject<{
|
|
13
|
+
id: import("typebox").TString;
|
|
14
|
+
version: import("typebox").TInteger;
|
|
15
|
+
path: import("typebox").TString;
|
|
16
|
+
}>>;
|
|
17
|
+
}>;
|
|
18
|
+
blueprints: import("typebox").TArray<import("typebox").TObject<{
|
|
19
|
+
definition: import("typebox").TObject<{
|
|
20
|
+
schemaVersion: import("typebox").TLiteral<1>;
|
|
21
|
+
id: import("typebox").TString;
|
|
22
|
+
version: import("typebox").TInteger;
|
|
23
|
+
rules: import("typebox").TArray<import("typebox").TObject<{
|
|
24
|
+
id: import("typebox").TString;
|
|
25
|
+
lane: import("typebox").TUnion<[import("typebox").TLiteral<"enforced">, import("typebox").TLiteral<"advisory">]>;
|
|
26
|
+
message: import("typebox").TString;
|
|
27
|
+
remediate: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
|
|
28
|
+
runner: import("typebox").TUnion<[import("typebox").TObject<{
|
|
29
|
+
name: import("typebox").TLiteral<"habitat">;
|
|
30
|
+
mode: import("typebox").TLiteral<"structure">;
|
|
31
|
+
structure: import("typebox").TString;
|
|
32
|
+
}>, import("typebox").TObject<{
|
|
33
|
+
name: import("typebox").TLiteral<"grit">;
|
|
34
|
+
pattern: import("typebox").TString;
|
|
35
|
+
patternName: import("typebox").TString;
|
|
36
|
+
acquisition: import("typebox").TObject<{
|
|
37
|
+
kind: import("typebox").TUnion<[import("typebox").TLiteral<"check">, import("typebox").TLiteral<"apply-dry-run">]>;
|
|
38
|
+
rootRoles: import("typebox").TArray<import("typebox").TString>;
|
|
39
|
+
selections: import("typebox").TArray<import("typebox").TString>;
|
|
40
|
+
}>;
|
|
41
|
+
}>]>;
|
|
42
|
+
}>>;
|
|
43
|
+
instance: import("typebox").TObject<{
|
|
44
|
+
manifest: import("typebox").TLiteral<"habitat.toml">;
|
|
45
|
+
anchorRoot: import("typebox").TString;
|
|
46
|
+
roots: import("typebox").TArray<import("typebox").TObject<{
|
|
47
|
+
id: import("typebox").TString;
|
|
48
|
+
required: import("typebox").TBoolean;
|
|
49
|
+
kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
|
|
50
|
+
}>>;
|
|
51
|
+
selections: import("typebox").TArray<import("typebox").TObject<{
|
|
52
|
+
id: import("typebox").TString;
|
|
53
|
+
root: import("typebox").TString;
|
|
54
|
+
kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
|
|
55
|
+
memberPattern: import("typebox").TString;
|
|
56
|
+
pathTemplate: import("typebox").TString;
|
|
57
|
+
}>>;
|
|
58
|
+
}>;
|
|
59
|
+
}>;
|
|
60
|
+
provenance: import("typebox").TObject<{
|
|
61
|
+
kind: import("typebox").TLiteral<"local">;
|
|
62
|
+
authorityRoot: import("typebox").TString;
|
|
63
|
+
relativePath: import("typebox").TString;
|
|
64
|
+
}>;
|
|
65
|
+
}>>;
|
|
66
|
+
instances: import("typebox").TArray<import("typebox").TObject<{
|
|
67
|
+
id: import("typebox").TString;
|
|
68
|
+
ownerProject: import("typebox").TString;
|
|
69
|
+
blueprint: import("typebox").TString;
|
|
70
|
+
blueprintVersion: import("typebox").TInteger;
|
|
71
|
+
manifestPath: import("typebox").TString;
|
|
72
|
+
roots: import("typebox").TArray<import("typebox").TObject<{
|
|
73
|
+
id: import("typebox").TString;
|
|
74
|
+
required: import("typebox").TBoolean;
|
|
75
|
+
kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
|
|
76
|
+
path: import("typebox").TString;
|
|
77
|
+
}>>;
|
|
78
|
+
selections: import("typebox").TArray<import("typebox").TObject<{
|
|
79
|
+
id: import("typebox").TString;
|
|
80
|
+
root: import("typebox").TString;
|
|
81
|
+
members: import("typebox").TArray<import("typebox").TObject<{
|
|
82
|
+
id: import("typebox").TString;
|
|
83
|
+
kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
|
|
84
|
+
path: import("typebox").TString;
|
|
85
|
+
}>>;
|
|
86
|
+
}>>;
|
|
87
|
+
}>>;
|
|
88
|
+
applications: import("typebox").TArray<import("typebox").TObject<{
|
|
89
|
+
ownerProject: import("typebox").TString;
|
|
90
|
+
instanceId: import("typebox").TString;
|
|
91
|
+
blueprint: import("typebox").TString;
|
|
92
|
+
blueprintVersion: import("typebox").TInteger;
|
|
93
|
+
ruleId: import("typebox").TString;
|
|
94
|
+
manifestPath: import("typebox").TString;
|
|
95
|
+
lane: import("typebox").TUnion<[import("typebox").TLiteral<"enforced">, import("typebox").TLiteral<"advisory">]>;
|
|
96
|
+
message: import("typebox").TString;
|
|
97
|
+
remediate: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
|
|
98
|
+
provenance: import("typebox").TObject<{
|
|
99
|
+
kind: import("typebox").TLiteral<"local">;
|
|
100
|
+
authorityRoot: import("typebox").TString;
|
|
101
|
+
relativePath: import("typebox").TString;
|
|
102
|
+
}>;
|
|
103
|
+
runner: import("typebox").TUnion<[import("typebox").TObject<{
|
|
104
|
+
name: import("typebox").TLiteral<"habitat">;
|
|
105
|
+
mode: import("typebox").TLiteral<"structure">;
|
|
106
|
+
structure: import("typebox").TObject<{
|
|
107
|
+
provenance: import("typebox").TObject<{
|
|
108
|
+
kind: import("typebox").TLiteral<"local">;
|
|
109
|
+
authorityRoot: import("typebox").TString;
|
|
110
|
+
relativePath: import("typebox").TString;
|
|
111
|
+
}>;
|
|
112
|
+
relativePath: import("typebox").TString;
|
|
113
|
+
absolutePath: import("typebox").TString;
|
|
114
|
+
}>;
|
|
115
|
+
rootBindings: import("typebox").TArray<import("typebox").TObject<{
|
|
116
|
+
rootRole: import("typebox").TString;
|
|
117
|
+
required: import("typebox").TBoolean;
|
|
118
|
+
kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
|
|
119
|
+
path: import("typebox").TOptional<import("typebox").TString>;
|
|
120
|
+
}>>;
|
|
121
|
+
}>, import("typebox").TObject<{
|
|
122
|
+
name: import("typebox").TLiteral<"grit">;
|
|
123
|
+
pattern: import("typebox").TObject<{
|
|
124
|
+
provenance: import("typebox").TObject<{
|
|
125
|
+
kind: import("typebox").TLiteral<"local">;
|
|
126
|
+
authorityRoot: import("typebox").TString;
|
|
127
|
+
relativePath: import("typebox").TString;
|
|
128
|
+
}>;
|
|
129
|
+
relativePath: import("typebox").TString;
|
|
130
|
+
absolutePath: import("typebox").TString;
|
|
131
|
+
}>;
|
|
132
|
+
patternName: import("typebox").TString;
|
|
133
|
+
acquisition: import("typebox").TObject<{
|
|
134
|
+
kind: import("typebox").TUnion<[import("typebox").TLiteral<"check">, import("typebox").TLiteral<"apply-dry-run">]>;
|
|
135
|
+
entries: import("typebox").TArray<import("typebox").TObject<{
|
|
136
|
+
source: import("typebox").TUnion<[import("typebox").TObject<{
|
|
137
|
+
kind: import("typebox").TLiteral<"root-role">;
|
|
138
|
+
id: import("typebox").TString;
|
|
139
|
+
}>, import("typebox").TObject<{
|
|
140
|
+
kind: import("typebox").TLiteral<"selection">;
|
|
141
|
+
id: import("typebox").TString;
|
|
142
|
+
member: import("typebox").TString;
|
|
143
|
+
}>]>;
|
|
144
|
+
kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
|
|
145
|
+
path: import("typebox").TString;
|
|
146
|
+
}>>;
|
|
147
|
+
}>;
|
|
148
|
+
}>]>;
|
|
149
|
+
}>>;
|
|
150
|
+
compatibility: import("typebox").TObject<{
|
|
151
|
+
schemaVersion: import("typebox").TLiteral<2>;
|
|
152
|
+
ownerRoots: import("typebox").TRecord<"^.*$", import("typebox").TString>;
|
|
153
|
+
rules: import("typebox").TArray<import("typebox").TObject<{
|
|
154
|
+
id: import("typebox").TString;
|
|
155
|
+
ownerProject: import("typebox").TString;
|
|
156
|
+
manifestPath: import("typebox").TString;
|
|
157
|
+
}>>;
|
|
158
|
+
}>;
|
|
159
|
+
}>;
|
|
160
|
+
}>, import("typebox").TObject<{
|
|
161
|
+
_tag: import("typebox").TLiteral<"Rejected">;
|
|
162
|
+
issues: import("typebox").TArray<import("typebox").TObject<{
|
|
163
|
+
code: import("typebox").TUnion<[import("typebox").TLiteral<"authority-anchor-mismatch">, import("typebox").TLiteral<"authority-blueprint-missing">, import("typebox").TLiteral<"authority-compatibility-invalid">, import("typebox").TLiteral<"authority-definition-invalid">, import("typebox").TLiteral<"authority-definition-kind-mismatch">, import("typebox").TLiteral<"authority-duplicate-blueprint">, import("typebox").TLiteral<"authority-duplicate-instance">, import("typebox").TLiteral<"authority-duplicate-rule">, import("typebox").TLiteral<"authority-filesystem-failed">, import("typebox").TLiteral<"authority-json-invalid">, import("typebox").TLiteral<"authority-manifest-invalid">, import("typebox").TLiteral<"authority-order-invalid">, import("typebox").TLiteral<"authority-path-escape">, import("typebox").TLiteral<"authority-path-invalid">, import("typebox").TLiteral<"authority-path-kind-mismatch">, import("typebox").TLiteral<"authority-path-missing">, import("typebox").TLiteral<"authority-package-name-mismatch">, import("typebox").TLiteral<"authority-policy-pack-members-unsupported">, import("typebox").TLiteral<"authority-resolution-failed">, import("typebox").TLiteral<"authority-rule-invalid">, import("typebox").TLiteral<"authority-schema-invalid">, import("typebox").TLiteral<"authority-toml-invalid">, import("typebox").TLiteral<"authority-version-mismatch">, import("typebox").TLiteral<"authority-workspace-root-invalid">]>;
|
|
164
|
+
path: import("typebox").TString;
|
|
165
|
+
message: import("typebox").TString;
|
|
166
|
+
}>>;
|
|
167
|
+
}>]>>, object>;
|
|
168
|
+
check: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<TypeBoxStandardSchema<import("typebox").TObject<{
|
|
169
|
+
selectors: import("typebox").TOptional<import("typebox").TObject<{
|
|
170
|
+
owner: import("typebox").TOptional<import("typebox").TString>;
|
|
171
|
+
instance: import("typebox").TOptional<import("typebox").TString>;
|
|
172
|
+
rule: import("typebox").TOptional<import("typebox").TString>;
|
|
173
|
+
rules: import("typebox").TOptional<import("typebox").TArray<import("typebox").TString>>;
|
|
174
|
+
runner: import("typebox").TOptional<import("typebox").TString>;
|
|
175
|
+
}>>;
|
|
176
|
+
}>>, TypeBoxStandardSchema<import("typebox").TUnion<[import("typebox").TObject<{
|
|
177
|
+
_tag: import("typebox").TLiteral<"CatalogRejected">;
|
|
178
|
+
issues: import("typebox").TArray<import("typebox").TObject<{
|
|
179
|
+
code: import("typebox").TUnion<[import("typebox").TLiteral<"authority-anchor-mismatch">, import("typebox").TLiteral<"authority-blueprint-missing">, import("typebox").TLiteral<"authority-compatibility-invalid">, import("typebox").TLiteral<"authority-definition-invalid">, import("typebox").TLiteral<"authority-definition-kind-mismatch">, import("typebox").TLiteral<"authority-duplicate-blueprint">, import("typebox").TLiteral<"authority-duplicate-instance">, import("typebox").TLiteral<"authority-duplicate-rule">, import("typebox").TLiteral<"authority-filesystem-failed">, import("typebox").TLiteral<"authority-json-invalid">, import("typebox").TLiteral<"authority-manifest-invalid">, import("typebox").TLiteral<"authority-order-invalid">, import("typebox").TLiteral<"authority-path-escape">, import("typebox").TLiteral<"authority-path-invalid">, import("typebox").TLiteral<"authority-path-kind-mismatch">, import("typebox").TLiteral<"authority-path-missing">, import("typebox").TLiteral<"authority-package-name-mismatch">, import("typebox").TLiteral<"authority-policy-pack-members-unsupported">, import("typebox").TLiteral<"authority-resolution-failed">, import("typebox").TLiteral<"authority-rule-invalid">, import("typebox").TLiteral<"authority-schema-invalid">, import("typebox").TLiteral<"authority-toml-invalid">, import("typebox").TLiteral<"authority-version-mismatch">, import("typebox").TLiteral<"authority-workspace-root-invalid">]>;
|
|
180
|
+
path: import("typebox").TString;
|
|
181
|
+
message: import("typebox").TString;
|
|
182
|
+
}>>;
|
|
183
|
+
}>, import("typebox").TObject<{
|
|
184
|
+
_tag: import("typebox").TLiteral<"SelectionRejected">;
|
|
185
|
+
issues: import("typebox").TArray<import("typebox").TObject<{
|
|
186
|
+
code: import("typebox").TUnion<[import("typebox").TLiteral<"selector-empty">, import("typebox").TLiteral<"selector-unknown">, import("typebox").TLiteral<"selector-wrong-namespace">, import("typebox").TLiteral<"runner-unsupported">]>;
|
|
187
|
+
selector: import("typebox").TString;
|
|
188
|
+
message: import("typebox").TString;
|
|
189
|
+
}>>;
|
|
190
|
+
}>, import("typebox").TObject<{
|
|
191
|
+
_tag: import("typebox").TLiteral<"Completed">;
|
|
192
|
+
ok: import("typebox").TBoolean;
|
|
193
|
+
applications: import("typebox").TArray<import("typebox").TUnion<[import("typebox").TObject<{
|
|
194
|
+
ownerProject: import("typebox").TString;
|
|
195
|
+
instanceId: import("typebox").TString;
|
|
196
|
+
ruleId: import("typebox").TString;
|
|
197
|
+
runner: import("typebox").TLiteral<"grit">;
|
|
198
|
+
lane: import("typebox").TUnion<[import("typebox").TLiteral<"enforced">, import("typebox").TLiteral<"advisory">]>;
|
|
199
|
+
locked: import("typebox").TLiteral<false>;
|
|
200
|
+
status: import("typebox").TUnion<[import("typebox").TLiteral<"pass">, import("typebox").TLiteral<"fail">, import("typebox").TLiteral<"advisory-findings">, import("typebox").TLiteral<"error">]>;
|
|
201
|
+
message: import("typebox").TString;
|
|
202
|
+
remediate: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
|
|
203
|
+
disposition: import("typebox").TUnion<[import("typebox").TObject<{
|
|
204
|
+
kind: import("typebox").TLiteral<"evaluated">;
|
|
205
|
+
}>, import("typebox").TObject<{
|
|
206
|
+
kind: import("typebox").TLiteral<"failed">;
|
|
207
|
+
reason: import("typebox").TUnion<[import("typebox").TUnion<[import("typebox").TLiteral<"InvalidInput">, import("typebox").TLiteral<"SetupFailed">, import("typebox").TLiteral<"ExecutionFailed">, import("typebox").TLiteral<"TimedOut">, import("typebox").TLiteral<"InvalidOutput">]>, import("typebox").TLiteral<"PatternReadFailed">, import("typebox").TLiteral<"PatternInvalid">, import("typebox").TLiteral<"FindingPathInvalid">]>;
|
|
208
|
+
detail: import("typebox").TString;
|
|
209
|
+
}>]>;
|
|
210
|
+
findings: import("typebox").TArray<import("typebox").TObject<{
|
|
211
|
+
path: import("typebox").TString;
|
|
212
|
+
start: import("typebox").TObject<{
|
|
213
|
+
line: import("typebox").TReadonly<import("typebox").TInteger>;
|
|
214
|
+
column: import("typebox").TReadonly<import("typebox").TInteger>;
|
|
215
|
+
offset: import("typebox").TReadonly<import("typebox").TInteger>;
|
|
216
|
+
}>;
|
|
217
|
+
end: import("typebox").TObject<{
|
|
218
|
+
line: import("typebox").TReadonly<import("typebox").TInteger>;
|
|
219
|
+
column: import("typebox").TReadonly<import("typebox").TInteger>;
|
|
220
|
+
offset: import("typebox").TReadonly<import("typebox").TInteger>;
|
|
221
|
+
}>;
|
|
222
|
+
message: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
|
|
223
|
+
severity: import("typebox").TUnion<[import("typebox").TLiteral<"error">, import("typebox").TLiteral<"advisory">]>;
|
|
224
|
+
baselined: import("typebox").TLiteral<false>;
|
|
225
|
+
}>>;
|
|
226
|
+
}>, import("typebox").TObject<{
|
|
227
|
+
ownerProject: import("typebox").TString;
|
|
228
|
+
instanceId: import("typebox").TString;
|
|
229
|
+
ruleId: import("typebox").TString;
|
|
230
|
+
runner: import("typebox").TLiteral<"habitat">;
|
|
231
|
+
lane: import("typebox").TUnion<[import("typebox").TLiteral<"enforced">, import("typebox").TLiteral<"advisory">]>;
|
|
232
|
+
locked: import("typebox").TLiteral<false>;
|
|
233
|
+
status: import("typebox").TUnion<[import("typebox").TLiteral<"pass">, import("typebox").TLiteral<"fail">, import("typebox").TLiteral<"advisory-findings">, import("typebox").TLiteral<"error">]>;
|
|
234
|
+
message: import("typebox").TString;
|
|
235
|
+
remediate: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
|
|
236
|
+
disposition: import("typebox").TUnion<[import("typebox").TObject<{
|
|
237
|
+
kind: import("typebox").TLiteral<"evaluated">;
|
|
238
|
+
}>, import("typebox").TObject<{
|
|
239
|
+
kind: import("typebox").TLiteral<"failed">;
|
|
240
|
+
reason: import("typebox").TUnion<[import("typebox").TLiteral<"StructureReadFailed">, import("typebox").TLiteral<"StructureInvalid">, import("typebox").TLiteral<"InventoryFailed">, import("typebox").TLiteral<"StructureObservationFailed">]>;
|
|
241
|
+
detail: import("typebox").TString;
|
|
242
|
+
}>]>;
|
|
243
|
+
findings: import("typebox").TArray<import("typebox").TObject<{
|
|
244
|
+
path: import("typebox").TString;
|
|
245
|
+
code: import("typebox").TUnion<[import("typebox").TLiteral<"root-missing">, import("typebox").TLiteral<"wrong-root-kind">, import("typebox").TLiteral<"missing-required-child">, import("typebox").TLiteral<"forbidden-child">, import("typebox").TLiteral<"unexpected-child">]>;
|
|
246
|
+
message: import("typebox").TString;
|
|
247
|
+
severity: import("typebox").TUnion<[import("typebox").TLiteral<"error">, import("typebox").TLiteral<"advisory">]>;
|
|
248
|
+
baselined: import("typebox").TLiteral<false>;
|
|
249
|
+
}>>;
|
|
250
|
+
}>]>>;
|
|
251
|
+
}>]>>, object>;
|
|
252
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { standard } from "@habitat-ai/typebox-adapter";
|
|
2
|
+
import { oc } from "@orpc/contract";
|
|
3
|
+
import { ResolveCatalogInputSchema, ResolveCatalogResultSchema } from "../model/dto/catalog.js";
|
|
4
|
+
import { CheckCatalogInputSchema, CheckCatalogResultSchema } from "../model/dto/check.js";
|
|
5
|
+
const resolveInput = standard(ResolveCatalogInputSchema);
|
|
6
|
+
const resolveOutput = standard(ResolveCatalogResultSchema);
|
|
7
|
+
const checkInput = standard(CheckCatalogInputSchema);
|
|
8
|
+
const checkOutput = standard(CheckCatalogResultSchema);
|
|
9
|
+
/** Catalog procedure group exposed through the module contract face. */
|
|
10
|
+
export const catalog = {
|
|
11
|
+
resolve: oc.input(resolveInput).output(resolveOutput),
|
|
12
|
+
check: oc.input(checkInput).output(checkOutput),
|
|
13
|
+
};
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { type Static, Type } from "typebox";
|
|
2
|
+
/** Maximum stable issues returned by one rejected resolution. */
|
|
3
|
+
export declare const MAX_CATALOG_ISSUES = 100;
|
|
4
|
+
/** npm metadata fields that own selected policy-pack package identity. */
|
|
5
|
+
export declare const PolicyPackPackageJsonSchema: Type.TObject<{
|
|
6
|
+
name: Type.TString;
|
|
7
|
+
version: Type.TString;
|
|
8
|
+
}>;
|
|
9
|
+
/** Closed selected policy-pack protocol 1 manifest. */
|
|
10
|
+
export declare const PolicyPackManifestSchema: Type.TObject<{
|
|
11
|
+
protocolVersion: Type.TLiteral<1>;
|
|
12
|
+
blueprints: Type.TArray<Type.TObject<{
|
|
13
|
+
id: Type.TString;
|
|
14
|
+
version: Type.TInteger;
|
|
15
|
+
path: Type.TString;
|
|
16
|
+
}>>;
|
|
17
|
+
}>;
|
|
18
|
+
/** Closed schema for one version 3 blueprint definition document. */
|
|
19
|
+
export declare const BlueprintDefinitionSchema: Type.TObject<{
|
|
20
|
+
schemaVersion: Type.TLiteral<1>;
|
|
21
|
+
id: Type.TString;
|
|
22
|
+
version: Type.TInteger;
|
|
23
|
+
rules: Type.TArray<Type.TObject<{
|
|
24
|
+
id: Type.TString;
|
|
25
|
+
lane: Type.TUnion<[Type.TLiteral<"enforced">, Type.TLiteral<"advisory">]>;
|
|
26
|
+
message: Type.TString;
|
|
27
|
+
remediate: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
28
|
+
runner: Type.TUnion<[Type.TObject<{
|
|
29
|
+
name: Type.TLiteral<"habitat">;
|
|
30
|
+
mode: Type.TLiteral<"structure">;
|
|
31
|
+
structure: Type.TString;
|
|
32
|
+
}>, Type.TObject<{
|
|
33
|
+
name: Type.TLiteral<"grit">;
|
|
34
|
+
pattern: Type.TString;
|
|
35
|
+
patternName: Type.TString;
|
|
36
|
+
acquisition: Type.TObject<{
|
|
37
|
+
kind: Type.TUnion<[Type.TLiteral<"check">, Type.TLiteral<"apply-dry-run">]>;
|
|
38
|
+
rootRoles: Type.TArray<Type.TString>;
|
|
39
|
+
selections: Type.TArray<Type.TString>;
|
|
40
|
+
}>;
|
|
41
|
+
}>]>;
|
|
42
|
+
}>>;
|
|
43
|
+
instance: Type.TObject<{
|
|
44
|
+
manifest: Type.TLiteral<"habitat.toml">;
|
|
45
|
+
anchorRoot: Type.TString;
|
|
46
|
+
roots: Type.TArray<Type.TObject<{
|
|
47
|
+
id: Type.TString;
|
|
48
|
+
required: Type.TBoolean;
|
|
49
|
+
kind: Type.TUnion<[Type.TLiteral<"directory">, Type.TLiteral<"file">]>;
|
|
50
|
+
}>>;
|
|
51
|
+
selections: Type.TArray<Type.TObject<{
|
|
52
|
+
id: Type.TString;
|
|
53
|
+
root: Type.TString;
|
|
54
|
+
kind: Type.TUnion<[Type.TLiteral<"directory">, Type.TLiteral<"file">]>;
|
|
55
|
+
memberPattern: Type.TString;
|
|
56
|
+
pathTemplate: Type.TString;
|
|
57
|
+
}>>;
|
|
58
|
+
}>;
|
|
59
|
+
}>;
|
|
60
|
+
/** Closed schema for one version 3 local instance document. */
|
|
61
|
+
export declare const HabitatInstanceManifestSchema: Type.TObject<{
|
|
62
|
+
schemaVersion: Type.TLiteral<1>;
|
|
63
|
+
id: Type.TString;
|
|
64
|
+
ownerProject: Type.TString;
|
|
65
|
+
blueprint: Type.TString;
|
|
66
|
+
blueprintVersion: Type.TInteger;
|
|
67
|
+
roots: Type.TRecord<"^.*$", Type.TString>;
|
|
68
|
+
selections: Type.TRecord<"^.*$", Type.TArray<Type.TString>>;
|
|
69
|
+
}>;
|
|
70
|
+
/** Closed compatibility index source schema. */
|
|
71
|
+
export declare const CompatibilityIndexSchema: Type.TObject<{
|
|
72
|
+
$comment: Type.TOptional<Type.TString>;
|
|
73
|
+
schemaVersion: Type.TLiteral<2>;
|
|
74
|
+
ownerRoots: Type.TRecord<"^.*$", Type.TString>;
|
|
75
|
+
}>;
|
|
76
|
+
/** Minimum TypeBox admission schema for an inert legacy rule manifest. */
|
|
77
|
+
export declare const CompatibilityRuleSourceSchema: Type.TObject<{
|
|
78
|
+
schemaVersion: Type.TLiteral<2>;
|
|
79
|
+
id: Type.TString;
|
|
80
|
+
ownerProject: Type.TString;
|
|
81
|
+
}>;
|
|
82
|
+
/** Closed empty request; the service owns repository authority enumeration. */
|
|
83
|
+
export declare const ResolveCatalogInputSchema: Type.TObject<{}>;
|
|
84
|
+
/** Closed stable issue schema returned for expected admission failures. */
|
|
85
|
+
export declare const CatalogIssueSchema: Type.TObject<{
|
|
86
|
+
code: Type.TUnion<[Type.TLiteral<"authority-anchor-mismatch">, Type.TLiteral<"authority-blueprint-missing">, Type.TLiteral<"authority-compatibility-invalid">, Type.TLiteral<"authority-definition-invalid">, Type.TLiteral<"authority-definition-kind-mismatch">, Type.TLiteral<"authority-duplicate-blueprint">, Type.TLiteral<"authority-duplicate-instance">, Type.TLiteral<"authority-duplicate-rule">, Type.TLiteral<"authority-filesystem-failed">, Type.TLiteral<"authority-json-invalid">, Type.TLiteral<"authority-manifest-invalid">, Type.TLiteral<"authority-order-invalid">, Type.TLiteral<"authority-path-escape">, Type.TLiteral<"authority-path-invalid">, Type.TLiteral<"authority-path-kind-mismatch">, Type.TLiteral<"authority-path-missing">, Type.TLiteral<"authority-package-name-mismatch">, Type.TLiteral<"authority-policy-pack-members-unsupported">, Type.TLiteral<"authority-resolution-failed">, Type.TLiteral<"authority-rule-invalid">, Type.TLiteral<"authority-schema-invalid">, Type.TLiteral<"authority-toml-invalid">, Type.TLiteral<"authority-version-mismatch">, Type.TLiteral<"authority-workspace-root-invalid">]>;
|
|
87
|
+
path: Type.TString;
|
|
88
|
+
message: Type.TString;
|
|
89
|
+
}>;
|
|
90
|
+
/** Closed resolved/rejected result union for catalog resolution. */
|
|
91
|
+
export declare const ResolveCatalogResultSchema: Type.TUnion<[Type.TObject<{
|
|
92
|
+
_tag: Type.TLiteral<"Resolved">;
|
|
93
|
+
catalog: Type.TObject<{
|
|
94
|
+
schemaVersion: Type.TLiteral<3>;
|
|
95
|
+
policyPack: Type.TObject<{
|
|
96
|
+
name: Type.TString;
|
|
97
|
+
version: Type.TString;
|
|
98
|
+
protocolVersion: Type.TLiteral<1>;
|
|
99
|
+
blueprints: Type.TArray<Type.TObject<{
|
|
100
|
+
id: Type.TString;
|
|
101
|
+
version: Type.TInteger;
|
|
102
|
+
path: Type.TString;
|
|
103
|
+
}>>;
|
|
104
|
+
}>;
|
|
105
|
+
blueprints: Type.TArray<Type.TObject<{
|
|
106
|
+
definition: Type.TObject<{
|
|
107
|
+
schemaVersion: Type.TLiteral<1>;
|
|
108
|
+
id: Type.TString;
|
|
109
|
+
version: Type.TInteger;
|
|
110
|
+
rules: Type.TArray<Type.TObject<{
|
|
111
|
+
id: Type.TString;
|
|
112
|
+
lane: Type.TUnion<[Type.TLiteral<"enforced">, Type.TLiteral<"advisory">]>;
|
|
113
|
+
message: Type.TString;
|
|
114
|
+
remediate: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
115
|
+
runner: Type.TUnion<[Type.TObject<{
|
|
116
|
+
name: Type.TLiteral<"habitat">;
|
|
117
|
+
mode: Type.TLiteral<"structure">;
|
|
118
|
+
structure: Type.TString;
|
|
119
|
+
}>, Type.TObject<{
|
|
120
|
+
name: Type.TLiteral<"grit">;
|
|
121
|
+
pattern: Type.TString;
|
|
122
|
+
patternName: Type.TString;
|
|
123
|
+
acquisition: Type.TObject<{
|
|
124
|
+
kind: Type.TUnion<[Type.TLiteral<"check">, Type.TLiteral<"apply-dry-run">]>;
|
|
125
|
+
rootRoles: Type.TArray<Type.TString>;
|
|
126
|
+
selections: Type.TArray<Type.TString>;
|
|
127
|
+
}>;
|
|
128
|
+
}>]>;
|
|
129
|
+
}>>;
|
|
130
|
+
instance: Type.TObject<{
|
|
131
|
+
manifest: Type.TLiteral<"habitat.toml">;
|
|
132
|
+
anchorRoot: Type.TString;
|
|
133
|
+
roots: Type.TArray<Type.TObject<{
|
|
134
|
+
id: Type.TString;
|
|
135
|
+
required: Type.TBoolean;
|
|
136
|
+
kind: Type.TUnion<[Type.TLiteral<"directory">, Type.TLiteral<"file">]>;
|
|
137
|
+
}>>;
|
|
138
|
+
selections: Type.TArray<Type.TObject<{
|
|
139
|
+
id: Type.TString;
|
|
140
|
+
root: Type.TString;
|
|
141
|
+
kind: Type.TUnion<[Type.TLiteral<"directory">, Type.TLiteral<"file">]>;
|
|
142
|
+
memberPattern: Type.TString;
|
|
143
|
+
pathTemplate: Type.TString;
|
|
144
|
+
}>>;
|
|
145
|
+
}>;
|
|
146
|
+
}>;
|
|
147
|
+
provenance: Type.TObject<{
|
|
148
|
+
kind: Type.TLiteral<"local">;
|
|
149
|
+
authorityRoot: Type.TString;
|
|
150
|
+
relativePath: Type.TString;
|
|
151
|
+
}>;
|
|
152
|
+
}>>;
|
|
153
|
+
instances: Type.TArray<Type.TObject<{
|
|
154
|
+
id: Type.TString;
|
|
155
|
+
ownerProject: Type.TString;
|
|
156
|
+
blueprint: Type.TString;
|
|
157
|
+
blueprintVersion: Type.TInteger;
|
|
158
|
+
manifestPath: Type.TString;
|
|
159
|
+
roots: Type.TArray<Type.TObject<{
|
|
160
|
+
id: Type.TString;
|
|
161
|
+
required: Type.TBoolean;
|
|
162
|
+
kind: Type.TUnion<[Type.TLiteral<"directory">, Type.TLiteral<"file">]>;
|
|
163
|
+
path: Type.TString;
|
|
164
|
+
}>>;
|
|
165
|
+
selections: Type.TArray<Type.TObject<{
|
|
166
|
+
id: Type.TString;
|
|
167
|
+
root: Type.TString;
|
|
168
|
+
members: Type.TArray<Type.TObject<{
|
|
169
|
+
id: Type.TString;
|
|
170
|
+
kind: Type.TUnion<[Type.TLiteral<"directory">, Type.TLiteral<"file">]>;
|
|
171
|
+
path: Type.TString;
|
|
172
|
+
}>>;
|
|
173
|
+
}>>;
|
|
174
|
+
}>>;
|
|
175
|
+
applications: Type.TArray<Type.TObject<{
|
|
176
|
+
ownerProject: Type.TString;
|
|
177
|
+
instanceId: Type.TString;
|
|
178
|
+
blueprint: Type.TString;
|
|
179
|
+
blueprintVersion: Type.TInteger;
|
|
180
|
+
ruleId: Type.TString;
|
|
181
|
+
manifestPath: Type.TString;
|
|
182
|
+
lane: Type.TUnion<[Type.TLiteral<"enforced">, Type.TLiteral<"advisory">]>;
|
|
183
|
+
message: Type.TString;
|
|
184
|
+
remediate: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
185
|
+
provenance: Type.TObject<{
|
|
186
|
+
kind: Type.TLiteral<"local">;
|
|
187
|
+
authorityRoot: Type.TString;
|
|
188
|
+
relativePath: Type.TString;
|
|
189
|
+
}>;
|
|
190
|
+
runner: Type.TUnion<[Type.TObject<{
|
|
191
|
+
name: Type.TLiteral<"habitat">;
|
|
192
|
+
mode: Type.TLiteral<"structure">;
|
|
193
|
+
structure: Type.TObject<{
|
|
194
|
+
provenance: Type.TObject<{
|
|
195
|
+
kind: Type.TLiteral<"local">;
|
|
196
|
+
authorityRoot: Type.TString;
|
|
197
|
+
relativePath: Type.TString;
|
|
198
|
+
}>;
|
|
199
|
+
relativePath: Type.TString;
|
|
200
|
+
absolutePath: Type.TString;
|
|
201
|
+
}>;
|
|
202
|
+
rootBindings: Type.TArray<Type.TObject<{
|
|
203
|
+
rootRole: Type.TString;
|
|
204
|
+
required: Type.TBoolean;
|
|
205
|
+
kind: Type.TUnion<[Type.TLiteral<"directory">, Type.TLiteral<"file">]>;
|
|
206
|
+
path: Type.TOptional<Type.TString>;
|
|
207
|
+
}>>;
|
|
208
|
+
}>, Type.TObject<{
|
|
209
|
+
name: Type.TLiteral<"grit">;
|
|
210
|
+
pattern: Type.TObject<{
|
|
211
|
+
provenance: Type.TObject<{
|
|
212
|
+
kind: Type.TLiteral<"local">;
|
|
213
|
+
authorityRoot: Type.TString;
|
|
214
|
+
relativePath: Type.TString;
|
|
215
|
+
}>;
|
|
216
|
+
relativePath: Type.TString;
|
|
217
|
+
absolutePath: Type.TString;
|
|
218
|
+
}>;
|
|
219
|
+
patternName: Type.TString;
|
|
220
|
+
acquisition: Type.TObject<{
|
|
221
|
+
kind: Type.TUnion<[Type.TLiteral<"check">, Type.TLiteral<"apply-dry-run">]>;
|
|
222
|
+
entries: Type.TArray<Type.TObject<{
|
|
223
|
+
source: Type.TUnion<[Type.TObject<{
|
|
224
|
+
kind: Type.TLiteral<"root-role">;
|
|
225
|
+
id: Type.TString;
|
|
226
|
+
}>, Type.TObject<{
|
|
227
|
+
kind: Type.TLiteral<"selection">;
|
|
228
|
+
id: Type.TString;
|
|
229
|
+
member: Type.TString;
|
|
230
|
+
}>]>;
|
|
231
|
+
kind: Type.TUnion<[Type.TLiteral<"directory">, Type.TLiteral<"file">]>;
|
|
232
|
+
path: Type.TString;
|
|
233
|
+
}>>;
|
|
234
|
+
}>;
|
|
235
|
+
}>]>;
|
|
236
|
+
}>>;
|
|
237
|
+
compatibility: Type.TObject<{
|
|
238
|
+
schemaVersion: Type.TLiteral<2>;
|
|
239
|
+
ownerRoots: Type.TRecord<"^.*$", Type.TString>;
|
|
240
|
+
rules: Type.TArray<Type.TObject<{
|
|
241
|
+
id: Type.TString;
|
|
242
|
+
ownerProject: Type.TString;
|
|
243
|
+
manifestPath: Type.TString;
|
|
244
|
+
}>>;
|
|
245
|
+
}>;
|
|
246
|
+
}>;
|
|
247
|
+
}>, Type.TObject<{
|
|
248
|
+
_tag: Type.TLiteral<"Rejected">;
|
|
249
|
+
issues: Type.TArray<Type.TObject<{
|
|
250
|
+
code: Type.TUnion<[Type.TLiteral<"authority-anchor-mismatch">, Type.TLiteral<"authority-blueprint-missing">, Type.TLiteral<"authority-compatibility-invalid">, Type.TLiteral<"authority-definition-invalid">, Type.TLiteral<"authority-definition-kind-mismatch">, Type.TLiteral<"authority-duplicate-blueprint">, Type.TLiteral<"authority-duplicate-instance">, Type.TLiteral<"authority-duplicate-rule">, Type.TLiteral<"authority-filesystem-failed">, Type.TLiteral<"authority-json-invalid">, Type.TLiteral<"authority-manifest-invalid">, Type.TLiteral<"authority-order-invalid">, Type.TLiteral<"authority-path-escape">, Type.TLiteral<"authority-path-invalid">, Type.TLiteral<"authority-path-kind-mismatch">, Type.TLiteral<"authority-path-missing">, Type.TLiteral<"authority-package-name-mismatch">, Type.TLiteral<"authority-policy-pack-members-unsupported">, Type.TLiteral<"authority-resolution-failed">, Type.TLiteral<"authority-rule-invalid">, Type.TLiteral<"authority-schema-invalid">, Type.TLiteral<"authority-toml-invalid">, Type.TLiteral<"authority-version-mismatch">, Type.TLiteral<"authority-workspace-root-invalid">]>;
|
|
251
|
+
path: Type.TString;
|
|
252
|
+
message: Type.TString;
|
|
253
|
+
}>>;
|
|
254
|
+
}>]>;
|
|
255
|
+
/** One admitted blueprint definition document. */
|
|
256
|
+
export type BlueprintDefinition = Static<typeof BlueprintDefinitionSchema>;
|
|
257
|
+
/** Selected npm package metadata admitted for a policy pack. */
|
|
258
|
+
export type PolicyPackPackageJson = Static<typeof PolicyPackPackageJsonSchema>;
|
|
259
|
+
/** Closed selected policy-pack protocol manifest. */
|
|
260
|
+
export type PolicyPackManifest = Static<typeof PolicyPackManifestSchema>;
|
|
261
|
+
/** One admitted local instance manifest document. */
|
|
262
|
+
export type HabitatInstanceManifest = Static<typeof HabitatInstanceManifestSchema>;
|
|
263
|
+
/** One validated inert compatibility index. */
|
|
264
|
+
export type CompatibilityIndex = Static<typeof CompatibilityIndexSchema>;
|
|
265
|
+
/** One validated inert compatibility rule source identity. */
|
|
266
|
+
export type CompatibilityRuleSource = Static<typeof CompatibilityRuleSourceSchema>;
|
|
267
|
+
/** Caller request for one catalog resolution. */
|
|
268
|
+
export type ResolveCatalogInput = Static<typeof ResolveCatalogInputSchema>;
|
|
269
|
+
/** Public resolved/rejected catalog outcome. */
|
|
270
|
+
export type ResolveCatalogResult = Static<typeof ResolveCatalogResultSchema>;
|
|
271
|
+
/** One bounded stable catalog issue. */
|
|
272
|
+
export type CatalogIssue = Static<typeof CatalogIssueSchema>;
|
|
273
|
+
/** Successful catalog payload extracted from the public result union. */
|
|
274
|
+
export type HabitatCatalog = Extract<ResolveCatalogResult, {
|
|
275
|
+
_tag: "Resolved";
|
|
276
|
+
}>["catalog"];
|