synsci 1.1.114 → 1.1.121
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/bin/synsci.mjs +12 -12
- package/package.json +8 -5
package/bin/synsci.mjs
CHANGED
|
@@ -49,7 +49,7 @@ function runQuiet(cmd) {
|
|
|
49
49
|
catch { return null }
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
function isInstalled() { return runQuiet("which
|
|
52
|
+
function isInstalled() { return runQuiet("which synsci") !== null }
|
|
53
53
|
|
|
54
54
|
function isConnected() {
|
|
55
55
|
const xdgData = process.env.XDG_DATA_HOME || join(homedir(), ".local", "share")
|
|
@@ -82,20 +82,20 @@ async function main() {
|
|
|
82
82
|
|
|
83
83
|
// --- Step 1: Install or upgrade ---
|
|
84
84
|
if (isInstalled()) {
|
|
85
|
-
const raw = runQuiet("
|
|
85
|
+
const raw = runQuiet("synsci --version") || "unknown"
|
|
86
86
|
const isDev = raw === "local" || raw.includes("-")
|
|
87
87
|
if (isDev) {
|
|
88
|
-
ok(`
|
|
88
|
+
ok(`synsci ${DIM}(dev build)${RESET}`)
|
|
89
89
|
} else {
|
|
90
90
|
const s = spinner("Checking for updates...")
|
|
91
91
|
const current = raw.replace(/[^0-9.]/g, "")
|
|
92
92
|
const latest = runQuiet("npm view @synsci/cli version")
|
|
93
93
|
if (!latest || current === latest) {
|
|
94
|
-
s.ok(`
|
|
94
|
+
s.ok(`synsci ${current} ${DIM}(up to date)${RESET}`)
|
|
95
95
|
} else {
|
|
96
96
|
s.update(`Upgrading ${current} \u2192 ${latest}...`)
|
|
97
97
|
try {
|
|
98
|
-
execSync("
|
|
98
|
+
execSync("synsci upgrade", { stdio: "pipe" })
|
|
99
99
|
s.ok(`Upgraded to ${latest}`)
|
|
100
100
|
} catch {
|
|
101
101
|
s.warn(`Upgrade failed, continuing with ${current}`)
|
|
@@ -103,10 +103,10 @@ async function main() {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
} else {
|
|
106
|
-
const s = spinner("Installing
|
|
106
|
+
const s = spinner("Installing synsci...")
|
|
107
107
|
try {
|
|
108
108
|
execSync("npm i -g @synsci/cli@latest", { stdio: "pipe" })
|
|
109
|
-
s.ok("Installed
|
|
109
|
+
s.ok("Installed synsci")
|
|
110
110
|
} catch {
|
|
111
111
|
s.fail("Install failed")
|
|
112
112
|
console.log(`\n Try manually: ${CYAN}npm i -g @synsci/cli${RESET}\n`)
|
|
@@ -120,24 +120,24 @@ async function main() {
|
|
|
120
120
|
} else {
|
|
121
121
|
console.log()
|
|
122
122
|
try {
|
|
123
|
-
execSync("
|
|
123
|
+
execSync("synsci connect login", { stdio: "inherit" })
|
|
124
124
|
} catch {}
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
console.log()
|
|
128
128
|
|
|
129
129
|
// --- Step 3: Launch mode ---
|
|
130
|
-
console.log(` ${BOLD}How would you like to use
|
|
130
|
+
console.log(` ${BOLD}How would you like to use synsci?${RESET}`)
|
|
131
131
|
console.log()
|
|
132
|
-
console.log(` ${BOLD}1${RESET} ${CYAN}
|
|
133
|
-
console.log(` ${BOLD}2${RESET} ${CYAN}
|
|
132
|
+
console.log(` ${BOLD}1${RESET} ${CYAN}synsci${RESET} ${DIM}terminal TUI${RESET}`)
|
|
133
|
+
console.log(` ${BOLD}2${RESET} ${CYAN}synsci web${RESET} ${DIM}browser UI at localhost${RESET}`)
|
|
134
134
|
console.log()
|
|
135
135
|
|
|
136
136
|
const choice = await ask(` ${DIM}\u276F${RESET} Choose [1/2]: `)
|
|
137
137
|
console.log()
|
|
138
138
|
|
|
139
139
|
const cmd = choice === "2" ? ["web"] : []
|
|
140
|
-
const child = spawn("
|
|
140
|
+
const child = spawn("synsci", cmd, { stdio: "inherit" })
|
|
141
141
|
child.on("close", (code) => process.exit(code ?? 0))
|
|
142
142
|
}
|
|
143
143
|
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "synsci",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.121",
|
|
4
4
|
"description": "One command to install, connect, and launch Synthetic Sciences CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
|
-
"synsci": "
|
|
8
|
+
"synsci": "bin/synsci.mjs"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"bin"
|
|
12
12
|
],
|
|
13
13
|
"keywords": [
|
|
14
|
-
"
|
|
14
|
+
"synsci",
|
|
15
15
|
"synthetic-sciences",
|
|
16
16
|
"ai",
|
|
17
17
|
"ml",
|
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
],
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
23
|
-
"url": "https://github.com/ishaan1124/synthetisciences-cli"
|
|
23
|
+
"url": "git+https://github.com/ishaan1124/synthetisciences-cli.git"
|
|
24
24
|
},
|
|
25
|
-
"homepage": "https://syntheticsciences.ai"
|
|
25
|
+
"homepage": "https://syntheticsciences.ai",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@synsci/cli": "1.1.121"
|
|
28
|
+
}
|
|
26
29
|
}
|