@novedu/cli 0.24.0 → 0.24.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.
- package/dist/main.js +36 -7
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -85,17 +85,46 @@ async function acquireSilent(pca) {
|
|
|
85
85
|
return null;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* How the system browser is launched per platform. Exported for tests.
|
|
90
|
+
*
|
|
91
|
+
* Windows goes through `cmd /c start`, and cmd RE-PARSES the command line it
|
|
92
|
+
* receives: an unquoted URL is cut at the first `&`, so Entra only ever saw
|
|
93
|
+
* `authorize?client_id=…` and answered AADSTS900144 ("the request body must
|
|
94
|
+
* contain the following parameter: 'scope'"). Node quotes an argument only
|
|
95
|
+
* when it contains whitespace, so the URL is quoted here explicitly and the
|
|
96
|
+
* command line handed over verbatim. The empty `""` is `start`'s window title
|
|
97
|
+
* — without it, `start` would take the quoted URL as the title.
|
|
98
|
+
*/
|
|
99
|
+
function browserCommand(url, platform = process.platform) {
|
|
100
|
+
if (platform === "darwin") return {
|
|
101
|
+
command: "open",
|
|
102
|
+
args: [url],
|
|
103
|
+
verbatim: false
|
|
104
|
+
};
|
|
105
|
+
if (platform === "win32") return {
|
|
106
|
+
command: "cmd",
|
|
107
|
+
args: [
|
|
108
|
+
"/c",
|
|
109
|
+
"start",
|
|
110
|
+
"\"\"",
|
|
111
|
+
`"${url}"`
|
|
112
|
+
],
|
|
113
|
+
verbatim: true
|
|
114
|
+
};
|
|
115
|
+
return {
|
|
116
|
+
command: "xdg-open",
|
|
117
|
+
args: [url],
|
|
118
|
+
verbatim: false
|
|
119
|
+
};
|
|
120
|
+
}
|
|
88
121
|
function defaultOpenBrowser(url) {
|
|
89
|
-
const
|
|
90
|
-
"/c",
|
|
91
|
-
"start",
|
|
92
|
-
"",
|
|
93
|
-
url
|
|
94
|
-
]] : ["xdg-open", [url]];
|
|
122
|
+
const { command, args, verbatim } = browserCommand(url);
|
|
95
123
|
try {
|
|
96
124
|
spawn(command, args, {
|
|
97
125
|
stdio: "ignore",
|
|
98
|
-
detached: true
|
|
126
|
+
detached: true,
|
|
127
|
+
windowsVerbatimArguments: verbatim
|
|
99
128
|
}).unref();
|
|
100
129
|
} catch {}
|
|
101
130
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novedu/cli",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.1",
|
|
4
4
|
"description": "Command-line companion for the Novedu chat app. Validates tutor, fragment, quiz, writing, coding and eval YAML definitions, dumps the exact LLM prompts an activity produces, evaluates a quiz's grading rubric against golden answers and replays scripted conversations against a tutor; signs in with Entra ID and manages codes, app-hosted files and images over the app's API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|