planexe-cli 0.0.2 → 0.0.4
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/index.js +7 -7
- package/package.json +2 -2
- package/postinstall.js +1 -1
package/index.js
CHANGED
|
@@ -14,7 +14,7 @@ const packageName = 'planexe'
|
|
|
14
14
|
|
|
15
15
|
function createConfig(packageName) {
|
|
16
16
|
const homeDir = os.homedir()
|
|
17
|
-
const configDir = path.join(homeDir, '.config', '
|
|
17
|
+
const configDir = path.join(homeDir, '.config', 'planexe')
|
|
18
18
|
const binaryName =
|
|
19
19
|
process.platform === 'win32' ? `${packageName}.exe` : packageName
|
|
20
20
|
|
|
@@ -23,7 +23,7 @@ function createConfig(packageName) {
|
|
|
23
23
|
configDir,
|
|
24
24
|
binaryName,
|
|
25
25
|
binaryPath: path.join(configDir, binaryName),
|
|
26
|
-
metadataPath: path.join(configDir, '
|
|
26
|
+
metadataPath: path.join(configDir, 'planexe-metadata.json'),
|
|
27
27
|
tempDownloadDir: path.join(configDir, '.download-temp'),
|
|
28
28
|
userAgent: `${packageName}-cli`,
|
|
29
29
|
requestTimeout: 20000,
|
|
@@ -34,10 +34,10 @@ const CONFIG = createConfig(packageName)
|
|
|
34
34
|
|
|
35
35
|
function getPostHogConfig() {
|
|
36
36
|
const apiKey =
|
|
37
|
-
process.env.
|
|
37
|
+
process.env.PLANEXE_POSTHOG_API_KEY ||
|
|
38
38
|
process.env.NEXT_PUBLIC_POSTHOG_API_KEY
|
|
39
39
|
const host =
|
|
40
|
-
process.env.
|
|
40
|
+
process.env.PLANEXE_POSTHOG_HOST ||
|
|
41
41
|
process.env.NEXT_PUBLIC_POSTHOG_HOST_URL
|
|
42
42
|
|
|
43
43
|
if (!apiKey || !host) {
|
|
@@ -60,7 +60,7 @@ function trackUpdateFailed(errorMessage, version, context = {}) {
|
|
|
60
60
|
|
|
61
61
|
const payload = JSON.stringify({
|
|
62
62
|
api_key: posthogConfig.apiKey,
|
|
63
|
-
event: 'cli.
|
|
63
|
+
event: 'cli.update_planexe_failed',
|
|
64
64
|
properties: {
|
|
65
65
|
distinct_id: `anonymous-${CONFIG.homeDir}`,
|
|
66
66
|
error: errorMessage,
|
|
@@ -385,7 +385,7 @@ async function downloadBinary(version) {
|
|
|
385
385
|
}
|
|
386
386
|
|
|
387
387
|
term.clearLine()
|
|
388
|
-
console.log('Download complete! Starting
|
|
388
|
+
console.log('Download complete! Starting PlanExe...')
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
async function ensureBinaryExists() {
|
|
@@ -405,7 +405,7 @@ async function ensureBinaryExists() {
|
|
|
405
405
|
await downloadBinary(version)
|
|
406
406
|
} catch (error) {
|
|
407
407
|
term.clearLine()
|
|
408
|
-
console.error('❌ Failed to download
|
|
408
|
+
console.error('❌ Failed to download planexe:', error.message)
|
|
409
409
|
console.error('Please check your internet connection and try again')
|
|
410
410
|
process.exit(1)
|
|
411
411
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "planexe-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "PlanExe CLI — AI planning and coding agent",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"postinstall": "node postinstall.js",
|
|
12
|
-
"preuninstall": "node -e \"const fs = require('fs'); const path = require('path'); const os = require('os'); const binaryPath = path.join(os.homedir(), '.config', '
|
|
12
|
+
"preuninstall": "node -e \"const fs = require('fs'); const path = require('path'); const os = require('os'); const binaryPath = path.join(os.homedir(), '.config', 'planexe', process.platform === 'win32' ? 'planexe.exe' : 'planexe'); try { fs.unlinkSync(binaryPath) } catch (e) { /* ignore if file doesn't exist */ }\""
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"index.js",
|