@bpinhosilva/agent-orchestrator 1.0.0-alpha.41 → 1.0.0-alpha.42

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [1.0.0-alpha.42](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.41...v1.0.0-alpha.42) (2026-04-17)
2
+
3
+
4
+ ### Features
5
+
6
+ * add early crash detection and log tailing for server process ([b3c7945](https://github.com/bpinhosilva/agent-orchestrator/commit/b3c79454f030845f3056e30f9daab1a7726ce00e))
7
+
1
8
  # [1.0.0-alpha.41](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.40...v1.0.0-alpha.41) (2026-04-17)
2
9
 
3
10
 
@@ -1,6 +1,40 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.registerRunCommand = registerRunCommand;
37
+ const fs = __importStar(require("fs"));
4
38
  const utils_1 = require("../utils");
5
39
  const process_manager_1 = require("../process-manager");
6
40
  const constants_1 = require("../constants");
@@ -12,12 +46,24 @@ const VALID_LOG_LEVELS = [
12
46
  'debug',
13
47
  'verbose',
14
48
  ];
49
+ const EARLY_CRASH_WAIT_MS = 3000;
50
+ const LOG_TAIL_LINES = 20;
51
+ function tailLogFile(logFile, lines) {
52
+ try {
53
+ const content = fs.readFileSync(logFile, 'utf8');
54
+ const allLines = content.split('\n');
55
+ return allLines.slice(-lines).join('\n').trim();
56
+ }
57
+ catch {
58
+ return '';
59
+ }
60
+ }
15
61
  function registerRunCommand(program) {
16
62
  program
17
63
  .command('run')
18
64
  .description('Start the orchestrator server in detached mode')
19
65
  .option('--log-level <level>', 'Set the log level (fatal, error, warn, log, debug, verbose)')
20
- .action((...args) => {
66
+ .action(async (...args) => {
21
67
  try {
22
68
  const options = (0, utils_1.resolveActionOptions)(args);
23
69
  if (options.logLevel) {
@@ -32,6 +78,21 @@ function registerRunCommand(program) {
32
78
  }
33
79
  console.log('Starting Agent Orchestrator in background...');
34
80
  const { pid, host, port } = (0, process_manager_1.startServer)({ logLevel: options.logLevel });
81
+ // Wait briefly and verify the process survived startup
82
+ await new Promise((r) => setTimeout(r, EARLY_CRASH_WAIT_MS));
83
+ const survived = (0, process_manager_1.isManagedProcess)(pid, {
84
+ cwd: constants_1.PACKAGE_ROOT,
85
+ mainPath: constants_1.MAIN_FILE,
86
+ });
87
+ if (!survived) {
88
+ (0, process_manager_1.removeRuntimeState)();
89
+ const tail = tailLogFile(constants_1.LOG_FILE, LOG_TAIL_LINES);
90
+ console.error('Server process exited immediately after starting.' +
91
+ (tail
92
+ ? `\n\nLast log output:\n${tail}`
93
+ : `\nCheck the log file for details: ${constants_1.LOG_FILE}`));
94
+ process.exit(1);
95
+ }
35
96
  console.log(`Orchestrator started in background.\n${(0, process_manager_1.formatProcessSummary)({
36
97
  pid,
37
98
  source: 'metadata',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpinhosilva/agent-orchestrator",
3
- "version": "1.0.0-alpha.41",
3
+ "version": "1.0.0-alpha.42",
4
4
  "description": "An open-source AI agent orchestrator platform built with NestJS.",
5
5
  "author": "bpinhosilva",
6
6
  "license": "MIT",