@suss/extractor 0.4.0 → 0.5.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/dist/index.cjs CHANGED
@@ -260,7 +260,9 @@ function exitKindOfList(stmts) {
260
260
  function chargeBudget(state) {
261
261
  state.pathCount++;
262
262
  if (state.pathCount > MAX_PATHS) {
263
- throw new PathBudgetExceeded();
263
+ throw new PathBudgetExceeded(
264
+ `path budget exceeded, more than ${MAX_PATHS} paths`
265
+ );
264
266
  }
265
267
  }
266
268
  function recordTerminal(ctx, terminal, home, path) {
@@ -451,7 +453,9 @@ function enumerate(ctx, stmts, prefix) {
451
453
  }
452
454
  frontiers = mergeRejoined(nextFrontiers);
453
455
  if (frontiers.length > MAX_PATHS) {
454
- throw new PathBudgetExceeded();
456
+ throw new PathBudgetExceeded(
457
+ `path budget exceeded, more than ${MAX_PATHS} paths`
458
+ );
455
459
  }
456
460
  if (frontiers.length === 0) {
457
461
  break;
@@ -524,7 +528,7 @@ function enumerateOrDegrade(input, terminals) {
524
528
  }
525
529
  function reasonToDegrade(error) {
526
530
  if (error instanceof PathBudgetExceeded) {
527
- return "path budget exceeded";
531
+ return error.message === "" ? "path budget exceeded" : error.message;
528
532
  }
529
533
  if (error instanceof UnmodeledFlow) {
530
534
  return error.message;
package/dist/index.js CHANGED
@@ -218,7 +218,9 @@ function exitKindOfList(stmts) {
218
218
  function chargeBudget(state) {
219
219
  state.pathCount++;
220
220
  if (state.pathCount > MAX_PATHS) {
221
- throw new PathBudgetExceeded();
221
+ throw new PathBudgetExceeded(
222
+ `path budget exceeded, more than ${MAX_PATHS} paths`
223
+ );
222
224
  }
223
225
  }
224
226
  function recordTerminal(ctx, terminal, home, path) {
@@ -409,7 +411,9 @@ function enumerate(ctx, stmts, prefix) {
409
411
  }
410
412
  frontiers = mergeRejoined(nextFrontiers);
411
413
  if (frontiers.length > MAX_PATHS) {
412
- throw new PathBudgetExceeded();
414
+ throw new PathBudgetExceeded(
415
+ `path budget exceeded, more than ${MAX_PATHS} paths`
416
+ );
413
417
  }
414
418
  if (frontiers.length === 0) {
415
419
  break;
@@ -482,7 +486,7 @@ function enumerateOrDegrade(input, terminals) {
482
486
  }
483
487
  function reasonToDegrade(error) {
484
488
  if (error instanceof PathBudgetExceeded) {
485
- return "path budget exceeded";
489
+ return error.message === "" ? "path budget exceeded" : error.message;
486
490
  }
487
491
  if (error instanceof UnmodeledFlow) {
488
492
  return error.message;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suss/extractor",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "description": "Framework-agnostic extraction pipeline that turns raw extractions into suss behavioral summaries.",
6
6
  "keywords": [
@@ -45,7 +45,7 @@
45
45
  "typecheck": "tsc --noEmit"
46
46
  },
47
47
  "dependencies": {
48
- "@suss/behavioral-ir": "0.4.0"
48
+ "@suss/behavioral-ir": "0.5.1"
49
49
  },
50
50
  "devDependencies": {
51
51
  "tsup": "*",