@xemahq/lockfile-resolver 0.1.1
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/LICENSE +201 -0
- package/README.md +64 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/errors.d.ts +23 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +50 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/lockfile-resolver.d.ts +33 -0
- package/dist/lib/lockfile-resolver.d.ts.map +1 -0
- package/dist/lib/lockfile-resolver.js +119 -0
- package/dist/lib/lockfile-resolver.js.map +1 -0
- package/dist/lib/lockfile-source.d.ts +9 -0
- package/dist/lib/lockfile-source.d.ts.map +1 -0
- package/dist/lib/lockfile-source.js +3 -0
- package/dist/lib/lockfile-source.js.map +1 -0
- package/dist/lib/version-constraint.d.ts +23 -0
- package/dist/lib/version-constraint.d.ts.map +1 -0
- package/dist/lib/version-constraint.js +162 -0
- package/dist/lib/version-constraint.js.map +1 -0
- package/package.json +39 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Support. While redistributing the Work or
|
|
166
|
+
Derivative Works thereof, You may choose to offer, and charge a
|
|
167
|
+
fee for, acceptance of support, warranty, indemnity, or other
|
|
168
|
+
liability obligations and/or rights consistent with this License.
|
|
169
|
+
However, in accepting such obligations, You may act only on Your
|
|
170
|
+
own behalf and on Your sole responsibility, not on behalf of any
|
|
171
|
+
other Contributor, and only if You agree to indemnify, defend, and
|
|
172
|
+
hold each Contributor harmless for any liability incurred by, or
|
|
173
|
+
claims asserted against, such Contributor by reason of your
|
|
174
|
+
accepting any such warranty or support.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Xema
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<svg width="680" height="120" viewBox="0 0 680 120" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="@xemahq/lockfile-resolver">
|
|
3
|
+
<rect width="680" height="120" rx="14" fill="#0B1020"/>
|
|
4
|
+
<g transform="translate(28,34)">
|
|
5
|
+
<path d="M26 0 L52 15 L52 45 L26 60 L0 45 L0 15 Z" fill="#8B5CF6" opacity="0.18"/>
|
|
6
|
+
<path d="M26 12 L41 21 L41 39 L26 48 L11 39 L11 21 Z" fill="#8B5CF6"/>
|
|
7
|
+
</g>
|
|
8
|
+
<text x="92" y="52" font-family="ui-monospace,SFMono-Regular,Menlo,monospace" font-size="22" fill="#F8FAFC" font-weight="700">@xemahq/lockfile-resolver</text>
|
|
9
|
+
<text x="92" y="80" font-family="ui-sans-serif,system-ui,sans-serif" font-size="15" fill="#94A3B8">Resolves an App's installed units into a pinned lockfile</text>
|
|
10
|
+
<text x="652" y="105" text-anchor="end" font-family="ui-sans-serif,system-ui,sans-serif" font-size="12" fill="#475569">xema.dev</text>
|
|
11
|
+
</svg>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://xema.dev">Website</a> ·
|
|
16
|
+
<a href="https://www.npmjs.com/package/@xemahq/lockfile-resolver">npm</a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img alt="npm" src="https://img.shields.io/npm/v/%40xemahq%2Flockfile-resolver?color=2563eb&label=npm">
|
|
21
|
+
<img alt="license" src="https://img.shields.io/npm/l/%40xemahq%2Flockfile-resolver?color=10b981">
|
|
22
|
+
<img alt="types" src="https://img.shields.io/npm/types/%40xemahq%2Flockfile-resolver?color=3178c6">
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
# @xemahq/lockfile-resolver
|
|
26
|
+
|
|
27
|
+
> Resolves an App's installed units into a pinned lockfile
|
|
28
|
+
|
|
29
|
+
## Overview
|
|
30
|
+
|
|
31
|
+
A leaf resolver that turns an App's installed-biome list — plus optional agent,
|
|
32
|
+
workflow, deliverable-spec, and skill references — into a fully pinned lockfile.
|
|
33
|
+
It ships the closed freeze-policy enum, a minimal caret/tilde/exact semver
|
|
34
|
+
matcher (no `semver` dependency), a pluggable source interface, and structured
|
|
35
|
+
errors. Lockfile keys are sorted so equivalent inputs serialize identically.
|
|
36
|
+
Concrete sources live in the consuming service; this package owns only the
|
|
37
|
+
resolution algebra — no NestJS, no fetch.
|
|
38
|
+
|
|
39
|
+
## When to use it
|
|
40
|
+
|
|
41
|
+
- Use it to compute a deterministic, byte-stable lockfile from declared install
|
|
42
|
+
refs and version constraints.
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pnpm add @xemahq/lockfile-resolver
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import { LockfileResolver } from '@xemahq/lockfile-resolver';
|
|
54
|
+
|
|
55
|
+
const resolver = new LockfileResolver({ sources });
|
|
56
|
+
|
|
57
|
+
const lockfile = await resolver.resolve({
|
|
58
|
+
installs: [{ kind: 'biome', ref: 'my-biome', constraint: '^1.2.0' }],
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
Apache-2.0 © Xema — [xema.dev](https://xema.dev)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./lib/errors"), exports);
|
|
18
|
+
__exportStar(require("./lib/version-constraint"), exports);
|
|
19
|
+
__exportStar(require("./lib/lockfile-source"), exports);
|
|
20
|
+
__exportStar(require("./lib/lockfile-resolver"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2DAAyC;AACzC,wDAAsC;AACtC,0DAAwC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare enum LockfileResolverErrorCode {
|
|
2
|
+
InvalidConstraint = "INVALID_CONSTRAINT",
|
|
3
|
+
ConstraintUnsatisfied = "CONSTRAINT_UNSATISFIED",
|
|
4
|
+
SourceUnreachable = "SOURCE_UNREACHABLE",
|
|
5
|
+
UnknownKind = "UNKNOWN_KIND",
|
|
6
|
+
RefMalformed = "REF_MALFORMED"
|
|
7
|
+
}
|
|
8
|
+
export interface LockfileResolverErrorOptions {
|
|
9
|
+
readonly code: LockfileResolverErrorCode;
|
|
10
|
+
readonly message?: string;
|
|
11
|
+
readonly ref?: string;
|
|
12
|
+
readonly constraint?: string;
|
|
13
|
+
readonly sourceName?: string;
|
|
14
|
+
readonly cause?: unknown;
|
|
15
|
+
}
|
|
16
|
+
export declare class LockfileResolverError extends Error {
|
|
17
|
+
readonly code: LockfileResolverErrorCode;
|
|
18
|
+
readonly ref?: string;
|
|
19
|
+
readonly constraint?: string;
|
|
20
|
+
readonly sourceName?: string;
|
|
21
|
+
constructor(opts: LockfileResolverErrorOptions);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAQA,oBAAY,yBAAyB;IACnC,iBAAiB,uBAAuB;IACxC,qBAAqB,2BAA2B;IAChD,iBAAiB,uBAAuB;IACxC,WAAW,iBAAiB;IAC5B,YAAY,kBAAkB;CAC/B;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AASD,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,SAAgB,IAAI,EAAE,yBAAyB,CAAC;IAChD,SAAgB,GAAG,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpC,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;gBAEjB,IAAI,EAAE,4BAA4B;CAmBtD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LockfileResolverError = exports.LockfileResolverErrorCode = void 0;
|
|
4
|
+
var LockfileResolverErrorCode;
|
|
5
|
+
(function (LockfileResolverErrorCode) {
|
|
6
|
+
LockfileResolverErrorCode["InvalidConstraint"] = "INVALID_CONSTRAINT";
|
|
7
|
+
LockfileResolverErrorCode["ConstraintUnsatisfied"] = "CONSTRAINT_UNSATISFIED";
|
|
8
|
+
LockfileResolverErrorCode["SourceUnreachable"] = "SOURCE_UNREACHABLE";
|
|
9
|
+
LockfileResolverErrorCode["UnknownKind"] = "UNKNOWN_KIND";
|
|
10
|
+
LockfileResolverErrorCode["RefMalformed"] = "REF_MALFORMED";
|
|
11
|
+
})(LockfileResolverErrorCode || (exports.LockfileResolverErrorCode = LockfileResolverErrorCode = {}));
|
|
12
|
+
class LockfileResolverError extends Error {
|
|
13
|
+
code;
|
|
14
|
+
ref;
|
|
15
|
+
constraint;
|
|
16
|
+
sourceName;
|
|
17
|
+
constructor(opts) {
|
|
18
|
+
super(opts.message ?? defaultMessage(opts));
|
|
19
|
+
this.name = 'LockfileResolverError';
|
|
20
|
+
this.code = opts.code;
|
|
21
|
+
if (opts.ref !== undefined) {
|
|
22
|
+
this.ref = opts.ref;
|
|
23
|
+
}
|
|
24
|
+
if (opts.constraint !== undefined) {
|
|
25
|
+
this.constraint = opts.constraint;
|
|
26
|
+
}
|
|
27
|
+
if (opts.sourceName !== undefined) {
|
|
28
|
+
this.sourceName = opts.sourceName;
|
|
29
|
+
}
|
|
30
|
+
if (opts.cause !== undefined) {
|
|
31
|
+
this.cause = opts.cause;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.LockfileResolverError = LockfileResolverError;
|
|
36
|
+
function defaultMessage(opts) {
|
|
37
|
+
switch (opts.code) {
|
|
38
|
+
case LockfileResolverErrorCode.InvalidConstraint:
|
|
39
|
+
return `Invalid version constraint${opts.constraint ? ` "${opts.constraint}"` : ''}.`;
|
|
40
|
+
case LockfileResolverErrorCode.ConstraintUnsatisfied:
|
|
41
|
+
return `No published version of "${opts.ref ?? '<unknown>'}" satisfies constraint${opts.constraint ? ` "${opts.constraint}"` : ''}.`;
|
|
42
|
+
case LockfileResolverErrorCode.SourceUnreachable:
|
|
43
|
+
return `Lockfile source "${opts.sourceName ?? '<unknown>'}" was unreachable while resolving "${opts.ref ?? '<unknown>'}".`;
|
|
44
|
+
case LockfileResolverErrorCode.UnknownKind:
|
|
45
|
+
return `No LockfileSource registered for kind required by "${opts.ref ?? '<unknown>'}".`;
|
|
46
|
+
case LockfileResolverErrorCode.RefMalformed:
|
|
47
|
+
return `Malformed reference "${opts.ref ?? '<unknown>'}".`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":";;;AAQA,IAAY,yBAMX;AAND,WAAY,yBAAyB;IACnC,qEAAwC,CAAA;IACxC,6EAAgD,CAAA;IAChD,qEAAwC,CAAA;IACxC,yDAA4B,CAAA;IAC5B,2DAA8B,CAAA;AAChC,CAAC,EANW,yBAAyB,yCAAzB,yBAAyB,QAMpC;AAkBD,MAAa,qBAAsB,SAAQ,KAAK;IAC9B,IAAI,CAA4B;IAChC,GAAG,CAAU;IACb,UAAU,CAAU;IACpB,UAAU,CAAU;IAEpC,YAAmB,IAAkC;QACnD,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;YAC3B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACtB,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACpC,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACpC,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAG5B,IAA4B,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACnD,CAAC;IACH,CAAC;CACF;AAzBD,sDAyBC;AAED,SAAS,cAAc,CAAC,IAAkC;IACxD,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,yBAAyB,CAAC,iBAAiB;YAC9C,OAAO,6BAA6B,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;QACxF,KAAK,yBAAyB,CAAC,qBAAqB;YAClD,OAAO,4BAA4B,IAAI,CAAC,GAAG,IAAI,WAAW,yBAAyB,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;QACvI,KAAK,yBAAyB,CAAC,iBAAiB;YAC9C,OAAO,oBAAoB,IAAI,CAAC,UAAU,IAAI,WAAW,sCAAsC,IAAI,CAAC,GAAG,IAAI,WAAW,IAAI,CAAC;QAC7H,KAAK,yBAAyB,CAAC,WAAW;YACxC,OAAO,sDAAsD,IAAI,CAAC,GAAG,IAAI,WAAW,IAAI,CAAC;QAC3F,KAAK,yBAAyB,CAAC,YAAY;YACzC,OAAO,wBAAwB,IAAI,CAAC,GAAG,IAAI,WAAW,IAAI,CAAC;IAC/D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AppLockfile } from '@xemahq/kernel-contracts/app-runtime';
|
|
2
|
+
import { type LockfileSource, type LockfileSourceKind } from './lockfile-source';
|
|
3
|
+
export interface LockfileEntry {
|
|
4
|
+
ref: string;
|
|
5
|
+
constraint?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface LockfileResolverInput {
|
|
8
|
+
kernel: {
|
|
9
|
+
version: string;
|
|
10
|
+
};
|
|
11
|
+
capabilities: ReadonlyArray<{
|
|
12
|
+
ref: string;
|
|
13
|
+
}>;
|
|
14
|
+
biomes: ReadonlyArray<LockfileEntry>;
|
|
15
|
+
agents?: ReadonlyArray<LockfileEntry>;
|
|
16
|
+
workflows?: ReadonlyArray<LockfileEntry>;
|
|
17
|
+
deliverableSpecs?: ReadonlyArray<LockfileEntry>;
|
|
18
|
+
skills?: ReadonlyArray<LockfileEntry>;
|
|
19
|
+
}
|
|
20
|
+
export type LockfileSourceRegistry = Partial<Record<LockfileSourceKind, LockfileSource>>;
|
|
21
|
+
export interface LockfileResolverOptions {
|
|
22
|
+
sources: LockfileSourceRegistry;
|
|
23
|
+
}
|
|
24
|
+
export declare class LockfileResolver {
|
|
25
|
+
private readonly sources;
|
|
26
|
+
constructor(opts: LockfileResolverOptions);
|
|
27
|
+
resolve(input: LockfileResolverInput): Promise<AppLockfile>;
|
|
28
|
+
private requireSource;
|
|
29
|
+
private resolveKind;
|
|
30
|
+
private resolveKindOptional;
|
|
31
|
+
private invokeSource;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=lockfile-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lockfile-resolver.d.ts","sourceRoot":"","sources":["../../src/lib/lockfile-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAS3B,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5B,YAAY,EAAE,aAAa,CAAC;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IACtC,SAAS,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IACzC,gBAAgB,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAChD,MAAM,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;CACvC;AAED,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,MAAM,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAC3C,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,sBAAsB,CAAC;CACjC;AAiBD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAE9B,IAAI,EAAE,uBAAuB;IAInC,OAAO,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,WAAW,CAAC;IA4CxE,OAAO,CAAC,aAAa;YAWP,WAAW;YAqCX,mBAAmB;YAiBnB,YAAY;CAuB3B"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LockfileResolver = void 0;
|
|
4
|
+
const errors_1 = require("./errors");
|
|
5
|
+
const version_constraint_1 = require("./version-constraint");
|
|
6
|
+
class LockfileResolver {
|
|
7
|
+
sources;
|
|
8
|
+
constructor(opts) {
|
|
9
|
+
this.sources = opts.sources;
|
|
10
|
+
}
|
|
11
|
+
async resolve(input) {
|
|
12
|
+
const kernelSource = this.requireSource('kernel');
|
|
13
|
+
const kernelResolved = await this.invokeSource(kernelSource, input.kernel.version);
|
|
14
|
+
const [capabilities, biomes, agents, workflows, deliverableSpecs, skills] = await Promise.all([
|
|
15
|
+
this.resolveKind('capability', input.capabilities, ({ ref }) => ({
|
|
16
|
+
ref,
|
|
17
|
+
})),
|
|
18
|
+
this.resolveKind('biome', input.biomes, (e) => e),
|
|
19
|
+
this.resolveKindOptional('agent', input.agents),
|
|
20
|
+
this.resolveKindOptional('workflow', input.workflows),
|
|
21
|
+
this.resolveKindOptional('deliverable-spec', input.deliverableSpecs),
|
|
22
|
+
this.resolveKindOptional('skill', input.skills),
|
|
23
|
+
]);
|
|
24
|
+
const lockfile = {
|
|
25
|
+
kernel: kernelResolved.version,
|
|
26
|
+
capabilities: sortRecord(capabilities),
|
|
27
|
+
biomes: sortRecord(biomes),
|
|
28
|
+
};
|
|
29
|
+
if (agents !== undefined) {
|
|
30
|
+
lockfile.agents = sortRecord(agents);
|
|
31
|
+
}
|
|
32
|
+
if (workflows !== undefined) {
|
|
33
|
+
lockfile.workflows = sortRecord(workflows);
|
|
34
|
+
}
|
|
35
|
+
if (deliverableSpecs !== undefined) {
|
|
36
|
+
lockfile.deliverableSpecs = sortRecord(deliverableSpecs);
|
|
37
|
+
}
|
|
38
|
+
if (skills !== undefined) {
|
|
39
|
+
lockfile.skills = sortRecord(skills);
|
|
40
|
+
}
|
|
41
|
+
return lockfile;
|
|
42
|
+
}
|
|
43
|
+
requireSource(kind) {
|
|
44
|
+
const src = this.sources[kind];
|
|
45
|
+
if (!src) {
|
|
46
|
+
throw new errors_1.LockfileResolverError({
|
|
47
|
+
code: errors_1.LockfileResolverErrorCode.UnknownKind,
|
|
48
|
+
message: `LockfileResolver: no LockfileSource registered for kind "${kind}".`,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return src;
|
|
52
|
+
}
|
|
53
|
+
async resolveKind(kind, entries, project) {
|
|
54
|
+
if (entries.length === 0) {
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
const source = this.requireSource(kind);
|
|
58
|
+
const resolutions = await Promise.all(entries.map(async (entry) => {
|
|
59
|
+
const { ref, constraint } = project(entry);
|
|
60
|
+
const resolved = await this.invokeSource(source, ref, constraint);
|
|
61
|
+
if (constraint !== undefined) {
|
|
62
|
+
if (!(0, version_constraint_1.satisfiesConstraint)(resolved.version, constraint)) {
|
|
63
|
+
throw new errors_1.LockfileResolverError({
|
|
64
|
+
code: errors_1.LockfileResolverErrorCode.ConstraintUnsatisfied,
|
|
65
|
+
ref,
|
|
66
|
+
constraint,
|
|
67
|
+
sourceName: source.name,
|
|
68
|
+
message: `Source "${source.name}" returned version "${resolved.version}" for "${ref}", which does NOT satisfy constraint "${constraint}".`,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return [ref, resolved.version];
|
|
73
|
+
}));
|
|
74
|
+
const record = {};
|
|
75
|
+
for (const [ref, version] of resolutions) {
|
|
76
|
+
record[ref] = version;
|
|
77
|
+
}
|
|
78
|
+
return record;
|
|
79
|
+
}
|
|
80
|
+
async resolveKindOptional(kind, entries) {
|
|
81
|
+
if (entries === undefined) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
if (entries.length === 0) {
|
|
85
|
+
return {};
|
|
86
|
+
}
|
|
87
|
+
return this.resolveKind(kind, entries, (e) => e);
|
|
88
|
+
}
|
|
89
|
+
async invokeSource(source, ref, constraint) {
|
|
90
|
+
try {
|
|
91
|
+
return await source.resolve(ref, constraint);
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
if (err instanceof errors_1.LockfileResolverError) {
|
|
95
|
+
throw err;
|
|
96
|
+
}
|
|
97
|
+
const opts = {
|
|
98
|
+
code: errors_1.LockfileResolverErrorCode.SourceUnreachable,
|
|
99
|
+
ref,
|
|
100
|
+
sourceName: source.name,
|
|
101
|
+
cause: err,
|
|
102
|
+
};
|
|
103
|
+
if (constraint !== undefined) {
|
|
104
|
+
opts.constraint = constraint;
|
|
105
|
+
}
|
|
106
|
+
throw new errors_1.LockfileResolverError(opts);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.LockfileResolver = LockfileResolver;
|
|
111
|
+
function sortRecord(record) {
|
|
112
|
+
const sortedKeys = Object.keys(record).sort((a, b) => a.localeCompare(b));
|
|
113
|
+
const out = {};
|
|
114
|
+
for (const key of sortedKeys) {
|
|
115
|
+
out[key] = record[key];
|
|
116
|
+
}
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=lockfile-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lockfile-resolver.js","sourceRoot":"","sources":["../../src/lib/lockfile-resolver.ts"],"names":[],"mappings":";;;AAEA,qCAA4E;AAK5E,6DAA2D;AA8C3D,MAAa,gBAAgB;IACV,OAAO,CAAyB;IAEjD,YAAmB,IAA6B;QAC9C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC9B,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,KAA4B;QAC/C,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAMlD,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,YAAY,CAC5C,YAAY,EACZ,KAAK,CAAC,MAAM,CAAC,OAAO,CACrB,CAAC;QAEF,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,CAAC,GACvE,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC/D,GAAG;aACJ,CAAC,CAAC;YACH,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;YACjD,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC;YAC/C,IAAI,CAAC,mBAAmB,C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AG,CAAE,CAAC;IAC1B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type LockfileSourceKind = 'kernel' | 'capability' | 'biome' | 'agent' | 'workflow' | 'deliverable-spec' | 'skill';
|
|
2
|
+
export interface LockfileSource {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly kind: LockfileSourceKind;
|
|
5
|
+
resolve(ref: string, constraint?: string): Promise<{
|
|
6
|
+
version: string;
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=lockfile-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lockfile-source.d.ts","sourceRoot":"","sources":["../../src/lib/lockfile-source.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,YAAY,GACZ,OAAO,GACP,OAAO,GACP,UAAU,GACV,kBAAkB,GAClB,OAAO,CAAC;AAgBZ,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lockfile-source.js","sourceRoot":"","sources":["../../src/lib/lockfile-source.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare enum FreezePolicy {
|
|
3
|
+
Caret = "caret",
|
|
4
|
+
Tilde = "tilde",
|
|
5
|
+
Exact = "exact",
|
|
6
|
+
LatestCompatible = "latest-compatible"
|
|
7
|
+
}
|
|
8
|
+
export declare const FreezePolicySchema: z.ZodEnum<typeof FreezePolicy>;
|
|
9
|
+
interface SemverTriplet {
|
|
10
|
+
readonly major: number;
|
|
11
|
+
readonly minor: number;
|
|
12
|
+
readonly patch: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function parseFreezePolicy(policyOrConstraint: string): FreezePolicy;
|
|
15
|
+
export declare function formatConstraint(input: {
|
|
16
|
+
version: string;
|
|
17
|
+
policy: FreezePolicy;
|
|
18
|
+
}): string;
|
|
19
|
+
export declare function satisfiesConstraint(version: string, constraint: string): boolean;
|
|
20
|
+
export declare function compareSemver(a: SemverTriplet, b: SemverTriplet): number;
|
|
21
|
+
export declare function pickHighestSatisfying(candidates: readonly string[], constraint: string): string | null;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=version-constraint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-constraint.d.ts","sourceRoot":"","sources":["../../src/lib/version-constraint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,oBAAY,YAAY;IACtB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;IACf,gBAAgB,sBAAsB;CACvC;AAED,eAAO,MAAM,kBAAkB,gCAA6B,CAAC;AAK7D,UAAU,aAAa;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AA+BD,wBAAgB,iBAAiB,CAAC,kBAAkB,EAAE,MAAM,GAAG,YAAY,CAgC1E;AAOD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,YAAY,CAAC;CACtB,GAAG,MAAM,CAYT;AAgBD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAmDhF;AAGD,wBAAgB,aAAa,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,GAAG,MAAM,CAWxE;AAWD,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,UAAU,EAAE,MAAM,GACjB,MAAM,GAAG,IAAI,CAef"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FreezePolicySchema = exports.FreezePolicy = void 0;
|
|
4
|
+
exports.parseFreezePolicy = parseFreezePolicy;
|
|
5
|
+
exports.formatConstraint = formatConstraint;
|
|
6
|
+
exports.satisfiesConstraint = satisfiesConstraint;
|
|
7
|
+
exports.compareSemver = compareSemver;
|
|
8
|
+
exports.pickHighestSatisfying = pickHighestSatisfying;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const errors_1 = require("./errors");
|
|
11
|
+
var FreezePolicy;
|
|
12
|
+
(function (FreezePolicy) {
|
|
13
|
+
FreezePolicy["Caret"] = "caret";
|
|
14
|
+
FreezePolicy["Tilde"] = "tilde";
|
|
15
|
+
FreezePolicy["Exact"] = "exact";
|
|
16
|
+
FreezePolicy["LatestCompatible"] = "latest-compatible";
|
|
17
|
+
})(FreezePolicy || (exports.FreezePolicy = FreezePolicy = {}));
|
|
18
|
+
exports.FreezePolicySchema = zod_1.z.nativeEnum(FreezePolicy);
|
|
19
|
+
const SEMVER_REGEX = /^(\d+)\.(\d+)\.(\d+)$/;
|
|
20
|
+
function parseSemver(value) {
|
|
21
|
+
const match = SEMVER_REGEX.exec(value);
|
|
22
|
+
if (!match) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
major: Number(match[1]),
|
|
27
|
+
minor: Number(match[2]),
|
|
28
|
+
patch: Number(match[3]),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function requireSemver(value, raw) {
|
|
32
|
+
const parsed = parseSemver(value);
|
|
33
|
+
if (parsed === null) {
|
|
34
|
+
throw new errors_1.LockfileResolverError({
|
|
35
|
+
code: errors_1.LockfileResolverErrorCode.InvalidConstraint,
|
|
36
|
+
constraint: raw,
|
|
37
|
+
message: `Constraint "${raw}" expected a MAJOR.MINOR.PATCH semver but got "${value}".`,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return parsed;
|
|
41
|
+
}
|
|
42
|
+
function parseFreezePolicy(policyOrConstraint) {
|
|
43
|
+
if (typeof policyOrConstraint !== 'string' || policyOrConstraint.length === 0) {
|
|
44
|
+
throw new errors_1.LockfileResolverError({
|
|
45
|
+
code: errors_1.LockfileResolverErrorCode.InvalidConstraint,
|
|
46
|
+
constraint: String(policyOrConstraint),
|
|
47
|
+
message: 'Constraint must be a non-empty string.',
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (policyOrConstraint.startsWith('^')) {
|
|
51
|
+
return FreezePolicy.Caret;
|
|
52
|
+
}
|
|
53
|
+
if (policyOrConstraint.startsWith('~')) {
|
|
54
|
+
return FreezePolicy.Tilde;
|
|
55
|
+
}
|
|
56
|
+
if (policyOrConstraint.startsWith('latest-compatible')) {
|
|
57
|
+
return FreezePolicy.LatestCompatible;
|
|
58
|
+
}
|
|
59
|
+
if (SEMVER_REGEX.test(policyOrConstraint)) {
|
|
60
|
+
return FreezePolicy.Exact;
|
|
61
|
+
}
|
|
62
|
+
switch (policyOrConstraint) {
|
|
63
|
+
case FreezePolicy.Caret:
|
|
64
|
+
case FreezePolicy.Tilde:
|
|
65
|
+
case FreezePolicy.Exact:
|
|
66
|
+
case FreezePolicy.LatestCompatible:
|
|
67
|
+
return policyOrConstraint;
|
|
68
|
+
}
|
|
69
|
+
throw new errors_1.LockfileResolverError({
|
|
70
|
+
code: errors_1.LockfileResolverErrorCode.InvalidConstraint,
|
|
71
|
+
constraint: policyOrConstraint,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function formatConstraint(input) {
|
|
75
|
+
const parsed = requireSemver(input.version, `${input.policy}:${input.version}`);
|
|
76
|
+
switch (input.policy) {
|
|
77
|
+
case FreezePolicy.Caret:
|
|
78
|
+
return `^${input.version}`;
|
|
79
|
+
case FreezePolicy.Tilde:
|
|
80
|
+
return `~${input.version}`;
|
|
81
|
+
case FreezePolicy.Exact:
|
|
82
|
+
return input.version;
|
|
83
|
+
case FreezePolicy.LatestCompatible:
|
|
84
|
+
return `latest-compatible:${parsed.major}.x`;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function satisfiesConstraint(version, constraint) {
|
|
88
|
+
const v = parseSemver(version);
|
|
89
|
+
if (v === null) {
|
|
90
|
+
throw new errors_1.LockfileResolverError({
|
|
91
|
+
code: errors_1.LockfileResolverErrorCode.InvalidConstraint,
|
|
92
|
+
constraint,
|
|
93
|
+
message: `satisfiesConstraint: version "${version}" is not a MAJOR.MINOR.PATCH triplet.`,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
if (constraint.startsWith('^')) {
|
|
97
|
+
const floor = requireSemver(constraint.slice(1), constraint);
|
|
98
|
+
if (v.major !== floor.major) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
return compareSemver(v, floor) >= 0;
|
|
102
|
+
}
|
|
103
|
+
if (constraint.startsWith('~')) {
|
|
104
|
+
const floor = requireSemver(constraint.slice(1), constraint);
|
|
105
|
+
if (v.major !== floor.major) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
if (v.minor !== floor.minor) {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
return v.patch >= floor.patch;
|
|
112
|
+
}
|
|
113
|
+
if (constraint.startsWith('latest-compatible:')) {
|
|
114
|
+
const trail = constraint.slice('latest-compatible:'.length);
|
|
115
|
+
const match = /^(\d+)\.x$/.exec(trail);
|
|
116
|
+
if (!match) {
|
|
117
|
+
throw new errors_1.LockfileResolverError({
|
|
118
|
+
code: errors_1.LockfileResolverErrorCode.InvalidConstraint,
|
|
119
|
+
constraint,
|
|
120
|
+
message: `Constraint "${constraint}" must follow the form latest-compatible:<major>.x`,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return v.major === Number(match[1]);
|
|
124
|
+
}
|
|
125
|
+
if (SEMVER_REGEX.test(constraint)) {
|
|
126
|
+
const exact = requireSemver(constraint, constraint);
|
|
127
|
+
return v.major === exact.major && v.minor === exact.minor && v.patch === exact.patch;
|
|
128
|
+
}
|
|
129
|
+
throw new errors_1.LockfileResolverError({
|
|
130
|
+
code: errors_1.LockfileResolverErrorCode.InvalidConstraint,
|
|
131
|
+
constraint,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function compareSemver(a, b) {
|
|
135
|
+
if (a.major !== b.major) {
|
|
136
|
+
return a.major < b.major ? -1 : 1;
|
|
137
|
+
}
|
|
138
|
+
if (a.minor !== b.minor) {
|
|
139
|
+
return a.minor < b.minor ? -1 : 1;
|
|
140
|
+
}
|
|
141
|
+
if (a.patch !== b.patch) {
|
|
142
|
+
return a.patch < b.patch ? -1 : 1;
|
|
143
|
+
}
|
|
144
|
+
return 0;
|
|
145
|
+
}
|
|
146
|
+
function pickHighestSatisfying(candidates, constraint) {
|
|
147
|
+
let best = null;
|
|
148
|
+
for (const candidate of candidates) {
|
|
149
|
+
const parsed = parseSemver(candidate);
|
|
150
|
+
if (parsed === null) {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
if (!satisfiesConstraint(candidate, constraint)) {
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
if (best === null || compareSemver(parsed, best.parsed) > 0) {
|
|
157
|
+
best = { raw: candidate, parsed };
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return best === null ? null : best.raw;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=version-constraint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-constraint.js","sourceRoot":"","sources":["../../src/lib/version-constraint.ts"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System Interface (XSI) plane 5 — Manifest & Wire helper. Compositional Lockfile Resolver that turns an App's installed-biome list (plus optional agent/workflow/deliverable-spec/skill references) into a fully pinned `AppLockfile` per plan §10.4. Pure leaf: no NestJS, no fetch, no semver npm dep — pluggable `LockfileSource` interface lets downstream services wire concrete resolvers (xema-store-api for biomes, object-registry-api for the rest).",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"registry": "https://npm.pkg.github.com"
|
|
7
|
+
},
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@types/node": "25.2.3",
|
|
15
|
+
"prettier": "3.6.2",
|
|
16
|
+
"typescript": "5.9.3"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@xemahq/kernel-contracts": "^0.2.0",
|
|
20
|
+
"zod": "^4.3.6"
|
|
21
|
+
},
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"xema-source": "./src/index.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./dist/lib/*": {
|
|
29
|
+
"types": "./dist/lib/*.d.ts",
|
|
30
|
+
"default": "./dist/lib/*.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"clean": "rm -rf dist",
|
|
35
|
+
"build": "tsc -p tsconfig.json",
|
|
36
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
37
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
38
|
+
}
|
|
39
|
+
}
|