@wrenai/genbi 0.0.1 → 0.0.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
@@ -8,8 +8,13 @@ The app does not write SQL itself. A question goes to the Wren agent harness,
8
8
  which answers with a structured envelope — the blocks to render, and whether the
9
9
  answer was verified — and the UI renders that.
10
10
 
11
- This README is for working on the app from source: getting it running, and the
12
- daily build/test/typecheck loop. Three companion docs cover the rest:
11
+ To just run it, `npx @wrenai/genbi` is the whole story — see
12
+ [Getting started](#getting-started) below, or [INSTALL.md](./INSTALL.md) for
13
+ what it needs and how to configure it.
14
+
15
+ The rest of this README is for working on the app **from source**: getting it
16
+ running, and the daily build/test/typecheck loop. Three companion docs cover
17
+ the rest:
13
18
 
14
19
  - [RUNNING.md](./RUNNING.md) — a live, BFF-backed dev loop against your own
15
20
  Warble build, and checking that the pieces still fit together.
@@ -20,10 +25,10 @@ daily build/test/typecheck loop. Three companion docs cover the rest:
20
25
 
21
26
  ## Developer preview
22
27
 
23
- `@wrenai/genbi` is at `0.0.0` and has not been published to npm. Nothing here is
24
- under a compatibility commitment yet — commands, environment variables and
25
- interfaces move without notice. The Codex runtime is supported in code but has
26
- not been exercised end to end; Claude is the one that is. See
28
+ `@wrenai/genbi` is published at `0.0.2`. Nothing here is under a compatibility
29
+ commitment yet — commands, environment variables and interfaces move without
30
+ notice. The Codex runtime is supported in code but has not been exercised end
31
+ to end; Claude is the one that is. See
27
32
  [MAINTAINING.md](./MAINTAINING.md#versioning) for what the version number does
28
33
  and does not promise.
29
34
 
@@ -40,8 +45,24 @@ pinned `@warble/*` packages are already pulled in by `pnpm install` — see
40
45
 
41
46
  ## Getting started
42
47
 
43
- This app lives in a pnpm workspace, so install JavaScript dependencies from
44
- the repo root:
48
+ ### Just run it
49
+
50
+ ```bash
51
+ WREN_HARNESS_WORKSPACE_ROOT=/absolute/path/to/an/empty/directory npx @wrenai/genbi
52
+ ```
53
+
54
+ That fetches the published package, downloads the Warble binary for your
55
+ platform on install, and serves the built UI and the BFF from one process on
56
+ `http://127.0.0.1:4787`. You still need a provider CLI you are logged in to
57
+ (`claude` or `codex`) and the `wren` CLI on `PATH`.
58
+ [INSTALL.md](./INSTALL.md) covers the prerequisites, what happens on first
59
+ start, and every other environment variable.
60
+
61
+ ### From source
62
+
63
+ Everything below is the development loop, and is only worth setting up if you
64
+ are changing the app. It lives in a pnpm workspace, so install JavaScript
65
+ dependencies from the repo root:
45
66
 
46
67
  ```bash
47
68
  corepack enable
@@ -41,10 +41,20 @@ export declare function collectBundleTierNames(bundle: {
41
41
  /** Reads the tier contract directly from a compiled Warble IR document. */
42
42
  export declare function collectIrTierNames(ir: unknown): string[];
43
43
  /**
44
- * Compiles the canonical profile source without rebinding its context and
45
- * extracts its tier contract from IR. This is intentionally independent of
46
- * auth choice and of any user project: the Setup form must discover the rows
47
- * before either exists.
44
+ * Reads the profile's tier contract, which the Setup form needs before an auth
45
+ * choice or a user project exists.
46
+ *
47
+ * A tier name is a static property of the profile — it comes from each
48
+ * `llm_calls[].tier` — so nothing here depends on what project is bound. The
49
+ * profile ships its own compiled IR next to it, so the contract is read from
50
+ * that and no Warble process runs at all.
51
+ *
52
+ * Compiling instead is the fallback, and only for a profile source that has no
53
+ * golden beside it (`WREN_HARNESS_PROFILE` pointed at someone's own profile
54
+ * tree). It is a fallback rather than the default because `warble compile`
55
+ * requires a resolvable context binding, and the shipped profiles are bound to
56
+ * a path that only resolves inside a checkout of this repository: in an
57
+ * installed package that compile fails, and the Setup form has no rows.
48
58
  */
49
59
  export declare function compileUnboundProfileTierNames(options: {
50
60
  readonly profileSource: string;
@@ -4,7 +4,7 @@
4
4
  * reads an API key only while constructing an in-memory in-process adapter spec.
5
5
  */
6
6
  import { createHash } from "node:crypto";
7
- import { mkdirSync, writeFileSync } from "node:fs";
7
+ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
8
8
  import { mkdtemp, readFile, rm } from "node:fs/promises";
9
9
  import { tmpdir } from "node:os";
10
10
  import path from "node:path";
@@ -233,12 +233,26 @@ export function collectIrTierNames(ir) {
233
233
  return [...seen];
234
234
  }
235
235
  /**
236
- * Compiles the canonical profile source without rebinding its context and
237
- * extracts its tier contract from IR. This is intentionally independent of
238
- * auth choice and of any user project: the Setup form must discover the rows
239
- * before either exists.
236
+ * Reads the profile's tier contract, which the Setup form needs before an auth
237
+ * choice or a user project exists.
238
+ *
239
+ * A tier name is a static property of the profile — it comes from each
240
+ * `llm_calls[].tier` — so nothing here depends on what project is bound. The
241
+ * profile ships its own compiled IR next to it, so the contract is read from
242
+ * that and no Warble process runs at all.
243
+ *
244
+ * Compiling instead is the fallback, and only for a profile source that has no
245
+ * golden beside it (`WREN_HARNESS_PROFILE` pointed at someone's own profile
246
+ * tree). It is a fallback rather than the default because `warble compile`
247
+ * requires a resolvable context binding, and the shipped profiles are bound to
248
+ * a path that only resolves inside a checkout of this repository: in an
249
+ * installed package that compile fails, and the Setup form has no rows.
240
250
  */
241
251
  export async function compileUnboundProfileTierNames(options) {
252
+ const goldenPath = path.join(path.resolve(options.profileSource), "ir.golden.json");
253
+ if (existsSync(goldenPath)) {
254
+ return collectIrTierNames(JSON.parse(await readFile(goldenPath, "utf8")));
255
+ }
242
256
  const workDir = await mkdtemp(path.join(tmpdir(), "wren-harness-runtime-tiers-"));
243
257
  try {
244
258
  const irPath = path.join(workDir, "ir.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrenai/genbi",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Wren GenBI — the web UI for WrenAI: ask questions of your data and get dashboards back",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [