dsh-plugin-shop 0.8.4-beta.0 → 0.8.4
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 +3 -3
- package/lib/client.js +464 -337
- package/lib/index.js +918 -94
- package/lib/typert.host.js +10 -10
- package/lib/typert.remote-client.js +10 -10
- package/lib/types/client/locales.d.ts +2 -0
- package/lib/types/client/present.d.ts +1 -0
- package/lib/types/client/restart-monitor.d.ts +62 -6
- package/lib/types/host/executor.d.ts +50 -3
- package/lib/types/host/index.d.ts +82 -21
- package/lib/types/host/manager-runner.d.ts +51 -0
- package/lib/types/host/plugin-manager.d.ts +100 -0
- package/package.json +1 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh's `pluginManager` service (0.1.7 on), as far as this shop calls it:
|
|
3
|
+
* design 2026-09-26-plugin-manager-delegation. Structural throughout: the
|
|
4
|
+
* build compiles against the 0.1.1-rc.2 harness floor, where
|
|
5
|
+
* `@deepseek-ai/dsh-plugin-manager` does not exist.
|
|
6
|
+
*/
|
|
7
|
+
import { type Activation } from './activation.ts';
|
|
8
|
+
import type { HotRestartReason } from './hot.ts';
|
|
9
|
+
/** The operations the shop calls. `cancelInstall` is optional because only
|
|
10
|
+
* the install deadline uses it. Answers stay `unknown` until `readChange`
|
|
11
|
+
* reads them: a later harness may add or drop fields. */
|
|
12
|
+
export interface PluginManagerLike {
|
|
13
|
+
installBundle(spec: string, options: {
|
|
14
|
+
requestId: string;
|
|
15
|
+
}): Promise<unknown>;
|
|
16
|
+
removeBundle(name: string): Promise<unknown>;
|
|
17
|
+
/** `id` is the live loader entry id `listPlugins` reports (`include:...`),
|
|
18
|
+
* not the patch row id (dsh 0.1.7-rc.2 `setPluginEnabled`). */
|
|
19
|
+
setPluginEnabled(id: string, enabled: boolean): Promise<unknown>;
|
|
20
|
+
setBundleEnabled(name: string, enabled: boolean): Promise<unknown>;
|
|
21
|
+
cancelInstall?(requestId: string): Promise<unknown>;
|
|
22
|
+
}
|
|
23
|
+
/** The service, when `service` offers every required operation; else null.
|
|
24
|
+
* All or nothing: half a service would take an install and fail its
|
|
25
|
+
* uninstall. */
|
|
26
|
+
export declare function asPluginManager(service: unknown): PluginManagerLike | null;
|
|
27
|
+
export interface ManagerIncompatible {
|
|
28
|
+
name: string;
|
|
29
|
+
version: string;
|
|
30
|
+
runtimeVersion: string;
|
|
31
|
+
peers: Record<string, string>;
|
|
32
|
+
}
|
|
33
|
+
/** The facts of one answer, each checked for its type. */
|
|
34
|
+
export interface ManagerChange {
|
|
35
|
+
application: string | null;
|
|
36
|
+
stage: string | null;
|
|
37
|
+
errorCode: string | null;
|
|
38
|
+
diagnostic: string | null;
|
|
39
|
+
incompatible: ManagerIncompatible[];
|
|
40
|
+
kind: string | null;
|
|
41
|
+
output: string;
|
|
42
|
+
pendingBuilds: string[];
|
|
43
|
+
failedAt: string | null;
|
|
44
|
+
/** Whether the profile's files differ from before the operation (dsh's
|
|
45
|
+
* `diskState`, which covers package.json). */
|
|
46
|
+
changed: boolean | null;
|
|
47
|
+
/** dsh keeps only the last 16 KB of a pnpm run's output; true when this
|
|
48
|
+
* answer's `packageResult.output` was cut short, so an absence in it
|
|
49
|
+
* proves nothing. */
|
|
50
|
+
truncated: boolean;
|
|
51
|
+
}
|
|
52
|
+
/** Read one `ChangeResult`. Every field is optional: one a later harness
|
|
53
|
+
* drops reads as absent, never as a crash. */
|
|
54
|
+
export declare function readChange(raw: unknown): ManagerChange;
|
|
55
|
+
/** `change`, with every clause naming a `dsh plugin` command removed from
|
|
56
|
+
* `diagnostic` and `output`: dsh's CLI refuses every `plugin` subcommand for
|
|
57
|
+
* the desktop profile, so a step dsh wrote assuming that command exists must
|
|
58
|
+
* not reach a reader there. Two dsh texts this exists for: dsh-app-boot's
|
|
59
|
+
* `pluginCompatibilityWarning` ("... with `dsh plugin allow-version` or the
|
|
60
|
+
* plugin manager ..."), whose sentence goes whole, and the restoration line
|
|
61
|
+
* after a failed repair ("..., but node_modules could not be reinstalled;
|
|
62
|
+
* run 'dsh plugin install'"), which keeps what it says dsh restored. A
|
|
63
|
+
* clause is a run between `; ` separators within a sentence; a sentence left
|
|
64
|
+
* with no clause is dropped, and so is a line left with no sentence. Every
|
|
65
|
+
* other line stays untouched, and a diagnostic left empty afterward reads as
|
|
66
|
+
* absent, the same way `codeReason` already treats one. */
|
|
67
|
+
export declare function forDesktopReader(change: ManagerChange): ManagerChange;
|
|
68
|
+
/** The end of a detail that passes on what a service call threw: `: ` and
|
|
69
|
+
* the message, scrubbed for a desktop reader as `forDesktopReader` scrubs
|
|
70
|
+
* dsh's answer, since a thrown message is dsh's text as well. A message left
|
|
71
|
+
* with nothing to say ends the detail with a period instead. */
|
|
72
|
+
export declare function thrownTail(message: string, desktop: boolean): string;
|
|
73
|
+
export interface ManagerOutcome {
|
|
74
|
+
state: 'done' | 'failed';
|
|
75
|
+
activation?: Activation;
|
|
76
|
+
restartReason?: HotRestartReason;
|
|
77
|
+
detail?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface OutcomeContext {
|
|
80
|
+
profile: string;
|
|
81
|
+
name: string;
|
|
82
|
+
operation: 'install' | 'update' | 'uninstall';
|
|
83
|
+
/** The gateway's `imported` record holds the name (market borrowings section 1). */
|
|
84
|
+
alreadyImported: boolean;
|
|
85
|
+
hasClientHalf: boolean;
|
|
86
|
+
/** The desktop profile, whose readers can run no `dsh plugin` command. */
|
|
87
|
+
desktop: boolean;
|
|
88
|
+
timeoutMs: number;
|
|
89
|
+
}
|
|
90
|
+
/** The sentence a management code gets, plus dsh's own diagnostic. The
|
|
91
|
+
* diagnostic is trimmed and stripped of one trailing period so one that
|
|
92
|
+
* already ends in a period is not doubled; empty after that reads as
|
|
93
|
+
* absent. Exported: Task 7 builds the same tail for a non-terminal notice. */
|
|
94
|
+
export declare function codeReason(change: ManagerChange, code: string): string;
|
|
95
|
+
/** A `ChangeResult` as the shop's terminal install record: design
|
|
96
|
+
* 2026-09-26-plugin-manager-delegation, section 5, read by the first rule
|
|
97
|
+
* that matches. A removal that failed after dsh changed the profile says,
|
|
98
|
+
* after whichever rule read it, that the package is still installed and
|
|
99
|
+
* switched off. */
|
|
100
|
+
export declare function managerOutcome(raw: unknown, context: OutcomeContext): ManagerOutcome;
|
package/package.json
CHANGED