traicebox 0.1.16 → 0.1.18

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.
Files changed (2) hide show
  1. package/dist/index.js +45 -25
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -4914,8 +4914,10 @@ ${cb}` : comment;
4914
4914
  }
4915
4915
  }
4916
4916
  if (afterDoc) {
4917
- Array.prototype.push.apply(doc.errors, this.errors);
4918
- Array.prototype.push.apply(doc.warnings, this.warnings);
4917
+ for (let i = 0;i < this.errors.length; ++i)
4918
+ doc.errors.push(this.errors[i]);
4919
+ for (let i = 0;i < this.warnings.length; ++i)
4920
+ doc.warnings.push(this.warnings[i]);
4919
4921
  } else {
4920
4922
  doc.errors = this.errors;
4921
4923
  doc.warnings = this.warnings;
@@ -5627,7 +5629,7 @@ var require_lexer = __commonJS((exports) => {
5627
5629
  const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
5628
5630
  this.indentNext = this.indentValue + 1;
5629
5631
  this.indentValue += n;
5630
- return yield* this.parseBlockStart();
5632
+ return "block-start";
5631
5633
  }
5632
5634
  return "doc";
5633
5635
  }
@@ -5934,26 +5936,37 @@ var require_lexer = __commonJS((exports) => {
5934
5936
  return 0;
5935
5937
  }
5936
5938
  *pushIndicators() {
5937
- switch (this.charAt(0)) {
5938
- case "!":
5939
- return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
5940
- case "&":
5941
- return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
5942
- case "-":
5943
- case "?":
5944
- case ":": {
5945
- const inFlow = this.flowLevel > 0;
5946
- const ch1 = this.charAt(1);
5947
- if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
5948
- if (!inFlow)
5949
- this.indentNext = this.indentValue + 1;
5950
- else if (this.flowKey)
5951
- this.flowKey = false;
5952
- return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
5939
+ let n = 0;
5940
+ loop:
5941
+ while (true) {
5942
+ switch (this.charAt(0)) {
5943
+ case "!":
5944
+ n += yield* this.pushTag();
5945
+ n += yield* this.pushSpaces(true);
5946
+ continue loop;
5947
+ case "&":
5948
+ n += yield* this.pushUntil(isNotAnchorChar);
5949
+ n += yield* this.pushSpaces(true);
5950
+ continue loop;
5951
+ case "-":
5952
+ case "?":
5953
+ case ":": {
5954
+ const inFlow = this.flowLevel > 0;
5955
+ const ch1 = this.charAt(1);
5956
+ if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
5957
+ if (!inFlow)
5958
+ this.indentNext = this.indentValue + 1;
5959
+ else if (this.flowKey)
5960
+ this.flowKey = false;
5961
+ n += yield* this.pushCount(1);
5962
+ n += yield* this.pushSpaces(true);
5963
+ continue loop;
5964
+ }
5965
+ }
5953
5966
  }
5967
+ break loop;
5954
5968
  }
5955
- }
5956
- return 0;
5969
+ return n;
5957
5970
  }
5958
5971
  *pushTag() {
5959
5972
  if (this.charAt(1) === "<") {
@@ -6107,6 +6120,13 @@ var require_parser = __commonJS((exports) => {
6107
6120
  while (prev[++i]?.type === "space") {}
6108
6121
  return prev.splice(i, prev.length);
6109
6122
  }
6123
+ function arrayPushArray(target, source) {
6124
+ if (source.length < 1e5)
6125
+ Array.prototype.push.apply(target, source);
6126
+ else
6127
+ for (let i = 0;i < source.length; ++i)
6128
+ target.push(source[i]);
6129
+ }
6110
6130
  function fixFlowSeqItems(fc) {
6111
6131
  if (fc.start.type === "flow-seq-start") {
6112
6132
  for (const it of fc.items) {
@@ -6116,11 +6136,11 @@ var require_parser = __commonJS((exports) => {
6116
6136
  delete it.key;
6117
6137
  if (isFlowToken(it.value)) {
6118
6138
  if (it.value.end)
6119
- Array.prototype.push.apply(it.value.end, it.sep);
6139
+ arrayPushArray(it.value.end, it.sep);
6120
6140
  else
6121
6141
  it.value.end = it.sep;
6122
6142
  } else
6123
- Array.prototype.push.apply(it.start, it.sep);
6143
+ arrayPushArray(it.start, it.sep);
6124
6144
  delete it.sep;
6125
6145
  }
6126
6146
  }
@@ -6460,7 +6480,7 @@ var require_parser = __commonJS((exports) => {
6460
6480
  const prev = map.items[map.items.length - 2];
6461
6481
  const end = prev?.value?.end;
6462
6482
  if (Array.isArray(end)) {
6463
- Array.prototype.push.apply(end, it.start);
6483
+ arrayPushArray(end, it.start);
6464
6484
  end.push(this.sourceToken);
6465
6485
  map.items.pop();
6466
6486
  return;
@@ -6648,7 +6668,7 @@ var require_parser = __commonJS((exports) => {
6648
6668
  const prev = seq.items[seq.items.length - 2];
6649
6669
  const end = prev?.value?.end;
6650
6670
  if (Array.isArray(end)) {
6651
- Array.prototype.push.apply(end, it.start);
6671
+ arrayPushArray(end, it.start);
6652
6672
  end.push(this.sourceToken);
6653
6673
  seq.items.pop();
6654
6674
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "traicebox",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "A local developer stack for tracing and session tracking around LLM and AI model workflows",
5
5
  "license": "MIT",
6
6
  "author": "Fardjad Davari <public@fardjad.com>",
@@ -35,7 +35,7 @@
35
35
  "fix": "biome check --write . && dprint fmt"
36
36
  },
37
37
  "devDependencies": {
38
- "@biomejs/biome": "^2.4.14",
38
+ "@biomejs/biome": "^2.4.15",
39
39
  "@types/bun": "^1.3.13",
40
40
  "@types/yargs": "^17.0.35",
41
41
  "dprint": "^0.54.0",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "picospinner": "^3.0.0",
46
- "yaml": "^2.8.4",
46
+ "yaml": "^2.9.0",
47
47
  "yargs": "^18.0.0"
48
48
  }
49
49
  }