@bonginkan/maria 4.3.19 → 4.3.21

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/dist/cli.cjs CHANGED
@@ -1704,7 +1704,7 @@ var init_AuthenticationManager = __esm({
1704
1704
  const response = await fetch(`${this.apiBase}/api/user/profile`, {
1705
1705
  headers: {
1706
1706
  "Authorization": `Bearer ${tokens2.accessToken}`,
1707
- "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.19"}`
1707
+ "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.21"}`
1708
1708
  }
1709
1709
  });
1710
1710
  if (response.status === 401) {
@@ -2407,7 +2407,7 @@ async function callApi(path60, init3 = {}) {
2407
2407
  "Authorization": `Bearer ${token}`,
2408
2408
  "X-Device-Id": getDeviceId(),
2409
2409
  "X-Session-Id": getSessionId() || "",
2410
- "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.19"}`,
2410
+ "User-Agent": `maria-cli/${process.env.CLI_VERSION || "4.3.21"}`,
2411
2411
  "Content-Type": init3.headers?.["Content-Type"] || "application/json"
2412
2412
  });
2413
2413
  const doFetch = async (token) => {
@@ -3487,7 +3487,20 @@ var init_logger = __esm({
3487
3487
  console[level](JSON.stringify(payload));
3488
3488
  return;
3489
3489
  }
3490
- console[level](tag, ...args2);
3490
+ const debugMode = process.env.MARIA_DEBUG === "1";
3491
+ const isError = tag.includes("[ERROR]");
3492
+ let outArgs = args2;
3493
+ if (isError && !debugMode) {
3494
+ const filtered = [];
3495
+ for (const a of args2) {
3496
+ const t2 = typeof a;
3497
+ if (a == null || t2 === "string" || t2 === "number" || t2 === "boolean") {
3498
+ filtered.push(a);
3499
+ }
3500
+ }
3501
+ outArgs = filtered;
3502
+ }
3503
+ console[level](tag, ...outArgs);
3491
3504
  }
3492
3505
  debug(...args2) {
3493
3506
  if (this.level <= 0 /* DEBUG */) {
@@ -11899,6 +11912,27 @@ var init_subscription_manager = __esm({
11899
11912
  }
11900
11913
  });
11901
11914
 
11915
+ // src/utils/terminal.ts
11916
+ function clearTerminal() {
11917
+ const stdout2 = process.stdout;
11918
+ if (!stdout2 || !stdout2.isTTY) {
11919
+ console.log("\n".repeat(10));
11920
+ return;
11921
+ }
11922
+ try {
11923
+ stdout2.write("\x1B[2J\x1B[3J\x1B[H");
11924
+ } catch {
11925
+ try {
11926
+ console.clear();
11927
+ } catch {
11928
+ }
11929
+ }
11930
+ }
11931
+ var init_terminal = __esm({
11932
+ "src/utils/terminal.ts"() {
11933
+ }
11934
+ });
11935
+
11902
11936
  // src/slash-commands/categories/conversation/clear.command.ts
11903
11937
  var clear_command_exports = {};
11904
11938
  __export(clear_command_exports, {
@@ -11911,6 +11945,7 @@ var init_clear_command = __esm({
11911
11945
  init_base_command();
11912
11946
  init_telemetry_helper();
11913
11947
  init_subscription_manager();
11948
+ init_terminal();
11914
11949
  ClearCommand = class extends BaseCommand {
11915
11950
  name = "clear";
11916
11951
  category = "conversation";
@@ -11927,7 +11962,7 @@ var init_clear_command = __esm({
11927
11962
  async execute(args2, context2) {
11928
11963
  const startTime = Date.now();
11929
11964
  try {
11930
- process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
11965
+ clearTerminal();
11931
11966
  if (context2.session) {
11932
11967
  if (context2.session.conversationHistory) {
11933
11968
  context2.session.conversationHistory = [];
@@ -11956,7 +11991,7 @@ var init_clear_command = __esm({
11956
11991
  plan: getUserPlan(),
11957
11992
  quotaLeft: context2.quotaLeft || 999
11958
11993
  });
11959
- process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
11994
+ clearTerminal();
11960
11995
  return this.success(chalk40__default.default.green("\u2705 Cleared"));
11961
11996
  }
11962
11997
  }
@@ -16071,8 +16106,8 @@ var require_package = __commonJS({
16071
16106
  "package.json"(exports, module) {
16072
16107
  module.exports = {
16073
16108
  name: "@bonginkan/maria",
16074
- version: "4.3.19",
16075
- description: "\u{1F680} MARIA v4.3.19 - Enterprise AI Development Platform with identity system and character voice implementation. Features 74 production-ready commands with comprehensive fallback implementation, local LLM support, and zero external dependencies. Includes natural language coding, AI safety evaluation, intelligent evolution system, episodic memory with PII masking, and real-time monitoring dashboard. Built with TypeScript AST-powered code generation, OAuth2.0 + PKCE authentication, quantum-resistant cryptography, and enterprise-grade performance.",
16109
+ version: "4.3.21",
16110
+ description: "\u{1F680} MARIA v4.3.21 - Enterprise AI Development Platform with identity system and character voice implementation. Features 74 production-ready commands with comprehensive fallback implementation, local LLM support, and zero external dependencies. Includes natural language coding, AI safety evaluation, intelligent evolution system, episodic memory with PII masking, and real-time monitoring dashboard. Built with TypeScript AST-powered code generation, OAuth2.0 + PKCE authentication, quantum-resistant cryptography, and enterprise-grade performance.",
16076
16111
  keywords: [
16077
16112
  "ai",
16078
16113
  "cli",
@@ -23205,11 +23240,20 @@ var init_image_command = __esm({
23205
23240
  model: cli.model,
23206
23241
  seed: cli.seed
23207
23242
  };
23208
- const apiRes = await callApiJson("/api/v1/image", {
23243
+ const resp = await callApi("/api/v1/image", {
23209
23244
  method: "POST",
23210
23245
  body: JSON.stringify(body),
23211
23246
  headers: { "Content-Type": "application/json" }
23212
23247
  });
23248
+ if (!resp.ok) {
23249
+ const data = await resp.json().catch(() => ({}));
23250
+ const code = data?.error ? String(data.error) : void 0;
23251
+ const msg2 = data?.message ? String(data.message) : `API error: ${resp.status}`;
23252
+ const hint = data?.hint ? String(data.hint) : "";
23253
+ const composed = hint ? `${msg2} (${code || "error"}) \u2014 ${hint}` : code ? `${msg2} (${code})` : msg2;
23254
+ return this.error(composed);
23255
+ }
23256
+ const apiRes = await resp.json();
23213
23257
  const urls = [];
23214
23258
  if (apiRes?.data?.url) urls.push(String(apiRes.data.url));
23215
23259
  const filesInline = apiRes?.data?.filesInline;
@@ -23335,6 +23379,8 @@ var init_image_command = __esm({
23335
23379
  }
23336
23380
  return this.success(msg, void 0, void 0);
23337
23381
  } catch (e2) {
23382
+ const m2 = e2?.message ? String(e2.message) : String(e2);
23383
+ return this.error(m2.startsWith("ERROR:") ? m2 : `ERROR: ${m2}`);
23338
23384
  }
23339
23385
  }
23340
23386
  const res = await runImagePipeline({
@@ -25681,7 +25727,7 @@ var init_about_command = __esm({
25681
25727
  async execute(args2, context2) {
25682
25728
  const output3 = [];
25683
25729
  output3.push("");
25684
- output3.push(chalk40__default.default.cyan.bold("\u{1F916} About MARIA v4.3.19"));
25730
+ output3.push(chalk40__default.default.cyan.bold("\u{1F916} About MARIA v4.3.21"));
25685
25731
  output3.push(chalk40__default.default.gray("\u2550".repeat(40)));
25686
25732
  output3.push("");
25687
25733
  output3.push(chalk40__default.default.white.bold("MARIA - Minimal API, Maximum Power"));
@@ -57547,7 +57593,7 @@ async function handleSlash(input3) {
57547
57593
  const { cmd, args: args2, flags } = parseSlash(input3);
57548
57594
  if (cmd === "clear" || cmd === "cls") {
57549
57595
  try {
57550
- process.stdout.write("\x1Bc");
57596
+ clearTerminal();
57551
57597
  } catch {
57552
57598
  }
57553
57599
  return true;
@@ -57596,6 +57642,7 @@ var init_handle_slash = __esm({
57596
57642
  init_unknown_command();
57597
57643
  init_slash_commands();
57598
57644
  init_cli_auth();
57645
+ init_terminal();
57599
57646
  }
57600
57647
  });
57601
57648
  function formatAnyError(err) {
@@ -71873,6 +71920,7 @@ var init_DisplayManager = __esm({
71873
71920
  "src/services/interactive-session/display/DisplayManager.ts"() {
71874
71921
  init_SpinnerManager();
71875
71922
  init_FormatUtils();
71923
+ init_terminal();
71876
71924
  DisplayManager = class {
71877
71925
  spinnerManager;
71878
71926
  platform;
@@ -71900,15 +71948,7 @@ var init_DisplayManager = __esm({
71900
71948
  * Clear the terminal screen
71901
71949
  */
71902
71950
  clear() {
71903
- if (!this.isTTY) {
71904
- console.log("\n".repeat(10));
71905
- return;
71906
- }
71907
- if (this.isWindows) {
71908
- process.stdout.write("\x1B[2J\x1B[0f");
71909
- } else {
71910
- console.clear();
71911
- }
71951
+ clearTerminal();
71912
71952
  }
71913
71953
  /**
71914
71954
  * Move cursor to position
@@ -72414,6 +72454,7 @@ var init_StatusDisplay = __esm({
72414
72454
  var HelpHandler, ClearHandler, ExitHandler, VersionHandler, HistoryHandler, CoreHandlers;
72415
72455
  var init_CoreHandlers = __esm({
72416
72456
  "src/services/interactive-session/handlers/CoreHandlers.ts"() {
72457
+ init_terminal();
72417
72458
  HelpHandler = class {
72418
72459
  registry;
72419
72460
  constructor(registry) {
@@ -72487,7 +72528,7 @@ Type '/help <command>' for detailed information about a specific command.`
72487
72528
  ClearHandler = class {
72488
72529
  async execute(args2) {
72489
72530
  const startTime = perf_hooks.performance.now();
72490
- process.stdout.write("\x1B[2J\x1B[0f");
72531
+ clearTerminal();
72491
72532
  const processingTime = perf_hooks.performance.now() - startTime;
72492
72533
  return {
72493
72534
  success: true,