@bolt-foundry/gambit 0.6.3 → 0.6.4
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 +131 -132
- package/bin/gambit.cjs +3 -0
- package/esm/gambit/simulator-ui/dist/bundle.js +854 -889
- package/esm/gambit/simulator-ui/dist/bundle.js.map +4 -4
- package/esm/src/server.d.ts.map +1 -1
- package/esm/src/server.js +1 -0
- package/package.json +2 -2
- package/script/gambit/simulator-ui/dist/bundle.js +854 -889
- package/script/gambit/simulator-ui/dist/bundle.js.map +4 -4
- package/script/src/server.d.ts.map +1 -1
- package/script/src/server.js +1 -0
|
@@ -16651,9 +16651,226 @@ var require_client = __commonJS({
|
|
|
16651
16651
|
});
|
|
16652
16652
|
|
|
16653
16653
|
// simulator-ui/src/main.tsx
|
|
16654
|
+
var import_jsx_runtime2 = __toESM(require_jsx_runtime());
|
|
16655
|
+
var import_react2 = __toESM(require__());
|
|
16656
|
+
var import_client = __toESM(require_client());
|
|
16657
|
+
|
|
16658
|
+
// simulator-ui/src/DocsPage.tsx
|
|
16654
16659
|
var import_jsx_runtime = __toESM(require_jsx_runtime());
|
|
16655
16660
|
var import_react = __toESM(require__());
|
|
16656
|
-
var
|
|
16661
|
+
var GAMBIT_PACKAGE_README = "https://github.com/bolt-foundry/gambit/blob/main/README.md";
|
|
16662
|
+
var GAMBIT_CLI_DOC = "https://github.com/bolt-foundry/gambit/blob/main/docs/cli.md";
|
|
16663
|
+
function DocsPage(props) {
|
|
16664
|
+
const { deckDisplayPath: deckDisplayPath2, deckAbsolutePath } = props;
|
|
16665
|
+
const [deckSource, setDeckSource] = (0, import_react.useState)(null);
|
|
16666
|
+
const [loading, setLoading] = (0, import_react.useState)(true);
|
|
16667
|
+
const [error, setError] = (0, import_react.useState)(null);
|
|
16668
|
+
const [copied, setCopied] = (0, import_react.useState)(false);
|
|
16669
|
+
(0, import_react.useEffect)(() => {
|
|
16670
|
+
let cancelled = false;
|
|
16671
|
+
const load = async () => {
|
|
16672
|
+
setLoading(true);
|
|
16673
|
+
setError(null);
|
|
16674
|
+
try {
|
|
16675
|
+
const res = await fetch("/api/deck-source");
|
|
16676
|
+
if (!res.ok) throw new Error(res.statusText);
|
|
16677
|
+
const body = await res.json();
|
|
16678
|
+
if (cancelled) return;
|
|
16679
|
+
if (body.error) {
|
|
16680
|
+
setError(body.error);
|
|
16681
|
+
setDeckSource(body.content ?? null);
|
|
16682
|
+
} else {
|
|
16683
|
+
setDeckSource(body.content ?? "");
|
|
16684
|
+
}
|
|
16685
|
+
} catch (err) {
|
|
16686
|
+
if (cancelled) return;
|
|
16687
|
+
setError(err instanceof Error ? err.message : "Failed to load deck");
|
|
16688
|
+
} finally {
|
|
16689
|
+
if (!cancelled) setLoading(false);
|
|
16690
|
+
}
|
|
16691
|
+
};
|
|
16692
|
+
load();
|
|
16693
|
+
return () => {
|
|
16694
|
+
cancelled = true;
|
|
16695
|
+
};
|
|
16696
|
+
}, []);
|
|
16697
|
+
(0, import_react.useEffect)(() => {
|
|
16698
|
+
if (!copied) return;
|
|
16699
|
+
const handle = window.setTimeout(() => setCopied(false), 2e3);
|
|
16700
|
+
return () => window.clearTimeout(handle);
|
|
16701
|
+
}, [
|
|
16702
|
+
copied
|
|
16703
|
+
]);
|
|
16704
|
+
const handleCopyPath = (0, import_react.useCallback)(async () => {
|
|
16705
|
+
try {
|
|
16706
|
+
await navigator.clipboard?.writeText(deckAbsolutePath);
|
|
16707
|
+
setCopied(true);
|
|
16708
|
+
} catch {
|
|
16709
|
+
setCopied(true);
|
|
16710
|
+
}
|
|
16711
|
+
}, [
|
|
16712
|
+
deckAbsolutePath
|
|
16713
|
+
]);
|
|
16714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
16715
|
+
className: "docs-shell",
|
|
16716
|
+
children: [
|
|
16717
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
16718
|
+
className: "docs-hero",
|
|
16719
|
+
children: [
|
|
16720
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", {
|
|
16721
|
+
children: "Gambit Simulator"
|
|
16722
|
+
}),
|
|
16723
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
|
|
16724
|
+
children: [
|
|
16725
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", {
|
|
16726
|
+
children: "Use the simulator to iterate fast and fix failures."
|
|
16727
|
+
}),
|
|
16728
|
+
" ",
|
|
16729
|
+
"Run a test, capture why it failed, grade the result, and hand the evidence to Codex so it can help you update the deck."
|
|
16730
|
+
]
|
|
16731
|
+
}),
|
|
16732
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
16733
|
+
children: "The simulator keeps the whole loop in one place: Test Bot to explore, Calibrate to grade, and Debug to inspect."
|
|
16734
|
+
})
|
|
16735
|
+
]
|
|
16736
|
+
}),
|
|
16737
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
16738
|
+
className: "docs-grid",
|
|
16739
|
+
children: [
|
|
16740
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", {
|
|
16741
|
+
className: "docs-card",
|
|
16742
|
+
children: [
|
|
16743
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
|
|
16744
|
+
children: "Run the test"
|
|
16745
|
+
}),
|
|
16746
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
16747
|
+
children: "Open Test Bot and try the scenario you care about. If the output looks wrong, add a rating and a short reason so the failure is captured."
|
|
16748
|
+
})
|
|
16749
|
+
]
|
|
16750
|
+
}),
|
|
16751
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", {
|
|
16752
|
+
className: "docs-card",
|
|
16753
|
+
children: [
|
|
16754
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
|
|
16755
|
+
children: "Grade"
|
|
16756
|
+
}),
|
|
16757
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
16758
|
+
children: "Run the grader in Calibrate. Copy a reference or the state file link for sharing."
|
|
16759
|
+
})
|
|
16760
|
+
]
|
|
16761
|
+
}),
|
|
16762
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", {
|
|
16763
|
+
className: "docs-card",
|
|
16764
|
+
children: [
|
|
16765
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
|
|
16766
|
+
children: "Fix + rerun"
|
|
16767
|
+
}),
|
|
16768
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
16769
|
+
children: "Paste the reference or state link into Codex and ask for help fixing the deck. Codex updates files, then you rerun the simulator to verify."
|
|
16770
|
+
})
|
|
16771
|
+
]
|
|
16772
|
+
})
|
|
16773
|
+
]
|
|
16774
|
+
}),
|
|
16775
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
16776
|
+
className: "deck-preview-shell",
|
|
16777
|
+
children: [
|
|
16778
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", {
|
|
16779
|
+
children: [
|
|
16780
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
16781
|
+
children: [
|
|
16782
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
|
|
16783
|
+
children: "Current deck"
|
|
16784
|
+
}),
|
|
16785
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
16786
|
+
children: "Edit this file in your editor. After changes, rerun or refresh the simulator."
|
|
16787
|
+
})
|
|
16788
|
+
]
|
|
16789
|
+
}),
|
|
16790
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
16791
|
+
className: "deck-preview-meta",
|
|
16792
|
+
children: [
|
|
16793
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
16794
|
+
children: [
|
|
16795
|
+
"Path: ",
|
|
16796
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", {
|
|
16797
|
+
children: deckDisplayPath2
|
|
16798
|
+
})
|
|
16799
|
+
]
|
|
16800
|
+
}),
|
|
16801
|
+
" ",
|
|
16802
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
16803
|
+
type: "button",
|
|
16804
|
+
onClick: handleCopyPath,
|
|
16805
|
+
children: copied ? "Copied" : "Copy path"
|
|
16806
|
+
})
|
|
16807
|
+
]
|
|
16808
|
+
})
|
|
16809
|
+
]
|
|
16810
|
+
}),
|
|
16811
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
16812
|
+
className: "deck-preview-body",
|
|
16813
|
+
children: [
|
|
16814
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
16815
|
+
className: "placeholder",
|
|
16816
|
+
children: "Loading deck\u2026"
|
|
16817
|
+
}),
|
|
16818
|
+
!loading && error && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
16819
|
+
className: "error",
|
|
16820
|
+
children: [
|
|
16821
|
+
"Failed to read deck: ",
|
|
16822
|
+
error
|
|
16823
|
+
]
|
|
16824
|
+
}),
|
|
16825
|
+
!loading && !error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
|
|
16826
|
+
className: "deck-preview",
|
|
16827
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", {
|
|
16828
|
+
children: deckSource ?? ""
|
|
16829
|
+
})
|
|
16830
|
+
})
|
|
16831
|
+
]
|
|
16832
|
+
})
|
|
16833
|
+
]
|
|
16834
|
+
}),
|
|
16835
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
16836
|
+
className: "docs-links",
|
|
16837
|
+
children: [
|
|
16838
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
|
|
16839
|
+
children: "More docs"
|
|
16840
|
+
}),
|
|
16841
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("ul", {
|
|
16842
|
+
children: [
|
|
16843
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", {
|
|
16844
|
+
children: [
|
|
16845
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
16846
|
+
href: GAMBIT_PACKAGE_README,
|
|
16847
|
+
target: "_blank",
|
|
16848
|
+
rel: "noreferrer",
|
|
16849
|
+
children: "README.md"
|
|
16850
|
+
}),
|
|
16851
|
+
" ",
|
|
16852
|
+
"\u2014 architecture, concepts, release notes."
|
|
16853
|
+
]
|
|
16854
|
+
}),
|
|
16855
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", {
|
|
16856
|
+
children: [
|
|
16857
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
16858
|
+
href: GAMBIT_CLI_DOC,
|
|
16859
|
+
target: "_blank",
|
|
16860
|
+
rel: "noreferrer",
|
|
16861
|
+
children: "docs/cli.md"
|
|
16862
|
+
}),
|
|
16863
|
+
" ",
|
|
16864
|
+
"\u2014 CLI commands, flags, and workflows."
|
|
16865
|
+
]
|
|
16866
|
+
})
|
|
16867
|
+
]
|
|
16868
|
+
})
|
|
16869
|
+
]
|
|
16870
|
+
})
|
|
16871
|
+
]
|
|
16872
|
+
});
|
|
16873
|
+
}
|
|
16657
16874
|
|
|
16658
16875
|
// simulator-ui/src/styles.ts
|
|
16659
16876
|
var globalStyles = `
|
|
@@ -16742,10 +16959,10 @@ code:not(pre *) {
|
|
|
16742
16959
|
}
|
|
16743
16960
|
button.ghost-btn,
|
|
16744
16961
|
a.ghost-btn {
|
|
16745
|
-
border: 1px solid
|
|
16962
|
+
border: 1px solid transparent;
|
|
16746
16963
|
border-radius: 10px;
|
|
16747
16964
|
padding: 8px 14px;
|
|
16748
|
-
background:
|
|
16965
|
+
background: transparent;
|
|
16749
16966
|
cursor: pointer;
|
|
16750
16967
|
font-weight: 600;
|
|
16751
16968
|
text-decoration: none;
|
|
@@ -16755,6 +16972,11 @@ a.ghost-btn {
|
|
|
16755
16972
|
justify-content: center;
|
|
16756
16973
|
gap: 6px;
|
|
16757
16974
|
}
|
|
16975
|
+
button.ghost-btn:hover,
|
|
16976
|
+
a.ghost-btn:hover {
|
|
16977
|
+
border: 1px solid #cbd5e1;
|
|
16978
|
+
background: #f1f5f9;
|
|
16979
|
+
}
|
|
16758
16980
|
button.primary,
|
|
16759
16981
|
a.primary {
|
|
16760
16982
|
border: 1px solid #0b93f6;
|
|
@@ -16770,6 +16992,11 @@ a.primary {
|
|
|
16770
16992
|
justify-content: center;
|
|
16771
16993
|
gap: 6px;
|
|
16772
16994
|
}
|
|
16995
|
+
button.primary:hover,
|
|
16996
|
+
a.primary:hover {
|
|
16997
|
+
background: #0a83e0;
|
|
16998
|
+
border-color: #0a83e0;
|
|
16999
|
+
}
|
|
16773
17000
|
button.primary:disabled {
|
|
16774
17001
|
opacity: 0.6;
|
|
16775
17002
|
cursor: not-allowed;
|
|
@@ -16797,6 +17024,9 @@ button.primary:disabled {
|
|
|
16797
17024
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
16798
17025
|
font-size: 12px;
|
|
16799
17026
|
color: #0f172a;
|
|
17027
|
+
overflow: hidden;
|
|
17028
|
+
white-space: nowrap;
|
|
17029
|
+
text-overflow: ellipsis;
|
|
16800
17030
|
}
|
|
16801
17031
|
.copy-badge .copy-label {
|
|
16802
17032
|
font-weight: 600;
|
|
@@ -17826,6 +18056,15 @@ button.primary:disabled {
|
|
|
17826
18056
|
cursor: pointer;
|
|
17827
18057
|
font-weight: 600;
|
|
17828
18058
|
}
|
|
18059
|
+
.top-nav button.top-nav-link {
|
|
18060
|
+
border-color: transparent;
|
|
18061
|
+
background: transparent;
|
|
18062
|
+
color: #0f172a;
|
|
18063
|
+
}
|
|
18064
|
+
.top-nav button.top-nav-link:hover {
|
|
18065
|
+
border-color: #cbd5e1;
|
|
18066
|
+
background: #f8fafc;
|
|
18067
|
+
}
|
|
17829
18068
|
.top-nav button.active {
|
|
17830
18069
|
background: #0b93f6;
|
|
17831
18070
|
color: white;
|
|
@@ -18195,9 +18434,6 @@ var DURABLE_STREAM_PREFIX = "/api/durable-streams/stream/";
|
|
|
18195
18434
|
var SIMULATOR_STREAM_ID = "gambit-simulator";
|
|
18196
18435
|
var TEST_BOT_STREAM_ID = "gambit-test-bot";
|
|
18197
18436
|
var CALIBRATE_STREAM_ID = "gambit-calibrate";
|
|
18198
|
-
var GAMBIT_MESSAGING_SPINE_DOC = "/@fs/bolt-foundry/bfmono/docs/internal/_memos/2-areas/marketing/gambit-messaging/2025-12-31-gambit-messaging-spine.md";
|
|
18199
|
-
var GAMBIT_PACKAGE_README = "/@fs/bolt-foundry/bfmono/packages/gambit/README.md";
|
|
18200
|
-
var GAMBIT_CLI_DOC = "/@fs/bolt-foundry/bfmono/packages/gambit/docs/cli.md";
|
|
18201
18437
|
function getDurableStreamOffset(streamId) {
|
|
18202
18438
|
try {
|
|
18203
18439
|
const raw = window.localStorage.getItem(`gambit.durable-streams.offset.${streamId}`);
|
|
@@ -18224,14 +18460,14 @@ var globalStyleEl = document.createElement("style");
|
|
|
18224
18460
|
globalStyleEl.textContent = globalStyles;
|
|
18225
18461
|
document.head.appendChild(globalStyleEl);
|
|
18226
18462
|
function useSimulator() {
|
|
18227
|
-
const [connectionStatus, setConnectionStatus] = (0,
|
|
18228
|
-
const [savedState, setSavedState] = (0,
|
|
18229
|
-
const [traceEvents, setTraceEvents] = (0,
|
|
18230
|
-
const [errors, setErrors] = (0,
|
|
18231
|
-
const [streamText, setStreamText] = (0,
|
|
18232
|
-
const [isRunning, setIsRunning] = (0,
|
|
18233
|
-
const [connectSeq, setConnectSeq] = (0,
|
|
18234
|
-
(0,
|
|
18463
|
+
const [connectionStatus, setConnectionStatus] = (0, import_react2.useState)("connecting");
|
|
18464
|
+
const [savedState, setSavedState] = (0, import_react2.useState)(null);
|
|
18465
|
+
const [traceEvents, setTraceEvents] = (0, import_react2.useState)([]);
|
|
18466
|
+
const [errors, setErrors] = (0, import_react2.useState)([]);
|
|
18467
|
+
const [streamText, setStreamText] = (0, import_react2.useState)("");
|
|
18468
|
+
const [isRunning, setIsRunning] = (0, import_react2.useState)(false);
|
|
18469
|
+
const [connectSeq, setConnectSeq] = (0, import_react2.useState)(0);
|
|
18470
|
+
(0, import_react2.useEffect)(() => {
|
|
18235
18471
|
const streamId = SIMULATOR_STREAM_ID;
|
|
18236
18472
|
const streamUrl = buildDurableStreamUrl(streamId, getDurableStreamOffset(streamId));
|
|
18237
18473
|
const source = new EventSource(streamUrl);
|
|
@@ -18300,7 +18536,7 @@ function useSimulator() {
|
|
|
18300
18536
|
}, [
|
|
18301
18537
|
connectSeq
|
|
18302
18538
|
]);
|
|
18303
|
-
const run = (0,
|
|
18539
|
+
const run = (0, import_react2.useCallback)(async (opts) => {
|
|
18304
18540
|
setIsRunning(true);
|
|
18305
18541
|
setStreamText("");
|
|
18306
18542
|
const sessionId = opts.resetState ? void 0 : savedState?.meta?.sessionId;
|
|
@@ -18335,7 +18571,7 @@ function useSimulator() {
|
|
|
18335
18571
|
}, [
|
|
18336
18572
|
savedState?.meta?.sessionId
|
|
18337
18573
|
]);
|
|
18338
|
-
const sendFeedback = (0,
|
|
18574
|
+
const sendFeedback = (0, import_react2.useCallback)(async (messageRefId, score, reason) => {
|
|
18339
18575
|
const sessionId = savedState?.meta?.sessionId;
|
|
18340
18576
|
if (!sessionId) return;
|
|
18341
18577
|
try {
|
|
@@ -18362,7 +18598,7 @@ function useSimulator() {
|
|
|
18362
18598
|
}, [
|
|
18363
18599
|
savedState?.meta?.sessionId
|
|
18364
18600
|
]);
|
|
18365
|
-
const loadSession = (0,
|
|
18601
|
+
const loadSession = (0, import_react2.useCallback)(async (sessionId) => {
|
|
18366
18602
|
try {
|
|
18367
18603
|
const res = await fetch("/api/simulator/load-session", {
|
|
18368
18604
|
method: "POST",
|
|
@@ -18391,7 +18627,7 @@ function useSimulator() {
|
|
|
18391
18627
|
]);
|
|
18392
18628
|
}
|
|
18393
18629
|
}, []);
|
|
18394
|
-
const saveNotes = (0,
|
|
18630
|
+
const saveNotes = (0, import_react2.useCallback)(async (text) => {
|
|
18395
18631
|
const sessionId = savedState?.meta?.sessionId;
|
|
18396
18632
|
if (!sessionId) return;
|
|
18397
18633
|
try {
|
|
@@ -18416,7 +18652,7 @@ function useSimulator() {
|
|
|
18416
18652
|
}, [
|
|
18417
18653
|
savedState?.meta?.sessionId
|
|
18418
18654
|
]);
|
|
18419
|
-
const saveSessionScore = (0,
|
|
18655
|
+
const saveSessionScore = (0, import_react2.useCallback)(async (score) => {
|
|
18420
18656
|
const sessionId = savedState?.meta?.sessionId;
|
|
18421
18657
|
if (!sessionId) return;
|
|
18422
18658
|
try {
|
|
@@ -18441,10 +18677,10 @@ function useSimulator() {
|
|
|
18441
18677
|
}, [
|
|
18442
18678
|
savedState?.meta?.sessionId
|
|
18443
18679
|
]);
|
|
18444
|
-
const reconnect = (0,
|
|
18680
|
+
const reconnect = (0, import_react2.useCallback)(() => {
|
|
18445
18681
|
setConnectSeq((prev) => prev + 1);
|
|
18446
18682
|
}, []);
|
|
18447
|
-
const resetLocal = (0,
|
|
18683
|
+
const resetLocal = (0, import_react2.useCallback)(() => {
|
|
18448
18684
|
setSavedState(null);
|
|
18449
18685
|
setTraceEvents([]);
|
|
18450
18686
|
setErrors([]);
|
|
@@ -18467,10 +18703,10 @@ function useSimulator() {
|
|
|
18467
18703
|
};
|
|
18468
18704
|
}
|
|
18469
18705
|
function useSessions() {
|
|
18470
|
-
const [sessions, setSessions] = (0,
|
|
18471
|
-
const [loading, setLoading] = (0,
|
|
18472
|
-
const [error, setError] = (0,
|
|
18473
|
-
const refresh = (0,
|
|
18706
|
+
const [sessions, setSessions] = (0, import_react2.useState)([]);
|
|
18707
|
+
const [loading, setLoading] = (0, import_react2.useState)(false);
|
|
18708
|
+
const [error, setError] = (0, import_react2.useState)(null);
|
|
18709
|
+
const refresh = (0, import_react2.useCallback)(async () => {
|
|
18474
18710
|
setLoading(true);
|
|
18475
18711
|
setError(null);
|
|
18476
18712
|
try {
|
|
@@ -18484,7 +18720,7 @@ function useSessions() {
|
|
|
18484
18720
|
setLoading(false);
|
|
18485
18721
|
}
|
|
18486
18722
|
}, []);
|
|
18487
|
-
const deleteSession = (0,
|
|
18723
|
+
const deleteSession = (0, import_react2.useCallback)(async (sessionId) => {
|
|
18488
18724
|
setLoading(true);
|
|
18489
18725
|
setError(null);
|
|
18490
18726
|
try {
|
|
@@ -18617,9 +18853,9 @@ function parseGradingRef(ref) {
|
|
|
18617
18853
|
}
|
|
18618
18854
|
function CopyBadge(props) {
|
|
18619
18855
|
const { label, displayValue, copyValue, className } = props;
|
|
18620
|
-
const [copied, setCopied] = (0,
|
|
18621
|
-
const timeoutRef = (0,
|
|
18622
|
-
(0,
|
|
18856
|
+
const [copied, setCopied] = (0, import_react2.useState)(false);
|
|
18857
|
+
const timeoutRef = (0, import_react2.useRef)(void 0);
|
|
18858
|
+
(0, import_react2.useEffect)(() => {
|
|
18623
18859
|
return () => {
|
|
18624
18860
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
18625
18861
|
};
|
|
@@ -18627,7 +18863,7 @@ function CopyBadge(props) {
|
|
|
18627
18863
|
const copyTarget = copyValue ?? displayValue;
|
|
18628
18864
|
if (!copyTarget) return null;
|
|
18629
18865
|
const text = displayValue ?? copyTarget;
|
|
18630
|
-
const handleCopy = (0,
|
|
18866
|
+
const handleCopy = (0, import_react2.useCallback)(async () => {
|
|
18631
18867
|
try {
|
|
18632
18868
|
if (navigator.clipboard?.writeText) {
|
|
18633
18869
|
await navigator.clipboard.writeText(copyTarget);
|
|
@@ -18649,23 +18885,23 @@ function CopyBadge(props) {
|
|
|
18649
18885
|
}, [
|
|
18650
18886
|
copyTarget
|
|
18651
18887
|
]);
|
|
18652
|
-
return /* @__PURE__ */ (0,
|
|
18888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", {
|
|
18653
18889
|
type: "button",
|
|
18654
18890
|
className: classNames("copy-badge", className, copied && "copied"),
|
|
18655
18891
|
onClick: handleCopy,
|
|
18656
18892
|
title: copied ? "Copied!" : `Click to copy ${label}`,
|
|
18657
18893
|
children: [
|
|
18658
|
-
/* @__PURE__ */ (0,
|
|
18894
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", {
|
|
18659
18895
|
className: "copy-label",
|
|
18660
18896
|
children: [
|
|
18661
18897
|
label,
|
|
18662
18898
|
":"
|
|
18663
18899
|
]
|
|
18664
18900
|
}),
|
|
18665
|
-
/* @__PURE__ */ (0,
|
|
18901
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", {
|
|
18666
18902
|
children: text
|
|
18667
18903
|
}),
|
|
18668
|
-
copied && /* @__PURE__ */ (0,
|
|
18904
|
+
copied && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
18669
18905
|
className: "copy-feedback",
|
|
18670
18906
|
children: "Copied"
|
|
18671
18907
|
})
|
|
@@ -18812,8 +19048,8 @@ function extractInitFromTraces(traces) {
|
|
|
18812
19048
|
}
|
|
18813
19049
|
function ConversationView(props) {
|
|
18814
19050
|
const { messages, header, onScore, onReasonChange, emptyState } = props;
|
|
18815
|
-
const containerRef = (0,
|
|
18816
|
-
(0,
|
|
19051
|
+
const containerRef = (0, import_react2.useRef)(null);
|
|
19052
|
+
(0, import_react2.useEffect)(() => {
|
|
18817
19053
|
const el = containerRef.current;
|
|
18818
19054
|
if (!el) return;
|
|
18819
19055
|
const frame = requestAnimationFrame(() => {
|
|
@@ -18823,19 +19059,19 @@ function ConversationView(props) {
|
|
|
18823
19059
|
}, [
|
|
18824
19060
|
messages.length
|
|
18825
19061
|
]);
|
|
18826
|
-
return /* @__PURE__ */ (0,
|
|
19062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
18827
19063
|
className: "chat-column",
|
|
18828
19064
|
ref: containerRef,
|
|
18829
19065
|
children: [
|
|
18830
19066
|
header,
|
|
18831
|
-
messages.map((entry, idx) => /* @__PURE__ */ (0,
|
|
19067
|
+
messages.map((entry, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MessageBubble, {
|
|
18832
19068
|
entry,
|
|
18833
19069
|
onScore,
|
|
18834
19070
|
onReasonChange
|
|
18835
19071
|
}, entry.id ?? idx)),
|
|
18836
|
-
messages.length === 0 && (emptyState ?? /* @__PURE__ */ (0,
|
|
19072
|
+
messages.length === 0 && (emptyState ?? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
18837
19073
|
className: "empty-state",
|
|
18838
|
-
children: /* @__PURE__ */ (0,
|
|
19074
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", {
|
|
18839
19075
|
children: "No conversation yet. Start a new chat to begin testing."
|
|
18840
19076
|
})
|
|
18841
19077
|
}))
|
|
@@ -18849,30 +19085,30 @@ function MessageBubble(props) {
|
|
|
18849
19085
|
const className = classNames("bubble", role === "user" ? "bubble-user" : "bubble-assistant");
|
|
18850
19086
|
const messageRefId = entry.id;
|
|
18851
19087
|
const content = entry.message.content ?? "";
|
|
18852
|
-
return /* @__PURE__ */ (0,
|
|
19088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
18853
19089
|
className: "chat-row",
|
|
18854
|
-
children: /* @__PURE__ */ (0,
|
|
19090
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
18855
19091
|
className,
|
|
18856
19092
|
children: [
|
|
18857
|
-
/* @__PURE__ */ (0,
|
|
19093
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
18858
19094
|
className: "bubble-role",
|
|
18859
19095
|
children: role
|
|
18860
19096
|
}),
|
|
18861
|
-
content && !isTool && /* @__PURE__ */ (0,
|
|
19097
|
+
content && !isTool && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
18862
19098
|
className: "bubble-text",
|
|
18863
19099
|
dangerouslySetInnerHTML: {
|
|
18864
19100
|
__html: renderMarkdown(content)
|
|
18865
19101
|
}
|
|
18866
19102
|
}),
|
|
18867
|
-
content && isTool && /* @__PURE__ */ (0,
|
|
19103
|
+
content && isTool && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pre", {
|
|
18868
19104
|
className: "bubble-json",
|
|
18869
19105
|
children: content
|
|
18870
19106
|
}),
|
|
18871
|
-
!content && entry.message.tool_calls && /* @__PURE__ */ (0,
|
|
19107
|
+
!content && entry.message.tool_calls && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pre", {
|
|
18872
19108
|
className: "bubble-json",
|
|
18873
19109
|
children: JSON.stringify(entry.message.tool_calls, null, 2)
|
|
18874
19110
|
}),
|
|
18875
|
-
messageRefId && role !== "user" && /* @__PURE__ */ (0,
|
|
19111
|
+
messageRefId && role !== "user" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FeedbackControls, {
|
|
18876
19112
|
messageRefId,
|
|
18877
19113
|
feedback: entry.feedback,
|
|
18878
19114
|
onScore,
|
|
@@ -18888,12 +19124,12 @@ function renderMarkdown(text) {
|
|
|
18888
19124
|
}
|
|
18889
19125
|
function FeedbackControls(props) {
|
|
18890
19126
|
const { messageRefId, feedback, onScore, onReasonChange } = props;
|
|
18891
|
-
const [reason, setReason] = (0,
|
|
18892
|
-
const [opened, setOpened] = (0,
|
|
18893
|
-
const [localScore, setLocalScore] = (0,
|
|
18894
|
-
const [status, setStatus] = (0,
|
|
18895
|
-
const lastSentRef = (0,
|
|
18896
|
-
(0,
|
|
19127
|
+
const [reason, setReason] = (0, import_react2.useState)(feedback?.reason ?? "");
|
|
19128
|
+
const [opened, setOpened] = (0, import_react2.useState)(false);
|
|
19129
|
+
const [localScore, setLocalScore] = (0, import_react2.useState)(null);
|
|
19130
|
+
const [status, setStatus] = (0, import_react2.useState)("idle");
|
|
19131
|
+
const lastSentRef = (0, import_react2.useRef)(null);
|
|
19132
|
+
(0, import_react2.useEffect)(() => {
|
|
18897
19133
|
setReason(feedback?.reason ?? "");
|
|
18898
19134
|
if (feedback?.reason !== void 0) {
|
|
18899
19135
|
setStatus("saved");
|
|
@@ -18903,7 +19139,7 @@ function FeedbackControls(props) {
|
|
|
18903
19139
|
}, [
|
|
18904
19140
|
feedback?.reason
|
|
18905
19141
|
]);
|
|
18906
|
-
(0,
|
|
19142
|
+
(0, import_react2.useEffect)(() => {
|
|
18907
19143
|
if (typeof feedback?.score === "number") {
|
|
18908
19144
|
setLocalScore(feedback.score);
|
|
18909
19145
|
setOpened(true);
|
|
@@ -18912,7 +19148,7 @@ function FeedbackControls(props) {
|
|
|
18912
19148
|
feedback?.score
|
|
18913
19149
|
]);
|
|
18914
19150
|
const effectiveScore = typeof feedback?.score === "number" ? feedback.score : localScore;
|
|
18915
|
-
(0,
|
|
19151
|
+
(0, import_react2.useEffect)(() => {
|
|
18916
19152
|
if (typeof effectiveScore !== "number") return;
|
|
18917
19153
|
if (status !== "unsaved") return;
|
|
18918
19154
|
const handle = window.setTimeout(() => {
|
|
@@ -18928,7 +19164,7 @@ function FeedbackControls(props) {
|
|
|
18928
19164
|
onReasonChange,
|
|
18929
19165
|
messageRefId
|
|
18930
19166
|
]);
|
|
18931
|
-
(0,
|
|
19167
|
+
(0, import_react2.useEffect)(() => {
|
|
18932
19168
|
if (status !== "saving") return;
|
|
18933
19169
|
if (feedback?.reason === reason && lastSentRef.current === reason) {
|
|
18934
19170
|
setStatus("saved");
|
|
@@ -18939,12 +19175,12 @@ function FeedbackControls(props) {
|
|
|
18939
19175
|
reason
|
|
18940
19176
|
]);
|
|
18941
19177
|
const showReason = opened || typeof effectiveScore === "number" || feedback?.reason !== void 0 && feedback.reason.length > 0;
|
|
18942
|
-
return /* @__PURE__ */ (0,
|
|
19178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
18943
19179
|
className: "feedback-controls",
|
|
18944
19180
|
children: [
|
|
18945
|
-
/* @__PURE__ */ (0,
|
|
19181
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
18946
19182
|
className: "feedback-scores",
|
|
18947
|
-
children: SCORE_VALUES.map((value) => /* @__PURE__ */ (0,
|
|
19183
|
+
children: SCORE_VALUES.map((value) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
18948
19184
|
type: "button",
|
|
18949
19185
|
className: classNames("score-button", effectiveScore === value && "score-button-active"),
|
|
18950
19186
|
onClick: () => {
|
|
@@ -18955,9 +19191,9 @@ function FeedbackControls(props) {
|
|
|
18955
19191
|
children: value
|
|
18956
19192
|
}, value))
|
|
18957
19193
|
}),
|
|
18958
|
-
showReason && /* @__PURE__ */ (0,
|
|
19194
|
+
showReason && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, {
|
|
18959
19195
|
children: [
|
|
18960
|
-
/* @__PURE__ */ (0,
|
|
19196
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("textarea", {
|
|
18961
19197
|
className: "feedback-reason",
|
|
18962
19198
|
placeholder: "Why?",
|
|
18963
19199
|
value: reason,
|
|
@@ -18973,7 +19209,7 @@ function FeedbackControls(props) {
|
|
|
18973
19209
|
onReasonChange(messageRefId, effectiveScore, reason);
|
|
18974
19210
|
}
|
|
18975
19211
|
}),
|
|
18976
|
-
/* @__PURE__ */ (0,
|
|
19212
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
18977
19213
|
className: classNames("feedback-status", status === "saving" && "saving", status === "unsaved" && "unsaved"),
|
|
18978
19214
|
children: [
|
|
18979
19215
|
status === "saving" && "Saving\u2026",
|
|
@@ -18989,8 +19225,8 @@ function FeedbackControls(props) {
|
|
|
18989
19225
|
function TraceList(props) {
|
|
18990
19226
|
const { traces } = props;
|
|
18991
19227
|
const ordered = traces;
|
|
18992
|
-
const panelRef = (0,
|
|
18993
|
-
const entries = (0,
|
|
19228
|
+
const panelRef = (0, import_react2.useRef)(null);
|
|
19229
|
+
const entries = (0, import_react2.useMemo)(() => {
|
|
18994
19230
|
const depthMap = /* @__PURE__ */ new Map();
|
|
18995
19231
|
return ordered.map((trace) => {
|
|
18996
19232
|
let depth = 0;
|
|
@@ -19017,7 +19253,7 @@ function TraceList(props) {
|
|
|
19017
19253
|
}, [
|
|
19018
19254
|
ordered
|
|
19019
19255
|
]);
|
|
19020
|
-
(0,
|
|
19256
|
+
(0, import_react2.useEffect)(() => {
|
|
19021
19257
|
const el = panelRef.current;
|
|
19022
19258
|
if (!el) return;
|
|
19023
19259
|
const frame = requestAnimationFrame(() => {
|
|
@@ -19027,19 +19263,19 @@ function TraceList(props) {
|
|
|
19027
19263
|
}, [
|
|
19028
19264
|
traces.length
|
|
19029
19265
|
]);
|
|
19030
|
-
return /* @__PURE__ */ (0,
|
|
19266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19031
19267
|
className: "trace-panel",
|
|
19032
19268
|
ref: panelRef,
|
|
19033
19269
|
children: [
|
|
19034
|
-
/* @__PURE__ */ (0,
|
|
19270
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", {
|
|
19035
19271
|
children: "Traces & Tools"
|
|
19036
19272
|
}),
|
|
19037
|
-
/* @__PURE__ */ (0,
|
|
19273
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19038
19274
|
className: "trace-list",
|
|
19039
19275
|
children: [
|
|
19040
19276
|
entries.map(({ trace, depth }, idx) => {
|
|
19041
19277
|
const isUser = trace.type === "message.user";
|
|
19042
|
-
return /* @__PURE__ */ (0,
|
|
19278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19043
19279
|
className: classNames("trace-row", isUser && "trace-row-user"),
|
|
19044
19280
|
style: depth > 0 ? {
|
|
19045
19281
|
marginLeft: depth * 12,
|
|
@@ -19047,21 +19283,21 @@ function TraceList(props) {
|
|
|
19047
19283
|
paddingLeft: 8
|
|
19048
19284
|
} : void 0,
|
|
19049
19285
|
children: [
|
|
19050
|
-
/* @__PURE__ */ (0,
|
|
19286
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", {
|
|
19051
19287
|
children: trace.type ?? "trace"
|
|
19052
19288
|
}),
|
|
19053
|
-
trace.message?.content && /* @__PURE__ */ (0,
|
|
19289
|
+
trace.message?.content && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19054
19290
|
className: "trace-text",
|
|
19055
19291
|
children: trace.message.content
|
|
19056
19292
|
}),
|
|
19057
|
-
!trace.message?.content && /* @__PURE__ */ (0,
|
|
19293
|
+
!trace.message?.content && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pre", {
|
|
19058
19294
|
className: "trace-json",
|
|
19059
19295
|
children: JSON.stringify(trace, null, 2)
|
|
19060
19296
|
})
|
|
19061
19297
|
]
|
|
19062
19298
|
}, idx);
|
|
19063
19299
|
}),
|
|
19064
|
-
traces.length === 0 && /* @__PURE__ */ (0,
|
|
19300
|
+
traces.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19065
19301
|
className: "trace-empty",
|
|
19066
19302
|
children: "No trace events yet."
|
|
19067
19303
|
})
|
|
@@ -19159,14 +19395,14 @@ function ToolCallField(props) {
|
|
|
19159
19395
|
text = String(value);
|
|
19160
19396
|
}
|
|
19161
19397
|
}
|
|
19162
|
-
return /* @__PURE__ */ (0,
|
|
19398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19163
19399
|
className: "tool-call-field",
|
|
19164
19400
|
children: [
|
|
19165
|
-
/* @__PURE__ */ (0,
|
|
19401
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19166
19402
|
className: "tool-call-field-label",
|
|
19167
19403
|
children: label
|
|
19168
19404
|
}),
|
|
19169
|
-
/* @__PURE__ */ (0,
|
|
19405
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pre", {
|
|
19170
19406
|
className: classNames("trace-json", isError && "tool-call-error"),
|
|
19171
19407
|
children: text
|
|
19172
19408
|
})
|
|
@@ -19175,76 +19411,76 @@ function ToolCallField(props) {
|
|
|
19175
19411
|
}
|
|
19176
19412
|
function ToolCallBubble(props) {
|
|
19177
19413
|
const { call } = props;
|
|
19178
|
-
const [open, setOpen] = (0,
|
|
19414
|
+
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
19179
19415
|
const statusLabel = call.status === "completed" ? "Completed" : call.status === "error" ? "Error" : call.status === "running" ? "Running" : "Pending";
|
|
19180
19416
|
const indentStyle = call.depth && call.depth > 0 ? {
|
|
19181
19417
|
marginLeft: call.depth * 12
|
|
19182
19418
|
} : void 0;
|
|
19183
|
-
return /* @__PURE__ */ (0,
|
|
19419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19184
19420
|
className: "imessage-row left tool-call-row",
|
|
19185
19421
|
style: indentStyle,
|
|
19186
|
-
children: /* @__PURE__ */ (0,
|
|
19422
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19187
19423
|
className: "imessage-bubble left tool-call-bubble",
|
|
19188
19424
|
children: [
|
|
19189
|
-
/* @__PURE__ */ (0,
|
|
19425
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", {
|
|
19190
19426
|
type: "button",
|
|
19191
19427
|
className: "tool-call-collapse",
|
|
19192
19428
|
onClick: () => setOpen((prev) => !prev),
|
|
19193
19429
|
children: [
|
|
19194
|
-
/* @__PURE__ */ (0,
|
|
19430
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19195
19431
|
className: "tool-call-header",
|
|
19196
19432
|
children: [
|
|
19197
|
-
/* @__PURE__ */ (0,
|
|
19433
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19198
19434
|
className: "tool-call-title",
|
|
19199
19435
|
children: [
|
|
19200
19436
|
"Tool call: ",
|
|
19201
|
-
/* @__PURE__ */ (0,
|
|
19437
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", {
|
|
19202
19438
|
children: call.name ?? call.id
|
|
19203
19439
|
})
|
|
19204
19440
|
]
|
|
19205
19441
|
}),
|
|
19206
|
-
/* @__PURE__ */ (0,
|
|
19442
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19207
19443
|
className: classNames("tool-call-status", `status-${call.status}`),
|
|
19208
19444
|
children: statusLabel
|
|
19209
19445
|
}),
|
|
19210
|
-
call.handledError && /* @__PURE__ */ (0,
|
|
19446
|
+
call.handledError && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19211
19447
|
className: "tool-call-handled",
|
|
19212
19448
|
children: "Error handled"
|
|
19213
19449
|
})
|
|
19214
19450
|
]
|
|
19215
19451
|
}),
|
|
19216
|
-
/* @__PURE__ */ (0,
|
|
19452
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19217
19453
|
className: "tool-call-id",
|
|
19218
19454
|
children: call.id
|
|
19219
19455
|
}),
|
|
19220
|
-
/* @__PURE__ */ (0,
|
|
19456
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19221
19457
|
className: "tool-call-expand",
|
|
19222
19458
|
children: open ? "Hide details" : "Show details"
|
|
19223
19459
|
})
|
|
19224
19460
|
]
|
|
19225
19461
|
}),
|
|
19226
|
-
open && /* @__PURE__ */ (0,
|
|
19462
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19227
19463
|
className: "tool-call-detail",
|
|
19228
19464
|
children: [
|
|
19229
|
-
call.args !== void 0 && /* @__PURE__ */ (0,
|
|
19465
|
+
call.args !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ToolCallField, {
|
|
19230
19466
|
label: "Arguments",
|
|
19231
19467
|
value: call.args
|
|
19232
19468
|
}),
|
|
19233
|
-
call.result !== void 0 && /* @__PURE__ */ (0,
|
|
19469
|
+
call.result !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ToolCallField, {
|
|
19234
19470
|
label: "Result",
|
|
19235
19471
|
value: call.result
|
|
19236
19472
|
}),
|
|
19237
|
-
call.error !== void 0 && /* @__PURE__ */ (0,
|
|
19473
|
+
call.error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ToolCallField, {
|
|
19238
19474
|
label: "Error",
|
|
19239
19475
|
value: call.error,
|
|
19240
19476
|
isError: true
|
|
19241
19477
|
}),
|
|
19242
|
-
call.handledError && /* @__PURE__ */ (0,
|
|
19478
|
+
call.handledError && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, {
|
|
19243
19479
|
children: [
|
|
19244
|
-
/* @__PURE__ */ (0,
|
|
19480
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19245
19481
|
className: "tool-call-divider"
|
|
19246
19482
|
}),
|
|
19247
|
-
/* @__PURE__ */ (0,
|
|
19483
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ToolCallField, {
|
|
19248
19484
|
label: "Handled error",
|
|
19249
19485
|
value: call.handledError,
|
|
19250
19486
|
isError: true
|
|
@@ -19260,58 +19496,58 @@ function ToolCallBubble(props) {
|
|
|
19260
19496
|
function SessionModal(props) {
|
|
19261
19497
|
const { open, sessions, loading, error, onRefresh, onSelect, onDelete, onClose } = props;
|
|
19262
19498
|
if (!open) return null;
|
|
19263
|
-
return /* @__PURE__ */ (0,
|
|
19499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19264
19500
|
className: "sessions-overlay",
|
|
19265
|
-
children: /* @__PURE__ */ (0,
|
|
19501
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19266
19502
|
className: "sessions-dialog",
|
|
19267
19503
|
children: [
|
|
19268
|
-
/* @__PURE__ */ (0,
|
|
19504
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", {
|
|
19269
19505
|
children: [
|
|
19270
|
-
/* @__PURE__ */ (0,
|
|
19506
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", {
|
|
19271
19507
|
children: "Sessions"
|
|
19272
19508
|
}),
|
|
19273
|
-
/* @__PURE__ */ (0,
|
|
19509
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
19274
19510
|
type: "button",
|
|
19275
19511
|
onClick: onClose,
|
|
19276
19512
|
children: "Close"
|
|
19277
19513
|
})
|
|
19278
19514
|
]
|
|
19279
19515
|
}),
|
|
19280
|
-
/* @__PURE__ */ (0,
|
|
19516
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19281
19517
|
className: "sessions-body",
|
|
19282
19518
|
children: [
|
|
19283
|
-
/* @__PURE__ */ (0,
|
|
19519
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
19284
19520
|
type: "button",
|
|
19285
19521
|
onClick: onRefresh,
|
|
19286
19522
|
children: "Refresh"
|
|
19287
19523
|
}),
|
|
19288
|
-
loading && /* @__PURE__ */ (0,
|
|
19524
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", {
|
|
19289
19525
|
children: "Loading sessions\u2026"
|
|
19290
19526
|
}),
|
|
19291
|
-
error && /* @__PURE__ */ (0,
|
|
19527
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", {
|
|
19292
19528
|
className: "error",
|
|
19293
19529
|
children: error
|
|
19294
19530
|
}),
|
|
19295
|
-
/* @__PURE__ */ (0,
|
|
19296
|
-
children: sessions.map((session) => /* @__PURE__ */ (0,
|
|
19531
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", {
|
|
19532
|
+
children: sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("li", {
|
|
19297
19533
|
children: [
|
|
19298
|
-
/* @__PURE__ */ (0,
|
|
19534
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", {
|
|
19299
19535
|
type: "button",
|
|
19300
19536
|
className: "session-select-button",
|
|
19301
19537
|
onClick: () => onSelect(session.id),
|
|
19302
19538
|
children: [
|
|
19303
|
-
/* @__PURE__ */ (0,
|
|
19539
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", {
|
|
19304
19540
|
children: session.testBotName ?? session.deckSlug ?? session.deck ?? "session"
|
|
19305
19541
|
}),
|
|
19306
|
-
/* @__PURE__ */ (0,
|
|
19542
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
19307
19543
|
children: formatTimestamp(session.createdAt)
|
|
19308
19544
|
}),
|
|
19309
|
-
/* @__PURE__ */ (0,
|
|
19545
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", {
|
|
19310
19546
|
children: session.id
|
|
19311
19547
|
})
|
|
19312
19548
|
]
|
|
19313
19549
|
}),
|
|
19314
|
-
/* @__PURE__ */ (0,
|
|
19550
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
19315
19551
|
type: "button",
|
|
19316
19552
|
className: "session-delete-button",
|
|
19317
19553
|
onClick: () => {
|
|
@@ -19325,7 +19561,7 @@ function SessionModal(props) {
|
|
|
19325
19561
|
]
|
|
19326
19562
|
}, session.id))
|
|
19327
19563
|
}),
|
|
19328
|
-
sessions.length === 0 && !loading && /* @__PURE__ */ (0,
|
|
19564
|
+
sessions.length === 0 && !loading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", {
|
|
19329
19565
|
children: "No saved sessions yet."
|
|
19330
19566
|
})
|
|
19331
19567
|
]
|
|
@@ -19337,44 +19573,44 @@ function SessionModal(props) {
|
|
|
19337
19573
|
function RecentSessionsEmptyState(props) {
|
|
19338
19574
|
const { sessions, loading, error, onSelect, onOpenAll } = props;
|
|
19339
19575
|
const preview = sessions.slice(0, 4);
|
|
19340
|
-
return /* @__PURE__ */ (0,
|
|
19576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19341
19577
|
className: "empty-state",
|
|
19342
19578
|
children: [
|
|
19343
|
-
/* @__PURE__ */ (0,
|
|
19579
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", {
|
|
19344
19580
|
children: "Start a new chat or load a previous session to review feedback."
|
|
19345
19581
|
}),
|
|
19346
|
-
loading && /* @__PURE__ */ (0,
|
|
19582
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", {
|
|
19347
19583
|
children: "Loading recent sessions\u2026"
|
|
19348
19584
|
}),
|
|
19349
|
-
error && /* @__PURE__ */ (0,
|
|
19585
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", {
|
|
19350
19586
|
className: "error",
|
|
19351
19587
|
children: error
|
|
19352
19588
|
}),
|
|
19353
|
-
!loading && !error && preview.length === 0 && /* @__PURE__ */ (0,
|
|
19589
|
+
!loading && !error && preview.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", {
|
|
19354
19590
|
children: "No saved sessions yet."
|
|
19355
19591
|
}),
|
|
19356
|
-
!loading && !error && preview.length > 0 && /* @__PURE__ */ (0,
|
|
19592
|
+
!loading && !error && preview.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19357
19593
|
className: "recent-sessions",
|
|
19358
|
-
children: preview.map((session) => /* @__PURE__ */ (0,
|
|
19594
|
+
children: preview.map((session) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", {
|
|
19359
19595
|
type: "button",
|
|
19360
19596
|
className: "recent-session-button",
|
|
19361
19597
|
onClick: () => onSelect(session.id),
|
|
19362
19598
|
children: [
|
|
19363
|
-
/* @__PURE__ */ (0,
|
|
19599
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", {
|
|
19364
19600
|
children: session.testBotName ?? session.deckSlug ?? session.deck ?? "session"
|
|
19365
19601
|
}),
|
|
19366
|
-
/* @__PURE__ */ (0,
|
|
19602
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
19367
19603
|
children: formatTimestamp(session.createdAt)
|
|
19368
19604
|
}),
|
|
19369
|
-
/* @__PURE__ */ (0,
|
|
19605
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", {
|
|
19370
19606
|
children: session.id
|
|
19371
19607
|
})
|
|
19372
19608
|
]
|
|
19373
19609
|
}, session.id))
|
|
19374
19610
|
}),
|
|
19375
|
-
/* @__PURE__ */ (0,
|
|
19611
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19376
19612
|
className: "empty-state-actions",
|
|
19377
|
-
children: /* @__PURE__ */ (0,
|
|
19613
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
19378
19614
|
type: "button",
|
|
19379
19615
|
className: "ghost-btn",
|
|
19380
19616
|
onClick: onOpenAll,
|
|
@@ -19385,10 +19621,10 @@ function RecentSessionsEmptyState(props) {
|
|
|
19385
19621
|
});
|
|
19386
19622
|
}
|
|
19387
19623
|
function useHttpSchema() {
|
|
19388
|
-
const [schemaResponse, setSchemaResponse] = (0,
|
|
19389
|
-
const [loading, setLoading] = (0,
|
|
19390
|
-
const [error, setError] = (0,
|
|
19391
|
-
const refresh = (0,
|
|
19624
|
+
const [schemaResponse, setSchemaResponse] = (0, import_react2.useState)(null);
|
|
19625
|
+
const [loading, setLoading] = (0, import_react2.useState)(false);
|
|
19626
|
+
const [error, setError] = (0, import_react2.useState)(null);
|
|
19627
|
+
const refresh = (0, import_react2.useCallback)(async () => {
|
|
19392
19628
|
setLoading(true);
|
|
19393
19629
|
setError(null);
|
|
19394
19630
|
try {
|
|
@@ -19402,7 +19638,7 @@ function useHttpSchema() {
|
|
|
19402
19638
|
setLoading(false);
|
|
19403
19639
|
}
|
|
19404
19640
|
}, []);
|
|
19405
|
-
(0,
|
|
19641
|
+
(0, import_react2.useEffect)(() => {
|
|
19406
19642
|
refresh();
|
|
19407
19643
|
}, [
|
|
19408
19644
|
refresh
|
|
@@ -19416,9 +19652,9 @@ function useHttpSchema() {
|
|
|
19416
19652
|
}
|
|
19417
19653
|
function JsonInputField(props) {
|
|
19418
19654
|
const { value, optional, placeholder, onChange, onErrorChange } = props;
|
|
19419
|
-
const onChangeRef = (0,
|
|
19420
|
-
const onErrorChangeRef = (0,
|
|
19421
|
-
const [text, setText] = (0,
|
|
19655
|
+
const onChangeRef = (0, import_react2.useRef)(onChange);
|
|
19656
|
+
const onErrorChangeRef = (0, import_react2.useRef)(onErrorChange);
|
|
19657
|
+
const [text, setText] = (0, import_react2.useState)(() => {
|
|
19422
19658
|
if (value === void 0) return "";
|
|
19423
19659
|
try {
|
|
19424
19660
|
return JSON.stringify(value, null, 2);
|
|
@@ -19426,16 +19662,16 @@ function JsonInputField(props) {
|
|
|
19426
19662
|
return String(value);
|
|
19427
19663
|
}
|
|
19428
19664
|
});
|
|
19429
|
-
const [dirty, setDirty] = (0,
|
|
19430
|
-
const [error, setError] = (0,
|
|
19431
|
-
(0,
|
|
19665
|
+
const [dirty, setDirty] = (0, import_react2.useState)(false);
|
|
19666
|
+
const [error, setError] = (0, import_react2.useState)(null);
|
|
19667
|
+
(0, import_react2.useEffect)(() => {
|
|
19432
19668
|
onChangeRef.current = onChange;
|
|
19433
19669
|
onErrorChangeRef.current = onErrorChange;
|
|
19434
19670
|
}, [
|
|
19435
19671
|
onChange,
|
|
19436
19672
|
onErrorChange
|
|
19437
19673
|
]);
|
|
19438
|
-
(0,
|
|
19674
|
+
(0, import_react2.useEffect)(() => {
|
|
19439
19675
|
if (dirty) return;
|
|
19440
19676
|
if (value === void 0) {
|
|
19441
19677
|
setText("");
|
|
@@ -19450,12 +19686,12 @@ function JsonInputField(props) {
|
|
|
19450
19686
|
value,
|
|
19451
19687
|
dirty
|
|
19452
19688
|
]);
|
|
19453
|
-
(0,
|
|
19689
|
+
(0, import_react2.useEffect)(() => {
|
|
19454
19690
|
onErrorChangeRef.current?.(error);
|
|
19455
19691
|
}, [
|
|
19456
19692
|
error
|
|
19457
19693
|
]);
|
|
19458
|
-
(0,
|
|
19694
|
+
(0, import_react2.useEffect)(() => {
|
|
19459
19695
|
if (!dirty) return;
|
|
19460
19696
|
const handle = window.setTimeout(() => {
|
|
19461
19697
|
const trimmed = text.trim();
|
|
@@ -19482,9 +19718,9 @@ function JsonInputField(props) {
|
|
|
19482
19718
|
text,
|
|
19483
19719
|
optional
|
|
19484
19720
|
]);
|
|
19485
|
-
return /* @__PURE__ */ (0,
|
|
19721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, {
|
|
19486
19722
|
children: [
|
|
19487
|
-
/* @__PURE__ */ (0,
|
|
19723
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("textarea", {
|
|
19488
19724
|
value: text,
|
|
19489
19725
|
placeholder,
|
|
19490
19726
|
onChange: (e) => {
|
|
@@ -19492,7 +19728,7 @@ function JsonInputField(props) {
|
|
|
19492
19728
|
setDirty(true);
|
|
19493
19729
|
}
|
|
19494
19730
|
}),
|
|
19495
|
-
error && /* @__PURE__ */ (0,
|
|
19731
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19496
19732
|
className: "error",
|
|
19497
19733
|
children: error
|
|
19498
19734
|
})
|
|
@@ -19501,10 +19737,10 @@ function JsonInputField(props) {
|
|
|
19501
19737
|
}
|
|
19502
19738
|
function InitForm(props) {
|
|
19503
19739
|
const { schema, value, onChange, onJsonErrorChange } = props;
|
|
19504
|
-
const leaves = (0,
|
|
19740
|
+
const leaves = (0, import_react2.useMemo)(() => flattenSchemaLeaves(schema), [
|
|
19505
19741
|
schema
|
|
19506
19742
|
]);
|
|
19507
|
-
return /* @__PURE__ */ (0,
|
|
19743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19508
19744
|
className: "init-grid",
|
|
19509
19745
|
children: leaves.map(({ path, schema: fieldSchema }) => {
|
|
19510
19746
|
const pathKey = path.join(".");
|
|
@@ -19516,30 +19752,30 @@ function InitForm(props) {
|
|
|
19516
19752
|
const nextRoot = setPathValue(value, path, nextFieldValue);
|
|
19517
19753
|
onChange(nextRoot);
|
|
19518
19754
|
};
|
|
19519
|
-
return /* @__PURE__ */ (0,
|
|
19755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19520
19756
|
className: "init-field",
|
|
19521
19757
|
children: [
|
|
19522
|
-
/* @__PURE__ */ (0,
|
|
19758
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", {
|
|
19523
19759
|
children: [
|
|
19524
|
-
/* @__PURE__ */ (0,
|
|
19760
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
19525
19761
|
children: label
|
|
19526
19762
|
}),
|
|
19527
|
-
/* @__PURE__ */ (0,
|
|
19763
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
19528
19764
|
className: "badge",
|
|
19529
19765
|
children: badgeText
|
|
19530
19766
|
})
|
|
19531
19767
|
]
|
|
19532
19768
|
}),
|
|
19533
|
-
description && /* @__PURE__ */ (0,
|
|
19769
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19534
19770
|
className: "secondary-note",
|
|
19535
19771
|
children: description
|
|
19536
19772
|
}),
|
|
19537
|
-
fieldSchema.kind === "string" && /* @__PURE__ */ (0,
|
|
19773
|
+
fieldSchema.kind === "string" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("input", {
|
|
19538
19774
|
value: typeof fieldValue === "string" ? fieldValue : "",
|
|
19539
19775
|
placeholder: fieldSchema.optional ? "" : "required",
|
|
19540
19776
|
onChange: (e) => setFieldValue(e.target.value === "" && fieldSchema.optional ? void 0 : e.target.value)
|
|
19541
19777
|
}),
|
|
19542
|
-
fieldSchema.kind === "number" && /* @__PURE__ */ (0,
|
|
19778
|
+
fieldSchema.kind === "number" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("input", {
|
|
19543
19779
|
type: "number",
|
|
19544
19780
|
value: typeof fieldValue === "number" ? String(fieldValue) : "",
|
|
19545
19781
|
placeholder: fieldSchema.optional ? "" : "required",
|
|
@@ -19553,23 +19789,23 @@ function InitForm(props) {
|
|
|
19553
19789
|
setFieldValue(Number.isFinite(parsed) ? parsed : void 0);
|
|
19554
19790
|
}
|
|
19555
19791
|
}),
|
|
19556
|
-
fieldSchema.kind === "boolean" && /* @__PURE__ */ (0,
|
|
19792
|
+
fieldSchema.kind === "boolean" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", {
|
|
19557
19793
|
style: {
|
|
19558
19794
|
fontWeight: 600,
|
|
19559
19795
|
justifyContent: "flex-start"
|
|
19560
19796
|
},
|
|
19561
19797
|
children: [
|
|
19562
|
-
/* @__PURE__ */ (0,
|
|
19798
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("input", {
|
|
19563
19799
|
type: "checkbox",
|
|
19564
19800
|
checked: Boolean(fieldValue),
|
|
19565
19801
|
onChange: (e) => setFieldValue(e.target.checked)
|
|
19566
19802
|
}),
|
|
19567
|
-
/* @__PURE__ */ (0,
|
|
19803
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
19568
19804
|
children: Boolean(fieldValue) ? "true" : "false"
|
|
19569
19805
|
})
|
|
19570
19806
|
]
|
|
19571
19807
|
}),
|
|
19572
|
-
fieldSchema.kind === "enum" && /* @__PURE__ */ (0,
|
|
19808
|
+
fieldSchema.kind === "enum" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("select", {
|
|
19573
19809
|
value: fieldValue === void 0 ? "" : String(fieldValue),
|
|
19574
19810
|
onChange: (e) => {
|
|
19575
19811
|
const raw = e.target.value;
|
|
@@ -19580,17 +19816,17 @@ function InitForm(props) {
|
|
|
19580
19816
|
setFieldValue(raw);
|
|
19581
19817
|
},
|
|
19582
19818
|
children: [
|
|
19583
|
-
/* @__PURE__ */ (0,
|
|
19819
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", {
|
|
19584
19820
|
value: "",
|
|
19585
19821
|
children: fieldSchema.optional ? "\u2014 optional \u2014" : "Select"
|
|
19586
19822
|
}),
|
|
19587
|
-
(fieldSchema.enumValues ?? []).map((opt) => /* @__PURE__ */ (0,
|
|
19823
|
+
(fieldSchema.enumValues ?? []).map((opt) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", {
|
|
19588
19824
|
value: String(opt),
|
|
19589
19825
|
children: String(opt)
|
|
19590
19826
|
}, String(opt)))
|
|
19591
19827
|
]
|
|
19592
19828
|
}),
|
|
19593
|
-
(fieldSchema.kind === "array" || fieldSchema.kind === "unknown" || fieldSchema.kind === "object") && /* @__PURE__ */ (0,
|
|
19829
|
+
(fieldSchema.kind === "array" || fieldSchema.kind === "unknown" || fieldSchema.kind === "object") && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(JsonInputField, {
|
|
19594
19830
|
value: fieldValue,
|
|
19595
19831
|
optional: fieldSchema.optional,
|
|
19596
19832
|
placeholder: "JSON",
|
|
@@ -19609,40 +19845,40 @@ function InitPanel(props) {
|
|
|
19609
19845
|
const { schema, value, lockedValue, editable, mode, open, onOpenChange, onModeChange, missingRequired, jsonErrorCount, rootJsonText, rootJsonError, onRootJsonChange, schemaError, onChange, onJsonErrorChange } = props;
|
|
19610
19846
|
const summaryLabel = editable ? "Init input (required before chat)" : "Init input (locked)";
|
|
19611
19847
|
const summaryValue = editable ? value : lockedValue;
|
|
19612
|
-
return /* @__PURE__ */ (0,
|
|
19848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("details", {
|
|
19613
19849
|
className: "init-panel",
|
|
19614
19850
|
open,
|
|
19615
19851
|
onToggle: (e) => onOpenChange(e.currentTarget.open),
|
|
19616
19852
|
children: [
|
|
19617
|
-
/* @__PURE__ */ (0,
|
|
19853
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("summary", {
|
|
19618
19854
|
children: summaryLabel
|
|
19619
19855
|
}),
|
|
19620
|
-
schemaError && /* @__PURE__ */ (0,
|
|
19856
|
+
schemaError && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19621
19857
|
className: "error",
|
|
19622
19858
|
children: [
|
|
19623
19859
|
"Schema error: ",
|
|
19624
19860
|
schemaError
|
|
19625
19861
|
]
|
|
19626
19862
|
}),
|
|
19627
|
-
/* @__PURE__ */ (0,
|
|
19863
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19628
19864
|
className: "hint",
|
|
19629
19865
|
children: "Fields are generated from the deck input schema. You can use the form or a raw JSON payload. Start a new chat to change init."
|
|
19630
19866
|
}),
|
|
19631
|
-
editable && /* @__PURE__ */ (0,
|
|
19867
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, {
|
|
19632
19868
|
children: [
|
|
19633
|
-
/* @__PURE__ */ (0,
|
|
19869
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19634
19870
|
className: "panel-tabs",
|
|
19635
19871
|
style: {
|
|
19636
19872
|
marginTop: 6
|
|
19637
19873
|
},
|
|
19638
19874
|
children: [
|
|
19639
|
-
/* @__PURE__ */ (0,
|
|
19875
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
19640
19876
|
type: "button",
|
|
19641
19877
|
className: classNames("panel-tab", mode === "form" && "active"),
|
|
19642
19878
|
onClick: () => onModeChange("form"),
|
|
19643
19879
|
children: "Form"
|
|
19644
19880
|
}),
|
|
19645
|
-
/* @__PURE__ */ (0,
|
|
19881
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
19646
19882
|
type: "button",
|
|
19647
19883
|
className: classNames("panel-tab", mode === "json" && "active"),
|
|
19648
19884
|
onClick: () => onModeChange("json"),
|
|
@@ -19650,26 +19886,26 @@ function InitPanel(props) {
|
|
|
19650
19886
|
})
|
|
19651
19887
|
]
|
|
19652
19888
|
}),
|
|
19653
|
-
mode === "form" ? /* @__PURE__ */ (0,
|
|
19889
|
+
mode === "form" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InitForm, {
|
|
19654
19890
|
schema,
|
|
19655
19891
|
value,
|
|
19656
19892
|
onChange,
|
|
19657
19893
|
onJsonErrorChange
|
|
19658
|
-
}) : /* @__PURE__ */ (0,
|
|
19894
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19659
19895
|
className: "init-field",
|
|
19660
19896
|
children: [
|
|
19661
|
-
/* @__PURE__ */ (0,
|
|
19897
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", {
|
|
19662
19898
|
children: [
|
|
19663
|
-
/* @__PURE__ */ (0,
|
|
19899
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
19664
19900
|
children: "Init JSON"
|
|
19665
19901
|
}),
|
|
19666
|
-
/* @__PURE__ */ (0,
|
|
19902
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
19667
19903
|
className: "badge",
|
|
19668
19904
|
children: "root"
|
|
19669
19905
|
})
|
|
19670
19906
|
]
|
|
19671
19907
|
}),
|
|
19672
|
-
/* @__PURE__ */ (0,
|
|
19908
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("textarea", {
|
|
19673
19909
|
className: "json-input",
|
|
19674
19910
|
value: rootJsonText,
|
|
19675
19911
|
placeholder: "Paste full init JSON payload",
|
|
@@ -19692,34 +19928,34 @@ function InitPanel(props) {
|
|
|
19692
19928
|
minHeight: 140
|
|
19693
19929
|
}
|
|
19694
19930
|
}),
|
|
19695
|
-
rootJsonError && /* @__PURE__ */ (0,
|
|
19931
|
+
rootJsonError && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19696
19932
|
className: "error",
|
|
19697
19933
|
children: rootJsonError
|
|
19698
19934
|
}),
|
|
19699
|
-
!rootJsonError && /* @__PURE__ */ (0,
|
|
19935
|
+
!rootJsonError && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19700
19936
|
className: "secondary-note",
|
|
19701
19937
|
children: "Leave blank to unset init. Parsed JSON replaces the form."
|
|
19702
19938
|
})
|
|
19703
19939
|
]
|
|
19704
19940
|
}),
|
|
19705
|
-
(missingRequired.length > 0 || jsonErrorCount > 0) && /* @__PURE__ */ (0,
|
|
19941
|
+
(missingRequired.length > 0 || jsonErrorCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19706
19942
|
className: "init-missing",
|
|
19707
19943
|
children: [
|
|
19708
|
-
missingRequired.length > 0 && /* @__PURE__ */ (0,
|
|
19944
|
+
missingRequired.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
19709
19945
|
children: [
|
|
19710
19946
|
"Missing required: ",
|
|
19711
19947
|
missingRequired.slice(0, 6).join(", "),
|
|
19712
19948
|
missingRequired.length > 6 ? "\u2026" : ""
|
|
19713
19949
|
]
|
|
19714
19950
|
}),
|
|
19715
|
-
jsonErrorCount > 0 && /* @__PURE__ */ (0,
|
|
19951
|
+
jsonErrorCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
19716
19952
|
children: "Fix invalid JSON fields to continue."
|
|
19717
19953
|
})
|
|
19718
19954
|
]
|
|
19719
19955
|
})
|
|
19720
19956
|
]
|
|
19721
19957
|
}),
|
|
19722
|
-
!editable && /* @__PURE__ */ (0,
|
|
19958
|
+
!editable && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pre", {
|
|
19723
19959
|
className: "init-summary-json",
|
|
19724
19960
|
children: JSON.stringify(summaryValue ?? {}, null, 2)
|
|
19725
19961
|
})
|
|
@@ -19735,41 +19971,41 @@ function SimulatorApp({ basePath }) {
|
|
|
19735
19971
|
const sessionBasePath = rootPath === "/" ? SESSIONS_BASE_PATH : rootPath;
|
|
19736
19972
|
const normalizedSessionBase = normalizeBasePath(sessionBasePath);
|
|
19737
19973
|
const newSessionPath = `${normalizedSessionBase === "" ? "/sessions" : normalizedSessionBase}/new`.replace(/\/{2,}/g, "/");
|
|
19738
|
-
const buildSessionUrl = (0,
|
|
19974
|
+
const buildSessionUrl = (0, import_react2.useCallback)((sessionId2) => `${normalizedSessionBase === "" ? "/sessions" : normalizedSessionBase}/${encodeURIComponent(sessionId2)}/debug`.replace(/\/{2,}/g, "/"), [
|
|
19739
19975
|
normalizedSessionBase
|
|
19740
19976
|
]);
|
|
19741
|
-
const [sessionsOpen, setSessionsOpen] = (0,
|
|
19742
|
-
const [message, setMessage] = (0,
|
|
19743
|
-
const [pendingReset, setPendingReset] = (0,
|
|
19744
|
-
const [initValue, setInitValue] = (0,
|
|
19745
|
-
const [initDirty, setInitDirty] = (0,
|
|
19746
|
-
const [initMode, setInitMode] = (0,
|
|
19747
|
-
const [initJsonText, setInitJsonText] = (0,
|
|
19748
|
-
const [initJsonError, setInitJsonError] = (0,
|
|
19749
|
-
const [initOpen, setInitOpen] = (0,
|
|
19750
|
-
const [jsonErrors, setJsonErrors] = (0,
|
|
19751
|
-
const [pendingSessionId, setPendingSessionId] = (0,
|
|
19752
|
-
const appliedSessionIdRef = (0,
|
|
19753
|
-
const initializedRef = (0,
|
|
19754
|
-
const currentDeckSlug = (0,
|
|
19755
|
-
const [noteDraft, setNoteDraft] = (0,
|
|
19756
|
-
const [noteStatus, setNoteStatus] = (0,
|
|
19757
|
-
const pendingNoteRef = (0,
|
|
19758
|
-
const [scoreStatus, setScoreStatus] = (0,
|
|
19759
|
-
const pendingScoreRef = (0,
|
|
19760
|
-
(0,
|
|
19977
|
+
const [sessionsOpen, setSessionsOpen] = (0, import_react2.useState)(false);
|
|
19978
|
+
const [message, setMessage] = (0, import_react2.useState)("");
|
|
19979
|
+
const [pendingReset, setPendingReset] = (0, import_react2.useState)(false);
|
|
19980
|
+
const [initValue, setInitValue] = (0, import_react2.useState)(void 0);
|
|
19981
|
+
const [initDirty, setInitDirty] = (0, import_react2.useState)(false);
|
|
19982
|
+
const [initMode, setInitMode] = (0, import_react2.useState)("form");
|
|
19983
|
+
const [initJsonText, setInitJsonText] = (0, import_react2.useState)("");
|
|
19984
|
+
const [initJsonError, setInitJsonError] = (0, import_react2.useState)(null);
|
|
19985
|
+
const [initOpen, setInitOpen] = (0, import_react2.useState)(false);
|
|
19986
|
+
const [jsonErrors, setJsonErrors] = (0, import_react2.useState)({});
|
|
19987
|
+
const [pendingSessionId, setPendingSessionId] = (0, import_react2.useState)(null);
|
|
19988
|
+
const appliedSessionIdRef = (0, import_react2.useRef)(null);
|
|
19989
|
+
const initializedRef = (0, import_react2.useRef)(false);
|
|
19990
|
+
const currentDeckSlug = (0, import_react2.useMemo)(() => toDeckSlug(deckPath), []);
|
|
19991
|
+
const [noteDraft, setNoteDraft] = (0, import_react2.useState)("");
|
|
19992
|
+
const [noteStatus, setNoteStatus] = (0, import_react2.useState)("idle");
|
|
19993
|
+
const pendingNoteRef = (0, import_react2.useRef)(null);
|
|
19994
|
+
const [scoreStatus, setScoreStatus] = (0, import_react2.useState)("idle");
|
|
19995
|
+
const pendingScoreRef = (0, import_react2.useRef)(null);
|
|
19996
|
+
(0, import_react2.useEffect)(() => {
|
|
19761
19997
|
if (simulator.connectionStatus === "connecting") {
|
|
19762
19998
|
appliedSessionIdRef.current = null;
|
|
19763
19999
|
}
|
|
19764
20000
|
}, [
|
|
19765
20001
|
simulator.connectionStatus
|
|
19766
20002
|
]);
|
|
19767
|
-
(0,
|
|
20003
|
+
(0, import_react2.useEffect)(() => {
|
|
19768
20004
|
refresh();
|
|
19769
20005
|
}, [
|
|
19770
20006
|
refresh
|
|
19771
20007
|
]);
|
|
19772
|
-
(0,
|
|
20008
|
+
(0, import_react2.useEffect)(() => {
|
|
19773
20009
|
if (sessionsOpen) refresh();
|
|
19774
20010
|
}, [
|
|
19775
20011
|
sessionsOpen,
|
|
@@ -19780,7 +20016,7 @@ function SimulatorApp({ basePath }) {
|
|
|
19780
20016
|
const schemaError = httpSchema.schemaResponse?.error ?? httpSchema.error ?? void 0;
|
|
19781
20017
|
const conversationStarted = Boolean(simulator.savedState && simulator.savedState.messages.length > 0);
|
|
19782
20018
|
const initEditable = Boolean(schema) && (!conversationStarted || pendingReset);
|
|
19783
|
-
const lockedInitValue = (0,
|
|
20019
|
+
const lockedInitValue = (0, import_react2.useMemo)(() => {
|
|
19784
20020
|
const fromTraces = extractInitFromTraces(simulator.savedState?.traces);
|
|
19785
20021
|
if (fromTraces !== void 0) return fromTraces;
|
|
19786
20022
|
return schemaDefaults ?? deriveInitialFromSchema(schema);
|
|
@@ -19789,7 +20025,7 @@ function SimulatorApp({ basePath }) {
|
|
|
19789
20025
|
schemaDefaults,
|
|
19790
20026
|
schema
|
|
19791
20027
|
]);
|
|
19792
|
-
(0,
|
|
20028
|
+
(0, import_react2.useEffect)(() => {
|
|
19793
20029
|
if (!schema) return;
|
|
19794
20030
|
if (initDirty) return;
|
|
19795
20031
|
if (schemaDefaults !== void 0) {
|
|
@@ -19802,7 +20038,7 @@ function SimulatorApp({ basePath }) {
|
|
|
19802
20038
|
schemaDefaults,
|
|
19803
20039
|
initDirty
|
|
19804
20040
|
]);
|
|
19805
|
-
(0,
|
|
20041
|
+
(0, import_react2.useEffect)(() => {
|
|
19806
20042
|
if (initMode !== "json") return;
|
|
19807
20043
|
if (initDirty) return;
|
|
19808
20044
|
try {
|
|
@@ -19815,14 +20051,14 @@ function SimulatorApp({ basePath }) {
|
|
|
19815
20051
|
initValue,
|
|
19816
20052
|
initDirty
|
|
19817
20053
|
]);
|
|
19818
|
-
(0,
|
|
20054
|
+
(0, import_react2.useEffect)(() => {
|
|
19819
20055
|
if (initEditable) {
|
|
19820
20056
|
setInitOpen(true);
|
|
19821
20057
|
}
|
|
19822
20058
|
}, [
|
|
19823
20059
|
initEditable
|
|
19824
20060
|
]);
|
|
19825
|
-
const messages = (0,
|
|
20061
|
+
const messages = (0, import_react2.useMemo)(() => {
|
|
19826
20062
|
if (!simulator.savedState) return [];
|
|
19827
20063
|
const feedbackByRef = new Map(simulator.savedState.feedback?.map((f) => [
|
|
19828
20064
|
f.messageRefId,
|
|
@@ -19839,7 +20075,7 @@ function SimulatorApp({ basePath }) {
|
|
|
19839
20075
|
}, [
|
|
19840
20076
|
simulator.savedState
|
|
19841
20077
|
]);
|
|
19842
|
-
const missingRequired = (0,
|
|
20078
|
+
const missingRequired = (0, import_react2.useMemo)(() => {
|
|
19843
20079
|
if (!schema || !initEditable) return [];
|
|
19844
20080
|
return findMissingRequiredFields(schema, initValue);
|
|
19845
20081
|
}, [
|
|
@@ -19847,13 +20083,13 @@ function SimulatorApp({ basePath }) {
|
|
|
19847
20083
|
initEditable,
|
|
19848
20084
|
initValue
|
|
19849
20085
|
]);
|
|
19850
|
-
const jsonErrorCount = (0,
|
|
20086
|
+
const jsonErrorCount = (0, import_react2.useMemo)(() => {
|
|
19851
20087
|
return Object.values(jsonErrors).filter((v) => typeof v === "string" && v).length;
|
|
19852
20088
|
}, [
|
|
19853
20089
|
jsonErrors
|
|
19854
20090
|
]);
|
|
19855
20091
|
const canStartWithInit = Boolean(schema) && initEditable && missingRequired.length === 0 && jsonErrorCount === 0;
|
|
19856
|
-
const resetInitValue = (0,
|
|
20092
|
+
const resetInitValue = (0, import_react2.useCallback)(() => {
|
|
19857
20093
|
setInitJsonError(null);
|
|
19858
20094
|
setJsonErrors((prev) => ({
|
|
19859
20095
|
...prev,
|
|
@@ -19871,7 +20107,7 @@ function SimulatorApp({ basePath }) {
|
|
|
19871
20107
|
schema,
|
|
19872
20108
|
schemaDefaults
|
|
19873
20109
|
]);
|
|
19874
|
-
const startNewChat = (0,
|
|
20110
|
+
const startNewChat = (0, import_react2.useCallback)((opts) => {
|
|
19875
20111
|
const shouldPush = opts?.pushHistory ?? true;
|
|
19876
20112
|
if (shouldPush) {
|
|
19877
20113
|
if (opts?.replace) {
|
|
@@ -19901,14 +20137,14 @@ function SimulatorApp({ basePath }) {
|
|
|
19901
20137
|
resetInitValue,
|
|
19902
20138
|
newSessionPath
|
|
19903
20139
|
]);
|
|
19904
|
-
const adoptSessionFromPath = (0,
|
|
20140
|
+
const adoptSessionFromPath = (0, import_react2.useCallback)((sessionId2) => {
|
|
19905
20141
|
appliedSessionIdRef.current = null;
|
|
19906
20142
|
setPendingSessionId(sessionId2);
|
|
19907
20143
|
setPendingReset(false);
|
|
19908
20144
|
setInitOpen(false);
|
|
19909
20145
|
setInitDirty(true);
|
|
19910
20146
|
}, []);
|
|
19911
|
-
const navigateToSession = (0,
|
|
20147
|
+
const navigateToSession = (0, import_react2.useCallback)((sessionId2, opts) => {
|
|
19912
20148
|
const url = buildSessionUrl(sessionId2);
|
|
19913
20149
|
if (opts?.replace) {
|
|
19914
20150
|
window.history.replaceState({}, "", url);
|
|
@@ -19920,7 +20156,7 @@ function SimulatorApp({ basePath }) {
|
|
|
19920
20156
|
adoptSessionFromPath,
|
|
19921
20157
|
buildSessionUrl
|
|
19922
20158
|
]);
|
|
19923
|
-
(0,
|
|
20159
|
+
(0, import_react2.useEffect)(() => {
|
|
19924
20160
|
if (initializedRef.current) return;
|
|
19925
20161
|
initializedRef.current = true;
|
|
19926
20162
|
const initialSession = getSessionIdFromPath(void 0, sessionBasePath) ?? getSessionIdFromPath();
|
|
@@ -19938,7 +20174,7 @@ function SimulatorApp({ basePath }) {
|
|
|
19938
20174
|
startNewChat,
|
|
19939
20175
|
sessionBasePath
|
|
19940
20176
|
]);
|
|
19941
|
-
(0,
|
|
20177
|
+
(0, import_react2.useEffect)(() => {
|
|
19942
20178
|
const handler = () => {
|
|
19943
20179
|
const sessionFromPath = getSessionIdFromPath(void 0, sessionBasePath) ?? getSessionIdFromPath();
|
|
19944
20180
|
if (sessionFromPath) {
|
|
@@ -19956,7 +20192,7 @@ function SimulatorApp({ basePath }) {
|
|
|
19956
20192
|
startNewChat,
|
|
19957
20193
|
sessionBasePath
|
|
19958
20194
|
]);
|
|
19959
|
-
(0,
|
|
20195
|
+
(0, import_react2.useEffect)(() => {
|
|
19960
20196
|
if (!pendingSessionId) return;
|
|
19961
20197
|
if (simulator.connectionStatus !== "connected") return;
|
|
19962
20198
|
if (appliedSessionIdRef.current === pendingSessionId) return;
|
|
@@ -19971,7 +20207,7 @@ function SimulatorApp({ basePath }) {
|
|
|
19971
20207
|
const serverNotesUpdatedAt = simulator.savedState?.notes?.updatedAt;
|
|
19972
20208
|
const serverScore = simulator.savedState?.conversationScore?.score ?? null;
|
|
19973
20209
|
const serverScoreUpdatedAt = simulator.savedState?.conversationScore?.updatedAt;
|
|
19974
|
-
(0,
|
|
20210
|
+
(0, import_react2.useEffect)(() => {
|
|
19975
20211
|
if (pendingNoteRef.current !== null) {
|
|
19976
20212
|
if (serverNotesText === pendingNoteRef.current) {
|
|
19977
20213
|
pendingNoteRef.current = null;
|
|
@@ -19984,7 +20220,7 @@ function SimulatorApp({ basePath }) {
|
|
|
19984
20220
|
}, [
|
|
19985
20221
|
serverNotesText
|
|
19986
20222
|
]);
|
|
19987
|
-
(0,
|
|
20223
|
+
(0, import_react2.useEffect)(() => {
|
|
19988
20224
|
if (noteStatus !== "dirty") return;
|
|
19989
20225
|
const handle = window.setTimeout(() => {
|
|
19990
20226
|
setNoteStatus("saving");
|
|
@@ -19997,7 +20233,7 @@ function SimulatorApp({ basePath }) {
|
|
|
19997
20233
|
noteDraft,
|
|
19998
20234
|
simulator
|
|
19999
20235
|
]);
|
|
20000
|
-
(0,
|
|
20236
|
+
(0, import_react2.useEffect)(() => {
|
|
20001
20237
|
if (pendingScoreRef.current !== null) {
|
|
20002
20238
|
if (serverScore === pendingScoreRef.current) {
|
|
20003
20239
|
pendingScoreRef.current = null;
|
|
@@ -20013,7 +20249,7 @@ function SimulatorApp({ basePath }) {
|
|
|
20013
20249
|
}, [
|
|
20014
20250
|
serverScore
|
|
20015
20251
|
]);
|
|
20016
|
-
const handleSend = (0,
|
|
20252
|
+
const handleSend = (0, import_react2.useCallback)(() => {
|
|
20017
20253
|
const trimmed = message.trim();
|
|
20018
20254
|
if (schema && initEditable) {
|
|
20019
20255
|
if (!canStartWithInit) return;
|
|
@@ -20053,12 +20289,12 @@ function SimulatorApp({ basePath }) {
|
|
|
20053
20289
|
canStartWithInit,
|
|
20054
20290
|
initValue
|
|
20055
20291
|
]);
|
|
20056
|
-
const handleScore = (0,
|
|
20292
|
+
const handleScore = (0, import_react2.useCallback)((refId, score) => {
|
|
20057
20293
|
simulator.sendFeedback(refId, score);
|
|
20058
20294
|
}, [
|
|
20059
20295
|
simulator
|
|
20060
20296
|
]);
|
|
20061
|
-
const handleReason = (0,
|
|
20297
|
+
const handleReason = (0, import_react2.useCallback)((refId, score, reason) => {
|
|
20062
20298
|
simulator.sendFeedback(refId, score, reason);
|
|
20063
20299
|
}, [
|
|
20064
20300
|
simulator
|
|
@@ -20068,7 +20304,7 @@ function SimulatorApp({ basePath }) {
|
|
|
20068
20304
|
const sessionPermalink = sessionId ? buildSessionUrl(sessionId) : null;
|
|
20069
20305
|
const sessionStatePath = typeof runMeta.sessionStatePath === "string" ? runMeta.sessionStatePath : typeof runMeta.sessionDir === "string" ? `${runMeta.sessionDir}/state.json` : void 0;
|
|
20070
20306
|
const currentSessionScore = pendingScoreRef.current !== null ? pendingScoreRef.current : serverScore;
|
|
20071
|
-
const deckSessions = (0,
|
|
20307
|
+
const deckSessions = (0, import_react2.useMemo)(() => {
|
|
20072
20308
|
return sessions.filter((session) => {
|
|
20073
20309
|
if (!session) return false;
|
|
20074
20310
|
if (session.deckSlug) return session.deckSlug === currentDeckSlug;
|
|
@@ -20081,51 +20317,51 @@ function SimulatorApp({ basePath }) {
|
|
|
20081
20317
|
sessions,
|
|
20082
20318
|
currentDeckSlug
|
|
20083
20319
|
]);
|
|
20084
|
-
const recentSessionsEmpty = /* @__PURE__ */ (0,
|
|
20320
|
+
const recentSessionsEmpty = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RecentSessionsEmptyState, {
|
|
20085
20321
|
sessions: deckSessions,
|
|
20086
20322
|
loading: sessionsLoading,
|
|
20087
20323
|
error: sessionsError,
|
|
20088
20324
|
onSelect: (id) => navigateToSession(id),
|
|
20089
20325
|
onOpenAll: () => setSessionsOpen(true)
|
|
20090
20326
|
});
|
|
20091
|
-
return /* @__PURE__ */ (0,
|
|
20327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20092
20328
|
className: "app-shell",
|
|
20093
20329
|
children: [
|
|
20094
|
-
/* @__PURE__ */ (0,
|
|
20330
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", {
|
|
20095
20331
|
className: "app-header",
|
|
20096
20332
|
children: [
|
|
20097
|
-
/* @__PURE__ */ (0,
|
|
20333
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20098
20334
|
children: [
|
|
20099
|
-
/* @__PURE__ */ (0,
|
|
20335
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h1", {
|
|
20100
20336
|
children: "Gambit Debug"
|
|
20101
20337
|
}),
|
|
20102
|
-
/* @__PURE__ */ (0,
|
|
20338
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20103
20339
|
className: "deck-path",
|
|
20104
20340
|
children: deckPath
|
|
20105
20341
|
})
|
|
20106
20342
|
]
|
|
20107
20343
|
}),
|
|
20108
|
-
/* @__PURE__ */ (0,
|
|
20344
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20109
20345
|
className: "header-actions",
|
|
20110
20346
|
children: [
|
|
20111
|
-
sessionId && /* @__PURE__ */ (0,
|
|
20347
|
+
sessionId && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", {
|
|
20112
20348
|
href: buildCalibratePath(sessionId),
|
|
20113
20349
|
className: "ghost-btn",
|
|
20114
20350
|
title: "Open Calibrate tab for this session",
|
|
20115
20351
|
children: "Calibrate session"
|
|
20116
20352
|
}),
|
|
20117
|
-
/* @__PURE__ */ (0,
|
|
20353
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
20118
20354
|
type: "button",
|
|
20119
20355
|
onClick: () => setSessionsOpen(true),
|
|
20120
20356
|
children: "Sessions"
|
|
20121
20357
|
}),
|
|
20122
|
-
/* @__PURE__ */ (0,
|
|
20358
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
20123
20359
|
type: "button",
|
|
20124
20360
|
onClick: () => startNewChat(),
|
|
20125
20361
|
className: pendingReset ? "primary" : "",
|
|
20126
20362
|
children: "New Chat"
|
|
20127
20363
|
}),
|
|
20128
|
-
/* @__PURE__ */ (0,
|
|
20364
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20129
20365
|
className: `status-indicator ${simulator.connectionStatus}`,
|
|
20130
20366
|
children: simulator.connectionStatus
|
|
20131
20367
|
})
|
|
@@ -20133,12 +20369,12 @@ function SimulatorApp({ basePath }) {
|
|
|
20133
20369
|
})
|
|
20134
20370
|
]
|
|
20135
20371
|
}),
|
|
20136
|
-
/* @__PURE__ */ (0,
|
|
20372
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("main", {
|
|
20137
20373
|
className: "app-main",
|
|
20138
20374
|
children: [
|
|
20139
|
-
/* @__PURE__ */ (0,
|
|
20375
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ConversationView, {
|
|
20140
20376
|
messages,
|
|
20141
|
-
header: schema ? /* @__PURE__ */ (0,
|
|
20377
|
+
header: schema ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InitPanel, {
|
|
20142
20378
|
schema,
|
|
20143
20379
|
value: initValue,
|
|
20144
20380
|
lockedValue: lockedInitValue,
|
|
@@ -20198,18 +20434,18 @@ function SimulatorApp({ basePath }) {
|
|
|
20198
20434
|
onScore: handleScore,
|
|
20199
20435
|
onReasonChange: handleReason
|
|
20200
20436
|
}),
|
|
20201
|
-
/* @__PURE__ */ (0,
|
|
20437
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TraceList, {
|
|
20202
20438
|
traces: simulator.traceEvents
|
|
20203
20439
|
})
|
|
20204
20440
|
]
|
|
20205
20441
|
}),
|
|
20206
|
-
/* @__PURE__ */ (0,
|
|
20442
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("footer", {
|
|
20207
20443
|
className: "composer",
|
|
20208
20444
|
children: [
|
|
20209
|
-
/* @__PURE__ */ (0,
|
|
20445
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20210
20446
|
className: "composer-inputs",
|
|
20211
20447
|
children: [
|
|
20212
|
-
/* @__PURE__ */ (0,
|
|
20448
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("textarea", {
|
|
20213
20449
|
className: "message-input",
|
|
20214
20450
|
"data-testid": "debug-message-input",
|
|
20215
20451
|
placeholder: schema && initEditable ? "Optional first message (init will be sent too)" : "Optional message (assistant can start)",
|
|
@@ -20222,23 +20458,23 @@ function SimulatorApp({ basePath }) {
|
|
|
20222
20458
|
}
|
|
20223
20459
|
}
|
|
20224
20460
|
}),
|
|
20225
|
-
/* @__PURE__ */ (0,
|
|
20461
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20226
20462
|
className: "notes-inline",
|
|
20227
20463
|
children: [
|
|
20228
|
-
/* @__PURE__ */ (0,
|
|
20464
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", {
|
|
20229
20465
|
children: [
|
|
20230
|
-
/* @__PURE__ */ (0,
|
|
20466
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", {
|
|
20231
20467
|
htmlFor: "session-notes",
|
|
20232
20468
|
children: "Session notes"
|
|
20233
20469
|
}),
|
|
20234
|
-
/* @__PURE__ */ (0,
|
|
20470
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20235
20471
|
className: "rating-controls",
|
|
20236
20472
|
children: [
|
|
20237
|
-
/* @__PURE__ */ (0,
|
|
20473
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
20238
20474
|
className: "rating-label",
|
|
20239
20475
|
children: "Overall score"
|
|
20240
20476
|
}),
|
|
20241
|
-
SCORE_VALUES.map((value) => /* @__PURE__ */ (0,
|
|
20477
|
+
SCORE_VALUES.map((value) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
20242
20478
|
type: "button",
|
|
20243
20479
|
className: classNames("rating-button", currentSessionScore === value && "active"),
|
|
20244
20480
|
onClick: () => {
|
|
@@ -20252,7 +20488,7 @@ function SimulatorApp({ basePath }) {
|
|
|
20252
20488
|
})
|
|
20253
20489
|
]
|
|
20254
20490
|
}),
|
|
20255
|
-
/* @__PURE__ */ (0,
|
|
20491
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("textarea", {
|
|
20256
20492
|
id: "session-notes",
|
|
20257
20493
|
value: noteDraft,
|
|
20258
20494
|
onChange: (e) => {
|
|
@@ -20261,14 +20497,14 @@ function SimulatorApp({ basePath }) {
|
|
|
20261
20497
|
},
|
|
20262
20498
|
placeholder: "Add context or TODOs..."
|
|
20263
20499
|
}),
|
|
20264
|
-
/* @__PURE__ */ (0,
|
|
20500
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20265
20501
|
className: "notes-inline-status",
|
|
20266
|
-
children: /* @__PURE__ */ (0,
|
|
20502
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
20267
20503
|
className: classNames("state", noteStatus === "saving" && "saving", noteStatus === "dirty" && "unsaved", noteStatus === "idle" && "idle", noteStatus === "saved" && "saved"),
|
|
20268
20504
|
children: noteStatus === "saving" ? "Saving\u2026" : noteStatus === "dirty" ? "Unsaved changes\u2026" : noteStatus === "saved" ? serverNotesUpdatedAt ? `Saved ${formatTimestamp(serverNotesUpdatedAt)}` : "Saved" : "No notes yet."
|
|
20269
20505
|
})
|
|
20270
20506
|
}),
|
|
20271
|
-
/* @__PURE__ */ (0,
|
|
20507
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20272
20508
|
className: "rating-status",
|
|
20273
20509
|
children: [
|
|
20274
20510
|
"Overall score:",
|
|
@@ -20282,59 +20518,59 @@ function SimulatorApp({ basePath }) {
|
|
|
20282
20518
|
})
|
|
20283
20519
|
]
|
|
20284
20520
|
}),
|
|
20285
|
-
pendingReset && /* @__PURE__ */ (0,
|
|
20521
|
+
pendingReset && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20286
20522
|
className: "reset-note",
|
|
20287
20523
|
children: "Next message will start a new chat."
|
|
20288
20524
|
}),
|
|
20289
|
-
/* @__PURE__ */ (0,
|
|
20525
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20290
20526
|
className: "composer-actions",
|
|
20291
20527
|
children: [
|
|
20292
|
-
/* @__PURE__ */ (0,
|
|
20528
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
20293
20529
|
type: "button",
|
|
20294
20530
|
onClick: handleSend,
|
|
20295
20531
|
disabled: schema && initEditable && !canStartWithInit,
|
|
20296
20532
|
"data-testid": "debug-send",
|
|
20297
20533
|
children: schema && initEditable ? "Start chat" : "Send"
|
|
20298
20534
|
}),
|
|
20299
|
-
/* @__PURE__ */ (0,
|
|
20535
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
20300
20536
|
type: "button",
|
|
20301
20537
|
onClick: simulator.reconnect,
|
|
20302
20538
|
children: "Reconnect"
|
|
20303
20539
|
})
|
|
20304
20540
|
]
|
|
20305
20541
|
}),
|
|
20306
|
-
simulator.errors.map((err, idx) => /* @__PURE__ */ (0,
|
|
20542
|
+
simulator.errors.map((err, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20307
20543
|
className: "error",
|
|
20308
20544
|
children: err
|
|
20309
20545
|
}, idx)),
|
|
20310
|
-
sessionId && /* @__PURE__ */ (0,
|
|
20546
|
+
sessionId && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20311
20547
|
className: "session-meta",
|
|
20312
20548
|
children: [
|
|
20313
20549
|
"Session: ",
|
|
20314
|
-
sessionPermalink ? /* @__PURE__ */ (0,
|
|
20550
|
+
sessionPermalink ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", {
|
|
20315
20551
|
href: sessionPermalink,
|
|
20316
20552
|
className: "session-link",
|
|
20317
20553
|
title: "Open session permalink",
|
|
20318
|
-
children: /* @__PURE__ */ (0,
|
|
20554
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", {
|
|
20319
20555
|
children: sessionId
|
|
20320
20556
|
})
|
|
20321
|
-
}) : /* @__PURE__ */ (0,
|
|
20557
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", {
|
|
20322
20558
|
children: sessionId
|
|
20323
20559
|
})
|
|
20324
20560
|
]
|
|
20325
20561
|
}),
|
|
20326
|
-
sessionStatePath && /* @__PURE__ */ (0,
|
|
20562
|
+
sessionStatePath && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20327
20563
|
className: "session-meta session-path",
|
|
20328
20564
|
children: [
|
|
20329
20565
|
"State file: ",
|
|
20330
|
-
/* @__PURE__ */ (0,
|
|
20566
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", {
|
|
20331
20567
|
children: sessionStatePath
|
|
20332
20568
|
})
|
|
20333
20569
|
]
|
|
20334
20570
|
})
|
|
20335
20571
|
]
|
|
20336
20572
|
}),
|
|
20337
|
-
/* @__PURE__ */ (0,
|
|
20573
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SessionModal, {
|
|
20338
20574
|
open: sessionsOpen,
|
|
20339
20575
|
sessions: deckSessions,
|
|
20340
20576
|
loading: sessionsLoading,
|
|
@@ -20351,19 +20587,19 @@ function SimulatorApp({ basePath }) {
|
|
|
20351
20587
|
});
|
|
20352
20588
|
}
|
|
20353
20589
|
function CalibrateApp() {
|
|
20354
|
-
const [loading, setLoading] = (0,
|
|
20355
|
-
const [error, setError] = (0,
|
|
20356
|
-
const [graders, setGraders] = (0,
|
|
20357
|
-
const [sessions, setSessions] = (0,
|
|
20358
|
-
const [selectedSessionId, setSelectedSessionId] = (0,
|
|
20359
|
-
const [selectedGraderId, setSelectedGraderId] = (0,
|
|
20360
|
-
const [running, setRunning] = (0,
|
|
20361
|
-
const initialCalibrateSessionRef = (0,
|
|
20362
|
-
const initialCalibrateRef = (0,
|
|
20590
|
+
const [loading, setLoading] = (0, import_react2.useState)(true);
|
|
20591
|
+
const [error, setError] = (0, import_react2.useState)(null);
|
|
20592
|
+
const [graders, setGraders] = (0, import_react2.useState)([]);
|
|
20593
|
+
const [sessions, setSessions] = (0, import_react2.useState)([]);
|
|
20594
|
+
const [selectedSessionId, setSelectedSessionId] = (0, import_react2.useState)(null);
|
|
20595
|
+
const [selectedGraderId, setSelectedGraderId] = (0, import_react2.useState)(null);
|
|
20596
|
+
const [running, setRunning] = (0, import_react2.useState)(false);
|
|
20597
|
+
const initialCalibrateSessionRef = (0, import_react2.useRef)(getCalibrateSessionIdFromLocation());
|
|
20598
|
+
const initialCalibrateRef = (0, import_react2.useRef)((() => {
|
|
20363
20599
|
const ref = getCalibrateRefFromLocation();
|
|
20364
20600
|
return ref ? parseGradingRef(ref) : {};
|
|
20365
20601
|
})());
|
|
20366
|
-
const updateCalibratePath = (0,
|
|
20602
|
+
const updateCalibratePath = (0, import_react2.useCallback)((sessionId, opts) => {
|
|
20367
20603
|
const targetPath = sessionId ? buildCalibratePath(sessionId) : "/calibrate";
|
|
20368
20604
|
if (window.location.pathname === targetPath) return;
|
|
20369
20605
|
const url = new URL(window.location.href);
|
|
@@ -20378,7 +20614,7 @@ function CalibrateApp() {
|
|
|
20378
20614
|
}
|
|
20379
20615
|
window.history.replaceState({}, "", url.toString());
|
|
20380
20616
|
}, []);
|
|
20381
|
-
const loadCalibrateData = (0,
|
|
20617
|
+
const loadCalibrateData = (0, import_react2.useCallback)(async () => {
|
|
20382
20618
|
try {
|
|
20383
20619
|
setLoading(true);
|
|
20384
20620
|
const res = await fetch("/api/calibrate");
|
|
@@ -20412,12 +20648,12 @@ function CalibrateApp() {
|
|
|
20412
20648
|
setLoading(false);
|
|
20413
20649
|
}
|
|
20414
20650
|
}, []);
|
|
20415
|
-
(0,
|
|
20651
|
+
(0, import_react2.useEffect)(() => {
|
|
20416
20652
|
loadCalibrateData();
|
|
20417
20653
|
}, [
|
|
20418
20654
|
loadCalibrateData
|
|
20419
20655
|
]);
|
|
20420
|
-
(0,
|
|
20656
|
+
(0, import_react2.useEffect)(() => {
|
|
20421
20657
|
const streamId = CALIBRATE_STREAM_ID;
|
|
20422
20658
|
const streamUrl = buildDurableStreamUrl(streamId, getDurableStreamOffset(streamId));
|
|
20423
20659
|
const source = new EventSource(streamUrl);
|
|
@@ -20452,7 +20688,7 @@ function CalibrateApp() {
|
|
|
20452
20688
|
source.close();
|
|
20453
20689
|
};
|
|
20454
20690
|
}, []);
|
|
20455
|
-
(0,
|
|
20691
|
+
(0, import_react2.useEffect)(() => {
|
|
20456
20692
|
if (selectedSessionId) {
|
|
20457
20693
|
updateCalibratePath(selectedSessionId);
|
|
20458
20694
|
} else {
|
|
@@ -20462,39 +20698,39 @@ function CalibrateApp() {
|
|
|
20462
20698
|
selectedSessionId,
|
|
20463
20699
|
updateCalibratePath
|
|
20464
20700
|
]);
|
|
20465
|
-
const selectedSession = (0,
|
|
20701
|
+
const selectedSession = (0, import_react2.useMemo)(() => sessions.find((session) => session.id === selectedSessionId) ?? null, [
|
|
20466
20702
|
sessions,
|
|
20467
20703
|
selectedSessionId
|
|
20468
20704
|
]);
|
|
20469
|
-
const selectedGrader = (0,
|
|
20705
|
+
const selectedGrader = (0, import_react2.useMemo)(() => graders.find((grader) => grader.id === selectedGraderId) ?? null, [
|
|
20470
20706
|
graders,
|
|
20471
20707
|
selectedGraderId
|
|
20472
20708
|
]);
|
|
20473
|
-
const sessionDeckDisplay = (0,
|
|
20709
|
+
const sessionDeckDisplay = (0, import_react2.useMemo)(() => {
|
|
20474
20710
|
if (!selectedSession?.deck) return null;
|
|
20475
20711
|
return toRelativePath(selectedSession.deck, repoRootPath) ?? normalizeFsPath(selectedSession.deck);
|
|
20476
20712
|
}, [
|
|
20477
20713
|
selectedSession
|
|
20478
20714
|
]);
|
|
20479
|
-
const sessionDirDisplay = (0,
|
|
20715
|
+
const sessionDirDisplay = (0, import_react2.useMemo)(() => {
|
|
20480
20716
|
if (!selectedSession?.sessionDir) return null;
|
|
20481
20717
|
return toRelativePath(selectedSession.sessionDir, repoRootPath) ?? normalizeFsPath(selectedSession.sessionDir);
|
|
20482
20718
|
}, [
|
|
20483
20719
|
selectedSession
|
|
20484
20720
|
]);
|
|
20485
|
-
const sessionStateDisplay = (0,
|
|
20721
|
+
const sessionStateDisplay = (0, import_react2.useMemo)(() => {
|
|
20486
20722
|
if (!selectedSession?.statePath) return null;
|
|
20487
20723
|
return toRelativePath(selectedSession.statePath, repoRootPath) ?? normalizeFsPath(selectedSession.statePath);
|
|
20488
20724
|
}, [
|
|
20489
20725
|
selectedSession
|
|
20490
20726
|
]);
|
|
20491
|
-
const sessionCreatedLabel = (0,
|
|
20727
|
+
const sessionCreatedLabel = (0, import_react2.useMemo)(() => {
|
|
20492
20728
|
return selectedSession?.createdAt ? formatTimestamp(selectedSession.createdAt) : null;
|
|
20493
20729
|
}, [
|
|
20494
20730
|
selectedSession
|
|
20495
20731
|
]);
|
|
20496
20732
|
const sessionDebugHref = selectedSession ? `${SESSIONS_BASE_PATH}/${encodeURIComponent(selectedSession.id)}/debug` : null;
|
|
20497
|
-
const sessionRuns = (0,
|
|
20733
|
+
const sessionRuns = (0, import_react2.useMemo)(() => {
|
|
20498
20734
|
if (!selectedSession?.gradingRuns) return [];
|
|
20499
20735
|
return [
|
|
20500
20736
|
...selectedSession.gradingRuns
|
|
@@ -20502,7 +20738,7 @@ function CalibrateApp() {
|
|
|
20502
20738
|
}, [
|
|
20503
20739
|
selectedSession
|
|
20504
20740
|
]);
|
|
20505
|
-
const runSections = (0,
|
|
20741
|
+
const runSections = (0, import_react2.useMemo)(() => {
|
|
20506
20742
|
return sessionRuns.map((run) => {
|
|
20507
20743
|
const items = [];
|
|
20508
20744
|
const result = run.result;
|
|
@@ -20591,16 +20827,16 @@ function CalibrateApp() {
|
|
|
20591
20827
|
}, [
|
|
20592
20828
|
sessionRuns
|
|
20593
20829
|
]);
|
|
20594
|
-
const runItems = (0,
|
|
20830
|
+
const runItems = (0, import_react2.useMemo)(() => runSections.flatMap((section) => section.items), [
|
|
20595
20831
|
runSections
|
|
20596
20832
|
]);
|
|
20597
|
-
const [expandedRunId, setExpandedRunId] = (0,
|
|
20598
|
-
const [expandedResults, setExpandedResults] = (0,
|
|
20599
|
-
const [highlightedResult, setHighlightedResult] = (0,
|
|
20600
|
-
const [copiedRef, setCopiedRef] = (0,
|
|
20601
|
-
const [referenceDrafts, setReferenceDrafts] = (0,
|
|
20602
|
-
const [showRawInputs, setShowRawInputs] = (0,
|
|
20603
|
-
(0,
|
|
20833
|
+
const [expandedRunId, setExpandedRunId] = (0, import_react2.useState)(null);
|
|
20834
|
+
const [expandedResults, setExpandedResults] = (0, import_react2.useState)({});
|
|
20835
|
+
const [highlightedResult, setHighlightedResult] = (0, import_react2.useState)(null);
|
|
20836
|
+
const [copiedRef, setCopiedRef] = (0, import_react2.useState)(null);
|
|
20837
|
+
const [referenceDrafts, setReferenceDrafts] = (0, import_react2.useState)({});
|
|
20838
|
+
const [showRawInputs, setShowRawInputs] = (0, import_react2.useState)({});
|
|
20839
|
+
(0, import_react2.useEffect)(() => {
|
|
20604
20840
|
const ref = initialCalibrateRef.current;
|
|
20605
20841
|
if (!ref.runId) return;
|
|
20606
20842
|
const match = runItems.find((item) => item.runId === ref.runId && (ref.turnIndex === void 0 || item.turnIndex === ref.turnIndex));
|
|
@@ -20614,7 +20850,7 @@ function CalibrateApp() {
|
|
|
20614
20850
|
}, [
|
|
20615
20851
|
runItems
|
|
20616
20852
|
]);
|
|
20617
|
-
(0,
|
|
20853
|
+
(0, import_react2.useEffect)(() => {
|
|
20618
20854
|
const latestRunId = runSections[0]?.run.id ?? null;
|
|
20619
20855
|
if (!latestRunId) {
|
|
20620
20856
|
setExpandedRunId(null);
|
|
@@ -20624,7 +20860,7 @@ function CalibrateApp() {
|
|
|
20624
20860
|
}, [
|
|
20625
20861
|
runSections
|
|
20626
20862
|
]);
|
|
20627
|
-
const runGrader = (0,
|
|
20863
|
+
const runGrader = (0, import_react2.useCallback)(async () => {
|
|
20628
20864
|
if (!selectedSessionId || !selectedGraderId) return;
|
|
20629
20865
|
try {
|
|
20630
20866
|
setRunning(true);
|
|
@@ -20670,26 +20906,26 @@ function CalibrateApp() {
|
|
|
20670
20906
|
selectedGraderId
|
|
20671
20907
|
]);
|
|
20672
20908
|
const canRun = Boolean(selectedSessionId && selectedGraderId && !running);
|
|
20673
|
-
return /* @__PURE__ */ (0,
|
|
20909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20674
20910
|
className: "app-shell calibrate-shell",
|
|
20675
20911
|
children: [
|
|
20676
|
-
/* @__PURE__ */ (0,
|
|
20912
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", {
|
|
20677
20913
|
className: "app-header",
|
|
20678
20914
|
children: [
|
|
20679
|
-
/* @__PURE__ */ (0,
|
|
20915
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20680
20916
|
children: [
|
|
20681
|
-
/* @__PURE__ */ (0,
|
|
20917
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h1", {
|
|
20682
20918
|
children: "Gambit Calibrate"
|
|
20683
20919
|
}),
|
|
20684
|
-
/* @__PURE__ */ (0,
|
|
20920
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20685
20921
|
className: "deck-path",
|
|
20686
20922
|
children: "Run deck-defined graders against saved sessions."
|
|
20687
20923
|
})
|
|
20688
20924
|
]
|
|
20689
20925
|
}),
|
|
20690
|
-
/* @__PURE__ */ (0,
|
|
20926
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20691
20927
|
className: "header-actions",
|
|
20692
|
-
children: /* @__PURE__ */ (0,
|
|
20928
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
20693
20929
|
type: "button",
|
|
20694
20930
|
className: "ghost-btn",
|
|
20695
20931
|
onClick: loadCalibrateData,
|
|
@@ -20699,40 +20935,40 @@ function CalibrateApp() {
|
|
|
20699
20935
|
})
|
|
20700
20936
|
]
|
|
20701
20937
|
}),
|
|
20702
|
-
/* @__PURE__ */ (0,
|
|
20938
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("main", {
|
|
20703
20939
|
className: "calibrate-layout",
|
|
20704
20940
|
children: [
|
|
20705
|
-
/* @__PURE__ */ (0,
|
|
20941
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20706
20942
|
className: "chat-column calibrate-main-column",
|
|
20707
20943
|
children: [
|
|
20708
|
-
error && /* @__PURE__ */ (0,
|
|
20944
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20709
20945
|
className: "error",
|
|
20710
20946
|
children: error
|
|
20711
20947
|
}),
|
|
20712
|
-
loading && /* @__PURE__ */ (0,
|
|
20948
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20713
20949
|
className: "editor-status",
|
|
20714
20950
|
children: "Loading calibration data\u2026"
|
|
20715
20951
|
}),
|
|
20716
|
-
!loading && /* @__PURE__ */ (0,
|
|
20952
|
+
!loading && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, {
|
|
20717
20953
|
children: [
|
|
20718
|
-
sessions.length === 0 && /* @__PURE__ */ (0,
|
|
20954
|
+
sessions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20719
20955
|
className: "placeholder",
|
|
20720
20956
|
children: "No sessions found. Run the Test Bot to capture a session before calibrating."
|
|
20721
20957
|
}),
|
|
20722
|
-
graders.length === 0 && /* @__PURE__ */ (0,
|
|
20958
|
+
graders.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20723
20959
|
className: "placeholder",
|
|
20724
20960
|
children: [
|
|
20725
20961
|
"No grader decks found. Add ",
|
|
20726
|
-
/* @__PURE__ */ (0,
|
|
20962
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", {
|
|
20727
20963
|
children: "[[graderDecks]]"
|
|
20728
20964
|
}),
|
|
20729
20965
|
" ",
|
|
20730
20966
|
"to your deck front matter to surface graders here."
|
|
20731
20967
|
]
|
|
20732
20968
|
}),
|
|
20733
|
-
sessions.length > 0 && graders.length > 0 && /* @__PURE__ */ (0,
|
|
20969
|
+
sessions.length > 0 && graders.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, {
|
|
20734
20970
|
children: [
|
|
20735
|
-
/* @__PURE__ */ (0,
|
|
20971
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20736
20972
|
className: "editor-panel calibrate-runner",
|
|
20737
20973
|
style: {
|
|
20738
20974
|
display: "flex",
|
|
@@ -20740,16 +20976,16 @@ function CalibrateApp() {
|
|
|
20740
20976
|
gap: 10
|
|
20741
20977
|
},
|
|
20742
20978
|
children: [
|
|
20743
|
-
/* @__PURE__ */ (0,
|
|
20979
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", {
|
|
20744
20980
|
children: "Run a grader"
|
|
20745
20981
|
}),
|
|
20746
|
-
/* @__PURE__ */ (0,
|
|
20982
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", {
|
|
20747
20983
|
style: {
|
|
20748
20984
|
fontWeight: 600
|
|
20749
20985
|
},
|
|
20750
20986
|
children: [
|
|
20751
20987
|
"Session",
|
|
20752
|
-
/* @__PURE__ */ (0,
|
|
20988
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("select", {
|
|
20753
20989
|
"data-testid": "calibrate-session-select",
|
|
20754
20990
|
value: selectedSessionId ?? "",
|
|
20755
20991
|
onChange: (e) => setSelectedSessionId(e.target.value.length ? e.target.value : null),
|
|
@@ -20761,7 +20997,7 @@ function CalibrateApp() {
|
|
|
20761
20997
|
fontFamily: "inherit",
|
|
20762
20998
|
marginTop: 4
|
|
20763
20999
|
},
|
|
20764
|
-
children: sessions.map((session) => /* @__PURE__ */ (0,
|
|
21000
|
+
children: sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("option", {
|
|
20765
21001
|
value: session.id,
|
|
20766
21002
|
children: [
|
|
20767
21003
|
session.testBotName ?? session.deckSlug ?? session.deck ?? session.id,
|
|
@@ -20771,13 +21007,13 @@ function CalibrateApp() {
|
|
|
20771
21007
|
})
|
|
20772
21008
|
]
|
|
20773
21009
|
}),
|
|
20774
|
-
/* @__PURE__ */ (0,
|
|
21010
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", {
|
|
20775
21011
|
style: {
|
|
20776
21012
|
fontWeight: 600
|
|
20777
21013
|
},
|
|
20778
21014
|
children: [
|
|
20779
21015
|
"Grader",
|
|
20780
|
-
/* @__PURE__ */ (0,
|
|
21016
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("select", {
|
|
20781
21017
|
"data-testid": "calibrate-grader-select",
|
|
20782
21018
|
value: selectedGraderId ?? "",
|
|
20783
21019
|
onChange: (e) => setSelectedGraderId(e.target.value.length ? e.target.value : null),
|
|
@@ -20789,32 +21025,32 @@ function CalibrateApp() {
|
|
|
20789
21025
|
fontFamily: "inherit",
|
|
20790
21026
|
marginTop: 4
|
|
20791
21027
|
},
|
|
20792
|
-
children: graders.map((grader) => /* @__PURE__ */ (0,
|
|
21028
|
+
children: graders.map((grader) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", {
|
|
20793
21029
|
value: grader.id,
|
|
20794
21030
|
children: grader.label
|
|
20795
21031
|
}, grader.id))
|
|
20796
21032
|
})
|
|
20797
21033
|
]
|
|
20798
21034
|
}),
|
|
20799
|
-
selectedGrader?.description && /* @__PURE__ */ (0,
|
|
21035
|
+
selectedGrader?.description && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20800
21036
|
className: "placeholder",
|
|
20801
21037
|
children: selectedGrader.description
|
|
20802
21038
|
}),
|
|
20803
|
-
/* @__PURE__ */ (0,
|
|
21039
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20804
21040
|
style: {
|
|
20805
21041
|
display: "flex",
|
|
20806
21042
|
gap: 8,
|
|
20807
21043
|
flexWrap: "wrap"
|
|
20808
21044
|
},
|
|
20809
21045
|
children: [
|
|
20810
|
-
/* @__PURE__ */ (0,
|
|
21046
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
20811
21047
|
type: "button",
|
|
20812
21048
|
className: "primary",
|
|
20813
21049
|
onClick: runGrader,
|
|
20814
21050
|
disabled: !canRun,
|
|
20815
21051
|
children: running ? "Running\u2026" : "Run grader"
|
|
20816
21052
|
}),
|
|
20817
|
-
/* @__PURE__ */ (0,
|
|
21053
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
20818
21054
|
type: "button",
|
|
20819
21055
|
className: "ghost-btn",
|
|
20820
21056
|
onClick: loadCalibrateData,
|
|
@@ -20825,7 +21061,7 @@ function CalibrateApp() {
|
|
|
20825
21061
|
})
|
|
20826
21062
|
]
|
|
20827
21063
|
}),
|
|
20828
|
-
/* @__PURE__ */ (0,
|
|
21064
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20829
21065
|
className: "editor-panel calibrate-results",
|
|
20830
21066
|
style: {
|
|
20831
21067
|
display: "flex",
|
|
@@ -20833,13 +21069,13 @@ function CalibrateApp() {
|
|
|
20833
21069
|
gap: 12
|
|
20834
21070
|
},
|
|
20835
21071
|
children: [
|
|
20836
|
-
/* @__PURE__ */ (0,
|
|
21072
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("strong", {
|
|
20837
21073
|
children: [
|
|
20838
21074
|
"Recent results ",
|
|
20839
21075
|
selectedSession && `(Session ${selectedSession.id})`
|
|
20840
21076
|
]
|
|
20841
21077
|
}),
|
|
20842
|
-
runItems.length === 0 && /* @__PURE__ */ (0,
|
|
21078
|
+
runItems.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20843
21079
|
className: "placeholder",
|
|
20844
21080
|
children: "No grader runs for this session yet."
|
|
20845
21081
|
}),
|
|
@@ -20854,10 +21090,10 @@ function CalibrateApp() {
|
|
|
20854
21090
|
const turnLabel = idx + 1;
|
|
20855
21091
|
const item = section.items.find((entry) => entry.turnNumber === turnLabel || entry.pending && entry.turnNumber === turnLabel);
|
|
20856
21092
|
if (item?.pending) {
|
|
20857
|
-
return /* @__PURE__ */ (0,
|
|
21093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
20858
21094
|
className: "calibrate-run-turn calibrate-run-turn--pending",
|
|
20859
21095
|
title: `Turn ${turnLabel}: running`,
|
|
20860
|
-
children: /* @__PURE__ */ (0,
|
|
21096
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
20861
21097
|
className: "calibrate-spinner calibrate-spinner--tiny",
|
|
20862
21098
|
role: "status",
|
|
20863
21099
|
"aria-label": "Grading"
|
|
@@ -20869,12 +21105,12 @@ function CalibrateApp() {
|
|
|
20869
21105
|
const reference = extractScoreAndReasonFromSample(item.referenceSample);
|
|
20870
21106
|
const displayScore = reference.score ?? graded.score;
|
|
20871
21107
|
const scoreClass = getScoreClass(displayScore);
|
|
20872
|
-
return /* @__PURE__ */ (0,
|
|
21108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
20873
21109
|
className: `calibrate-run-turn ${scoreClass}`,
|
|
20874
21110
|
title: `Turn ${turnLabel}: ${displayScore ?? "\u2014"}`
|
|
20875
21111
|
}, `${section.run.id}-turn-${turnLabel}`);
|
|
20876
21112
|
}
|
|
20877
|
-
return /* @__PURE__ */ (0,
|
|
21113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
20878
21114
|
className: "calibrate-run-turn calibrate-run-turn--empty",
|
|
20879
21115
|
title: `Turn ${turnLabel}: pending`
|
|
20880
21116
|
}, `${section.run.id}-turn-${turnLabel}`);
|
|
@@ -20882,10 +21118,10 @@ function CalibrateApp() {
|
|
|
20882
21118
|
const item = section.items[0];
|
|
20883
21119
|
if (section.run.status === "running") {
|
|
20884
21120
|
return [
|
|
20885
|
-
/* @__PURE__ */ (0,
|
|
21121
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
20886
21122
|
className: "calibrate-run-turn calibrate-run-turn--pending",
|
|
20887
21123
|
title: "Running",
|
|
20888
|
-
children: /* @__PURE__ */ (0,
|
|
21124
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
20889
21125
|
className: "calibrate-spinner calibrate-spinner--tiny",
|
|
20890
21126
|
role: "status",
|
|
20891
21127
|
"aria-label": "Grading"
|
|
@@ -20899,7 +21135,7 @@ function CalibrateApp() {
|
|
|
20899
21135
|
const displayScore = reference.score ?? graded.score;
|
|
20900
21136
|
const scoreClass = getScoreClass(displayScore);
|
|
20901
21137
|
return [
|
|
20902
|
-
/* @__PURE__ */ (0,
|
|
21138
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
20903
21139
|
className: `calibrate-run-turn ${scoreClass}`,
|
|
20904
21140
|
title: `Result: ${displayScore ?? "\u2014"}`
|
|
20905
21141
|
}, `${section.run.id}-result`)
|
|
@@ -20907,28 +21143,28 @@ function CalibrateApp() {
|
|
|
20907
21143
|
}
|
|
20908
21144
|
return [];
|
|
20909
21145
|
})();
|
|
20910
|
-
return /* @__PURE__ */ (0,
|
|
21146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20911
21147
|
className: "calibrate-run-card",
|
|
20912
21148
|
children: [
|
|
20913
|
-
/* @__PURE__ */ (0,
|
|
21149
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20914
21150
|
className: "calibrate-run-header",
|
|
20915
21151
|
children: [
|
|
20916
|
-
/* @__PURE__ */ (0,
|
|
21152
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20917
21153
|
children: [
|
|
20918
|
-
/* @__PURE__ */ (0,
|
|
21154
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20919
21155
|
className: "calibrate-run-title-row",
|
|
20920
21156
|
children: [
|
|
20921
|
-
/* @__PURE__ */ (0,
|
|
21157
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20922
21158
|
className: "calibrate-run-title",
|
|
20923
21159
|
children: section.label
|
|
20924
21160
|
}),
|
|
20925
|
-
/* @__PURE__ */ (0,
|
|
21161
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20926
21162
|
className: "calibrate-run-turns",
|
|
20927
21163
|
children: turnBadges
|
|
20928
21164
|
})
|
|
20929
21165
|
]
|
|
20930
21166
|
}),
|
|
20931
|
-
/* @__PURE__ */ (0,
|
|
21167
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20932
21168
|
className: "calibrate-run-subtitle",
|
|
20933
21169
|
children: [
|
|
20934
21170
|
section.run.status,
|
|
@@ -20937,7 +21173,7 @@ function CalibrateApp() {
|
|
|
20937
21173
|
})
|
|
20938
21174
|
]
|
|
20939
21175
|
}),
|
|
20940
|
-
/* @__PURE__ */ (0,
|
|
21176
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
20941
21177
|
type: "button",
|
|
20942
21178
|
className: "ghost-btn calibrate-run-toggle",
|
|
20943
21179
|
onClick: () => setExpandedRunId((prev) => prev === section.run.id ? null : section.run.id),
|
|
@@ -20945,7 +21181,7 @@ function CalibrateApp() {
|
|
|
20945
21181
|
})
|
|
20946
21182
|
]
|
|
20947
21183
|
}),
|
|
20948
|
-
isExpanded && /* @__PURE__ */ (0,
|
|
21184
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20949
21185
|
className: "calibrate-run-body",
|
|
20950
21186
|
children: section.items.map((item) => {
|
|
20951
21187
|
const graded = extractScoreAndReason(item.result);
|
|
@@ -20960,61 +21196,61 @@ function CalibrateApp() {
|
|
|
20960
21196
|
const scoreClass = getScoreClass(displayScore);
|
|
20961
21197
|
const isOpen = !isPending && Boolean(expandedResults[item.key]);
|
|
20962
21198
|
const draft = referenceDrafts[item.key];
|
|
20963
|
-
return /* @__PURE__ */ (0,
|
|
21199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20964
21200
|
className: `calibrate-run-section${highlightedResult === item.key ? " trace-row-highlight" : ""}`,
|
|
20965
21201
|
children: [
|
|
20966
|
-
/* @__PURE__ */ (0,
|
|
21202
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20967
21203
|
className: "calibrate-result-header",
|
|
20968
21204
|
children: [
|
|
20969
|
-
/* @__PURE__ */ (0,
|
|
21205
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20970
21206
|
className: "calibrate-result-main",
|
|
20971
21207
|
children: [
|
|
20972
|
-
/* @__PURE__ */ (0,
|
|
21208
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20973
21209
|
className: `calibrate-score-badge ${scoreClass}${isPending ? " calibrate-score-badge--pending" : ""}`,
|
|
20974
|
-
children: isPending ? /* @__PURE__ */ (0,
|
|
21210
|
+
children: isPending ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
20975
21211
|
className: "calibrate-spinner",
|
|
20976
21212
|
role: "status",
|
|
20977
21213
|
"aria-label": "Grading"
|
|
20978
21214
|
}) : displayScore !== void 0 ? displayScore : "\u2014"
|
|
20979
21215
|
}),
|
|
20980
|
-
/* @__PURE__ */ (0,
|
|
21216
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20981
21217
|
className: "calibrate-result-meta",
|
|
20982
21218
|
children: [
|
|
20983
|
-
/* @__PURE__ */ (0,
|
|
21219
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
20984
21220
|
className: "calibrate-result-title",
|
|
20985
21221
|
children: item.label
|
|
20986
21222
|
}),
|
|
20987
|
-
/* @__PURE__ */ (0,
|
|
21223
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
20988
21224
|
className: "calibrate-result-subtitle",
|
|
20989
21225
|
children: [
|
|
20990
21226
|
item.status,
|
|
20991
21227
|
item.runAt ? ` \xB7 ${formatTimestampShort(item.runAt)}` : "",
|
|
20992
|
-
reference.score !== void 0 && /* @__PURE__ */ (0,
|
|
21228
|
+
reference.score !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
20993
21229
|
className: "calibrate-score-chip",
|
|
20994
21230
|
children: "ref"
|
|
20995
21231
|
}),
|
|
20996
|
-
delta !== void 0 && /* @__PURE__ */ (0,
|
|
21232
|
+
delta !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
20997
21233
|
className: "calibrate-delta-chip",
|
|
20998
21234
|
children: delta >= 0 ? `+${delta}` : `${delta}`
|
|
20999
21235
|
}),
|
|
21000
|
-
polarityFlip && /* @__PURE__ */ (0,
|
|
21236
|
+
polarityFlip && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
|
|
21001
21237
|
className: "calibrate-alert-chip",
|
|
21002
21238
|
children: "!"
|
|
21003
21239
|
})
|
|
21004
21240
|
]
|
|
21005
21241
|
}),
|
|
21006
|
-
displayReason && !isPending && /* @__PURE__ */ (0,
|
|
21242
|
+
displayReason && !isPending && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21007
21243
|
className: "calibrate-result-reason",
|
|
21008
21244
|
children: displayReason
|
|
21009
21245
|
}),
|
|
21010
|
-
reference.score !== void 0 && graded.score !== void 0 && /* @__PURE__ */ (0,
|
|
21246
|
+
reference.score !== void 0 && graded.score !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21011
21247
|
className: "calibrate-result-secondary",
|
|
21012
21248
|
children: [
|
|
21013
21249
|
"Graded score: ",
|
|
21014
21250
|
graded.score
|
|
21015
21251
|
]
|
|
21016
21252
|
}),
|
|
21017
|
-
isPending && /* @__PURE__ */ (0,
|
|
21253
|
+
isPending && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21018
21254
|
className: "calibrate-result-secondary",
|
|
21019
21255
|
children: "Grading\u2026"
|
|
21020
21256
|
})
|
|
@@ -21022,10 +21258,10 @@ function CalibrateApp() {
|
|
|
21022
21258
|
})
|
|
21023
21259
|
]
|
|
21024
21260
|
}),
|
|
21025
|
-
!isPending && /* @__PURE__ */ (0,
|
|
21261
|
+
!isPending && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21026
21262
|
className: "calibrate-result-actions",
|
|
21027
21263
|
children: [
|
|
21028
|
-
/* @__PURE__ */ (0,
|
|
21264
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
21029
21265
|
type: "button",
|
|
21030
21266
|
className: "ghost-btn calibrate-ref-copy",
|
|
21031
21267
|
onClick: () => {
|
|
@@ -21037,7 +21273,7 @@ function CalibrateApp() {
|
|
|
21037
21273
|
},
|
|
21038
21274
|
children: copiedRef === item.key ? "Copied" : "Copy ref"
|
|
21039
21275
|
}),
|
|
21040
|
-
/* @__PURE__ */ (0,
|
|
21276
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
21041
21277
|
type: "button",
|
|
21042
21278
|
className: "ghost-btn calibrate-toggle",
|
|
21043
21279
|
onClick: () => setExpandedResults((prev) => {
|
|
@@ -21066,34 +21302,34 @@ function CalibrateApp() {
|
|
|
21066
21302
|
})
|
|
21067
21303
|
]
|
|
21068
21304
|
}),
|
|
21069
|
-
item.error && /* @__PURE__ */ (0,
|
|
21305
|
+
item.error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21070
21306
|
className: "error",
|
|
21071
21307
|
children: item.error
|
|
21072
21308
|
}),
|
|
21073
|
-
item.turnIndex !== void 0 && !isPending && /* @__PURE__ */ (0,
|
|
21309
|
+
item.turnIndex !== void 0 && !isPending && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21074
21310
|
className: "calibrate-context calibrate-context-compact",
|
|
21075
21311
|
children: [
|
|
21076
|
-
turnContext.priorUser && /* @__PURE__ */ (0,
|
|
21312
|
+
turnContext.priorUser && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21077
21313
|
className: "calibrate-context-row",
|
|
21078
21314
|
children: [
|
|
21079
|
-
/* @__PURE__ */ (0,
|
|
21315
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21080
21316
|
className: "calibrate-context-label",
|
|
21081
21317
|
children: "Prior user"
|
|
21082
21318
|
}),
|
|
21083
|
-
/* @__PURE__ */ (0,
|
|
21319
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21084
21320
|
className: "calibrate-context-bubble calibrate-context-user",
|
|
21085
21321
|
children: turnContext.priorUser
|
|
21086
21322
|
})
|
|
21087
21323
|
]
|
|
21088
21324
|
}),
|
|
21089
|
-
turnContext.gradedAssistant && /* @__PURE__ */ (0,
|
|
21325
|
+
turnContext.gradedAssistant && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21090
21326
|
className: "calibrate-context-row",
|
|
21091
21327
|
children: [
|
|
21092
|
-
/* @__PURE__ */ (0,
|
|
21328
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21093
21329
|
className: "calibrate-context-label",
|
|
21094
21330
|
children: "Graded assistant"
|
|
21095
21331
|
}),
|
|
21096
|
-
/* @__PURE__ */ (0,
|
|
21332
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21097
21333
|
className: "calibrate-context-bubble calibrate-context-assistant",
|
|
21098
21334
|
children: turnContext.gradedAssistant
|
|
21099
21335
|
})
|
|
@@ -21101,64 +21337,64 @@ function CalibrateApp() {
|
|
|
21101
21337
|
})
|
|
21102
21338
|
]
|
|
21103
21339
|
}),
|
|
21104
|
-
isOpen && /* @__PURE__ */ (0,
|
|
21340
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21105
21341
|
className: "calibrate-result-details",
|
|
21106
21342
|
children: [
|
|
21107
|
-
/* @__PURE__ */ (0,
|
|
21343
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21108
21344
|
children: [
|
|
21109
|
-
/* @__PURE__ */ (0,
|
|
21345
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21110
21346
|
className: "calibrate-section-title",
|
|
21111
21347
|
children: "Graded sample"
|
|
21112
21348
|
}),
|
|
21113
|
-
/* @__PURE__ */ (0,
|
|
21349
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pre", {
|
|
21114
21350
|
className: "trace-json",
|
|
21115
21351
|
children: JSON.stringify(item.result ?? null, null, 2)
|
|
21116
21352
|
})
|
|
21117
21353
|
]
|
|
21118
21354
|
}),
|
|
21119
|
-
/* @__PURE__ */ (0,
|
|
21355
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21120
21356
|
children: [
|
|
21121
|
-
/* @__PURE__ */ (0,
|
|
21357
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21122
21358
|
className: "calibrate-section-title",
|
|
21123
21359
|
children: "Input"
|
|
21124
21360
|
}),
|
|
21125
|
-
typeof item.messageIndex === "number" && /* @__PURE__ */ (0,
|
|
21361
|
+
typeof item.messageIndex === "number" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21126
21362
|
className: "calibrate-result-meta-line",
|
|
21127
21363
|
children: [
|
|
21128
21364
|
"Message index: ",
|
|
21129
21365
|
item.messageIndex
|
|
21130
21366
|
]
|
|
21131
21367
|
}),
|
|
21132
|
-
item.turnIndex !== void 0 ? /* @__PURE__ */ (0,
|
|
21368
|
+
item.turnIndex !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21133
21369
|
className: "calibrate-context",
|
|
21134
21370
|
children: [
|
|
21135
|
-
turnContext.priorUser && /* @__PURE__ */ (0,
|
|
21371
|
+
turnContext.priorUser && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21136
21372
|
className: "calibrate-context-row",
|
|
21137
21373
|
children: [
|
|
21138
|
-
/* @__PURE__ */ (0,
|
|
21374
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21139
21375
|
className: "calibrate-context-label",
|
|
21140
21376
|
children: "Prior user"
|
|
21141
21377
|
}),
|
|
21142
|
-
/* @__PURE__ */ (0,
|
|
21378
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21143
21379
|
className: "calibrate-context-bubble calibrate-context-user",
|
|
21144
21380
|
children: turnContext.priorUser
|
|
21145
21381
|
})
|
|
21146
21382
|
]
|
|
21147
21383
|
}),
|
|
21148
|
-
turnContext.gradedAssistant && /* @__PURE__ */ (0,
|
|
21384
|
+
turnContext.gradedAssistant && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21149
21385
|
className: "calibrate-context-row",
|
|
21150
21386
|
children: [
|
|
21151
|
-
/* @__PURE__ */ (0,
|
|
21387
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21152
21388
|
className: "calibrate-context-label",
|
|
21153
21389
|
children: "Graded assistant"
|
|
21154
21390
|
}),
|
|
21155
|
-
/* @__PURE__ */ (0,
|
|
21391
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21156
21392
|
className: "calibrate-context-bubble calibrate-context-assistant",
|
|
21157
21393
|
children: turnContext.gradedAssistant
|
|
21158
21394
|
})
|
|
21159
21395
|
]
|
|
21160
21396
|
}),
|
|
21161
|
-
/* @__PURE__ */ (0,
|
|
21397
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
21162
21398
|
type: "button",
|
|
21163
21399
|
className: "ghost-btn calibrate-toggle",
|
|
21164
21400
|
onClick: () => setShowRawInputs((prev) => ({
|
|
@@ -21167,41 +21403,41 @@ function CalibrateApp() {
|
|
|
21167
21403
|
})),
|
|
21168
21404
|
children: showRawInputs[item.key] ? "Hide raw input" : "Show raw input"
|
|
21169
21405
|
}),
|
|
21170
|
-
showRawInputs[item.key] && /* @__PURE__ */ (0,
|
|
21406
|
+
showRawInputs[item.key] && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pre", {
|
|
21171
21407
|
className: "trace-json",
|
|
21172
21408
|
children: JSON.stringify(item.input ?? null, null, 2)
|
|
21173
21409
|
})
|
|
21174
21410
|
]
|
|
21175
|
-
}) : /* @__PURE__ */ (0,
|
|
21411
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21176
21412
|
className: "calibrate-context",
|
|
21177
21413
|
children: [
|
|
21178
|
-
conversationContext.latestUser && /* @__PURE__ */ (0,
|
|
21414
|
+
conversationContext.latestUser && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21179
21415
|
className: "calibrate-context-row",
|
|
21180
21416
|
children: [
|
|
21181
|
-
/* @__PURE__ */ (0,
|
|
21417
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21182
21418
|
className: "calibrate-context-label",
|
|
21183
21419
|
children: "Latest user"
|
|
21184
21420
|
}),
|
|
21185
|
-
/* @__PURE__ */ (0,
|
|
21421
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21186
21422
|
className: "calibrate-context-bubble calibrate-context-user",
|
|
21187
21423
|
children: conversationContext.latestUser
|
|
21188
21424
|
})
|
|
21189
21425
|
]
|
|
21190
21426
|
}),
|
|
21191
|
-
conversationContext.latestAssistant && /* @__PURE__ */ (0,
|
|
21427
|
+
conversationContext.latestAssistant && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21192
21428
|
className: "calibrate-context-row",
|
|
21193
21429
|
children: [
|
|
21194
|
-
/* @__PURE__ */ (0,
|
|
21430
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21195
21431
|
className: "calibrate-context-label",
|
|
21196
21432
|
children: "Latest assistant"
|
|
21197
21433
|
}),
|
|
21198
|
-
/* @__PURE__ */ (0,
|
|
21434
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21199
21435
|
className: "calibrate-context-bubble calibrate-context-assistant",
|
|
21200
21436
|
children: conversationContext.latestAssistant
|
|
21201
21437
|
})
|
|
21202
21438
|
]
|
|
21203
21439
|
}),
|
|
21204
|
-
/* @__PURE__ */ (0,
|
|
21440
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
21205
21441
|
type: "button",
|
|
21206
21442
|
className: "ghost-btn calibrate-toggle",
|
|
21207
21443
|
onClick: () => setShowRawInputs((prev) => ({
|
|
@@ -21210,7 +21446,7 @@ function CalibrateApp() {
|
|
|
21210
21446
|
})),
|
|
21211
21447
|
children: showRawInputs[item.key] ? "Hide raw input" : "Show raw input"
|
|
21212
21448
|
}),
|
|
21213
|
-
showRawInputs[item.key] && /* @__PURE__ */ (0,
|
|
21449
|
+
showRawInputs[item.key] && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pre", {
|
|
21214
21450
|
className: "trace-json",
|
|
21215
21451
|
children: JSON.stringify(item.input ?? null, null, 2)
|
|
21216
21452
|
})
|
|
@@ -21218,25 +21454,25 @@ function CalibrateApp() {
|
|
|
21218
21454
|
})
|
|
21219
21455
|
]
|
|
21220
21456
|
}),
|
|
21221
|
-
/* @__PURE__ */ (0,
|
|
21457
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21222
21458
|
children: [
|
|
21223
|
-
/* @__PURE__ */ (0,
|
|
21459
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21224
21460
|
className: "calibrate-section-title",
|
|
21225
21461
|
children: "Reference sample"
|
|
21226
21462
|
}),
|
|
21227
|
-
item.referenceSample ? /* @__PURE__ */ (0,
|
|
21463
|
+
item.referenceSample ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pre", {
|
|
21228
21464
|
className: "trace-json",
|
|
21229
21465
|
children: JSON.stringify(item.referenceSample, null, 2)
|
|
21230
|
-
}) : /* @__PURE__ */ (0,
|
|
21466
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21231
21467
|
className: "placeholder",
|
|
21232
21468
|
children: "No reference sample yet."
|
|
21233
21469
|
}),
|
|
21234
|
-
draft && /* @__PURE__ */ (0,
|
|
21470
|
+
draft && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21235
21471
|
className: "calibrate-reference-form",
|
|
21236
21472
|
children: [
|
|
21237
|
-
/* @__PURE__ */ (0,
|
|
21473
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21238
21474
|
className: "calibrate-score-buttons",
|
|
21239
|
-
children: SCORE_VALUES.map((value) => /* @__PURE__ */ (0,
|
|
21475
|
+
children: SCORE_VALUES.map((value) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
21240
21476
|
type: "button",
|
|
21241
21477
|
className: Number.isNaN(draft.score) ? "score-btn" : value === draft.score ? "score-btn score-btn-active" : "score-btn",
|
|
21242
21478
|
onClick: () => setReferenceDrafts((prev) => ({
|
|
@@ -21249,10 +21485,10 @@ function CalibrateApp() {
|
|
|
21249
21485
|
children: value
|
|
21250
21486
|
}, value))
|
|
21251
21487
|
}),
|
|
21252
|
-
/* @__PURE__ */ (0,
|
|
21488
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", {
|
|
21253
21489
|
children: [
|
|
21254
21490
|
"Reason",
|
|
21255
|
-
/* @__PURE__ */ (0,
|
|
21491
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("textarea", {
|
|
21256
21492
|
value: draft.reason,
|
|
21257
21493
|
onChange: (e) => setReferenceDrafts((prev) => ({
|
|
21258
21494
|
...prev,
|
|
@@ -21264,10 +21500,10 @@ function CalibrateApp() {
|
|
|
21264
21500
|
})
|
|
21265
21501
|
]
|
|
21266
21502
|
}),
|
|
21267
|
-
/* @__PURE__ */ (0,
|
|
21503
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", {
|
|
21268
21504
|
children: [
|
|
21269
21505
|
"Evidence (one per line)",
|
|
21270
|
-
/* @__PURE__ */ (0,
|
|
21506
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("textarea", {
|
|
21271
21507
|
value: draft.evidenceText,
|
|
21272
21508
|
onChange: (e) => setReferenceDrafts((prev) => ({
|
|
21273
21509
|
...prev,
|
|
@@ -21279,10 +21515,10 @@ function CalibrateApp() {
|
|
|
21279
21515
|
})
|
|
21280
21516
|
]
|
|
21281
21517
|
}),
|
|
21282
|
-
/* @__PURE__ */ (0,
|
|
21518
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21283
21519
|
className: "calibrate-reference-actions",
|
|
21284
21520
|
children: [
|
|
21285
|
-
/* @__PURE__ */ (0,
|
|
21521
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
21286
21522
|
type: "button",
|
|
21287
21523
|
className: "ghost-btn",
|
|
21288
21524
|
onClick: async () => {
|
|
@@ -21325,7 +21561,7 @@ function CalibrateApp() {
|
|
|
21325
21561
|
},
|
|
21326
21562
|
children: "Agree with graded"
|
|
21327
21563
|
}),
|
|
21328
|
-
/* @__PURE__ */ (0,
|
|
21564
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
21329
21565
|
type: "button",
|
|
21330
21566
|
className: "primary",
|
|
21331
21567
|
onClick: async () => {
|
|
@@ -21384,60 +21620,60 @@ function CalibrateApp() {
|
|
|
21384
21620
|
})
|
|
21385
21621
|
]
|
|
21386
21622
|
}),
|
|
21387
|
-
/* @__PURE__ */ (0,
|
|
21623
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("aside", {
|
|
21388
21624
|
className: "calibrate-drawer",
|
|
21389
21625
|
children: [
|
|
21390
|
-
/* @__PURE__ */ (0,
|
|
21626
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", {
|
|
21391
21627
|
children: "Deck & session"
|
|
21392
21628
|
}),
|
|
21393
|
-
/* @__PURE__ */ (0,
|
|
21629
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21394
21630
|
className: "drawer-section",
|
|
21395
21631
|
children: [
|
|
21396
|
-
/* @__PURE__ */ (0,
|
|
21632
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", {
|
|
21397
21633
|
children: "Deck reference"
|
|
21398
21634
|
}),
|
|
21399
|
-
/* @__PURE__ */ (0,
|
|
21635
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CopyBadge, {
|
|
21400
21636
|
label: "Deck path",
|
|
21401
21637
|
displayValue: deckDisplayPath,
|
|
21402
21638
|
copyValue: normalizedDeckPath
|
|
21403
21639
|
})
|
|
21404
21640
|
]
|
|
21405
21641
|
}),
|
|
21406
|
-
/* @__PURE__ */ (0,
|
|
21642
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21407
21643
|
className: "drawer-section",
|
|
21408
21644
|
children: [
|
|
21409
|
-
/* @__PURE__ */ (0,
|
|
21645
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", {
|
|
21410
21646
|
children: "Selected session"
|
|
21411
21647
|
}),
|
|
21412
|
-
selectedSession ? /* @__PURE__ */ (0,
|
|
21648
|
+
selectedSession ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, {
|
|
21413
21649
|
children: [
|
|
21414
|
-
/* @__PURE__ */ (0,
|
|
21650
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CopyBadge, {
|
|
21415
21651
|
label: "Session ID",
|
|
21416
21652
|
displayValue: selectedSession.id
|
|
21417
21653
|
}),
|
|
21418
|
-
sessionDeckDisplay && /* @__PURE__ */ (0,
|
|
21654
|
+
sessionDeckDisplay && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CopyBadge, {
|
|
21419
21655
|
label: "Session deck",
|
|
21420
21656
|
displayValue: sessionDeckDisplay,
|
|
21421
21657
|
copyValue: selectedSession.deck ?? sessionDeckDisplay
|
|
21422
21658
|
}),
|
|
21423
|
-
sessionDirDisplay && /* @__PURE__ */ (0,
|
|
21659
|
+
sessionDirDisplay && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CopyBadge, {
|
|
21424
21660
|
label: "Session folder",
|
|
21425
21661
|
displayValue: sessionDirDisplay,
|
|
21426
21662
|
copyValue: selectedSession.sessionDir ?? sessionDirDisplay
|
|
21427
21663
|
}),
|
|
21428
|
-
sessionStateDisplay && /* @__PURE__ */ (0,
|
|
21664
|
+
sessionStateDisplay && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CopyBadge, {
|
|
21429
21665
|
label: "State file",
|
|
21430
21666
|
displayValue: sessionStateDisplay,
|
|
21431
21667
|
copyValue: selectedSession.statePath ?? sessionStateDisplay
|
|
21432
21668
|
}),
|
|
21433
|
-
sessionCreatedLabel && /* @__PURE__ */ (0,
|
|
21669
|
+
sessionCreatedLabel && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
21434
21670
|
className: "drawer-meta",
|
|
21435
21671
|
children: [
|
|
21436
21672
|
"Created ",
|
|
21437
21673
|
sessionCreatedLabel
|
|
21438
21674
|
]
|
|
21439
21675
|
}),
|
|
21440
|
-
sessionDebugHref && /* @__PURE__ */ (0,
|
|
21676
|
+
sessionDebugHref && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", {
|
|
21441
21677
|
className: "ghost-btn",
|
|
21442
21678
|
href: sessionDebugHref,
|
|
21443
21679
|
target: "_blank",
|
|
@@ -21445,7 +21681,7 @@ function CalibrateApp() {
|
|
|
21445
21681
|
children: "Open session debug"
|
|
21446
21682
|
})
|
|
21447
21683
|
]
|
|
21448
|
-
}) : /* @__PURE__ */ (0,
|
|
21684
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
21449
21685
|
className: "placeholder",
|
|
21450
21686
|
children: "Select a session to view file paths and metadata."
|
|
21451
21687
|
})
|
|
@@ -21459,37 +21695,37 @@ function CalibrateApp() {
|
|
|
21459
21695
|
});
|
|
21460
21696
|
}
|
|
21461
21697
|
function TestBotApp(props) {
|
|
21462
|
-
const {
|
|
21698
|
+
const { onNavigateToSession, onReplaceTestBotSession, onResetTestBotSession, activeSessionId } = props;
|
|
21463
21699
|
const deckStorageKey = "gambit:test-bot:selected-deck";
|
|
21464
|
-
const [testDecks, setTestDecks] = (0,
|
|
21465
|
-
const [selectedDeckId, setSelectedDeckId] = (0,
|
|
21466
|
-
const [botLabel, setBotLabel] = (0,
|
|
21467
|
-
const [botDescription, setBotDescription] = (0,
|
|
21468
|
-
const [botInputSchema, setBotInputSchema] = (0,
|
|
21469
|
-
const [botInputSchemaError, setBotInputSchemaError] = (0,
|
|
21470
|
-
const [botInputValue, setBotInputValue] = (0,
|
|
21471
|
-
const [botInputDirty, setBotInputDirty] = (0,
|
|
21472
|
-
const [botInputJsonErrors, setBotInputJsonErrors] = (0,
|
|
21473
|
-
const [botInputDefaults, setBotInputDefaults] = (0,
|
|
21474
|
-
const [initialUserMessage, setInitialUserMessage] = (0,
|
|
21475
|
-
const [run, setRun] = (0,
|
|
21700
|
+
const [testDecks, setTestDecks] = (0, import_react2.useState)([]);
|
|
21701
|
+
const [selectedDeckId, setSelectedDeckId] = (0, import_react2.useState)(null);
|
|
21702
|
+
const [botLabel, setBotLabel] = (0, import_react2.useState)(null);
|
|
21703
|
+
const [botDescription, setBotDescription] = (0, import_react2.useState)(null);
|
|
21704
|
+
const [botInputSchema, setBotInputSchema] = (0, import_react2.useState)(null);
|
|
21705
|
+
const [botInputSchemaError, setBotInputSchemaError] = (0, import_react2.useState)(null);
|
|
21706
|
+
const [botInputValue, setBotInputValue] = (0, import_react2.useState)(void 0);
|
|
21707
|
+
const [botInputDirty, setBotInputDirty] = (0, import_react2.useState)(false);
|
|
21708
|
+
const [botInputJsonErrors, setBotInputJsonErrors] = (0, import_react2.useState)({});
|
|
21709
|
+
const [botInputDefaults, setBotInputDefaults] = (0, import_react2.useState)(void 0);
|
|
21710
|
+
const [initialUserMessage, setInitialUserMessage] = (0, import_react2.useState)("");
|
|
21711
|
+
const [run, setRun] = (0, import_react2.useState)({
|
|
21476
21712
|
status: "idle",
|
|
21477
21713
|
messages: [],
|
|
21478
21714
|
traces: [],
|
|
21479
21715
|
toolInserts: []
|
|
21480
21716
|
});
|
|
21481
|
-
const runRef = (0,
|
|
21717
|
+
const runRef = (0, import_react2.useRef)({
|
|
21482
21718
|
status: "idle",
|
|
21483
21719
|
messages: [],
|
|
21484
21720
|
traces: [],
|
|
21485
21721
|
toolInserts: []
|
|
21486
21722
|
});
|
|
21487
|
-
const lastRunMessageCountRef = (0,
|
|
21488
|
-
const [toolCallsOpen, setToolCallsOpen] = (0,
|
|
21489
|
-
const [latencyByTurn, setLatencyByTurn] = (0,
|
|
21490
|
-
const lastUserEndByTurnRef = (0,
|
|
21491
|
-
const firstAssistantTokenByTurnRef = (0,
|
|
21492
|
-
(0,
|
|
21723
|
+
const lastRunMessageCountRef = (0, import_react2.useRef)(0);
|
|
21724
|
+
const [toolCallsOpen, setToolCallsOpen] = (0, import_react2.useState)({});
|
|
21725
|
+
const [latencyByTurn, setLatencyByTurn] = (0, import_react2.useState)({});
|
|
21726
|
+
const lastUserEndByTurnRef = (0, import_react2.useRef)({});
|
|
21727
|
+
const firstAssistantTokenByTurnRef = (0, import_react2.useRef)({});
|
|
21728
|
+
(0, import_react2.useEffect)(() => {
|
|
21493
21729
|
lastRunMessageCountRef.current = 0;
|
|
21494
21730
|
setToolCallsOpen({});
|
|
21495
21731
|
setLatencyByTurn({});
|
|
@@ -21498,20 +21734,20 @@ function TestBotApp(props) {
|
|
|
21498
21734
|
}, [
|
|
21499
21735
|
run.id
|
|
21500
21736
|
]);
|
|
21501
|
-
const [streamingUser, setStreamingUser] = (0,
|
|
21502
|
-
const [streamingAssistant, setStreamingAssistant] = (0,
|
|
21737
|
+
const [streamingUser, setStreamingUser] = (0, import_react2.useState)(null);
|
|
21738
|
+
const [streamingAssistant, setStreamingAssistant] = (0, import_react2.useState)(null);
|
|
21503
21739
|
const deckSchema = useHttpSchema();
|
|
21504
21740
|
const deckInputSchema = deckSchema.schemaResponse?.schema;
|
|
21505
21741
|
const deckSchemaDefaults = deckSchema.schemaResponse?.defaults;
|
|
21506
21742
|
const deckSchemaError = deckSchema.schemaResponse?.error ?? deckSchema.error ?? void 0;
|
|
21507
|
-
const [deckInitValue, setDeckInitValue] = (0,
|
|
21508
|
-
const [deckInitDirty, setDeckInitDirty] = (0,
|
|
21509
|
-
const [deckJsonErrors, setDeckJsonErrors] = (0,
|
|
21510
|
-
const [botPath, setBotPath] = (0,
|
|
21511
|
-
const pollRef = (0,
|
|
21512
|
-
const transcriptRef = (0,
|
|
21513
|
-
const runIdRef = (0,
|
|
21514
|
-
const loadTestBot = (0,
|
|
21743
|
+
const [deckInitValue, setDeckInitValue] = (0, import_react2.useState)(void 0);
|
|
21744
|
+
const [deckInitDirty, setDeckInitDirty] = (0, import_react2.useState)(false);
|
|
21745
|
+
const [deckJsonErrors, setDeckJsonErrors] = (0, import_react2.useState)({});
|
|
21746
|
+
const [botPath, setBotPath] = (0, import_react2.useState)(null);
|
|
21747
|
+
const pollRef = (0, import_react2.useRef)(null);
|
|
21748
|
+
const transcriptRef = (0, import_react2.useRef)(null);
|
|
21749
|
+
const runIdRef = (0, import_react2.useRef)(void 0);
|
|
21750
|
+
const loadTestBot = (0, import_react2.useCallback)(async (opts) => {
|
|
21515
21751
|
let storedDeckId = null;
|
|
21516
21752
|
try {
|
|
21517
21753
|
storedDeckId = localStorage.getItem(deckStorageKey);
|
|
@@ -21562,12 +21798,12 @@ function TestBotApp(props) {
|
|
|
21562
21798
|
}, [
|
|
21563
21799
|
deckStorageKey
|
|
21564
21800
|
]);
|
|
21565
|
-
(0,
|
|
21801
|
+
(0, import_react2.useEffect)(() => {
|
|
21566
21802
|
loadTestBot();
|
|
21567
21803
|
}, [
|
|
21568
21804
|
loadTestBot
|
|
21569
21805
|
]);
|
|
21570
|
-
(0,
|
|
21806
|
+
(0, import_react2.useEffect)(() => {
|
|
21571
21807
|
runIdRef.current = run.id;
|
|
21572
21808
|
runRef.current = run;
|
|
21573
21809
|
setStreamingUser(null);
|
|
@@ -21575,14 +21811,14 @@ function TestBotApp(props) {
|
|
|
21575
21811
|
}, [
|
|
21576
21812
|
run.id
|
|
21577
21813
|
]);
|
|
21578
|
-
(0,
|
|
21814
|
+
(0, import_react2.useEffect)(() => {
|
|
21579
21815
|
if (!run.sessionId) return;
|
|
21580
21816
|
onReplaceTestBotSession(run.sessionId);
|
|
21581
21817
|
}, [
|
|
21582
21818
|
onReplaceTestBotSession,
|
|
21583
21819
|
run.sessionId
|
|
21584
21820
|
]);
|
|
21585
|
-
(0,
|
|
21821
|
+
(0, import_react2.useEffect)(() => {
|
|
21586
21822
|
if (!selectedDeckId) return;
|
|
21587
21823
|
try {
|
|
21588
21824
|
localStorage.setItem(deckStorageKey, selectedDeckId);
|
|
@@ -21592,12 +21828,12 @@ function TestBotApp(props) {
|
|
|
21592
21828
|
deckStorageKey,
|
|
21593
21829
|
selectedDeckId
|
|
21594
21830
|
]);
|
|
21595
|
-
(0,
|
|
21831
|
+
(0, import_react2.useEffect)(() => {
|
|
21596
21832
|
runRef.current = run;
|
|
21597
21833
|
}, [
|
|
21598
21834
|
run
|
|
21599
21835
|
]);
|
|
21600
|
-
(0,
|
|
21836
|
+
(0, import_react2.useEffect)(() => {
|
|
21601
21837
|
const streamId = TEST_BOT_STREAM_ID;
|
|
21602
21838
|
const streamUrl = buildDurableStreamUrl(streamId, getDurableStreamOffset(streamId));
|
|
21603
21839
|
const source = new EventSource(streamUrl);
|
|
@@ -21699,7 +21935,7 @@ function TestBotApp(props) {
|
|
|
21699
21935
|
source.close();
|
|
21700
21936
|
};
|
|
21701
21937
|
}, []);
|
|
21702
|
-
const refreshStatus = (0,
|
|
21938
|
+
const refreshStatus = (0, import_react2.useCallback)(async (opts) => {
|
|
21703
21939
|
try {
|
|
21704
21940
|
const runId = opts?.runId ?? run.id;
|
|
21705
21941
|
const sessionId = opts?.sessionId;
|
|
@@ -21730,12 +21966,12 @@ function TestBotApp(props) {
|
|
|
21730
21966
|
selectedDeckId,
|
|
21731
21967
|
testDecks
|
|
21732
21968
|
]);
|
|
21733
|
-
(0,
|
|
21969
|
+
(0, import_react2.useEffect)(() => {
|
|
21734
21970
|
refreshStatus();
|
|
21735
21971
|
}, [
|
|
21736
21972
|
refreshStatus
|
|
21737
21973
|
]);
|
|
21738
|
-
(0,
|
|
21974
|
+
(0, import_react2.useEffect)(() => {
|
|
21739
21975
|
if (!activeSessionId) return;
|
|
21740
21976
|
refreshStatus({
|
|
21741
21977
|
sessionId: activeSessionId
|
|
@@ -21744,7 +21980,7 @@ function TestBotApp(props) {
|
|
|
21744
21980
|
activeSessionId,
|
|
21745
21981
|
refreshStatus
|
|
21746
21982
|
]);
|
|
21747
|
-
(0,
|
|
21983
|
+
(0, import_react2.useEffect)(() => {
|
|
21748
21984
|
if (!deckInputSchema) return;
|
|
21749
21985
|
if (deckInitDirty) return;
|
|
21750
21986
|
const nextInit = deckSchemaDefaults !== void 0 ? cloneValue(deckSchemaDefaults) : deriveInitialFromSchema(deckInputSchema);
|
|
@@ -21754,7 +21990,7 @@ function TestBotApp(props) {
|
|
|
21754
21990
|
deckSchemaDefaults,
|
|
21755
21991
|
deckInitDirty
|
|
21756
21992
|
]);
|
|
21757
|
-
(0,
|
|
21993
|
+
(0, import_react2.useEffect)(() => {
|
|
21758
21994
|
if (!botInputSchema) return;
|
|
21759
21995
|
if (botInputDirty) return;
|
|
21760
21996
|
const nextBotInput = botInputDefaults !== void 0 ? cloneValue(botInputDefaults) : deriveInitialFromSchema(botInputSchema);
|
|
@@ -21764,34 +22000,34 @@ function TestBotApp(props) {
|
|
|
21764
22000
|
botInputDirty,
|
|
21765
22001
|
botInputDefaults
|
|
21766
22002
|
]);
|
|
21767
|
-
const missingBotInput = (0,
|
|
22003
|
+
const missingBotInput = (0, import_react2.useMemo)(() => {
|
|
21768
22004
|
if (!botInputSchema) return [];
|
|
21769
22005
|
return findMissingRequiredFields(botInputSchema, botInputValue);
|
|
21770
22006
|
}, [
|
|
21771
22007
|
botInputSchema,
|
|
21772
22008
|
botInputValue
|
|
21773
22009
|
]);
|
|
21774
|
-
const botJsonErrorCount = (0,
|
|
22010
|
+
const botJsonErrorCount = (0, import_react2.useMemo)(() => {
|
|
21775
22011
|
return Object.values(botInputJsonErrors).filter((v) => typeof v === "string" && v).length;
|
|
21776
22012
|
}, [
|
|
21777
22013
|
botInputJsonErrors
|
|
21778
22014
|
]);
|
|
21779
|
-
const missingDeckInit = (0,
|
|
22015
|
+
const missingDeckInit = (0, import_react2.useMemo)(() => {
|
|
21780
22016
|
if (!deckInputSchema) return [];
|
|
21781
22017
|
return findMissingRequiredFields(deckInputSchema, deckInitValue);
|
|
21782
22018
|
}, [
|
|
21783
22019
|
deckInputSchema,
|
|
21784
22020
|
deckInitValue
|
|
21785
22021
|
]);
|
|
21786
|
-
const deckJsonErrorCount = (0,
|
|
22022
|
+
const deckJsonErrorCount = (0, import_react2.useMemo)(() => {
|
|
21787
22023
|
return Object.values(deckJsonErrors).filter((v) => typeof v === "string" && v).length;
|
|
21788
22024
|
}, [
|
|
21789
22025
|
deckJsonErrors
|
|
21790
22026
|
]);
|
|
21791
|
-
const toolCallSummaries = (0,
|
|
22027
|
+
const toolCallSummaries = (0, import_react2.useMemo)(() => summarizeToolCalls(run.traces ?? []), [
|
|
21792
22028
|
run.traces
|
|
21793
22029
|
]);
|
|
21794
|
-
const toolBuckets = (0,
|
|
22030
|
+
const toolBuckets = (0, import_react2.useMemo)(() => {
|
|
21795
22031
|
const deriveInsertsFromTraces = (traces, messageCount) => {
|
|
21796
22032
|
const inserts2 = [];
|
|
21797
22033
|
let messageIndex = 0;
|
|
@@ -21862,7 +22098,7 @@ function TestBotApp(props) {
|
|
|
21862
22098
|
run.traces,
|
|
21863
22099
|
run.messages.length
|
|
21864
22100
|
]);
|
|
21865
|
-
const assistantLatencyByMessageIndex = (0,
|
|
22101
|
+
const assistantLatencyByMessageIndex = (0, import_react2.useMemo)(() => {
|
|
21866
22102
|
const map = {};
|
|
21867
22103
|
let assistantTurn = 0;
|
|
21868
22104
|
run.messages.forEach((msg, index) => {
|
|
@@ -21881,7 +22117,7 @@ function TestBotApp(props) {
|
|
|
21881
22117
|
const canRunPersona = testDecks.length > 0;
|
|
21882
22118
|
const hasPersonaSelection = canRunPersona && Boolean(selectedDeckId);
|
|
21883
22119
|
const canStart = hasPersonaSelection && (!botInputSchema || missingBotInput.length === 0) && (!deckInputSchema || missingDeckInit.length === 0) && botJsonErrorCount === 0 && deckJsonErrorCount === 0;
|
|
21884
|
-
(0,
|
|
22120
|
+
(0, import_react2.useEffect)(() => {
|
|
21885
22121
|
if (run.status !== "running") {
|
|
21886
22122
|
if (pollRef.current) window.clearInterval(pollRef.current);
|
|
21887
22123
|
return;
|
|
@@ -21896,7 +22132,7 @@ function TestBotApp(props) {
|
|
|
21896
22132
|
run.status,
|
|
21897
22133
|
refreshStatus
|
|
21898
22134
|
]);
|
|
21899
|
-
(0,
|
|
22135
|
+
(0, import_react2.useEffect)(() => {
|
|
21900
22136
|
if (streamingUser?.expectedUserCount !== void 0 && streamingUser.runId === run.id && countUserMessages(run.messages) >= streamingUser.expectedUserCount) {
|
|
21901
22137
|
setStreamingUser(null);
|
|
21902
22138
|
}
|
|
@@ -21919,7 +22155,7 @@ function TestBotApp(props) {
|
|
|
21919
22155
|
streamingUser,
|
|
21920
22156
|
streamingAssistant?.text
|
|
21921
22157
|
]);
|
|
21922
|
-
const startRun = (0,
|
|
22158
|
+
const startRun = (0, import_react2.useCallback)(async () => {
|
|
21923
22159
|
try {
|
|
21924
22160
|
const res = await fetch("/api/test-bot/run", {
|
|
21925
22161
|
method: "POST",
|
|
@@ -21962,7 +22198,7 @@ function TestBotApp(props) {
|
|
|
21962
22198
|
refreshStatus,
|
|
21963
22199
|
selectedDeckId
|
|
21964
22200
|
]);
|
|
21965
|
-
const stopRun = (0,
|
|
22201
|
+
const stopRun = (0, import_react2.useCallback)(async () => {
|
|
21966
22202
|
if (!run.id) return;
|
|
21967
22203
|
try {
|
|
21968
22204
|
await fetch("/api/test-bot/stop", {
|
|
@@ -21985,7 +22221,7 @@ function TestBotApp(props) {
|
|
|
21985
22221
|
refreshStatus,
|
|
21986
22222
|
run.id
|
|
21987
22223
|
]);
|
|
21988
|
-
const handleNewChat = (0,
|
|
22224
|
+
const handleNewChat = (0, import_react2.useCallback)(async () => {
|
|
21989
22225
|
if (run.status === "running") {
|
|
21990
22226
|
await stopRun();
|
|
21991
22227
|
}
|
|
@@ -22001,7 +22237,7 @@ function TestBotApp(props) {
|
|
|
22001
22237
|
run.status,
|
|
22002
22238
|
stopRun
|
|
22003
22239
|
]);
|
|
22004
|
-
const saveTestBotFeedback = (0,
|
|
22240
|
+
const saveTestBotFeedback = (0, import_react2.useCallback)(async (messageRefId, score, reason) => {
|
|
22005
22241
|
if (!run.sessionId) return;
|
|
22006
22242
|
try {
|
|
22007
22243
|
const res = await fetch("/api/session/feedback", {
|
|
@@ -22033,17 +22269,17 @@ function TestBotApp(props) {
|
|
|
22033
22269
|
}, [
|
|
22034
22270
|
run.sessionId
|
|
22035
22271
|
]);
|
|
22036
|
-
const handleTestBotScore = (0,
|
|
22272
|
+
const handleTestBotScore = (0, import_react2.useCallback)((messageRefId, score) => {
|
|
22037
22273
|
saveTestBotFeedback(messageRefId, score);
|
|
22038
22274
|
}, [
|
|
22039
22275
|
saveTestBotFeedback
|
|
22040
22276
|
]);
|
|
22041
|
-
const handleTestBotReason = (0,
|
|
22277
|
+
const handleTestBotReason = (0, import_react2.useCallback)((messageRefId, score, reason) => {
|
|
22042
22278
|
saveTestBotFeedback(messageRefId, score, reason);
|
|
22043
22279
|
}, [
|
|
22044
22280
|
saveTestBotFeedback
|
|
22045
22281
|
]);
|
|
22046
|
-
const handleDeckSelection = (0,
|
|
22282
|
+
const handleDeckSelection = (0, import_react2.useCallback)(async (nextId) => {
|
|
22047
22283
|
if (!nextId) return;
|
|
22048
22284
|
if (nextId === selectedDeckId) return;
|
|
22049
22285
|
await handleNewChat();
|
|
@@ -22057,51 +22293,44 @@ function TestBotApp(props) {
|
|
|
22057
22293
|
selectedDeckId
|
|
22058
22294
|
]);
|
|
22059
22295
|
const runStatusLabel = run.status === "running" ? "Running test bot\u2026" : run.status === "completed" ? "Completed" : run.status === "error" ? "Failed" : run.status === "canceled" ? "Stopped" : "Idle";
|
|
22060
|
-
return /* @__PURE__ */ (0,
|
|
22296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22061
22297
|
className: "editor-shell",
|
|
22062
22298
|
children: [
|
|
22063
|
-
/* @__PURE__ */ (0,
|
|
22299
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22064
22300
|
className: "editor-header",
|
|
22065
22301
|
children: [
|
|
22066
|
-
/* @__PURE__ */ (0,
|
|
22302
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22067
22303
|
children: [
|
|
22068
|
-
/* @__PURE__ */ (0,
|
|
22304
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h1", {
|
|
22069
22305
|
className: "editor-title",
|
|
22070
22306
|
children: "Test Bot"
|
|
22071
22307
|
}),
|
|
22072
|
-
/* @__PURE__ */ (0,
|
|
22308
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22073
22309
|
className: "editor-status",
|
|
22074
22310
|
children: [
|
|
22075
22311
|
"Active deck: ",
|
|
22076
|
-
/* @__PURE__ */ (0,
|
|
22312
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", {
|
|
22077
22313
|
children: deckPath
|
|
22078
22314
|
})
|
|
22079
22315
|
]
|
|
22080
22316
|
})
|
|
22081
22317
|
]
|
|
22082
22318
|
}),
|
|
22083
|
-
/* @__PURE__ */ (0,
|
|
22319
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22084
22320
|
className: "header-actions",
|
|
22085
|
-
children:
|
|
22086
|
-
|
|
22087
|
-
|
|
22088
|
-
|
|
22089
|
-
|
|
22090
|
-
|
|
22091
|
-
}),
|
|
22092
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
22093
|
-
type: "button",
|
|
22094
|
-
onClick: onNavigateToSimulator,
|
|
22095
|
-
children: "Open debug"
|
|
22096
|
-
})
|
|
22097
|
-
]
|
|
22321
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
22322
|
+
type: "button",
|
|
22323
|
+
className: "primary",
|
|
22324
|
+
onClick: handleNewChat,
|
|
22325
|
+
children: "New chat"
|
|
22326
|
+
})
|
|
22098
22327
|
})
|
|
22099
22328
|
]
|
|
22100
22329
|
}),
|
|
22101
|
-
/* @__PURE__ */ (0,
|
|
22330
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22102
22331
|
className: "editor-main",
|
|
22103
22332
|
children: [
|
|
22104
|
-
/* @__PURE__ */ (0,
|
|
22333
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22105
22334
|
className: "editor-panel test-bot-sidebar",
|
|
22106
22335
|
style: {
|
|
22107
22336
|
display: "flex",
|
|
@@ -22109,10 +22338,10 @@ function TestBotApp(props) {
|
|
|
22109
22338
|
gap: 8
|
|
22110
22339
|
},
|
|
22111
22340
|
children: [
|
|
22112
|
-
/* @__PURE__ */ (0,
|
|
22341
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", {
|
|
22113
22342
|
children: "Persona deck"
|
|
22114
22343
|
}),
|
|
22115
|
-
testDecks.length > 0 && /* @__PURE__ */ (0,
|
|
22344
|
+
testDecks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("select", {
|
|
22116
22345
|
value: selectedDeckId ?? "",
|
|
22117
22346
|
onChange: (e) => handleDeckSelection(e.target.value),
|
|
22118
22347
|
style: {
|
|
@@ -22122,44 +22351,44 @@ function TestBotApp(props) {
|
|
|
22122
22351
|
padding: 8,
|
|
22123
22352
|
fontFamily: "inherit"
|
|
22124
22353
|
},
|
|
22125
|
-
children: testDecks.map((deck) => /* @__PURE__ */ (0,
|
|
22354
|
+
children: testDecks.map((deck) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", {
|
|
22126
22355
|
value: deck.id,
|
|
22127
22356
|
children: deck.label
|
|
22128
22357
|
}, deck.id))
|
|
22129
22358
|
}),
|
|
22130
|
-
testDecks.length === 0 && /* @__PURE__ */ (0,
|
|
22359
|
+
testDecks.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22131
22360
|
className: "placeholder",
|
|
22132
22361
|
children: [
|
|
22133
22362
|
"No deck-defined personas found. Add ",
|
|
22134
|
-
/* @__PURE__ */ (0,
|
|
22363
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", {
|
|
22135
22364
|
children: "[[testDecks]]"
|
|
22136
22365
|
}),
|
|
22137
22366
|
" ",
|
|
22138
22367
|
"to your deck front matter to drive the Test Bot."
|
|
22139
22368
|
]
|
|
22140
22369
|
}),
|
|
22141
|
-
/* @__PURE__ */ (0,
|
|
22370
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22142
22371
|
className: "editor-status",
|
|
22143
22372
|
children: [
|
|
22144
22373
|
botLabel ?? "Persona",
|
|
22145
22374
|
" \xB7 ",
|
|
22146
|
-
/* @__PURE__ */ (0,
|
|
22375
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", {
|
|
22147
22376
|
children: botPath ?? "unknown path"
|
|
22148
22377
|
})
|
|
22149
22378
|
]
|
|
22150
22379
|
}),
|
|
22151
|
-
botDescription && /* @__PURE__ */ (0,
|
|
22380
|
+
botDescription && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22152
22381
|
className: "placeholder",
|
|
22153
22382
|
children: botDescription
|
|
22154
22383
|
}),
|
|
22155
|
-
/* @__PURE__ */ (0,
|
|
22384
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", {
|
|
22156
22385
|
children: "Scenario (Test Bot input)"
|
|
22157
22386
|
}),
|
|
22158
|
-
botInputSchemaError && /* @__PURE__ */ (0,
|
|
22387
|
+
botInputSchemaError && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22159
22388
|
className: "error",
|
|
22160
22389
|
children: botInputSchemaError
|
|
22161
22390
|
}),
|
|
22162
|
-
botInputSchema && /* @__PURE__ */ (0,
|
|
22391
|
+
botInputSchema && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InitForm, {
|
|
22163
22392
|
schema: botInputSchema,
|
|
22164
22393
|
value: botInputValue,
|
|
22165
22394
|
onChange: (next) => {
|
|
@@ -22171,14 +22400,14 @@ function TestBotApp(props) {
|
|
|
22171
22400
|
[pathKey]: err
|
|
22172
22401
|
})
|
|
22173
22402
|
}),
|
|
22174
|
-
!botInputSchema && /* @__PURE__ */ (0,
|
|
22403
|
+
!botInputSchema && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22175
22404
|
className: "placeholder",
|
|
22176
22405
|
children: "No test bot input schema configured."
|
|
22177
22406
|
}),
|
|
22178
|
-
/* @__PURE__ */ (0,
|
|
22407
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", {
|
|
22179
22408
|
children: "Initial user message (optional)"
|
|
22180
22409
|
}),
|
|
22181
|
-
/* @__PURE__ */ (0,
|
|
22410
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("textarea", {
|
|
22182
22411
|
"data-testid": "testbot-initial-message",
|
|
22183
22412
|
value: initialUserMessage,
|
|
22184
22413
|
onChange: (e) => setInitialUserMessage(e.target.value),
|
|
@@ -22193,12 +22422,12 @@ function TestBotApp(props) {
|
|
|
22193
22422
|
},
|
|
22194
22423
|
placeholder: "If provided, this is sent as the first user message."
|
|
22195
22424
|
}),
|
|
22196
|
-
/* @__PURE__ */ (0,
|
|
22425
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22197
22426
|
className: "placeholder",
|
|
22198
22427
|
children: [
|
|
22199
22428
|
"Persona content is managed by the selected deck. Edit",
|
|
22200
22429
|
" ",
|
|
22201
|
-
/* @__PURE__ */ (0,
|
|
22430
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", {
|
|
22202
22431
|
children: botPath ?? "the referenced deck"
|
|
22203
22432
|
}),
|
|
22204
22433
|
" ",
|
|
@@ -22207,7 +22436,7 @@ function TestBotApp(props) {
|
|
|
22207
22436
|
})
|
|
22208
22437
|
]
|
|
22209
22438
|
}),
|
|
22210
|
-
/* @__PURE__ */ (0,
|
|
22439
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22211
22440
|
className: "editor-panel",
|
|
22212
22441
|
style: {
|
|
22213
22442
|
display: "flex",
|
|
@@ -22215,74 +22444,93 @@ function TestBotApp(props) {
|
|
|
22215
22444
|
gap: 8
|
|
22216
22445
|
},
|
|
22217
22446
|
children: [
|
|
22218
|
-
/* @__PURE__ */ (0,
|
|
22219
|
-
children: "Latest test run"
|
|
22220
|
-
}),
|
|
22221
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22222
|
-
className: "editor-status",
|
|
22223
|
-
children: runStatusLabel
|
|
22224
|
-
}),
|
|
22225
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22447
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22226
22448
|
style: {
|
|
22227
22449
|
display: "flex",
|
|
22228
|
-
|
|
22229
|
-
|
|
22450
|
+
flexDirection: "row",
|
|
22451
|
+
gap: 8
|
|
22230
22452
|
},
|
|
22231
22453
|
children: [
|
|
22232
|
-
/* @__PURE__ */ (0,
|
|
22233
|
-
|
|
22234
|
-
|
|
22235
|
-
|
|
22236
|
-
|
|
22237
|
-
|
|
22238
|
-
children:
|
|
22239
|
-
|
|
22240
|
-
|
|
22241
|
-
|
|
22242
|
-
|
|
22243
|
-
|
|
22244
|
-
|
|
22245
|
-
|
|
22246
|
-
|
|
22454
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22455
|
+
style: {
|
|
22456
|
+
display: "flex",
|
|
22457
|
+
flexDirection: "column",
|
|
22458
|
+
flex: 1
|
|
22459
|
+
},
|
|
22460
|
+
children: [
|
|
22461
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", {
|
|
22462
|
+
children: "Latest test run"
|
|
22463
|
+
}),
|
|
22464
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22465
|
+
className: "editor-status",
|
|
22466
|
+
children: runStatusLabel
|
|
22467
|
+
})
|
|
22468
|
+
]
|
|
22247
22469
|
}),
|
|
22248
|
-
/* @__PURE__ */ (0,
|
|
22249
|
-
|
|
22250
|
-
|
|
22251
|
-
|
|
22252
|
-
|
|
22470
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22471
|
+
style: {
|
|
22472
|
+
display: "flex",
|
|
22473
|
+
flexDirection: "row-reverse",
|
|
22474
|
+
gap: 8,
|
|
22475
|
+
flexWrap: "wrap"
|
|
22476
|
+
},
|
|
22477
|
+
children: [
|
|
22478
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
22479
|
+
type: "button",
|
|
22480
|
+
className: "primary",
|
|
22481
|
+
onClick: startRun,
|
|
22482
|
+
disabled: !canStart,
|
|
22483
|
+
"data-testid": "testbot-run",
|
|
22484
|
+
children: "Run test bot"
|
|
22485
|
+
}),
|
|
22486
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
22487
|
+
type: "button",
|
|
22488
|
+
className: "ghost-btn",
|
|
22489
|
+
onClick: stopRun,
|
|
22490
|
+
disabled: run.status !== "running",
|
|
22491
|
+
"data-testid": "testbot-stop",
|
|
22492
|
+
children: "Stop"
|
|
22493
|
+
}),
|
|
22494
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
22495
|
+
type: "button",
|
|
22496
|
+
className: "ghost-btn",
|
|
22497
|
+
onClick: () => refreshStatus(),
|
|
22498
|
+
children: "Refresh"
|
|
22499
|
+
})
|
|
22500
|
+
]
|
|
22253
22501
|
})
|
|
22254
22502
|
]
|
|
22255
22503
|
}),
|
|
22256
|
-
run.error && /* @__PURE__ */ (0,
|
|
22504
|
+
run.error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22257
22505
|
className: "error",
|
|
22258
22506
|
children: run.error
|
|
22259
22507
|
}),
|
|
22260
|
-
run.sessionId && /* @__PURE__ */ (0,
|
|
22508
|
+
run.sessionId && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22261
22509
|
className: "editor-status",
|
|
22262
22510
|
children: [
|
|
22263
22511
|
"Session:",
|
|
22264
22512
|
" ",
|
|
22265
|
-
/* @__PURE__ */ (0,
|
|
22513
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", {
|
|
22266
22514
|
"data-testid": "testbot-session-id",
|
|
22267
22515
|
children: run.sessionId
|
|
22268
22516
|
})
|
|
22269
22517
|
]
|
|
22270
22518
|
}),
|
|
22271
|
-
run.sessionId && /* @__PURE__ */ (0,
|
|
22519
|
+
run.sessionId && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
22272
22520
|
type: "button",
|
|
22273
22521
|
className: "ghost-btn",
|
|
22274
22522
|
onClick: () => onNavigateToSession(run.sessionId),
|
|
22275
22523
|
children: "Open in debug"
|
|
22276
22524
|
}),
|
|
22277
|
-
!canStart && canRunPersona && /* @__PURE__ */ (0,
|
|
22525
|
+
!canStart && canRunPersona && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22278
22526
|
className: "error",
|
|
22279
22527
|
children: !hasPersonaSelection ? "Select a persona deck to run." : botJsonErrorCount > 0 || deckJsonErrorCount > 0 ? "Fix invalid JSON fields to run." : missingBotInput.length > 0 ? `Missing required bot inputs: ${missingBotInput.slice(0, 6).join(", ")}${missingBotInput.length > 6 ? "\u2026" : ""}` : missingDeckInit.length > 0 ? `Missing required init fields: ${missingDeckInit.slice(0, 6).join(", ")}${missingDeckInit.length > 6 ? "\u2026" : ""}` : ""
|
|
22280
22528
|
}),
|
|
22281
|
-
/* @__PURE__ */ (0,
|
|
22529
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22282
22530
|
className: "imessage-thread",
|
|
22283
22531
|
ref: transcriptRef,
|
|
22284
22532
|
children: [
|
|
22285
|
-
run.messages.length === 0 && /* @__PURE__ */ (0,
|
|
22533
|
+
run.messages.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22286
22534
|
className: "placeholder",
|
|
22287
22535
|
children: "No messages yet."
|
|
22288
22536
|
}),
|
|
@@ -22302,17 +22550,17 @@ function TestBotApp(props) {
|
|
|
22302
22550
|
break;
|
|
22303
22551
|
}
|
|
22304
22552
|
}
|
|
22305
|
-
rows.push(/* @__PURE__ */ (0,
|
|
22553
|
+
rows.push(/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22306
22554
|
className: "tool-calls-collapsible",
|
|
22307
22555
|
children: [
|
|
22308
|
-
/* @__PURE__ */ (0,
|
|
22556
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
22309
22557
|
type: "button",
|
|
22310
22558
|
className: "tool-calls-toggle",
|
|
22311
22559
|
onClick: () => setToolCallsOpen((prev) => ({
|
|
22312
22560
|
...prev,
|
|
22313
22561
|
[index]: !prev[index]
|
|
22314
22562
|
})),
|
|
22315
|
-
children: /* @__PURE__ */ (0,
|
|
22563
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", {
|
|
22316
22564
|
className: "tool-calls-toggle-label",
|
|
22317
22565
|
children: [
|
|
22318
22566
|
"Tool calls (",
|
|
@@ -22325,9 +22573,9 @@ function TestBotApp(props) {
|
|
|
22325
22573
|
]
|
|
22326
22574
|
})
|
|
22327
22575
|
}),
|
|
22328
|
-
isOpen && /* @__PURE__ */ (0,
|
|
22576
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22329
22577
|
className: "tool-calls-list",
|
|
22330
|
-
children: bucket.map((call, callIdx) => /* @__PURE__ */ (0,
|
|
22578
|
+
children: bucket.map((call, callIdx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ToolCallBubble, {
|
|
22331
22579
|
call
|
|
22332
22580
|
}, `tool-${call.id}-${index}-${callIdx}`))
|
|
22333
22581
|
})
|
|
@@ -22336,14 +22584,14 @@ function TestBotApp(props) {
|
|
|
22336
22584
|
};
|
|
22337
22585
|
renderToolBucket(0);
|
|
22338
22586
|
run.messages.forEach((m, idx) => {
|
|
22339
|
-
rows.push(/* @__PURE__ */ (0,
|
|
22587
|
+
rows.push(/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22340
22588
|
className: `imessage-row ${m.role === "user" ? "left" : "right"}`,
|
|
22341
|
-
children: /* @__PURE__ */ (0,
|
|
22589
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22342
22590
|
className: `imessage-bubble ${m.role === "user" ? "right" : "left"}`,
|
|
22343
22591
|
title: m.role,
|
|
22344
22592
|
children: [
|
|
22345
22593
|
m.content,
|
|
22346
|
-
m.messageRefId && run.sessionId && /* @__PURE__ */ (0,
|
|
22594
|
+
m.messageRefId && run.sessionId && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FeedbackControls, {
|
|
22347
22595
|
messageRefId: m.messageRefId,
|
|
22348
22596
|
feedback: m.feedback,
|
|
22349
22597
|
onScore: handleTestBotScore,
|
|
@@ -22356,17 +22604,17 @@ function TestBotApp(props) {
|
|
|
22356
22604
|
});
|
|
22357
22605
|
return rows;
|
|
22358
22606
|
})(),
|
|
22359
|
-
streamingUser?.text && streamingUser.runId === run.id && (streamingUser.expectedUserCount === void 0 || countUserMessages(run.messages) < streamingUser.expectedUserCount) && /* @__PURE__ */ (0,
|
|
22607
|
+
streamingUser?.text && streamingUser.runId === run.id && (streamingUser.expectedUserCount === void 0 || countUserMessages(run.messages) < streamingUser.expectedUserCount) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22360
22608
|
className: "imessage-row left",
|
|
22361
|
-
children: /* @__PURE__ */ (0,
|
|
22609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22362
22610
|
className: "imessage-bubble right imessage-bubble-muted",
|
|
22363
22611
|
title: "user",
|
|
22364
22612
|
children: streamingUser.text
|
|
22365
22613
|
})
|
|
22366
22614
|
}),
|
|
22367
|
-
streamingAssistant?.text && streamingAssistant.runId === run.id && /* @__PURE__ */ (0,
|
|
22615
|
+
streamingAssistant?.text && streamingAssistant.runId === run.id && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22368
22616
|
className: "imessage-row right",
|
|
22369
|
-
children: /* @__PURE__ */ (0,
|
|
22617
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22370
22618
|
className: "imessage-bubble left imessage-bubble-muted",
|
|
22371
22619
|
title: "assistant",
|
|
22372
22620
|
children: streamingAssistant.text
|
|
@@ -22376,7 +22624,7 @@ function TestBotApp(props) {
|
|
|
22376
22624
|
})
|
|
22377
22625
|
]
|
|
22378
22626
|
}),
|
|
22379
|
-
/* @__PURE__ */ (0,
|
|
22627
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22380
22628
|
className: "editor-panel",
|
|
22381
22629
|
style: {
|
|
22382
22630
|
display: "flex",
|
|
@@ -22384,29 +22632,29 @@ function TestBotApp(props) {
|
|
|
22384
22632
|
gap: 10
|
|
22385
22633
|
},
|
|
22386
22634
|
children: [
|
|
22387
|
-
/* @__PURE__ */ (0,
|
|
22635
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", {
|
|
22388
22636
|
children: "Deck to test"
|
|
22389
22637
|
}),
|
|
22390
|
-
/* @__PURE__ */ (0,
|
|
22638
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22391
22639
|
className: "editor-status",
|
|
22392
|
-
children: /* @__PURE__ */ (0,
|
|
22640
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", {
|
|
22393
22641
|
children: deckPath
|
|
22394
22642
|
})
|
|
22395
22643
|
}),
|
|
22396
|
-
/* @__PURE__ */ (0,
|
|
22644
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", {
|
|
22397
22645
|
children: "Init (gambit_init)"
|
|
22398
22646
|
}),
|
|
22399
|
-
deckSchema.loading && /* @__PURE__ */ (0,
|
|
22647
|
+
deckSchema.loading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22400
22648
|
className: "editor-status",
|
|
22401
22649
|
children: "Loading schema\u2026"
|
|
22402
22650
|
}),
|
|
22403
|
-
deckSchemaError && /* @__PURE__ */ (0,
|
|
22651
|
+
deckSchemaError && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22404
22652
|
className: "error",
|
|
22405
22653
|
children: deckSchemaError
|
|
22406
22654
|
}),
|
|
22407
|
-
deckInputSchema && /* @__PURE__ */ (0,
|
|
22655
|
+
deckInputSchema && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, {
|
|
22408
22656
|
children: [
|
|
22409
|
-
/* @__PURE__ */ (0,
|
|
22657
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InitForm, {
|
|
22410
22658
|
schema: deckInputSchema,
|
|
22411
22659
|
value: deckInitValue,
|
|
22412
22660
|
onChange: (next) => {
|
|
@@ -22418,14 +22666,14 @@ function TestBotApp(props) {
|
|
|
22418
22666
|
[pathKey]: err
|
|
22419
22667
|
})
|
|
22420
22668
|
}),
|
|
22421
|
-
/* @__PURE__ */ (0,
|
|
22669
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22422
22670
|
style: {
|
|
22423
22671
|
display: "flex",
|
|
22424
22672
|
gap: 8,
|
|
22425
22673
|
flexWrap: "wrap"
|
|
22426
22674
|
},
|
|
22427
22675
|
children: [
|
|
22428
|
-
/* @__PURE__ */ (0,
|
|
22676
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
22429
22677
|
type: "button",
|
|
22430
22678
|
className: "ghost-btn",
|
|
22431
22679
|
onClick: () => {
|
|
@@ -22436,7 +22684,7 @@ function TestBotApp(props) {
|
|
|
22436
22684
|
},
|
|
22437
22685
|
children: "Reset init"
|
|
22438
22686
|
}),
|
|
22439
|
-
/* @__PURE__ */ (0,
|
|
22687
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
22440
22688
|
type: "button",
|
|
22441
22689
|
className: "ghost-btn",
|
|
22442
22690
|
onClick: () => deckSchema.refresh(),
|
|
@@ -22446,7 +22694,7 @@ function TestBotApp(props) {
|
|
|
22446
22694
|
})
|
|
22447
22695
|
]
|
|
22448
22696
|
}),
|
|
22449
|
-
!deckInputSchema && !deckSchema.loading && /* @__PURE__ */ (0,
|
|
22697
|
+
!deckInputSchema && !deckSchema.loading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22450
22698
|
className: "placeholder",
|
|
22451
22699
|
children: "No input schema found for this deck."
|
|
22452
22700
|
})
|
|
@@ -22507,295 +22755,17 @@ function normalizeAppPath(input) {
|
|
|
22507
22755
|
}
|
|
22508
22756
|
return trimmed || DEFAULT_SESSION_PATH;
|
|
22509
22757
|
}
|
|
22510
|
-
function DocsPage(props) {
|
|
22511
|
-
const { deckDisplayPath: deckDisplayPath2, deckAbsolutePath, onNavigateToTestBot, onNavigateToDebug, onNavigateToCalibrate } = props;
|
|
22512
|
-
const [deckSource, setDeckSource] = (0, import_react.useState)(null);
|
|
22513
|
-
const [loading, setLoading] = (0, import_react.useState)(true);
|
|
22514
|
-
const [error, setError] = (0, import_react.useState)(null);
|
|
22515
|
-
const [copied, setCopied] = (0, import_react.useState)(false);
|
|
22516
|
-
(0, import_react.useEffect)(() => {
|
|
22517
|
-
let cancelled = false;
|
|
22518
|
-
const load = async () => {
|
|
22519
|
-
setLoading(true);
|
|
22520
|
-
setError(null);
|
|
22521
|
-
try {
|
|
22522
|
-
const res = await fetch("/api/deck-source");
|
|
22523
|
-
if (!res.ok) throw new Error(res.statusText);
|
|
22524
|
-
const body = await res.json();
|
|
22525
|
-
if (cancelled) return;
|
|
22526
|
-
if (body.error) {
|
|
22527
|
-
setError(body.error);
|
|
22528
|
-
setDeckSource(body.content ?? null);
|
|
22529
|
-
} else {
|
|
22530
|
-
setDeckSource(body.content ?? "");
|
|
22531
|
-
}
|
|
22532
|
-
} catch (err) {
|
|
22533
|
-
if (cancelled) return;
|
|
22534
|
-
setError(err instanceof Error ? err.message : "Failed to load deck");
|
|
22535
|
-
} finally {
|
|
22536
|
-
if (!cancelled) setLoading(false);
|
|
22537
|
-
}
|
|
22538
|
-
};
|
|
22539
|
-
load();
|
|
22540
|
-
return () => {
|
|
22541
|
-
cancelled = true;
|
|
22542
|
-
};
|
|
22543
|
-
}, []);
|
|
22544
|
-
(0, import_react.useEffect)(() => {
|
|
22545
|
-
if (!copied) return;
|
|
22546
|
-
const handle = window.setTimeout(() => setCopied(false), 2e3);
|
|
22547
|
-
return () => window.clearTimeout(handle);
|
|
22548
|
-
}, [
|
|
22549
|
-
copied
|
|
22550
|
-
]);
|
|
22551
|
-
const runCommand = (0, import_react.useMemo)(() => {
|
|
22552
|
-
const target = deckDisplayPath2 || deckAbsolutePath;
|
|
22553
|
-
return `deno run -A src/cli.ts serve "${target}" --port 8000`;
|
|
22554
|
-
}, [
|
|
22555
|
-
deckDisplayPath2,
|
|
22556
|
-
deckAbsolutePath
|
|
22557
|
-
]);
|
|
22558
|
-
const handleCopyPath = (0, import_react.useCallback)(async () => {
|
|
22559
|
-
try {
|
|
22560
|
-
await navigator.clipboard?.writeText(deckAbsolutePath);
|
|
22561
|
-
setCopied(true);
|
|
22562
|
-
} catch {
|
|
22563
|
-
setCopied(true);
|
|
22564
|
-
}
|
|
22565
|
-
}, [
|
|
22566
|
-
deckAbsolutePath
|
|
22567
|
-
]);
|
|
22568
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22569
|
-
className: "docs-shell",
|
|
22570
|
-
children: [
|
|
22571
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
22572
|
-
className: "docs-hero",
|
|
22573
|
-
children: [
|
|
22574
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
|
|
22575
|
-
children: [
|
|
22576
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", {
|
|
22577
|
-
children: "Gambit makes LLM workflows feel like software."
|
|
22578
|
-
}),
|
|
22579
|
-
" ",
|
|
22580
|
-
"Build typed decks, run them locally, and verify the results with test and grader decks."
|
|
22581
|
-
]
|
|
22582
|
-
}),
|
|
22583
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
|
|
22584
|
-
children: [
|
|
22585
|
-
"That framing comes straight from",
|
|
22586
|
-
" ",
|
|
22587
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
22588
|
-
href: GAMBIT_MESSAGING_SPINE_DOC,
|
|
22589
|
-
target: "_blank",
|
|
22590
|
-
rel: "noreferrer",
|
|
22591
|
-
children: "the Gambit messaging spine"
|
|
22592
|
-
}),
|
|
22593
|
-
" ",
|
|
22594
|
-
"so the simulator, docs, and demos all share the same Build \u2192 Run \u2192 Verify story."
|
|
22595
|
-
]
|
|
22596
|
-
})
|
|
22597
|
-
]
|
|
22598
|
-
}),
|
|
22599
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
22600
|
-
className: "docs-grid",
|
|
22601
|
-
children: [
|
|
22602
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", {
|
|
22603
|
-
className: "docs-card",
|
|
22604
|
-
children: [
|
|
22605
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
|
|
22606
|
-
children: "Build"
|
|
22607
|
-
}),
|
|
22608
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
|
|
22609
|
-
children: [
|
|
22610
|
-
"Use your editor (VS Code, Cursor, Codex Cloud, etc.) to edit decks directly in the repo. The active deck for this run lives at",
|
|
22611
|
-
" ",
|
|
22612
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", {
|
|
22613
|
-
children: deckDisplayPath2
|
|
22614
|
-
}),
|
|
22615
|
-
"."
|
|
22616
|
-
]
|
|
22617
|
-
})
|
|
22618
|
-
]
|
|
22619
|
-
}),
|
|
22620
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", {
|
|
22621
|
-
className: "docs-card",
|
|
22622
|
-
children: [
|
|
22623
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
|
|
22624
|
-
children: "Run"
|
|
22625
|
-
}),
|
|
22626
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
22627
|
-
children: "Spin up the simulator locally and iterate on Test Bot and Debug loops without leaving your machine."
|
|
22628
|
-
})
|
|
22629
|
-
]
|
|
22630
|
-
}),
|
|
22631
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", {
|
|
22632
|
-
className: "docs-card",
|
|
22633
|
-
children: [
|
|
22634
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
|
|
22635
|
-
children: "Verify"
|
|
22636
|
-
}),
|
|
22637
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
22638
|
-
children: "Feed saved sessions through grader decks in Calibrate so every demo includes traceability and scores."
|
|
22639
|
-
})
|
|
22640
|
-
]
|
|
22641
|
-
})
|
|
22642
|
-
]
|
|
22643
|
-
}),
|
|
22644
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
22645
|
-
className: "docs-run",
|
|
22646
|
-
children: [
|
|
22647
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
|
|
22648
|
-
children: "Run the simulator"
|
|
22649
|
-
}),
|
|
22650
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
22651
|
-
children: "Launch Gambit locally with your current deck:"
|
|
22652
|
-
}),
|
|
22653
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
|
|
22654
|
-
className: "docs-command",
|
|
22655
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", {
|
|
22656
|
-
children: runCommand
|
|
22657
|
-
})
|
|
22658
|
-
})
|
|
22659
|
-
]
|
|
22660
|
-
}),
|
|
22661
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
22662
|
-
className: "deck-preview-shell",
|
|
22663
|
-
children: [
|
|
22664
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", {
|
|
22665
|
-
children: [
|
|
22666
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22667
|
-
children: [
|
|
22668
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
|
|
22669
|
-
children: "Deck preview"
|
|
22670
|
-
}),
|
|
22671
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
22672
|
-
children: "Edit this file in your editor, then rerun or refresh the simulator."
|
|
22673
|
-
})
|
|
22674
|
-
]
|
|
22675
|
-
}),
|
|
22676
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22677
|
-
className: "deck-preview-meta",
|
|
22678
|
-
children: [
|
|
22679
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
22680
|
-
children: [
|
|
22681
|
-
"Path: ",
|
|
22682
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", {
|
|
22683
|
-
children: deckDisplayPath2
|
|
22684
|
-
})
|
|
22685
|
-
]
|
|
22686
|
-
}),
|
|
22687
|
-
" ",
|
|
22688
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
22689
|
-
type: "button",
|
|
22690
|
-
onClick: handleCopyPath,
|
|
22691
|
-
children: copied ? "Copied" : "Copy path"
|
|
22692
|
-
})
|
|
22693
|
-
]
|
|
22694
|
-
})
|
|
22695
|
-
]
|
|
22696
|
-
}),
|
|
22697
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22698
|
-
className: "deck-preview-body",
|
|
22699
|
-
children: [
|
|
22700
|
-
loading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22701
|
-
className: "placeholder",
|
|
22702
|
-
children: "Loading deck\u2026"
|
|
22703
|
-
}),
|
|
22704
|
-
!loading && error && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22705
|
-
className: "error",
|
|
22706
|
-
children: [
|
|
22707
|
-
"Failed to read deck: ",
|
|
22708
|
-
error
|
|
22709
|
-
]
|
|
22710
|
-
}),
|
|
22711
|
-
!loading && !error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
|
|
22712
|
-
className: "deck-preview",
|
|
22713
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", {
|
|
22714
|
-
children: deckSource ?? ""
|
|
22715
|
-
})
|
|
22716
|
-
})
|
|
22717
|
-
]
|
|
22718
|
-
})
|
|
22719
|
-
]
|
|
22720
|
-
}),
|
|
22721
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
22722
|
-
className: "docs-buttons",
|
|
22723
|
-
children: [
|
|
22724
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
22725
|
-
type: "button",
|
|
22726
|
-
onClick: onNavigateToTestBot,
|
|
22727
|
-
children: "Open Test Bot"
|
|
22728
|
-
}),
|
|
22729
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
22730
|
-
type: "button",
|
|
22731
|
-
onClick: onNavigateToDebug,
|
|
22732
|
-
children: "Inspect in Debug"
|
|
22733
|
-
}),
|
|
22734
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
22735
|
-
type: "button",
|
|
22736
|
-
onClick: onNavigateToCalibrate,
|
|
22737
|
-
children: "Grade in Calibrate"
|
|
22738
|
-
})
|
|
22739
|
-
]
|
|
22740
|
-
}),
|
|
22741
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
22742
|
-
className: "docs-links",
|
|
22743
|
-
children: [
|
|
22744
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
|
|
22745
|
-
children: "More docs"
|
|
22746
|
-
}),
|
|
22747
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("ul", {
|
|
22748
|
-
children: [
|
|
22749
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", {
|
|
22750
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
22751
|
-
href: GAMBIT_MESSAGING_SPINE_DOC,
|
|
22752
|
-
target: "_blank",
|
|
22753
|
-
rel: "noreferrer",
|
|
22754
|
-
children: "Gambit messaging spine (Build \u2192 Run \u2192 Verify narrative)"
|
|
22755
|
-
})
|
|
22756
|
-
}),
|
|
22757
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", {
|
|
22758
|
-
children: [
|
|
22759
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
22760
|
-
href: GAMBIT_PACKAGE_README,
|
|
22761
|
-
target: "_blank",
|
|
22762
|
-
rel: "noreferrer",
|
|
22763
|
-
children: "packages/gambit/README.md"
|
|
22764
|
-
}),
|
|
22765
|
-
" ",
|
|
22766
|
-
"\u2014 architecture, concepts, release notes."
|
|
22767
|
-
]
|
|
22768
|
-
}),
|
|
22769
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", {
|
|
22770
|
-
children: [
|
|
22771
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
22772
|
-
href: GAMBIT_CLI_DOC,
|
|
22773
|
-
target: "_blank",
|
|
22774
|
-
rel: "noreferrer",
|
|
22775
|
-
children: "packages/gambit/docs/cli.md"
|
|
22776
|
-
}),
|
|
22777
|
-
" ",
|
|
22778
|
-
"\u2014 CLI commands, flags, and workflows."
|
|
22779
|
-
]
|
|
22780
|
-
})
|
|
22781
|
-
]
|
|
22782
|
-
})
|
|
22783
|
-
]
|
|
22784
|
-
})
|
|
22785
|
-
]
|
|
22786
|
-
});
|
|
22787
|
-
}
|
|
22788
22758
|
function App() {
|
|
22789
22759
|
const simulatorBasePath = SESSIONS_BASE_PATH;
|
|
22790
|
-
const [path, setPath] = (0,
|
|
22791
|
-
const [bundleStamp, setBundleStamp] = (0,
|
|
22760
|
+
const [path, setPath] = (0, import_react2.useState)(() => normalizeAppPath(window.location.pathname));
|
|
22761
|
+
const [bundleStamp, setBundleStamp] = (0, import_react2.useState)(null);
|
|
22792
22762
|
const activeSessionId = getSessionIdFromPath(path);
|
|
22793
|
-
(0,
|
|
22763
|
+
(0, import_react2.useEffect)(() => {
|
|
22794
22764
|
const handler = () => setPath(normalizeAppPath(window.location.pathname));
|
|
22795
22765
|
window.addEventListener("popstate", handler);
|
|
22796
22766
|
return () => window.removeEventListener("popstate", handler);
|
|
22797
22767
|
}, []);
|
|
22798
|
-
(0,
|
|
22768
|
+
(0, import_react2.useEffect)(() => {
|
|
22799
22769
|
const loadBundleStamp = async () => {
|
|
22800
22770
|
try {
|
|
22801
22771
|
const res = await fetch("/ui/bundle.js", {
|
|
@@ -22811,14 +22781,14 @@ function App() {
|
|
|
22811
22781
|
};
|
|
22812
22782
|
loadBundleStamp();
|
|
22813
22783
|
}, []);
|
|
22814
|
-
const navigate = (0,
|
|
22784
|
+
const navigate = (0, import_react2.useCallback)((next) => {
|
|
22815
22785
|
if (next === path) return;
|
|
22816
22786
|
window.history.pushState({}, "", next);
|
|
22817
22787
|
setPath(next);
|
|
22818
22788
|
}, [
|
|
22819
22789
|
path
|
|
22820
22790
|
]);
|
|
22821
|
-
const replacePath = (0,
|
|
22791
|
+
const replacePath = (0, import_react2.useCallback)((next) => {
|
|
22822
22792
|
if (next === path) return;
|
|
22823
22793
|
window.history.replaceState({}, "", next);
|
|
22824
22794
|
setPath(next);
|
|
@@ -22828,54 +22798,53 @@ function App() {
|
|
|
22828
22798
|
const isDocs = path === DOCS_PATH;
|
|
22829
22799
|
const isTestBot = !isDocs && /\/test-bot$/.test(path);
|
|
22830
22800
|
const isCalibrate = !isDocs && (path.startsWith("/calibrate") || /^\/sessions\/[^/]+\/calibrate/.test(path));
|
|
22831
|
-
const isSimulator = !isDocs && !isTestBot && !isCalibrate;
|
|
22832
22801
|
const currentPage = isDocs ? "docs" : isTestBot ? "test-bot" : isCalibrate ? "calibrate" : "debug";
|
|
22833
22802
|
const testBotPath = activeSessionId ? `${SESSIONS_BASE_PATH}/${encodeURIComponent(activeSessionId)}/test-bot` : DEFAULT_TEST_BOT_PATH;
|
|
22834
22803
|
const debugPath = activeSessionId ? `${SESSIONS_BASE_PATH}/${encodeURIComponent(activeSessionId)}/debug` : DEFAULT_SESSION_PATH;
|
|
22835
22804
|
const calibratePath = activeSessionId ? buildCalibratePath(activeSessionId) : "/calibrate";
|
|
22836
|
-
return /* @__PURE__ */ (0,
|
|
22837
|
-
children: /* @__PURE__ */ (0,
|
|
22805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, {
|
|
22806
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22838
22807
|
className: "app-root",
|
|
22839
22808
|
children: [
|
|
22840
|
-
/* @__PURE__ */ (0,
|
|
22809
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22841
22810
|
className: "top-nav",
|
|
22842
22811
|
children: [
|
|
22843
|
-
/* @__PURE__ */ (0,
|
|
22812
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
22844
22813
|
className: "top-nav-buttons",
|
|
22845
22814
|
children: [
|
|
22846
|
-
/* @__PURE__ */ (0,
|
|
22815
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
22847
22816
|
type: "button",
|
|
22848
22817
|
className: currentPage === "docs" ? "active" : "",
|
|
22849
22818
|
onClick: () => navigate(DOCS_PATH),
|
|
22850
22819
|
"data-testid": "nav-docs",
|
|
22851
22820
|
children: "Docs"
|
|
22852
22821
|
}),
|
|
22853
|
-
/* @__PURE__ */ (0,
|
|
22822
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
22854
22823
|
type: "button",
|
|
22855
22824
|
className: currentPage === "test-bot" ? "active" : "",
|
|
22856
22825
|
onClick: () => navigate(testBotPath),
|
|
22857
22826
|
"data-testid": "nav-test-bot",
|
|
22858
22827
|
children: "Test Bot"
|
|
22859
22828
|
}),
|
|
22860
|
-
/* @__PURE__ */ (0,
|
|
22861
|
-
type: "button",
|
|
22862
|
-
className: currentPage === "debug" ? "active" : "",
|
|
22863
|
-
onClick: () => navigate(debugPath),
|
|
22864
|
-
"data-testid": "nav-debug",
|
|
22865
|
-
children: "Debug"
|
|
22866
|
-
}),
|
|
22867
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
22829
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
22868
22830
|
type: "button",
|
|
22869
22831
|
className: currentPage === "calibrate" ? "active" : "",
|
|
22870
22832
|
onClick: () => navigate(calibratePath),
|
|
22871
22833
|
"data-testid": "nav-calibrate",
|
|
22872
22834
|
children: "Calibrate"
|
|
22835
|
+
}),
|
|
22836
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", {
|
|
22837
|
+
type: "button",
|
|
22838
|
+
className: classNames("top-nav-link", currentPage === "debug" && "active"),
|
|
22839
|
+
onClick: () => navigate(debugPath),
|
|
22840
|
+
"data-testid": "nav-debug",
|
|
22841
|
+
children: "Debug"
|
|
22873
22842
|
})
|
|
22874
22843
|
]
|
|
22875
22844
|
}),
|
|
22876
|
-
/* @__PURE__ */ (0,
|
|
22845
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22877
22846
|
className: "top-nav-info",
|
|
22878
|
-
children: bundleStamp && /* @__PURE__ */ (0,
|
|
22847
|
+
children: bundleStamp && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", {
|
|
22879
22848
|
className: "bundle-stamp",
|
|
22880
22849
|
children: [
|
|
22881
22850
|
"Bundle: ",
|
|
@@ -22885,30 +22854,26 @@ function App() {
|
|
|
22885
22854
|
})
|
|
22886
22855
|
]
|
|
22887
22856
|
}),
|
|
22888
|
-
/* @__PURE__ */ (0,
|
|
22857
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
22889
22858
|
className: "page-shell",
|
|
22890
|
-
children: currentPage === "docs" ? /* @__PURE__ */ (0,
|
|
22859
|
+
children: currentPage === "docs" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DocsPage, {
|
|
22891
22860
|
deckDisplayPath,
|
|
22892
|
-
deckAbsolutePath: normalizedDeckPath
|
|
22893
|
-
|
|
22894
|
-
onNavigateToDebug: () => navigate(debugPath),
|
|
22895
|
-
onNavigateToCalibrate: () => navigate(calibratePath)
|
|
22896
|
-
}) : currentPage === "debug" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SimulatorApp, {
|
|
22861
|
+
deckAbsolutePath: normalizedDeckPath
|
|
22862
|
+
}) : currentPage === "debug" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SimulatorApp, {
|
|
22897
22863
|
basePath: simulatorBasePath
|
|
22898
|
-
}) : currentPage === "test-bot" ? /* @__PURE__ */ (0,
|
|
22899
|
-
onNavigateToSimulator: () => navigate(debugPath),
|
|
22864
|
+
}) : currentPage === "test-bot" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TestBotApp, {
|
|
22900
22865
|
onNavigateToSession: (sessionId) => navigate(`${simulatorBasePath}/${encodeURIComponent(sessionId)}/debug`),
|
|
22901
22866
|
onReplaceTestBotSession: (sessionId) => replacePath(`${simulatorBasePath}/${encodeURIComponent(sessionId)}/test-bot`),
|
|
22902
22867
|
onResetTestBotSession: () => replacePath(DEFAULT_TEST_BOT_PATH),
|
|
22903
22868
|
activeSessionId
|
|
22904
|
-
}) : /* @__PURE__ */ (0,
|
|
22869
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CalibrateApp, {})
|
|
22905
22870
|
})
|
|
22906
22871
|
]
|
|
22907
22872
|
})
|
|
22908
22873
|
});
|
|
22909
22874
|
}
|
|
22910
|
-
(0, import_client.createRoot)(document.getElementById("root")).render(/* @__PURE__ */ (0,
|
|
22911
|
-
children: /* @__PURE__ */ (0,
|
|
22875
|
+
(0, import_client.createRoot)(document.getElementById("root")).render(/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.default.StrictMode, {
|
|
22876
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(App, {})
|
|
22912
22877
|
}));
|
|
22913
22878
|
/**
|
|
22914
22879
|
* @license React
|