sera-code 0.1.0 → 0.1.3

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/NOTICE-SERA.md CHANGED
@@ -23,3 +23,11 @@ There is intentionally no `origin` remote (no push).
23
23
 
24
24
  Code from other projects: Claude Code / Cursor are used as ideas only (no code).
25
25
  Any code adapted from OpenAI Codex CLI (Apache-2.0) must carry per-file attribution.
26
+
27
+ ## Licensing (2026-11-17)
28
+
29
+ - **Pi core** (everything that comes from upstream Pi) remains under the **MIT License** — see root `LICENSE`
30
+ (Copyright (c) 2025 Mario Zechner). Those rights are not restricted.
31
+ - **Sera's own work** — `packages/sera-core` (`@sera/core`) and any Sera-specific modifications — is
32
+ **proprietary: Copyright (c) 2026 Seraphina. All rights reserved.** See `packages/sera-core/LICENSE`.
33
+ - Dependencies keep their own licenses (e.g. `@anthropic-ai/sandbox-runtime`, Apache-2.0).
package/bin/sera.mjs CHANGED
@@ -47,10 +47,18 @@ function writePrivateJson(file, data) {
47
47
  renameSync(tmp, file);
48
48
  }
49
49
 
50
- function seedSettings() {
50
+ async function seedSettings() {
51
51
  const file = join(agentDir, "settings.json");
52
52
  if (existsSync(file)) return;
53
- writePrivateJson(file, { defaultProvider: "sera", defaultModel: "sera-mini" });
53
+ // Varsayilan model sunucu listesinin ilki; liste alinamazsa YALNIZ son care "sera-mini".
54
+ let defaultModel = "sera-mini";
55
+ try {
56
+ const { DEFAULT_MODEL } = await import("../lib/provider.js");
57
+ const { loadModelList } = await import("../sera-core/src/model-list.ts").catch(() => ({}));
58
+ if (loadModelList) defaultModel = (await loadModelList()).models[0]?.id ?? defaultModel;
59
+ else defaultModel = DEFAULT_MODEL;
60
+ } catch {}
61
+ writePrivateJson(file, { defaultProvider: "sera", defaultModel });
54
62
  }
55
63
 
56
64
  function ask(rl, message) {
@@ -61,11 +69,11 @@ function ask(rl, message) {
61
69
  }
62
70
 
63
71
  async function login() {
64
- const { loginWithEmailCode } = await import("../lib/auth.js");
72
+ const { loginInteractive } = await import("../lib/auth.js");
65
73
  const rl = createInterface({ input: process.stdin, output: process.stderr });
66
74
  try {
67
- console.error("Sera - giris (e-posta + tek seferlik kod)");
68
- const { email, credentials } = await loginWithEmailCode({
75
+ console.error("Sera - giris (Google ya da e-posta)");
76
+ const { email, credentials } = await loginInteractive({
69
77
  prompt: (m) => ask(rl, m),
70
78
  auth: (url) => console.error(`\nTarayici acilmazsa bu adresi ac:\n ${url}\n`),
71
79
  progress: (m) => console.error(m),
@@ -73,7 +81,7 @@ async function login() {
73
81
  const data = readJson(authFile);
74
82
  data.sera = credentials;
75
83
  writePrivateJson(authFile, data);
76
- seedSettings();
84
+ await seedSettings();
77
85
  console.error(`Giris yapildi: ${email}\nBaslamak icin: sera`);
78
86
  } finally {
79
87
  rl.close();
@@ -131,7 +139,7 @@ if (process.stderr.isTTY && process.stdin.isTTY && args.length === 0) {
131
139
  if (!loggedIn) console.error("Sera: henuz giris yapilmamis. Once `sera login` (ya da acilinca /login) calistir.");
132
140
  }
133
141
  try {
134
- seedSettings();
142
+ await seedSettings();
135
143
  } catch {}
136
144
 
137
145
  await import(pathToFileURL(join(root, "dist", "bundle", "cli-runtime.js")).href);