@rhizogrip/spore-cli 1.62.2 → 1.64.0
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/package.json +2 -2
- package/src/mo.js +9 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rhizogrip/spore-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.64.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Christophe Le Bars",
|
|
6
6
|
"email": "clb@toort.net"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"minimist": "^1.2.8"
|
|
55
55
|
},
|
|
56
56
|
"optionalDependencies": {
|
|
57
|
-
"@rhizogrip/spore": "1.
|
|
57
|
+
"@rhizogrip/spore": "1.64.0"
|
|
58
58
|
},
|
|
59
59
|
"license": "Apache-2.0"
|
|
60
60
|
}
|
package/src/mo.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `mo` comes inside spore for spore's own use, and npm does not put it on PATH. A message naming a
|
|
3
3
|
* `mo` command says how to install it where it is missing, at the mohdel spore pins, since the two
|
|
4
|
-
* share one catalog.
|
|
4
|
+
* share one catalog. A ChatGPT error that signing in again fixes names no command, so the one that
|
|
5
|
+
* signs in is added first.
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
8
|
import { accessSync, constants, statSync } from 'node:fs'
|
|
8
9
|
import { createRequire } from 'node:module'
|
|
9
10
|
import { delimiter, join } from 'node:path'
|
|
10
11
|
|
|
12
|
+
import { CHATGPT_SIGN_IN_AGAIN } from '@rhizogrip/spore'
|
|
13
|
+
|
|
11
14
|
const MO_COMMAND = /(?:^|[\s"'`(])mo (?:chatgpt|curate|ls|model|onboard|providers)\b/
|
|
12
15
|
|
|
13
16
|
function runnable (path) {
|
|
@@ -28,7 +31,10 @@ export function moHint (text) {
|
|
|
28
31
|
return `mo is a separate install: npm install -g mohdel@${mohdel}`
|
|
29
32
|
}
|
|
30
33
|
|
|
34
|
+
const withSignIn = (text) => text.includes(CHATGPT_SIGN_IN_AGAIN) ? `${text}: mo chatgpt login` : text
|
|
35
|
+
|
|
31
36
|
export function withMoHint (text) {
|
|
32
|
-
const
|
|
33
|
-
|
|
37
|
+
const named = withSignIn(text)
|
|
38
|
+
const hint = moHint(named)
|
|
39
|
+
return hint ? `${named} — ${hint}` : named
|
|
34
40
|
}
|