@sandboxpm/store 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 sandboxpm contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @sandboxpm/store
3
+ *
4
+ * Content-Addressable Store (CAS) — the heart of sandboxpm.
5
+ *
6
+ * Each file is stored once at ~/.sandboxpm/store/{sha512-hex}.
7
+ * node_modules files are hard links into the store — never copies.
8
+ */
9
+ export interface StoreEntry {
10
+ hash: string;
11
+ size: number;
12
+ addedAt: number;
13
+ }
14
+ export interface StoreStats {
15
+ totalFiles: number;
16
+ totalSizeBytes: number;
17
+ storeDir: string;
18
+ }
19
+ export declare class CASStore {
20
+ readonly storeDir: string;
21
+ constructor(storeDir: string);
22
+ private storePath;
23
+ has(hash: string): Promise<boolean>;
24
+ /**
25
+ * Copy a file into the store under its hash. Atomic: write to temp, then rename.
26
+ * No-op if the file is already present.
27
+ */
28
+ put(hash: string, sourcePath: string): Promise<void>;
29
+ /**
30
+ * Hard-link a store entry to destPath.
31
+ * Falls back to copyFile on EXDEV (cross-device / different filesystem).
32
+ */
33
+ link(hash: string, destPath: string): Promise<void>;
34
+ /** Recompute SHA-512 of the stored file and compare to hash. */
35
+ verify(hash: string): Promise<boolean>;
36
+ stat(hash: string): Promise<StoreEntry>;
37
+ /** Remove store entries not referenced by the given set. Returns bytes freed. */
38
+ gc(referencedHashes: Set<string>): Promise<number>;
39
+ /** Remove store entries whose mtime is older than ttlDays. Returns bytes freed. */
40
+ gcByTtl(ttlDays: number): Promise<number>;
41
+ stats(): Promise<StoreStats>;
42
+ }
43
+ /** Compute the SHA-512 hex digest of a file. */
44
+ export declare function hashFile(filePath: string): Promise<string>;
45
+ /** Compute the SHA-512 hex digest of a Buffer. */
46
+ export declare function hashBuffer(buf: Buffer): string;
47
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,qBAAa,QAAQ;IACnB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;gBAEb,QAAQ,EAAE,MAAM;IAI5B,OAAO,CAAC,SAAS;IAIX,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IASzC;;;OAGG;IACG,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B1D;;;OAGG;IACG,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBzD,gEAAgE;IAC1D,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAStC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAS7C,iFAAiF;IAC3E,EAAE,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAyBxD,mFAAmF;IAC7E,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA0BzC,KAAK,IAAI,OAAO,CAAC,UAAU,CAAC;CA4BnC;AAED,gDAAgD;AAChD,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQhE;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9C"}
package/dist/index.js ADDED
@@ -0,0 +1,206 @@
1
+ /**
2
+ * @sandboxpm/store
3
+ *
4
+ * Content-Addressable Store (CAS) — the heart of sandboxpm.
5
+ *
6
+ * Each file is stored once at ~/.sandboxpm/store/{sha512-hex}.
7
+ * node_modules files are hard links into the store — never copies.
8
+ */
9
+ import * as crypto from 'crypto';
10
+ import * as fs from 'fs/promises';
11
+ import { createReadStream } from 'fs';
12
+ import * as path from 'path';
13
+ function randomSuffix() {
14
+ return crypto.randomBytes(8).toString('hex');
15
+ }
16
+ export class CASStore {
17
+ storeDir;
18
+ constructor(storeDir) {
19
+ this.storeDir = storeDir;
20
+ }
21
+ storePath(hash) {
22
+ return path.join(this.storeDir, hash);
23
+ }
24
+ async has(hash) {
25
+ try {
26
+ await fs.access(this.storePath(hash));
27
+ return true;
28
+ }
29
+ catch {
30
+ return false;
31
+ }
32
+ }
33
+ /**
34
+ * Copy a file into the store under its hash. Atomic: write to temp, then rename.
35
+ * No-op if the file is already present.
36
+ */
37
+ async put(hash, sourcePath) {
38
+ const dest = this.storePath(hash);
39
+ if (await this.has(hash))
40
+ return;
41
+ await fs.mkdir(this.storeDir, { recursive: true });
42
+ const tmp = `${dest}.tmp.${randomSuffix()}`;
43
+ try {
44
+ await fs.copyFile(sourcePath, tmp);
45
+ // Another concurrent put may have won the race — that's fine
46
+ try {
47
+ await fs.rename(tmp, dest);
48
+ }
49
+ catch (renameErr) {
50
+ if (renameErr.code === 'ENOENT' && await this.has(hash)) {
51
+ // Lost the race; the winner already renamed. Clean up our temp file.
52
+ await fs.rm(tmp, { force: true });
53
+ return;
54
+ }
55
+ throw renameErr;
56
+ }
57
+ }
58
+ catch (err) {
59
+ // Clean up partial temp file on failure
60
+ await fs.rm(tmp, { force: true });
61
+ throw err;
62
+ }
63
+ }
64
+ /**
65
+ * Hard-link a store entry to destPath.
66
+ * Falls back to copyFile on EXDEV (cross-device / different filesystem).
67
+ */
68
+ async link(hash, destPath) {
69
+ const src = this.storePath(hash);
70
+ await fs.mkdir(path.dirname(destPath), { recursive: true });
71
+ try {
72
+ await fs.link(src, destPath);
73
+ }
74
+ catch (err) {
75
+ const e = err;
76
+ if (e.code === 'EEXIST')
77
+ return; // already linked, fine
78
+ if (e.code === 'EXDEV' || e.code === 'UNKNOWN' || e.code === 'EPERM') {
79
+ // EXDEV — cross-device (store and project on different volumes)
80
+ // UNKNOWN — Windows error when destination is inside OneDrive or other
81
+ // cloud-synced folder that blocks hard links
82
+ // EPERM — Windows Developer Mode off or filesystem doesn't support links
83
+ await fs.copyFile(src, destPath);
84
+ return;
85
+ }
86
+ throw err;
87
+ }
88
+ }
89
+ /** Recompute SHA-512 of the stored file and compare to hash. */
90
+ async verify(hash) {
91
+ try {
92
+ const computed = await hashFile(this.storePath(hash));
93
+ return computed === hash;
94
+ }
95
+ catch {
96
+ return false;
97
+ }
98
+ }
99
+ async stat(hash) {
100
+ const st = await fs.stat(this.storePath(hash));
101
+ return {
102
+ hash,
103
+ size: st.size,
104
+ addedAt: Math.floor(st.mtimeMs),
105
+ };
106
+ }
107
+ /** Remove store entries not referenced by the given set. Returns bytes freed. */
108
+ async gc(referencedHashes) {
109
+ let freed = 0;
110
+ let entries;
111
+ try {
112
+ entries = await fs.readdir(this.storeDir);
113
+ }
114
+ catch (err) {
115
+ if (err.code === 'ENOENT')
116
+ return 0;
117
+ throw err;
118
+ }
119
+ for (const entry of entries) {
120
+ if (!referencedHashes.has(entry)) {
121
+ const p = path.join(this.storeDir, entry);
122
+ try {
123
+ const st = await fs.stat(p);
124
+ await fs.rm(p, { force: true });
125
+ freed += st.size;
126
+ }
127
+ catch {
128
+ // If the file disappeared between readdir and stat, ignore
129
+ }
130
+ }
131
+ }
132
+ return freed;
133
+ }
134
+ /** Remove store entries whose mtime is older than ttlDays. Returns bytes freed. */
135
+ async gcByTtl(ttlDays) {
136
+ const cutoff = Date.now() - ttlDays * 24 * 60 * 60 * 1000;
137
+ let freed = 0;
138
+ let entries;
139
+ try {
140
+ entries = await fs.readdir(this.storeDir, { withFileTypes: true });
141
+ }
142
+ catch (err) {
143
+ if (err.code === 'ENOENT')
144
+ return 0;
145
+ throw err;
146
+ }
147
+ for (const entry of entries) {
148
+ if (!entry.isFile())
149
+ continue;
150
+ const filePath = path.join(this.storeDir, entry.name);
151
+ try {
152
+ const stat = await fs.stat(filePath);
153
+ if (stat.mtimeMs < cutoff) {
154
+ freed += stat.size;
155
+ await fs.rm(filePath, { force: true });
156
+ }
157
+ }
158
+ catch {
159
+ // file may have been removed between readdir and stat
160
+ }
161
+ }
162
+ return freed;
163
+ }
164
+ async stats() {
165
+ let totalFiles = 0;
166
+ let totalSizeBytes = 0;
167
+ let entries;
168
+ try {
169
+ entries = await fs.readdir(this.storeDir);
170
+ }
171
+ catch (err) {
172
+ if (err.code === 'ENOENT') {
173
+ return { totalFiles: 0, totalSizeBytes: 0, storeDir: this.storeDir };
174
+ }
175
+ throw err;
176
+ }
177
+ for (const entry of entries) {
178
+ try {
179
+ const st = await fs.stat(path.join(this.storeDir, entry));
180
+ if (st.isFile()) {
181
+ totalFiles++;
182
+ totalSizeBytes += st.size;
183
+ }
184
+ }
185
+ catch {
186
+ // skip files that disappear mid-iteration
187
+ }
188
+ }
189
+ return { totalFiles, totalSizeBytes, storeDir: this.storeDir };
190
+ }
191
+ }
192
+ /** Compute the SHA-512 hex digest of a file. */
193
+ export async function hashFile(filePath) {
194
+ return new Promise((resolve, reject) => {
195
+ const hash = crypto.createHash('sha512');
196
+ const stream = createReadStream(filePath);
197
+ stream.on('data', chunk => hash.update(chunk));
198
+ stream.on('end', () => resolve(hash.digest('hex')));
199
+ stream.on('error', reject);
200
+ });
201
+ }
202
+ /** Compute the SHA-512 hex digest of a Buffer. */
203
+ export function hashBuffer(buf) {
204
+ return crypto.createHash('sha512').update(buf).digest('hex');
205
+ }
206
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,SAAS,YAAY;IACnB,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC9C,CAAC;AAcD,MAAM,OAAO,QAAQ;IACV,QAAQ,CAAQ;IAEzB,YAAY,QAAgB;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAEO,SAAS,CAAC,IAAY;QAC5B,OAAO,IAAI,CAAC,IAAI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AAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACnD,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC9D,CAAC"}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@sandboxpm/store",
3
+ "version": "0.1.0",
4
+ "description": "Content-addressable store (CAS) for sandboxpm — SHA-512 keyed hard links",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/daviddaco1/sandboxpm.git",
9
+ "directory": "packages/store"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "type": "module",
15
+ "main": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "files": [
18
+ "dist",
19
+ "!dist/**/*.tsbuildinfo"
20
+ ],
21
+ "dependencies": {
22
+ "@sandboxpm/config": "0.1.0"
23
+ },
24
+ "scripts": {
25
+ "build": "tsc --build",
26
+ "test": "vitest run"
27
+ }
28
+ }