@devframes/plugin-code-server 0.9.10 → 0.9.12

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/dist/node/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createCodeServerDevframe } from "../node-C_wU5QYh.mjs";
1
+ import { t as createCodeServerDevframe } from "../node-vxRsKluL.mjs";
2
2
  import { createCac } from "devframe/adapters/cac";
3
3
  //#region src/node/cli.ts
4
4
  /**
@@ -1,3 +1,3 @@
1
- import { t as createCodeServerDevframe } from "../node-C_wU5QYh.mjs";
1
+ import { t as createCodeServerDevframe } from "../node-vxRsKluL.mjs";
2
2
  import { DEFAULT_CODE_SERVER_PORT, DEFAULT_PORT, PLUGIN_ID, STATE_KEY, getCookieSessionName } from "./constants.mjs";
3
3
  export { DEFAULT_CODE_SERVER_PORT, DEFAULT_PORT, PLUGIN_ID, STATE_KEY, createCodeServerDevframe, createCodeServerDevframe as default, getCookieSessionName };
@@ -60,6 +60,13 @@ declare class CodeServerSupervisor {
60
60
  detect(): Promise<CodeServerDetection>;
61
61
  /** Current status (+ connect info when running) for the launcher UI. */
62
62
  status(): CodeServerStatusResult;
63
+ /**
64
+ * The server info projected to clients and shared state, tagged with the
65
+ * live hub terminal session id when one exists so the launcher can offer a
66
+ * "view in terminal" jump. Standalone runtimes hold no session and leave it
67
+ * undefined.
68
+ */
69
+ private serverInfo;
63
70
  /**
64
71
  * Launch the editor (if not already up) and resolve once it is reachable.
65
72
  * Idempotent while starting/running; returns the live status instead of
@@ -70,7 +77,11 @@ declare class CodeServerSupervisor {
70
77
  start(req?: CodeServerStartRequest): Promise<CodeServerStartResult>;
71
78
  /** Adopt an already-running local server on the target port, if one answers. */
72
79
  private tryAdopt;
73
- /** Resolve the port to launch on: 0 for tunnels/dynamic, a forced port, or a free one. */
80
+ /**
81
+ * Resolve the port to launch on: 0 for tunnels/dynamic launches, otherwise a
82
+ * free port starting from the forced port (if any) or the default -
83
+ * verified free before it's ever handed to the editor binary's `--port`.
84
+ */
74
85
  private resolveInitialPort;
75
86
  /** The child's environment: inherited env, caller overrides, then profile shaping. */
76
87
  private buildLaunchEnv;
@@ -321,11 +321,23 @@ var CodeServerSupervisor = class {
321
321
  status() {
322
322
  return {
323
323
  detection: { ...this.detection },
324
- server: { ...this.server },
324
+ server: this.serverInfo(),
325
325
  connect: this.connectInfo()
326
326
  };
327
327
  }
328
328
  /**
329
+ * The server info projected to clients and shared state, tagged with the
330
+ * live hub terminal session id when one exists so the launcher can offer a
331
+ * "view in terminal" jump. Standalone runtimes hold no session and leave it
332
+ * undefined.
333
+ */
334
+ serverInfo() {
335
+ return this.session ? {
336
+ ...this.server,
337
+ terminalSessionId: this.sessionId
338
+ } : { ...this.server };
339
+ }
340
+ /**
329
341
  * Launch the editor (if not already up) and resolve once it is reachable.
330
342
  * Idempotent while starting/running; returns the live status instead of
331
343
  * spawning a second process. In tunnel mode it resolves as soon as either
@@ -401,14 +413,16 @@ var CodeServerSupervisor = class {
401
413
  this.publish();
402
414
  return this.status();
403
415
  }
404
- /** Resolve the port to launch on: 0 for tunnels/dynamic, a forced port, or a free one. */
416
+ /**
417
+ * Resolve the port to launch on: 0 for tunnels/dynamic launches, otherwise a
418
+ * free port starting from the forced port (if any) or the default -
419
+ * verified free before it's ever handed to the editor binary's `--port`.
420
+ */
405
421
  async resolveInitialPort(isLocal) {
406
- if (!isLocal) return 0;
407
- if (this.forcedPort !== void 0 && this.forcedPort !== 0) return this.forcedPort;
408
- if (this.forcedPort === 0) return 0;
422
+ if (!isLocal || this.forcedPort === 0) return 0;
409
423
  return getPort({
410
424
  host: "127.0.0.1",
411
- port: DEFAULT_CODE_SERVER_PORT
425
+ port: this.forcedPort ?? 8080
412
426
  });
413
427
  }
414
428
  /** The child's environment: inherited env, caller overrides, then profile shaping. */
@@ -731,7 +745,7 @@ var CodeServerSupervisor = class {
731
745
  publish() {
732
746
  this.state?.mutate((draft) => {
733
747
  draft.detection = { ...this.detection };
734
- draft.server = { ...this.server };
748
+ draft.server = this.serverInfo();
735
749
  });
736
750
  }
737
751
  /**
@@ -67,6 +67,14 @@ interface CodeServerServerInfo {
67
67
  error?: string;
68
68
  /** Device-login prompt while a tunnel is authenticating. */
69
69
  login?: CodeServerLogin;
70
+ /**
71
+ * Id of the hub terminal session mirroring this process, present only when
72
+ * the editor was launched through the hub's terminals subsystem
73
+ * (`ctx.terminals`). The launcher uses it to jump the user to that session
74
+ * in the terminals dock via `hub:docks:activate`; standalone runtimes have
75
+ * no hub session and leave it undefined.
76
+ */
77
+ terminalSessionId?: string;
70
78
  }
71
79
  /**
72
80
  * The full shared-state payload broadcast to subscribed clients. Deliberately
@@ -1,4 +1,4 @@
1
- import { t as createCodeServerDevframe } from "../node-C_wU5QYh.mjs";
1
+ import { t as createCodeServerDevframe } from "../node-vxRsKluL.mjs";
2
2
  import { devframeViteBridge, devframeVitePlugin } from "@devframes/vite/single";
3
3
  //#region src/node/vite.ts
4
4
  /**
@@ -2,7 +2,7 @@ import { PLUGIN_ID } from "./node/constants.mjs";
2
2
  import { defineDevframe } from "devframe";
3
3
  //#region package.json
4
4
  var name = "@devframes/plugin-code-server";
5
- var version = "0.9.10";
5
+ var version = "0.9.12";
6
6
  var description = "Devframe plugin that runs VS Code in the browser as an embedded editor panel.";
7
7
  var homepage = "https://github.com/devframes/devframe#readme";
8
8
  //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devframes/plugin-code-server",
3
3
  "type": "module",
4
- "version": "0.9.10",
4
+ "version": "0.9.12",
5
5
  "description": "Devframe plugin that runs VS Code in the browser as an embedded editor panel.",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -39,8 +39,8 @@
39
39
  "dist"
40
40
  ],
41
41
  "peerDependencies": {
42
- "@devframes/plugin-code-server--assets": "0.9.10",
43
- "devframe": "0.9.10",
42
+ "@devframes/plugin-code-server--assets": "0.9.12",
43
+ "devframe": "0.9.12",
44
44
  "vite": "^8.0.0"
45
45
  },
46
46
  "peerDependenciesMeta": {
@@ -52,19 +52,19 @@
52
52
  }
53
53
  },
54
54
  "dependencies": {
55
- "@devframes/vite": "0.9.10",
55
+ "@devframes/vite": "0.9.12",
56
56
  "cac": "^7.0.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@antfu/design": "^0.4.0",
60
- "@devframes/plugin-code-server--assets": "0.9.10",
60
+ "@devframes/plugin-code-server--assets": "0.9.12",
61
61
  "@iconify-json/ph": "^1.2.2",
62
62
  "@storybook/addon-docs": "^10.5.10",
63
63
  "@storybook/vue3-vite": "^10.5.10",
64
64
  "@types/node": "^26.4.0",
65
65
  "@vitejs/plugin-vue": "^6.0.8",
66
66
  "colorjs.io": "^0.7.1",
67
- "devframe": "0.9.10",
67
+ "devframe": "0.9.12",
68
68
  "h3": "^2.0.1-rc.29",
69
69
  "pathe": "^2.0.3",
70
70
  "storybook": "^10.5.10",