codehost 0.19.0 → 0.20.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [0.20.0](https://github.com/snomiao/codehost/compare/v0.19.0...v0.20.0) (2026-06-11)
2
+
3
+
4
+ ### Features
5
+
6
+ * **web:** edit a host's .codehost config from the site — advertised as a ⚙ workspace entry ([7c97b87](https://github.com/snomiao/codehost/commit/7c97b870715d6879cee39dab286cc7b8d45f08a6))
7
+
1
8
  # [0.19.0](https://github.com/snomiao/codehost/compare/v0.18.2...v0.19.0) (2026-06-11)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codehost",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,6 +1,6 @@
1
- import { mkdirSync } from "node:fs";
1
+ import { existsSync, mkdirSync } from "node:fs";
2
2
  import { homedir, hostname } from "node:os";
3
- import { resolve } from "node:path";
3
+ import { join, resolve } from "node:path";
4
4
  import type { CommandModule } from "yargs";
5
5
  import type { PeerMeta } from "../../shared/signaling";
6
6
  import { DEFAULT_LAYOUT, GITHUB_HOST, toPosixPath } from "../../shared/repo";
@@ -150,6 +150,12 @@ export const serveCommand: CommandModule<{}, ServeArgs> = {
150
150
  // Layout-enumerated checkouts plus directories other `codehost dev` runs
151
151
  // registered with this host daemon (git-identified best-effort).
152
152
  const workspaces = enumerateWorkspaces(dir, layout);
153
+ // The config dir itself is editable from the site (rendered as ⚙, opens
154
+ // in the editor) — advertised so its /host/<host>/<path> link resolves.
155
+ const configDir = join(dir, ".codehost");
156
+ if (existsSync(configDir)) {
157
+ workspaces.push({ path: toPosixPath(configDir), config: true });
158
+ }
153
159
  for (const w of readRegisteredWorkspaces()) {
154
160
  const path = toPosixPath(w.path);
155
161
  if (workspaces.some((x) => x.path === path)) continue;
@@ -30,6 +30,10 @@ export interface WorkspaceInfo {
30
30
  repo?: string;
31
31
  /** Branch from the layout path, e.g. "main". */
32
32
  branch?: string;
33
+ /** This entry is the daemon's `.codehost/` config dir (setup.sh etc.), not a
34
+ * repo checkout — clients render it as a settings affordance, openable in
35
+ * the editor like any workspace. */
36
+ config?: boolean;
33
37
  }
34
38
 
35
39
  /** Metadata a `codehost serve`/`dev` daemon advertises about itself. */
@@ -1025,11 +1025,13 @@ export function Discovery() {
1025
1025
  key={w.path}
1026
1026
  style={styles.wsLink}
1027
1027
  onClick={() => openWorkspace(s, w)}
1028
- title={w.path}
1028
+ title={w.config ? `edit this host's provisioning config\n${w.path}` : w.path}
1029
1029
  >
1030
- {w.repo
1031
- ? `${w.repo.split("/").slice(1).join("/")}${w.branch ? ` @${w.branch}` : ""}`
1032
- : w.path}
1030
+ {w.config
1031
+ ? ".codehost (setup.sh, config.yaml)"
1032
+ : w.repo
1033
+ ? `${w.repo.split("/").slice(1).join("/")}${w.branch ? ` @${w.branch}` : ""}`
1034
+ : w.path}
1033
1035
  </button>
1034
1036
  ))}
1035
1037
  </div>