@aqenta-gateway/cli 0.1.2 → 0.1.4

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.
Files changed (3) hide show
  1. package/LICENSE +52 -5
  2. package/dist/bin.js +178 -170
  3. package/package.json +2 -2
package/LICENSE CHANGED
@@ -1,7 +1,54 @@
1
- Copyright (c) 2026 Aqenta. Tüm hakları saklıdır.
1
+ Aqenta Gateway CLI Son Kullanıcı Lisans Şartları
2
2
 
3
- Bu yazılım Aqenta'nın tescilli ürünüdür. Aqenta ile yapılmış yazılı bir lisans
4
- sözleşmesi olmadan kullanılamaz, kopyalanamaz, değiştirilemez, dağıtılamaz veya
5
- türev çalışma üretiminde kullanılamaz.
3
+ Telif Hakkı (c) 2026 Aqenta. Tüm hakları saklıdır.
6
4
 
7
- YAZILIM, AÇIK VEYA ÖRTÜLÜ HİÇBİR GARANTİ VERİLMEKSİZİN "OLDUĞU GİBİ" SUNULUR.
5
+ Bu yazılım Aqenta'nın tescilli ürünüdür ve açık kaynak değildir.
6
+
7
+ 1. KULLANIM HAKKI
8
+
9
+ Aqenta, bu yazılımı indiren kişiye; Aqenta Gateway hizmetine erişmek ve onu
10
+ kullanmak amacıyla, dünya çapında geçerli, telifsiz, münhasır olmayan ve
11
+ devredilemez bir kullanım hakkı verir. Bu hak, geçerli bir Aqenta hesabı
12
+ bulunması ve Aqenta Hizmet Şartları'na uyulması koşuluna bağlıdır.
13
+
14
+ Bu hak kapsamında yazılımı kişisel veya ticari projelerinizde, kendi
15
+ altyapınızda ve otomasyon süreçlerinizde çalıştırabilirsiniz.
16
+
17
+ 2. KISITLAMALAR
18
+
19
+ Aqenta'nın önceden yazılı izni olmadan:
20
+
21
+ a) yazılımı yeniden dağıtamaz, satamaz, kiralayamaz veya alt lisanslayamaz;
22
+ b) yazılımı değiştiremez, türev çalışma üretemez;
23
+ c) kaynak koda dönüştürme (reverse engineering) yapamaz;
24
+ d) telif, marka veya sahiplik bildirimlerini kaldıramaz veya değiştiremez;
25
+ e) yazılımı, Aqenta Gateway dışındaki bir hizmete erişmek için
26
+ uyarlayamazsınız.
27
+
28
+ Zorunlu hukuk kuralları uyarınca kısıtlanamayan haklar saklıdır.
29
+
30
+ 3. HİZMET BAĞIMLILIĞI
31
+
32
+ Bu yazılım bir istemcidir; işlevi Aqenta Gateway hizmetine bağlıdır. Hizmete
33
+ erişim, ilgili abonelik ve kullanım şartlarına tabidir. Hesabın askıya
34
+ alınması veya kapatılması hâlinde bu lisans kapsamındaki kullanım hakkı da
35
+ sona erer.
36
+
37
+ 4. GARANTİ REDDİ
38
+
39
+ YAZILIM, AÇIK VEYA ÖRTÜLÜ HİÇBİR GARANTİ VERİLMEKSİZİN "OLDUĞU GİBİ"
40
+ SUNULUR. BUNLARLA SINIRLI OLMAMAK ÜZERE, TİCARETE ELVERİŞLİLİK, BELİRLİ BİR
41
+ AMACA UYGUNLUK VE İHLAL ETMEME GARANTİLERİ REDDEDİLİR.
42
+
43
+ 5. SORUMLULUK SINIRI
44
+
45
+ UYGULANABİLİR HUKUKUN İZİN VERDİĞİ AZAMİ ÖLÇÜDE AQENTA; YAZILIMIN
46
+ KULLANIMINDAN VEYA KULLANILAMAMASINDAN DOĞAN DOLAYLI, ARIZİ, ÖZEL VEYA
47
+ SONUÇSAL ZARARLARDAN SORUMLU TUTULAMAZ.
48
+
49
+ 6. ÜÇÜNCÜ TARAF BİLEŞENLER
50
+
51
+ Yazılım, kendi lisansları altında dağıtılan açık kaynak bileşenler içerebilir.
52
+ Bu bileşenler kendi lisans şartlarına tabidir.
53
+
54
+ İletişim: https://ai.aqenta.com.tr
package/dist/bin.js CHANGED
@@ -3132,7 +3132,7 @@ function registerMcpCommand(program, output) {
3132
3132
  import path10 from "path";
3133
3133
 
3134
3134
  // src/version.ts
3135
- var CLI_VERSION = "0.1.2";
3135
+ var CLI_VERSION = "0.1.4";
3136
3136
 
3137
3137
  // src/commands/extensions.ts
3138
3138
  function store2() {
@@ -4102,8 +4102,10 @@ var GatewayAgentModelClient = class {
4102
4102
  model: request.model,
4103
4103
  organizationId: this.options.organizationId,
4104
4104
  messages: request.messages.map(modelMessage),
4105
- tools: request.tools.map(toolDefinition),
4106
- toolChoice: request.tools.length > 0 ? "auto" : "none",
4105
+ // Arac listesi bosken alan HIC gonderilmez. `tools: []` OpenAI
4106
+ // sozlesmesinde gecersizdir ve gateway bunu `invalid_tools` ile 400
4107
+ // dondurerek reddeder; gorev daha modele ulasmadan duser.
4108
+ ...request.tools.length > 0 ? { tools: request.tools.map(toolDefinition), toolChoice: "auto" } : { toolChoice: "none" },
4107
4109
  stream: false,
4108
4110
  signal,
4109
4111
  timeoutMs: this.options.timeoutMs
@@ -9343,7 +9345,9 @@ var GatewayClient = class {
9343
9345
  model: request.model,
9344
9346
  messages: messages2,
9345
9347
  stream: request.stream === true,
9346
- ...request.tools ? { tools: request.tools } : {},
9348
+ // Bos dizi de "tools yok" demektir; alan gonderilmez. Bos dizi
9349
+ // gondermek gecersiz bir istektir ve 400 ile geri doner.
9350
+ ...request.tools?.length ? { tools: request.tools } : {},
9347
9351
  ...request.toolChoice !== void 0 ? { tool_choice: request.toolChoice } : {}
9348
9352
  }),
9349
9353
  signal: controller.signal
@@ -9782,7 +9786,7 @@ var OutputRenderer = class {
9782
9786
 
9783
9787
  // src/terminal/interactive.ts
9784
9788
  import * as p2 from "@clack/prompts";
9785
- import pc2 from "picocolors";
9789
+ import pc3 from "picocolors";
9786
9790
 
9787
9791
  // src/terminal/coding-agent.ts
9788
9792
  import { createHash as createHash16, randomUUID as randomUUID14 } from "crypto";
@@ -10463,15 +10467,171 @@ ${result.finalText}
10463
10467
  return true;
10464
10468
  }
10465
10469
 
10470
+ // src/agent/tui/dashboard.ts
10471
+ import pc2, { createColors } from "picocolors";
10472
+ var MAX_PANEL_WIDTH = 96;
10473
+ function renderWelcomeDashboard(summary, options = {}) {
10474
+ const noColor = Boolean(options.noColor);
10475
+ const colors = noColor ? createColors(false) : pc2;
10476
+ const rows = [
10477
+ ["Profil", safeValue2(summary.profile)],
10478
+ ["Servis", statusLabel(summary.serviceStatus)],
10479
+ ["Hesap", safeValue2(summary.accountEmail)],
10480
+ ["Organizasyon", safeValue2(summary.organizationName)],
10481
+ ["Power", formatPower(summary.powerRemaining, summary.powerLimit)],
10482
+ ["Model", safeValue2(summary.modelId)],
10483
+ ["Workspace", compactPath(summary.workspaceRoot)],
10484
+ ["Mod", safeValue2(summary.mode)]
10485
+ ].filter(([, value2]) => value2 !== "-");
10486
+ const tools = summary.tools?.length ? summary.tools.join(" \xB7 ") : "chat \xB7 models \xB7 git diff \xB7 tests \xB7 mcp";
10487
+ const status = statusBadge(summary.serviceStatus, noColor);
10488
+ const accountLine = summary.accountEmail ? `${summary.accountEmail}${summary.organizationName ? ` \xB7 ${summary.organizationName}` : ""}` : "Giri\u015F yap\u0131lmad\u0131";
10489
+ const body = [
10490
+ ...brandLogo(noColor),
10491
+ colors.bold("AQENTA"),
10492
+ "",
10493
+ `${colors.bold(`${summary.productName} CLI`)} ${colors.dim(`v${summary.version}`)} ${status}`,
10494
+ "Coding agent, model gateway, Power ve g\xFCvenli workspace kontrol\xFC.",
10495
+ "",
10496
+ ...twoColumn(
10497
+ [
10498
+ colors.bold("Ba\u015Flamak i\xE7in"),
10499
+ "\u203A Do\u011Fal dilde g\xF6rev yaz",
10500
+ "\u203A /help ile komutlar\u0131 g\xF6r",
10501
+ "\u203A @file veya @klas\xF6r ile ba\u011Flam ekle",
10502
+ `\u203A ${FEATURED_SLASH_COMMANDS.join(", ")}`
10503
+ ],
10504
+ [
10505
+ colors.bold("Durum"),
10506
+ `\u203A Hesap: ${accountLine}`,
10507
+ `\u203A Workspace: ${compactPath(summary.workspaceRoot, 42)}`,
10508
+ `\u203A Power: ${formatPower(summary.powerRemaining, summary.powerLimit)}`,
10509
+ `\u203A Ara\xE7lar: ${tools}`
10510
+ ],
10511
+ noColor
10512
+ ),
10513
+ "",
10514
+ ...rows.filter(([label]) => !["Hesap", "Organizasyon", "Power", "Workspace"].includes(label)).map(([label, value2]) => `${colors.dim(label.padEnd(13))} ${value2}`)
10515
+ ];
10516
+ if (typeof summary.mcpServerCount === "number" && summary.mcpServerCount > 0) {
10517
+ body.push(`${colors.dim("MCP".padEnd(13))} ${summary.mcpServerCount} sunucu`);
10518
+ }
10519
+ body.push(
10520
+ "",
10521
+ colors.bold("\xD6rnek komutlar"),
10522
+ " /model model se\xE7 /power kalan Power",
10523
+ " /status servis durumu /org organizasyon se\xE7",
10524
+ " /exit g\xFCvenli \xE7\u0131k\u0131\u015F"
10525
+ );
10526
+ return panel(body, noColor);
10527
+ }
10528
+ function compactPath(value2, maxLength = 64) {
10529
+ if (!value2) return "-";
10530
+ if (value2.length <= maxLength) return value2;
10531
+ const normalized = value2.replaceAll("\\", "/");
10532
+ const parts = normalized.split("/").filter(Boolean);
10533
+ if (parts.length <= 2) return truncateMiddle(value2, maxLength);
10534
+ const suffix = parts.slice(-2).join("/");
10535
+ const root = normalized.startsWith("/") ? "/" : `${parts[0]}/`;
10536
+ return truncateMiddle(`${root}.../${suffix}`, maxLength);
10537
+ }
10538
+ function panel(lines, noColor) {
10539
+ const colors = noColor ? createColors(false) : pc2;
10540
+ const clean = lines.map((line) => stripAnsi(line));
10541
+ const width = Math.min(MAX_PANEL_WIDTH, Math.max(...clean.map((line) => line.length), 44));
10542
+ const border = colors.dim(`\u256D${"\u2500".repeat(width + 2)}\u256E`);
10543
+ const bottom = colors.dim(`\u2570${"\u2500".repeat(width + 2)}\u256F`);
10544
+ const content = lines.map((line, index) => {
10545
+ const visible = stripAnsi(line);
10546
+ const padded = `${line}${" ".repeat(Math.max(0, width - visible.length))}`;
10547
+ const side = index < 7 ? colors.cyan("\u2502") : colors.dim("\u2502");
10548
+ return `${side} ${padded} ${side}`;
10549
+ });
10550
+ return [border, ...content, bottom].join("\n");
10551
+ }
10552
+ function statusLabel(value2) {
10553
+ if (value2 === "operational") return "operational";
10554
+ if (value2 === "unknown") return "do\u011Frulanmad\u0131";
10555
+ return value2 || "do\u011Frulanmad\u0131";
10556
+ }
10557
+ function statusBadge(value2, noColor) {
10558
+ const colors = noColor ? createColors(false) : pc2;
10559
+ if (value2 === "operational") return colors.green("\u25CF sistem haz\u0131r");
10560
+ if (value2 === "unknown") return colors.yellow("\u25CF durum do\u011Frulanmad\u0131");
10561
+ return colors.yellow(`\u25CF sistem ${value2}`);
10562
+ }
10563
+ function brandLogo(noColor) {
10564
+ const colors = noColor ? createColors(false) : pc2;
10565
+ const lines = [
10566
+ " ___ ____ ______ _ _ _______ ___ ",
10567
+ " / _ \\ / __ \\ | ____| \\ | |__ __/ _ \\",
10568
+ " / /_\\ \\| | | || |__ | \\| | | | / /_\\ \\",
10569
+ " | _ || | | || __| | . ` | | | | _ |",
10570
+ " | | | || |__| || |____| |\\ | | | | | | |",
10571
+ " \\_| |_/ \\___\\_\\|______|_| \\_| |_| \\_| |_/"
10572
+ ];
10573
+ return lines.map((line, index) => {
10574
+ if (noColor) return line;
10575
+ if (index < 2) return colors.cyan(line);
10576
+ if (index < 4) return colors.magenta(line);
10577
+ return colors.yellow(line);
10578
+ });
10579
+ }
10580
+ function twoColumn(left, right, noColor) {
10581
+ const colors = noColor ? createColors(false) : pc2;
10582
+ const width = 42;
10583
+ const count = Math.max(left.length, right.length);
10584
+ const rows = [];
10585
+ for (let index = 0; index < count; index += 1) {
10586
+ const a = left[index] ?? "";
10587
+ const b = right[index] ?? "";
10588
+ rows.push(`${padVisible(a, width)} ${colors.dim("\u2502")} ${b}`);
10589
+ }
10590
+ return rows;
10591
+ }
10592
+ function padVisible(value2, width) {
10593
+ const visible = stripAnsi(value2);
10594
+ return `${value2}${" ".repeat(Math.max(0, width - visible.length))}`;
10595
+ }
10596
+ function formatPower(remaining, limit2) {
10597
+ if (typeof remaining !== "number" || typeof limit2 !== "number") return "-";
10598
+ return `${formatNumber(remaining)} / ${formatNumber(limit2)}`;
10599
+ }
10600
+ function formatNumber(value2) {
10601
+ return new Intl.NumberFormat("tr-TR", { maximumFractionDigits: 2 }).format(value2);
10602
+ }
10603
+ function safeValue2(value2) {
10604
+ const trimmed = value2?.trim();
10605
+ return trimmed ? trimmed : "-";
10606
+ }
10607
+ function truncateMiddle(value2, maxLength) {
10608
+ if (value2.length <= maxLength) return value2;
10609
+ if (maxLength <= 3) return ".".repeat(maxLength);
10610
+ const head = Math.ceil((maxLength - 3) / 2);
10611
+ const tail = Math.floor((maxLength - 3) / 2);
10612
+ return `${value2.slice(0, head)}...${value2.slice(value2.length - tail)}`;
10613
+ }
10614
+ function stripAnsi(value2) {
10615
+ const escape = String.fromCharCode(27);
10616
+ return value2.replace(new RegExp(`${escape}\\[[0-9;]*m`, "g"), "");
10617
+ }
10618
+
10466
10619
  // src/terminal/interactive.ts
10467
10620
  async function runInteractiveTerminal(runtime) {
10468
10621
  process.title = branding.terminalTitle;
10469
- p2.intro(`${pc2.cyan("\u25C6")} ${pc2.bold(branding.productName)} ${pc2.dim(`v${runtime.version}`)}`);
10622
+ const serviceStatus = await publicStatus(runtime.management);
10623
+ process.stdout.write(`${renderWelcomeDashboard({
10624
+ productName: branding.productName,
10625
+ version: runtime.version,
10626
+ profile: runtime.profile,
10627
+ serviceStatus,
10628
+ workspaceRoot: process.cwd()
10629
+ })}
10630
+ `);
10631
+ p2.intro(`${pc3.cyan("\u25C6")} ${pc3.bold(branding.productName)} ${pc3.dim(`v${runtime.version}`)}`);
10470
10632
  if (runtime.internalDevelopment) {
10471
10633
  p2.note("Canl\u0131 Function\u2019lara g\xFCvenli internal development ba\u011Flant\u0131s\u0131 kullan\u0131l\u0131yor.\nBu adres m\xFC\u015Fteri config veya \xE7\u0131kt\u0131s\u0131na yaz\u0131lmaz.", "Geli\u015Ftirme modu");
10472
10634
  }
10473
- const serviceStatus = await publicStatus(runtime.management);
10474
- p2.log.message(`${serviceStatus === "operational" ? pc2.green("\u25CF") : pc2.yellow("\u25CF")} Sistem ${statusLabel(serviceStatus)}`);
10475
10635
  let session = runtime.sessions.currentSession();
10476
10636
  if (!session) {
10477
10637
  const restore = p2.spinner();
@@ -10549,9 +10709,9 @@ async function homeLoop(runtime) {
10549
10709
  ]);
10550
10710
  const org = account?.organizations.find((item) => item.id === organizationId);
10551
10711
  p2.note([
10552
- `${pc2.dim("Hesap")} ${account?.user.email ?? "Ba\u011Fl\u0131"}`,
10553
- `${pc2.dim("Organizasyon")} ${org?.name ?? "Se\xE7ilmedi"}`,
10554
- `${pc2.dim("Power")} ${power ? `${formatNumber(power.total_remaining_today)} / ${formatNumber(power.total_daily_limit)}` : "\u2014"}`
10712
+ `${pc3.dim("Hesap")} ${account?.user.email ?? "Ba\u011Fl\u0131"}`,
10713
+ `${pc3.dim("Organizasyon")} ${org?.name ?? "Se\xE7ilmedi"}`,
10714
+ `${pc3.dim("Power")} ${power ? `${formatNumber2(power.total_remaining_today)} / ${formatNumber2(power.total_daily_limit)}` : "\u2014"}`
10555
10715
  ].join("\n"), "\xC7al\u0131\u015Fma alan\u0131");
10556
10716
  const codingAgentStarted = organizationId ? await runCodingAgentTerminal(runtime, organizationId).catch(() => false) : false;
10557
10717
  if (!codingAgentStarted) await chatSession(runtime, organizationId ?? void 0);
@@ -10570,9 +10730,9 @@ async function chatSession(runtime, organizationId) {
10570
10730
  }
10571
10731
  let model = catalog.data[0].id;
10572
10732
  let history = [];
10573
- p2.log.info(`${pc2.bold(String(model))} haz\u0131r. Mesaj\u0131n\u0131 yaz; komutlar i\xE7in /help.`);
10733
+ p2.log.info(`${pc3.bold(String(model))} haz\u0131r. Mesaj\u0131n\u0131 yaz; komutlar i\xE7in /help.`);
10574
10734
  while (true) {
10575
- const message = await p2.text({ message: pc2.cyan("\u203A"), placeholder: "Bir \u015Fey sor veya /help yaz\u2026" });
10735
+ const message = await p2.text({ message: pc3.cyan("\u203A"), placeholder: "Bir \u015Fey sor veya /help yaz\u2026" });
10576
10736
  if (cancelled2(message)) return;
10577
10737
  const input = String(message).trim();
10578
10738
  if (!input) continue;
@@ -10605,12 +10765,12 @@ async function chatSession(runtime, organizationId) {
10605
10765
  }
10606
10766
  if (input === "/power") {
10607
10767
  const power = await runtime.management.get("power", powerSchema, { organizationId: activeOrganizationId }).catch(() => null);
10608
- p2.note(power ? `${formatNumber(power.total_remaining_today)} / ${formatNumber(power.total_daily_limit)} Power` : "Power bilgisi al\u0131namad\u0131.", "Power");
10768
+ p2.note(power ? `${formatNumber2(power.total_remaining_today)} / ${formatNumber2(power.total_daily_limit)} Power` : "Power bilgisi al\u0131namad\u0131.", "Power");
10609
10769
  continue;
10610
10770
  }
10611
10771
  if (input === "/usage") {
10612
10772
  const usage = await runtime.management.get("usage", usageSchema, { organizationId: activeOrganizationId }).catch(() => null);
10613
- p2.note(usage ? `${formatNumber(usage.summary.power_used)} Power \xB7 ${usage.summary.request_count} istek` : "Kullan\u0131m bilgisi al\u0131namad\u0131.", "Kullan\u0131m");
10773
+ p2.note(usage ? `${formatNumber2(usage.summary.power_used)} Power \xB7 ${usage.summary.request_count} istek` : "Kullan\u0131m bilgisi al\u0131namad\u0131.", "Kullan\u0131m");
10614
10774
  continue;
10615
10775
  }
10616
10776
  if (input === "/org") {
@@ -10638,7 +10798,7 @@ async function chatSession(runtime, organizationId) {
10638
10798
  onDelta: (delta) => {
10639
10799
  if (!streaming) {
10640
10800
  waiting.stop("Yan\u0131t");
10641
- process.stdout.write(`${pc2.cyan("Aqenta")} `);
10801
+ process.stdout.write(`${pc3.cyan("Aqenta")} `);
10642
10802
  streaming = true;
10643
10803
  }
10644
10804
  process.stdout.write(delta);
@@ -10646,7 +10806,7 @@ async function chatSession(runtime, organizationId) {
10646
10806
  });
10647
10807
  if (!streaming) {
10648
10808
  waiting.stop("Yan\u0131t");
10649
- process.stdout.write(`${pc2.cyan("Aqenta")} ${result.content}`);
10809
+ process.stdout.write(`${pc3.cyan("Aqenta")} ${result.content}`);
10650
10810
  }
10651
10811
  process.stdout.write("\n\n");
10652
10812
  history.push({ role: "assistant", content: result.content });
@@ -10677,10 +10837,7 @@ function cancelled2(value2) {
10677
10837
  function finish(message) {
10678
10838
  p2.outro(message);
10679
10839
  }
10680
- function statusLabel(status) {
10681
- return status === "operational" ? pc2.green("\xE7al\u0131\u015F\u0131yor") : status === "unknown" ? pc2.yellow("do\u011Frulanamad\u0131") : pc2.yellow(status);
10682
- }
10683
- function formatNumber(value2) {
10840
+ function formatNumber2(value2) {
10684
10841
  return new Intl.NumberFormat("tr-TR", { maximumFractionDigits: 2 }).format(value2);
10685
10842
  }
10686
10843
  function safeChatError(error) {
@@ -10688,155 +10845,6 @@ function safeChatError(error) {
10688
10845
  return code === "gateway_cancelled" ? "\u0130stek iptal edildi." : "Gateway \u015Fu anda yan\u0131t vermiyor. Daha sonra tekrar dene.";
10689
10846
  }
10690
10847
 
10691
- // src/agent/tui/dashboard.ts
10692
- import pc3, { createColors } from "picocolors";
10693
- var MAX_PANEL_WIDTH = 96;
10694
- function renderWelcomeDashboard(summary, options = {}) {
10695
- const noColor = Boolean(options.noColor);
10696
- const colors = noColor ? createColors(false) : pc3;
10697
- const rows = [
10698
- ["Profil", safeValue2(summary.profile)],
10699
- ["Servis", statusLabel2(summary.serviceStatus)],
10700
- ["Hesap", safeValue2(summary.accountEmail)],
10701
- ["Organizasyon", safeValue2(summary.organizationName)],
10702
- ["Power", formatPower(summary.powerRemaining, summary.powerLimit)],
10703
- ["Model", safeValue2(summary.modelId)],
10704
- ["Workspace", compactPath(summary.workspaceRoot)],
10705
- ["Mod", safeValue2(summary.mode)]
10706
- ].filter(([, value2]) => value2 !== "-");
10707
- const tools = summary.tools?.length ? summary.tools.join(" \xB7 ") : "chat \xB7 models \xB7 git diff \xB7 tests \xB7 mcp";
10708
- const status = statusBadge(summary.serviceStatus, noColor);
10709
- const accountLine = summary.accountEmail ? `${summary.accountEmail}${summary.organizationName ? ` \xB7 ${summary.organizationName}` : ""}` : "Giri\u015F yap\u0131lmad\u0131";
10710
- const body = [
10711
- ...brandLogo(noColor),
10712
- colors.bold("AQENTA"),
10713
- "",
10714
- `${colors.bold(`${summary.productName} CLI`)} ${colors.dim(`v${summary.version}`)} ${status}`,
10715
- "Coding agent, model gateway, Power ve g\xFCvenli workspace kontrol\xFC.",
10716
- "",
10717
- ...twoColumn(
10718
- [
10719
- colors.bold("Ba\u015Flamak i\xE7in"),
10720
- "\u203A Do\u011Fal dilde g\xF6rev yaz",
10721
- "\u203A /help ile komutlar\u0131 g\xF6r",
10722
- "\u203A @file veya @klas\xF6r ile ba\u011Flam ekle",
10723
- `\u203A ${FEATURED_SLASH_COMMANDS.join(", ")}`
10724
- ],
10725
- [
10726
- colors.bold("Durum"),
10727
- `\u203A Hesap: ${accountLine}`,
10728
- `\u203A Workspace: ${compactPath(summary.workspaceRoot, 42)}`,
10729
- `\u203A Power: ${formatPower(summary.powerRemaining, summary.powerLimit)}`,
10730
- `\u203A Ara\xE7lar: ${tools}`
10731
- ],
10732
- noColor
10733
- ),
10734
- "",
10735
- ...rows.filter(([label]) => !["Hesap", "Organizasyon", "Power", "Workspace"].includes(label)).map(([label, value2]) => `${colors.dim(label.padEnd(13))} ${value2}`)
10736
- ];
10737
- if (typeof summary.mcpServerCount === "number" && summary.mcpServerCount > 0) {
10738
- body.push(`${colors.dim("MCP".padEnd(13))} ${summary.mcpServerCount} sunucu`);
10739
- }
10740
- body.push(
10741
- "",
10742
- colors.bold("\xD6rnek komutlar"),
10743
- " /model model se\xE7 /power kalan Power",
10744
- " /status servis durumu /org organizasyon se\xE7",
10745
- " /exit g\xFCvenli \xE7\u0131k\u0131\u015F"
10746
- );
10747
- return panel(body, noColor);
10748
- }
10749
- function compactPath(value2, maxLength = 64) {
10750
- if (!value2) return "-";
10751
- if (value2.length <= maxLength) return value2;
10752
- const normalized = value2.replaceAll("\\", "/");
10753
- const parts = normalized.split("/").filter(Boolean);
10754
- if (parts.length <= 2) return truncateMiddle(value2, maxLength);
10755
- const suffix = parts.slice(-2).join("/");
10756
- const root = normalized.startsWith("/") ? "/" : `${parts[0]}/`;
10757
- return truncateMiddle(`${root}.../${suffix}`, maxLength);
10758
- }
10759
- function panel(lines, noColor) {
10760
- const colors = noColor ? createColors(false) : pc3;
10761
- const clean = lines.map((line) => stripAnsi(line));
10762
- const width = Math.min(MAX_PANEL_WIDTH, Math.max(...clean.map((line) => line.length), 44));
10763
- const border = colors.dim(`\u256D${"\u2500".repeat(width + 2)}\u256E`);
10764
- const bottom = colors.dim(`\u2570${"\u2500".repeat(width + 2)}\u256F`);
10765
- const content = lines.map((line, index) => {
10766
- const visible = stripAnsi(line);
10767
- const padded = `${line}${" ".repeat(Math.max(0, width - visible.length))}`;
10768
- const side = index < 7 ? colors.cyan("\u2502") : colors.dim("\u2502");
10769
- return `${side} ${padded} ${side}`;
10770
- });
10771
- return [border, ...content, bottom].join("\n");
10772
- }
10773
- function statusLabel2(value2) {
10774
- if (value2 === "operational") return "operational";
10775
- if (value2 === "unknown") return "do\u011Frulanmad\u0131";
10776
- return value2 || "do\u011Frulanmad\u0131";
10777
- }
10778
- function statusBadge(value2, noColor) {
10779
- const colors = noColor ? createColors(false) : pc3;
10780
- if (value2 === "operational") return colors.green("\u25CF sistem haz\u0131r");
10781
- if (value2 === "unknown") return colors.yellow("\u25CF durum do\u011Frulanmad\u0131");
10782
- return colors.yellow(`\u25CF sistem ${value2}`);
10783
- }
10784
- function brandLogo(noColor) {
10785
- const colors = noColor ? createColors(false) : pc3;
10786
- const lines = [
10787
- " ___ ____ ______ _ _ _______ ___ ",
10788
- " / _ \\ / __ \\ | ____| \\ | |__ __/ _ \\",
10789
- " / /_\\ \\| | | || |__ | \\| | | | / /_\\ \\",
10790
- " | _ || | | || __| | . ` | | | | _ |",
10791
- " | | | || |__| || |____| |\\ | | | | | | |",
10792
- " \\_| |_/ \\___\\_\\|______|_| \\_| |_| \\_| |_/"
10793
- ];
10794
- return lines.map((line, index) => {
10795
- if (noColor) return line;
10796
- if (index < 2) return colors.cyan(line);
10797
- if (index < 4) return colors.magenta(line);
10798
- return colors.yellow(line);
10799
- });
10800
- }
10801
- function twoColumn(left, right, noColor) {
10802
- const colors = noColor ? createColors(false) : pc3;
10803
- const width = 42;
10804
- const count = Math.max(left.length, right.length);
10805
- const rows = [];
10806
- for (let index = 0; index < count; index += 1) {
10807
- const a = left[index] ?? "";
10808
- const b = right[index] ?? "";
10809
- rows.push(`${padVisible(a, width)} ${colors.dim("\u2502")} ${b}`);
10810
- }
10811
- return rows;
10812
- }
10813
- function padVisible(value2, width) {
10814
- const visible = stripAnsi(value2);
10815
- return `${value2}${" ".repeat(Math.max(0, width - visible.length))}`;
10816
- }
10817
- function formatPower(remaining, limit2) {
10818
- if (typeof remaining !== "number" || typeof limit2 !== "number") return "-";
10819
- return `${formatNumber2(remaining)} / ${formatNumber2(limit2)}`;
10820
- }
10821
- function formatNumber2(value2) {
10822
- return new Intl.NumberFormat("tr-TR", { maximumFractionDigits: 2 }).format(value2);
10823
- }
10824
- function safeValue2(value2) {
10825
- const trimmed = value2?.trim();
10826
- return trimmed ? trimmed : "-";
10827
- }
10828
- function truncateMiddle(value2, maxLength) {
10829
- if (value2.length <= maxLength) return value2;
10830
- if (maxLength <= 3) return ".".repeat(maxLength);
10831
- const head = Math.ceil((maxLength - 3) / 2);
10832
- const tail = Math.floor((maxLength - 3) / 2);
10833
- return `${value2.slice(0, head)}...${value2.slice(value2.length - tail)}`;
10834
- }
10835
- function stripAnsi(value2) {
10836
- const escape = String.fromCharCode(27);
10837
- return value2.replace(new RegExp(`${escape}\\[[0-9;]*m`, "g"), "");
10838
- }
10839
-
10840
10848
  // src/app.ts
10841
10849
  async function createProgram(argv = process.argv, dependencies = {}) {
10842
10850
  const config = dependencies.config ?? new FileConfigStore();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aqenta-gateway/cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -39,7 +39,7 @@
39
39
  "tsup": "8.5.0"
40
40
  },
41
41
  "description": "Aqenta Gateway CLI: coding agent, model gateway ve guvenli workspace kontrolu.",
42
- "license": "UNLICENSED",
42
+ "license": "SEE LICENSE IN LICENSE",
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  }