dsh-home-hosted 0.2.1 → 0.2.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.md +8 -3
- package/docs/DESIGN.md +20 -0
- package/lib/client.js +89 -6
- package/lib/index.js +107 -7
- package/lib/index.js.map +3 -3
- package/lib/types/home-hosted/entries.d.ts +18 -4
- package/lib/types/home-hosted/resolve.d.ts +3 -1
- package/lib/types/home-hosted/web-notice.d.ts +18 -0
- package/lib/types/service.d.ts +4 -0
- package/lib/types/shared/contracts.d.ts +12 -0
- package/package.json +18 -4
|
@@ -12,10 +12,24 @@ import type { EntryIntent, OnPortConflict, ServerEntry, ServerEntryPatch } from
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function defaultOnPortConflict(platform?: NodeJS.Platform): OnPortConflict;
|
|
14
14
|
export declare function defaultIntent(id: string, platform?: NodeJS.Platform): EntryIntent;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The owned keys as a patch, preserving any sibling keys inside `stop`.
|
|
17
|
+
*
|
|
18
|
+
* `persistent` is omitted unless the panel that would parse the write knows the
|
|
19
|
+
* key: an older schema drops it and warns, so writing one is noise at best.
|
|
20
|
+
*/
|
|
21
|
+
export declare function ownedPatch(intent: EntryIntent, live?: ServerEntry | null, options?: {
|
|
22
|
+
persistent?: boolean;
|
|
23
|
+
}): ServerEntryPatch;
|
|
24
|
+
/**
|
|
25
|
+
* Owned keys whose live value differs from the intent.
|
|
26
|
+
*
|
|
27
|
+
* The intent keeps what the person asked for; a key the panel cannot parse is
|
|
28
|
+
* not drift, or every entry would report one on an older panel.
|
|
29
|
+
*/
|
|
30
|
+
export declare function ownedDrift(live: ServerEntry | null, intent: EntryIntent, options?: {
|
|
31
|
+
persistent?: boolean;
|
|
32
|
+
}): string[];
|
|
19
33
|
/**
|
|
20
34
|
* Only the owned keys, as they were before this plugin touched the entry.
|
|
21
35
|
*
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { CliStatus } from '../shared/contracts.js';
|
|
2
2
|
import type { CliLaunch } from './launch.js';
|
|
3
3
|
/** The range the plugin ships and is tested against. */
|
|
4
|
-
export declare const EXPECTED_RANGE = "^0.6.
|
|
4
|
+
export declare const EXPECTED_RANGE = "^0.6.4";
|
|
5
5
|
/** Oldest release whose API and config schema this plugin relies on. */
|
|
6
6
|
export declare const MIN_SUPPORTED_VERSION = "0.4.1";
|
|
7
7
|
/** Oldest release whose config schema accepts `onPortConflict: kill`. */
|
|
8
8
|
export declare const MIN_KILL_VERSION = "0.6.0";
|
|
9
|
+
/** `persistent` (the nanny that keeps an entry alive across panel restarts). */
|
|
10
|
+
export declare const MIN_PERSISTENT_VERSION = "0.6.3";
|
|
9
11
|
export type CliPreference = 'pinned' | 'global';
|
|
10
12
|
export interface CliResolution {
|
|
11
13
|
launch: CliLaunch | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
/**
|
|
3
|
+
* dsh web answers an unauthenticated browser with a plain-text 401 line written
|
|
4
|
+
* by the in-box connection plugin. That text is not configurable and no event
|
|
5
|
+
* covers it, so a home-hosted deployment — which is where this session's log,
|
|
6
|
+
* and with it the tokenised URL, actually lives — appends where to look.
|
|
7
|
+
*
|
|
8
|
+
* It reaches one internal field, `connection.browserAuth.writeUnauthorized`, and
|
|
9
|
+
* fails soft: if that shape is ever gone, dsh's own text is left untouched.
|
|
10
|
+
*/
|
|
11
|
+
export declare const STOCK_UNAUTHORIZED = "dsh web authentication required; reopen the URL printed by dsh web.";
|
|
12
|
+
/** The 401 body: dsh's own line, plus where this deployment's log page is. */
|
|
13
|
+
export declare function authNoticeBody(logUrl: string | null): string;
|
|
14
|
+
/**
|
|
15
|
+
* Install the notice once the connection service is up. `logUrlOf` is read per
|
|
16
|
+
* 401, so turning the setting off takes effect without re-installing anything.
|
|
17
|
+
*/
|
|
18
|
+
export declare function registerAuthNotice(ctx: Context, logUrlOf: () => string | null): void;
|
package/lib/types/service.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ export declare class HomeHostedService extends Service {
|
|
|
63
63
|
private cli;
|
|
64
64
|
private panelControlDeps;
|
|
65
65
|
private cliExec;
|
|
66
|
+
/** The panel page showing this session's log, where its tokenised URL is. */
|
|
67
|
+
panelLogUrl(): string | null;
|
|
66
68
|
/** The port the panel's config holds, without touching a running panel. */
|
|
67
69
|
private configuredPort;
|
|
68
70
|
/** Write the chosen panel port into the state the panel boots from. */
|
|
@@ -82,6 +84,8 @@ export declare class HomeHostedService extends Service {
|
|
|
82
84
|
* older panel refuses to *boot* with it — so this is checked before any write.
|
|
83
85
|
*/
|
|
84
86
|
private configVersion;
|
|
87
|
+
/** Whether the panel whose schema parses our write knows `persistent`. */
|
|
88
|
+
private supportsPersistent;
|
|
85
89
|
private assertPolicySupported;
|
|
86
90
|
private applyIntents;
|
|
87
91
|
/**
|
|
@@ -28,6 +28,8 @@ export interface SettingsPatch {
|
|
|
28
28
|
manageDsh?: boolean;
|
|
29
29
|
entries?: PluginSettings['entries'];
|
|
30
30
|
panel?: Partial<PluginSettings['panel']>;
|
|
31
|
+
authNotice?: boolean;
|
|
32
|
+
uiStyle?: UiStyle;
|
|
31
33
|
agentTools?: Partial<PluginSettings['agentTools']>;
|
|
32
34
|
cli?: Partial<PluginSettings['cli']>;
|
|
33
35
|
}
|
|
@@ -131,6 +133,11 @@ export type ServerEntryPatch = Partial<ServerEntry>;
|
|
|
131
133
|
/** What the plugin decides about one entry, and the keys it therefore owns. */
|
|
132
134
|
export interface EntryIntent {
|
|
133
135
|
id: string;
|
|
136
|
+
/**
|
|
137
|
+
* Run under home-hosted's nanny, so stopping or restarting the *panel* leaves
|
|
138
|
+
* this process alive. Needs home-hosted 0.6.3.
|
|
139
|
+
*/
|
|
140
|
+
persistent: boolean;
|
|
134
141
|
autostart: boolean;
|
|
135
142
|
onPortConflict: OnPortConflict;
|
|
136
143
|
stopKillPortHolders: boolean;
|
|
@@ -250,6 +257,7 @@ export declare const AGENT_TOOL_NAMES: readonly AgentToolName[];
|
|
|
250
257
|
export declare const MUTATING_AGENT_TOOLS: readonly AgentToolName[];
|
|
251
258
|
/** The shape this release writes; a file without it was written by 0.1.x. */
|
|
252
259
|
export declare const SETTINGS_VERSION = 2;
|
|
260
|
+
export type UiStyle = 'detailed' | 'compact';
|
|
253
261
|
export interface PluginSettings {
|
|
254
262
|
version: number;
|
|
255
263
|
autostart: {
|
|
@@ -270,6 +278,10 @@ export interface PluginSettings {
|
|
|
270
278
|
panel: {
|
|
271
279
|
port: number | null;
|
|
272
280
|
};
|
|
281
|
+
/** Point dsh web's sign-in page at the panel log that holds the tokenised URL. */
|
|
282
|
+
authNotice: boolean;
|
|
283
|
+
/** `detailed` shows cards and open disclosures; `compact` folds both away. */
|
|
284
|
+
uiStyle: UiStyle;
|
|
273
285
|
cli: {
|
|
274
286
|
/** `pinned` runs the copy this plugin ships; `global` runs the one on PATH. */
|
|
275
287
|
prefer: 'pinned' | 'global';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-home-hosted",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "DeepSeek Harness (dsh) plugin: start your dsh web server automatically at boot, and manage home-hosted's panel and servers from inside dsh.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"publishConfig": {
|
|
@@ -17,11 +17,25 @@
|
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
19
19
|
"deepseek-harness",
|
|
20
|
+
"dsh",
|
|
20
21
|
"dsh-plugin",
|
|
22
|
+
"deepseek",
|
|
21
23
|
"home-hosted",
|
|
22
24
|
"autostart",
|
|
25
|
+
"boot",
|
|
26
|
+
"startup",
|
|
27
|
+
"reboot",
|
|
23
28
|
"systemd",
|
|
24
|
-
"launchd"
|
|
29
|
+
"launchd",
|
|
30
|
+
"xdg-autostart",
|
|
31
|
+
"windows-task-scheduler",
|
|
32
|
+
"process-supervisor",
|
|
33
|
+
"server-management",
|
|
34
|
+
"self-hosted",
|
|
35
|
+
"homelab",
|
|
36
|
+
"agent-tools",
|
|
37
|
+
"cordis",
|
|
38
|
+
"typescript"
|
|
25
39
|
],
|
|
26
40
|
"engines": {
|
|
27
41
|
"node": ">=24"
|
|
@@ -103,6 +117,6 @@
|
|
|
103
117
|
"vitest": "^2.1.8"
|
|
104
118
|
},
|
|
105
119
|
"dependencies": {
|
|
106
|
-
"home-hosted": "^0.6.
|
|
120
|
+
"home-hosted": "^0.6.4"
|
|
107
121
|
}
|
|
108
122
|
}
|