dsh-home-hosted 0.7.2 → 0.7.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.
@@ -36,14 +36,31 @@ export declare function shellCommand(program: string, args: string[]): string;
36
36
  */
37
37
  export declare function systemdExecWord(value: string): string;
38
38
  /**
39
- * A single-line free-text setting such as `Description=` (specifiers only).
39
+ * A single-line free-text setting such as `Description=`.
40
+ *
41
+ * systemd reads these **verbatim** — unlike `ExecStart=`, it does not unescape
42
+ * `\\` or `$` there — so doubling a backslash puts a backslash *into* the value.
43
+ * Only two things need care: `%` starts a specifier, and a value that *ends* in a
44
+ * backslash splices the following line onto this directive, because the
45
+ * continuation rule applies to the raw line whatever the setting. A trailing
46
+ * space is the one encoding that leaves both the value and the next directive
47
+ * intact.
40
48
  */
41
49
  export declare function systemdText(value: string): string;
42
50
  /**
43
- * A path setting (`WorkingDirectory=`). systemd does not unquote these, but it
44
- * does expand `%` specifiers (an unknown one is fatal, verified with
45
- * `systemd-analyze verify`), and a trailing `\` continues the line into the next
46
- * directive. So both are escaped rather than passed raw.
51
+ * A path setting (`WorkingDirectory=`).
52
+ *
53
+ * Measured against real systemd (`systemctl show -p WorkingDirectory --value`):
54
+ * the value is taken **verbatim**, so a backslash is a backslash and must not be
55
+ * doubled — doubling turned a directory named `a\b` into a path that does not
56
+ * exist, and the unit failed with `status=200/CHDIR`. `%` still expands as a
57
+ * specifier, and an unknown one (`%i` in a system unit) is fatal, so it is
58
+ * escaped. The remaining hazard is a *trailing* backslash, which continues the
59
+ * directive onto the next line and swallows it; a trailing space absorbs that
60
+ * without changing the path.
61
+ *
62
+ * A double quote is refused rather than quoted: systemd does not unquote these
63
+ * settings, so a quoted form is simply a path with a quote in it.
47
64
  */
48
65
  export declare function systemdPath(value: string, what?: string): string;
49
66
  /** `Environment=KEY=value`, quoted as one assignment when the value needs it. */
@@ -52,9 +69,37 @@ export declare function xmlEscape(value: string): string;
52
69
  export declare function xmlUnescape(value: string): string;
53
70
  /** A marker inside an XML comment may not contain `--`. */
54
71
  export declare function assertXmlCommentSafe(value: string): string;
72
+ /**
73
+ * Escape one value for the **key-file** layer of a `.desktop` file.
74
+ *
75
+ * This is a separate layer from `Exec=`'s own quoting, and it runs *first*:
76
+ * GLib reads the line with `GKeyFile`, which consumes `\n`, `\t`, `\r`, `\s`
77
+ * and `\\` before anything else sees the value. A `\` that is not one of those
78
+ * escapes makes `g_key_file_get_string` fail outright — "Key file contains key
79
+ * … which has a value that cannot be interpreted" — so the whole entry becomes
80
+ * unloadable, and `desktop-file-validate` happily accepts the file.
81
+ *
82
+ * That is why every backslash is doubled here: after the key-file layer the
83
+ * value is byte-identical to what the next layer was handed. Only `\\` may
84
+ * appear in the file — a bare `\` is always invalid.
85
+ */
86
+ export declare function desktopValueEscape(value: string): string;
87
+ /**
88
+ * Quote one `Exec=` word for the desktop-entry parser.
89
+ *
90
+ * Two layers, in order: `desktopValueEscape` for the key file, then the shell
91
+ * quoting below for `g_shell_parse_argv`, which is what actually splits the
92
+ * value into words and unquotes each one.
93
+ */
55
94
  export declare function desktopWord(value: string): string;
56
95
  export declare function desktopExec(program: string, args: string[]): string;
57
- /** A `Key=value` line in a `.desktop` file; the marker is written verbatim. */
96
+ /**
97
+ * A `Key=value` line in a `.desktop` file.
98
+ *
99
+ * The value is key-file escaped, because a `.desktop` line has no shell to
100
+ * quote for: `Path=`/`Name=`/`Comment=` are read as plain strings, and a
101
+ * backslash in any of them is a key-file escape rather than data.
102
+ */
58
103
  export declare function desktopValue(key: string, value: string): string;
59
104
  /** Quote one argv word the way `CreateProcess`/`cmd` parse a command line. */
60
105
  export declare function windowsArg(value: string): string;
@@ -39,6 +39,19 @@ export declare class PanelClient {
39
39
  * `workspace`. One mapping, so a caller never has to know both spellings.
40
40
  */
41
41
  private view;
42
+ /**
43
+ * A `POST`/`PATCH` answer.
44
+ *
45
+ * The real panel answers the stored entry *flat* here — no `config` wrapper, no
46
+ * `workspaceId`, no live status — while `GET` answers a view. Both are accepted:
47
+ * a body that already carries a `config` object is a view, and anything else is
48
+ * the entry itself. Reading a flat entry as a view is what made `created.config`
49
+ * `undefined`, so the shape is decided here rather than assumed.
50
+ *
51
+ * A flat entry carries no live status, so it is reported as `unknown`: the panel
52
+ * has not said. Callers that need one re-read the list.
53
+ */
54
+ private written;
42
55
  private ws;
43
56
  private request;
44
57
  listServers(workspace?: string): Promise<ServerEntryView[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-home-hosted",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "DeepSeek Harness (dsh) plugin: prompt your home servers into existence through home-hosted — Gitea, Jellyfin, anything — and manage the panel, the entries and boot autostart from dsh.",
5
5
  "type": "module",
6
6
  "license": "MIT",