rebilder 0.4.0 → 0.5.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/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ Notable changes to the `rebilder` command-line tool. Exit codes are a stable con
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.5.0 (2026-10-17)
8
+
9
+ - `rebilder init` wires reporting into the generated config. It reports agent visits to your Rebilder Console once you set `REBILDER_API_KEY` and `REBILDER_STORE_ID`, which a free account provides. Without the key, nothing is sent. The CLI itself still makes no network request.
10
+
7
11
  ## 0.4.0 (2026-10-06)
8
12
 
9
13
  - **Scores against ARS 0.3.** Weights and check ids are unchanged. When a page does not send a Markdown copy but links one on the same site, `check` fetches that one copy. A copy that loads earns 6 of the Markdown check's 9 points. More action words count as a page's main action, such as "shop", "free trial", "get a demo" and "talk to sales". Evidence lines and fixes are written in plain language.
package/README.md CHANGED
@@ -342,7 +342,7 @@ page we never scored is an `<error>`.
342
342
  <property name="notice" value="ARS measures format and retrievability. It does not measure whether the facts are true, or whether any assistant cites this page."/>
343
343
  <property name="url" value="https://basecamp-supply.example/products/alpine-trail-pack-28l"/>
344
344
  <property name="generatedAt" value="2026-08-05T00:00:00.000Z"/>
345
- <property name="tool" value="rebilder 0.4.0"/>
345
+ <property name="tool" value="rebilder 0.5.0"/>
346
346
  <property name="specVersion" value="0.3.0"/>
347
347
  <property name="rulesetHash" value="1d07a1223b3460c3b4d37669c0970d67e9f7e60f121d861201e73dafc9b544b0"/>
348
348
  <property name="corpusHash" value="e88662472394316deb404ff02cde136b26a08a54439c52dcd299d80bc8fd9f9e"/>
@@ -383,6 +383,12 @@ The scaffold is a skeleton with `TODO`s, not a working config: the resolvers
383
383
  return **your** source of truth, and every substantive value on a rendered page
384
384
  comes from those fields. The gateway never invents one.
385
385
 
386
+ Reporting is wired in. The generated config sends agent visits to your
387
+ Rebilder Console from your own server once you install `@rebilder/events` and
388
+ set `REBILDER_STORE_ID` and `REBILDER_API_KEY`. A free account provides both at
389
+ [rebilder.com/console/install](https://rebilder.com/console/install). Without
390
+ the key, the config sends nothing. `init` itself still makes no request.
391
+
386
392
  ---
387
393
 
388
394
  ## `rebilder badge`
package/dist/bin.js CHANGED
@@ -465,12 +465,26 @@ async function runInit(command, runtime2) {
465
465
  }
466
466
  return { ...SCAFFOLDS[framework], framework, detection };
467
467
  }
468
+ var INGEST_ORIGIN = "https://api.rebilder.com";
469
+ var CONSOLE_INSTALL_URL = "https://rebilder.com/console/install";
468
470
  var SHARED_NOTES = [
469
471
  "The resolvers return your source of truth. Every substantive value \u2014 price, stock, hours, policy text \u2014 comes from these fields; the gateway never invents one.",
470
- "The Apache-2.0 SDK serves without a Rebilder account or subscription. Configure reporting separately.",
472
+ "The Apache-2.0 SDK serves without a Rebilder account or subscription.",
473
+ `Reporting is wired in. Install \`@rebilder/events\`, create a free account, then set REBILDER_STORE_ID and REBILDER_API_KEY from ${CONSOLE_INSTALL_URL}. Without the key, nothing is sent.`,
471
474
  `Run \`rebilder check <url>\` before and after to see what changed. Sending a Markdown copy from the page address is D2.1 (${DEFAULT_RULESET.weights["machine-representation.negotiated-response"] ?? 0} points) and unlocks D2.3 and D2.4.`
472
475
  ];
473
476
  var CONFIG_BODY = `import type { GatewayConfig } from '@rebilder/gateway'
477
+ import { createHttpEventSink } from '@rebilder/events'
478
+
479
+ // Reports agent visits to your Rebilder Console. Free accounts include it.
480
+ // Copy both values from ${CONSOLE_INSTALL_URL} into your environment.
481
+ // Without REBILDER_API_KEY, nothing is sent.
482
+ const env = (name: string): string | undefined =>
483
+ (globalThis as { process?: { env?: Record<string, string | undefined> } }).process?.env?.[name]
484
+ const apiKey = env('REBILDER_API_KEY')
485
+
486
+ // Module scope, not per request: the sink batches (20 events, or every 2s).
487
+ const sink = apiKey ? createHttpEventSink({ url: '${INGEST_ORIGIN}', apiKey }) : null
474
488
 
475
489
  /**
476
490
  * Wiring to YOUR source of truth. Each resolver takes a URL and returns the
@@ -480,7 +494,7 @@ var CONFIG_BODY = `import type { GatewayConfig } from '@rebilder/gateway'
480
494
  * call except a cache. Anything slower belongs in a build step.
481
495
  */
482
496
  export const gatewayConfig: GatewayConfig = {
483
- storeId: 'TODO-your-store-id',
497
+ storeId: env('REBILDER_STORE_ID') ?? 'TODO-your-store-id',
484
498
  sources: {
485
499
  // TODO: return your product fields, or null when the URL is not a PDP.
486
500
  product: async (url) => {
@@ -489,8 +503,7 @@ export const gatewayConfig: GatewayConfig = {
489
503
  },
490
504
  // TODO: policies, catalog, document, collection \u2014 add the ones you have.
491
505
  },
492
- // Optional: emit @rebilder/events RebilderEventV0 into your observation layer.
493
- // onEvent: (event) => { void event },
506
+ onEvent: (event) => sink?.emit(event),
494
507
  }
495
508
  `;
496
509
  function scaffold(suggestedPath, mount, notes) {
@@ -1811,7 +1824,7 @@ function helpText(topic) {
1811
1824
  }
1812
1825
 
1813
1826
  // src/cli.ts
1814
- var CLI_VERSION = "0.4.0";
1827
+ var CLI_VERSION = "0.5.0";
1815
1828
  async function runCli(argv, runtime2) {
1816
1829
  const caps = detectCapabilities({
1817
1830
  env: runtime2.env,