@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
|
-
|
|
12
|
-
|
|
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.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
44
|
-
|
|
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
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
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
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
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");
|