@deepseek-ai/dsh-app-boot 0.1.6-alpha.2 → 0.1.7-alpha.2
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.i18n.yaml +2 -2
- package/README.md +34 -14
- package/README.zh.md +34 -14
- package/lib/index.js +1683 -693
- package/lib/types/config-schema/collect.d.ts +16 -0
- package/lib/types/config-schema/document.d.ts +13 -0
- package/lib/types/config-schema/index.d.ts +20 -0
- package/lib/types/config-schema/native.d.ts +9 -0
- package/lib/types/config-schema/pattern.d.ts +8 -0
- package/lib/types/config-schema/projector.d.ts +20 -0
- package/lib/types/config-schema/types.d.ts +95 -0
- package/lib/types/index.d.ts +34 -9
- package/lib/types/package-meta.d.ts +25 -0
- package/lib/types/profile-resolution/legacy-links.d.ts +1 -28
- package/lib/types/profile-resolution/resolver.d.ts +18 -19
- package/lib/types/profile-resolution/service.d.ts +17 -12
- package/lib/types/profile-resolution/worker-bootstrap.d.ts +1 -1
- package/lib/types/profile.d.ts +71 -63
- package/lib/worker/profile-resolution-bootstrap.js +255 -357
- package/package.json +20 -18
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Boot-free inspection of declared plugin Config schemas using profile module resolution. */
|
|
2
|
+
import type { Profile, RuntimeResolution } from '../profile.ts';
|
|
3
|
+
import type { ConfigSchemaDiagnostic, ConfigSchemaDump } from './types.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Generate JSON Schema from parsed entry rows and root-tree patches without applying plugins or evaluating expressions.
|
|
6
|
+
* Imports, Config getters, and lazy schema builders execute trusted plugin code; transform callbacks do not. Calls must not overlap
|
|
7
|
+
* another profile-resolution interception; module imports remain cached after the interception is released.
|
|
8
|
+
* @param profile - prepared profile whose directory anchors root module and include resolution.
|
|
9
|
+
* @param entries - unvalidated rows from profile composition; malformed rows become positioned diagnostics without losing siblings.
|
|
10
|
+
* @param resolution - the same immutable package resolution used for profile boot.
|
|
11
|
+
* @param diagnostics - existing composition diagnostics; copied into the returned catalog.
|
|
12
|
+
* @returns a JSON Schema document with partial-result diagnostics and Config references under `x-cordis`.
|
|
13
|
+
* @throws when Node's profile module resolution cannot be installed.
|
|
14
|
+
*/
|
|
15
|
+
export declare function collectConfigSchemas(profile: Profile, entries: readonly unknown[], resolution: RuntimeResolution, diagnostics?: readonly ConfigSchemaDiagnostic[]): Promise<ConfigSchemaDump>;
|
|
16
|
+
//# sourceMappingURL=collect.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Compose Loader entry/patch structure and discovered plugin input schemas into one JSON Schema document. */
|
|
2
|
+
import type { CollectedConfigEntry, ConfigSchemaDiagnostic, ConfigSchemaDump } from './types.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Build a schema for the composed entry list and a separately addressable root-tree patch list.
|
|
5
|
+
* Unknown plugin names remain open; only collected schemas supply plugin-specific constraints.
|
|
6
|
+
* @param profile - selected profile name.
|
|
7
|
+
* @param collected - declarations discovered without mounting plugins, including include descendants.
|
|
8
|
+
* @param targets - last-id-wins patch targets from the root tree's patch index, excluding include descendants.
|
|
9
|
+
* @param initialDiagnostics - composition and import diagnostics already collected.
|
|
10
|
+
* @returns one JSON Schema document with explicit collection and projection annotations.
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildConfigSchemaDocument(profile: string, collected: readonly CollectedConfigEntry[], targets: ReadonlyMap<string, CollectedConfigEntry>, initialDiagnostics: readonly ConfigSchemaDiagnostic[]): Promise<ConfigSchemaDump>;
|
|
13
|
+
//# sourceMappingURL=document.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Profile schema generation: composition diagnostics, runtime resolution, and boot-free discovery. */
|
|
2
|
+
import type { PatchOptions } from '@deepseek-ai/cordis-plugin-include';
|
|
3
|
+
import { type Profile } from '../profile.ts';
|
|
4
|
+
import type { ConfigSchemaDump } from './types.ts';
|
|
5
|
+
export type { ConfigSchemaDump, NativeConfigSchema } from './types.ts';
|
|
6
|
+
/**
|
|
7
|
+
* Generate JSON Schema for a prepared profile's ordered patch layers without mounting plugins or evaluating expressions.
|
|
8
|
+
* Reads the profile manifest; imports, Config getters, and lazy builders execute trusted code. Native validators and
|
|
9
|
+
* transform callbacks are not executed. Calls must not overlap another profile-resolution interception; collection
|
|
10
|
+
* releases its interception on success or rejection, while Node retains imported modules. Supplied layers are not mutated.
|
|
11
|
+
* Profile preparation, layer selection, process streams, and exit policy belong to the caller.
|
|
12
|
+
* @param binName - the diagnostic prefix on thrown manifest errors.
|
|
13
|
+
* @param profile - prepared on-disk profile whose directory anchors root module and include resolution.
|
|
14
|
+
* @param layers - already parsed patch lists in application order, including caller-selected home and argv overlays.
|
|
15
|
+
* @param installAnchor - package manifest anchoring the installation's runtime dependencies.
|
|
16
|
+
* @returns a JSON Schema document with declaration references, partial results, and diagnostics under `x-cordis`.
|
|
17
|
+
* @throws when profile metadata, composition, or runtime resolution cannot be prepared.
|
|
18
|
+
*/
|
|
19
|
+
export declare function generateConfigSchema(binName: string, profile: Profile, layers: readonly PatchOptions[][], installAnchor: string): Promise<ConfigSchemaDump>;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Identity checks at the plugin-export and lazy-builder boundaries. */
|
|
2
|
+
import type { NativeConfigSchema } from './types.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Recognize the native Schemastery graph protocol without invoking a validator or serialization hook.
|
|
5
|
+
* @param value - plugin Config export or lazy-builder result.
|
|
6
|
+
* @returns whether native schema fields can be inspected.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isNativeConfigSchema(value: unknown): value is NativeConfigSchema;
|
|
9
|
+
//# sourceMappingURL=native.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Conservative compatibility checks between native RegExp validation and Unicode JSON Schema patterns. */
|
|
2
|
+
/**
|
|
3
|
+
* Create a checker for patterns that can retain native acceptance under Unicode regex semantics.
|
|
4
|
+
* Unrecognized flagless syntax stays explicitly partial rather than becoming a misleading constraint.
|
|
5
|
+
* @returns the compatibility predicate; parsing never executes the regular expression against config values.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createPatternCheck(): Promise<(source: string, flags?: string) => boolean>;
|
|
8
|
+
//# sourceMappingURL=pattern.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Project native Config input constraints without executing their validators or transform callbacks. */
|
|
2
|
+
import type { ConfigJsonSchema, ConfigJsonSchemaObject, NativeConfigSchema } from './types.ts';
|
|
3
|
+
/** Definition that projected value positions reference as `#/$defs/loaderExpression`; an enclosing document must define it. */
|
|
4
|
+
export declare const LOADER_EXPRESSION_SCHEMA: ConfigJsonSchemaObject;
|
|
5
|
+
/** One Config projection; unknown omission behavior is explicit rather than an invented default. */
|
|
6
|
+
export interface ConfigProjection {
|
|
7
|
+
/** Object-form root: value positions are wrapped in `anyOf` with the loader-expression reference. */
|
|
8
|
+
schema: ConfigJsonSchemaObject;
|
|
9
|
+
definitions: Record<string, ConfigJsonSchema>;
|
|
10
|
+
acceptsMissing: boolean | 'unknown';
|
|
11
|
+
limitations: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Create an invocation-local projector. Ajv checks only literal defaults against generated schemas;
|
|
15
|
+
* it does not fill defaults, coerce input, or call native plugin validators. Opaque input or metadata effects
|
|
16
|
+
* widen validation with explicit limitations instead of simulating native mutation.
|
|
17
|
+
* @returns a function projecting one trusted native Config graph into the enclosing document's definitions.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createConfigProjector(): Promise<(root: NativeConfigSchema, prefix: string) => ConfigProjection>;
|
|
20
|
+
//# sourceMappingURL=projector.d.ts.map
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/** JSON Schema output and native graph inputs for boot-free configuration inspection. */
|
|
2
|
+
/** JSON Schema 2020-12, including annotations that standard validators may ignore. */
|
|
3
|
+
export type ConfigJsonSchema = boolean | ConfigJsonSchemaObject;
|
|
4
|
+
/** Object-form JSON Schema; vocabulary extensions are annotations, not executable validators. */
|
|
5
|
+
export interface ConfigJsonSchemaObject {
|
|
6
|
+
[keyword: string]: unknown;
|
|
7
|
+
$schema?: string;
|
|
8
|
+
$ref?: string;
|
|
9
|
+
$defs?: Record<string, ConfigJsonSchema>;
|
|
10
|
+
type?: string | string[];
|
|
11
|
+
properties?: Record<string, ConfigJsonSchema>;
|
|
12
|
+
required?: string[];
|
|
13
|
+
items?: ConfigJsonSchema;
|
|
14
|
+
prefixItems?: ConfigJsonSchema[];
|
|
15
|
+
additionalProperties?: ConfigJsonSchema;
|
|
16
|
+
propertyNames?: ConfigJsonSchema;
|
|
17
|
+
anyOf?: ConfigJsonSchema[];
|
|
18
|
+
allOf?: ConfigJsonSchema[];
|
|
19
|
+
not?: ConfigJsonSchema;
|
|
20
|
+
if?: ConfigJsonSchema;
|
|
21
|
+
then?: ConfigJsonSchema;
|
|
22
|
+
default?: unknown;
|
|
23
|
+
description?: string;
|
|
24
|
+
}
|
|
25
|
+
/** A collection or projection diagnostic, without independently collected config values. */
|
|
26
|
+
export interface ConfigSchemaDiagnostic {
|
|
27
|
+
level: 'warning' | 'error';
|
|
28
|
+
/** Structural position in the discovered entry tree, when applicable. */
|
|
29
|
+
path?: string;
|
|
30
|
+
message: string;
|
|
31
|
+
}
|
|
32
|
+
/** One declared entry and its generated Config reference; include paths describe discovery, not root JSON pointers. */
|
|
33
|
+
export interface ConfigSchemaEntry {
|
|
34
|
+
path: string;
|
|
35
|
+
id?: string;
|
|
36
|
+
/** Omitted when a malformed row has no literal plugin name. */
|
|
37
|
+
name?: string;
|
|
38
|
+
status: 'schema' | 'partial' | 'absent' | 'unsupported' | 'error';
|
|
39
|
+
configRef?: string;
|
|
40
|
+
/** Native Loader carrier, whose config is not interpolated as an ordinary plugin config. */
|
|
41
|
+
tree?: 'group' | 'include';
|
|
42
|
+
}
|
|
43
|
+
/** JSON Schema for a composed entry list; `$defs.patchList` describes profile overlays. */
|
|
44
|
+
export interface ConfigSchemaDump extends ConfigJsonSchemaObject {
|
|
45
|
+
$schema: 'https://json-schema.org/draft/2020-12/schema';
|
|
46
|
+
$defs: Record<string, ConfigJsonSchema>;
|
|
47
|
+
'x-cordis': {
|
|
48
|
+
profile: string;
|
|
49
|
+
/** False for error diagnostics, partial/unsupported/error entries, or ambiguous plugin-name schemas; includes disabled declarations. */
|
|
50
|
+
complete: boolean;
|
|
51
|
+
entries: ConfigSchemaEntry[];
|
|
52
|
+
diagnostics: ConfigSchemaDiagnostic[];
|
|
53
|
+
patchSchema: '#/$defs/patchList';
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/** Native Schemastery graph protocol after its identity marker has been checked. */
|
|
57
|
+
export interface NativeConfigSchema {
|
|
58
|
+
type: string;
|
|
59
|
+
meta: {
|
|
60
|
+
role?: string;
|
|
61
|
+
extra?: unknown;
|
|
62
|
+
hidden?: boolean;
|
|
63
|
+
disabled?: boolean;
|
|
64
|
+
collapse?: boolean;
|
|
65
|
+
link?: string;
|
|
66
|
+
comment?: string;
|
|
67
|
+
badges?: {
|
|
68
|
+
text: string;
|
|
69
|
+
type: string;
|
|
70
|
+
}[];
|
|
71
|
+
required?: boolean;
|
|
72
|
+
volatile?: boolean;
|
|
73
|
+
default?: unknown;
|
|
74
|
+
min?: number;
|
|
75
|
+
max?: number;
|
|
76
|
+
step?: number;
|
|
77
|
+
pattern?: {
|
|
78
|
+
source: string;
|
|
79
|
+
flags?: string;
|
|
80
|
+
};
|
|
81
|
+
description?: string | Record<string, string>;
|
|
82
|
+
loose?: boolean;
|
|
83
|
+
};
|
|
84
|
+
dict?: Record<string, NativeConfigSchema>;
|
|
85
|
+
inner?: NativeConfigSchema;
|
|
86
|
+
sKey?: NativeConfigSchema;
|
|
87
|
+
list?: NativeConfigSchema[];
|
|
88
|
+
value?: unknown;
|
|
89
|
+
builder?: unknown;
|
|
90
|
+
}
|
|
91
|
+
/** Collected declaration used only while constructing the JSON Schema document. */
|
|
92
|
+
export interface CollectedConfigEntry extends ConfigSchemaEntry {
|
|
93
|
+
native?: NativeConfigSchema;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=types.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -12,14 +12,26 @@ import { dshHomePath } from '@deepseek-ai/dsh-home-paths';
|
|
|
12
12
|
import { type LaunchEnvironmentSnapshot } from '@deepseek-ai/dsh-launch-environment';
|
|
13
13
|
export { readProfilePatches, resolveTelemetryPatch, type ProfileContext, type ProfilePnpmInvocation } from './profile-context.ts';
|
|
14
14
|
export { sanitizeProfile } from './profile-sanitize.ts';
|
|
15
|
+
export { readPluginMeta } from './package-meta.ts';
|
|
16
|
+
export { generateConfigSchema, type ConfigSchemaDump, type NativeConfigSchema } from './config-schema/index.ts';
|
|
17
|
+
export { createConfigProjector, LOADER_EXPRESSION_SCHEMA, type ConfigProjection } from './config-schema/projector.ts';
|
|
18
|
+
export { isNativeConfigSchema } from './config-schema/native.ts';
|
|
15
19
|
export { readProfilePlugins, reconcileProfilePlugins, writeProfileBundles, type ProfilePluginLocation, type ProfilePluginDependency, type ProfilePluginInventory, type ProfilePluginReconciliation, } from './profile-plugins.ts';
|
|
16
20
|
declare module '@deepseek-ai/cordis' {
|
|
17
21
|
interface Context {
|
|
18
22
|
/** Harness-home path resolver available to Loader `!!js` config expressions. */
|
|
19
23
|
dshHomePath?: typeof dshHomePath;
|
|
20
24
|
}
|
|
25
|
+
interface Events {
|
|
26
|
+
/**
|
|
27
|
+
* Profile patches were reconciled into the running Loader tree: every entry update settled and no new
|
|
28
|
+
* inactive entry was introduced. Carries no diff; listeners re-read Loader entries.
|
|
29
|
+
* @mode emit
|
|
30
|
+
*/
|
|
31
|
+
'app-boot/config-reload'(): void;
|
|
32
|
+
}
|
|
21
33
|
}
|
|
22
|
-
export { composeEntries,
|
|
34
|
+
export { composeEntries, createRuntimeResolution, DEFAULT_PROFILE_BUNDLES, OPTIONAL_BUNDLES, bundlePatchFiles, bundlePatchPaths, initProfile, removeLinkProjections, loadProfile, loadProfileDirectory, PROFILE_PATCH_FILENAME, PROFILE_TEMPLATES, PROFILES_DIR, readProfileManifest, resolveBundleDir, resolveProfileDir, writeProfileManifest, type Profile, type ProfileLayer, type ProfileManifest, type LinkedRoot, type RuntimeResolutionOptions, type RuntimeResolutionEntry, type RuntimeResolution, type ProfileTemplate, } from './profile.ts';
|
|
23
35
|
export { PluginPackages, type PluginPackage, type PluginPackagesConfig, } from './profile-resolution/service.ts';
|
|
24
36
|
/**
|
|
25
37
|
* Resolve the config to boot. Replay swaps a `cordis.yml` basename for
|
|
@@ -132,13 +144,15 @@ export declare function renderConfigDump(binName: string, absoluteConfigPath: st
|
|
|
132
144
|
* entry creation was in flight.
|
|
133
145
|
*/
|
|
134
146
|
export declare function mountRootInclude(ctx: Context, absoluteConfigPath: string, patches?: readonly PatchOptions[], bareModuleBaseUrl?: string): Promise<Entry | undefined>;
|
|
147
|
+
/** The two process events {@link installFailLoud} turns into a fatal exit. */
|
|
148
|
+
export type FailLoudEvent = 'unhandledRejection' | 'uncaughtException';
|
|
135
149
|
/**
|
|
136
150
|
* The slice of `process` {@link installFailLoud} needs — injectable so tests
|
|
137
151
|
* exercise the handler without registering on (or exiting) the real process.
|
|
138
152
|
*/
|
|
139
153
|
export interface FailLoudProcess {
|
|
140
|
-
on(event:
|
|
141
|
-
off(event:
|
|
154
|
+
on(event: FailLoudEvent, handler: (err: unknown) => void): unknown;
|
|
155
|
+
off(event: FailLoudEvent, handler: (err: unknown) => void): unknown;
|
|
142
156
|
stderr: {
|
|
143
157
|
write(chunk: string): unknown;
|
|
144
158
|
};
|
|
@@ -155,11 +169,22 @@ export interface FailLoudProcess {
|
|
|
155
169
|
*/
|
|
156
170
|
export declare const FAIL_LOUD_RELEASE_TIMEOUT_MS = 2000;
|
|
157
171
|
/**
|
|
158
|
-
* Install before boot to turn
|
|
159
|
-
*
|
|
160
|
-
* {@link auditStartupEntries} is
|
|
161
|
-
*
|
|
162
|
-
*
|
|
172
|
+
* Install before boot to turn an unhandled rejection or an uncaught exception,
|
|
173
|
+
* at any point in the process lifetime, into one labelled stderr diagnostic and
|
|
174
|
+
* `exit(1)`. A rejection already included by {@link auditStartupEntries} is
|
|
175
|
+
* ignored during its process checkpoint; every other rejection and every
|
|
176
|
+
* uncaught exception remains fatal. Control never returns to the failed
|
|
177
|
+
* operation after either: only the throw site knows which state is intact, and
|
|
178
|
+
* a listener that threw mid-update (a stream `'data'` handler, a half-applied
|
|
179
|
+
* registry write) leaves silently wrong results behind if it were resumed. The
|
|
180
|
+
* event loop keeps running only until the release hook settles or times out.
|
|
181
|
+
* Stdout remains untouched for ACP; the returned function removes both handlers.
|
|
182
|
+
*
|
|
183
|
+
* The diagnostic is `util.inspect(err)`, not `err.stack`: a `node:fs` error's
|
|
184
|
+
* `code`, `syscall`, and `path` and any `cause` chain are enumerable properties
|
|
185
|
+
* that the stack line omits, and they are what a crash report needs. Once a
|
|
186
|
+
* handler is installed Node prints nothing of its own, so this line is the
|
|
187
|
+
* only record of the failure.
|
|
163
188
|
*
|
|
164
189
|
* The Loader mounts entries concurrently, so a surface that owns the terminal
|
|
165
190
|
* can already hold it when a sibling entry rejects. Exiting straight from the
|
|
@@ -181,7 +206,7 @@ export declare const FAIL_LOUD_RELEASE_TIMEOUT_MS = 2000;
|
|
|
181
206
|
* @param release - optional teardown awaited before exit, used by a
|
|
182
207
|
* terminal-owning surface to restore the terminal. Its own failure is
|
|
183
208
|
* swallowed because the pending fatal exit already owns the outcome.
|
|
184
|
-
* @returns the uninstaller that removes
|
|
209
|
+
* @returns the uninstaller that removes both handlers.
|
|
185
210
|
*/
|
|
186
211
|
export declare function installFailLoud(binName: string, proc?: FailLoudProcess, release?: () => Promise<void> | void): () => void;
|
|
187
212
|
interface InactiveEntry {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Read plugin display text and icons through exported resources without evaluating plugin code. */
|
|
2
|
+
import type { PluginLocalizedMeta } from '@deepseek-ai/dsh-package-manifest';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve a plugin resource through the active Node ESM resolver without evaluating it.
|
|
5
|
+
* @param specifier - complete resource module specifier, including its locale filename.
|
|
6
|
+
* @param parentURL - owning module-resolution base.
|
|
7
|
+
* @returns the local filesystem path selected by Node and the active profile.
|
|
8
|
+
* @throws when the resolver is unavailable or the resource cannot resolve to a local file.
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolvePluginResource(specifier: string, parentURL: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Read localized display text and the icon declared in a plugin's exported package.json.
|
|
13
|
+
* Icons are manifest-relative SVG, PNG, JPEG, or WebP files of at most 256 KiB,
|
|
14
|
+
* contained in the manifest directory after realpath resolution. Icon failures retain display text.
|
|
15
|
+
* Non-package specifiers are skipped without invoking the resource resolver.
|
|
16
|
+
* Language files share the directory containing the resolved English resource;
|
|
17
|
+
* each file is resolved through the complete plugin specifier before reading.
|
|
18
|
+
* Missing fields use the same address's package.json name/description. Translation
|
|
19
|
+
* maps retain an English fallback, ultimately the full module specifier for titles and empty for descriptions.
|
|
20
|
+
* @param specifier - configured plugin module name, including any package subpath.
|
|
21
|
+
* @param parentURL - owning Loader tree's module-resolution base.
|
|
22
|
+
* @returns display fields and any icon diagnostic, or undefined for non-package specifiers or absent metadata.
|
|
23
|
+
*/
|
|
24
|
+
export declare function readPluginMeta(specifier: string, parentURL: string): PluginLocalizedMeta | undefined;
|
|
25
|
+
//# sourceMappingURL=package-meta.d.ts.map
|
|
@@ -1,35 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
/** Profile-private package links projected into its pnpm-managed node_modules. */
|
|
3
|
-
export declare const PROFILE_MODULE_FALLBACK_DIR = ".dsh-module-fallback";
|
|
4
|
-
/**
|
|
5
|
-
* Return whether the process reads application modules from pkg's virtual filesystem.
|
|
6
|
-
* @returns whether pkg owns the module filesystem.
|
|
7
|
-
*/
|
|
8
|
-
export declare function isPackagedExecutable(): boolean;
|
|
1
|
+
/** Package directory canonicalization through the active runtime carrier's filesystem. */
|
|
9
2
|
/**
|
|
10
3
|
* Resolve a directory through the active carrier's filesystem implementation.
|
|
11
4
|
* @param path - directory path to canonicalize.
|
|
12
5
|
* @returns the canonical directory path.
|
|
13
6
|
*/
|
|
14
7
|
export declare function realModuleDirectory(path: string): string;
|
|
15
|
-
/**
|
|
16
|
-
* Resolve a link target without following the final path component.
|
|
17
|
-
* @param path - candidate path whose parent is canonicalized.
|
|
18
|
-
* @returns the canonical candidate, or undefined when its parent is absent.
|
|
19
|
-
*/
|
|
20
|
-
export declare function canonicalLinkPath(path: string): string | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Return whether a symlink or junction points at the same path as `target`.
|
|
23
|
-
* @param link - symlink or junction to inspect.
|
|
24
|
-
* @param target - expected target path.
|
|
25
|
-
* @returns whether both paths identify the same entry.
|
|
26
|
-
*/
|
|
27
|
-
export declare function symlinkPointsTo(link: string, target: string): boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Return whether an observed profile package must not claim local precedence.
|
|
30
|
-
* @param profileDir - profile directory containing the package projection.
|
|
31
|
-
* @param packageName - bare package name to inspect.
|
|
32
|
-
* @returns whether the entry is a managed fallback link or disappeared during inspection.
|
|
33
|
-
*/
|
|
34
|
-
export declare function isProfileModuleFallbackLink(profileDir: string, packageName: string): boolean;
|
|
35
8
|
//# sourceMappingURL=legacy-links.d.ts.map
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
/** In-memory profile package routing for Node's default ESM and CommonJS loaders. */
|
|
2
|
-
import type {
|
|
3
|
-
/**
|
|
4
|
-
export
|
|
5
|
-
/** Active resolver registration in one Node isolate. */
|
|
6
|
-
export interface ProfileResolutionRegistration {
|
|
2
|
+
import type { RuntimeResolution } from '../profile.ts';
|
|
3
|
+
/** Active interception in one Node isolate. */
|
|
4
|
+
export interface RuntimeInterception {
|
|
7
5
|
/**
|
|
8
6
|
* Locate a bare package without requiring one of its exports.
|
|
7
|
+
* A package subpath selects its package directory without resolving or validating the requested file.
|
|
9
8
|
* @param specifier - bare package or package-subpath specifier.
|
|
10
9
|
* @param parentURL - file URL whose lookup order applies.
|
|
11
10
|
* @returns selected package directory, or undefined when it is absent.
|
|
12
11
|
*/
|
|
13
12
|
packageDir(specifier: string, parentURL: string): string | undefined;
|
|
14
13
|
/**
|
|
15
|
-
* Atomically publish
|
|
16
|
-
*
|
|
17
|
-
* @
|
|
14
|
+
* Atomically publish a complete successor and fresh caches. Linked roots may be added or removed.
|
|
15
|
+
* Removed roots stop intercepting uncovered directories; existing modules and Node caches remain intact.
|
|
16
|
+
* @param successor - fully constructed generation retaining existing package mappings and local names.
|
|
17
|
+
* @throws when the profile scope or existing mappings change, local names are removed or override
|
|
18
|
+
* existing mappings, or a previously published link name selects a different real directory.
|
|
18
19
|
*/
|
|
19
|
-
replace(
|
|
20
|
-
/** Restore the native resolver methods.
|
|
20
|
+
replace(successor: RuntimeResolution): void;
|
|
21
|
+
/** Restore the native resolver methods. Interceptions dispose in reverse order. */
|
|
21
22
|
dispose(): void;
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
@@ -27,17 +28,15 @@ export interface ProfileResolutionRegistration {
|
|
|
27
28
|
*/
|
|
28
29
|
export declare function barePackageName(request: string): string | undefined;
|
|
29
30
|
/**
|
|
30
|
-
* Install one
|
|
31
|
-
* @param
|
|
32
|
-
* @
|
|
33
|
-
* @returns a registration that replaces the generation or restores the native methods.
|
|
31
|
+
* Install one runtime resolution as the interception on Node's default ESM and CommonJS resolvers.
|
|
32
|
+
* @param resolution - complete package table and profile scope.
|
|
33
|
+
* @returns an interception that publishes a successor or restores the native methods.
|
|
34
34
|
*/
|
|
35
|
-
export declare function
|
|
35
|
+
export declare function installRuntimeInterception(resolution: RuntimeResolution): RuntimeInterception;
|
|
36
36
|
/**
|
|
37
|
-
* Publish one
|
|
38
|
-
* @param
|
|
39
|
-
* @param behavior - enforce or verify the generation in newly created Workers.
|
|
37
|
+
* Publish one runtime resolution for Harness-owned Workers.
|
|
38
|
+
* @param resolution - complete package table and profile scope.
|
|
40
39
|
* @returns a disposer restoring the previous thread environment data.
|
|
41
40
|
*/
|
|
42
|
-
export declare function registerWorkerResolution(
|
|
41
|
+
export declare function registerWorkerResolution(resolution: RuntimeResolution): () => void;
|
|
43
42
|
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** Package metadata resolved through one
|
|
1
|
+
/** Package metadata resolved through one runtime interception. */
|
|
2
2
|
import { Service, type Context } from '@deepseek-ai/cordis';
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
3
|
+
import type { PluginLocalizedMeta } from '@deepseek-ai/dsh-package-manifest';
|
|
4
|
+
import type { RuntimeResolution } from '../profile.ts';
|
|
5
5
|
declare module '@deepseek-ai/cordis' {
|
|
6
6
|
interface Context {
|
|
7
7
|
/** Deterministic package lookup for configured plugin specifiers. */
|
|
@@ -21,25 +21,23 @@ export interface PluginPackage {
|
|
|
21
21
|
/** Parsed manifest shared by metadata readers. */
|
|
22
22
|
manifest: Record<string, unknown>;
|
|
23
23
|
}
|
|
24
|
-
/** Optional runtime
|
|
24
|
+
/** Optional runtime interception installed and owned by {@link PluginPackages}. */
|
|
25
25
|
export interface PluginPackagesConfig {
|
|
26
26
|
/** Complete package table; omit it to expose native package lookup only. */
|
|
27
|
-
|
|
28
|
-
/** Enforce the table or compare it with a materialized fallback. */
|
|
29
|
-
behavior?: ProfileResolutionBehavior;
|
|
27
|
+
resolution?: RuntimeResolution;
|
|
30
28
|
}
|
|
31
29
|
/** Package lookup shared by metadata consumers in one profile process. */
|
|
32
30
|
export declare class PluginPackages extends Service {
|
|
33
31
|
private packages;
|
|
34
|
-
private readonly
|
|
35
|
-
private readonly behavior;
|
|
32
|
+
private readonly interception;
|
|
36
33
|
private disposeWorkerResolution;
|
|
37
34
|
constructor(ctx: Context, config?: PluginPackagesConfig);
|
|
38
35
|
/**
|
|
39
|
-
* Publish
|
|
40
|
-
*
|
|
36
|
+
* Publish a complete successor generation for this process and subsequently created Workers.
|
|
37
|
+
* Linked roots may be removed without unloading modules or clearing Node caches.
|
|
38
|
+
* @param successor - fully constructed generation accepted by {@link RuntimeInterception.replace}.
|
|
41
39
|
*/
|
|
42
|
-
replace(
|
|
40
|
+
replace(successor: RuntimeResolution): void;
|
|
43
41
|
/**
|
|
44
42
|
* Locate the package named by a specifier without requiring a package export.
|
|
45
43
|
* @param specifier - module specifier whose package owns the requested module.
|
|
@@ -47,5 +45,12 @@ export declare class PluginPackages extends Service {
|
|
|
47
45
|
* @returns the parsed package, or undefined when no package owns the request.
|
|
48
46
|
*/
|
|
49
47
|
packageOf(specifier: string, parentURL: string): PluginPackage | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Read display metadata without loading or activating the target plugin.
|
|
50
|
+
* @param specifier - configured package module, including package subpaths.
|
|
51
|
+
* @param parentURL - owning Loader tree's resolution base.
|
|
52
|
+
* @returns local display metadata or its diagnostic; undefined for non-package requests or absent metadata.
|
|
53
|
+
*/
|
|
54
|
+
metaOf(specifier: string, parentURL: string): PluginLocalizedMeta | undefined;
|
|
50
55
|
}
|
|
51
56
|
//# sourceMappingURL=service.d.ts.map
|