@auroraflow/code 0.0.8 → 0.0.9
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 +1 -1
- package/packages/cli/src/index.js +23 -18
package/package.json
CHANGED
|
@@ -61,35 +61,40 @@ async function startInteractive(args) {
|
|
|
61
61
|
async function init() {
|
|
62
62
|
const existing = await readState();
|
|
63
63
|
const account = await readAccount();
|
|
64
|
+
const controlPlaneURL = account.controlPlaneURL ?? existing.controlPlaneURL ?? "https://auroramos.com/api/v1";
|
|
65
|
+
const gatewayURL = account.gatewayURL ?? existing.gatewayURL ?? "https://auroramos.com";
|
|
66
|
+
console.log(`Welcome to Aurora Code.
|
|
67
|
+
Sign in with your Aurora account to connect the local Claude/Codex launcher.
|
|
68
|
+
API key and model selection are managed in Aurora Desktop > 本机调用.
|
|
69
|
+
`);
|
|
64
70
|
const answers = await promptFields([
|
|
65
|
-
{ name: "controlPlaneURL", label: "Aurora control-plane URL", defaultValue: account.controlPlaneURL ?? existing.controlPlaneURL ?? "https://auroramos.com/api/v1" },
|
|
66
|
-
{ name: "gatewayURL", label: "Aurora gateway URL", defaultValue: account.gatewayURL ?? existing.gatewayURL ?? "https://auroramos.com" },
|
|
67
71
|
{ name: "email", label: "Aurora email", defaultValue: account.user?.email ?? "" },
|
|
68
|
-
{ name: "password", label: "Aurora password", defaultValue: "" }
|
|
69
|
-
{ name: "presentedKey", label: "Initial Aurora API key", defaultValue: existing.selectedKey?.presentedKey ?? "" },
|
|
70
|
-
{ name: "model", label: "Initial Aurora model alias", defaultValue: existing.selectedModel?.alias ?? "" }
|
|
72
|
+
{ name: "password", label: "Aurora password", defaultValue: "" }
|
|
71
73
|
]);
|
|
72
|
-
const login = await loginAurora(
|
|
74
|
+
const login = await loginAurora(controlPlaneURL, answers.email, answers.password);
|
|
73
75
|
const sessionToken = login.session?.token?.trim();
|
|
74
76
|
if (!sessionToken) throw new Error("Aurora login did not return session.token");
|
|
77
|
+
const user = login.user ? {
|
|
78
|
+
id: login.user.id,
|
|
79
|
+
email: login.user.email,
|
|
80
|
+
name: login.user.display_name || login.user.email
|
|
81
|
+
} : null;
|
|
75
82
|
await writeAccount({
|
|
76
|
-
controlPlaneURL
|
|
77
|
-
gatewayURL
|
|
83
|
+
controlPlaneURL,
|
|
84
|
+
gatewayURL,
|
|
78
85
|
sessionToken,
|
|
79
|
-
user
|
|
80
|
-
id: login.user.id,
|
|
81
|
-
email: login.user.email,
|
|
82
|
-
name: login.user.display_name || login.user.email
|
|
83
|
-
} : null
|
|
86
|
+
user
|
|
84
87
|
});
|
|
85
88
|
await writeState({
|
|
86
89
|
...existing,
|
|
87
|
-
controlPlaneURL
|
|
88
|
-
gatewayURL
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
controlPlaneURL,
|
|
91
|
+
gatewayURL,
|
|
92
|
+
account: {
|
|
93
|
+
sessionToken,
|
|
94
|
+
user
|
|
95
|
+
}
|
|
91
96
|
});
|
|
92
|
-
console.log("Aurora
|
|
97
|
+
console.log("Aurora account initialized. Select API key and model in Aurora Desktop > 本机调用.");
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
async function loginAurora(controlPlaneURL, email, password) {
|