inplan 0.1.12 → 0.1.13

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/app/main/index.js CHANGED
@@ -326,7 +326,7 @@ function writeStatus(statusPath, status) {
326
326
  writeFileSync(statusPath, `${JSON.stringify(status, null, 2)}
327
327
  `);
328
328
  }
329
- var PLUGIN_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAVP11te5E7xzNJ4reKg0+mAnrr91gcyD1bMr43Homq98=\n-----END PUBLIC KEY-----\n";
329
+ var PLUGIN_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAVP11te5E7xzNJ4reKg0+mAnrr91gcyD1bMr43Homq98=\n-----END PUBLIC KEY-----";
330
330
  function verifyLease(token, publicKeyPem = PLUGIN_PUBLIC_KEY, now = Date.now()) {
331
331
  try {
332
332
  if (!publicKeyPem || typeof token !== "string") return null;
@@ -718,7 +718,7 @@ function track(event, enabled, props) {
718
718
  });
719
719
  }
720
720
  const PLUGIN_HTTP = (process.env.INPLAN_PLUGIN_URL || "wss://inplan-collab.fly.dev").replace(/^ws/, "http");
721
- const PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAVP11te5E7xzNJ4reKg0+mAnrr91gcyD1bMr43Homq98=\n-----END PUBLIC KEY-----\n";
721
+ const PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAVP11te5E7xzNJ4reKg0+mAnrr91gcyD1bMr43Homq98=\n-----END PUBLIC KEY-----";
722
722
  const SCHEME = "inplan-plugin";
723
723
  const cacheDir = () => join$1(process.env.INPLAN_HOME || join$1(homedir$1(), ".inplan"), "plugin-cache");
724
724
  let state = null;
package/bin/cli.js CHANGED
@@ -1213,17 +1213,39 @@ function hasFlag(args, name) {
1213
1213
  }
1214
1214
  var debounceMs = Number(process.env.INPLAN_DEBOUNCE_MS ?? 3e3);
1215
1215
  var pollMs = Number(process.env.INPLAN_POLL_MS ?? 200);
1216
+ function electronDistRel(platform) {
1217
+ if (platform === "win32") return "electron.exe";
1218
+ if (platform === "darwin") return join9("Electron.app", "Contents", "MacOS", "Electron");
1219
+ return "electron";
1220
+ }
1221
+ function electronBinaryFromDisk(reqUrl) {
1222
+ try {
1223
+ const pkgDir = dirname9(createRequire(reqUrl).resolve("electron/package.json"));
1224
+ const rel = electronDistRel(process.platform);
1225
+ const bin = join9(pkgDir, "dist", rel);
1226
+ if (!existsSync9(bin)) return null;
1227
+ try {
1228
+ const pathFile = join9(pkgDir, "path.txt");
1229
+ if (!existsSync9(pathFile)) writeFileSync8(pathFile, rel);
1230
+ } catch {
1231
+ }
1232
+ return bin;
1233
+ } catch {
1234
+ return null;
1235
+ }
1236
+ }
1216
1237
  function resolveBundledApp() {
1217
1238
  const here = dirname9(fileURLToPath2(import.meta.url));
1218
1239
  const appMain = join9(here, "..", "app", "main", "index.js");
1219
1240
  if (!existsSync9(appMain)) return { appMain: null };
1220
1241
  try {
1221
1242
  const electron = createRequire(import.meta.url)("electron");
1222
- if (typeof electron === "string" && electron) return { electron, appMain };
1223
- return { appMain, error: "the electron dependency did not resolve to a runtime path" };
1224
- } catch (e) {
1225
- return { appMain, error: e instanceof Error ? e.message : String(e) };
1243
+ if (typeof electron === "string" && electron && existsSync9(electron)) return { electron, appMain };
1244
+ } catch {
1226
1245
  }
1246
+ const onDisk = electronBinaryFromDisk(import.meta.url);
1247
+ if (onDisk) return { electron: onDisk, appMain };
1248
+ return { appMain, error: "Electron's binary isn't installed \u2014 its download was likely blocked (proxy/AV), and path.txt is missing" };
1227
1249
  }
1228
1250
  function spawnApp(file) {
1229
1251
  const env = { ...process.env, INPLAN_CLI: process.argv[1] ?? "" };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inplan",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "inplan — a Markdown editor for human ⇄ coding-agent planning. CLI + desktop editor.",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "repository": {