@bluefields/cli 0.2.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 +661 -0
- package/README.md +181 -0
- package/dist/anchor.d.ts +24 -0
- package/dist/anchor.js +48 -0
- package/dist/anchor.js.map +1 -0
- package/dist/attestation.d.ts +50 -0
- package/dist/attestation.js +90 -0
- package/dist/attestation.js.map +1 -0
- package/dist/bluefield.d.ts +180 -0
- package/dist/bluefield.js +382 -0
- package/dist/bluefield.js.map +1 -0
- package/dist/cli.d.ts +19 -0
- package/dist/cli.js +310 -0
- package/dist/cli.js.map +1 -0
- package/dist/constants.d.ts +28 -0
- package/dist/constants.js +30 -0
- package/dist/constants.js.map +1 -0
- package/dist/fs-storage.d.ts +20 -0
- package/dist/fs-storage.js +60 -0
- package/dist/fs-storage.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/keystore.d.ts +40 -0
- package/dist/keystore.js +77 -0
- package/dist/keystore.js.map +1 -0
- package/dist/mcp-server.d.ts +40 -0
- package/dist/mcp-server.js +252 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/paths.d.ts +52 -0
- package/dist/paths.js +77 -0
- package/dist/paths.js.map +1 -0
- package/dist/quiet.d.ts +11 -0
- package/dist/quiet.js +14 -0
- package/dist/quiet.js.map +1 -0
- package/dist/store.d.ts +46 -0
- package/dist/store.js +233 -0
- package/dist/store.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
/**
|
|
3
|
+
* The Bluefield local library — "git for web data".
|
|
4
|
+
*
|
|
5
|
+
* A thin orchestration layer over the reused engine packages:
|
|
6
|
+
* - `@bluefields/fetcher` → fetch + content-address + sign (fetchAndStore)
|
|
7
|
+
* - `@bluefields/extractor` → optional structured extraction (BYO LLM key)
|
|
8
|
+
* - `@bluefields/differ` → line/structural diffs between snapshots
|
|
9
|
+
* - `@bluefields/attest` → offline signature verification
|
|
10
|
+
*
|
|
11
|
+
* It injects a LOCAL `DbClient` (PGlite) and a LOCAL filesystem
|
|
12
|
+
* `StorageAdapter` so the whole engine runs with no server, no Postgres, no
|
|
13
|
+
* KMS, and no network beyond the fetch itself. There is NO phone-home and NO
|
|
14
|
+
* telemetry anywhere in this package.
|
|
15
|
+
*
|
|
16
|
+
* Everything the CLI and the MCP server do goes through this class, so both
|
|
17
|
+
* surfaces stay thin.
|
|
18
|
+
*/
|
|
19
|
+
import { and, desc, eq, sql } from 'drizzle-orm';
|
|
20
|
+
import { verifyBundle } from '@bluefields/attest';
|
|
21
|
+
import { extractions as extractionsTable, snapshots as snapshotsTable, } from '@bluefields/db';
|
|
22
|
+
import { lineDiff, structuralDiff } from '@bluefields/differ';
|
|
23
|
+
import { extract } from '@bluefields/extractor';
|
|
24
|
+
import { fetchAndStore, getDefaultFetcher, } from '@bluefields/fetcher';
|
|
25
|
+
import { canonicalizeUrl } from '@bluefields/primitives';
|
|
26
|
+
import { tryAnchor } from './anchor.js';
|
|
27
|
+
import { isSigned, localTrustStore, readBundleSidecar, signedManifestFromRow, toBundle, writeBundleSidecar, } from './attestation.js';
|
|
28
|
+
import { createFsStorageAdapter } from './fs-storage.js';
|
|
29
|
+
import { loadOrCreateIdentity } from './keystore.js';
|
|
30
|
+
import { resolveStoreRoot, storePaths } from './paths.js';
|
|
31
|
+
import { LOCAL_CUSTOMER_ID, LOCAL_SUBSCRIPTION_ID, openStore } from './store.js';
|
|
32
|
+
const HEX_PREFIX = /^[0-9a-f]{6,}$/i;
|
|
33
|
+
/** Open (or create) a local Bluefield store. Call `close()` when done. */
|
|
34
|
+
export async function openBluefield(opts = {}) {
|
|
35
|
+
const env = opts.env ?? process.env;
|
|
36
|
+
const root = opts.storeRoot ?? resolveStoreRoot({ env });
|
|
37
|
+
const paths = storePaths(root);
|
|
38
|
+
const identity = loadOrCreateIdentity(opts.keysDir);
|
|
39
|
+
const store = await openStore(paths.db);
|
|
40
|
+
const storage = createFsStorageAdapter(paths.objects);
|
|
41
|
+
const fetcher = opts.fetcher ?? getDefaultFetcher(env);
|
|
42
|
+
return new Bluefield(paths, identity, store, storage, fetcher, env, opts.respectRobotsTxt ?? true);
|
|
43
|
+
}
|
|
44
|
+
export class Bluefield {
|
|
45
|
+
paths;
|
|
46
|
+
identity;
|
|
47
|
+
store;
|
|
48
|
+
storage;
|
|
49
|
+
fetcher;
|
|
50
|
+
env;
|
|
51
|
+
respectRobotsTxt;
|
|
52
|
+
constructor(paths, identity, store, storage, fetcher, env, respectRobotsTxt) {
|
|
53
|
+
this.paths = paths;
|
|
54
|
+
this.identity = identity;
|
|
55
|
+
this.store = store;
|
|
56
|
+
this.storage = storage;
|
|
57
|
+
this.fetcher = fetcher;
|
|
58
|
+
this.env = env;
|
|
59
|
+
this.respectRobotsTxt = respectRobotsTxt;
|
|
60
|
+
}
|
|
61
|
+
get db() {
|
|
62
|
+
return this.store.db;
|
|
63
|
+
}
|
|
64
|
+
/** Capture a URL: fetch → content-address on disk → sign → record → sidecar. */
|
|
65
|
+
async scrape(url, opts = {}) {
|
|
66
|
+
const sign = opts.sign ?? true;
|
|
67
|
+
const canonical = canonicalizeUrl(url).url_canonical;
|
|
68
|
+
const prev = await this.latestForUrl(canonical);
|
|
69
|
+
const outcome = await fetchAndStore({
|
|
70
|
+
db: this.db,
|
|
71
|
+
fetcher: this.fetcher,
|
|
72
|
+
storage: this.storage,
|
|
73
|
+
url,
|
|
74
|
+
customerId: LOCAL_CUSTOMER_ID,
|
|
75
|
+
subscriptionId: LOCAL_SUBSCRIPTION_ID,
|
|
76
|
+
respectRobotsTxt: this.respectRobotsTxt,
|
|
77
|
+
signer: sign ? this.identity.signer : null,
|
|
78
|
+
...(opts.fetchOptions ? { fetchOptions: opts.fetchOptions } : {}),
|
|
79
|
+
});
|
|
80
|
+
if (!outcome.ok)
|
|
81
|
+
return { ok: false, reason: 'robots_disallowed', url: canonical };
|
|
82
|
+
const row = await this.snapshotById(outcome.snapshotId);
|
|
83
|
+
if (!row)
|
|
84
|
+
throw new Error(`snapshot row vanished after insert: ${outcome.snapshotId}`);
|
|
85
|
+
// Freeze the portable bundle sidecar (manifest + signature + public key).
|
|
86
|
+
const bundle = toBundle(signedManifestFromRow(row), this.identity.publicJwk);
|
|
87
|
+
writeBundleSidecar(this.paths.manifests, row.id, bundle);
|
|
88
|
+
const result = {
|
|
89
|
+
ok: true,
|
|
90
|
+
snapshotId: row.id,
|
|
91
|
+
contentHash: row.contentHash,
|
|
92
|
+
url: canonical,
|
|
93
|
+
signed: isSigned(row),
|
|
94
|
+
changed: prev ? prev.contentHash !== row.contentHash : true,
|
|
95
|
+
};
|
|
96
|
+
if (opts.extract) {
|
|
97
|
+
result.extraction = await this.runExtract(row, outcome.fetchResult.html, opts);
|
|
98
|
+
}
|
|
99
|
+
if (opts.anchor) {
|
|
100
|
+
result.anchor = await tryAnchor(bundle);
|
|
101
|
+
}
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
104
|
+
/** Run the extractor over a snapshot's HTML (BYO LLM key via env). */
|
|
105
|
+
async runExtract(row, html, opts) {
|
|
106
|
+
const apiKey = this.env.ANTHROPIC_API_KEY;
|
|
107
|
+
const res = await extract(this.db, {
|
|
108
|
+
snapshotId: row.id,
|
|
109
|
+
subscriptionId: null,
|
|
110
|
+
customerId: LOCAL_CUSTOMER_ID,
|
|
111
|
+
html,
|
|
112
|
+
url: row.urlCanonical,
|
|
113
|
+
contentHash: row.contentHash,
|
|
114
|
+
schema: opts.schema ?? null,
|
|
115
|
+
intent: opts.intent ?? null,
|
|
116
|
+
}, apiKey ? { anthropicApiKey: apiKey } : {});
|
|
117
|
+
return res.extraction;
|
|
118
|
+
}
|
|
119
|
+
/** History: newest-first snapshots, optionally filtered to one URL. */
|
|
120
|
+
async log(url, opts = {}) {
|
|
121
|
+
const limit = opts.limit ?? 50;
|
|
122
|
+
const rows = url
|
|
123
|
+
? await this.db
|
|
124
|
+
.select()
|
|
125
|
+
.from(snapshotsTable)
|
|
126
|
+
.where(eq(snapshotsTable.urlCanonical, canonicalizeUrl(url).url_canonical))
|
|
127
|
+
.orderBy(desc(snapshotsTable.fetchedAt))
|
|
128
|
+
.limit(limit)
|
|
129
|
+
: await this.db
|
|
130
|
+
.select()
|
|
131
|
+
.from(snapshotsTable)
|
|
132
|
+
.orderBy(desc(snapshotsTable.fetchedAt))
|
|
133
|
+
.limit(limit);
|
|
134
|
+
return rows.map(summarize);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Diff two snapshots. With one URL and no explicit `to`, diffs the two most
|
|
138
|
+
* recent snapshots of that URL. `content` mode line-diffs the raw bodies;
|
|
139
|
+
* `structured` mode JSON-patch-diffs their extractions' structured data.
|
|
140
|
+
*/
|
|
141
|
+
async diff(fromRef, toRef, opts = {}) {
|
|
142
|
+
const mode = opts.mode ?? 'content';
|
|
143
|
+
let fromRow;
|
|
144
|
+
let toRow;
|
|
145
|
+
if (toRef) {
|
|
146
|
+
fromRow = await this.mustResolve(fromRef);
|
|
147
|
+
toRow = await this.mustResolve(toRef);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
// Single ref → treat as a URL and diff its last two snapshots.
|
|
151
|
+
const hist = await this.db
|
|
152
|
+
.select()
|
|
153
|
+
.from(snapshotsTable)
|
|
154
|
+
.where(eq(snapshotsTable.urlCanonical, canonicalizeUrl(fromRef).url_canonical))
|
|
155
|
+
.orderBy(desc(snapshotsTable.fetchedAt))
|
|
156
|
+
.limit(2);
|
|
157
|
+
if (hist.length < 2) {
|
|
158
|
+
throw new Error(`need at least two snapshots of ${fromRef} to diff (have ${hist.length})`);
|
|
159
|
+
}
|
|
160
|
+
toRow = hist[0];
|
|
161
|
+
fromRow = hist[1];
|
|
162
|
+
}
|
|
163
|
+
if (mode === 'structured') {
|
|
164
|
+
const [a, b] = await Promise.all([this.extractionFor(fromRow), this.extractionFor(toRow)]);
|
|
165
|
+
const ops = structuralDiff(a?.structuredData ?? null, b?.structuredData ?? null);
|
|
166
|
+
return {
|
|
167
|
+
from: summarize(fromRow),
|
|
168
|
+
to: summarize(toRow),
|
|
169
|
+
mode,
|
|
170
|
+
text: JSON.stringify(ops, null, 2),
|
|
171
|
+
added: ops.filter((o) => o.op === 'add').length,
|
|
172
|
+
removed: ops.filter((o) => o.op === 'remove').length,
|
|
173
|
+
ops,
|
|
174
|
+
identical: ops.length === 0,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
const [prevContent, currContent] = await Promise.all([
|
|
178
|
+
this.storage.getSnapshot(fromRow.contentHash),
|
|
179
|
+
this.storage.getSnapshot(toRow.contentHash),
|
|
180
|
+
]);
|
|
181
|
+
const d = lineDiff(prevContent, currContent);
|
|
182
|
+
return {
|
|
183
|
+
from: summarize(fromRow),
|
|
184
|
+
to: summarize(toRow),
|
|
185
|
+
mode,
|
|
186
|
+
text: d.text,
|
|
187
|
+
added: d.added,
|
|
188
|
+
removed: d.removed,
|
|
189
|
+
ops: [],
|
|
190
|
+
identical: prevContent === currContent,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Poll a URL on an interval, capturing each tick and reporting whether the
|
|
195
|
+
* content changed. Runs `times` iterations (default: forever) or until the
|
|
196
|
+
* `signal` aborts. `onTick` is invoked after every capture.
|
|
197
|
+
*/
|
|
198
|
+
async watch(url, opts = {}) {
|
|
199
|
+
const intervalMs = opts.intervalMs ?? 300_000; // 5 min default
|
|
200
|
+
const times = opts.times ?? Number.POSITIVE_INFINITY;
|
|
201
|
+
const results = [];
|
|
202
|
+
for (let i = 0; i < times; i++) {
|
|
203
|
+
if (opts.signal?.aborted)
|
|
204
|
+
break;
|
|
205
|
+
const r = await this.scrape(url, opts.scrape ?? {});
|
|
206
|
+
results.push(r);
|
|
207
|
+
opts.onTick?.(r, i);
|
|
208
|
+
if (i + 1 >= times)
|
|
209
|
+
break;
|
|
210
|
+
const interrupted = await sleep(intervalMs, opts.signal);
|
|
211
|
+
if (interrupted)
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
return results;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Verify a snapshot (by ref) or a previously-exported bundle. Recomputes the
|
|
218
|
+
* content hash from the stored object AND checks the signature against a
|
|
219
|
+
* trusted key (the local identity plus any keys under `<store>/trusted`, plus
|
|
220
|
+
* `extraKeys`). Fails closed on an unknown key unless `trustEmbedded` is set.
|
|
221
|
+
*/
|
|
222
|
+
async verify(ref, opts = {}) {
|
|
223
|
+
const row = await this.resolve(ref);
|
|
224
|
+
if (!row) {
|
|
225
|
+
throw new Error(`no snapshot matches "${ref}"`);
|
|
226
|
+
}
|
|
227
|
+
// Prefer the frozen sidecar bundle; fall back to reconstruction.
|
|
228
|
+
const sidecar = readBundleSidecar(this.paths.manifests, row.id);
|
|
229
|
+
const bundle = sidecar ?? toBundle(signedManifestFromRow(row), this.identity.publicJwk);
|
|
230
|
+
// Re-hash the on-disk content — proves the bytes match what was signed.
|
|
231
|
+
let contentHashMatches = false;
|
|
232
|
+
try {
|
|
233
|
+
const content = await this.storage.getSnapshot(row.contentHash);
|
|
234
|
+
const { createHash } = await import('node:crypto');
|
|
235
|
+
contentHashMatches = createHash('sha256').update(content).digest('hex') === row.contentHash;
|
|
236
|
+
}
|
|
237
|
+
catch {
|
|
238
|
+
contentHashMatches = false;
|
|
239
|
+
}
|
|
240
|
+
// Build the trust store. Embedded key is only trusted with explicit opt-in.
|
|
241
|
+
const keys = [this.identity.publicJwk, ...this.loadTrustedKeys(), ...(opts.extraKeys ?? [])];
|
|
242
|
+
if (opts.trustEmbedded && bundle.jwk)
|
|
243
|
+
keys.push(bundle.jwk);
|
|
244
|
+
const trustStore = localTrustStore(keys);
|
|
245
|
+
const signatureValid = verifyBundle(bundle, { trustStore });
|
|
246
|
+
const ok = contentHashMatches && signatureValid;
|
|
247
|
+
return {
|
|
248
|
+
ok,
|
|
249
|
+
snapshotId: row.id,
|
|
250
|
+
keyId: bundle.signature.keyId,
|
|
251
|
+
contentHashMatches,
|
|
252
|
+
signatureValid,
|
|
253
|
+
detail: ok
|
|
254
|
+
? 'content hash and signature verified'
|
|
255
|
+
: `${contentHashMatches ? '' : 'content hash mismatch; '}${signatureValid ? '' : 'signature not valid against a trusted key; '}`.trim(),
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/** Write a snapshot's raw content + portable bundle into `destDir`. */
|
|
259
|
+
async export(ref, destDir) {
|
|
260
|
+
const row = await this.mustResolve(ref);
|
|
261
|
+
const content = await this.storage.getSnapshot(row.contentHash);
|
|
262
|
+
const bundle = readBundleSidecar(this.paths.manifests, row.id) ??
|
|
263
|
+
toBundle(signedManifestFromRow(row), this.identity.publicJwk);
|
|
264
|
+
const { mkdirSync, writeFileSync } = await import('node:fs');
|
|
265
|
+
const { join } = await import('node:path');
|
|
266
|
+
mkdirSync(destDir, { recursive: true });
|
|
267
|
+
const contentFile = join(destDir, `${row.id}.content`);
|
|
268
|
+
const bundleFile = join(destDir, `${row.id}.bundle.json`);
|
|
269
|
+
writeFileSync(contentFile, content, 'utf8');
|
|
270
|
+
writeFileSync(bundleFile, `${JSON.stringify(bundle, null, 2)}\n`, 'utf8');
|
|
271
|
+
return { snapshotId: row.id, dir: destDir, contentFile, bundleFile };
|
|
272
|
+
}
|
|
273
|
+
/** Retrieve the raw stored content for a snapshot ref. */
|
|
274
|
+
async getContent(ref) {
|
|
275
|
+
const row = await this.mustResolve(ref);
|
|
276
|
+
return this.storage.getSnapshot(row.contentHash);
|
|
277
|
+
}
|
|
278
|
+
/** The public identity (safe to share). */
|
|
279
|
+
publicIdentity() {
|
|
280
|
+
return { keyId: this.identity.keyId, publicJwk: this.identity.publicJwk };
|
|
281
|
+
}
|
|
282
|
+
async close() {
|
|
283
|
+
await this.store.close();
|
|
284
|
+
}
|
|
285
|
+
// ── internals ────────────────────────────────────────────────────────
|
|
286
|
+
loadTrustedKeys() {
|
|
287
|
+
try {
|
|
288
|
+
const { readdirSync, readFileSync } = require('node:fs');
|
|
289
|
+
const { join } = require('node:path');
|
|
290
|
+
return readdirSync(this.paths.trusted)
|
|
291
|
+
.filter((f) => f.endsWith('.jwk') || f.endsWith('.json'))
|
|
292
|
+
.map((f) => JSON.parse(readFileSync(join(this.paths.trusted, f), 'utf8')));
|
|
293
|
+
}
|
|
294
|
+
catch {
|
|
295
|
+
return []; // no trusted dir / unreadable → just the local identity
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
async snapshotById(id) {
|
|
299
|
+
const rows = await this.db
|
|
300
|
+
.select()
|
|
301
|
+
.from(snapshotsTable)
|
|
302
|
+
.where(eq(snapshotsTable.id, id))
|
|
303
|
+
.limit(1);
|
|
304
|
+
return rows[0];
|
|
305
|
+
}
|
|
306
|
+
async latestForUrl(urlCanonical) {
|
|
307
|
+
const rows = await this.db
|
|
308
|
+
.select()
|
|
309
|
+
.from(snapshotsTable)
|
|
310
|
+
.where(eq(snapshotsTable.urlCanonical, urlCanonical))
|
|
311
|
+
.orderBy(desc(snapshotsTable.fetchedAt))
|
|
312
|
+
.limit(1);
|
|
313
|
+
return rows[0];
|
|
314
|
+
}
|
|
315
|
+
/** Resolve a ref (snapshot-id prefix, or URL → latest) to a row, or null. */
|
|
316
|
+
async resolve(ref) {
|
|
317
|
+
// URL form first (contains '://') → latest snapshot of that URL.
|
|
318
|
+
if (ref.includes('://')) {
|
|
319
|
+
const row = await this.latestForUrl(canonicalizeUrl(ref).url_canonical);
|
|
320
|
+
return row ?? null;
|
|
321
|
+
}
|
|
322
|
+
// Otherwise treat as a snapshot-id prefix.
|
|
323
|
+
if (HEX_PREFIX.test(ref.replace(/-/g, ''))) {
|
|
324
|
+
const rows = await this.db
|
|
325
|
+
.select()
|
|
326
|
+
.from(snapshotsTable)
|
|
327
|
+
.where(sql `${snapshotsTable.id}::text LIKE ${`${ref}%`}`)
|
|
328
|
+
.orderBy(desc(snapshotsTable.fetchedAt))
|
|
329
|
+
.limit(2);
|
|
330
|
+
if (rows.length === 1)
|
|
331
|
+
return rows[0] ?? null;
|
|
332
|
+
if (rows.length > 1)
|
|
333
|
+
throw new Error(`ambiguous snapshot ref "${ref}" — provide more hex`);
|
|
334
|
+
}
|
|
335
|
+
return null;
|
|
336
|
+
}
|
|
337
|
+
async mustResolve(ref) {
|
|
338
|
+
const row = await this.resolve(ref);
|
|
339
|
+
if (!row)
|
|
340
|
+
throw new Error(`no snapshot matches "${ref}"`);
|
|
341
|
+
return row;
|
|
342
|
+
}
|
|
343
|
+
async extractionFor(row) {
|
|
344
|
+
const rows = await this.db
|
|
345
|
+
.select()
|
|
346
|
+
.from(extractionsTable)
|
|
347
|
+
.where(and(eq(extractionsTable.snapshotId, row.id), eq(extractionsTable.contentHash, row.contentHash)))
|
|
348
|
+
.orderBy(desc(extractionsTable.createdAt))
|
|
349
|
+
.limit(1);
|
|
350
|
+
return rows[0];
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
/** Sleep `ms`, resolving early (`true`) if the signal aborts. */
|
|
354
|
+
function sleep(ms, signal) {
|
|
355
|
+
return new Promise((res) => {
|
|
356
|
+
if (signal?.aborted)
|
|
357
|
+
return res(true);
|
|
358
|
+
const t = setTimeout(() => {
|
|
359
|
+
signal?.removeEventListener('abort', onAbort);
|
|
360
|
+
res(false);
|
|
361
|
+
}, ms);
|
|
362
|
+
const onAbort = () => {
|
|
363
|
+
clearTimeout(t);
|
|
364
|
+
res(true);
|
|
365
|
+
};
|
|
366
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
/** Row → compact summary. */
|
|
370
|
+
function summarize(row) {
|
|
371
|
+
return {
|
|
372
|
+
snapshotId: row.id,
|
|
373
|
+
url: row.urlCanonical,
|
|
374
|
+
contentHash: row.contentHash,
|
|
375
|
+
fetchedAt: row.fetchedAt,
|
|
376
|
+
responseStatus: row.responseStatus,
|
|
377
|
+
sizeBytes: row.rawHtmlSizeBytes,
|
|
378
|
+
signed: isSigned(row),
|
|
379
|
+
keyId: row.attestationKeyId,
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
//# sourceMappingURL=bluefield.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bluefield.js","sourceRoot":"","sources":["../src/bluefield.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAGL,WAAW,IAAI,gBAAgB,EAC/B,SAAS,IAAI,cAAc,GAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAGL,aAAa,EACb,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAqB,SAAS,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EACL,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,QAAQ,EACR,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAsB,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAmB,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAc,SAAS,EAAE,MAAM,YAAY,CAAC;AA+F7F,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAErC,0E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AE,GAAG,CAAC,EAAE;QAClB,GAAG,EAAE,GAAG,CAAC,YAAY;QACrB,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,cAAc,EAAE,GAAG,CAAC,cAAc;QAClC,SAAS,EAAE,GAAG,CAAC,gBAAgB;QAC/B,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC;QACrB,KAAK,EAAE,GAAG,CAAC,gBAAgB;KAC5B,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `bf` — the Bluefield command line. A thin, dependency-free wrapper over the
|
|
4
|
+
* `@bluefields/cli` library. No arg-parsing dependency (a hand-rolled parser
|
|
5
|
+
* covers the small surface); no telemetry; no network beyond the fetch itself.
|
|
6
|
+
*
|
|
7
|
+
* Kept separate from `index.ts` so importing the library has no side effects
|
|
8
|
+
* and the binary runs reliably whether invoked as `node dist/cli.js` or via the
|
|
9
|
+
* `bf` bin symlink.
|
|
10
|
+
*/
|
|
11
|
+
import './quiet.js';
|
|
12
|
+
interface Parsed {
|
|
13
|
+
positionals: string[];
|
|
14
|
+
flags: Map<string, string | true>;
|
|
15
|
+
}
|
|
16
|
+
/** Minimal argv parser: `--flag`, `--flag value`, `--flag=value`, positionals. */
|
|
17
|
+
export declare function parse(argv: string[]): Parsed;
|
|
18
|
+
export declare function main(argv: string[]): Promise<number>;
|
|
19
|
+
export {};
|