jsonbit 1.1.1__tar.gz
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.
- jsonbit-1.1.1/.github/ISSUE_TEMPLATE/bug_report.md +20 -0
- jsonbit-1.1.1/.github/ISSUE_TEMPLATE/feature_request.md +12 -0
- jsonbit-1.1.1/.github/PULL_REQUEST_TEMPLATE.md +7 -0
- jsonbit-1.1.1/.github/workflows/ci.yml +69 -0
- jsonbit-1.1.1/.github/workflows/release.yml +295 -0
- jsonbit-1.1.1/.gitignore +20 -0
- jsonbit-1.1.1/.mcp.json +8 -0
- jsonbit-1.1.1/AGENTS.md +28 -0
- jsonbit-1.1.1/CHANGELOG.md +21 -0
- jsonbit-1.1.1/CLAUDE.md +28 -0
- jsonbit-1.1.1/Cargo.lock +137 -0
- jsonbit-1.1.1/Cargo.toml +28 -0
- jsonbit-1.1.1/LICENSE +21 -0
- jsonbit-1.1.1/PKG-INFO +335 -0
- jsonbit-1.1.1/README.md +317 -0
- jsonbit-1.1.1/benchmarks/charts/gemini-accuracy-and-tokens.svg +10 -0
- jsonbit-1.1.1/benchmarks/charts/storage-and-query-speed.svg +10 -0
- jsonbit-1.1.1/benchmarks/charts/token-scaling.svg +11 -0
- jsonbit-1.1.1/benchmarks/data/W1-tiny-api-response.json +28 -0
- jsonbit-1.1.1/benchmarks/data/W10-unicode-financial-ledger.json +1204 -0
- jsonbit-1.1.1/benchmarks/data/W2-singleton-k8s-config.json +23 -0
- jsonbit-1.1.1/benchmarks/data/W3-hr-payroll-directory.json +2004 -0
- jsonbit-1.1.1/benchmarks/data/W4-ecommerce-orders-1toN.json +3868 -0
- jsonbit-1.1.1/benchmarks/data/W5-otel-production-logs.jsonl +300 -0
- jsonbit-1.1.1/benchmarks/data/W6-github-repos-metrics.json +2004 -0
- jsonbit-1.1.1/benchmarks/data/W7-stripe-dispute-webhooks.json +2204 -0
- jsonbit-1.1.1/benchmarks/data/W8-iam-primitive-arrays.json +1395 -0
- jsonbit-1.1.1/benchmarks/data/W9-wide-enterprise-crm.json +4804 -0
- jsonbit-1.1.1/benchmarks/data/github-repos.json +1302 -0
- jsonbit-1.1.1/benchmarks/datasets/real-world-workloads.ts +763 -0
- jsonbit-1.1.1/benchmarks/results/opencode-benchmark-results.json +301 -0
- jsonbit-1.1.1/benchmarks/results/pure-rust-benchmark-results.json +816 -0
- jsonbit-1.1.1/benchmarks/run-full-rust-benchmark.ts +1185 -0
- jsonbit-1.1.1/benchmarks/run-opencode-agent-bench.ts +313 -0
- jsonbit-1.1.1/benchmarks/rust-bench.ts +133 -0
- jsonbit-1.1.1/benchmarks/stress-test-all-cases.ts +476 -0
- jsonbit-1.1.1/benchmarks/toon-suite/constants.ts +143 -0
- jsonbit-1.1.1/benchmarks/toon-suite/datasets.ts +817 -0
- jsonbit-1.1.1/benchmarks/toon-suite/evaluate.ts +95 -0
- jsonbit-1.1.1/benchmarks/toon-suite/formats.ts +143 -0
- jsonbit-1.1.1/benchmarks/toon-suite/normalize.ts +358 -0
- jsonbit-1.1.1/benchmarks/toon-suite/questions/analytics.ts +212 -0
- jsonbit-1.1.1/benchmarks/toon-suite/questions/event-logs.ts +204 -0
- jsonbit-1.1.1/benchmarks/toon-suite/questions/github.ts +199 -0
- jsonbit-1.1.1/benchmarks/toon-suite/questions/index.ts +57 -0
- jsonbit-1.1.1/benchmarks/toon-suite/questions/keyed.ts +98 -0
- jsonbit-1.1.1/benchmarks/toon-suite/questions/nested-config.ts +287 -0
- jsonbit-1.1.1/benchmarks/toon-suite/questions/nested-group.ts +121 -0
- jsonbit-1.1.1/benchmarks/toon-suite/questions/nested.ts +221 -0
- jsonbit-1.1.1/benchmarks/toon-suite/questions/structural-validation.ts +45 -0
- jsonbit-1.1.1/benchmarks/toon-suite/questions/structure.ts +370 -0
- jsonbit-1.1.1/benchmarks/toon-suite/questions/tabular.ts +206 -0
- jsonbit-1.1.1/benchmarks/toon-suite/questions/utils.ts +92 -0
- jsonbit-1.1.1/benchmarks/toon-suite/report.ts +553 -0
- jsonbit-1.1.1/benchmarks/toon-suite/storage.ts +40 -0
- jsonbit-1.1.1/benchmarks/toon-suite/structural-corruption.ts +305 -0
- jsonbit-1.1.1/benchmarks/toon-suite/types.ts +88 -0
- jsonbit-1.1.1/benchmarks/toon-suite/utils.ts +77 -0
- jsonbit-1.1.1/bin/jsonbit.js +45 -0
- jsonbit-1.1.1/opencode.json +13 -0
- jsonbit-1.1.1/package-lock.json +1174 -0
- jsonbit-1.1.1/package.json +54 -0
- jsonbit-1.1.1/pyproject.toml +29 -0
- jsonbit-1.1.1/python/jsonbit/__init__.py +115 -0
- jsonbit-1.1.1/rust/bitmap.rs +125 -0
- jsonbit-1.1.1/rust/column.rs +779 -0
- jsonbit-1.1.1/rust/engine.rs +1539 -0
- jsonbit-1.1.1/rust/lib.rs +149 -0
- jsonbit-1.1.1/rust/main.rs +254 -0
- jsonbit-1.1.1/rust/mcp.rs +279 -0
- jsonbit-1.1.1/rust/normalizer.rs +679 -0
- jsonbit-1.1.1/rust/query_exec.rs +943 -0
- jsonbit-1.1.1/rust/snapshot.rs +452 -0
- jsonbit-1.1.1/scripts/install-binary.mjs +86 -0
- jsonbit-1.1.1/src/index.ts +128 -0
- jsonbit-1.1.1/src/types.ts +94 -0
- jsonbit-1.1.1/test/jsonbit.test.ts +188 -0
- jsonbit-1.1.1/tsconfig.json +13 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Report a bug in jsonbit (Rust engine, CLI, MCP server, or SDKs)
|
|
4
|
+
title: "[Bug]: "
|
|
5
|
+
labels: bug
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
### Description
|
|
9
|
+
A clear description of what went wrong.
|
|
10
|
+
|
|
11
|
+
### Reproduction
|
|
12
|
+
- **Input file / minimal JSON snippet:**
|
|
13
|
+
- **Command or SQL query:**
|
|
14
|
+
- **Expected output:**
|
|
15
|
+
- **Actual output:**
|
|
16
|
+
|
|
17
|
+
### Environment
|
|
18
|
+
- `jsonbit --version`:
|
|
19
|
+
- OS & Architecture:
|
|
20
|
+
- Client (CLI / OpenCode / Claude Code / Python / TypeScript):
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an enhancement or new SQL / MCP / SDK capability
|
|
4
|
+
title: "[Feature]: "
|
|
5
|
+
labels: enhancement
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
### Problem / Use Case
|
|
9
|
+
What problem does this solve?
|
|
10
|
+
|
|
11
|
+
### Proposed Solution
|
|
12
|
+
Describe the desired CLI flag, SQL feature, MCP tool, or SDK API.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
Briefly describe what this PR changes and why.
|
|
3
|
+
|
|
4
|
+
## Verification
|
|
5
|
+
- [ ] `cargo build --release && cargo test --release` passes with 0 warnings
|
|
6
|
+
- [ ] `npx tsc --noEmit && npm test` passes
|
|
7
|
+
- [ ] Lossless 3NF round-trip verified (if touching normalizer, columns, or `.jsonbit` snapshot)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
name: Build & Test (${{ matrix.os }})
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
os: [ubuntu-latest, macos-latest]
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout repository
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Install Rust toolchain
|
|
26
|
+
uses: dtolnay/rust-toolchain@stable
|
|
27
|
+
|
|
28
|
+
- name: Cache Cargo registry & build
|
|
29
|
+
uses: Swatinem/rust-cache@v2
|
|
30
|
+
|
|
31
|
+
- name: Build release binary & run Rust unit tests
|
|
32
|
+
run: |
|
|
33
|
+
cargo build --release --locked
|
|
34
|
+
cargo test --release --locked
|
|
35
|
+
./target/release/jsonbit --version
|
|
36
|
+
|
|
37
|
+
- name: Setup Node.js
|
|
38
|
+
uses: actions/setup-node@v4
|
|
39
|
+
with:
|
|
40
|
+
node-version: "22"
|
|
41
|
+
cache: npm
|
|
42
|
+
|
|
43
|
+
- name: Install Node dependencies & run TypeScript + Vitest checks
|
|
44
|
+
run: |
|
|
45
|
+
npm ci
|
|
46
|
+
npx tsc --noEmit
|
|
47
|
+
npm test
|
|
48
|
+
|
|
49
|
+
- name: Setup Python & verify Python SDK
|
|
50
|
+
uses: actions/setup-python@v5
|
|
51
|
+
with:
|
|
52
|
+
python-version: "3.12"
|
|
53
|
+
|
|
54
|
+
- name: Smoke test Python SDK & MCP server
|
|
55
|
+
run: |
|
|
56
|
+
python3 -B -c '
|
|
57
|
+
import json, subprocess
|
|
58
|
+
from python.jsonbit import JsonBit
|
|
59
|
+
with JsonBit("benchmarks/data/github-repos.json") as olap:
|
|
60
|
+
assert olap.answer("How many repositories have more than 150000 stars and more than 30000 forks?") == "31"
|
|
61
|
+
assert len(olap.sql("SELECT defaultBranch, COUNT(*) AS cnt FROM records GROUP BY defaultBranch")) > 0
|
|
62
|
+
proc = subprocess.run(
|
|
63
|
+
["./target/release/jsonbit", "mcp"],
|
|
64
|
+
input="{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"ping\"}\n",
|
|
65
|
+
capture_output=True, text=True, check=True,
|
|
66
|
+
)
|
|
67
|
+
assert json.loads(proc.stdout.strip()) == {"jsonrpc": "2.0", "id": 1, "result": {}}
|
|
68
|
+
print("Python SDK & MCP ping OK")
|
|
69
|
+
'
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
bump:
|
|
7
|
+
description: "Version bump (patch: 1.0.x, minor: 1.x.0, major: x.0.0, current: release current version)"
|
|
8
|
+
required: true
|
|
9
|
+
default: "patch"
|
|
10
|
+
type: choice
|
|
11
|
+
options:
|
|
12
|
+
- patch
|
|
13
|
+
- minor
|
|
14
|
+
- major
|
|
15
|
+
- current
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
contents: write
|
|
19
|
+
id-token: write
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
bump-and-tag:
|
|
23
|
+
name: Bump Version & Create Tag
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
outputs:
|
|
26
|
+
tag_name: ${{ steps.bump.outputs.tag_name }}
|
|
27
|
+
version: ${{ steps.bump.outputs.version }}
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 0
|
|
32
|
+
|
|
33
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
34
|
+
|
|
35
|
+
- uses: actions/setup-node@v4
|
|
36
|
+
with:
|
|
37
|
+
node-version: "22"
|
|
38
|
+
|
|
39
|
+
- name: Compute & apply version bump
|
|
40
|
+
id: bump
|
|
41
|
+
env:
|
|
42
|
+
BUMP: ${{ github.event.inputs.bump }}
|
|
43
|
+
run: |
|
|
44
|
+
node -e '
|
|
45
|
+
const fs = require("fs");
|
|
46
|
+
const pkg = JSON.parse(fs.readFileSync("package.json", "utf8"));
|
|
47
|
+
let [maj, min, pat] = pkg.version.split(".").map(Number);
|
|
48
|
+
const bump = process.env.BUMP;
|
|
49
|
+
if (bump === "major") { maj += 1; min = 0; pat = 0; }
|
|
50
|
+
else if (bump === "minor") { min += 1; pat = 0; }
|
|
51
|
+
else if (bump === "patch") { pat += 1; }
|
|
52
|
+
const next = `${maj}.${min}.${pat}`;
|
|
53
|
+
|
|
54
|
+
if (bump !== "current") {
|
|
55
|
+
pkg.version = next;
|
|
56
|
+
fs.writeFileSync("package.json", JSON.stringify(pkg, null, 2) + "\n");
|
|
57
|
+
|
|
58
|
+
const lock = JSON.parse(fs.readFileSync("package-lock.json", "utf8"));
|
|
59
|
+
lock.version = next;
|
|
60
|
+
if (lock.packages && lock.packages[""]) lock.packages[""].version = next;
|
|
61
|
+
fs.writeFileSync("package-lock.json", JSON.stringify(lock, null, 2) + "\n");
|
|
62
|
+
|
|
63
|
+
const cargo = fs.readFileSync("Cargo.toml", "utf8")
|
|
64
|
+
.replace(/^version = "[^"]+"/m, `version = "${next}"`);
|
|
65
|
+
fs.writeFileSync("Cargo.toml", cargo);
|
|
66
|
+
|
|
67
|
+
const py = fs.readFileSync("pyproject.toml", "utf8")
|
|
68
|
+
.replace(/^version = "[^"]+"/m, `version = "${next}"`);
|
|
69
|
+
fs.writeFileSync("pyproject.toml", py);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
fs.appendFileSync(process.env.GITHUB_OUTPUT, `version=${next}\ntag_name=v${next}\n`);
|
|
73
|
+
console.log(`Release version: v${next}`);
|
|
74
|
+
'
|
|
75
|
+
|
|
76
|
+
- name: Sync Cargo.lock & push release tag
|
|
77
|
+
env:
|
|
78
|
+
TAG: ${{ steps.bump.outputs.tag_name }}
|
|
79
|
+
VER: ${{ steps.bump.outputs.version }}
|
|
80
|
+
run: |
|
|
81
|
+
cargo update --workspace --offline || cargo generate-lockfile
|
|
82
|
+
git config user.name "github-actions[bot]"
|
|
83
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
84
|
+
if ! git diff --quiet; then
|
|
85
|
+
git add Cargo.toml Cargo.lock package.json package-lock.json pyproject.toml
|
|
86
|
+
git commit -m "chore(release): ${TAG}"
|
|
87
|
+
git push origin HEAD:main
|
|
88
|
+
fi
|
|
89
|
+
git tag -f "${TAG}"
|
|
90
|
+
git push -f origin "${TAG}"
|
|
91
|
+
|
|
92
|
+
build-binaries:
|
|
93
|
+
name: Build Native Binary (${{ matrix.asset }})
|
|
94
|
+
needs: [bump-and-tag]
|
|
95
|
+
runs-on: ${{ matrix.os }}
|
|
96
|
+
strategy:
|
|
97
|
+
fail-fast: false
|
|
98
|
+
matrix:
|
|
99
|
+
include:
|
|
100
|
+
- os: ubuntu-latest
|
|
101
|
+
target: x86_64-unknown-linux-gnu
|
|
102
|
+
asset: jsonbit-linux-x64
|
|
103
|
+
ext: tar.gz
|
|
104
|
+
- os: ubuntu-24.04-arm
|
|
105
|
+
target: aarch64-unknown-linux-gnu
|
|
106
|
+
asset: jsonbit-linux-arm64
|
|
107
|
+
ext: tar.gz
|
|
108
|
+
- os: macos-15
|
|
109
|
+
target: aarch64-apple-darwin
|
|
110
|
+
asset: jsonbit-darwin-arm64
|
|
111
|
+
ext: tar.gz
|
|
112
|
+
- os: macos-15-intel
|
|
113
|
+
target: x86_64-apple-darwin
|
|
114
|
+
asset: jsonbit-darwin-x64
|
|
115
|
+
ext: tar.gz
|
|
116
|
+
- os: windows-latest
|
|
117
|
+
target: x86_64-pc-windows-msvc
|
|
118
|
+
asset: jsonbit-win32-x64
|
|
119
|
+
ext: zip
|
|
120
|
+
|
|
121
|
+
steps:
|
|
122
|
+
- uses: actions/checkout@v4
|
|
123
|
+
with:
|
|
124
|
+
ref: ${{ needs.bump-and-tag.outputs.tag_name }}
|
|
125
|
+
|
|
126
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
127
|
+
with:
|
|
128
|
+
targets: ${{ matrix.target }}
|
|
129
|
+
|
|
130
|
+
- uses: Swatinem/rust-cache@v2
|
|
131
|
+
|
|
132
|
+
- name: Build release binary
|
|
133
|
+
run: cargo build --release --locked --target ${{ matrix.target }}
|
|
134
|
+
|
|
135
|
+
- name: Package Unix binary
|
|
136
|
+
if: runner.os != 'Windows'
|
|
137
|
+
run: |
|
|
138
|
+
mkdir -p dist
|
|
139
|
+
tar -C target/${{ matrix.target }}/release -czf dist/${{ matrix.asset }}.tar.gz jsonbit
|
|
140
|
+
|
|
141
|
+
- name: Package Windows binary
|
|
142
|
+
if: runner.os == 'Windows'
|
|
143
|
+
shell: pwsh
|
|
144
|
+
run: |
|
|
145
|
+
New-Item -ItemType Directory -Force -Path dist | Out-Null
|
|
146
|
+
Compress-Archive -Path target/${{ matrix.target }}/release/jsonbit.exe -DestinationPath dist/${{ matrix.asset }}.zip
|
|
147
|
+
|
|
148
|
+
- uses: actions/upload-artifact@v4
|
|
149
|
+
with:
|
|
150
|
+
name: ${{ matrix.asset }}
|
|
151
|
+
path: dist/*
|
|
152
|
+
|
|
153
|
+
github-release:
|
|
154
|
+
name: Create GitHub Release
|
|
155
|
+
needs: [bump-and-tag, build-binaries]
|
|
156
|
+
runs-on: ubuntu-latest
|
|
157
|
+
steps:
|
|
158
|
+
- uses: actions/download-artifact@v4
|
|
159
|
+
with:
|
|
160
|
+
path: dist
|
|
161
|
+
merge-multiple: true
|
|
162
|
+
|
|
163
|
+
- name: Generate SHA256SUMS
|
|
164
|
+
working-directory: dist
|
|
165
|
+
run: sha256sum jsonbit-* > SHA256SUMS.txt
|
|
166
|
+
|
|
167
|
+
- name: Publish GitHub Release
|
|
168
|
+
uses: softprops/action-gh-release@v2
|
|
169
|
+
with:
|
|
170
|
+
tag_name: ${{ needs.bump-and-tag.outputs.tag_name }}
|
|
171
|
+
generate_release_notes: true
|
|
172
|
+
files: dist/*
|
|
173
|
+
|
|
174
|
+
pypi-wheels:
|
|
175
|
+
name: Build Python Wheels (${{ matrix.target }})
|
|
176
|
+
needs: [bump-and-tag]
|
|
177
|
+
runs-on: ${{ matrix.os }}
|
|
178
|
+
strategy:
|
|
179
|
+
fail-fast: false
|
|
180
|
+
matrix:
|
|
181
|
+
include:
|
|
182
|
+
- os: ubuntu-latest
|
|
183
|
+
target: x86_64
|
|
184
|
+
manylinux: auto
|
|
185
|
+
- os: ubuntu-24.04-arm
|
|
186
|
+
target: aarch64
|
|
187
|
+
manylinux: auto
|
|
188
|
+
- os: macos-15
|
|
189
|
+
target: aarch64
|
|
190
|
+
manylinux: ""
|
|
191
|
+
- os: macos-15-intel
|
|
192
|
+
target: x86_64
|
|
193
|
+
manylinux: ""
|
|
194
|
+
- os: windows-latest
|
|
195
|
+
target: x64
|
|
196
|
+
manylinux: ""
|
|
197
|
+
|
|
198
|
+
steps:
|
|
199
|
+
- uses: actions/checkout@v4
|
|
200
|
+
with:
|
|
201
|
+
ref: ${{ needs.bump-and-tag.outputs.tag_name }}
|
|
202
|
+
|
|
203
|
+
- name: Build wheel with maturin
|
|
204
|
+
uses: PyO3/maturin-action@v1
|
|
205
|
+
with:
|
|
206
|
+
target: ${{ matrix.target }}
|
|
207
|
+
args: --release --out dist
|
|
208
|
+
manylinux: ${{ matrix.manylinux }}
|
|
209
|
+
|
|
210
|
+
- uses: actions/upload-artifact@v4
|
|
211
|
+
with:
|
|
212
|
+
name: wheels-${{ matrix.os }}-${{ matrix.target }}
|
|
213
|
+
path: dist
|
|
214
|
+
|
|
215
|
+
pypi-sdist:
|
|
216
|
+
name: Build Python sdist
|
|
217
|
+
needs: [bump-and-tag]
|
|
218
|
+
runs-on: ubuntu-latest
|
|
219
|
+
steps:
|
|
220
|
+
- uses: actions/checkout@v4
|
|
221
|
+
with:
|
|
222
|
+
ref: ${{ needs.bump-and-tag.outputs.tag_name }}
|
|
223
|
+
- uses: PyO3/maturin-action@v1
|
|
224
|
+
with:
|
|
225
|
+
command: sdist
|
|
226
|
+
args: --out dist
|
|
227
|
+
- uses: actions/upload-artifact@v4
|
|
228
|
+
with:
|
|
229
|
+
name: wheels-sdist
|
|
230
|
+
path: dist
|
|
231
|
+
|
|
232
|
+
publish-pypi:
|
|
233
|
+
name: Publish to PyPI
|
|
234
|
+
needs: [bump-and-tag, pypi-wheels, pypi-sdist]
|
|
235
|
+
runs-on: ubuntu-latest
|
|
236
|
+
environment:
|
|
237
|
+
name: pypi
|
|
238
|
+
url: https://pypi.org/p/jsonbit
|
|
239
|
+
steps:
|
|
240
|
+
- uses: actions/download-artifact@v4
|
|
241
|
+
with:
|
|
242
|
+
pattern: wheels-*
|
|
243
|
+
path: dist
|
|
244
|
+
merge-multiple: true
|
|
245
|
+
- name: Publish to PyPI (Trusted Publishing)
|
|
246
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
247
|
+
with:
|
|
248
|
+
packages-dir: dist
|
|
249
|
+
|
|
250
|
+
publish-crates:
|
|
251
|
+
name: Publish to crates.io
|
|
252
|
+
needs: [bump-and-tag, github-release]
|
|
253
|
+
runs-on: ubuntu-latest
|
|
254
|
+
steps:
|
|
255
|
+
- name: Check crates.io token
|
|
256
|
+
id: check
|
|
257
|
+
env:
|
|
258
|
+
TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
259
|
+
run: echo "enabled=$([ -n "$TOKEN" ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
|
|
260
|
+
- uses: actions/checkout@v4
|
|
261
|
+
if: steps.check.outputs.enabled == 'true'
|
|
262
|
+
with:
|
|
263
|
+
ref: ${{ needs.bump-and-tag.outputs.tag_name }}
|
|
264
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
265
|
+
if: steps.check.outputs.enabled == 'true'
|
|
266
|
+
- name: Publish crate
|
|
267
|
+
if: steps.check.outputs.enabled == 'true'
|
|
268
|
+
env:
|
|
269
|
+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
270
|
+
run: cargo publish --locked
|
|
271
|
+
|
|
272
|
+
publish-npm:
|
|
273
|
+
name: Publish @jsonbit/core to npm
|
|
274
|
+
needs: [bump-and-tag, github-release]
|
|
275
|
+
runs-on: ubuntu-latest
|
|
276
|
+
steps:
|
|
277
|
+
- name: Check npm token
|
|
278
|
+
id: check
|
|
279
|
+
env:
|
|
280
|
+
TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
281
|
+
run: echo "enabled=$([ -n "$TOKEN" ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
|
|
282
|
+
- uses: actions/checkout@v4
|
|
283
|
+
if: steps.check.outputs.enabled == 'true'
|
|
284
|
+
with:
|
|
285
|
+
ref: ${{ needs.bump-and-tag.outputs.tag_name }}
|
|
286
|
+
- uses: actions/setup-node@v4
|
|
287
|
+
if: steps.check.outputs.enabled == 'true'
|
|
288
|
+
with:
|
|
289
|
+
node-version: "22"
|
|
290
|
+
registry-url: "https://registry.npmjs.org"
|
|
291
|
+
- name: Publish to npm
|
|
292
|
+
if: steps.check.outputs.enabled == 'true'
|
|
293
|
+
env:
|
|
294
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
295
|
+
run: npm publish --access public --provenance
|
jsonbit-1.1.1/.gitignore
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Rust build artifacts
|
|
2
|
+
/target/
|
|
3
|
+
**/*.rs.bk
|
|
4
|
+
|
|
5
|
+
# Node / TypeScript
|
|
6
|
+
/node_modules/
|
|
7
|
+
/dist/
|
|
8
|
+
/vendor/
|
|
9
|
+
|
|
10
|
+
# Python
|
|
11
|
+
__pycache__/
|
|
12
|
+
*.py[cod]
|
|
13
|
+
*.egg-info/
|
|
14
|
+
.venv/
|
|
15
|
+
/wheels/
|
|
16
|
+
|
|
17
|
+
# Temporary test & snapshot files
|
|
18
|
+
*.jsonbit
|
|
19
|
+
benchmarks/.tmp*/
|
|
20
|
+
.DS_Store
|
jsonbit-1.1.1/.mcp.json
ADDED
jsonbit-1.1.1/AGENTS.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Agent Instructions for `jsonbit` (Claude Code, Codex, Cursor, Windsurf)
|
|
2
|
+
|
|
3
|
+
Whenever you need to inspect, analyze, filter, aggregate, or query any `.json`, `.jsonl`, or `.jsonbit` file larger than 2 KB, **NEVER dump the raw JSON file into context**. Instead, use `jsonbit` (via MCP tools or the native Rust CLI) to save **96%+ of tokens** and get **100% exact mathematical answers in ~6 microseconds**:
|
|
4
|
+
|
|
5
|
+
## 1. MCP Tools (Automatically Mounted via `.mcp.json` / `opencode.json`)
|
|
6
|
+
- `olap_load({ filePath })`: Normalizes any nested JSON/JSONL file into Pure-Rust 3NF Bit-Packed Columnar tables and returns a ~250-token Semantic Cube Card.
|
|
7
|
+
- `olap_digest({ filePath })`: Generates a 1-Turn Factorized 3NF Holistic Digest (100% of rows + pivot legend) for qualitative/narrative summaries.
|
|
8
|
+
- `olap_ask({ filePath, question })`: Executes natural-language lookups, aggregations, multi-condition filters, and 1-to-Many CSR joins on `BitVec64` indices.
|
|
9
|
+
- `olap_sql({ filePath, sql })`: Executes read-only `SELECT ... WHERE ... GROUP BY ... ORDER BY ... LIMIT ...` queries directly on the Rust Bit-Packed store (supports JSON dot-paths like `customer.name` and `error.retryable`).
|
|
10
|
+
- `olap_rehydrate({ alias })`: Reconstructs the exact nested JSON document from the 3NF tables.
|
|
11
|
+
|
|
12
|
+
## 2. Direct Rust CLI Usage (For Codex / Bash Tool Agents)
|
|
13
|
+
```bash
|
|
14
|
+
# 1. Inspect 3NF Cube Card (~250 tokens instead of 150,000 tokens)
|
|
15
|
+
./target/release/jsonbit card <file.json|.jsonl|.jsonbit>
|
|
16
|
+
|
|
17
|
+
# 2. Emit 1-Turn Factorized Holistic Digest (100% of rows, ~40-70% smaller than TOON)
|
|
18
|
+
./target/release/jsonbit digest <file.json|.jsonl|.jsonbit>
|
|
19
|
+
|
|
20
|
+
# 3. Ask an analytical / filter question in ~15 µs
|
|
21
|
+
./target/release/jsonbit ask <file.json|.jsonl|.jsonbit> "How many log entries for /api/users have status >= 500?"
|
|
22
|
+
|
|
23
|
+
# 4. Execute deterministic SQL directly on Rust Bit-Packed columns
|
|
24
|
+
./target/release/jsonbit sql <file.json|.jsonl|.jsonbit> "SELECT endpoint, COUNT(*) AS cnt FROM records WHERE statusCode >= 500 GROUP BY endpoint"
|
|
25
|
+
|
|
26
|
+
# 5. Pack JSON into a compact binary .jsonbit file
|
|
27
|
+
./target/release/jsonbit pack input.json output.jsonbit
|
|
28
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [1.1.1](https://github.com/prathikmurugan/jsonbit/compare/v1.1.0...v1.1.1) (2026-11-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **python:** package python/jsonbit/__init__.py for maturin wheels ([ada1e17](https://github.com/prathikmurugan/jsonbit/commit/ada1e17d2e35bb924675c8b6d78a13b859c4e3a8))
|
|
9
|
+
|
|
10
|
+
## [1.1.0](https://github.com/prathikmurugan/jsonbit/compare/v1.0.0...v1.1.0) (2026-11-20)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* finalize jsonbit v1.0.0 engine, MCP server, benchmarks, and CI/CD ([2849976](https://github.com/prathikmurugan/jsonbit/commit/28499760e8357ab3bfb1536f4d73826a068893d9))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **ci:** check publish tokens at step level in release workflow ([875d707](https://github.com/prathikmurugan/jsonbit/commit/875d70791afa0339803a139d73f52668e9f03022))
|
|
21
|
+
* **ci:** pin vitest 3.x and regenerate clean package-lock.json ([55bff1f](https://github.com/prathikmurugan/jsonbit/commit/55bff1f682408d2c24496989151c889f3a553a2d))
|
jsonbit-1.1.1/CLAUDE.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Agent Instructions for `jsonbit` (Claude Code, Codex, Cursor, Windsurf)
|
|
2
|
+
|
|
3
|
+
Whenever you need to inspect, analyze, filter, aggregate, or query any `.json`, `.jsonl`, or `.jsonbit` file larger than 2 KB, **NEVER dump the raw JSON file into context**. Instead, use `jsonbit` (via MCP tools or the native Rust CLI) to save **96%+ of tokens** and get **100% exact mathematical answers in ~6 microseconds**:
|
|
4
|
+
|
|
5
|
+
## 1. MCP Tools (Automatically Mounted via `.mcp.json` / `opencode.json`)
|
|
6
|
+
- `olap_load({ filePath })`: Normalizes any nested JSON/JSONL file into Pure-Rust 3NF Bit-Packed Columnar tables and returns a ~250-token Semantic Cube Card.
|
|
7
|
+
- `olap_digest({ filePath })`: Generates a 1-Turn Factorized 3NF Holistic Digest (100% of rows + pivot legend) for qualitative/narrative summaries.
|
|
8
|
+
- `olap_ask({ filePath, question })`: Executes natural-language lookups, aggregations, multi-condition filters, and 1-to-Many CSR joins on `BitVec64` indices.
|
|
9
|
+
- `olap_sql({ filePath, sql })`: Executes read-only `SELECT ... WHERE ... GROUP BY ... ORDER BY ... LIMIT ...` queries directly on the Rust Bit-Packed store (supports JSON dot-paths like `customer.name` and `error.retryable`).
|
|
10
|
+
- `olap_rehydrate({ alias })`: Reconstructs the exact nested JSON document from the 3NF tables.
|
|
11
|
+
|
|
12
|
+
## 2. Direct Rust CLI Usage (For Codex / Bash Tool Agents)
|
|
13
|
+
```bash
|
|
14
|
+
# 1. Inspect 3NF Cube Card (~250 tokens instead of 150,000 tokens)
|
|
15
|
+
./target/release/jsonbit card <file.json|.jsonl|.jsonbit>
|
|
16
|
+
|
|
17
|
+
# 2. Emit 1-Turn Factorized Holistic Digest (100% of rows, ~40-70% smaller than TOON)
|
|
18
|
+
./target/release/jsonbit digest <file.json|.jsonl|.jsonbit>
|
|
19
|
+
|
|
20
|
+
# 3. Ask an analytical / filter question in ~15 µs
|
|
21
|
+
./target/release/jsonbit ask <file.json|.jsonl|.jsonbit> "How many log entries for /api/users have status >= 500?"
|
|
22
|
+
|
|
23
|
+
# 4. Execute deterministic SQL directly on Rust Bit-Packed columns
|
|
24
|
+
./target/release/jsonbit sql <file.json|.jsonl|.jsonbit> "SELECT endpoint, COUNT(*) AS cnt FROM records WHERE statusCode >= 500 GROUP BY endpoint"
|
|
25
|
+
|
|
26
|
+
# 5. Pack JSON into a compact binary .jsonbit file
|
|
27
|
+
./target/release/jsonbit pack input.json output.jsonbit
|
|
28
|
+
```
|
jsonbit-1.1.1/Cargo.lock
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "equivalent"
|
|
7
|
+
version = "1.0.3"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "foldhash"
|
|
13
|
+
version = "0.2.0"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
|
|
16
|
+
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "hashbrown"
|
|
19
|
+
version = "0.17.1"
|
|
20
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
21
|
+
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
|
|
22
|
+
|
|
23
|
+
[[package]]
|
|
24
|
+
name = "indexmap"
|
|
25
|
+
version = "2.14.2"
|
|
26
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
|
+
checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"
|
|
28
|
+
dependencies = [
|
|
29
|
+
"equivalent",
|
|
30
|
+
"hashbrown",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[[package]]
|
|
34
|
+
name = "itoa"
|
|
35
|
+
version = "1.0.19"
|
|
36
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
37
|
+
checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4"
|
|
38
|
+
|
|
39
|
+
[[package]]
|
|
40
|
+
name = "jsonbit"
|
|
41
|
+
version = "1.1.1"
|
|
42
|
+
dependencies = [
|
|
43
|
+
"serde",
|
|
44
|
+
"serde_json",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[[package]]
|
|
48
|
+
name = "memchr"
|
|
49
|
+
version = "2.8.3"
|
|
50
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
51
|
+
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
52
|
+
|
|
53
|
+
[[package]]
|
|
54
|
+
name = "proc-macro2"
|
|
55
|
+
version = "1.0.107"
|
|
56
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
57
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
58
|
+
dependencies = [
|
|
59
|
+
"unicode-ident",
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
[[package]]
|
|
63
|
+
name = "quote"
|
|
64
|
+
version = "1.0.47"
|
|
65
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
66
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
67
|
+
dependencies = [
|
|
68
|
+
"proc-macro2",
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
[[package]]
|
|
72
|
+
name = "serde"
|
|
73
|
+
version = "1.0.229"
|
|
74
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
75
|
+
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
|
|
76
|
+
dependencies = [
|
|
77
|
+
"serde_core",
|
|
78
|
+
"serde_derive",
|
|
79
|
+
]
|
|
80
|
+
|
|
81
|
+
[[package]]
|
|
82
|
+
name = "serde_core"
|
|
83
|
+
version = "1.0.229"
|
|
84
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
85
|
+
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
|
|
86
|
+
dependencies = [
|
|
87
|
+
"serde_derive",
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
[[package]]
|
|
91
|
+
name = "serde_derive"
|
|
92
|
+
version = "1.0.229"
|
|
93
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
94
|
+
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
|
95
|
+
dependencies = [
|
|
96
|
+
"proc-macro2",
|
|
97
|
+
"quote",
|
|
98
|
+
"syn",
|
|
99
|
+
]
|
|
100
|
+
|
|
101
|
+
[[package]]
|
|
102
|
+
name = "serde_json"
|
|
103
|
+
version = "1.0.154"
|
|
104
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
105
|
+
checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
|
|
106
|
+
dependencies = [
|
|
107
|
+
"foldhash",
|
|
108
|
+
"indexmap",
|
|
109
|
+
"itoa",
|
|
110
|
+
"memchr",
|
|
111
|
+
"serde",
|
|
112
|
+
"serde_core",
|
|
113
|
+
"zmij",
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
[[package]]
|
|
117
|
+
name = "syn"
|
|
118
|
+
version = "3.0.10"
|
|
119
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
120
|
+
checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
|
|
121
|
+
dependencies = [
|
|
122
|
+
"proc-macro2",
|
|
123
|
+
"quote",
|
|
124
|
+
"unicode-ident",
|
|
125
|
+
]
|
|
126
|
+
|
|
127
|
+
[[package]]
|
|
128
|
+
name = "unicode-ident"
|
|
129
|
+
version = "1.0.27"
|
|
130
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
131
|
+
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
|
132
|
+
|
|
133
|
+
[[package]]
|
|
134
|
+
name = "zmij"
|
|
135
|
+
version = "1.0.23"
|
|
136
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
137
|
+
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
jsonbit-1.1.1/Cargo.toml
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "jsonbit"
|
|
3
|
+
version = "1.1.1"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
authors = ["Prathik Murugan"]
|
|
6
|
+
description = "jsonbit — Pure-Rust Auto-3NF Columnar Bit-Packed & BitVec64 Analytical Engine for LLMs"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
repository = "https://github.com/prathikmurugan/jsonbit"
|
|
10
|
+
keywords = ["json", "olap", "llm", "mcp", "columnar"]
|
|
11
|
+
categories = ["command-line-utilities", "database-implementations", "encoding"]
|
|
12
|
+
|
|
13
|
+
[[bin]]
|
|
14
|
+
name = "jsonbit"
|
|
15
|
+
path = "rust/main.rs"
|
|
16
|
+
|
|
17
|
+
[lib]
|
|
18
|
+
name = "jsonbit"
|
|
19
|
+
path = "rust/lib.rs"
|
|
20
|
+
|
|
21
|
+
[dependencies]
|
|
22
|
+
serde = { version = "1.0", features = ["derive"] }
|
|
23
|
+
serde_json = { version = "1.0", features = ["preserve_order"] }
|
|
24
|
+
|
|
25
|
+
[profile.release]
|
|
26
|
+
opt-level = 3
|
|
27
|
+
lto = "thin"
|
|
28
|
+
codegen-units = 1
|