@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auroraflow/code",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "description": "Aurora launcher and sidecar for official Codex and Claude Code clients.",
6
6
  "repository": {
@@ -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(answers.controlPlaneURL, answers.email, answers.password);
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: answers.controlPlaneURL,
77
- gatewayURL: answers.gatewayURL,
83
+ controlPlaneURL,
84
+ gatewayURL,
78
85
  sessionToken,
79
- user: login.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: answers.controlPlaneURL,
88
- gatewayURL: answers.gatewayURL,
89
- selectedKey: answers.presentedKey ? { presentedKey: answers.presentedKey, source: "manual" } : existing.selectedKey,
90
- selectedModel: answers.model ? { alias: answers.model, source: "manual" } : existing.selectedModel
90
+ controlPlaneURL,
91
+ gatewayURL,
92
+ account: {
93
+ sessionToken,
94
+ user
95
+ }
91
96
  });
92
- console.log("Aurora local account and runtime state initialized.");
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) {