@aion0/forge 0.4.0 → 0.4.1

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/RELEASE_NOTES.md CHANGED
@@ -1,8 +1,11 @@
1
- # Forge v0.4.0
1
+ # Forge v0.4.1
2
2
 
3
3
  Released: 2026-03-21
4
4
 
5
- ## Changes since v0.3.7
5
+ ## Changes since v0.4.0
6
6
 
7
+ ### Bug Fixes
8
+ - fix: prevent double console.log wrapping in production mode
7
9
 
8
- **Full Changelog**: https://github.com/aiwatching/forge/compare/v0.3.7...v0.4.0
10
+
11
+ **Full Changelog**: https://github.com/aiwatching/forge/compare/v0.4.0...v0.4.1
@@ -72,14 +72,22 @@ const LOG_FILE = join(DATA_DIR, 'forge.log');
72
72
 
73
73
  process.chdir(ROOT);
74
74
 
75
- // ── Add timestamps to all console output ──
76
- const origLog = console.log;
77
- const origError = console.error;
78
- const origWarn = console.warn;
79
- const ts = () => new Date().toISOString().replace('T', ' ').slice(0, 19);
80
- console.log = (...args) => origLog(`[${ts()}]`, ...args);
81
- console.error = (...args) => origError(`[${ts()}]`, ...args);
82
- console.warn = (...args) => origWarn(`[${ts()}]`, ...args);
75
+ // ── Init logger (timestamps + file output) ──
76
+ try {
77
+ const { initLogger } = await import('../lib/logger.ts');
78
+ initLogger();
79
+ } catch {
80
+ // logger.ts is TypeScript, may not load directly in .mjs — fallback inline
81
+ const _key = Symbol.for('forge-logger-init');
82
+ if (!globalThis[_key]) {
83
+ globalThis[_key] = true;
84
+ const _origLog = console.log, _origErr = console.error, _origWarn = console.warn;
85
+ const _ts = () => new Date().toISOString().replace('T', ' ').slice(0, 19);
86
+ console.log = (...a) => _origLog(`[${_ts()}]`, ...a);
87
+ console.error = (...a) => _origErr(`[${_ts()}]`, ...a);
88
+ console.warn = (...a) => _origWarn(`[${_ts()}]`, ...a);
89
+ }
90
+ }
83
91
 
84
92
  // ── Migrate old layout (~/.forge/*) to new (~/.forge/data/*) ──
85
93
  if (!getArg('--dir')) {
package/lib/logger.ts CHANGED
@@ -7,11 +7,12 @@
7
7
  import { appendFileSync, mkdirSync, existsSync } from 'node:fs';
8
8
  import { join } from 'node:path';
9
9
 
10
- let initialized = false;
10
+ // Use globalThis to prevent double-init across forge-server.mjs and init.ts
11
+ const loggerKey = Symbol.for('forge-logger-init');
11
12
 
12
13
  export function initLogger() {
13
- if (initialized) return;
14
- initialized = true;
14
+ if ((globalThis as any)[loggerKey]) return;
15
+ (globalThis as any)[loggerKey] = true;
15
16
 
16
17
  // Determine log file path
17
18
  let logFile: string | null = null;
package/next-env.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="next" />
2
2
  /// <reference types="next/image-types/global" />
3
- import "./.next/dev/types/routes.d.ts";
3
+ import "./.next/types/routes.d.ts";
4
4
 
5
5
  // NOTE: This file should not be edited
6
6
  // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aion0/forge",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Unified AI workflow platform — multi-model task orchestration, persistent sessions, web terminal, remote access",
5
5
  "type": "module",
6
6
  "scripts": {