@deepseek-ai/dsh-plugin-manager 0.2.1-alpha.1 → 0.2.1-alpha.3
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 +10 -10
- package/README.md +14 -7
- package/README.zh.md +15 -8
- package/lib/index.js +585 -292
- package/lib/typert.host.js +407 -242
- package/lib/typert.remote-client.d.ts +16 -2
- package/lib/typert.remote-client.js +390 -234
- package/lib/types/build-approval.d.ts +14 -2
- package/lib/types/build-approval.js +35 -5
- package/lib/types/index.d.ts +22 -2
- package/lib/types/index.js +172 -62
- package/lib/types/official-install-target.d.ts +15 -0
- package/lib/types/official-install-target.js +54 -0
- package/lib/types/operations.d.ts +1 -0
- package/lib/types/operations.js +320 -255
- package/lib/types/patch.d.ts +12 -3
- package/lib/types/patch.js +47 -9
- package/lib/types/tools.js +70 -8
- package/lib/types/types.d.ts +24 -3
- package/locale/en.json +5 -0
- package/locale/tools/en.json +5 -0
- package/locale/tools/zh.json +5 -0
- package/locale/zh.json +6 -0
- package/package.json +40 -36
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Select Official bundle packages from the running installation without importing provider code. */
|
|
2
|
+
import { existsSync, globSync, readFileSync, realpathSync, statSync } from 'node:fs';
|
|
3
|
+
import { dirname, join, resolve } from 'node:path';
|
|
4
|
+
import { bundlePatchPaths } from '@deepseek-ai/dsh-app-boot';
|
|
5
|
+
function manifestAt(file) {
|
|
6
|
+
return JSON.parse(readFileSync(file, 'utf8'));
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Offer a source checkout link or an exact published package version. Source installations are
|
|
10
|
+
* identified by the real CLI manifest and its unpacked workspace dependencies, including Desktop's
|
|
11
|
+
* development symlink. An incomplete checkout is an error, never a registry fallback.
|
|
12
|
+
* @param name - Official catalog package name.
|
|
13
|
+
* @param installAnchor - Running application's DSH package.json, possibly reached through a symlink.
|
|
14
|
+
* @param version - Running DSH version used by its release family.
|
|
15
|
+
* @returns An ordinary package-manager spec and its package version.
|
|
16
|
+
* @throws when a source installation lacks its workspace package, bundle patch, or built runtime.
|
|
17
|
+
*/
|
|
18
|
+
export function officialBundleInstallTarget(name, installAnchor, version) {
|
|
19
|
+
const anchor = realpathSync(installAnchor);
|
|
20
|
+
const installation = manifestAt(anchor);
|
|
21
|
+
const source = installation.name === '@deepseek-ai/dsh'
|
|
22
|
+
&& Object.values(installation.dependencies ?? {}).some(value => value.startsWith('workspace:'));
|
|
23
|
+
if (!source)
|
|
24
|
+
return { spec: `${name}@${version}`, version };
|
|
25
|
+
const root = resolve(dirname(anchor), '../..');
|
|
26
|
+
if (anchor !== join(root, 'apps', 'cli', 'package.json')
|
|
27
|
+
|| !existsSync(join(root, 'package.json'))
|
|
28
|
+
|| manifestAt(join(root, 'package.json')).name !== '@deepseek-ai/dsh-root') {
|
|
29
|
+
throw new Error(`Official bundle ${name}: source DSH installation ${anchor} requires its complete workspace checkout`);
|
|
30
|
+
}
|
|
31
|
+
const matches = globSync('packages/*/*/package.json', { cwd: root })
|
|
32
|
+
.map(file => ({ file: join(root, file), manifest: manifestAt(join(root, file)) }))
|
|
33
|
+
.filter(entry => entry.manifest.name === name);
|
|
34
|
+
const selected = matches[0];
|
|
35
|
+
if (matches.length !== 1 || selected === undefined) {
|
|
36
|
+
throw new Error(`Official bundle ${name}: expected one workspace package in ${root}, found ${matches.length}; restore the checkout and run pnpm install`);
|
|
37
|
+
}
|
|
38
|
+
const { file, manifest } = selected;
|
|
39
|
+
const directory = realpathSync(dirname(file));
|
|
40
|
+
if (manifest.version !== version || manifest.private === true || manifest.dsh?.bundle === undefined) {
|
|
41
|
+
throw new Error(`Official bundle ${name}: ${file} must declare a public bundle at DSH version ${version}`);
|
|
42
|
+
}
|
|
43
|
+
const main = typeof manifest.main === 'string' ? resolve(directory, manifest.main) : undefined;
|
|
44
|
+
if (main === undefined || !existsSync(main) || !statSync(main).isFile()) {
|
|
45
|
+
throw new Error(`Official bundle ${name}: built runtime is missing in ${directory}; run pnpm install and pnpm run build in ${root}`);
|
|
46
|
+
}
|
|
47
|
+
for (const patch of bundlePatchPaths(directory, manifest.dsh.bundle)) {
|
|
48
|
+
if (!existsSync(patch) || !statSync(patch).isFile()) {
|
|
49
|
+
throw new Error(`Official bundle ${name}: bundle patch ${patch} is missing; restore the checkout`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return { spec: `link:${directory}`, version };
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=official-install-target.js.map
|
|
@@ -62,6 +62,7 @@ export declare function saveManifest(dir: string, manifest: ProfileManifest): Pr
|
|
|
62
62
|
* @param options Output, activation and cancellation policy.
|
|
63
63
|
* @returns Exit status, whether the silence bound stopped the run, and the diagnostic path.
|
|
64
64
|
* A compatibility denial returns exit code 1. Service output is bounded; CLI output uses inherited descriptors.
|
|
65
|
+
* The diagnostic file is closed on return or rejection, including preparation and spawn failures.
|
|
65
66
|
*/
|
|
66
67
|
export declare function runProfilePnpm(context: PackageOperationContext, args: readonly string[], options: PackageOperationOptions): Promise<PackageResult>;
|
|
67
68
|
/** Initialize and run the dsh plugin command with the same write lock as the service.
|