@aiam/ciba 0.8.1 → 0.8.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.
Files changed (2) hide show
  1. package/ciba.mjs +7 -2
  2. package/package.json +1 -1
package/ciba.mjs CHANGED
@@ -752,9 +752,14 @@ const logoutCmd = defineCommand({
752
752
  const stopCmd = defineCommand({
753
753
  meta: { description: 'Stop daemon and clear session' },
754
754
  args: {},
755
- run() {
756
- const cfg = loadConfig();
755
+ async run() {
757
756
  if (cfg.pid) { try { process.kill(parseInt(cfg.pid)); } catch {} }
757
+ // Kill all orphaned ciba daemon processes (previous --persist runs that
758
+ // were never approved or whose parent exited without storing the PID).
759
+ try {
760
+ const { execFileSync } = await import('node:child_process');
761
+ execFileSync('pkill', ['-f', 'ciba login --daemon'], { stdio: 'ignore' });
762
+ } catch { /* pkill not found or no matching processes */ }
758
763
  if (existsSync(SOCKET_PATH)) unlinkSync(SOCKET_PATH);
759
764
  const sessionFile = join(CONFIG_DIR, 'session');
760
765
  if (existsSync(sessionFile)) unlinkSync(sessionFile);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiam/ciba",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "OAuth 2.0 Device Authorization Grant CLI with cross-device push approval (Yjs sync, ECDH-encrypted token delivery, persistent device id)",
5
5
  "type": "module",
6
6
  "bin": {