@dmsdc-ai/aterm 0.1.0 → 0.1.1

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/install.js +32 -0
  2. package/package.json +3 -3
package/install.js CHANGED
@@ -8,6 +8,9 @@ import { createRequire } from 'node:module';
8
8
  const __filename = fileURLToPath(import.meta.url);
9
9
  const __dirname = path.dirname(__filename);
10
10
  const require = createRequire(import.meta.url);
11
+ const packageJson = JSON.parse(
12
+ fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8'),
13
+ );
11
14
 
12
15
  const PLATFORM_PACKAGES = {
13
16
  darwin: {
@@ -19,6 +22,35 @@ function resolvePlatformPackage() {
19
22
  return PLATFORM_PACKAGES[os.platform()]?.[os.arch()] ?? null;
20
23
  }
21
24
 
25
+ function bootstrapEcosystem() {
26
+ const homeDir = os.homedir();
27
+ const directories = [
28
+ path.join(homeDir, '.aigentry', 'inbox'),
29
+ path.join(homeDir, '.aigentry', 'config'),
30
+ path.join(homeDir, '.aigentry', 'brain', 'local'),
31
+ path.join(homeDir, '.aigentry', 'brain', 'profiles'),
32
+ path.join(homeDir, '.aigentry', 'brain', 'search'),
33
+ path.join(homeDir, '.telepty', 'shared'),
34
+ path.join(homeDir, 'Library', 'Application Support', 'aterm'),
35
+ ];
36
+
37
+ for (const directory of directories) {
38
+ fs.mkdirSync(directory, { recursive: true });
39
+ }
40
+
41
+ const configPath = path.join(homeDir, '.aigentry', 'config', 'aterm.json');
42
+ if (!fs.existsSync(configPath)) {
43
+ const defaultConfig = {
44
+ version: packageJson.version,
45
+ installed_at: new Date().toISOString(),
46
+ platform: `${os.platform()}-${os.arch()}`,
47
+ };
48
+ fs.writeFileSync(`${configPath}`, `${JSON.stringify(defaultConfig, null, 2)}\n`);
49
+ }
50
+ }
51
+
52
+ bootstrapEcosystem();
53
+
22
54
  const platformPackage = resolvePlatformPackage();
23
55
  if (!platformPackage) {
24
56
  console.warn(`[aterm] no native package for ${os.platform()} ${os.arch()}; install skipped`);
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dmsdc-ai/aterm",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Native aterm launcher package",
5
5
  "type": "module",
6
6
  "main": "./bin/aterm.js",
7
7
  "bin": {
8
- "aterm": "./bin/aterm.js"
8
+ "aterm": "bin/aterm.js"
9
9
  },
10
10
  "scripts": {
11
11
  "postinstall": "node install.js"
@@ -16,7 +16,7 @@
16
16
  "package.json"
17
17
  ],
18
18
  "optionalDependencies": {
19
- "@dmsdc-ai/aterm-darwin-arm64": "0.1.0"
19
+ "@dmsdc-ai/aterm-darwin-arm64": "0.1.1"
20
20
  },
21
21
  "license": "UNLICENSED",
22
22
  "publishConfig": {