agent-factorio 0.3.0 → 0.3.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/bin.js +1 -0
- package/commands/login.mjs +4 -10
- package/package.json +1 -1
package/bin.js
CHANGED
package/commands/login.mjs
CHANGED
|
@@ -41,16 +41,11 @@ async function waitForVerification(hubUrl, loginToken) {
|
|
|
41
41
|
throw new Error("Verification timed out. Please try again.");
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
const existing = readGlobalConfig();
|
|
46
|
-
const defaultUrl = existing?.organizations?.[0]?.hubUrl || "";
|
|
44
|
+
const DEFAULT_HUB_URL = "https://agent-factorio.vercel.app";
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
error("Hub URL is required.");
|
|
52
|
-
process.exit(1);
|
|
53
|
-
}
|
|
46
|
+
export async function loginCommand(options = {}) {
|
|
47
|
+
const existing = readGlobalConfig();
|
|
48
|
+
const hubUrl = options.hubUrl || existing?.organizations?.[0]?.hubUrl || DEFAULT_HUB_URL;
|
|
54
49
|
|
|
55
50
|
// Check connectivity
|
|
56
51
|
const reachable = await checkHub(hubUrl);
|
|
@@ -58,7 +53,6 @@ export async function loginCommand() {
|
|
|
58
53
|
error(`Cannot connect to ${hubUrl}. Is the hub running?`);
|
|
59
54
|
process.exit(1);
|
|
60
55
|
}
|
|
61
|
-
success("Hub connected.");
|
|
62
56
|
|
|
63
57
|
// 2. Email input
|
|
64
58
|
const email = await ask("Your email (used as your identifier)");
|