neuvikon 0.2.1 → 0.2.3

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/README.md CHANGED
@@ -38,7 +38,7 @@ as being worked on, by whom, with which tool.
38
38
  | `neuvikon start --ticket EWWQ-1` | Begin tracking. `--tool claude-code\|codex\|cursor\|other` |
39
39
  | `neuvikon stop` | Stop tracking |
40
40
  | `neuvikon status` | Login, project setup, current ticket |
41
- | `neuvikon logout` | Forget the stored token |
41
+ | `neuvikon logout` | Revoke this machine's token and forget it |
42
42
 
43
43
  `start` also accepts the ticket on stdin, and pulls the reference out of it:
44
44
 
package/dist/index.mjs CHANGED
@@ -149,7 +149,7 @@ function isInstalled(root) {
149
149
  * installed copy of this CLI hardcodes whatever ships here, and a dev
150
150
  * deployment can be reset out from under them.
151
151
  */
152
- const DEFAULT_SITE_URL = process.env.NEUVIKON_URL ?? "https://flexible-bird-801.eu-west-1.convex.site";
152
+ const DEFAULT_SITE_URL = process.env.NEUVIKON_URL ?? "https://flexible-bird-801.eu-west-1.convex.sites";
153
153
  const CONFIG_DIR = join(homedir(), ".neuvikon");
154
154
  const CONFIG_PATH = join(CONFIG_DIR, "config.json");
155
155
  /**
@@ -366,15 +366,6 @@ async function login(flags) {
366
366
  }
367
367
  }
368
368
  //#endregion
369
- //#region src/commands/logout.ts
370
- function logout() {
371
- if (clearCredentials()) {
372
- success("Logged out.");
373
- return;
374
- }
375
- info("You were not logged in.");
376
- }
377
- //#endregion
378
369
  //#region src/session.ts
379
370
  /**
380
371
  * Scoped to the working directory rather than the machine: two checkouts driven
@@ -409,6 +400,42 @@ function clearSession() {
409
400
  } catch {}
410
401
  }
411
402
  //#endregion
403
+ //#region src/commands/logout.ts
404
+ /**
405
+ * Deleting the local file is not enough: the token stays valid until the server
406
+ * is told otherwise, so a copy of it lifted from a backup or a shared machine
407
+ * would still be able to report. Revoking is the part that actually ends the
408
+ * session; forgetting it locally is bookkeeping.
409
+ */
410
+ async function logout() {
411
+ const credentials = readCredentials();
412
+ if (!credentials) {
413
+ info("You were not logged in.");
414
+ return;
415
+ }
416
+ const session = readSession();
417
+ if (session) {
418
+ await post(credentials.url, "/api/agent/events", {
419
+ token: credentials.token,
420
+ event: "stop",
421
+ sessionKey: session.sessionKey
422
+ }).catch(() => void 0);
423
+ clearSession();
424
+ }
425
+ let revoked = false;
426
+ try {
427
+ revoked = (await post(credentials.url, "/api/cli/auth/revoke", { token: credentials.token })).revoked;
428
+ } catch {}
429
+ if (process.env.NEUVIKON_TOKEN) warn("NEUVIKON_TOKEN is set in your environment — unset it to finish logging out.");
430
+ clearCredentials();
431
+ if (revoked) {
432
+ success("Logged out. That token has been revoked.");
433
+ return;
434
+ }
435
+ success("Logged out on this machine.");
436
+ info(dim(" Could not reach Neuvikon to revoke the token — revoke it in settings if it leaked."));
437
+ }
438
+ //#endregion
412
439
  //#region src/ticket.ts
413
440
  /**
414
441
  * Ticket refs look like `AWKN-14`. This pattern is deliberately looser than the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neuvikon",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Tell Neuvikon which ticket your coding agent is working on.",
5
5
  "keywords": [
6
6
  "neuvikon",