Skip to content

Commit 25a324a

Browse files
committed
sync(bfmono): fix(gambit-serve): root workspace state in invocation directory (+19 more) (bfmono@6c76075fa)
This PR is an automated gambitmono sync of bfmono Gambit packages. - Source: `packages/gambit/` - Core: `packages/gambit/packages/gambit-core/` - bfmono rev: 6c76075fa Changes: - 6c76075fa fix(gambit-serve): root workspace state in invocation directory - de75a3987 feat(gambit): ship faq openresponses interoperability updates - 11e0477a3 fix(gambit-sim): default test init when workspace has no saved messages - 14df328c7 test(gambit-simulator): cover test tab JSON input gating and payload wiring - 2e833821c feat(gambit-simulator): switch test tab schema inputs to JSON-only - 126087519 fix(simulator-ui): keep activity toggle visible and prevent collapse jump - 0c0366932 feat(simulator-ui): add test chat actions activity card parity - 72bb726e5 fix(gambit): guard artifact restore typing and stabilize reset-abort test - b65a0567e fix(gambit): harden CI import-map prep for bfmono and mirror layouts - 4a30aca91 fix(gambit): align standalone CI config deps and typing - 0e7914222 fix(providers): propagate abort signal in codex responses and add conformance coverage - b504cb290 fix(gambit): correct relative deck paths after core relocation - 5d9de8c94 fix(gambit): align verification artifacts after core relocation - f6036daeb refactor(gambit): move gambit-core under packages/gambit - 232e540c3 docs(gambit): migrate onboarding guidance to serve - 0ac740288 refactor(gambit): remove init-only runtime assets - 242793426 feat(gambit): remove init from CLI command surface - 4a3d18204 fix(gambit-ui): prevent build stop response from wiping chat transcript - 0efecdc13 feat(gambit): add serve --artifact restore workflow - 95a72fd53 chore(gambit-examples): rename root decks to PROMPT files Do not edit this repo directly; make changes in bfmono and re-run the sync.
1 parent 5356ee6 commit 25a324a

221 files changed

Lines changed: 32571 additions & 6612 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,37 @@ jobs:
5454
};
5555
const gambitPath = await findPath(
5656
[
57-
"deno.jsonc",
58-
"deno.json",
5957
"packages/gambit/deno.jsonc",
6058
"packages/gambit/deno.json",
59+
"deno.jsonc",
60+
"deno.json",
6161
],
6262
"gambit deno.json(c)",
6363
);
6464
const corePath = await findPath(
65-
["packages/gambit-core/deno.json"],
65+
[
66+
"packages/gambit-core/deno.json",
67+
"packages/gambit/packages/gambit-core/deno.json",
68+
],
6669
"gambit-core deno.json",
6770
);
6871
const gambit = parse(await Deno.readTextFile(gambitPath));
6972
const core = parse(await Deno.readTextFile(corePath));
73+
const unstable = new Set(Array.isArray(gambit.unstable) ? gambit.unstable : []);
74+
for (const flag of [
75+
"worker-options",
76+
"temporal",
77+
"net",
78+
"bundle",
79+
"webgpu",
80+
]) {
81+
unstable.add(flag);
82+
}
83+
gambit.unstable = [...unstable];
7084
const exportsMap = core.exports ?? {};
85+
const coreDir = corePath.includes("/")
86+
? corePath.slice(0, corePath.lastIndexOf("/"))
87+
: ".";
7188
const localImports = {};
7289
for (const [key, value] of Object.entries(exportsMap)) {
7390
if (typeof value !== "string") continue;
@@ -76,7 +93,7 @@ jobs:
7693
: key;
7794
const spec = `@bolt-foundry/gambit-core${suffix}`;
7895
const rel = value.startsWith("./") ? value.slice(2) : value;
79-
localImports[spec] = `./packages/gambit-core/${rel}`;
96+
localImports[spec] = `./${coreDir}/${rel}`;
8097
}
8198
gambit.imports = { ...(gambit.imports ?? {}), ...localImports };
8299
await Deno.writeTextFile(

.github/workflows/e2e-manual.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,37 @@ jobs:
4848
};
4949
const gambitPath = await findPath(
5050
[
51-
"deno.jsonc",
52-
"deno.json",
5351
"packages/gambit/deno.jsonc",
5452
"packages/gambit/deno.json",
53+
"deno.jsonc",
54+
"deno.json",
5555
],
5656
"gambit deno.json(c)",
5757
);
5858
const corePath = await findPath(
59-
["packages/gambit-core/deno.json"],
59+
[
60+
"packages/gambit-core/deno.json",
61+
"packages/gambit/packages/gambit-core/deno.json",
62+
],
6063
"gambit-core deno.json",
6164
);
6265
const gambit = parse(await Deno.readTextFile(gambitPath));
6366
const core = parse(await Deno.readTextFile(corePath));
67+
const unstable = new Set(Array.isArray(gambit.unstable) ? gambit.unstable : []);
68+
for (const flag of [
69+
"worker-options",
70+
"temporal",
71+
"net",
72+
"bundle",
73+
"webgpu",
74+
]) {
75+
unstable.add(flag);
76+
}
77+
gambit.unstable = [...unstable];
6478
const exportsMap = core.exports ?? {};
79+
const coreDir = corePath.includes("/")
80+
? corePath.slice(0, corePath.lastIndexOf("/"))
81+
: ".";
6582
const localImports = {};
6683
for (const [key, value] of Object.entries(exportsMap)) {
6784
if (typeof value !== "string") continue;
@@ -70,7 +87,7 @@ jobs:
7087
: key;
7188
const spec = `@bolt-foundry/gambit-core${suffix}`;
7289
const rel = value.startsWith("./") ? value.slice(2) : value;
73-
localImports[spec] = `./packages/gambit-core/${rel}`;
90+
localImports[spec] = `./${coreDir}/${rel}`;
7491
}
7592
gambit.imports = { ...(gambit.imports ?? {}), ...localImports };
7693
await Deno.writeTextFile(

.github/workflows/gambit-publish.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,37 @@ jobs:
5353
};
5454
const gambitPath = await findPath(
5555
[
56-
"deno.jsonc",
57-
"deno.json",
5856
"packages/gambit/deno.jsonc",
5957
"packages/gambit/deno.json",
58+
"deno.jsonc",
59+
"deno.json",
6060
],
6161
"gambit deno.json(c)",
6262
);
6363
const corePath = await findPath(
64-
["packages/gambit-core/deno.json"],
64+
[
65+
"packages/gambit-core/deno.json",
66+
"packages/gambit/packages/gambit-core/deno.json",
67+
],
6568
"gambit-core deno.json",
6669
);
6770
const gambit = parse(await Deno.readTextFile(gambitPath));
6871
const core = parse(await Deno.readTextFile(corePath));
72+
const unstable = new Set(Array.isArray(gambit.unstable) ? gambit.unstable : []);
73+
for (const flag of [
74+
"worker-options",
75+
"temporal",
76+
"net",
77+
"bundle",
78+
"webgpu",
79+
]) {
80+
unstable.add(flag);
81+
}
82+
gambit.unstable = [...unstable];
6983
const exportsMap = core.exports ?? {};
84+
const coreDir = corePath.includes("/")
85+
? corePath.slice(0, corePath.lastIndexOf("/"))
86+
: ".";
7087
const localImports = {};
7188
for (const [key, value] of Object.entries(exportsMap)) {
7289
if (typeof value !== "string") continue;
@@ -75,7 +92,7 @@ jobs:
7592
: key;
7693
const spec = `@bolt-foundry/gambit-core${suffix}`;
7794
const rel = value.startsWith("./") ? value.slice(2) : value;
78-
localImports[spec] = `./packages/gambit-core/${rel}`;
95+
localImports[spec] = `./${coreDir}/${rel}`;
7996
}
8097
gambit.imports = { ...(gambit.imports ?? {}), ...localImports };
8198
await Deno.writeTextFile(

.github/workflows/release-binaries.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,37 @@ jobs:
8383
};
8484
const gambitPath = await findPath(
8585
[
86-
"deno.jsonc",
87-
"deno.json",
8886
"packages/gambit/deno.jsonc",
8987
"packages/gambit/deno.json",
88+
"deno.jsonc",
89+
"deno.json",
9090
],
9191
"gambit deno.json(c)",
9292
);
9393
const corePath = await findPath(
94-
["packages/gambit-core/deno.json"],
94+
[
95+
"packages/gambit-core/deno.json",
96+
"packages/gambit/packages/gambit-core/deno.json",
97+
],
9598
"gambit-core deno.json",
9699
);
97100
const gambit = parse(await Deno.readTextFile(gambitPath));
98101
const core = parse(await Deno.readTextFile(corePath));
102+
const unstable = new Set(Array.isArray(gambit.unstable) ? gambit.unstable : []);
103+
for (const flag of [
104+
"worker-options",
105+
"temporal",
106+
"net",
107+
"bundle",
108+
"webgpu",
109+
]) {
110+
unstable.add(flag);
111+
}
112+
gambit.unstable = [...unstable];
99113
const exportsMap = core.exports ?? {};
114+
const coreDir = corePath.includes("/")
115+
? corePath.slice(0, corePath.lastIndexOf("/"))
116+
: ".";
100117
const localImports = {};
101118
for (const [key, value] of Object.entries(exportsMap)) {
102119
if (typeof value !== "string") continue;
@@ -105,7 +122,7 @@ jobs:
105122
: key;
106123
const spec = `@bolt-foundry/gambit-core${suffix}`;
107124
const rel = value.startsWith("./") ? value.slice(2) : value;
108-
localImports[spec] = `./packages/gambit-core/${rel}`;
125+
localImports[spec] = `./${coreDir}/${rel}`;
109126
}
110127
gambit.imports = { ...(gambit.imports ?? {}), ...localImports };
111128
await Deno.writeTextFile(

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ since = "849762245925cce325c04da1d604088370ec3723"
77

88
## Unreleased (v0.8.4)
99

10-
- TBD
10+
- feat(gambit): remove `gambit init`; onboarding now routes through
11+
`gambit serve`
12+
- feat(gambit): add `createDefaultedRuntime` and defaulted `runDeck` wrapper
13+
with CLI-equivalent provider/model routing for library callers
14+
- refactor(gambit): route CLI runtime/provider setup through shared
15+
`default_runtime` construction path
16+
- feat(demo-runner): migrate demo test-deck prompt generation to Gambit default
17+
runtime wrapper (no hardwired OpenRouter provider)
18+
- docs(gambit): add migration guidance for `runDeck` wrapper and `runDeckCore`
19+
replacement mapping
1120

1221
## v0.8.3
1322

README.md

Lines changed: 78 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@ npx @bolt-foundry/gambit demo
2222
Downloads example files (hello decks plus the `examples/` gallery) and sets
2323
environment variables.
2424

25-
To scaffold a starter project that you can customize, run:
25+
To start onboarding with the simulator, run:
2626

2727
```
28-
npx @bolt-foundry/gambit init my-project
28+
npx @bolt-foundry/gambit serve gambit/hello.deck.md
29+
open http://localhost:8000/debug
2930
```
3031

31-
This creates a structured skeleton (`decks/`, `actions/`, `graders/`, `tests/`,
32-
`schemas/`, `.gambit/`) with README guides so you can start authoring your own
33-
workflows immediately.
32+
Use the Build tab to draft your own workspace decks and scenarios.
3433

3534
Run an example in the terminal (`repl`):
3635

@@ -100,10 +99,10 @@ Drop into a REPL (streams by default):
10099
npx @bolt-foundry/gambit repl <deck>
101100
```
102101

103-
Run a persona against a root deck (test bot):
102+
Run a persona against a root deck (scenario):
104103

105104
```
106-
npx @bolt-foundry/gambit test-bot <root-deck> --test-deck <persona-deck>
105+
npx @bolt-foundry/gambit scenario <root-deck> --test-deck <persona-deck>
107106
```
108107

109108
Grade a saved session:
@@ -124,6 +123,23 @@ Tracing and state: 
124123
`--verbose` to print events\
125124
`--state <file>` to persist a session.
126125

126+
### Worker sandbox defaults
127+
128+
- Deck-executing CLI surfaces default to worker sandbox execution.
129+
- Use `--no-worker-sandbox` (or `--legacy-exec`) to force legacy in-process
130+
execution.
131+
- `--worker-sandbox` explicitly forces worker execution on.
132+
- `--sandbox` / `--no-sandbox` are deprecated aliases.
133+
- `gambit.toml` equivalent:
134+
```toml
135+
[execution]
136+
worker_sandbox = false # same as --no-worker-sandbox
137+
# legacy_exec = true # equivalent rollback toggle
138+
```
139+
140+
The npm launcher (`npx @bolt-foundry/gambit ...`) runs the Gambit CLI binary for
141+
your platform, so these defaults and flags apply there as well.
142+
127143
## Using the Simulator
128144

129145
The simulator is the local Debug UI that streams runs and renders traces.
@@ -173,6 +189,59 @@ Define `contextSchema`/`responseSchema` with Zod to validate IO, and implement\
173189
`ctx.spawnAndWait({ path, input })`. Emit structured trace events with\
174190
`ctx.log(...)`.
175191

192+
### Runtime defaults for programmatic `runDeck`
193+
194+
`runDeck` from `@bolt-foundry/gambit` now uses CLI-equivalent provider/model
195+
defaults (alias expansion, provider routing, fallback behavior).
196+
197+
Before (direct-provider setup in each caller):
198+
199+
```ts
200+
import { createOpenRouterProvider, runDeck } from "jsr:@bolt-foundry/gambit";
201+
202+
const provider = createOpenRouterProvider({
203+
apiKey: Deno.env.get("OPENROUTER_API_KEY")!,
204+
});
205+
await runDeck({
206+
path: "./root.deck.md",
207+
input: { message: "hi" },
208+
modelProvider: provider,
209+
});
210+
```
211+
212+
After (defaulted wrapper):
213+
214+
```ts
215+
import { runDeck } from "jsr:@bolt-foundry/gambit";
216+
217+
await runDeck({
218+
path: "./root.deck.md",
219+
input: { message: "hi" },
220+
});
221+
```
222+
223+
Per-runtime override (shared runtime object):
224+
225+
```ts
226+
import { createDefaultedRuntime, runDeck } from "jsr:@bolt-foundry/gambit";
227+
228+
const runtime = await createDefaultedRuntime({
229+
fallbackProvider: "codex-cli",
230+
});
231+
232+
await runDeck({
233+
runtime,
234+
path: "./root.deck.md",
235+
input: { message: "hi" },
236+
});
237+
```
238+
239+
Replacement mapping:
240+
241+
- Legacy direct core passthrough export: `runDeck` -> `runDeckCore`
242+
- Defaulted wrapper export: `runDeck`
243+
- Runtime builder: `createDefaultedRuntime`
244+
176245
---
177246

178247
## Author your first deck
@@ -271,8 +340,8 @@ npx @bolt-foundry/gambit serve ./examples/respond_flow/decks/root.deck.ts --port
271340
Then:
272341

273342
1. Open `http://localhost:8000/test`, pick the **Escalation persona**, and run
274-
it. Leave the “Use test deck input for init” toggle on to see persona data
275-
seed the init form automatically.
343+
it. Leave the “Use scenario deck input for init” toggle on to see persona
344+
data seed the init form automatically.
276345
2. Switch to the Debug tab to inspect the session—the child deck emits a
277346
`gambit_respond` payload that now shows up as a structured assistant turn.
278347
3. Head to the Calibrate tab and run the **Respond payload grader** to exercise
@@ -289,12 +358,6 @@ export OPENROUTER_API_KEY=...
289358
deno run -A jsr:@bolt-foundry/gambit/cli demo
290359
```
291360

292-
Starter project:
293-
294-
```
295-
deno run -A jsr:@bolt-foundry/gambit/cli init my-project
296-
```
297-
298361
Run a deck:
299362

300363
```

0 commit comments

Comments
 (0)