@swarp/cli 0.0.1 → 0.0.2-rc.19

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": "@swarp/cli",
3
- "version": "0.0.1",
3
+ "version": "0.0.2-rc.19",
4
4
  "description": "SWARP agent orchestration platform — CLI, MCP server, generator",
5
5
  "type": "module",
6
6
  "bin": {
@@ -54,7 +54,12 @@ function set_(...items) {
54
54
 
55
55
  function integerFromBuffer(buf) {
56
56
  const b = Buffer.isBuffer(buf) ? buf : Buffer.from(buf);
57
- const prefixed = b[0] & 0x80 ? Buffer.concat([Buffer.from([0x00]), b]) : b;
57
+ // Strip leading zeros DER requires minimal integer encoding
58
+ let start = 0;
59
+ while (start < b.length - 1 && b[start] === 0x00) start++;
60
+ const trimmed = start > 0 ? b.subarray(start) : b;
61
+ // Add padding zero if high bit set (positive integer must not look negative)
62
+ const prefixed = trimmed[0] & 0x80 ? Buffer.concat([Buffer.from([0x00]), trimmed]) : trimmed;
58
63
  return tlv(TAG.INTEGER, prefixed);
59
64
  }
60
65