aontu 0.63.0 → 0.65.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/README.md +8 -8
- package/dist/agentsmd.js +3 -3
- package/dist/agentsmd.js.map +1 -1
- package/dist/aontu.d.ts +3 -3
- package/dist/aontu.js +4 -6
- package/dist/aontu.js.map +1 -1
- package/dist/aontumodel.js +6 -12
- package/dist/aontumodel.js.map +1 -1
- package/dist/casing.d.ts +5 -0
- package/dist/casing.js +90 -0
- package/dist/casing.js.map +1 -0
- package/dist/cli.d.ts +16 -3
- package/dist/cli.js +653 -455
- package/dist/cli.js.map +1 -1
- package/dist/compat.d.ts +7 -0
- package/dist/compat.js +113 -0
- package/dist/compat.js.map +1 -0
- package/dist/helpdoc.js +5 -5
- package/dist/helpdoc.js.map +1 -1
- package/dist/hints.js +14 -5
- package/dist/hints.js.map +1 -1
- package/dist/lang.d.ts +1 -0
- package/dist/lang.js +8 -0
- package/dist/lang.js.map +1 -1
- package/dist/lsp.d.ts +1 -1
- package/dist/mcp.js +0 -36
- package/dist/mcp.js.map +1 -1
- package/dist/mod.d.ts +18 -3
- package/dist/mod.js +117 -46
- package/dist/mod.js.map +1 -1
- package/dist/pkg-net.d.ts +227 -0
- package/dist/pkg-net.js +1598 -0
- package/dist/pkg-net.js.map +1 -0
- package/dist/pkg-zip.d.ts +8 -0
- package/dist/pkg-zip.js +196 -0
- package/dist/pkg-zip.js.map +1 -0
- package/dist/pkg.d.ts +159 -0
- package/dist/pkg.js +767 -0
- package/dist/pkg.js.map +1 -0
- package/dist/profile.d.ts +9 -0
- package/dist/profile.js +28 -0
- package/dist/profile.js.map +1 -0
- package/dist/report-sarif.js +1 -1
- package/dist/report-sarif.js.map +1 -1
- package/dist/subsume.d.ts +3 -1
- package/dist/subsume.js +2 -0
- package/dist/subsume.js.map +1 -1
- package/dist/trace.d.ts +21 -0
- package/dist/trace.js +107 -0
- package/dist/trace.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/unify.js +1 -6
- package/dist/unify.js.map +1 -1
- package/dist/val/CmpFuncVal.d.ts +2 -0
- package/dist/val/CmpFuncVal.js +47 -13
- package/dist/val/CmpFuncVal.js.map +1 -1
- package/dist/val/NomFuncVal.js +11 -13
- package/dist/val/NomFuncVal.js.map +1 -1
- package/dist/val/ReferFuncVal.js +3 -0
- package/dist/val/ReferFuncVal.js.map +1 -1
- package/package.json +1 -1
- package/skill/SKILL.md +3 -3
- package/skill/error-codes.md +4 -4
- package/skill/examples.md +4 -4
- package/skill/grammar-card.md +1 -1
- package/skill/init/check.sh +2 -2
- package/skill/tasks.md +14 -12
- package/src/agentsmd.ts +3 -3
- package/src/aontu.ts +3 -8
- package/src/aontumodel.ts +6 -12
- package/src/casing.ts +95 -0
- package/src/cli.ts +758 -495
- package/src/compat.ts +148 -0
- package/src/helpdoc.ts +5 -5
- package/src/hints.ts +14 -7
- package/src/lang.ts +9 -1
- package/src/mcp.ts +0 -39
- package/src/mod.ts +142 -51
- package/src/pkg-net.ts +1945 -0
- package/src/pkg-zip.ts +228 -0
- package/src/pkg.ts +1018 -0
- package/src/profile.ts +42 -0
- package/src/report-sarif.ts +1 -1
- package/src/subsume.ts +2 -2
- package/src/trace.ts +157 -0
- package/src/unify.ts +1 -6
- package/src/val/CmpFuncVal.ts +66 -20
- package/src/val/NomFuncVal.ts +3 -5
- package/src/val/ReferFuncVal.ts +4 -0
- package/dist/lower.d.ts +0 -23
- package/dist/lower.js +0 -528
- package/dist/lower.js.map +0 -1
- package/dist/mod-tool.d.ts +0 -58
- package/dist/mod-tool.js +0 -403
- package/dist/mod-tool.js.map +0 -1
- package/dist/render.d.ts +0 -53
- package/dist/render.js +0 -432
- package/dist/render.js.map +0 -1
- package/src/lower.ts +0 -586
- package/src/mod-tool.ts +0 -561
- package/src/render.ts +0 -580
package/dist/mod.js
CHANGED
|
@@ -1,29 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Copyright (c) 2025 Richard Rodger, MIT License */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.MODULE_REFUSAL_CODES = exports.MODULE_MAX_DEPTH = exports.MODULE_MAX_ELEMS = exports.MODULE_MAX_PATH = void 0;
|
|
4
|
+
exports.MODULE_REFUSAL_CODES = exports.MODULE_MAX_DEPTH = exports.VENDOR_DIR = exports.META_DIR = exports.LOCK_FILE = exports.PKG_FILE = exports.MODULE_MAX_ELEMS = exports.MODULE_MAX_PATH = exports.ALIAS_PREFIX = void 0;
|
|
5
5
|
exports.parseModuleRef = parseModuleRef;
|
|
6
|
+
exports.isAlias = isAlias;
|
|
6
7
|
exports.validateModulePath = validateModulePath;
|
|
8
|
+
exports.localFileExt = localFileExt;
|
|
9
|
+
exports.escapeElem = escapeElem;
|
|
7
10
|
exports.moduleDir = moduleDir;
|
|
8
11
|
exports.projectRoots = projectRoots;
|
|
9
12
|
exports.lockJson = lockJson;
|
|
10
13
|
exports.modCacheDir = modCacheDir;
|
|
11
14
|
exports.modCacheDirFor = modCacheDirFor;
|
|
12
|
-
exports.
|
|
15
|
+
exports.cacheStoreDir = cacheStoreDir;
|
|
16
|
+
exports.cacheDownloadDir = cacheDownloadDir;
|
|
17
|
+
exports.cacheSeenDir = cacheSeenDir;
|
|
18
|
+
exports.lockEntry = lockEntry;
|
|
19
|
+
exports.refuseLocalFile = refuseLocalFile;
|
|
13
20
|
exports.resolveModule = resolveModule;
|
|
14
21
|
const node_path_1 = require("node:path");
|
|
15
|
-
|
|
22
|
+
// A package path is `<domain>/<path>` and carries no major (ADR-022).
|
|
23
|
+
const MODULE_RE = /^([a-z0-9][a-z0-9-]*(?:\.[a-z0-9][a-z0-9-]*)+(?:\/[A-Za-z0-9._-]+)*)(?:#(aon1-[A-Za-z0-9_-]+))?$/;
|
|
24
|
+
const ALIAS_RE = /^(alias:[A-Za-z0-9._-]+)(?:#(aon1-[A-Za-z0-9_-]+))?$/;
|
|
25
|
+
exports.ALIAS_PREFIX = 'alias:';
|
|
16
26
|
function parseModuleRef(spec) {
|
|
17
|
-
const m = MODULE_RE.exec(spec);
|
|
27
|
+
const m = MODULE_RE.exec(spec) ?? ALIAS_RE.exec(spec);
|
|
18
28
|
if (null == m) {
|
|
19
29
|
return undefined;
|
|
20
30
|
}
|
|
21
31
|
return {
|
|
22
32
|
path: m[1],
|
|
23
|
-
|
|
24
|
-
...(null == m[3] ? {} : { hash: m[3] }),
|
|
33
|
+
...(null == m[2] ? {} : { hash: m[2] }),
|
|
25
34
|
};
|
|
26
35
|
}
|
|
36
|
+
function isAlias(path) {
|
|
37
|
+
return path.startsWith(exports.ALIAS_PREFIX);
|
|
38
|
+
}
|
|
27
39
|
exports.MODULE_MAX_PATH = 512;
|
|
28
40
|
exports.MODULE_MAX_ELEMS = 32;
|
|
29
41
|
const RESERVED_ELEMS = new Set([
|
|
@@ -52,17 +64,34 @@ function validateModulePath(path) {
|
|
|
52
64
|
}
|
|
53
65
|
return undefined;
|
|
54
66
|
}
|
|
67
|
+
// The final element of a routed path, when it carries an extension the
|
|
68
|
+
// include table knows, was meant as a file: the commonest mistake once
|
|
69
|
+
// the major left the name (ADR-022 part 4), so it gets its own message.
|
|
70
|
+
function localFileExt(path) {
|
|
71
|
+
const last = path.split('/').pop();
|
|
72
|
+
const m = /\.([^.]+)$/.exec(last);
|
|
73
|
+
return null == m ? undefined : m[1].toLowerCase();
|
|
74
|
+
}
|
|
55
75
|
function escapeElem(elem) {
|
|
56
76
|
return elem.replace(/[A-Z]/g, (c) => '!' + c.toLowerCase());
|
|
57
77
|
}
|
|
58
|
-
|
|
59
|
-
|
|
78
|
+
// The directory a key lives at under a store: one directory per
|
|
79
|
+
// element, uppercase escaped; an alias under `alias/<name>`, which no
|
|
80
|
+
// package path can spell because a domain carries a dot.
|
|
81
|
+
function moduleDir(store, path) {
|
|
82
|
+
const elems = isAlias(path) ?
|
|
83
|
+
['alias', path.slice(exports.ALIAS_PREFIX.length)] : path.split('/');
|
|
84
|
+
return (0, node_path_1.join)(store, ...elems.map(escapeElem));
|
|
60
85
|
}
|
|
86
|
+
exports.PKG_FILE = 'pkg.aon';
|
|
87
|
+
exports.LOCK_FILE = 'pkg-lock.aon';
|
|
88
|
+
exports.META_DIR = 'aontu_meta';
|
|
89
|
+
exports.VENDOR_DIR = 'vendor';
|
|
61
90
|
function projectRoots(from, fs) {
|
|
62
91
|
const roots = [];
|
|
63
92
|
let dir = from;
|
|
64
93
|
for (;;) {
|
|
65
|
-
if (fs.existsSync((0, node_path_1.join)(dir,
|
|
94
|
+
if (fs.existsSync((0, node_path_1.join)(dir, exports.PKG_FILE))) {
|
|
66
95
|
roots.push(dir);
|
|
67
96
|
}
|
|
68
97
|
const up = (0, node_path_1.dirname)(dir);
|
|
@@ -84,22 +113,32 @@ function modCacheDir() {
|
|
|
84
113
|
function modCacheDirFor(platform, env) {
|
|
85
114
|
const xdg = env.XDG_CACHE_HOME;
|
|
86
115
|
if ('string' === typeof xdg && '' !== xdg) {
|
|
87
|
-
return (0, node_path_1.join)(xdg, 'aontu', '
|
|
116
|
+
return (0, node_path_1.join)(xdg, 'aontu', 'pkg');
|
|
88
117
|
}
|
|
89
118
|
const home = env.HOME;
|
|
90
119
|
if ('string' === typeof home && '' !== home) {
|
|
91
|
-
return (0, node_path_1.join)(home, '.cache', 'aontu', '
|
|
120
|
+
return (0, node_path_1.join)(home, '.cache', 'aontu', 'pkg');
|
|
92
121
|
}
|
|
93
122
|
if ('win32' === platform) {
|
|
94
123
|
const local = env.LOCALAPPDATA;
|
|
95
124
|
if ('string' === typeof local && '' !== local) {
|
|
96
|
-
return (0, node_path_1.join)(local, 'aontu', '
|
|
125
|
+
return (0, node_path_1.join)(local, 'aontu', 'pkg');
|
|
97
126
|
}
|
|
98
127
|
}
|
|
99
128
|
return undefined;
|
|
100
129
|
}
|
|
101
|
-
|
|
102
|
-
|
|
130
|
+
// The user cache's trees (ADR-039 part 2).
|
|
131
|
+
function cacheStoreDir(cache, hash, pkg) {
|
|
132
|
+
return moduleDir((0, node_path_1.join)(cache, 'store', hash), pkg);
|
|
133
|
+
}
|
|
134
|
+
function cacheDownloadDir(cache, pkg) {
|
|
135
|
+
return (0, node_path_1.join)(moduleDir((0, node_path_1.join)(cache, 'download'), pkg), '@v');
|
|
136
|
+
}
|
|
137
|
+
function cacheSeenDir(cache, pkg) {
|
|
138
|
+
return moduleDir((0, node_path_1.join)(cache, 'seen'), pkg);
|
|
139
|
+
}
|
|
140
|
+
function lockEntry(root, key, fs) {
|
|
141
|
+
const file = (0, node_path_1.join)(root, exports.META_DIR, exports.LOCK_FILE);
|
|
103
142
|
if (!fs.existsSync(file)) {
|
|
104
143
|
return undefined;
|
|
105
144
|
}
|
|
@@ -110,74 +149,106 @@ function lockHash(root, ref, fs) {
|
|
|
110
149
|
catch {
|
|
111
150
|
return undefined;
|
|
112
151
|
}
|
|
113
|
-
const entry = lock?.lock?.[
|
|
114
|
-
|
|
152
|
+
const entry = lock?.lock?.[key];
|
|
153
|
+
if (null == entry || 'object' !== typeof entry) {
|
|
154
|
+
return undefined;
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
...('string' === typeof entry.canon ? { canon: entry.canon } : {}),
|
|
158
|
+
...('string' === typeof entry.pkg ? { pkg: entry.pkg } : {}),
|
|
159
|
+
};
|
|
115
160
|
}
|
|
116
161
|
exports.MODULE_MAX_DEPTH = 16;
|
|
117
162
|
exports.MODULE_REFUSAL_CODES = new Set([
|
|
118
163
|
'module_path', 'module_missing', 'module_integrity', 'module_depth',
|
|
164
|
+
'module_local', 'module_moved',
|
|
119
165
|
]);
|
|
120
166
|
function refuse(code, message) {
|
|
121
167
|
const err = new Error(message);
|
|
122
168
|
err.code = code;
|
|
123
169
|
throw err;
|
|
124
170
|
}
|
|
171
|
+
function refuseLocalFile(path) {
|
|
172
|
+
return refuse('module_local', 'local files need a ./ prefix: ' + path + ' (write @"./' + path + '")');
|
|
173
|
+
}
|
|
125
174
|
// Resolve one module import against the local stores.
|
|
126
175
|
function resolveModule(ref, fromDir, fs, options) {
|
|
127
|
-
const
|
|
176
|
+
const alias = isAlias(ref.path);
|
|
177
|
+
const badpath = alias ? undefined : validateModulePath(ref.path);
|
|
128
178
|
if (undefined !== badpath) {
|
|
129
|
-
refuse('module_path', 'module path: ' + ref.path + '
|
|
179
|
+
refuse('module_path', 'module path: ' + ref.path + ' (' + badpath + ')');
|
|
130
180
|
}
|
|
131
181
|
if (exports.MODULE_MAX_DEPTH <= (options.depth ?? 0)) {
|
|
132
|
-
refuse('module_depth', 'module depth: ' + ref.path +
|
|
182
|
+
refuse('module_depth', 'module depth: ' + ref.path +
|
|
133
183
|
' (verification nested past ' + exports.MODULE_MAX_DEPTH + ')');
|
|
134
184
|
}
|
|
135
185
|
// EVERY enclosing project, innermost first (see projectRoots): a
|
|
136
|
-
// vendored
|
|
186
|
+
// vendored package is a project inside a project, and its nested
|
|
137
187
|
// imports have to reach the tree the consumer vendored them into.
|
|
138
188
|
const roots = projectRoots(fromDir, fs);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const
|
|
189
|
+
const locked = roots.map((r) => lockEntry(r, ref.path, fs))
|
|
190
|
+
.find((e) => null != e);
|
|
191
|
+
const expect = ref.hash ?? locked?.canon;
|
|
192
|
+
// The store is keyed by hash AND package path; an alias names its
|
|
193
|
+
// package in the lockfile, else in the package file that declares it.
|
|
194
|
+
const pkg = alias ?
|
|
195
|
+
(locked?.pkg ?? roots.map((r) => aliasTarget(r, ref.path, fs, options))
|
|
196
|
+
.find((p) => null != p)) : ref.path;
|
|
197
|
+
if (alias && null == pkg) {
|
|
198
|
+
refuse('module_missing', 'alias not declared: ' + ref.path + ' (declare it under dep in ' +
|
|
199
|
+
exports.PKG_FILE + ')');
|
|
200
|
+
}
|
|
201
|
+
const stores = roots.map((r) => moduleDir((0, node_path_1.join)(r, exports.META_DIR, exports.VENDOR_DIR), ref.path));
|
|
145
202
|
if (null != options.cache && null != expect) {
|
|
146
|
-
|
|
147
|
-
// is already the right MEANING before anything is read from it.
|
|
148
|
-
stores.push((0, node_path_1.join)(options.cache, expect));
|
|
203
|
+
stores.push(cacheStoreDir(options.cache, expect, pkg));
|
|
149
204
|
}
|
|
150
|
-
const dir = stores.find((d) => fs.existsSync((0, node_path_1.join)(d,
|
|
205
|
+
const dir = stores.find((d) => fs.existsSync((0, node_path_1.join)(d, exports.PKG_FILE)));
|
|
151
206
|
if (undefined === dir) {
|
|
152
|
-
refuse('module_missing', 'module not fetched: ' + ref.path + '
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
const
|
|
159
|
-
|
|
207
|
+
refuse('module_missing', 'module not fetched: ' + ref.path + ' (run: aontu sync)');
|
|
208
|
+
}
|
|
209
|
+
// The package's own file names its entry and says whether it moved.
|
|
210
|
+
// Read with the evaluator rather than a regexp: a package file is
|
|
211
|
+
// ordinary Aontu, and the language reading its own metadata is the
|
|
212
|
+
// point.
|
|
213
|
+
const self = packageSelf((0, node_path_1.join)(dir, exports.PKG_FILE), fs, options);
|
|
214
|
+
if (null != self.moved) {
|
|
215
|
+
refuse('module_moved', 'module moved: ' + ref.path + ' (now ' + self.moved +
|
|
216
|
+
'; import that instead, nothing follows a move)');
|
|
217
|
+
}
|
|
218
|
+
const full = (0, node_path_1.join)(dir, self.main);
|
|
160
219
|
if (!fs.existsSync(full)) {
|
|
161
|
-
refuse('module_missing', 'module not fetched: ' + ref.path + '
|
|
162
|
-
' (run: aontu mod get)');
|
|
220
|
+
refuse('module_missing', 'module not fetched: ' + ref.path + ' (run: aontu sync)');
|
|
163
221
|
}
|
|
164
222
|
const src = fs.readFileSync(full, 'utf8');
|
|
165
223
|
if (null != expect) {
|
|
166
|
-
// VERIFICATION IS ALWAYS LOCAL. The
|
|
167
|
-
//
|
|
224
|
+
// VERIFICATION IS ALWAYS LOCAL. The repository's manifest is a
|
|
225
|
+
// claim; what decides is the hash of the module as it is on this
|
|
168
226
|
// machine, recomputed now.
|
|
169
227
|
const got = options.eval(src, full).hash;
|
|
170
228
|
if (got !== expect) {
|
|
171
|
-
refuse('module_integrity', 'module integrity: ' + ref.path +
|
|
229
|
+
refuse('module_integrity', 'module integrity: ' + ref.path +
|
|
172
230
|
' expected ' + expect + ' got ' + got);
|
|
173
231
|
}
|
|
174
232
|
}
|
|
175
233
|
return { full, src };
|
|
176
234
|
}
|
|
177
|
-
function
|
|
235
|
+
function packageSelf(file, fs, options) {
|
|
236
|
+
const gen = options.eval(fs.readFileSync(file, 'utf8'), file).gen;
|
|
237
|
+
const main = gen?.pkg?.main;
|
|
238
|
+
const moved = gen?.moved;
|
|
239
|
+
return {
|
|
240
|
+
main: 'string' === typeof main && '' !== main ? main : DEFAULT_MAIN,
|
|
241
|
+
...('string' === typeof moved && '' !== moved ? { moved } : {}),
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
function aliasTarget(root, key, fs, options) {
|
|
245
|
+
const file = (0, node_path_1.join)(root, exports.PKG_FILE);
|
|
246
|
+
if (!fs.existsSync(file)) {
|
|
247
|
+
return undefined;
|
|
248
|
+
}
|
|
178
249
|
const gen = options.eval(fs.readFileSync(file, 'utf8'), file).gen;
|
|
179
|
-
const
|
|
180
|
-
return 'string' === typeof
|
|
250
|
+
const pkg = gen?.dep?.[key]?.pkg;
|
|
251
|
+
return 'string' === typeof pkg && '' !== pkg ? pkg : undefined;
|
|
181
252
|
}
|
|
182
253
|
const DEFAULT_MAIN = 'main.aon';
|
|
183
254
|
//# sourceMappingURL=mod.js.map
|
package/dist/mod.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":";AAAA,oDAAoD
|
|
1
|
+
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;;;;;;;;;;;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AO,QAAQ,KAAK,OAAO,GAAG,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAA;AAChE,CAAC;AAGD,MAAM,YAAY,GAAG,UAAU,CAAA"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import type { Server } from 'node:http';
|
|
2
|
+
import { relPathError } from './pkg';
|
|
3
|
+
import type { PkgToolOptions, LockEntry, Dependency, PkgManifest, PkgMismatch } from './pkg';
|
|
4
|
+
export type HttpResponse = {
|
|
5
|
+
status: number;
|
|
6
|
+
body: Uint8Array;
|
|
7
|
+
};
|
|
8
|
+
export type PublishParts = {
|
|
9
|
+
manifest: Uint8Array;
|
|
10
|
+
proof: Uint8Array;
|
|
11
|
+
archive: Uint8Array;
|
|
12
|
+
};
|
|
13
|
+
export type PkgHttp = {
|
|
14
|
+
get: (url: string) => Promise<HttpResponse>;
|
|
15
|
+
post: (url: string, parts: PublishParts, token: string) => Promise<HttpResponse>;
|
|
16
|
+
};
|
|
17
|
+
export declare const DEFAULT_BASE = "https://pkg.aontu.dev";
|
|
18
|
+
export declare const DEFAULT_WRITE = "https://publish.aontu.dev";
|
|
19
|
+
export declare const PUBLISH_PATH = "/v1/publish";
|
|
20
|
+
export declare const COOLDOWN_HOURS = 72;
|
|
21
|
+
export declare const CLOSURE_MAX = 1024;
|
|
22
|
+
export declare const LIMITS: {
|
|
23
|
+
depth: number;
|
|
24
|
+
closure: number;
|
|
25
|
+
};
|
|
26
|
+
export declare const ARCHIVE_MAX_BYTES: number;
|
|
27
|
+
export declare const ARCHIVE_MAX_UNPACKED: number;
|
|
28
|
+
export declare const ARCHIVE_MAX_FILES: number;
|
|
29
|
+
export declare const ARCHIVE_MAX_FILE_BYTES: number;
|
|
30
|
+
export declare const SIGNATURE_ENCODING = "aontu-signature/v1";
|
|
31
|
+
export type TrustEntry = {
|
|
32
|
+
signer: string;
|
|
33
|
+
inclusion: 'required' | 'none';
|
|
34
|
+
};
|
|
35
|
+
export type RepoConfig = {
|
|
36
|
+
base: string[];
|
|
37
|
+
write: string;
|
|
38
|
+
private: string[];
|
|
39
|
+
privateBase: string[];
|
|
40
|
+
trust: Record<string, TrustEntry>;
|
|
41
|
+
};
|
|
42
|
+
export type PkgEvent = {
|
|
43
|
+
code: string;
|
|
44
|
+
message: string;
|
|
45
|
+
};
|
|
46
|
+
export type PkgRefusalReport = {
|
|
47
|
+
code: string;
|
|
48
|
+
message: string;
|
|
49
|
+
pkg?: string;
|
|
50
|
+
};
|
|
51
|
+
export declare class PkgRefusal extends Error {
|
|
52
|
+
code: string;
|
|
53
|
+
pkg?: string;
|
|
54
|
+
constructor(code: string, message: string, pkg?: string);
|
|
55
|
+
}
|
|
56
|
+
export declare function isLoopback(url: string): boolean;
|
|
57
|
+
export declare function baseAdmitted(url: string): boolean;
|
|
58
|
+
export type RepoOverrides = {
|
|
59
|
+
base?: string[];
|
|
60
|
+
write?: string;
|
|
61
|
+
};
|
|
62
|
+
export declare function repoConfig(root: string, options: PkgToolOptions, overrides?: RepoOverrides): RepoConfig;
|
|
63
|
+
export declare function patternMatches(pattern: string, pkg: string): boolean;
|
|
64
|
+
export declare function trustEntryFor(config: RepoConfig, pkg: string): TrustEntry;
|
|
65
|
+
export declare function isPrivateName(config: RepoConfig, pkg: string): boolean;
|
|
66
|
+
export declare function pkgUrlPath(pkg: string): string;
|
|
67
|
+
export declare function objectPath(kind: string, pkg: string, version?: string): string;
|
|
68
|
+
export declare function timestamp(d: Date): string;
|
|
69
|
+
export declare function keyIdOf(publicKeyDer: Uint8Array): string;
|
|
70
|
+
export declare function keyIdFromPem(pem: string): string;
|
|
71
|
+
export declare function keygen(file: string): {
|
|
72
|
+
signer?: string;
|
|
73
|
+
refused?: string;
|
|
74
|
+
};
|
|
75
|
+
export type KeyProof = {
|
|
76
|
+
kind: 'key';
|
|
77
|
+
encoding: typeof SIGNATURE_ENCODING;
|
|
78
|
+
over: string;
|
|
79
|
+
signer: string;
|
|
80
|
+
signature: string;
|
|
81
|
+
};
|
|
82
|
+
export declare function signDigest(pem: string, over: string): KeyProof;
|
|
83
|
+
export declare function smallOrderKey(raw: Uint8Array): boolean;
|
|
84
|
+
export declare function verifyKeyProof(proof: any, over: string, signer: string): string | undefined;
|
|
85
|
+
export declare function packagePath(s: any): boolean;
|
|
86
|
+
export declare function manifestError(m: any): string | undefined;
|
|
87
|
+
export { relPathError };
|
|
88
|
+
type Acquired = {
|
|
89
|
+
pkg: string;
|
|
90
|
+
version: string;
|
|
91
|
+
canon: string;
|
|
92
|
+
archive: string;
|
|
93
|
+
manifestDigest: string;
|
|
94
|
+
deps: Record<string, Dependency>;
|
|
95
|
+
dir: string;
|
|
96
|
+
closure: LockEntry[];
|
|
97
|
+
};
|
|
98
|
+
type AcquireCtx = {
|
|
99
|
+
options: PkgToolOptions;
|
|
100
|
+
http: PkgHttp;
|
|
101
|
+
config: RepoConfig;
|
|
102
|
+
cache: string;
|
|
103
|
+
now: () => Date;
|
|
104
|
+
events: PkgEvent[];
|
|
105
|
+
fetched: string[];
|
|
106
|
+
acquired: Record<string, Acquired>;
|
|
107
|
+
count: number;
|
|
108
|
+
};
|
|
109
|
+
export declare function acquire(ctx: AcquireCtx, pkg: string, asked: string | undefined, depth: number): Promise<Acquired>;
|
|
110
|
+
export type PkgSyncReport = {
|
|
111
|
+
verdict: 'ok' | 'frozen' | 'refused' | 'missing' | 'error' | 'mismatch' | 'unlocked';
|
|
112
|
+
fetched: string[];
|
|
113
|
+
lock: LockEntry[];
|
|
114
|
+
vendored: string[];
|
|
115
|
+
missing: string[];
|
|
116
|
+
unevaluable: string[];
|
|
117
|
+
forbidden: string[];
|
|
118
|
+
mismatched: PkgMismatch[];
|
|
119
|
+
unlocked: string[];
|
|
120
|
+
changes: string[];
|
|
121
|
+
events: PkgEvent[];
|
|
122
|
+
refusal?: PkgRefusalReport;
|
|
123
|
+
};
|
|
124
|
+
export type SyncArgs = RepoOverrides & {
|
|
125
|
+
frozen?: boolean;
|
|
126
|
+
now?: () => Date;
|
|
127
|
+
};
|
|
128
|
+
export declare function pkgSync(root: string, options: PkgToolOptions, http: PkgHttp, args?: SyncArgs): Promise<PkgSyncReport>;
|
|
129
|
+
export type DepEdit = {
|
|
130
|
+
op: 'add';
|
|
131
|
+
key: string;
|
|
132
|
+
v: string;
|
|
133
|
+
} | {
|
|
134
|
+
op: 'raise';
|
|
135
|
+
key: string;
|
|
136
|
+
v: string;
|
|
137
|
+
} | {
|
|
138
|
+
op: 'remove';
|
|
139
|
+
key: string;
|
|
140
|
+
};
|
|
141
|
+
export declare function editDeps(root: string, edit: DepEdit, options: PkgToolOptions): string | undefined;
|
|
142
|
+
export type PkgChangeReport = PkgSyncReport & {
|
|
143
|
+
change: string;
|
|
144
|
+
};
|
|
145
|
+
export type ChangeArgs = SyncArgs & {
|
|
146
|
+
mode: 'add' | 'get';
|
|
147
|
+
};
|
|
148
|
+
export declare function parsePkgSpec(spec: string): {
|
|
149
|
+
pkg: string;
|
|
150
|
+
version?: string;
|
|
151
|
+
} | string;
|
|
152
|
+
export declare function pkgGet(root: string, options: PkgToolOptions, http: PkgHttp, spec: string, args: ChangeArgs): Promise<PkgChangeReport | string>;
|
|
153
|
+
export declare function pkgRemove(root: string, options: PkgToolOptions, http: PkgHttp, pkg: string, args: SyncArgs): Promise<PkgChangeReport | string>;
|
|
154
|
+
export type PkgWhyReport = {
|
|
155
|
+
verdict: 'ok' | 'missing';
|
|
156
|
+
pkg: string;
|
|
157
|
+
paths: string[][];
|
|
158
|
+
};
|
|
159
|
+
export declare function pkgWhy(root: string, options: PkgToolOptions, pkg: string): PkgWhyReport;
|
|
160
|
+
export type LayoutWrite = {
|
|
161
|
+
manifest: any;
|
|
162
|
+
manifestBytes: Uint8Array;
|
|
163
|
+
proofBytes: Uint8Array;
|
|
164
|
+
archive: Uint8Array;
|
|
165
|
+
};
|
|
166
|
+
export declare function writeLayout(dir: string, w: LayoutWrite, options: PkgToolOptions, now: Date): void;
|
|
167
|
+
export declare function dirHttp(dir: string): PkgHttp;
|
|
168
|
+
export type PkgPublishReport = {
|
|
169
|
+
verdict: 'dry-run' | 'sent' | 'refused' | 'breaking' | 'undecided' | 'error';
|
|
170
|
+
manifest?: PkgManifest;
|
|
171
|
+
digest?: string;
|
|
172
|
+
signer?: string;
|
|
173
|
+
against?: string;
|
|
174
|
+
to?: string;
|
|
175
|
+
write?: string;
|
|
176
|
+
missing: string[];
|
|
177
|
+
forbidden: string[];
|
|
178
|
+
findings: any[];
|
|
179
|
+
refusal?: PkgRefusalReport;
|
|
180
|
+
};
|
|
181
|
+
export type PublishArgs = RepoOverrides & {
|
|
182
|
+
yes?: boolean;
|
|
183
|
+
to?: string;
|
|
184
|
+
key?: string;
|
|
185
|
+
token?: string;
|
|
186
|
+
against?: string;
|
|
187
|
+
now?: () => Date;
|
|
188
|
+
};
|
|
189
|
+
export declare function publisherFromToken(token: string): any | undefined;
|
|
190
|
+
export declare function pkgPublish(root: string, options: PkgToolOptions, http: PkgHttp, args: PublishArgs): Promise<PkgPublishReport>;
|
|
191
|
+
export type PkgOutdatedEntry = {
|
|
192
|
+
key: string;
|
|
193
|
+
v: string;
|
|
194
|
+
newest: string;
|
|
195
|
+
retracted?: string;
|
|
196
|
+
moves: string[];
|
|
197
|
+
};
|
|
198
|
+
export type PkgOutdatedReport = {
|
|
199
|
+
verdict: 'current' | 'outdated' | 'refused';
|
|
200
|
+
locked: PkgOutdatedEntry[];
|
|
201
|
+
events: PkgEvent[];
|
|
202
|
+
refusal?: PkgRefusalReport;
|
|
203
|
+
};
|
|
204
|
+
export declare function pkgOutdated(root: string, options: PkgToolOptions, http: PkgHttp, args?: SyncArgs): Promise<PkgOutdatedReport>;
|
|
205
|
+
export declare function objectShape(p: string): boolean;
|
|
206
|
+
export declare function objectMutable(p: string): boolean;
|
|
207
|
+
export type ServeOptions = {
|
|
208
|
+
dir: string;
|
|
209
|
+
upstream: string[];
|
|
210
|
+
listen: string;
|
|
211
|
+
http: PkgHttp;
|
|
212
|
+
};
|
|
213
|
+
export type Served = {
|
|
214
|
+
url: string;
|
|
215
|
+
close: () => Promise<void>;
|
|
216
|
+
server: Server;
|
|
217
|
+
};
|
|
218
|
+
export declare function serveObject(opts: ServeOptions, p: string): Promise<{
|
|
219
|
+
status: number;
|
|
220
|
+
body: Uint8Array;
|
|
221
|
+
stale?: boolean;
|
|
222
|
+
}>;
|
|
223
|
+
export declare function startServe(opts: ServeOptions): Promise<Served>;
|
|
224
|
+
export declare function servedUrl(address: string, port: number): string;
|
|
225
|
+
export declare function splitListen(listen: string): [string, number];
|
|
226
|
+
export declare function readBounded(r: Response, max: number): Promise<Uint8Array>;
|
|
227
|
+
export declare function defaultHttp(): PkgHttp;
|