fascicle 0.3.3 → 0.3.8
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 +57 -0
- package/README.md +58 -5
- package/dist/bin/fascicle-viewer.js +9 -0
- package/dist/index.d.ts +139 -3
- package/dist/index.js +1155 -6
- package/dist/index.js.map +1 -1
- package/dist/static/viewer.html +374 -0
- package/package.json +8 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.3.8 — 2026-05-06
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- `examples/mcp-server/` lint failures that blocked `prepublishOnly`: rewrote the `reverse_text` tool to use `Intl.Segmenter` + `Array#toReversed()` (grapheme-correct, lint-clean), and replaced the chained `as` casts in `client.ts:text_of` with a small `is_record` user-defined type guard. Smoke test output unchanged.
|
|
7
|
+
|
|
8
|
+
## v0.3.7 — 2026-05-05
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Public `fascicle/adapters` subpath exposing `filesystem_logger`, `filesystem_store`, `http_logger`, `tee_logger`, and `noop_logger`. Previously these adapters lived in workspace-private packages and were unreachable by `npm install fascicle` consumers despite being referenced throughout the docs.
|
|
12
|
+
- Minimal stdio MCP server example under `examples/mcp-server/`, demonstrating how to expose a `Step<i, o>` as an MCP tool.
|
|
13
|
+
- `CONTRIBUTING.md` with contribution guidelines, linked from the README.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- README hero illustration is now an animated mycelium diagram showing model_call, step, and tool fruiting from a shared substrate; viewer screenshot moved into the live-dashboard section.
|
|
17
|
+
- Documented two adapter limits in `docs/concepts.md`: `filesystem_logger` writes synchronously via `appendFileSync`, and the in-memory span stack in `filesystem_logger`/`http_logger` is not async-context-aware. README, getting-started, cookbook, and writing-a-harness all cross-reference the new "Adapter limits" section.
|
|
18
|
+
- README primitives count corrected to 18, with `loop` and `compose` listed in the table.
|
|
19
|
+
|
|
20
|
+
### Internal
|
|
21
|
+
- Added `docs/plans/menu.md` cataloguing considered-but-unshipped work.
|
|
22
|
+
|
|
23
|
+
## v0.3.6 — 2026-04-30
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
- `bench` primitive in `@repo/composites`: online counterpart to `learn`. `bench(flow, cases, judges, options?)` runs a flow against a fixture set, scores each output via judges, and returns a structured `BenchReport` with per-case results and summary (pass_rate, mean_scores per judge, total/mean cost). Per-case observability via `trajectory_dir` (one JSONL per case) and `live_url` (push to a viewer); both can be combined. Cost is tracked in-process by intercepting `cost` events on the trajectory pipeline.
|
|
27
|
+
- `judge_equals`, `judge_with`, `judge_llm` in `@repo/composites`: stock judges over `{ input, output, meta }`. `judge_llm` takes a `Step<string, string>` model so composites stays engine-free; users wire their own `model_call({...})` into the judge.
|
|
28
|
+
- `regression_compare`, `read_baseline`, `write_baseline`: diff two `BenchReport`s against `pass_rate`, per-judge means, and a relative cost threshold (default 10%). Doesn't short-circuit; full delta + per-case report.
|
|
29
|
+
- `tee_logger` adapter in `@repo/observability`: fan one `TrajectoryLogger` contract out to N sinks. First sink's `start_span` id is canonical; per-sink ids are translated back on `end_span`; sinks that throw don't derail the others.
|
|
30
|
+
- `examples/bench_reviewer.ts` + `bench/reviewer/{cases.json,baseline.json}`: end-to-end driver against `@repo/agents`'s `reviewer`. `WRITE_BASELINE=1` records, subsequent runs compare and exit 1 on regression.
|
|
31
|
+
- Cost rendering in the viewer: per-span cost badges that roll up the tree, plus a header running total (`<n> events · <m> errors · $<total>`). Run filter narrows the total. Cost attribution uses an open-span stack per `run_id`; format is 4 decimals under $0.01, 2 decimals otherwise.
|
|
32
|
+
- `examples/amplify` opt-in viewer push via `AMPLIFY_VIEWER_URL`: tees the on-disk trajectory with `http_logger` when set; standalone runs without the env var keep the existing single-sink behaviour.
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
- The viewer ships as part of the `fascicle` umbrella. `start_viewer` is importable from `'fascicle'`; the `fascicle-viewer` bin ships with the published tarball at `dist/bin/fascicle-viewer.js` (with `dist/static/viewer.html` copied alongside). `scripts/check-deps.mjs` now asserts inclusion (was: isolation). Runtime install graph stays free of HTTP-server deps because the viewer only uses `node:*` + `zod` + `@repo/core`.
|
|
36
|
+
- README promotes the viewer to a headline surface section with `pnpm dlx fascicle-viewer` and the programmatic `start_viewer` shape.
|
|
37
|
+
|
|
38
|
+
### Internal
|
|
39
|
+
- `scripts/build.mjs` copies `viewer.html` into `dist/static/` and writes a tiny `dist/bin/fascicle-viewer.js` shim that drives `run_viewer_cli` from the bundled umbrella; smoke test asserts `start_viewer` and `run_viewer_cli` are exported.
|
|
40
|
+
- `spec/eval.md` records the four-wedge plan and seven open questions surfaced during execution (judge_llm wiring, judge abstention encoding, bench parallelism, baseline `run_id` non-determinism, two viewer UI papercuts, and the live-amplify dogfood result: 51 events, $0.1725 cost, both transports verified end-to-end).
|
|
41
|
+
- `spec/viewer.md` reframed packaging and §12 done-def items 2–3 marked verified.
|
|
42
|
+
|
|
43
|
+
## v0.3.5 — 2026-04-30
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
- `@repo/viewer` package and `fascicle-viewer` CLI: minimal in-repo dev dashboard for visualizing a fascicle run as it executes. Single static HTML page (vanilla JS, no build step), an SSE-fed span tree with active/error/emit highlighting, and a click-to-expand event log. Two transports feed one in-process broadcaster: file-tail (`fascicle-viewer .trajectory.jsonl`) for the primary case and HTTP push (`fascicle-viewer --listen` plus the new `http_logger`) for low-latency or remote attach. Localhost-only by default. Programmatic embed via `start_viewer({...})`. See `packages/viewer/README.md`.
|
|
47
|
+
- `http_logger` adapter in `@repo/observability`: a `TrajectoryLogger` that POSTs each event as one line of NDJSON to a configured URL. Drops on transport error, never blocks the user flow. Wire format mirrors `filesystem_logger` byte-for-byte and parses back via `trajectory_event_schema`.
|
|
48
|
+
|
|
49
|
+
### Internal
|
|
50
|
+
- New ast-grep boundary rule (`rules/no-engine-import-from-viewer.yml`) keeps the viewer dev tool isolated from `@repo/engine`, composites, agents, the umbrella, stores, observability, and any provider SDK.
|
|
51
|
+
- `scripts/check-deps.mjs` gains a `check_viewer_isolation` invariant: `@repo/viewer` must not appear in `@repo/fascicle`'s dependency graph, so the published `fascicle` install graph stays free of HTTP-server deps.
|
|
52
|
+
- `spec/viewer.md` documents the v1 plan, scope boundaries, and the explicit non-goals that separate this dev tool from the larger `spec/studio.md` PDR.
|
|
53
|
+
|
|
54
|
+
## v0.3.4 — 2026-04-30
|
|
55
|
+
|
|
56
|
+
### Internal
|
|
57
|
+
- Switch to ASI-only style: trailing statement semicolons and multi-line interface/type-member separators removed across all TS sources.
|
|
58
|
+
- Add ast-grep rules (`no-semicolons`, `no-semicolons-types`) and a small orchestrator script (`scripts/strip-semicolons.mjs`) wired into `check:fix` to enforce the style going forward.
|
|
59
|
+
|
|
3
60
|
## v0.3.3 — 2026-04-29
|
|
4
61
|
|
|
5
62
|
### Added
|
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Fascicle
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Compose agents out of LLM calls, tool calls, and plain functions. Everything is a `Step<i, o>`. Wire steps together with 18 primitives (`sequence`, `parallel`, `branch`, `retry`, `loop`, `ensemble`, `checkpoint`, …) and run them as plain values. One `generate` surface fronts seven provider adapters: Anthropic, OpenAI, Google, OpenRouter, Ollama, LM Studio, and a `claude_cli` subprocess that drives the Claude Code CLI.
|
|
4
6
|
|
|
5
7
|
No framework lifecycle. No ambient state. No decorators. Adapters are passed in per run.
|
|
6
8
|
|
|
@@ -51,15 +53,37 @@ try {
|
|
|
51
53
|
|
|
52
54
|
## What's in the box
|
|
53
55
|
|
|
54
|
-
**Composition primitives (
|
|
56
|
+
**Composition primitives (18).** Every composer takes `Step<i, o>` and returns `Step<i, o>`. Anything that fits a step fits any composition of steps.
|
|
57
|
+
|
|
58
|
+
| Primitive | Shape |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| `step` | lift a plain function into `Step<i, o>` |
|
|
61
|
+
| `sequence` | run A then B then C, threading the value |
|
|
62
|
+
| `parallel` | run a named map of steps concurrently |
|
|
63
|
+
| `branch` | route on a predicate of the input |
|
|
64
|
+
| `map` | run a step per array element, optional concurrency cap |
|
|
65
|
+
| `pipe` | post-process an inner step's output with a plain function |
|
|
66
|
+
| `retry` | re-run on failure with exponential backoff |
|
|
67
|
+
| `fallback` | run a backup if the primary throws |
|
|
68
|
+
| `timeout` | cancel an inner step after N ms |
|
|
69
|
+
| `loop` | bounded iteration with carry-state and an optional convergence guard |
|
|
70
|
+
| `compose` | label a composite so it shows up by intent in trajectories |
|
|
71
|
+
| `adversarial` | build, critique, repeat until accept or `max_rounds` |
|
|
72
|
+
| `ensemble` | run N members, pick the highest-scoring result |
|
|
73
|
+
| `tournament` | single-elimination bracket |
|
|
74
|
+
| `consensus` | run N concurrently, accept only if `>= quorum` agree |
|
|
75
|
+
| `checkpoint` | memoize an inner step by key in a `CheckpointStore` |
|
|
76
|
+
| `suspend` | pause for external input; resume later with `resume_data` |
|
|
77
|
+
| `scope` / `stash` / `use` | named state across non-adjacent steps |
|
|
78
|
+
|
|
79
|
+
Plus `run`, `run.stream`, and `describe`.
|
|
55
80
|
|
|
56
81
|
**AI engine.** `create_engine(config)` returns one `generate` surface across seven providers. Aliases (`sonnet`, `opus`, `gpt-4o`, `cli-sonnet`, …) resolve to `provider:model_id`. Reasoning effort (`'low' | 'medium' | 'high'`) is translated per provider. Cost estimation uses a pricing table with per-engine overrides.
|
|
57
82
|
|
|
58
|
-
**Adapters injected per run.**
|
|
83
|
+
**Adapters injected per run.** Trajectory loggers and checkpoint stores ship under the `fascicle/adapters` subpath:
|
|
59
84
|
|
|
60
85
|
```typescript
|
|
61
|
-
import { filesystem_logger } from '
|
|
62
|
-
import { filesystem_store } from '@repo/stores';
|
|
86
|
+
import { filesystem_logger, filesystem_store } from 'fascicle/adapters';
|
|
63
87
|
|
|
64
88
|
await run(flow, input, {
|
|
65
89
|
trajectory: filesystem_logger({ output_path: '.trajectory.jsonl' }),
|
|
@@ -67,6 +91,8 @@ await run(flow, input, {
|
|
|
67
91
|
});
|
|
68
92
|
```
|
|
69
93
|
|
|
94
|
+
`filesystem_logger` writes synchronously and the bundled span stacks aren't async-context-aware — fine for dev tools and short-lived runs, see [docs/concepts.md](./docs/concepts.md#adapter-limits) before wiring it into a long-running server. The `TrajectoryLogger` and `CheckpointStore` contracts (exported from `fascicle`) are tiny — roll your own to push events to Honeycomb, S3, etc.
|
|
95
|
+
|
|
70
96
|
`run.stream(flow, input)` returns `{ events, result }` for incremental observation.
|
|
71
97
|
|
|
72
98
|
## Provider matrix
|
|
@@ -83,6 +109,28 @@ await run(flow, input, {
|
|
|
83
109
|
|
|
84
110
|
Full details: [docs/providers.md](./docs/providers.md). The `claude_cli` adapter has its own guide: [docs/cli.md](./docs/cli.md).
|
|
85
111
|
|
|
112
|
+
## Live dev dashboard
|
|
113
|
+
|
|
114
|
+

|
|
115
|
+
|
|
116
|
+
The `fascicle-viewer` bin ships with the umbrella package. Point it at a trajectory file and it opens a browser tree of spans, errors, and emits as the run executes:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
pnpm dlx fascicle-viewer .trajectory.jsonl
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Or embed it programmatically:
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
import { start_viewer } from 'fascicle';
|
|
126
|
+
|
|
127
|
+
const handle = await start_viewer({ port: 4242 });
|
|
128
|
+
// later
|
|
129
|
+
await handle.close();
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
For zero-latency streaming from inside a long-running flow, pair it with `http_logger` from `fascicle/adapters`. See [packages/viewer/README.md](./packages/viewer/README.md) for the full transport story.
|
|
133
|
+
|
|
86
134
|
## Where to go next
|
|
87
135
|
|
|
88
136
|
- [docs/getting-started.md](./docs/getting-started.md) — install and run your first flow
|
|
@@ -93,9 +141,14 @@ Full details: [docs/providers.md](./docs/providers.md). The `claude_cli` adapter
|
|
|
93
141
|
- [docs/cookbook.md](./docs/cookbook.md) — retries, fan-out, judges, HITL, tool loops
|
|
94
142
|
- [docs/writing-a-harness.md](./docs/writing-a-harness.md) — building a runner around fascicle
|
|
95
143
|
- [examples/](./examples/) — runnable reference flows
|
|
144
|
+
- [packages/viewer/README.md](./packages/viewer/README.md) — viewer details and transport options
|
|
96
145
|
|
|
97
146
|
## Contributing
|
|
98
147
|
|
|
148
|
+
Fascicle is early and not accepting outside pull requests yet. Bug reports and feature ideas via GitHub Issues are welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md).
|
|
149
|
+
|
|
150
|
+
## Development
|
|
151
|
+
|
|
99
152
|
This repo is a pnpm workspace. Internally the code is split into `@repo/core`, `@repo/engine`, `@repo/observability`, `@repo/stores`, and `@repo/fascicle` (umbrella). Only the umbrella reaches npm as `fascicle`. The split exists to enforce architectural boundaries (e.g. `@repo/core` cannot import adapters; only `@repo/config` reads `process.env`); fallow and the ast-grep rules in `rules/` police them.
|
|
100
153
|
|
|
101
154
|
```bash
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { pathToFileURL } from 'node:url';
|
|
3
|
+
import { dirname, resolve } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const dist_index = resolve(here, '..', 'index.js');
|
|
8
|
+
const mod = await import(pathToFileURL(dist_index).href);
|
|
9
|
+
await mod.run_viewer_cli(process.argv.slice(2));
|
package/dist/index.d.ts
CHANGED
|
@@ -325,7 +325,7 @@ type CustomTrajectoryEvent = z.infer<typeof custom_event_schema>;
|
|
|
325
325
|
type ParsedTrajectoryEvent = z.infer<typeof trajectory_event_schema>;
|
|
326
326
|
//#endregion
|
|
327
327
|
//#region packages/core/src/version.d.ts
|
|
328
|
-
declare const version = "0.3.
|
|
328
|
+
declare const version = "0.3.8";
|
|
329
329
|
//#endregion
|
|
330
330
|
//#region packages/core/src/index.d.ts
|
|
331
331
|
declare const flow_schema: {
|
|
@@ -882,8 +882,102 @@ type TournamentResult<o> = {
|
|
|
882
882
|
};
|
|
883
883
|
declare function tournament<i, o>(config: TournamentConfig<i, o>): Step<i, TournamentResult<o>>;
|
|
884
884
|
//#endregion
|
|
885
|
+
//#region packages/composites/src/bench.d.ts
|
|
886
|
+
type Score = {
|
|
887
|
+
readonly score: number;
|
|
888
|
+
readonly reason?: string;
|
|
889
|
+
};
|
|
890
|
+
type BenchCase<I> = {
|
|
891
|
+
readonly id: string;
|
|
892
|
+
readonly input: I;
|
|
893
|
+
readonly meta?: Readonly<Record<string, unknown>>;
|
|
894
|
+
};
|
|
895
|
+
type JudgeArgs<I, O> = {
|
|
896
|
+
readonly input: I;
|
|
897
|
+
readonly output: O;
|
|
898
|
+
readonly meta?: Readonly<Record<string, unknown>>;
|
|
899
|
+
};
|
|
900
|
+
type Judge<I, O, S = Score> = Step<JudgeArgs<I, O>, S | undefined>;
|
|
901
|
+
type CaseResult<I = unknown, O = unknown, S = Score> = {
|
|
902
|
+
readonly case_id: string;
|
|
903
|
+
readonly ok: boolean;
|
|
904
|
+
readonly output?: O;
|
|
905
|
+
readonly error?: string;
|
|
906
|
+
readonly scores: Record<string, S>;
|
|
907
|
+
readonly duration_ms: number;
|
|
908
|
+
readonly cost_usd: number;
|
|
909
|
+
readonly trajectory_path?: string;
|
|
910
|
+
readonly _input?: I;
|
|
911
|
+
};
|
|
912
|
+
type BenchSummary = {
|
|
913
|
+
readonly pass_rate: number;
|
|
914
|
+
readonly mean_scores: Record<string, number>;
|
|
915
|
+
readonly total_duration_ms: number;
|
|
916
|
+
readonly total_cost_usd: number;
|
|
917
|
+
readonly mean_cost_usd: number;
|
|
918
|
+
};
|
|
919
|
+
type BenchReport<I = unknown, O = unknown, S = Score> = {
|
|
920
|
+
readonly flow_name: string;
|
|
921
|
+
readonly run_id: string;
|
|
922
|
+
readonly cases: ReadonlyArray<CaseResult<I, O, S>>;
|
|
923
|
+
readonly summary: BenchSummary;
|
|
924
|
+
};
|
|
925
|
+
type BenchOptions = {
|
|
926
|
+
readonly concurrency?: number;
|
|
927
|
+
readonly on_case?: (result: CaseResult) => void;
|
|
928
|
+
readonly trajectory_dir?: string;
|
|
929
|
+
readonly live_url?: string;
|
|
930
|
+
readonly run_id?: string;
|
|
931
|
+
readonly install_signal_handlers?: boolean;
|
|
932
|
+
};
|
|
933
|
+
declare function bench<I, O, S = Score>(flow: Step<I, O>, cases: ReadonlyArray<BenchCase<I>>, judges: Record<string, Judge<I, O, S>>, options?: BenchOptions): Promise<BenchReport<I, O, S>>;
|
|
934
|
+
declare function normalize_score(raw: unknown): Score | undefined;
|
|
935
|
+
//#endregion
|
|
936
|
+
//#region packages/composites/src/judges.d.ts
|
|
937
|
+
declare function judge_equals<O>(): Judge<unknown, O>;
|
|
938
|
+
type JudgeWithFn<I, O> = (args: JudgeArgs<I, O>) => number | Score | undefined | Promise<number | Score | undefined>;
|
|
939
|
+
declare function judge_with<I, O>(fn: JudgeWithFn<I, O>): Judge<I, O>;
|
|
940
|
+
type JudgeLlmConfig = {
|
|
941
|
+
readonly model: Step<string, string>;
|
|
942
|
+
readonly rubric: string;
|
|
943
|
+
readonly scale?: {
|
|
944
|
+
readonly min: number;
|
|
945
|
+
readonly max: number;
|
|
946
|
+
};
|
|
947
|
+
};
|
|
948
|
+
declare function judge_llm<I, O>(config: JudgeLlmConfig): Judge<I, O>;
|
|
949
|
+
//#endregion
|
|
950
|
+
//#region packages/composites/src/regression.d.ts
|
|
951
|
+
type RegressionDelta = {
|
|
952
|
+
readonly metric: string;
|
|
953
|
+
readonly baseline: number;
|
|
954
|
+
readonly current: number;
|
|
955
|
+
readonly delta: number;
|
|
956
|
+
readonly is_regression: boolean;
|
|
957
|
+
};
|
|
958
|
+
type PerCaseDelta = {
|
|
959
|
+
readonly case_id: string;
|
|
960
|
+
readonly baseline?: CaseResult;
|
|
961
|
+
readonly current?: CaseResult;
|
|
962
|
+
readonly score_deltas: Record<string, number>;
|
|
963
|
+
readonly cost_delta: number;
|
|
964
|
+
readonly is_regression: boolean;
|
|
965
|
+
};
|
|
966
|
+
type RegressionReport = {
|
|
967
|
+
readonly ok: boolean;
|
|
968
|
+
readonly deltas: ReadonlyArray<RegressionDelta>;
|
|
969
|
+
readonly per_case: ReadonlyArray<PerCaseDelta>;
|
|
970
|
+
};
|
|
971
|
+
type RegressionCompareOptions = {
|
|
972
|
+
readonly score_threshold?: number;
|
|
973
|
+
readonly cost_threshold?: number;
|
|
974
|
+
};
|
|
975
|
+
declare function regression_compare(current: BenchReport, baseline: BenchReport, options?: RegressionCompareOptions): RegressionReport;
|
|
976
|
+
declare function read_baseline(path: string): Promise<BenchReport>;
|
|
977
|
+
declare function write_baseline(path: string, report: BenchReport): Promise<void>;
|
|
978
|
+
//#endregion
|
|
885
979
|
//#region packages/engine/src/version.d.ts
|
|
886
|
-
declare const version$1 = "0.3.
|
|
980
|
+
declare const version$1 = "0.3.8";
|
|
887
981
|
//#endregion
|
|
888
982
|
//#region packages/engine/src/providers/claude_cli/types.d.ts
|
|
889
983
|
/**
|
|
@@ -1301,5 +1395,47 @@ declare function model_call<T = unknown>(cfg: ModelCallConfig<T>): Step<ModelCal
|
|
|
1301
1395
|
//#region packages/fascicle/src/forward_standard_env.d.ts
|
|
1302
1396
|
declare function forward_standard_env(): Record<string, string>;
|
|
1303
1397
|
//#endregion
|
|
1304
|
-
|
|
1398
|
+
//#region packages/viewer/src/cli.d.ts
|
|
1399
|
+
/**
|
|
1400
|
+
* fascicle-viewer CLI.
|
|
1401
|
+
*
|
|
1402
|
+
* fascicle-viewer <path> # tail a JSONL file (primary)
|
|
1403
|
+
* fascicle-viewer --listen # accept HTTP push only
|
|
1404
|
+
* fascicle-viewer <path> --listen # both producers feed the same broadcaster
|
|
1405
|
+
*
|
|
1406
|
+
* Flags: --port <n> --host <h> --buffer <n> --no-open --help
|
|
1407
|
+
*
|
|
1408
|
+
* Defaults bind 127.0.0.1:4242 and open the user's default browser. SIGINT
|
|
1409
|
+
* shuts everything down cleanly. The CLI body is exposed as `run_viewer_cli`
|
|
1410
|
+
* so the umbrella's bin shim can drive it from a bundled `dist/index.js`.
|
|
1411
|
+
*/
|
|
1412
|
+
declare function run_viewer_cli(argv: readonly string[]): Promise<void>;
|
|
1413
|
+
//#endregion
|
|
1414
|
+
//#region packages/viewer/src/index.d.ts
|
|
1415
|
+
/**
|
|
1416
|
+
* Public surface for @repo/viewer.
|
|
1417
|
+
*
|
|
1418
|
+
* `start_viewer({ ... })` is the programmatic embed: spin up the server,
|
|
1419
|
+
* optionally start tailing a JSONL file, and return a handle that can stop
|
|
1420
|
+
* both. `start_viewer` only depends on @repo/core's wire-format schema; it
|
|
1421
|
+
* never reaches into the engine, composites, or any provider.
|
|
1422
|
+
*/
|
|
1423
|
+
type StartViewerOptions = {
|
|
1424
|
+
readonly path?: string;
|
|
1425
|
+
readonly host?: string;
|
|
1426
|
+
readonly port?: number;
|
|
1427
|
+
readonly buffer?: number;
|
|
1428
|
+
readonly on_parse_error?: (err: unknown, line: string) => void;
|
|
1429
|
+
readonly on_io_error?: (err: unknown) => void;
|
|
1430
|
+
readonly on_subscriber_error?: (err: unknown) => void;
|
|
1431
|
+
};
|
|
1432
|
+
type ViewerHandle = {
|
|
1433
|
+
readonly url: string;
|
|
1434
|
+
readonly host: string;
|
|
1435
|
+
readonly port: number;
|
|
1436
|
+
readonly close: () => Promise<void>;
|
|
1437
|
+
};
|
|
1438
|
+
declare function start_viewer(options?: StartViewerOptions): Promise<ViewerHandle>;
|
|
1439
|
+
//#endregion
|
|
1440
|
+
export { type AdversarialBuildInput, type AdversarialConfig, type AdversarialCritiqueResult, type AdversarialResult, type AliasTable, type AliasTarget, type AssistantContentPart, type BenchCase, type BenchOptions, type BenchReport, type BenchSummary, type BracketRecord, type Candidate, type CaseResult, type CheckpointStore, type ConsensusConfig, type ConsensusResult, type CostBreakdown, type CustomTrajectoryEvent, type DescribeOptions, type EffortLevel, type EmitEvent, type Engine, type EngineConfig, type EngineDefaults, type EnsembleConfig, type EnsembleResult, type EnsembleStepConfig, type EnsembleStepResult, type FinishReason, type FlowNode, type FlowValue, type GenerateOptions, type GenerateResult, type HistoryEntry, type ImproveBudget, type ImproveConfig, type ImproveResult, type ImproveRoundInput, type Improvement, type Judge, type JudgeArgs, type JudgeLlmConfig, type JudgeWithFn, type LearnConfig, type LearnInput, type LearnResult, type Lesson, type LoopConfig, type LoopGuardResult, type LoopResult, type Message, type ModelCallConfig, type ModelCallInput, type ParsedTrajectoryEvent, type PerCaseDelta, type Pricing, type PricingTable, type ProviderConfigMap, type ProviderInit, type RegressionCompareOptions, type RegressionDelta, type RegressionReport, type RetryFailureKind, type RetryPolicy, type RunContext, STEP_KINDS, type Score, type ScoredCandidate, type SpanEndEvent, type SpanStartEvent, type StartViewerOptions, type Step, type StepKind, type StepMetadata, type StepRecord, type StreamChunk, type Tool, type ToolApprovalHandler, type ToolApprovalRequest, type ToolCallRecord, type ToolExecContext, type TournamentConfig, type TournamentResult, type TrajectoryEvent, type TrajectoryLogger, type TrajectorySource, type UsageTotals, type UserContentPart, type ViewerHandle, aborted_error, adversarial, bench, branch, checkpoint, compose, consensus, version as core_version, create_engine, custom_event_schema, describe, describe_cycle_error, emit_event_schema, engine_config_error, version$1 as engine_version, ensemble, ensemble_step, fallback, flow_schema, forward_standard_env, improve, is_step_kind, judge_equals, judge_llm, judge_with, learn, loop, map, model_call, model_not_found_error, normalize_score, on_chunk_error, parallel, pipe, provider_capability_error, provider_error, provider_not_configured_error, rate_limit_error, read_baseline, regression_compare, resume_validation_error, retry, run, run_viewer_cli, schema_validation_error, scope, sequence, span_end_event_schema, span_start_event_schema, start_viewer, stash, step, suspend, suspended_error, timeout, timeout_error, tool_approval_denied_error, tool_error, tournament, trajectory_event_schema, use, write_baseline };
|
|
1305
1441
|
//# sourceMappingURL=index.d.ts.map
|