agentxchain 2.155.39 → 2.155.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentxchain",
3
- "version": "2.155.39",
3
+ "version": "2.155.40",
4
4
  "description": "CLI for AgentXchain — governed multi-agent software delivery",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,8 +8,11 @@ import {
8
8
  formatGovernanceReportText,
9
9
  } from '../lib/report.js';
10
10
 
11
+ // BUG-88: apply bounding to prevent Invalid string length on large accumulated state
12
+ const defaultExportOpts = { maxJsonlEntries: 1000, maxBase64Bytes: 1024 * 1024, maxExportFiles: 500, maxTextDataBytes: 131072 };
13
+
11
14
  function detectAuditKind(cwd) {
12
- const runResult = buildRunExport(cwd);
15
+ const runResult = buildRunExport(cwd, defaultExportOpts);
13
16
  if (runResult.ok) {
14
17
  return {
15
18
  ok: true,
@@ -381,7 +381,8 @@ function assertExpectedWorkloadSignals(workload, metrics) {
381
381
 
382
382
  async function buildAndVerifyRunExport(root) {
383
383
  const { buildRunExport } = await import('../lib/export.js');
384
- const exportResult = buildRunExport(root);
384
+ // BUG-88: apply bounding to prevent Invalid string length on large accumulated state
385
+ const exportResult = buildRunExport(root, { maxJsonlEntries: 1000, maxBase64Bytes: 1024 * 1024, maxExportFiles: 500, maxTextDataBytes: 131072 });
385
386
  if (!exportResult.ok) {
386
387
  return {
387
388
  ok: false,
@@ -28,10 +28,13 @@ export async function exportCommand(options) {
28
28
  const cwd = process.cwd();
29
29
  const kind = detectExportKind(cwd);
30
30
 
31
+ // BUG-88: apply bounding to prevent Invalid string length on large accumulated state
32
+ const defaultExportOpts = { maxJsonlEntries: 1000, maxBase64Bytes: 1024 * 1024, maxExportFiles: 500, maxTextDataBytes: 131072 };
33
+
31
34
  let result;
32
35
  try {
33
36
  if (kind === 'governed') {
34
- result = buildRunExport(cwd);
37
+ result = buildRunExport(cwd, defaultExportOpts);
35
38
  } else if (kind === 'coordinator') {
36
39
  result = buildCoordinatorExport(cwd);
37
40
  } else {
@@ -59,5 +62,22 @@ export async function exportCommand(options) {
59
62
  return;
60
63
  }
61
64
 
62
- console.log(JSON.stringify(result.export, null, 2));
65
+ // BUG-88: compact JSON to avoid string-length overflow on large exports
66
+ try {
67
+ console.log(JSON.stringify(result.export));
68
+ } catch (serializeErr) {
69
+ if (/Invalid string length/i.test(serializeErr.message)) {
70
+ // Retry with tighter bounds
71
+ const tightOpts = { maxJsonlEntries: 500, maxBase64Bytes: 65536, maxExportFiles: 200, maxTextDataBytes: 32768 };
72
+ const tightResult = buildRunExport(cwd, tightOpts);
73
+ if (tightResult.ok) {
74
+ console.log(JSON.stringify(tightResult.export));
75
+ } else {
76
+ console.error(tightResult.error || serializeErr.message);
77
+ process.exitCode = 1;
78
+ }
79
+ } else {
80
+ throw serializeErr;
81
+ }
82
+ }
63
83
  }
package/src/lib/export.js CHANGED
@@ -616,7 +616,7 @@ function buildAggregatedEventsSummary(workspaceRoot, repoEntries) {
616
616
  };
617
617
  }
618
618
 
619
- export function buildCoordinatorExport(startDir = process.cwd()) {
619
+ export function buildCoordinatorExport(startDir = process.cwd(), exportOpts = {}) {
620
620
  const workspaceRoot = resolve(startDir);
621
621
  const configPath = join(workspaceRoot, COORDINATOR_CONFIG_FILE);
622
622
 
@@ -679,7 +679,8 @@ export function buildCoordinatorExport(startDir = process.cwd()) {
679
679
  const resolvedPath = resolve(workspaceRoot, repoPath);
680
680
 
681
681
  try {
682
- const childExport = buildRunExport(resolvedPath);
682
+ // BUG-88: apply bounding to child exports in coordinator workspaces
683
+ const childExport = buildRunExport(resolvedPath, exportOpts);
683
684
  if (childExport.ok) {
684
685
  repos[repoId] = {
685
686
  ok: true,