synsci 1.2.4 → 1.2.5

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/synsci.mjs +72 -26
  2. package/package.json +1 -1
package/bin/synsci.mjs CHANGED
@@ -40,18 +40,18 @@ const SHOW_CURSOR = "\x1b[?25h"
40
40
  const CLEAR_LINE = "\x1b[2K\r"
41
41
 
42
42
  const LOGO = [
43
- " ██████╗ ██████╗ ███████╗███╗ ██╗",
44
- "██╔═══██╗██╔══██╗██╔════╝████╗ ██║",
45
- "██║ ██║██████╔╝█████╗ ██╔██╗ ██║",
46
- "██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║",
47
- "╚██████╔╝██║ ███████╗██║ ╚████║",
48
- " ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝",
49
- "███████╗ ██████╗██╗███████╗███╗ ██╗ ██████╗███████╗",
50
- "██╔════╝██╔════╝██║██╔════╝████╗ ██║██╔════╝██╔════╝",
51
- "███████╗██║ ██║█████╗ ██╔██╗ ██║██║ █████╗ ",
52
- "╚════██║██║ ██║██╔══╝ ██║╚██╗██║██║ ██╔══╝ ",
53
- "███████║╚██████╗██║███████╗██║ ╚████║╚██████╗███████╗",
54
- "╚══════╝ ╚═════╝╚═╝╚══════╝╚═╝ ╚═══╝ ╚═════╝╚══════╝",
43
+ "███████╗██╗ ██╗███╗ ██╗████████╗██╗ ██╗███████╗████████╗██╗ ██████╗",
44
+ "██╔════╝╚██╗ ██╔╝████╗ ██║╚══██╔══╝██║ ██║██╔════╝╚══██╔══╝██║██╔════╝",
45
+ "███████╗ ╚████╔╝ ██╔██╗ ██║ ██║ ███████║█████╗ ██║ ██║██║ ",
46
+ "╚════██║ ╚██╔╝ ██║╚██╗██║ ██║ ██╔══██║██╔══╝ ██║ ██║██║ ",
47
+ "███████║ ██║ ██║ ╚████║ ██║ ██║ ██║███████╗ ██║ ██║╚██████╗",
48
+ "╚══════╝ ╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═════╝",
49
+ "███████╗ ██████╗██╗███████╗███╗ ██╗ ██████╗███████╗███████╗",
50
+ "██╔════╝██╔════╝██║██╔════╝████╗ ██║██╔════╝██╔════╝██╔════╝",
51
+ "███████╗██║ ██║█████╗ ██╔██╗ ██║██║ █████╗ ███████╗",
52
+ "╚════██║██║ ██║██╔══╝ ██║╚██╗██║██║ ██╔══╝ ╚════██║",
53
+ "███████║╚██████╗██║███████╗██║ ╚████║╚██████╗███████╗███████║",
54
+ "╚══════╝ ╚═════╝╚═╝╚══════╝╚═╝ ╚═══╝ ╚═════╝╚══════╝╚══════╝",
55
55
  ]
56
56
 
57
57
  function ok(msg) { console.log(` ${GREEN}✓${RESET} ${msg}`) }
@@ -139,8 +139,37 @@ function isConnected() {
139
139
  } catch { return false }
140
140
  }
141
141
 
142
- function hasAtlas() {
143
- return runQuiet("atlas --version") !== null
142
+ function atlasVersion() {
143
+ const raw = runQuiet("atlas --version")
144
+ return raw ? raw.replace(/[^0-9.]/g, "") : null
145
+ }
146
+
147
+ // Install the Atlas CLI, or bring an existing install up to date. Returns
148
+ // true when a working `atlas` binary is on PATH afterwards.
149
+ async function installOrUpdateAtlas() {
150
+ const current = atlasVersion()
151
+ if (current) {
152
+ const s = spinner("Checking Atlas CLI for updates...")
153
+ const latest = runQuiet("npm view @synsci/atlas version")
154
+ if (!latest || current === latest) {
155
+ s.ok(`atlas ${current} ${DIM}(up to date)${RESET}`)
156
+ return true
157
+ }
158
+ s.update(`Upgrading Atlas CLI ${current} → ${latest}...`)
159
+ if (runQuiet("npm i -g @synsci/atlas@latest") !== null) {
160
+ s.ok(`Upgraded Atlas CLI to ${latest}`)
161
+ } else {
162
+ s.warn(`Atlas CLI upgrade failed, continuing with ${current}`)
163
+ }
164
+ return true
165
+ }
166
+ const s = spinner("Installing Atlas CLI...")
167
+ if (runQuiet("npm i -g @synsci/atlas@latest") !== null && atlasVersion()) {
168
+ s.ok("Installed Atlas CLI")
169
+ return true
170
+ }
171
+ s.warn(`Atlas CLI install failed, you can retry later: ${CYAN}npm i -g @synsci/atlas${RESET}`)
172
+ return false
144
173
  }
145
174
 
146
175
  async function ask(question) {
@@ -158,7 +187,7 @@ async function main() {
158
187
  console.log()
159
188
  for (const line of LOGO) console.log(` ${CYAN}${line}${RESET}`)
160
189
  console.log()
161
- console.log(` ${BOLD}OpenScience${RESET} ${DIM}the open-source AI research workspace${RESET}`)
190
+ console.log(` ${BOLD}Synthetic Sciences${RESET} ${DIM}OpenScience, the open-source AI research workspace · Atlas, the research platform${RESET}`)
162
191
  console.log()
163
192
 
164
193
  // --- Step 1: Install or upgrade the OpenScience CLI ---
@@ -238,23 +267,40 @@ async function main() {
238
267
  console.log()
239
268
  console.log(` ${BOLD}1${RESET} ${CYAN}OpenScience${RESET} ${DIM}free and open source, bring your own API keys, no account${RESET}`)
240
269
  console.log(` ${BOLD}2${RESET} ${CYAN}OpenScience + Atlas${RESET} ${DIM}managed models, wallet billing, research graph & compute${RESET}`)
270
+ console.log(` ${BOLD}3${RESET} ${CYAN}Atlas CLI${RESET} ${DIM}just the Atlas research CLI — maps, runs, and compute from the terminal${RESET}`)
241
271
  console.log()
242
272
 
243
- const setup = await ask(` ${DIM}❯${RESET} Choose [1/2]: `)
273
+ const setup = await ask(` ${DIM}❯${RESET} Choose [1/2/3]: `)
244
274
  console.log()
245
275
 
246
- if (setup === "2") {
247
- if (!hasAtlas()) {
248
- const s = spinner("Installing Atlas CLI...")
249
- try {
250
- execSync("npm i -g @synsci/atlas@latest", { stdio: "pipe" })
251
- s.ok("Installed Atlas CLI")
252
- } catch {
253
- s.warn(`Atlas CLI install failed, you can retry later: ${CYAN}npm i -g @synsci/atlas${RESET}`)
254
- }
276
+ if (setup === "3") {
277
+ // Atlas-CLI-only path: install/upgrade, verify, hand off to `atlas`.
278
+ // No workspace launch this option exists for people who want the
279
+ // research CLI on a box without opening the browser app.
280
+ const installed = await installOrUpdateAtlas()
281
+ if (!installed) process.exit(1)
282
+ const s = spinner("Running atlas doctor...")
283
+ if (runQuiet("atlas doctor") !== null) {
284
+ s.ok("atlas doctor passed")
255
285
  } else {
256
- ok("Atlas CLI already installed")
286
+ s.warn(`atlas doctor reported issues — run ${CYAN}atlas doctor${RESET} for details`)
257
287
  }
288
+ if (isConnected()) {
289
+ ok("Connected to Atlas")
290
+ } else {
291
+ console.log()
292
+ console.log(` ${DIM}Connect your Atlas account for managed credentials:${RESET} ${CYAN}openscience connect login${RESET}`)
293
+ }
294
+ console.log()
295
+ console.log(` ${BOLD}Next steps${RESET}`)
296
+ console.log(` ${CYAN}atlas --help${RESET} ${DIM}see everything the CLI can do${RESET}`)
297
+ console.log(` ${CYAN}atlas doctor${RESET} ${DIM}check credentials and environment${RESET}`)
298
+ console.log()
299
+ process.exit(0)
300
+ }
301
+
302
+ if (setup === "2") {
303
+ await installOrUpdateAtlas()
258
304
  if (isConnected()) {
259
305
  ok("Connected to Atlas")
260
306
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synsci",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Install wizard for OpenScience, the open-source AI research workspace (optionally with Atlas)",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",