@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.
Files changed (33) hide show
  1. package/dist/client.d.ts +16 -0
  2. package/dist/client.js +16 -0
  3. package/dist/service/base.d.ts +28 -0
  4. package/dist/service/base.js +1 -0
  5. package/dist/service/contract.d.ts +10 -0
  6. package/dist/service/contract.js +5 -0
  7. package/dist/service/impl.d.ts +508 -0
  8. package/dist/service/impl.js +7 -0
  9. package/dist/service/modules/catalog/contract/catalog.d.ts +252 -0
  10. package/dist/service/modules/catalog/contract/catalog.js +13 -0
  11. package/dist/service/modules/catalog/contract/index.d.ts +3 -0
  12. package/dist/service/modules/catalog/contract/index.js +3 -0
  13. package/dist/service/modules/catalog/model/dto/catalog.d.ts +276 -0
  14. package/dist/service/modules/catalog/model/dto/catalog.js +380 -0
  15. package/dist/service/modules/catalog/model/dto/check.d.ts +104 -0
  16. package/dist/service/modules/catalog/model/dto/check.js +305 -0
  17. package/dist/service/modules/catalog/model/dto/structure.d.ts +23 -0
  18. package/dist/service/modules/catalog/model/dto/structure.js +93 -0
  19. package/dist/service/modules/catalog/model/policy/catalog.d.ts +109 -0
  20. package/dist/service/modules/catalog/model/policy/catalog.js +607 -0
  21. package/dist/service/modules/catalog/model/policy/check.d.ts +57 -0
  22. package/dist/service/modules/catalog/model/policy/check.js +207 -0
  23. package/dist/service/modules/catalog/model/policy/structure.d.ts +64 -0
  24. package/dist/service/modules/catalog/model/policy/structure.js +249 -0
  25. package/dist/service/modules/catalog/module.d.ts +521 -0
  26. package/dist/service/modules/catalog/module.js +12 -0
  27. package/dist/service/modules/catalog/router/catalog.router.d.ts +266 -0
  28. package/dist/service/modules/catalog/router/catalog.router.js +659 -0
  29. package/dist/service/modules/catalog/router.d.ts +265 -0
  30. package/dist/service/modules/catalog/router.js +3 -0
  31. package/dist/service/router.d.ts +267 -0
  32. package/dist/service/router.js +4 -0
  33. package/package.json +49 -0
@@ -0,0 +1,265 @@
1
+ /** Composes the completed catalog operations into the module router face. */
2
+ export declare const router: {
3
+ resolve: import("@orpc/server").ImplementedProcedure<import("../../base.js").Context & object, {
4
+ fileSystem: import("effect/FileSystem").FileSystem;
5
+ path: import("effect/Path").Path;
6
+ ruleEvaluation: import("resources/rule-evaluation/dist/contract.js").RuleEvaluationResource<never>;
7
+ sourceInventory: import("resources/source-inventory/dist/contract.js").SourceInventoryResource<never>;
8
+ workspaceRoot: string;
9
+ policyPack: import("../../base.js").SelectedPolicyPack;
10
+ }, import("packages/typebox-adapter/dist/index.js").TypeBoxStandardSchema<import("typebox").TObject<{}>>, import("packages/typebox-adapter/dist/index.js").TypeBoxStandardSchema<import("typebox").TUnion<[import("typebox").TObject<{
11
+ _tag: import("typebox").TLiteral<"Resolved">;
12
+ catalog: import("typebox").TObject<{
13
+ schemaVersion: import("typebox").TLiteral<3>;
14
+ policyPack: import("typebox").TObject<{
15
+ name: import("typebox").TString;
16
+ version: import("typebox").TString;
17
+ protocolVersion: import("typebox").TLiteral<1>;
18
+ blueprints: import("typebox").TArray<import("typebox").TObject<{
19
+ id: import("typebox").TString;
20
+ version: import("typebox").TInteger;
21
+ path: import("typebox").TString;
22
+ }>>;
23
+ }>;
24
+ blueprints: import("typebox").TArray<import("typebox").TObject<{
25
+ definition: import("typebox").TObject<{
26
+ schemaVersion: import("typebox").TLiteral<1>;
27
+ id: import("typebox").TString;
28
+ version: import("typebox").TInteger;
29
+ rules: import("typebox").TArray<import("typebox").TObject<{
30
+ id: import("typebox").TString;
31
+ lane: import("typebox").TUnion<[import("typebox").TLiteral<"enforced">, import("typebox").TLiteral<"advisory">]>;
32
+ message: import("typebox").TString;
33
+ remediate: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
34
+ runner: import("typebox").TUnion<[import("typebox").TObject<{
35
+ name: import("typebox").TLiteral<"habitat">;
36
+ mode: import("typebox").TLiteral<"structure">;
37
+ structure: import("typebox").TString;
38
+ }>, import("typebox").TObject<{
39
+ name: import("typebox").TLiteral<"grit">;
40
+ pattern: import("typebox").TString;
41
+ patternName: import("typebox").TString;
42
+ acquisition: import("typebox").TObject<{
43
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"check">, import("typebox").TLiteral<"apply-dry-run">]>;
44
+ rootRoles: import("typebox").TArray<import("typebox").TString>;
45
+ selections: import("typebox").TArray<import("typebox").TString>;
46
+ }>;
47
+ }>]>;
48
+ }>>;
49
+ instance: import("typebox").TObject<{
50
+ manifest: import("typebox").TLiteral<"habitat.toml">;
51
+ anchorRoot: import("typebox").TString;
52
+ roots: import("typebox").TArray<import("typebox").TObject<{
53
+ id: import("typebox").TString;
54
+ required: import("typebox").TBoolean;
55
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
56
+ }>>;
57
+ selections: import("typebox").TArray<import("typebox").TObject<{
58
+ id: import("typebox").TString;
59
+ root: import("typebox").TString;
60
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
61
+ memberPattern: import("typebox").TString;
62
+ pathTemplate: import("typebox").TString;
63
+ }>>;
64
+ }>;
65
+ }>;
66
+ provenance: import("typebox").TObject<{
67
+ kind: import("typebox").TLiteral<"local">;
68
+ authorityRoot: import("typebox").TString;
69
+ relativePath: import("typebox").TString;
70
+ }>;
71
+ }>>;
72
+ instances: import("typebox").TArray<import("typebox").TObject<{
73
+ id: import("typebox").TString;
74
+ ownerProject: import("typebox").TString;
75
+ blueprint: import("typebox").TString;
76
+ blueprintVersion: import("typebox").TInteger;
77
+ manifestPath: import("typebox").TString;
78
+ roots: import("typebox").TArray<import("typebox").TObject<{
79
+ id: import("typebox").TString;
80
+ required: import("typebox").TBoolean;
81
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
82
+ path: import("typebox").TString;
83
+ }>>;
84
+ selections: import("typebox").TArray<import("typebox").TObject<{
85
+ id: import("typebox").TString;
86
+ root: import("typebox").TString;
87
+ members: import("typebox").TArray<import("typebox").TObject<{
88
+ id: import("typebox").TString;
89
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
90
+ path: import("typebox").TString;
91
+ }>>;
92
+ }>>;
93
+ }>>;
94
+ applications: import("typebox").TArray<import("typebox").TObject<{
95
+ ownerProject: import("typebox").TString;
96
+ instanceId: import("typebox").TString;
97
+ blueprint: import("typebox").TString;
98
+ blueprintVersion: import("typebox").TInteger;
99
+ ruleId: import("typebox").TString;
100
+ manifestPath: import("typebox").TString;
101
+ lane: import("typebox").TUnion<[import("typebox").TLiteral<"enforced">, import("typebox").TLiteral<"advisory">]>;
102
+ message: import("typebox").TString;
103
+ remediate: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
104
+ provenance: import("typebox").TObject<{
105
+ kind: import("typebox").TLiteral<"local">;
106
+ authorityRoot: import("typebox").TString;
107
+ relativePath: import("typebox").TString;
108
+ }>;
109
+ runner: import("typebox").TUnion<[import("typebox").TObject<{
110
+ name: import("typebox").TLiteral<"habitat">;
111
+ mode: import("typebox").TLiteral<"structure">;
112
+ structure: import("typebox").TObject<{
113
+ provenance: import("typebox").TObject<{
114
+ kind: import("typebox").TLiteral<"local">;
115
+ authorityRoot: import("typebox").TString;
116
+ relativePath: import("typebox").TString;
117
+ }>;
118
+ relativePath: import("typebox").TString;
119
+ absolutePath: import("typebox").TString;
120
+ }>;
121
+ rootBindings: import("typebox").TArray<import("typebox").TObject<{
122
+ rootRole: import("typebox").TString;
123
+ required: import("typebox").TBoolean;
124
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
125
+ path: import("typebox").TOptional<import("typebox").TString>;
126
+ }>>;
127
+ }>, import("typebox").TObject<{
128
+ name: import("typebox").TLiteral<"grit">;
129
+ pattern: import("typebox").TObject<{
130
+ provenance: import("typebox").TObject<{
131
+ kind: import("typebox").TLiteral<"local">;
132
+ authorityRoot: import("typebox").TString;
133
+ relativePath: import("typebox").TString;
134
+ }>;
135
+ relativePath: import("typebox").TString;
136
+ absolutePath: import("typebox").TString;
137
+ }>;
138
+ patternName: import("typebox").TString;
139
+ acquisition: import("typebox").TObject<{
140
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"check">, import("typebox").TLiteral<"apply-dry-run">]>;
141
+ entries: import("typebox").TArray<import("typebox").TObject<{
142
+ source: import("typebox").TUnion<[import("typebox").TObject<{
143
+ kind: import("typebox").TLiteral<"root-role">;
144
+ id: import("typebox").TString;
145
+ }>, import("typebox").TObject<{
146
+ kind: import("typebox").TLiteral<"selection">;
147
+ id: import("typebox").TString;
148
+ member: import("typebox").TString;
149
+ }>]>;
150
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
151
+ path: import("typebox").TString;
152
+ }>>;
153
+ }>;
154
+ }>]>;
155
+ }>>;
156
+ compatibility: import("typebox").TObject<{
157
+ schemaVersion: import("typebox").TLiteral<2>;
158
+ ownerRoots: import("typebox").TRecord<"^.*$", import("typebox").TString>;
159
+ rules: import("typebox").TArray<import("typebox").TObject<{
160
+ id: import("typebox").TString;
161
+ ownerProject: import("typebox").TString;
162
+ manifestPath: import("typebox").TString;
163
+ }>>;
164
+ }>;
165
+ }>;
166
+ }>, import("typebox").TObject<{
167
+ _tag: import("typebox").TLiteral<"Rejected">;
168
+ issues: import("typebox").TArray<import("typebox").TObject<{
169
+ 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">]>;
170
+ path: import("typebox").TString;
171
+ message: import("typebox").TString;
172
+ }>>;
173
+ }>]>>, object>;
174
+ check: import("@orpc/server").ImplementedProcedure<import("../../base.js").Context & object, {
175
+ fileSystem: import("effect/FileSystem").FileSystem;
176
+ path: import("effect/Path").Path;
177
+ ruleEvaluation: import("resources/rule-evaluation/dist/contract.js").RuleEvaluationResource<never>;
178
+ sourceInventory: import("resources/source-inventory/dist/contract.js").SourceInventoryResource<never>;
179
+ workspaceRoot: string;
180
+ policyPack: import("../../base.js").SelectedPolicyPack;
181
+ }, import("packages/typebox-adapter/dist/index.js").TypeBoxStandardSchema<import("typebox").TObject<{
182
+ selectors: import("typebox").TOptional<import("typebox").TObject<{
183
+ owner: import("typebox").TOptional<import("typebox").TString>;
184
+ instance: import("typebox").TOptional<import("typebox").TString>;
185
+ rule: import("typebox").TOptional<import("typebox").TString>;
186
+ rules: import("typebox").TOptional<import("typebox").TArray<import("typebox").TString>>;
187
+ runner: import("typebox").TOptional<import("typebox").TString>;
188
+ }>>;
189
+ }>>, import("packages/typebox-adapter/dist/index.js").TypeBoxStandardSchema<import("typebox").TUnion<[import("typebox").TObject<{
190
+ _tag: import("typebox").TLiteral<"CatalogRejected">;
191
+ issues: import("typebox").TArray<import("typebox").TObject<{
192
+ 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">]>;
193
+ path: import("typebox").TString;
194
+ message: import("typebox").TString;
195
+ }>>;
196
+ }>, import("typebox").TObject<{
197
+ _tag: import("typebox").TLiteral<"SelectionRejected">;
198
+ issues: import("typebox").TArray<import("typebox").TObject<{
199
+ 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">]>;
200
+ selector: import("typebox").TString;
201
+ message: import("typebox").TString;
202
+ }>>;
203
+ }>, import("typebox").TObject<{
204
+ _tag: import("typebox").TLiteral<"Completed">;
205
+ ok: import("typebox").TBoolean;
206
+ applications: import("typebox").TArray<import("typebox").TUnion<[import("typebox").TObject<{
207
+ ownerProject: import("typebox").TString;
208
+ instanceId: import("typebox").TString;
209
+ ruleId: import("typebox").TString;
210
+ runner: import("typebox").TLiteral<"grit">;
211
+ lane: import("typebox").TUnion<[import("typebox").TLiteral<"enforced">, import("typebox").TLiteral<"advisory">]>;
212
+ locked: import("typebox").TLiteral<false>;
213
+ status: import("typebox").TUnion<[import("typebox").TLiteral<"pass">, import("typebox").TLiteral<"fail">, import("typebox").TLiteral<"advisory-findings">, import("typebox").TLiteral<"error">]>;
214
+ message: import("typebox").TString;
215
+ remediate: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
216
+ disposition: import("typebox").TUnion<[import("typebox").TObject<{
217
+ kind: import("typebox").TLiteral<"evaluated">;
218
+ }>, import("typebox").TObject<{
219
+ kind: import("typebox").TLiteral<"failed">;
220
+ 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">]>;
221
+ detail: import("typebox").TString;
222
+ }>]>;
223
+ findings: import("typebox").TArray<import("typebox").TObject<{
224
+ path: import("typebox").TString;
225
+ start: import("typebox").TObject<{
226
+ line: import("typebox").TReadonly<import("typebox").TInteger>;
227
+ column: import("typebox").TReadonly<import("typebox").TInteger>;
228
+ offset: import("typebox").TReadonly<import("typebox").TInteger>;
229
+ }>;
230
+ end: import("typebox").TObject<{
231
+ line: import("typebox").TReadonly<import("typebox").TInteger>;
232
+ column: import("typebox").TReadonly<import("typebox").TInteger>;
233
+ offset: import("typebox").TReadonly<import("typebox").TInteger>;
234
+ }>;
235
+ message: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
236
+ severity: import("typebox").TUnion<[import("typebox").TLiteral<"error">, import("typebox").TLiteral<"advisory">]>;
237
+ baselined: import("typebox").TLiteral<false>;
238
+ }>>;
239
+ }>, import("typebox").TObject<{
240
+ ownerProject: import("typebox").TString;
241
+ instanceId: import("typebox").TString;
242
+ ruleId: import("typebox").TString;
243
+ runner: import("typebox").TLiteral<"habitat">;
244
+ lane: import("typebox").TUnion<[import("typebox").TLiteral<"enforced">, import("typebox").TLiteral<"advisory">]>;
245
+ locked: import("typebox").TLiteral<false>;
246
+ status: import("typebox").TUnion<[import("typebox").TLiteral<"pass">, import("typebox").TLiteral<"fail">, import("typebox").TLiteral<"advisory-findings">, import("typebox").TLiteral<"error">]>;
247
+ message: import("typebox").TString;
248
+ remediate: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
249
+ disposition: import("typebox").TUnion<[import("typebox").TObject<{
250
+ kind: import("typebox").TLiteral<"evaluated">;
251
+ }>, import("typebox").TObject<{
252
+ kind: import("typebox").TLiteral<"failed">;
253
+ reason: import("typebox").TUnion<[import("typebox").TLiteral<"StructureReadFailed">, import("typebox").TLiteral<"StructureInvalid">, import("typebox").TLiteral<"InventoryFailed">, import("typebox").TLiteral<"StructureObservationFailed">]>;
254
+ detail: import("typebox").TString;
255
+ }>]>;
256
+ findings: import("typebox").TArray<import("typebox").TObject<{
257
+ path: import("typebox").TString;
258
+ 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">]>;
259
+ message: import("typebox").TString;
260
+ severity: import("typebox").TUnion<[import("typebox").TLiteral<"error">, import("typebox").TLiteral<"advisory">]>;
261
+ baselined: import("typebox").TLiteral<false>;
262
+ }>>;
263
+ }>]>>;
264
+ }>]>>, object>;
265
+ };
@@ -0,0 +1,3 @@
1
+ import { catalog } from "./router/catalog.router.js";
2
+ /** Composes the completed catalog operations into the module router face. */
3
+ export const router = { ...catalog };
@@ -0,0 +1,267 @@
1
+ /** Completes the Habitat service from its catalog module router. */
2
+ export declare const router: {
3
+ catalog: {
4
+ resolve: import("@orpc/server").ImplementedProcedure<import("./base.js").Context & object, {
5
+ fileSystem: import("effect/FileSystem").FileSystem;
6
+ path: import("effect/Path").Path;
7
+ ruleEvaluation: import("resources/rule-evaluation/dist/contract.js").RuleEvaluationResource<never>;
8
+ sourceInventory: import("resources/source-inventory/dist/contract.js").SourceInventoryResource<never>;
9
+ workspaceRoot: string;
10
+ policyPack: import("./base.js").SelectedPolicyPack;
11
+ }, import("packages/typebox-adapter/dist/index.js").TypeBoxStandardSchema<import("typebox").TObject<{}>>, import("packages/typebox-adapter/dist/index.js").TypeBoxStandardSchema<import("typebox").TUnion<[import("typebox").TObject<{
12
+ _tag: import("typebox").TLiteral<"Resolved">;
13
+ catalog: import("typebox").TObject<{
14
+ schemaVersion: import("typebox").TLiteral<3>;
15
+ policyPack: import("typebox").TObject<{
16
+ name: import("typebox").TString;
17
+ version: import("typebox").TString;
18
+ protocolVersion: import("typebox").TLiteral<1>;
19
+ blueprints: import("typebox").TArray<import("typebox").TObject<{
20
+ id: import("typebox").TString;
21
+ version: import("typebox").TInteger;
22
+ path: import("typebox").TString;
23
+ }>>;
24
+ }>;
25
+ blueprints: import("typebox").TArray<import("typebox").TObject<{
26
+ definition: import("typebox").TObject<{
27
+ schemaVersion: import("typebox").TLiteral<1>;
28
+ id: import("typebox").TString;
29
+ version: import("typebox").TInteger;
30
+ rules: import("typebox").TArray<import("typebox").TObject<{
31
+ id: import("typebox").TString;
32
+ lane: import("typebox").TUnion<[import("typebox").TLiteral<"enforced">, import("typebox").TLiteral<"advisory">]>;
33
+ message: import("typebox").TString;
34
+ remediate: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
35
+ runner: import("typebox").TUnion<[import("typebox").TObject<{
36
+ name: import("typebox").TLiteral<"habitat">;
37
+ mode: import("typebox").TLiteral<"structure">;
38
+ structure: import("typebox").TString;
39
+ }>, import("typebox").TObject<{
40
+ name: import("typebox").TLiteral<"grit">;
41
+ pattern: import("typebox").TString;
42
+ patternName: import("typebox").TString;
43
+ acquisition: import("typebox").TObject<{
44
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"check">, import("typebox").TLiteral<"apply-dry-run">]>;
45
+ rootRoles: import("typebox").TArray<import("typebox").TString>;
46
+ selections: import("typebox").TArray<import("typebox").TString>;
47
+ }>;
48
+ }>]>;
49
+ }>>;
50
+ instance: import("typebox").TObject<{
51
+ manifest: import("typebox").TLiteral<"habitat.toml">;
52
+ anchorRoot: import("typebox").TString;
53
+ roots: import("typebox").TArray<import("typebox").TObject<{
54
+ id: import("typebox").TString;
55
+ required: import("typebox").TBoolean;
56
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
57
+ }>>;
58
+ selections: import("typebox").TArray<import("typebox").TObject<{
59
+ id: import("typebox").TString;
60
+ root: import("typebox").TString;
61
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
62
+ memberPattern: import("typebox").TString;
63
+ pathTemplate: import("typebox").TString;
64
+ }>>;
65
+ }>;
66
+ }>;
67
+ provenance: import("typebox").TObject<{
68
+ kind: import("typebox").TLiteral<"local">;
69
+ authorityRoot: import("typebox").TString;
70
+ relativePath: import("typebox").TString;
71
+ }>;
72
+ }>>;
73
+ instances: import("typebox").TArray<import("typebox").TObject<{
74
+ id: import("typebox").TString;
75
+ ownerProject: import("typebox").TString;
76
+ blueprint: import("typebox").TString;
77
+ blueprintVersion: import("typebox").TInteger;
78
+ manifestPath: import("typebox").TString;
79
+ roots: import("typebox").TArray<import("typebox").TObject<{
80
+ id: import("typebox").TString;
81
+ required: import("typebox").TBoolean;
82
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
83
+ path: import("typebox").TString;
84
+ }>>;
85
+ selections: import("typebox").TArray<import("typebox").TObject<{
86
+ id: import("typebox").TString;
87
+ root: import("typebox").TString;
88
+ members: import("typebox").TArray<import("typebox").TObject<{
89
+ id: import("typebox").TString;
90
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
91
+ path: import("typebox").TString;
92
+ }>>;
93
+ }>>;
94
+ }>>;
95
+ applications: import("typebox").TArray<import("typebox").TObject<{
96
+ ownerProject: import("typebox").TString;
97
+ instanceId: import("typebox").TString;
98
+ blueprint: import("typebox").TString;
99
+ blueprintVersion: import("typebox").TInteger;
100
+ ruleId: import("typebox").TString;
101
+ manifestPath: import("typebox").TString;
102
+ lane: import("typebox").TUnion<[import("typebox").TLiteral<"enforced">, import("typebox").TLiteral<"advisory">]>;
103
+ message: import("typebox").TString;
104
+ remediate: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
105
+ provenance: import("typebox").TObject<{
106
+ kind: import("typebox").TLiteral<"local">;
107
+ authorityRoot: import("typebox").TString;
108
+ relativePath: import("typebox").TString;
109
+ }>;
110
+ runner: import("typebox").TUnion<[import("typebox").TObject<{
111
+ name: import("typebox").TLiteral<"habitat">;
112
+ mode: import("typebox").TLiteral<"structure">;
113
+ structure: import("typebox").TObject<{
114
+ provenance: import("typebox").TObject<{
115
+ kind: import("typebox").TLiteral<"local">;
116
+ authorityRoot: import("typebox").TString;
117
+ relativePath: import("typebox").TString;
118
+ }>;
119
+ relativePath: import("typebox").TString;
120
+ absolutePath: import("typebox").TString;
121
+ }>;
122
+ rootBindings: import("typebox").TArray<import("typebox").TObject<{
123
+ rootRole: import("typebox").TString;
124
+ required: import("typebox").TBoolean;
125
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
126
+ path: import("typebox").TOptional<import("typebox").TString>;
127
+ }>>;
128
+ }>, import("typebox").TObject<{
129
+ name: import("typebox").TLiteral<"grit">;
130
+ pattern: import("typebox").TObject<{
131
+ provenance: import("typebox").TObject<{
132
+ kind: import("typebox").TLiteral<"local">;
133
+ authorityRoot: import("typebox").TString;
134
+ relativePath: import("typebox").TString;
135
+ }>;
136
+ relativePath: import("typebox").TString;
137
+ absolutePath: import("typebox").TString;
138
+ }>;
139
+ patternName: import("typebox").TString;
140
+ acquisition: import("typebox").TObject<{
141
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"check">, import("typebox").TLiteral<"apply-dry-run">]>;
142
+ entries: import("typebox").TArray<import("typebox").TObject<{
143
+ source: import("typebox").TUnion<[import("typebox").TObject<{
144
+ kind: import("typebox").TLiteral<"root-role">;
145
+ id: import("typebox").TString;
146
+ }>, import("typebox").TObject<{
147
+ kind: import("typebox").TLiteral<"selection">;
148
+ id: import("typebox").TString;
149
+ member: import("typebox").TString;
150
+ }>]>;
151
+ kind: import("typebox").TUnion<[import("typebox").TLiteral<"directory">, import("typebox").TLiteral<"file">]>;
152
+ path: import("typebox").TString;
153
+ }>>;
154
+ }>;
155
+ }>]>;
156
+ }>>;
157
+ compatibility: import("typebox").TObject<{
158
+ schemaVersion: import("typebox").TLiteral<2>;
159
+ ownerRoots: import("typebox").TRecord<"^.*$", import("typebox").TString>;
160
+ rules: import("typebox").TArray<import("typebox").TObject<{
161
+ id: import("typebox").TString;
162
+ ownerProject: import("typebox").TString;
163
+ manifestPath: import("typebox").TString;
164
+ }>>;
165
+ }>;
166
+ }>;
167
+ }>, import("typebox").TObject<{
168
+ _tag: import("typebox").TLiteral<"Rejected">;
169
+ issues: import("typebox").TArray<import("typebox").TObject<{
170
+ 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">]>;
171
+ path: import("typebox").TString;
172
+ message: import("typebox").TString;
173
+ }>>;
174
+ }>]>>, object>;
175
+ check: import("@orpc/server").ImplementedProcedure<import("./base.js").Context & object, {
176
+ fileSystem: import("effect/FileSystem").FileSystem;
177
+ path: import("effect/Path").Path;
178
+ ruleEvaluation: import("resources/rule-evaluation/dist/contract.js").RuleEvaluationResource<never>;
179
+ sourceInventory: import("resources/source-inventory/dist/contract.js").SourceInventoryResource<never>;
180
+ workspaceRoot: string;
181
+ policyPack: import("./base.js").SelectedPolicyPack;
182
+ }, import("packages/typebox-adapter/dist/index.js").TypeBoxStandardSchema<import("typebox").TObject<{
183
+ selectors: import("typebox").TOptional<import("typebox").TObject<{
184
+ owner: import("typebox").TOptional<import("typebox").TString>;
185
+ instance: import("typebox").TOptional<import("typebox").TString>;
186
+ rule: import("typebox").TOptional<import("typebox").TString>;
187
+ rules: import("typebox").TOptional<import("typebox").TArray<import("typebox").TString>>;
188
+ runner: import("typebox").TOptional<import("typebox").TString>;
189
+ }>>;
190
+ }>>, import("packages/typebox-adapter/dist/index.js").TypeBoxStandardSchema<import("typebox").TUnion<[import("typebox").TObject<{
191
+ _tag: import("typebox").TLiteral<"CatalogRejected">;
192
+ issues: import("typebox").TArray<import("typebox").TObject<{
193
+ 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">]>;
194
+ path: import("typebox").TString;
195
+ message: import("typebox").TString;
196
+ }>>;
197
+ }>, import("typebox").TObject<{
198
+ _tag: import("typebox").TLiteral<"SelectionRejected">;
199
+ issues: import("typebox").TArray<import("typebox").TObject<{
200
+ 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">]>;
201
+ selector: import("typebox").TString;
202
+ message: import("typebox").TString;
203
+ }>>;
204
+ }>, import("typebox").TObject<{
205
+ _tag: import("typebox").TLiteral<"Completed">;
206
+ ok: import("typebox").TBoolean;
207
+ applications: import("typebox").TArray<import("typebox").TUnion<[import("typebox").TObject<{
208
+ ownerProject: import("typebox").TString;
209
+ instanceId: import("typebox").TString;
210
+ ruleId: import("typebox").TString;
211
+ runner: import("typebox").TLiteral<"grit">;
212
+ lane: import("typebox").TUnion<[import("typebox").TLiteral<"enforced">, import("typebox").TLiteral<"advisory">]>;
213
+ locked: import("typebox").TLiteral<false>;
214
+ status: import("typebox").TUnion<[import("typebox").TLiteral<"pass">, import("typebox").TLiteral<"fail">, import("typebox").TLiteral<"advisory-findings">, import("typebox").TLiteral<"error">]>;
215
+ message: import("typebox").TString;
216
+ remediate: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
217
+ disposition: import("typebox").TUnion<[import("typebox").TObject<{
218
+ kind: import("typebox").TLiteral<"evaluated">;
219
+ }>, import("typebox").TObject<{
220
+ kind: import("typebox").TLiteral<"failed">;
221
+ 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">]>;
222
+ detail: import("typebox").TString;
223
+ }>]>;
224
+ findings: import("typebox").TArray<import("typebox").TObject<{
225
+ path: import("typebox").TString;
226
+ start: import("typebox").TObject<{
227
+ line: import("typebox").TReadonly<import("typebox").TInteger>;
228
+ column: import("typebox").TReadonly<import("typebox").TInteger>;
229
+ offset: import("typebox").TReadonly<import("typebox").TInteger>;
230
+ }>;
231
+ end: import("typebox").TObject<{
232
+ line: import("typebox").TReadonly<import("typebox").TInteger>;
233
+ column: import("typebox").TReadonly<import("typebox").TInteger>;
234
+ offset: import("typebox").TReadonly<import("typebox").TInteger>;
235
+ }>;
236
+ message: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
237
+ severity: import("typebox").TUnion<[import("typebox").TLiteral<"error">, import("typebox").TLiteral<"advisory">]>;
238
+ baselined: import("typebox").TLiteral<false>;
239
+ }>>;
240
+ }>, import("typebox").TObject<{
241
+ ownerProject: import("typebox").TString;
242
+ instanceId: import("typebox").TString;
243
+ ruleId: import("typebox").TString;
244
+ runner: import("typebox").TLiteral<"habitat">;
245
+ lane: import("typebox").TUnion<[import("typebox").TLiteral<"enforced">, import("typebox").TLiteral<"advisory">]>;
246
+ locked: import("typebox").TLiteral<false>;
247
+ status: import("typebox").TUnion<[import("typebox").TLiteral<"pass">, import("typebox").TLiteral<"fail">, import("typebox").TLiteral<"advisory-findings">, import("typebox").TLiteral<"error">]>;
248
+ message: import("typebox").TString;
249
+ remediate: import("typebox").TUnion<[import("typebox").TString, import("typebox").TNull]>;
250
+ disposition: import("typebox").TUnion<[import("typebox").TObject<{
251
+ kind: import("typebox").TLiteral<"evaluated">;
252
+ }>, import("typebox").TObject<{
253
+ kind: import("typebox").TLiteral<"failed">;
254
+ reason: import("typebox").TUnion<[import("typebox").TLiteral<"StructureReadFailed">, import("typebox").TLiteral<"StructureInvalid">, import("typebox").TLiteral<"InventoryFailed">, import("typebox").TLiteral<"StructureObservationFailed">]>;
255
+ detail: import("typebox").TString;
256
+ }>]>;
257
+ findings: import("typebox").TArray<import("typebox").TObject<{
258
+ path: import("typebox").TString;
259
+ 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">]>;
260
+ message: import("typebox").TString;
261
+ severity: import("typebox").TUnion<[import("typebox").TLiteral<"error">, import("typebox").TLiteral<"advisory">]>;
262
+ baselined: import("typebox").TLiteral<false>;
263
+ }>>;
264
+ }>]>>;
265
+ }>]>>, object>;
266
+ };
267
+ };
@@ -0,0 +1,4 @@
1
+ import { impl } from "./impl.js";
2
+ import { router as catalog } from "./modules/catalog/router.js";
3
+ /** Completes the Habitat service from its catalog module router. */
4
+ export const router = impl.router({ catalog });
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@habitat-ai/service",
3
+ "version": "0.2.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "packageManager": "bun@1.3.14",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "exports": {
11
+ "./client": {
12
+ "types": "./dist/client.d.ts",
13
+ "default": "./dist/client.js"
14
+ }
15
+ },
16
+ "scripts": {
17
+ "build": "tsc -p tsconfig.build.json",
18
+ "typecheck": "tsc -p tsconfig.json --noEmit",
19
+ "test": "bun test test"
20
+ },
21
+ "dependencies": {
22
+ "@habitat-ai/resource-rule-evaluation": "0.2.0",
23
+ "@habitat-ai/resource-source-inventory": "0.2.0",
24
+ "@opentelemetry/api": "^1.9.0",
25
+ "@orpc/contract": "2.0.0-beta.20",
26
+ "@orpc/experimental-effect": "2.0.0-beta.20",
27
+ "@orpc/server": "2.0.0-beta.20",
28
+ "@habitat-ai/typebox-adapter": "0.1.0",
29
+ "effect": "4.0.0-beta.101",
30
+ "picomatch": "4.0.4",
31
+ "smol-toml": "1.7.0",
32
+ "typebox": "1.3.8"
33
+ },
34
+ "devDependencies": {
35
+ "@effect/platform-node": "4.0.0-beta.101",
36
+ "@types/picomatch": "4.0.3",
37
+ "bun-types": "1.3.14",
38
+ "typescript": "^5.9.3"
39
+ },
40
+ "nx": {
41
+ "tags": [
42
+ "type:service",
43
+ "role:servicepackage"
44
+ ]
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ }
49
+ }