superbee 0.4.1 → 0.4.2-pre.2

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/README.md CHANGED
@@ -47,13 +47,17 @@ Skill, an instruction file your agent loads, that teaches it how to use the tool
47
47
 
48
48
  ## Install
49
49
 
50
- Requires Node.js 20 or newer on macOS and Linux. Native Windows is not supported by this package.
50
+ Requires a supported Node.js 22, 24, or 26 release (22.14.0 minimum) on macOS or Linux. Native Windows is not supported by this package.
51
51
 
52
52
  ```sh
53
53
  npm install -g superbee
54
54
  ```
55
55
 
56
- Stable releases publish on npm's `latest` tag and prereleases on `next`.
56
+ Stable releases publish on npm's `latest` tag and prereleases on `next`. To try the prerelease:
57
+
58
+ ```sh
59
+ npm install -g superbee@next
60
+ ```
57
61
 
58
62
  Windows adapters and the `superbee-windows` executable live in a separate repository and are
59
63
  not included in `superbee`. Most Windows users should run Superbee in WSL2, where npm sees a
@@ -3310,8 +3310,24 @@ function matchesFilter(doc, filter) {
3310
3310
  if (!actual.includes(expected)) return false;
3311
3311
  }
3312
3312
  }
3313
+ if (filter.sources && (filter.sources.resource !== void 0 || filter.sources.id !== void 0)) {
3314
+ if (!hasSourceIdentity(doc.frontmatter.sources, filter.sources)) return false;
3315
+ }
3316
+ return true;
3317
+ }
3318
+ function matchesSourceIdentity(entry, identity) {
3319
+ if (entry === null || typeof entry !== "object" || Array.isArray(entry)) return false;
3320
+ const row = entry;
3321
+ for (const key of ["resource", "id"]) {
3322
+ const expected = identity[key];
3323
+ if (expected === void 0) continue;
3324
+ if (!Object.hasOwn(row, key) || typeof row[key] !== "string" || row[key] !== expected) return false;
3325
+ }
3313
3326
  return true;
3314
3327
  }
3328
+ function hasSourceIdentity(sources, identity) {
3329
+ return Array.isArray(sources) && sources.some((entry) => matchesSourceIdentity(entry, identity));
3330
+ }
3315
3331
 
3316
3332
  // ../core/src/engine.ts
3317
3333
  async function readBundleOkfVersion(backend) {
@@ -4550,10 +4566,6 @@ function versionOfBytes(raw) {
4550
4566
  function blobVersion(bytes) {
4551
4567
  return `sha256:${sha256HexOfBytes(bytes)}`;
4552
4568
  }
4553
- function defaultActor() {
4554
- const env = typeof process !== "undefined" ? process.env : void 0;
4555
- return env?.USER?.trim() || env?.USERNAME?.trim() || env?.LOGNAME?.trim() || "local";
4556
- }
4557
4569
 
4558
4570
  // ../core/src/backend.ts
4559
4571
  var publicationContexts = /* @__PURE__ */ new WeakMap();
@@ -4689,7 +4701,7 @@ var FilesystemBackend = class _FilesystemBackend {
4689
4701
  if (observed.state === "absent") return [];
4690
4702
  const { raw, mtime } = observed.value;
4691
4703
  const { frontmatter: frontmatter2 } = parseMarkdown(raw, rel);
4692
- const actor = mutationActorFromFrontmatter(frontmatter2) ?? defaultActor();
4704
+ const actor = mutationActorFromFrontmatter(frontmatter2) ?? "unattributed";
4693
4705
  const timestamp = firstString(frontmatter2.timestamp) ?? mtime.toISOString();
4694
4706
  return [{ version: versionOfBytes(raw), actor, timestamp }];
4695
4707
  }
@@ -31264,8 +31264,24 @@ function matchesFilter(doc, filter) {
31264
31264
  if (!actual.includes(expected)) return false;
31265
31265
  }
31266
31266
  }
31267
+ if (filter.sources && (filter.sources.resource !== void 0 || filter.sources.id !== void 0)) {
31268
+ if (!hasSourceIdentity(doc.frontmatter.sources, filter.sources)) return false;
31269
+ }
31270
+ return true;
31271
+ }
31272
+ function matchesSourceIdentity(entry, identity) {
31273
+ if (entry === null || typeof entry !== "object" || Array.isArray(entry)) return false;
31274
+ const row = entry;
31275
+ for (const key of ["resource", "id"]) {
31276
+ const expected = identity[key];
31277
+ if (expected === void 0) continue;
31278
+ if (!Object.hasOwn(row, key) || typeof row[key] !== "string" || row[key] !== expected) return false;
31279
+ }
31267
31280
  return true;
31268
31281
  }
31282
+ function hasSourceIdentity(sources, identity) {
31283
+ return Array.isArray(sources) && sources.some((entry) => matchesSourceIdentity(entry, identity));
31284
+ }
31269
31285
 
31270
31286
  // ../core/src/engine.ts
31271
31287
  async function readBundleOkfVersion(backend) {
@@ -32504,10 +32520,6 @@ function versionOfBytes(raw) {
32504
32520
  function blobVersion(bytes) {
32505
32521
  return `sha256:${sha256HexOfBytes(bytes)}`;
32506
32522
  }
32507
- function defaultActor() {
32508
- const env = typeof process !== "undefined" ? process.env : void 0;
32509
- return env?.USER?.trim() || env?.USERNAME?.trim() || env?.LOGNAME?.trim() || "local";
32510
- }
32511
32523
 
32512
32524
  // ../core/src/backend.ts
32513
32525
  var publicationContexts = /* @__PURE__ */ new WeakMap();
@@ -32643,7 +32655,7 @@ var FilesystemBackend = class _FilesystemBackend {
32643
32655
  if (observed.state === "absent") return [];
32644
32656
  const { raw, mtime } = observed.value;
32645
32657
  const { frontmatter: frontmatter2 } = parseMarkdown(raw, rel);
32646
- const actor = mutationActorFromFrontmatter(frontmatter2) ?? defaultActor();
32658
+ const actor = mutationActorFromFrontmatter(frontmatter2) ?? "unattributed";
32647
32659
  const timestamp = firstString(frontmatter2.timestamp) ?? mtime.toISOString();
32648
32660
  return [{ version: versionOfBytes(raw), actor, timestamp }];
32649
32661
  }