@hienlh/ppm 0.7.34 → 0.7.35

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,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.35] - 2026-03-23
4
+
5
+ ### Improved
6
+ - **Cloud link auto-sync**: `ppm cloud link` detects active tunnel and sends heartbeat immediately — device shows online on cloud dashboard without restart
7
+
3
8
  ## [0.7.34] - 2026-03-23
4
9
 
5
10
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hienlh/ppm",
3
- "version": "0.7.34",
3
+ "version": "0.7.35",
4
4
  "description": "Personal Project Manager — mobile-first web IDE with AI assistance",
5
5
  "author": "hienlh",
6
6
  "license": "MIT",
@@ -89,7 +89,26 @@ export function registerCloudCommands(program: Command): void {
89
89
  console.log(` ✓ Machine linked`);
90
90
  console.log(` Name: ${device.name}`);
91
91
  console.log(` ID: ${device.device_id}`);
92
- console.log(`\n Run 'ppm start --share' to sync tunnel URL to cloud.\n`);
92
+
93
+ // Auto-detect running tunnel and start heartbeat immediately
94
+ try {
95
+ const { resolve } = await import("node:path");
96
+ const { homedir } = await import("node:os");
97
+ const { existsSync, readFileSync } = await import("node:fs");
98
+ const statusFile = resolve(homedir(), ".ppm", "status.json");
99
+ if (existsSync(statusFile)) {
100
+ const status = JSON.parse(readFileSync(statusFile, "utf-8"));
101
+ if (status.shareUrl) {
102
+ const { sendHeartbeat } = await import("../../services/cloud.service.ts");
103
+ const ok = await sendHeartbeat(status.shareUrl);
104
+ if (ok) {
105
+ console.log(`\n ➜ Cloud: synced tunnel URL (${status.shareUrl})`);
106
+ }
107
+ }
108
+ }
109
+ } catch { /* non-blocking */ }
110
+
111
+ console.log();
93
112
  } catch (err: unknown) {
94
113
  const msg = err instanceof Error ? err.message : String(err);
95
114
  console.error(` ✗ Link failed: ${msg}\n`);