@nissyai/desktop 0.1.0 → 0.1.2

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/LICENSE ADDED
@@ -0,0 +1,34 @@
1
+ Copyright (c) Cleverbit. All rights reserved.
2
+
3
+ Nissy and all accompanying files, code, and assets (the "Software") are the
4
+ proprietary and confidential property of Cleverbit. The Software is licensed,
5
+ not sold.
6
+
7
+ Subject to your continued compliance with these terms, Cleverbit grants you a
8
+ limited, personal, non-exclusive, non-transferable, non-sublicensable, and
9
+ revocable licence to install and run the unmodified Software solely for its
10
+ intended purpose. No other rights are granted.
11
+
12
+ Except as expressly permitted above, you may not, in whole or in part: copy,
13
+ reproduce, modify, adapt, translate, or create derivative works of the
14
+ Software; distribute, publish, sublicense, sell, rent, lease, lend, or
15
+ otherwise make the Software available to any third party; or reverse engineer,
16
+ decompile, disassemble, or otherwise attempt to derive the source code of the
17
+ Software, except to the extent this restriction is prohibited by applicable
18
+ law.
19
+
20
+ All right, title, and interest in and to the Software, including all
21
+ intellectual property rights, remain with Cleverbit. This licence grants no
22
+ rights to Cleverbit's trademarks, logos, or brand.
23
+
24
+ Cleverbit may suspend or terminate this licence at any time. On termination you
25
+ must cease all use of the Software and destroy all copies in your possession.
26
+
27
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. IN NO EVENT SHALL
30
+ CLEVERBIT BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN
31
+ ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
32
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33
+
34
+ Contact: hello@cleverbit.software
package/bin/nissy.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  //
3
- // `nissy` launcher entry point (internal npx dev channel).
3
+ // `nissy` launcher entry point for `npx @nissyai/desktop`.
4
4
  //
5
5
  // Picks the payload package for the host platform/arch, finds where npm
6
6
  // installed it, and spawns the self-contained app executable inside it,
@@ -23,6 +23,7 @@ import { fileURLToPath } from "node:url";
23
23
 
24
24
  import {
25
25
  cacheRootSegments,
26
+ LAUNCHER_TOOLCHAIN_FILE,
26
27
  needsMacReinstall,
27
28
  npxChannelEnv,
28
29
  resolveLaunchCommand,
@@ -182,6 +183,24 @@ const childEnv = {
182
183
  ...npxChannelEnv(process.execPath, fileURLToPath(import.meta.url)),
183
184
  };
184
185
 
186
+ // Record the toolchain to a FILE as well as the env, because macOS `open`
187
+ // (LaunchServices) does not pass our env to the app, and a Dock launch never
188
+ // runs this launcher at all. The app's npx self-update reads this to run `npm`
189
+ // and to relaunch via the stable launcher command. Best-effort: never block a
190
+ // launch on it.
191
+ try {
192
+ const toolchainRoot = join(
193
+ ...cacheRootSegments({ platform: process.platform, home: homedir(), env: process.env }),
194
+ );
195
+ mkdirSync(toolchainRoot, { recursive: true });
196
+ writeFileSync(
197
+ join(toolchainRoot, LAUNCHER_TOOLCHAIN_FILE),
198
+ JSON.stringify({ node: process.execPath, script: fileURLToPath(import.meta.url) }),
199
+ );
200
+ } catch {
201
+ // Ignore: self-update falls back to the env/persisted value or the manual command.
202
+ }
203
+
185
204
  if (foreground) {
186
205
  const child = spawn(command, args, { stdio: "inherit", env: childEnv });
187
206
  child.on("error", (err) => {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@nissyai/desktop",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
- "description": "Launcher for the Nissy desktop app (internal npx dev channel). Resolves the host's app payload and spawns it. Run via `npx @nissyai/desktop`; a global install (`npm i -g @nissyai/desktop`) exposes the `nissy` command.",
5
+ "description": "Launcher for the Nissy desktop app. Resolves the host's app payload and spawns it. Run via `npx @nissyai/desktop`; a global install (`npm i -g @nissyai/desktop`) exposes the `nissy` command.",
6
6
  "license": "SEE LICENSE IN LICENSE",
7
7
  "author": {
8
8
  "name": "Cleverbit",
@@ -20,8 +20,8 @@
20
20
  "src/"
21
21
  ],
22
22
  "optionalDependencies": {
23
- "@nissyai/app-win32-x64": "0.1.0",
24
- "@nissyai/app-darwin-arm64": "0.1.0",
25
- "@nissyai/app-darwin-x64": "0.1.0"
23
+ "@nissyai/app-win32-x64": "0.1.2",
24
+ "@nissyai/app-darwin-arm64": "0.1.2",
25
+ "@nissyai/app-darwin-x64": "0.1.2"
26
26
  }
27
27
  }
package/src/resolve.mjs CHANGED
@@ -72,6 +72,16 @@ export function cacheRootSegments({ platform, home, env }) {
72
72
  return env.XDG_CACHE_HOME ? [env.XDG_CACHE_HOME, "nissy"] : [home, ".cache", "nissy"];
73
73
  }
74
74
 
75
+ /**
76
+ * Filename (under the cache root) where the launcher records the Node toolchain
77
+ * it ran under, so the app's npx self-update can find `npm` and the stable
78
+ * relaunch command WITHOUT relying on inherited env — which macOS `open`
79
+ * (LaunchServices) strips, and which a Dock launch never sets. The app mirrors
80
+ * this path in `apps/desktop/src/main/services/npx-self-update.ts`; keep the
81
+ * two in sync.
82
+ */
83
+ export const LAUNCHER_TOOLCHAIN_FILE = "launcher-toolchain.json";
84
+
75
85
  /**
76
86
  * Filesystem-safe, version-pinned cache key for a payload package, e.g.
77
87
  * ("@nissyai/app-darwin-x64", "1.2.3") → "nissyai-app-darwin-x64@1.2.3". Version