@dmsdc-ai/aterm 0.1.76 → 0.1.78

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/bin/aterm.js +15 -1
  2. package/package.json +4 -4
package/bin/aterm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import fs from 'node:fs';
3
3
  import path from 'node:path';
4
- import { spawn } from 'node:child_process';
4
+ import { spawn, execFileSync } from 'node:child_process';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import {
7
7
  ensureUserLayout,
@@ -50,6 +50,20 @@ env.AIGENTRY_USER_ROOT = resolvedConfig.userRoot;
50
50
  env.AIGENTRY_PROJECT_ROOT = resolvedConfig.projectRoot;
51
51
  env.AIGENTRY_PROJECT_AIGENTRY_ROOT = resolvedConfig.projectAigentryRoot;
52
52
 
53
+ // Single instance: if aterm is already running, activate and exit
54
+ try {
55
+ execFileSync('pgrep', ['-f', 'aterm.app/Contents/MacOS/aterm'], {
56
+ encoding: 'utf8',
57
+ stdio: ['pipe', 'pipe', 'pipe'],
58
+ });
59
+ // pgrep succeeded → aterm is running
60
+ console.log('[aterm] already running, activating existing instance');
61
+ try { execFileSync('open', [appRoot]); } catch {}
62
+ process.exit(0);
63
+ } catch {
64
+ // pgrep exit 1 = not running, proceed to launch
65
+ }
66
+
53
67
  const child = spawn(executable, process.argv.slice(2), {
54
68
  stdio: 'inherit',
55
69
  env,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmsdc-ai/aterm",
3
- "version": "0.1.76",
3
+ "version": "0.1.78",
4
4
  "description": "Native aterm launcher package",
5
5
  "type": "module",
6
6
  "main": "./bin/aterm.js",
@@ -17,11 +17,11 @@
17
17
  "package.json"
18
18
  ],
19
19
  "optionalDependencies": {
20
- "@dmsdc-ai/aterm-darwin-arm64": "0.1.76"
20
+ "@dmsdc-ai/aterm-darwin-arm64": "0.1.78"
21
21
  },
22
22
  "dependencies": {
23
- "@dmsdc-ai/aigentry-devkit": "^0.0.7",
24
- "@dmsdc-ai/aigentry-telepty": "latest"
23
+ "@dmsdc-ai/aigentry-devkit": ">=0.0.19",
24
+ "@dmsdc-ai/aigentry-telepty": ">=0.1.87"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@dmsdc-ai/aigentry": ">=0.1.0"