@deepseek-ai/dsh-plugin-manager 0.1.6-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/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +133 -0
- package/README.zh.md +133 -0
- package/lib/index.js +1174 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +604 -0
- package/lib/typert.remote-client.d.ts +37 -0
- package/lib/typert.remote-client.js +393 -0
- package/lib/types/build-approval.d.ts +12 -0
- package/lib/types/build-approval.js +56 -0
- package/lib/types/failure.d.ts +10 -0
- package/lib/types/failure.js +8 -0
- package/lib/types/index.d.ts +107 -0
- package/lib/types/index.js +623 -0
- package/lib/types/install-failure.d.ts +23 -0
- package/lib/types/install-failure.js +33 -0
- package/lib/types/install-spec.d.ts +44 -0
- package/lib/types/install-spec.js +73 -0
- package/lib/types/operations.d.ts +93 -0
- package/lib/types/operations.js +177 -0
- package/lib/types/patch.d.ts +9 -0
- package/lib/types/patch.js +50 -0
- package/lib/types/tools.d.ts +8 -0
- package/lib/types/tools.js +74 -0
- package/lib/types/types.d.ts +169 -0
- package/lib/types/types.js +2 -0
- package/package.json +102 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/** Public plugin management records shared with clients. */
|
|
2
|
+
import type { Branded } from '@deepseek-ai/dsh-brand';
|
|
3
|
+
import type { PluginInventoryEntry } from '@deepseek-ai/dsh-host-plugin-inventory/types';
|
|
4
|
+
export type { PluginEntryId } from '@deepseek-ai/dsh-host-plugin-inventory/types';
|
|
5
|
+
import type { PluginEntryId } from '@deepseek-ai/dsh-host-plugin-inventory/types';
|
|
6
|
+
/** Reasons a profile control cannot modify its target. */
|
|
7
|
+
export type ReadOnlyReason = 'management-required' | 'unaddressable';
|
|
8
|
+
/** Localizable management failure and optional external diagnostic. */
|
|
9
|
+
export interface ManagementError {
|
|
10
|
+
code: ReadOnlyReason | 'unknown-plugin' | 'invalid-spec' | 'ambiguous-install' | 'not-bundle' | 'not-removable' | 'stop-profile' | 'bundle-in-use' | 'stale-approval' | 'operation-error';
|
|
11
|
+
diagnostic?: string;
|
|
12
|
+
}
|
|
13
|
+
/** One running-profile entry and its persistent control availability. */
|
|
14
|
+
export type PluginInfo = PluginInventoryEntry & ({
|
|
15
|
+
patchId: string;
|
|
16
|
+
readOnlyReason?: never;
|
|
17
|
+
} | {
|
|
18
|
+
patchId?: never;
|
|
19
|
+
readOnlyReason: ReadOnlyReason;
|
|
20
|
+
});
|
|
21
|
+
/** One row a bundle's patch declares, with its live entry while the bundle contributes it. */
|
|
22
|
+
export interface BundleRowInfo {
|
|
23
|
+
/** The row id as the patch declares it. */
|
|
24
|
+
rowId: string;
|
|
25
|
+
/** The module the row names. */
|
|
26
|
+
moduleName: string;
|
|
27
|
+
/** The Loader entry carrying this row, when exactly one live entry has its id. */
|
|
28
|
+
entryId?: PluginEntryId;
|
|
29
|
+
}
|
|
30
|
+
/** One installed or installation-provided bundle. */
|
|
31
|
+
export interface BundleInfo {
|
|
32
|
+
name: string;
|
|
33
|
+
version?: string;
|
|
34
|
+
/** `description` of the package manifest. */
|
|
35
|
+
description?: string;
|
|
36
|
+
enabled: boolean;
|
|
37
|
+
/** Whether the profile's own dependencies hold the package; false for a bundle the dsh installation supplies. */
|
|
38
|
+
installed: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the installation ships the bundle for the person to switch on: named by the launcher's `OPTIONAL_BUNDLES`,
|
|
41
|
+
* held by the installation's dependencies, selected by no shipped template, and never removable.
|
|
42
|
+
*/
|
|
43
|
+
optional: boolean;
|
|
44
|
+
removable: boolean;
|
|
45
|
+
readOnlyReason?: ReadOnlyReason;
|
|
46
|
+
error?: ManagementError;
|
|
47
|
+
/** The rows the bundle's patch inserts, in declaration order; empty when the patch cannot be read. */
|
|
48
|
+
rows: BundleRowInfo[];
|
|
49
|
+
/** Ids of rows the bundle's patch changes without declaring them: the built-in rows it configures or disables. */
|
|
50
|
+
overrides: string[];
|
|
51
|
+
}
|
|
52
|
+
/** How a pnpm run failed, read off how it ended and what it printed. */
|
|
53
|
+
export type PluginInstallFailureKind = 'pnpm-missing' | 'timeout' | 'not-found' | 'no-matching-version' | 'network' | 'disk-full' | 'permission' | 'build-blocked' | 'integrity' | 'unknown';
|
|
54
|
+
/** Pnpm completion, including a retrieval path for unabridged diagnostics. */
|
|
55
|
+
export interface PackageResult {
|
|
56
|
+
exitCode: number;
|
|
57
|
+
output: string;
|
|
58
|
+
truncated: boolean;
|
|
59
|
+
logPath: string;
|
|
60
|
+
/** Present when the run failed: what kind of failure its exit and output describe. */
|
|
61
|
+
kind?: PluginInstallFailureKind;
|
|
62
|
+
}
|
|
63
|
+
/** Persisted change and independently observed application outcome. */
|
|
64
|
+
export interface ChangeResult {
|
|
65
|
+
changed: boolean;
|
|
66
|
+
/** `cancelled` is an installation the caller stopped, its files restored. */
|
|
67
|
+
application: 'applied' | 'restart-required' | 'overridden' | 'failed' | 'cancelled';
|
|
68
|
+
/** Last attempted step; successful installation can proceed to enablement. */
|
|
69
|
+
stage: 'install' | 'enable' | 'remove';
|
|
70
|
+
target: string;
|
|
71
|
+
enabled?: boolean;
|
|
72
|
+
error?: ManagementError;
|
|
73
|
+
/** Pre-existing inactive entries the operation left as they were. */
|
|
74
|
+
warnings?: string[];
|
|
75
|
+
packageResult?: PackageResult;
|
|
76
|
+
/** The bundle an installation added, once pnpm and the bundle check accepted it. */
|
|
77
|
+
bundle?: string;
|
|
78
|
+
/** Exact package names awaiting explicit script approval in the profile's pnpm settings, read after a failed run. */
|
|
79
|
+
pendingBuilds?: string[];
|
|
80
|
+
/** Package script permissions saved before this installation attempt. */
|
|
81
|
+
approvedBuilds?: string[];
|
|
82
|
+
}
|
|
83
|
+
/** Identifies one installation from its start to its settlement, including its log chunks and cancellation. */
|
|
84
|
+
export type PluginInstallRequestId = Branded<'PluginInstallRequestId'>;
|
|
85
|
+
/** Bundle installation defaults to activation; callers that offer cancellation supply their request id. */
|
|
86
|
+
export interface InstallBundleOptions {
|
|
87
|
+
enabled?: boolean;
|
|
88
|
+
requestId?: PluginInstallRequestId;
|
|
89
|
+
/** Explicitly allow these pending packages' scripts for this profile, then install; a name no longer pending refuses the call. */
|
|
90
|
+
approvedBuilds?: string[];
|
|
91
|
+
}
|
|
92
|
+
/** The form one install spec takes, in pnpm's vocabulary. */
|
|
93
|
+
export type InstallSpecKind = 'registry' | 'path' | 'git' | 'tarball';
|
|
94
|
+
/** Why a spec was refused before anything installed. */
|
|
95
|
+
export type PluginInspectProblem = 'invalid-spec' | 'already-installed' | 'not-found' | 'not-a-package' | 'not-a-bundle' | 'network' | 'unknown';
|
|
96
|
+
/**
|
|
97
|
+
* What a spec names, read before installing it: the registry's answer for a
|
|
98
|
+
* name, a directory's manifest for a path, and only the form for a git or
|
|
99
|
+
* tarball spec, whose package is known once pnpm has fetched it.
|
|
100
|
+
*/
|
|
101
|
+
export type PluginSpecInspection = {
|
|
102
|
+
readonly status: 'accepted';
|
|
103
|
+
readonly kind: InstallSpecKind;
|
|
104
|
+
readonly name?: string;
|
|
105
|
+
readonly version?: string;
|
|
106
|
+
/** `description` of the package manifest. */
|
|
107
|
+
readonly description?: string;
|
|
108
|
+
/** Whether the package declares a bundle patch; null when the spec's form does not say. */
|
|
109
|
+
readonly bundle: boolean | null;
|
|
110
|
+
} | {
|
|
111
|
+
readonly status: 'refused';
|
|
112
|
+
readonly problem: PluginInspectProblem;
|
|
113
|
+
/** What pnpm, the registry, or the file system said. */
|
|
114
|
+
readonly reason: string;
|
|
115
|
+
};
|
|
116
|
+
/** The Host phase of one installation, before its install call settles. */
|
|
117
|
+
export interface PluginInstallProgress {
|
|
118
|
+
readonly requestId: PluginInstallRequestId;
|
|
119
|
+
readonly phase: 'installing' | 'cancelling' | 'applying';
|
|
120
|
+
}
|
|
121
|
+
/** Cancellation is confirmed only after process exit and file restoration. */
|
|
122
|
+
export interface PluginInstallCancellation {
|
|
123
|
+
readonly status: 'cancelled' | 'too-late' | 'not-running';
|
|
124
|
+
}
|
|
125
|
+
/** One chunk of a pnpm run's output, as the run produces it. */
|
|
126
|
+
export interface PluginInstallLogChunk {
|
|
127
|
+
/** The installation the run belongs to, when its caller supplied a request id. */
|
|
128
|
+
readonly requestId?: PluginInstallRequestId;
|
|
129
|
+
/** The run the chunk belongs to. */
|
|
130
|
+
readonly jobId: string;
|
|
131
|
+
/** The command line the run executes: pnpm's command name, then its arguments. */
|
|
132
|
+
readonly argv: readonly string[];
|
|
133
|
+
/** The directory the run executes in: the profile directory. */
|
|
134
|
+
readonly cwd: string;
|
|
135
|
+
readonly stream: 'stdout' | 'stderr';
|
|
136
|
+
readonly text: string;
|
|
137
|
+
/** Present on the run's last chunk: pnpm's exit code, null when it ended without one. */
|
|
138
|
+
readonly exitCode?: number | null;
|
|
139
|
+
}
|
|
140
|
+
/** What changed in the profile, for consumers that show it. */
|
|
141
|
+
export interface PluginChange {
|
|
142
|
+
/** The operation that changed it. */
|
|
143
|
+
readonly reason: 'plugin' | 'bundle' | 'install' | 'remove';
|
|
144
|
+
}
|
|
145
|
+
declare module '@deepseek-ai/cordis' {
|
|
146
|
+
interface Events {
|
|
147
|
+
/**
|
|
148
|
+
* The profile's plugins, bundles, or composition changed: a manager
|
|
149
|
+
* operation completed. A patch generation applied outside the manager,
|
|
150
|
+
* by HMR's watcher after a CLI or hand edit, announces nothing here.
|
|
151
|
+
* @mode emit
|
|
152
|
+
* @param change - what changed.
|
|
153
|
+
*/
|
|
154
|
+
'plugin-manager/changed'(change: PluginChange): void;
|
|
155
|
+
/**
|
|
156
|
+
* One chunk of a pnpm run's output, streamed as the run produces it.
|
|
157
|
+
* @mode emit
|
|
158
|
+
* @param chunk - the chunk and the run it belongs to.
|
|
159
|
+
*/
|
|
160
|
+
'plugin-manager/install-log'(chunk: PluginInstallLogChunk): void;
|
|
161
|
+
/**
|
|
162
|
+
* An installation moved between its Host phases.
|
|
163
|
+
* @mode emit
|
|
164
|
+
* @param progress - the installation's request id and phase.
|
|
165
|
+
*/
|
|
166
|
+
'plugin-manager/install-state'(progress: PluginInstallProgress): void;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=types.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deepseek-ai/dsh-plugin-manager",
|
|
3
|
+
"description": "Current-profile plugin and bundle management shared by dsh CLI, Web and agent tools",
|
|
4
|
+
"version": "0.1.6-alpha.2",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
+
"directory": "packages/boot/plugin-manager"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./types": {
|
|
22
|
+
"types": "./lib/types/types.d.ts",
|
|
23
|
+
"default": "./lib/types/types.js"
|
|
24
|
+
},
|
|
25
|
+
"./typert": {
|
|
26
|
+
"types": "./lib/typert.host.d.ts",
|
|
27
|
+
"default": "./lib/typert.host.js"
|
|
28
|
+
},
|
|
29
|
+
"./remote": {
|
|
30
|
+
"types": "./lib/typert.remote-client.d.ts",
|
|
31
|
+
"default": "./lib/typert.remote-client.js"
|
|
32
|
+
},
|
|
33
|
+
"./src/*": "./src/*",
|
|
34
|
+
"./package.json": "./package.json",
|
|
35
|
+
"./operations": {
|
|
36
|
+
"types": "./lib/types/operations.d.ts",
|
|
37
|
+
"default": "./lib/types/operations.js"
|
|
38
|
+
},
|
|
39
|
+
"./tools": {
|
|
40
|
+
"types": "./lib/types/tools.d.ts",
|
|
41
|
+
"default": "./lib/types/tools.js"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"lib/index.js",
|
|
46
|
+
"lib/types/**/*.js",
|
|
47
|
+
"lib/types/**/*.d.ts",
|
|
48
|
+
"lib/typert.host.js",
|
|
49
|
+
"lib/typert.host.d.ts",
|
|
50
|
+
"lib/typert.remote-client.js",
|
|
51
|
+
"lib/typert.remote-client.d.ts"
|
|
52
|
+
],
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"execa": "^10.0.0",
|
|
56
|
+
"yaml": "^2.9.0",
|
|
57
|
+
"zod": "^4.4.3",
|
|
58
|
+
"@deepseek-ai/dsh-app-boot": "^0.1.6-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-atomic-write": "^0.1.6-alpha.2",
|
|
60
|
+
"@deepseek-ai/schemastery": "^3.18.2",
|
|
61
|
+
"@deepseek-ai/dsh-util-values": "^0.1.6-alpha.2"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
65
|
+
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
66
|
+
"@deepseek-ai/dsh-subprocess": "^0.1.6-alpha.2",
|
|
67
|
+
"@deepseek-ai/dsh-tools": "^0.1.6-alpha.2",
|
|
68
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.1.6-alpha.2",
|
|
69
|
+
"@deepseek-ai/dsh-host-plugin-inventory": "^0.1.6-alpha.2",
|
|
70
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.2",
|
|
71
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.1.6-alpha.2",
|
|
72
|
+
"@deepseek-ai/dsh-hmr": "^0.1.6-alpha.2",
|
|
73
|
+
"@deepseek-ai/dsh-user-approval": "^0.1.6-alpha.2",
|
|
74
|
+
"@deepseek-ai/dsh-sandbox": "^0.1.6-alpha.2"
|
|
75
|
+
},
|
|
76
|
+
"peerDependenciesMeta": {
|
|
77
|
+
"@deepseek-ai/dsh-hmr": {
|
|
78
|
+
"optional": true
|
|
79
|
+
},
|
|
80
|
+
"@deepseek-ai/dsh-user-approval": {
|
|
81
|
+
"optional": true
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"devDependencies": {
|
|
85
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
86
|
+
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
87
|
+
"@deepseek-ai/dsh-tools": "^0.1.6-alpha.2",
|
|
88
|
+
"@deepseek-ai/dsh-subprocess": "^0.1.6-alpha.2",
|
|
89
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.6-alpha.2",
|
|
90
|
+
"@deepseek-ai/dsh-hmr": "^0.1.6-alpha.2",
|
|
91
|
+
"@deepseek-ai/cordis-plugin-timer": "^1.1.4",
|
|
92
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.1.6-alpha.2",
|
|
93
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.2",
|
|
94
|
+
"@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
|
|
95
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2",
|
|
96
|
+
"@deepseek-ai/dsh-sandbox": "^0.1.6-alpha.2",
|
|
97
|
+
"@deepseek-ai/dsh-user-approval": "^0.1.6-alpha.2",
|
|
98
|
+
"@deepseek-ai/dsh-host-plugin-inventory": "^0.1.6-alpha.2",
|
|
99
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.1.6-alpha.2",
|
|
100
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.2"
|
|
101
|
+
}
|
|
102
|
+
}
|