panteao-ts 1.1.3 → 1.1.6

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/cjs/index.js CHANGED
@@ -152,12 +152,22 @@ class BdiClient extends events_1.EventEmitter {
152
152
  }
153
153
  const args = [this.project, '--port', String(this.port)];
154
154
  this.process = child_process.spawn(this.binPath, args, { stdio: ["ignore", "pipe", "pipe"] });
155
- this.process.stdout?.on("data", data => {
156
- console.log("\x1b[36m[MAS]\x1b[0m", data.toString().trim());
157
- });
158
- this.process.stderr?.on("data", data => {
159
- console.error("\x1b[31m[MAS ERROR]\x1b[0m", data.toString().trim());
160
- });
155
+ const formatLog = (data) => {
156
+ const lines = data.toString().trim().split('\n');
157
+ for (const line of lines) {
158
+ if (!line.trim())
159
+ continue;
160
+ const match = line.match(/^\[(.*?)\]\s(.*)/);
161
+ if (match) {
162
+ console.log(`\x1b[36m[${match[1]}]\x1b[0m`, match[2]);
163
+ }
164
+ else {
165
+ console.log('\x1b[36m[MAS]\x1b[0m', line);
166
+ }
167
+ }
168
+ };
169
+ this.process.stdout?.on("data", formatLog);
170
+ this.process.stderr?.on("data", formatLog);
161
171
  await new Promise((resolve) => setTimeout(resolve, 800));
162
172
  }
163
173
  else if (this.port === 0) {
package/dist/esm/index.js CHANGED
@@ -116,12 +116,22 @@ export class BdiClient extends EventEmitter {
116
116
  }
117
117
  const args = [this.project, '--port', String(this.port)];
118
118
  this.process = child_process.spawn(this.binPath, args, { stdio: ["ignore", "pipe", "pipe"] });
119
- this.process.stdout?.on("data", data => {
120
- console.log("\x1b[36m[MAS]\x1b[0m", data.toString().trim());
121
- });
122
- this.process.stderr?.on("data", data => {
123
- console.error("\x1b[31m[MAS ERROR]\x1b[0m", data.toString().trim());
124
- });
119
+ const formatLog = (data) => {
120
+ const lines = data.toString().trim().split('\n');
121
+ for (const line of lines) {
122
+ if (!line.trim())
123
+ continue;
124
+ const match = line.match(/^\[(.*?)\]\s(.*)/);
125
+ if (match) {
126
+ console.log(`\x1b[36m[${match[1]}]\x1b[0m`, match[2]);
127
+ }
128
+ else {
129
+ console.log('\x1b[36m[MAS]\x1b[0m', line);
130
+ }
131
+ }
132
+ };
133
+ this.process.stdout?.on("data", formatLog);
134
+ this.process.stderr?.on("data", formatLog);
125
135
  await new Promise((resolve) => setTimeout(resolve, 800));
126
136
  }
127
137
  else if (this.port === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "panteao-ts",
3
- "version": "1.1.3",
3
+ "version": "1.1.6",
4
4
  "description": "TypeScript client for the Panteao BDI agent engine",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",