@avantf/dsh-plugin-base 0.5.3 → 0.6.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/README.md +132 -13
- package/lib/bootstrap.d.ts +1 -1
- package/lib/bootstrap.js +1 -1
- package/lib/client/load_more.d.ts +157 -0
- package/lib/client/load_more.d.ts.map +1 -0
- package/lib/client/load_more.js +252 -0
- package/lib/conformance.d.ts.map +1 -1
- package/lib/conformance.js +5 -0
- package/lib/errors.d.ts +3 -1
- package/lib/errors.d.ts.map +1 -1
- package/lib/fs.d.ts.map +1 -1
- package/lib/fs.js +3 -0
- package/lib/index.d.ts +10 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +18 -3
- package/lib/interface.d.ts +165 -32
- package/lib/interface.d.ts.map +1 -1
- package/lib/interface.js +56 -16
- package/lib/internal.d.ts +4 -0
- package/lib/internal.d.ts.map +1 -1
- package/lib/internal.js +22 -0
- package/lib/lint.d.ts.map +1 -1
- package/lib/lint.js +39 -1
- package/lib/providers/npm.d.ts +10 -1
- package/lib/providers/npm.d.ts.map +1 -1
- package/lib/providers/npm.js +2 -2
- package/lib/providers/runtime_deps.d.ts +184 -0
- package/lib/providers/runtime_deps.d.ts.map +1 -0
- package/lib/providers/runtime_deps.js +1214 -0
- package/lib/provisioner.d.ts.map +1 -1
- package/lib/provisioner.js +4 -1
- package/lib/runtime_deps_helper.d.ts +71 -0
- package/lib/runtime_deps_helper.d.ts.map +1 -0
- package/lib/runtime_deps_helper.js +161 -0
- package/lib/session_notices.d.ts +95 -0
- package/lib/session_notices.d.ts.map +1 -0
- package/lib/session_notices.js +172 -0
- package/lib/state.d.ts +8 -1
- package/lib/state.d.ts.map +1 -1
- package/lib/state.js +20 -4
- package/lib/types.d.ts +14 -1
- package/lib/types.d.ts.map +1 -1
- package/package.json +7 -4
- package/src/client/controls.module.css +294 -0
package/lib/interface.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The integer interface generation this module implements.
|
|
3
3
|
*
|
|
4
|
-
* `
|
|
5
|
-
*
|
|
6
|
-
* `
|
|
7
|
-
*
|
|
8
|
-
* file name's `N` and this constant are the SAME fact — `test/public-surface.spec.ts`
|
|
9
|
-
* snapshot for this constant exists and that its `interfaceVersion` field equals it,
|
|
10
|
-
*
|
|
11
|
-
* interface change (INTERFACE.md §1); a behaviour change or a fix does NOT touch it. The
|
|
12
|
-
* this number into their artifacts and compare it, at startup, with the number the base
|
|
13
|
-
* reports — a difference is a warning and a capability-level degradation, never a refused
|
|
4
|
+
* `6` is the CURRENT generation: v5 plus the session-notice registry (`createSessionNotices` and the
|
|
5
|
+
* `SessionNoticeSpec` / `SessionNoticeRegistry` types) and the thin runtime-deps helper
|
|
6
|
+
* (`createRuntimeDeps` and the `RuntimeDepsConfig` / `RuntimeDepsHandle` types), INTERFACE.md §12. v6
|
|
7
|
+
* `extends` v5, so every v5 member is still present and a v6 module remains assignable to the v5
|
|
8
|
+
* interface. The file name's `N` and this constant are the SAME fact — `test/public-surface.spec.ts`
|
|
9
|
+
* asserts that the snapshot for this constant exists and that its `interfaceVersion` field equals it,
|
|
10
|
+
* so "the JSON says v7, the constant says 6" cannot happen. Bump it (and add `api/interface-vN.json`)
|
|
11
|
+
* only for an interface change (INTERFACE.md §1); a behaviour change or a fix does NOT touch it. The
|
|
12
|
+
* plugins bake this number into their artifacts and compare it, at startup, with the number the base
|
|
13
|
+
* they loaded reports — a difference is a warning and a capability-level degradation, never a refused
|
|
14
|
+
* mount.
|
|
14
15
|
*
|
|
15
|
-
* `3`, `2` and `1` are the earlier frozen generations (`api/interface-
|
|
16
|
-
* `api/interface-
|
|
17
|
-
*
|
|
16
|
+
* `5`, `4`, `3`, `2` and `1` are the earlier frozen generations (`api/interface-v5.json`, …,
|
|
17
|
+
* `api/interface-v1.json`). They stay in the tree as those generations' records and as the types
|
|
18
|
+
* callers compiled against still import.
|
|
18
19
|
*/
|
|
19
|
-
export const INTERFACE_VERSION =
|
|
20
|
+
export const INTERFACE_VERSION = 6;
|
|
20
21
|
/**
|
|
21
22
|
* Every VALUE name of the v1 `.` surface, in {@link BaseRuntimeV1} declaration order.
|
|
22
23
|
*
|
|
@@ -232,7 +233,7 @@ export const VALUE_NAMES_V3 = [
|
|
|
232
233
|
'MODEL_CACHE_KIND',
|
|
233
234
|
];
|
|
234
235
|
/**
|
|
235
|
-
* Every VALUE name of the
|
|
236
|
+
* Every VALUE name of the FROZEN v4 `.` surface, in {@link BaseRuntimeV4} declaration order.
|
|
236
237
|
*
|
|
237
238
|
* The spread is the whole point of this generation: v4 adds no name, so the list is stated as "the v3
|
|
238
239
|
* list verbatim" and `test/public-surface.spec.ts` asserts equality with {@link VALUE_NAMES_V3} — both
|
|
@@ -241,6 +242,26 @@ export const VALUE_NAMES_V3 = [
|
|
|
241
242
|
* compile error.
|
|
242
243
|
*/
|
|
243
244
|
export const VALUE_NAMES_V4 = [...VALUE_NAMES_V3];
|
|
245
|
+
/**
|
|
246
|
+
* Every VALUE name of the FROZEN v5 `.` surface, in {@link BaseRuntimeV5} declaration order.
|
|
247
|
+
*
|
|
248
|
+
* The spread states the additive transition: v5 is the v4 list verbatim plus the runtime-deps
|
|
249
|
+
* provider. `test/public-surface.spec.ts` asserts the difference is exactly those two names (so a
|
|
250
|
+
* member cannot be added to the carrier and forgotten here, or vice versa), and the `satisfies`
|
|
251
|
+
* clause still ties the list to the whole v5 `keyof`. v5 stays frozen as that generation's record;
|
|
252
|
+
* {@link VALUE_NAMES_V6} is the current list.
|
|
253
|
+
*/
|
|
254
|
+
export const VALUE_NAMES_V5 = [...VALUE_NAMES_V4, 'RUNTIME_DEPS_KIND', 'runtimeDepsProvider'];
|
|
255
|
+
/**
|
|
256
|
+
* Every VALUE name of the CURRENT (v6) `.` surface, in {@link BaseRuntimeV6} declaration order: the
|
|
257
|
+
* v5 list verbatim plus the session-notice registry and the runtime-deps helper.
|
|
258
|
+
*
|
|
259
|
+
* The spread states the additive transition, and `test/public-surface.spec.ts` asserts the difference
|
|
260
|
+
* is exactly these two names (set and order), while the `satisfies` clause ties the list to the whole
|
|
261
|
+
* v6 `keyof`. Namespaced by purpose: the registry comes before the helper that consumes it, the same
|
|
262
|
+
* reading order `src/index.ts` and `docs/INTERFACE.md` §12 use.
|
|
263
|
+
*/
|
|
264
|
+
export const VALUE_NAMES_V6 = [...VALUE_NAMES_V5, 'createSessionNotices', 'createRuntimeDeps'];
|
|
244
265
|
/**
|
|
245
266
|
* The TYPE names v3 NAMES for the first time — they were reachable through `export *` in v2 but were
|
|
246
267
|
* never declared in {@link BaseTypeSurfaceV2}, so they had no entry and no promise. v3's explicit
|
|
@@ -347,11 +368,30 @@ export const TYPE_NAMES_V3 = [
|
|
|
347
368
|
'InterfaceVerdict',
|
|
348
369
|
];
|
|
349
370
|
/**
|
|
350
|
-
* Every TYPE name of the
|
|
371
|
+
* Every TYPE name of the FROZEN v4 `.` surface, in {@link BaseTypeSurfaceV4} declaration order.
|
|
351
372
|
*
|
|
352
373
|
* Like {@link VALUE_NAMES_V4}, the spread states the fact this generation is about: v4 names no new type
|
|
353
374
|
* and sheds none, so the list is the v3 list verbatim. `test/public-surface.spec.ts` asserts equality
|
|
354
375
|
* with {@link TYPE_NAMES_V3}, and the `satisfies` clause ties it to the whole v4 `keyof`.
|
|
355
376
|
*/
|
|
356
377
|
export const TYPE_NAMES_V4 = [...TYPE_NAMES_V3];
|
|
378
|
+
/**
|
|
379
|
+
* Every TYPE name of the FROZEN v5 `.` surface, in {@link BaseTypeSurfaceV5} declaration order:
|
|
380
|
+
* the three runtime-deps types, then the v4 list verbatim.
|
|
381
|
+
*
|
|
382
|
+
* `test/public-surface.spec.ts` asserts that the first three are exactly the added names and that the
|
|
383
|
+
* remainder is v4, so the additive transition is stated once and checked in both directions. v5 stays
|
|
384
|
+
* frozen as that generation's record; {@link TYPE_NAMES_V6} is the current list.
|
|
385
|
+
*/
|
|
386
|
+
export const TYPE_NAMES_V5 = ['DependencySource', 'InstallAttempt', 'RuntimeDepsSpec', ...TYPE_NAMES_V4];
|
|
387
|
+
/**
|
|
388
|
+
* Every TYPE name of the CURRENT (v6) `.` surface, in {@link BaseTypeSurfaceV6} declaration order:
|
|
389
|
+
* the four v6 types, then the v5 list verbatim.
|
|
390
|
+
*
|
|
391
|
+
* The added names are the registry's two (`SessionNoticeRegistry` / `SessionNoticeSpec`) and the
|
|
392
|
+
* helper's two (`RuntimeDepsConfig` / `RuntimeDepsHandle`); `test/public-surface.spec.ts` asserts that
|
|
393
|
+
* the first four are exactly the difference and that the remainder is v5, so the additive transition
|
|
394
|
+
* is stated once and checked in both directions.
|
|
395
|
+
*/
|
|
396
|
+
export const TYPE_NAMES_V6 = ['RuntimeDepsConfig', 'RuntimeDepsHandle', 'SessionNoticeRegistry', 'SessionNoticeSpec', ...TYPE_NAMES_V5];
|
|
357
397
|
//# sourceMappingURL=interface.js.map
|
package/lib/internal.d.ts
CHANGED
|
@@ -41,6 +41,10 @@ export { COMPAT_PROBE_TOOL, checkInterval, checkServices, declaredSchemaKeys, fl
|
|
|
41
41
|
export { CAPABILITIES, DEFAULT_DEADLINE_MS, normalizeOnMissing } from './provisioner.js';
|
|
42
42
|
export { NPM_PACKAGE_KIND, npmPackageProvider } from './providers/npm.js';
|
|
43
43
|
export type { NpmPackageSpec } from './providers/npm.js';
|
|
44
|
+
export { RUNTIME_DEPS_DIR, RUNTIME_DEPS_KIND, gcRuntimeDeps, runtimeDepsLockPath, runtimeDepsProvider, runtimeDepsStore, } from './providers/runtime_deps.js';
|
|
45
|
+
export type { DependencySource, InstallAttempt, RuntimeDepsAttemptRecord, RuntimeDepsGcOptions, RuntimeDepsGcReport, RuntimeDepsProviderOptions, RuntimeDepsRecord, RuntimeDepsRunInput, RuntimeDepsRunResult, RuntimeDepsSpec, } from './providers/runtime_deps.js';
|
|
46
|
+
export { AUTO_LOAD_MORE_MARGIN_PX, createAutoLoadMore, scrollParentOf } from './client/load_more.js';
|
|
47
|
+
export type { AutoLoadMore, AutoLoadMoreOptions, ScrollDocument, ScrollElement, ScrollView } from './client/load_more.js';
|
|
44
48
|
export { createPluginLogger } from './kit/logger.js';
|
|
45
49
|
export type { PluginLogger, PluginLoggerHost, PluginLoggerOptions } from './kit/logger.js';
|
|
46
50
|
export { endpointId, fieldSymbol, resultSymbol, strictCodec } from './kit/typert.js';
|
package/lib/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC9H,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,UAAU,EACV,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC7D,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,SAAS,EACT,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,cAAc,EACd,WAAW,GACZ,MAAM,YAAY,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ACV,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,GAChB,MAAM,6BAA6B,CAAA;AASpC,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACpG,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAWzH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACpD,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1F,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACpF,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA"}
|
package/lib/internal.js
CHANGED
|
@@ -39,6 +39,28 @@ export { BOOTSTRAP_SUBPATH, FRAMEWORK_INLINING_BEACONS, FRAMEWORK_PACKAGE, MIN_I
|
|
|
39
39
|
export { COMPAT_PROBE_TOOL, checkInterval, checkServices, declaredSchemaKeys, floorOf, probeToolsRegistry, probeTypertRegistry, resolveRuntimeVersion, } from './compat.js';
|
|
40
40
|
export { CAPABILITIES, DEFAULT_DEADLINE_MS, normalizeOnMissing } from './provisioner.js';
|
|
41
41
|
export { NPM_PACKAGE_KIND, npmPackageProvider } from './providers/npm.js';
|
|
42
|
+
// The runtime-deps store's operator/maintenance half. The PROVIDER itself is on `.` (v5); GC, the
|
|
43
|
+
// store paths and the runner seams are explicit operator/test surface and stay off the interface.
|
|
44
|
+
export { RUNTIME_DEPS_DIR, RUNTIME_DEPS_KIND, gcRuntimeDeps, runtimeDepsLockPath, runtimeDepsProvider, runtimeDepsStore, } from './providers/runtime_deps.js';
|
|
45
|
+
// ── the browser-side kit ────────────────────────────────────────────────────────────────────────
|
|
46
|
+
// "Scroll to the end → load the next page", shared by the panels that page a list (mem's 记忆 tab,
|
|
47
|
+
// mission's paged lists). It lives HERE for two reasons, and neither changes the generation:
|
|
48
|
+
// `.` must not grow a browser-only member, and the base has no `react` peer, so the controller is
|
|
49
|
+
// plain DOM and each plugin keeps its own thin React wrapper. A client bundle INLINES this module (a
|
|
50
|
+
// browser cannot load the base at runtime), which is why it reads no node built-in and holds no
|
|
51
|
+
// shared runtime identity. Internal means internal: no compatibility promise, no generation entry,
|
|
52
|
+
// changeable in any base release.
|
|
53
|
+
export { AUTO_LOAD_MORE_MARGIN_PX, createAutoLoadMore, scrollParentOf } from './client/load_more.js';
|
|
54
|
+
// …and the shared CONTROL STYLES, on the same terms. Not a value export: a stylesheet is not a
|
|
55
|
+
// module this package can re-export, so it is its own subpath — `./internal/controls.module.css`,
|
|
56
|
+
// mapped to `src/client/controls.module.css` (source, shipped as-is; `controls_css.spec.ts` pins
|
|
57
|
+
// that). A plugin's client build writes
|
|
58
|
+
//
|
|
59
|
+
// import controls from '@avantf/dsh-plugin-base/internal/controls.module.css'
|
|
60
|
+
//
|
|
61
|
+
// and INLINES it: the CSS Modules pipeline hashes the classes from this file and injects one style
|
|
62
|
+
// tag, so the base still needs no browser artifact and no plugin fetches anything at runtime. mem's
|
|
63
|
+
// 记忆 tab is the first consumer; mission follows.
|
|
42
64
|
export { createPluginLogger } from './kit/logger.js';
|
|
43
65
|
export { endpointId, fieldSymbol, resultSymbol, strictCodec } from './kit/typert.js';
|
|
44
66
|
//# sourceMappingURL=internal.js.map
|
package/lib/lint.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../src/lint.ts"],"names":[],"mappings":"AAWA,mDAAmD;AACnD,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../src/lint.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
@@ -8,7 +8,7 @@ import { ProvisionError } from './errors.js';
|
|
|
8
8
|
import { assertPackageName } from './package-name.js';
|
|
9
9
|
import { assertRange } from './semver.js';
|
|
10
10
|
/** The built-in kinds whose names are reserved. */
|
|
11
|
-
export const BUILTIN_KINDS = ['npm-package', 'binary-archive', 'model-cache'];
|
|
11
|
+
export const BUILTIN_KINDS = ['npm-package', 'binary-archive', 'model-cache', 'runtime-deps'];
|
|
12
12
|
/** Item policy keys the core reads. */
|
|
13
13
|
export const IMPLEMENTED_POLICY_KEYS = ['mirrors', 'timeoutMs'];
|
|
14
14
|
/** Item policy keys the surface declares but this build does not read. */
|
|
@@ -110,6 +110,44 @@ function checkSpec(kind, spec, itemId, findings) {
|
|
|
110
110
|
if (!isRecord(spec) || str(spec['repo']) === undefined) {
|
|
111
111
|
findings.push({ rule: 'lint/spec-shape', itemId, message: 'model-cache 的 spec 必须是 {repo, revision?}' });
|
|
112
112
|
}
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (kind === 'runtime-deps') {
|
|
116
|
+
// Base names no package: the lint checks the GENERIC shape only. The dependency specs themselves
|
|
117
|
+
// are manager-native package.json specs (ranges, file:, aliases, …), so no semver-subset rule here.
|
|
118
|
+
if (!isRecord(spec)) {
|
|
119
|
+
findings.push({ rule: 'lint/spec-shape', itemId, message: 'runtime-deps 的 spec 必须是 {packages, sources, attempts, verify}' });
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const packages = spec['packages'];
|
|
123
|
+
if (!isRecord(packages) || Object.keys(packages).length === 0) {
|
|
124
|
+
findings.push({ rule: 'lint/spec-shape', itemId, message: 'runtime-deps 缺少非空的 spec.packages' });
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
for (const [name, dependency] of Object.entries(packages)) {
|
|
128
|
+
try {
|
|
129
|
+
assertPackageName(name);
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
findings.push({ rule: 'lint/spec-shape', itemId, message: error instanceof ProvisionError ? error.message : `非法的包名:${name}` });
|
|
133
|
+
}
|
|
134
|
+
if (typeof dependency !== 'string' || dependency.trim() === '') {
|
|
135
|
+
findings.push({ rule: 'lint/spec-shape', itemId, message: `runtime-deps 的 spec.packages["${name}"] 必须是非空字符串` });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const sources = spec['sources'];
|
|
140
|
+
if (!Array.isArray(sources) || sources.length === 0 || sources.some(source => !isRecord(source) || str(source['id']) === undefined)) {
|
|
141
|
+
findings.push({ rule: 'lint/spec-shape', itemId, message: 'runtime-deps 的 spec.sources 必须是非空数组且每项带 id' });
|
|
142
|
+
}
|
|
143
|
+
const attempts = spec['attempts'];
|
|
144
|
+
if (!Array.isArray(attempts) || attempts.length === 0 || attempts.some(attempt => !isRecord(attempt) || str(attempt['source']) === undefined)) {
|
|
145
|
+
findings.push({ rule: 'lint/spec-shape', itemId, message: 'runtime-deps 的 spec.attempts 必须是非空数组且每项带 source' });
|
|
146
|
+
}
|
|
147
|
+
const verify = spec['verify'];
|
|
148
|
+
if (!Array.isArray(verify) || verify.some(entry => typeof entry !== 'string' || entry.trim() === '')) {
|
|
149
|
+
findings.push({ rule: 'lint/spec-shape', itemId, message: 'runtime-deps 的 spec.verify 必须是字符串数组' });
|
|
150
|
+
}
|
|
113
151
|
}
|
|
114
152
|
}
|
|
115
153
|
/** Lint a manifest value (already parsed JSON, or a typed object). */
|
package/lib/providers/npm.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Provider } from '../types.js';
|
|
1
|
+
import type { Provider, ProviderContext } from '../types.js';
|
|
2
2
|
export declare const NPM_PACKAGE_KIND = "npm-package";
|
|
3
3
|
/** The `spec` of an `npm-package` item. */
|
|
4
4
|
export interface NpmPackageSpec {
|
|
@@ -14,11 +14,20 @@ export interface NpmPackageSpec {
|
|
|
14
14
|
readonly dir?: string;
|
|
15
15
|
}[];
|
|
16
16
|
}
|
|
17
|
+
export declare function packageVersionOf(ctx: ProviderContext, dir: string): Promise<string | undefined>;
|
|
17
18
|
/** Walk up from a resolved entry to the owning package directory.
|
|
18
19
|
*
|
|
19
20
|
* The candidate is checked BEFORE stepping up (the entry usually sits directly in the package), and
|
|
20
21
|
* `dirnameImpl` is the platform `dirname` so the win32 separator path is covered from Linux. */
|
|
21
22
|
export declare function packageDirOf(entry: string, name: string, dirnameImpl?: (path: string) => string): string | undefined;
|
|
23
|
+
/** Resolve a peer directory from this module's tree, falling back to the host CWD with a warning.
|
|
24
|
+
*
|
|
25
|
+
* The order matters: `import.meta.url` is the tree that actually loaded this provider, while the CWD
|
|
26
|
+
* is wherever the host happened to start. A peer resolved from the CWD becomes an ABSOLUTE symlink
|
|
27
|
+
* inside the published version directory (see {@link linkPeers}); it dangles the moment the host
|
|
28
|
+
* starts elsewhere or that tree is removed, and it made "one zod" depend on the launch directory.
|
|
29
|
+
* The CWD stays as a last resort, but never silently. */
|
|
30
|
+
export declare function resolvePeerDir(peer: string, ctx: ProviderContext): string | undefined;
|
|
22
31
|
/** Build the built-in npm provider. */
|
|
23
32
|
export declare function npmPackageProvider(options?: {
|
|
24
33
|
readonly id?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npm.d.ts","sourceRoot":"","sources":["../../src/providers/npm.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAA+B,QAAQ,
|
|
1
|
+
{"version":3,"file":"npm.d.ts","sourceRoot":"","sources":["../../src/providers/npm.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAA+B,QAAQ,EAAE,eAAe,EAAsD,MAAM,aAAa,CAAA;AAE7I,eAAO,MAAM,gBAAgB,gBAAgB,CAAA;AAM7C,2CAA2C;AAC3C,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,0EAA0E;IAC1E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IACnC,gGAAgG;IAChG,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC1G;AAuJD,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CASrG;AAeD;;;iGAGiG;AACjG,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAgB,GAAG,MAAM,GAAG,SAAS,CAS7H;AAED;;;;;;0DAM0D;AAC1D,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAyBrF;AA8FD,uCAAuC;AACvC,wBAAgB,kBAAkB,CAAC,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,QAAQ,CAqKnF"}
|
package/lib/providers/npm.js
CHANGED
|
@@ -163,7 +163,7 @@ async function findNativeModule(ctx, dir, depth = 0) {
|
|
|
163
163
|
}
|
|
164
164
|
return undefined;
|
|
165
165
|
}
|
|
166
|
-
async function packageVersionOf(ctx, dir) {
|
|
166
|
+
export async function packageVersionOf(ctx, dir) {
|
|
167
167
|
try {
|
|
168
168
|
const raw = decodeJson(await ctx.fs.readFile(join(dir, 'package.json')));
|
|
169
169
|
if (typeof raw !== 'object' || raw === null)
|
|
@@ -211,7 +211,7 @@ export function packageDirOf(entry, name, dirnameImpl = dirname) {
|
|
|
211
211
|
* inside the published version directory (see {@link linkPeers}); it dangles the moment the host
|
|
212
212
|
* starts elsewhere or that tree is removed, and it made "one zod" depend on the launch directory.
|
|
213
213
|
* The CWD stays as a last resort, but never silently. */
|
|
214
|
-
function resolvePeerDir(peer, ctx) {
|
|
214
|
+
export function resolvePeerDir(peer, ctx) {
|
|
215
215
|
const from = (root) => {
|
|
216
216
|
try {
|
|
217
217
|
return dirname(createRequire(root).resolve(`${peer}/package.json`));
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import type { ProvisionFs, ProvisionLock, ProvisionLogger } from '../types.js';
|
|
2
|
+
import type { Provider } from '../types.js';
|
|
3
|
+
/** The kind the runtime-dependency provider claims. */
|
|
4
|
+
export declare const RUNTIME_DEPS_KIND = "runtime-deps";
|
|
5
|
+
/**
|
|
6
|
+
* The canonical `item.target.root` for the shared store. A caller may put the store elsewhere, but
|
|
7
|
+
* then it is a different shared root: the store is shared through the HOME + target.root pair.
|
|
8
|
+
*/
|
|
9
|
+
export declare const RUNTIME_DEPS_DIR = "deps/runtime";
|
|
10
|
+
/** One registry/cache endpoint the attempts can name. */
|
|
11
|
+
export interface DependencySource {
|
|
12
|
+
/** Stable id referenced by an {@link InstallAttempt}. */
|
|
13
|
+
readonly id: string;
|
|
14
|
+
/** Registry URL (`https://registry.example/`); omitted means "no registry". */
|
|
15
|
+
readonly registry?: string;
|
|
16
|
+
/** Manager cache/store directory; with no registry the attempt runs offline. */
|
|
17
|
+
readonly cache?: string;
|
|
18
|
+
}
|
|
19
|
+
/** One install attempt: a source plus the manager/script/env policy for that try. */
|
|
20
|
+
export interface InstallAttempt {
|
|
21
|
+
/** An id from {@link RuntimeDepsSpec.sources}. */
|
|
22
|
+
readonly source: string;
|
|
23
|
+
/** `pnpm` when omitted (this family's package manager). */
|
|
24
|
+
readonly manager?: 'npm' | 'pnpm';
|
|
25
|
+
/** Extra environment for the manager process. */
|
|
26
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
27
|
+
/**
|
|
28
|
+
* Whether lifecycle scripts may run. Default `false`: a self-heal install that runs arbitrary
|
|
29
|
+
* registry lifecycle scripts is an explicit decision, so a caller that needs a native build says so.
|
|
30
|
+
*/
|
|
31
|
+
readonly allowScripts?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** What a plugin declares for one `runtime-deps` item. Base names no package. */
|
|
34
|
+
export interface RuntimeDepsSpec {
|
|
35
|
+
/** Package name → package.json dependency spec (a range, `file:` path, alias, …). */
|
|
36
|
+
readonly packages: Readonly<Record<string, string>>;
|
|
37
|
+
/** The registry/cache endpoints the attempts reference. */
|
|
38
|
+
readonly sources: readonly DependencySource[];
|
|
39
|
+
/** Tried in order; the first one whose install AND verify succeeds wins. */
|
|
40
|
+
readonly attempts: readonly InstallAttempt[];
|
|
41
|
+
/**
|
|
42
|
+
* Package specifiers every successful root must resolve (`createRequire(...).resolve()`). Must be
|
|
43
|
+
* non-empty (a root that verified nothing is not a verified root), and the set is part of the key:
|
|
44
|
+
* two specs that verify different things never share a root.
|
|
45
|
+
*/
|
|
46
|
+
readonly verify: readonly string[];
|
|
47
|
+
/**
|
|
48
|
+
* Host-provided singletons: name → peer range. They are LINKED from the caller's tree, never
|
|
49
|
+
* installed. The key commits to the name, the range AND the host copy that gets linked (directory +
|
|
50
|
+
* version), so two specs that ask for different ranges — or resolve the same range from different
|
|
51
|
+
* physical copies — never share a root. Every reuse re-reads the version actually linked into the
|
|
52
|
+
* root against the range declared here.
|
|
53
|
+
*/
|
|
54
|
+
readonly peers?: Readonly<Record<string, string>>;
|
|
55
|
+
/** A lockfile whose bytes seed/audit the install and are part of the content key. */
|
|
56
|
+
readonly lockfile?: string;
|
|
57
|
+
}
|
|
58
|
+
/** What one call to the manager runner returns. */
|
|
59
|
+
export interface RuntimeDepsRunResult {
|
|
60
|
+
readonly code: number;
|
|
61
|
+
readonly stdout: string;
|
|
62
|
+
readonly stderr: string;
|
|
63
|
+
}
|
|
64
|
+
/** One manager invocation; injectable so the orchestration is testable without a registry. */
|
|
65
|
+
export interface RuntimeDepsRunInput {
|
|
66
|
+
readonly manager: 'npm' | 'pnpm';
|
|
67
|
+
readonly args: readonly string[];
|
|
68
|
+
readonly cwd: string;
|
|
69
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
70
|
+
readonly timeoutMs?: number;
|
|
71
|
+
readonly signal?: AbortSignal;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Provider options. None of them is a package name: the options only seam the host tree, the
|
|
75
|
+
* process facts the key is built from, and the manager runner (tests).
|
|
76
|
+
*/
|
|
77
|
+
export interface RuntimeDepsProviderOptions {
|
|
78
|
+
/** Provider id; defaults to `@avantf/dsh-plugin-base/runtime-deps`. */
|
|
79
|
+
readonly id?: string;
|
|
80
|
+
/** The manager used by an attempt that does not name one. Default `pnpm`. */
|
|
81
|
+
readonly manager?: 'npm' | 'pnpm';
|
|
82
|
+
/** Explicit peer directories, overriding resolution from the tree that loaded the base. */
|
|
83
|
+
readonly peerDirs?: Readonly<Record<string, string>>;
|
|
84
|
+
/** Per-key lock budget. Default 300 000 ms. */
|
|
85
|
+
readonly lockTimeoutMs?: number;
|
|
86
|
+
/** A lock whose holder is gone is reclaimed after this age. Default 10 000 ms. */
|
|
87
|
+
readonly staleLockMs?: number;
|
|
88
|
+
/** Manager version probe; defaults to `<manager> --version` (cached per process). */
|
|
89
|
+
readonly managerVersion?: (manager: 'npm' | 'pnpm') => string | undefined;
|
|
90
|
+
/** The manager runner; defaults to spawning the manager with `stdio: pipe`. */
|
|
91
|
+
readonly run?: (input: RuntimeDepsRunInput) => Promise<RuntimeDepsRunResult>;
|
|
92
|
+
/** Process facts the content key includes; defaults to `process.platform/arch/versions.modules`. */
|
|
93
|
+
readonly target?: {
|
|
94
|
+
readonly platform?: string;
|
|
95
|
+
readonly arch?: string;
|
|
96
|
+
readonly abi?: string;
|
|
97
|
+
};
|
|
98
|
+
readonly clock?: () => number;
|
|
99
|
+
}
|
|
100
|
+
/** One attempt as recorded in `.runtime.json`. */
|
|
101
|
+
export interface RuntimeDepsAttemptRecord {
|
|
102
|
+
readonly source: string;
|
|
103
|
+
/** The source's registry, REDACTED: a private registry may carry userinfo or a `_authToken`, and this
|
|
104
|
+
* record sits in a store every plugin can read. The host survives (the diagnostic value), the
|
|
105
|
+
* credential does not; the key still commits to the declared value. */
|
|
106
|
+
readonly registry?: string;
|
|
107
|
+
readonly cache?: string;
|
|
108
|
+
readonly manager: 'npm' | 'pnpm';
|
|
109
|
+
/** The env KEYS the attempt set. Values are deliberately not persisted: they can carry tokens. */
|
|
110
|
+
readonly envKeys: readonly string[];
|
|
111
|
+
readonly allowScripts: boolean;
|
|
112
|
+
readonly result: 'ok' | 'failed';
|
|
113
|
+
readonly code?: string;
|
|
114
|
+
readonly detail?: string;
|
|
115
|
+
readonly ms: number;
|
|
116
|
+
}
|
|
117
|
+
/** The `.runtime.json` record: the handle a plugin can read back from the root. */
|
|
118
|
+
export interface RuntimeDepsRecord {
|
|
119
|
+
readonly schemaVersion: number;
|
|
120
|
+
readonly kind: typeof RUNTIME_DEPS_KIND;
|
|
121
|
+
readonly state: 'ready';
|
|
122
|
+
readonly key: string;
|
|
123
|
+
readonly packages: Readonly<Record<string, string>>;
|
|
124
|
+
readonly lockHash: string;
|
|
125
|
+
readonly platform: string;
|
|
126
|
+
readonly arch: string;
|
|
127
|
+
readonly nodeAbi: string;
|
|
128
|
+
readonly attempts: readonly RuntimeDepsAttemptRecord[];
|
|
129
|
+
readonly peers: readonly string[];
|
|
130
|
+
/**
|
|
131
|
+
* Peers whose link fell back to a COPY (`linkOrCopy`: no symlink support on this filesystem).
|
|
132
|
+
* A linked peer's identity is the resolved host directory AND version; a copied peer only records
|
|
133
|
+
* the version it was cloned from, so the root states that boundary here instead of implying a
|
|
134
|
+
* physical link it does not have. Absent in records written before this field existed.
|
|
135
|
+
*/
|
|
136
|
+
readonly copiedPeers?: readonly string[];
|
|
137
|
+
readonly integrity: string;
|
|
138
|
+
readonly installedAt: string;
|
|
139
|
+
}
|
|
140
|
+
/** The shared store root for one item. */
|
|
141
|
+
export declare function runtimeDepsStore(home: string, targetRoot?: string): string;
|
|
142
|
+
/** The per-key lock path; the lock files sit beside the roots, never inside one. */
|
|
143
|
+
export declare function runtimeDepsLockPath(store: string, key: string): string;
|
|
144
|
+
/** Build the built-in shared runtime-dependency provider.
|
|
145
|
+
* @stable */
|
|
146
|
+
export declare function runtimeDepsProvider(options?: RuntimeDepsProviderOptions): Provider;
|
|
147
|
+
/** What one explicit GC pass did. */
|
|
148
|
+
export interface RuntimeDepsGcReport {
|
|
149
|
+
/** Root keys actually removed. */
|
|
150
|
+
readonly removed: readonly string[];
|
|
151
|
+
/** Root keys kept because a recorded plugin references them or the caller listed them. */
|
|
152
|
+
readonly kept: readonly string[];
|
|
153
|
+
/** Root keys not removed (dry-run candidates, a held lock, an unreadable status plane, a failed rm). */
|
|
154
|
+
readonly skipped: readonly string[];
|
|
155
|
+
/** Stale staging trees and dead lock files cleaned up. */
|
|
156
|
+
readonly cleaned: readonly string[];
|
|
157
|
+
}
|
|
158
|
+
export interface RuntimeDepsGcOptions {
|
|
159
|
+
/** The provisioner home (the `<home>` in `<home>/<root>/<key>`). */
|
|
160
|
+
readonly home: string;
|
|
161
|
+
/** The store root below `home`; defaults to {@link RUNTIME_DEPS_DIR}. */
|
|
162
|
+
readonly root?: string;
|
|
163
|
+
/** Extra keys to keep (a caller's own record of the keys it uses). */
|
|
164
|
+
readonly keep?: readonly string[];
|
|
165
|
+
/** Report but do not remove anything. */
|
|
166
|
+
readonly dryRun?: boolean;
|
|
167
|
+
readonly fs?: ProvisionFs;
|
|
168
|
+
readonly lock?: ProvisionLock;
|
|
169
|
+
readonly logger?: ProvisionLogger;
|
|
170
|
+
readonly clock?: () => number;
|
|
171
|
+
/** A lock whose holder pid is gone is removed after this age. Default 10 000 ms. */
|
|
172
|
+
readonly staleMs?: number;
|
|
173
|
+
/** Staging trees older than this are removed. Default 1 hour. */
|
|
174
|
+
readonly stagingGraceMs?: number;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Remove roots no recorded plugin references. EXPLICIT: this is an operator action, never a startup
|
|
178
|
+
* step, because a running plugin may hold a key that has not reached `status.json` yet.
|
|
179
|
+
*
|
|
180
|
+
* A root is kept when its key is in `keep` or in a `runtime-deps` status row's `version` (the
|
|
181
|
+
* content key this provider reports). Roots in use by a live per-key lock are skipped, never stolen.
|
|
182
|
+
*/
|
|
183
|
+
export declare function gcRuntimeDeps(options: RuntimeDepsGcOptions): Promise<RuntimeDepsGcReport>;
|
|
184
|
+
//# sourceMappingURL=runtime_deps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime_deps.d.ts","sourceRoot":"","sources":["../../src/providers/runtime_deps.ts"],"names":[],"mappings":"AAsDA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC9E,OAAO,KAAK,EAA+B,QAAQ,EAA0D,MAAM,aAAa,CAAA;AAEhI,uDAAuD;AACvD,eAAO,MAAM,iBAAiB,iBAAiB,CAAA;AAE/C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,iBAAiB,CAAA;AAwB9C,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B,yDAAyD;IACzD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,gFAAgF;IAChF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,qFAAqF;AACrF,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,2DAA2D;IAC3D,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IACjC,iDAAiD;IACjD,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAA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