@aui.io/apollo 0.1.16 → 0.1.17
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/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js +23 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/scenarios.d.ts +3 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/scenarios.js +124 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/scenarios.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/index.js +2 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/package.json +3 -3
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.d.ts +177 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js +67 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/client-types.d.ts +3 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.d.ts +15 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js +27 -7
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/config/index.js +4 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/config/types.d.ts +2 -0
- package/node_modules/@aui.io/apollo-core/dist/src/index.d.ts +3 -1
- package/node_modules/@aui.io/apollo-core/dist/src/index.js +3 -1
- package/node_modules/@aui.io/apollo-core/dist/src/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.d.ts +3 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js +10 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.d.ts +151 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.js +459 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/package.json +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.js +28 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/operationStore.js +3 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/operationStore.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.d.ts +3 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.js +3 -3
- package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/author/ScenariosView.d.ts +22 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/ScenariosView.js +99 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/ScenariosView.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/scenarios.d.ts +47 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/scenarios.js +284 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/scenarios.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js +80 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js +43 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js +159 -15
- package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.d.ts +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.js +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/package.json +2 -2
- package/package.json +4 -4
|
@@ -21,7 +21,7 @@ const STATUS_COLOR = {
|
|
|
21
21
|
* Without a login or an agent it renders the welcome page instead: a setup
|
|
22
22
|
* checklist (sign in → project → agent) whose steps are clickable.
|
|
23
23
|
*/
|
|
24
|
-
export function AuthorHome({ scope, snapshot, validation, version, paneTitle, paneLines, resources, session, sessionRows, sessionCursor, sessionScrollRef, sessionUnitRefs, backendLabel, backendDetection, onSelectUnit, onWelcomeStep, }) {
|
|
24
|
+
export function AuthorHome({ scope, snapshot, validation, version, paneTitle, paneLines, resources, scenarios, session, sessionRows, sessionCursor, sessionScrollRef, sessionUnitRefs, backendLabel, backendDetection, onSelectUnit, onWelcomeStep, }) {
|
|
25
25
|
const hasAgent = scope.agent !== "—";
|
|
26
26
|
// Welcome page: the wordmark plus a setup checklist (setup screens are
|
|
27
27
|
// not day-to-day, so they can afford the room).
|
|
@@ -98,7 +98,7 @@ export function AuthorHome({ scope, snapshot, validation, version, paneTitle, pa
|
|
|
98
98
|
flexBasis: 0,
|
|
99
99
|
paddingLeft: 1,
|
|
100
100
|
paddingRight: 1,
|
|
101
|
-
}, children: [_jsx("text", { fg: DIM, children: scope.agentPath ? homeishPath(scope.agentPath) : "bundle/src" }), _jsxs("text", { fg: DIM, children: ["baseline", " ", _jsx("span", { fg: snapshot?.baselineTag ? FG : AMBER, children: snapshot?.baselineTag ?? "none" }), snapshot?.baselineAt ? (_jsxs("span", { fg: FAINT, children: [" ", "\u00B7 synced ", relativeTime(Date.parse(snapshot.baselineAt))] })) : null] }), _jsx(ChangesLine, { snapshot: snapshot }), _jsx(ValidationLine, { validation: validation }), _jsxs("text", { fg: DIM, children: ["resources ", _jsx("span", { fg: FAINT, children: resources ?? "m to inspect" })] })] }), _jsxs("box", { title: " remote target ", style: {
|
|
101
|
+
}, children: [_jsx("text", { fg: DIM, children: scope.agentPath ? homeishPath(scope.agentPath) : "bundle/src" }), _jsxs("text", { fg: DIM, children: ["baseline", " ", _jsx("span", { fg: snapshot?.baselineTag ? FG : AMBER, children: snapshot?.baselineTag ?? "none" }), snapshot?.baselineAt ? (_jsxs("span", { fg: FAINT, children: [" ", "\u00B7 synced ", relativeTime(Date.parse(snapshot.baselineAt))] })) : null] }), _jsx(ChangesLine, { snapshot: snapshot }), _jsx(ValidationLine, { validation: validation }), _jsxs("text", { fg: DIM, children: ["resources ", _jsx("span", { fg: FAINT, children: resources ?? "m to inspect" })] }), _jsxs("text", { fg: DIM, children: ["scenarios ", _jsx("span", { fg: FAINT, children: scenarios ?? "s to inspect" })] })] }), _jsxs("box", { title: " remote target ", style: {
|
|
102
102
|
border: true,
|
|
103
103
|
borderStyle: "rounded",
|
|
104
104
|
borderColor: TEAL_DIM,
|
|
@@ -109,7 +109,7 @@ export function AuthorHome({ scope, snapshot, validation, version, paneTitle, pa
|
|
|
109
109
|
paddingRight: 1,
|
|
110
110
|
}, children: [_jsxs("text", { fg: DIM, children: ["project ", _jsx("span", { fg: FG, children: scope.project })] }), scope.org !== "—" && scope.org !== scope.orgId?.slice(0, 12) ? (_jsxs("text", { fg: DIM, children: ["org ", scope.org] })) : null, _jsxs("text", { fg: FAINT, children: ["push \u2192 ", scope.env, scope.version !== "—"
|
|
111
111
|
? ` · draft revision from ${scope.version}`
|
|
112
|
-
: " · creates the first draft"] })] })] }), preview.length > 0 ? (_jsxs("box", { style: { flexDirection: "column", flexShrink: 0, paddingLeft: 1 }, children: [preview.map((entry) => (_jsxs("text", { fg: DIM, children: [" ", _jsx("span", { fg: STATUS_COLOR[entry.status], children: entry.status }), " ", entry.path] }, entry.path))), entries.length > preview.length ? (_jsxs("text", { fg: FAINT, children: [" ", "\u2026 ", entries.length - preview.length, " more \u2014 d for the full diff"] })) : null] })) : null, _jsxs("text", { fg: FG, style: { flexShrink: 0 }, children: [" ", _jsx("span", { fg: TEAL, children: "[v]" }), " validate ", _jsx("span", { fg: TEAL, children: "[d]" }), " diff", " ", _jsx("span", { fg: TEAL, children: "[p]" }), " push ", _jsx("span", { fg: TEAL, children: "[l]" }), " pull", " ", _jsx("span", { fg: TEAL, children: "[r]" }), " versions ", _jsx("span", { fg: TEAL, children: "[o]" }), " IDE", " ", _jsx("span", { fg: TEAL, children: "[m]" }), " resources"] }), _jsx(CopilotLine, { backendLabel: backendLabel, detection: backendDetection }), paneLines.length === 0 && entries.length === 0 && !session ? (_jsxs("text", { fg: FAINT, style: { flexShrink: 0 }, children: [" ", "edit in your IDE \u2014 changes appear here as you save"] })) : null, session ? (_jsx(SessionPane, { session: session, rows: sessionRows, cursor: sessionCursor, scrollRef: sessionScrollRef, unitRefs: sessionUnitRefs, onSelectUnit: onSelectUnit })) : (_jsx(OutputPane, { paneTitle: paneTitle, paneLines: paneLines }))] }));
|
|
112
|
+
: " · creates the first draft"] })] })] }), preview.length > 0 ? (_jsxs("box", { style: { flexDirection: "column", flexShrink: 0, paddingLeft: 1 }, children: [preview.map((entry) => (_jsxs("text", { fg: DIM, children: [" ", _jsx("span", { fg: STATUS_COLOR[entry.status], children: entry.status }), " ", entry.path] }, entry.path))), entries.length > preview.length ? (_jsxs("text", { fg: FAINT, children: [" ", "\u2026 ", entries.length - preview.length, " more \u2014 d for the full diff"] })) : null] })) : null, _jsxs("text", { fg: FG, style: { flexShrink: 0 }, children: [" ", _jsx("span", { fg: TEAL, children: "[v]" }), " validate ", _jsx("span", { fg: TEAL, children: "[d]" }), " diff", " ", _jsx("span", { fg: TEAL, children: "[p]" }), " push ", _jsx("span", { fg: TEAL, children: "[l]" }), " pull", " ", _jsx("span", { fg: TEAL, children: "[r]" }), " versions ", _jsx("span", { fg: TEAL, children: "[o]" }), " IDE", " ", _jsx("span", { fg: TEAL, children: "[m]" }), " resources ", _jsx("span", { fg: TEAL, children: "[s]" }), " scenarios"] }), _jsx(CopilotLine, { backendLabel: backendLabel, detection: backendDetection }), paneLines.length === 0 && entries.length === 0 && !session ? (_jsxs("text", { fg: FAINT, style: { flexShrink: 0 }, children: [" ", "edit in your IDE \u2014 changes appear here as you save"] })) : null, session ? (_jsx(SessionPane, { session: session, rows: sessionRows, cursor: sessionCursor, scrollRef: sessionScrollRef, unitRefs: sessionUnitRefs, onSelectUnit: onSelectUnit })) : (_jsx(OutputPane, { paneTitle: paneTitle, paneLines: paneLines }))] }));
|
|
113
113
|
}
|
|
114
114
|
/** One honest line about the copilot backend: detected, missing, or probing. */
|
|
115
115
|
function CopilotLine({ backendLabel, detection, }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorHome.js","sourceRoot":"","sources":["../../../src/author/AuthorHome.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAmB,MAAM,iBAAiB,CAAC;AAI/D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,KAAK,EACL,GAAG,EACH,KAAK,EACL,EAAE,EACF,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,QAAQ,GAET,MAAM,oBAAoB,CAAC;AAE5B,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB;0DAC0D;AAC1D,MAAM,QAAQ,GAAG,gBAAgB,EAAE,IAAI,IAAI,CAAC;AAE5C,MAAM,YAAY,GAAmC;IACnD,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,GAAG;CACP,CAAC;AAKF;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,UAAU,EACV,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,EACT,OAAO,EACP,WAAW,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;IACC,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,eAAM,EAAE,EAAE,KAAK,qDAAwC,CAAC;IACjE,CAAC;IACD,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAC9C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS,CAC7B,CAAC,MAAM,CAAC;IACT,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,KAAK,CAAC,CAAC;IACnD,OAAO,CACL,gBAAM,EAAE,EAAE,GAAG,2BACA,GAAG,EACd,eAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,YAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,MAAM,WAAW,GAAQ,EAC9E,gBAAM,EAAE,EAAE,KAAK,yBAAM,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC,IAAQ,EACvD,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,eAAM,EAAE,EAAE,KAAK,8BAAiB,CAAC,CAAC,CAAC,IAAI,IACtD,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import type { ScrollBoxRenderable } from "@opentui/core";
|
|
3
|
+
import type { ScenarioViewRow } from "./scenarios.js";
|
|
4
|
+
/**
|
|
5
|
+
* Scenarios subview — the evaluation suite as a list (status glyph,
|
|
6
|
+
* pass@k, goal) with a report pane (markdown blocks). Same shell as the
|
|
7
|
+
* resources subview: sidebar list + detail pane, Enter expands the detail
|
|
8
|
+
* full-width, Esc collapses, the wheel scrolls, clicks select/activate.
|
|
9
|
+
* `t` jumps to the selected row's graded transcript in Talk.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ScenariosView({ rows, cursor, expanded, sidebarWidth, pageSize, scrollRef, loadedNote, onRowClick, }: {
|
|
12
|
+
rows: ScenarioViewRow[];
|
|
13
|
+
cursor: number;
|
|
14
|
+
/** Full-width detail (Enter on a row); the list hides until Esc. */
|
|
15
|
+
expanded: boolean;
|
|
16
|
+
sidebarWidth: number;
|
|
17
|
+
pageSize: number;
|
|
18
|
+
scrollRef: RefObject<ScrollBoxRenderable | null>;
|
|
19
|
+
/** "loaded 12s ago · r reload" style note. */
|
|
20
|
+
loadedNote: string;
|
|
21
|
+
onRowClick?: ((index: number) => void) | undefined;
|
|
22
|
+
}): import("react").ReactNode;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { memo, useEffect } from "react";
|
|
3
|
+
import { G } from "../theme/glyphs.js";
|
|
4
|
+
import { getSyntaxStyle, getTreeSitter } from "../theme/syntax.js";
|
|
5
|
+
import { AMBER, DIM, FAINT, FG, RICH, TEAL, TEAL_DIM, } from "../theme/tokens.js";
|
|
6
|
+
/**
|
|
7
|
+
* Scenarios subview — the evaluation suite as a list (status glyph,
|
|
8
|
+
* pass@k, goal) with a report pane (markdown blocks). Same shell as the
|
|
9
|
+
* resources subview: sidebar list + detail pane, Enter expands the detail
|
|
10
|
+
* full-width, Esc collapses, the wheel scrolls, clicks select/activate.
|
|
11
|
+
* `t` jumps to the selected row's graded transcript in Talk.
|
|
12
|
+
*/
|
|
13
|
+
export function ScenariosView({ rows, cursor, expanded, sidebarWidth, pageSize, scrollRef, loadedNote, onRowClick, }) {
|
|
14
|
+
const selected = rows[cursor];
|
|
15
|
+
if (expanded) {
|
|
16
|
+
return (_jsx(DetailPane, { row: selected, loadedNote: loadedNote, scrollRef: scrollRef }));
|
|
17
|
+
}
|
|
18
|
+
return (_jsxs("box", { style: { flexDirection: "row", flexGrow: 1, minHeight: 0, width: "100%" }, children: [_jsx("box", { style: {
|
|
19
|
+
width: sidebarWidth,
|
|
20
|
+
flexShrink: 0,
|
|
21
|
+
minHeight: 0,
|
|
22
|
+
flexDirection: "column",
|
|
23
|
+
}, children: _jsx(ListPane, { rows: rows, cursor: cursor, pageSize: pageSize, onRowClick: onRowClick }) }), _jsx(DetailPane, { row: selected, loadedNote: loadedNote, scrollRef: scrollRef })] }));
|
|
24
|
+
}
|
|
25
|
+
function statusGlyph(row) {
|
|
26
|
+
if (row.kind === "summary")
|
|
27
|
+
return { glyph: G.bullet, color: row.warn ? AMBER : TEAL };
|
|
28
|
+
if (row.kind === "action")
|
|
29
|
+
return { glyph: "+", color: TEAL_DIM };
|
|
30
|
+
if (row.kind === "note")
|
|
31
|
+
return { glyph: G.warn, color: row.warn ? AMBER : FAINT };
|
|
32
|
+
if (row.status === "pass")
|
|
33
|
+
return { glyph: G.ok, color: TEAL };
|
|
34
|
+
if (row.status === "open")
|
|
35
|
+
return { glyph: G.fail, color: AMBER };
|
|
36
|
+
return { glyph: "·", color: FAINT };
|
|
37
|
+
}
|
|
38
|
+
function rowColor(row, active) {
|
|
39
|
+
if (row.kind === "action")
|
|
40
|
+
return active ? FG : TEAL_DIM;
|
|
41
|
+
if (row.kind === "note")
|
|
42
|
+
return row.warn ? AMBER : DIM;
|
|
43
|
+
return active ? FG : DIM;
|
|
44
|
+
}
|
|
45
|
+
const ListPane = memo(function ListPane({ rows, cursor, pageSize, onRowClick, }) {
|
|
46
|
+
const start = rows.length <= pageSize
|
|
47
|
+
? 0
|
|
48
|
+
: Math.max(0, Math.min(cursor - Math.floor(pageSize / 3), rows.length - pageSize));
|
|
49
|
+
const window = rows.slice(start, start + pageSize);
|
|
50
|
+
return (_jsxs("box", { title: " scenarios ", style: {
|
|
51
|
+
border: true,
|
|
52
|
+
borderStyle: "rounded",
|
|
53
|
+
borderColor: TEAL_DIM,
|
|
54
|
+
flexDirection: "column",
|
|
55
|
+
flexGrow: 1,
|
|
56
|
+
minHeight: 0,
|
|
57
|
+
overflow: "hidden",
|
|
58
|
+
paddingLeft: 1,
|
|
59
|
+
paddingRight: 1,
|
|
60
|
+
}, children: [start > 0 ? _jsxs("text", { fg: FAINT, children: ["\u2026 ", start, " above"] }) : null, window.map((row, i) => {
|
|
61
|
+
const index = start + i;
|
|
62
|
+
const active = index === cursor;
|
|
63
|
+
const status = statusGlyph(row);
|
|
64
|
+
return (_jsxs("text", { fg: rowColor(row, active), onMouseDown: onRowClick
|
|
65
|
+
? () => {
|
|
66
|
+
onRowClick(index);
|
|
67
|
+
}
|
|
68
|
+
: undefined, children: [active ? `${G.pointerBold} ` : " ", _jsxs("span", { fg: status.color, children: [status.glyph, " "] }), row.label, row.note ? (_jsx("span", { fg: row.warn ? AMBER : FAINT, children: ` ${row.note}` })) : null] }, row.id));
|
|
69
|
+
}), start + window.length < rows.length ? (_jsxs("text", { fg: FAINT, children: ["\u2026 ", rows.length - start - window.length, " below"] })) : null] }));
|
|
70
|
+
});
|
|
71
|
+
function Block({ block }) {
|
|
72
|
+
return (_jsxs("box", { style: { flexDirection: "column", width: "100%", flexShrink: 0 }, children: [block.heading ? (_jsx("text", { fg: TEAL, style: { flexShrink: 0 }, children: block.heading.toUpperCase() })) : null, block.markdown && RICH ? (_jsx("markdown", { content: block.text, syntaxStyle: getSyntaxStyle(), treeSitterClient: getTreeSitter(), style: { width: "100%" } })) : (_jsx("text", { fg: FG, wrapMode: "word", children: block.text })), _jsx("text", { children: " " })] }));
|
|
73
|
+
}
|
|
74
|
+
const DetailPane = memo(function DetailPane({ row, loadedNote, scrollRef, }) {
|
|
75
|
+
// Same scrollbox across selection moves — just rewind.
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
scrollRef.current?.scrollTo({ x: 0, y: 0 });
|
|
78
|
+
}, [row?.id, scrollRef]);
|
|
79
|
+
const hasTranscript = (row?.sessionIds.length ?? 0) > 0;
|
|
80
|
+
return (_jsxs("box", { title: ` ${row?.detailTitle ?? "scenarios"} `, style: {
|
|
81
|
+
border: true,
|
|
82
|
+
borderStyle: "rounded",
|
|
83
|
+
borderColor: TEAL_DIM,
|
|
84
|
+
flexDirection: "column",
|
|
85
|
+
flexGrow: 1,
|
|
86
|
+
flexBasis: 0,
|
|
87
|
+
minHeight: 0,
|
|
88
|
+
paddingLeft: 1,
|
|
89
|
+
paddingRight: 1,
|
|
90
|
+
}, children: [_jsxs("text", { fg: DIM, style: { flexShrink: 0 }, children: [loadedNote, hasTranscript ? (_jsx("span", { fg: FAINT, children: " \u00B7 t opens the graded transcript" })) : null] }), !row || row.blocks.length === 0 ? (_jsx("text", { fg: FAINT, children: row?.kind === "action"
|
|
91
|
+
? "Enter runs this action"
|
|
92
|
+
: "(select a row — its report renders here)" })) : (_jsx("scrollbox", { ref: scrollRef, style: {
|
|
93
|
+
flexGrow: 1,
|
|
94
|
+
flexShrink: 1,
|
|
95
|
+
flexBasis: 0,
|
|
96
|
+
flexDirection: "column",
|
|
97
|
+
}, children: row.blocks.map((block, index) => (_jsx(Block, { block: block }, `${row.id}/${String(index)}`))) }))] }));
|
|
98
|
+
});
|
|
99
|
+
//# sourceMappingURL=ScenariosView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScenariosView.js","sourceRoot":"","sources":["../../../src/author/ScenariosView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAkB,MAAM,OAAO,CAAC;AAIxD,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EACL,KAAK,EACL,GAAG,EACH,KAAK,EACL,EAAE,EACF,IAAI,EACJ,IAAI,EACJ,QAAQ,GAET,MAAM,oBAAoB,CAAC;AAE5B;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GAYX;IACC,MAAM,QAAQ,GA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C3D,CAAC,GACQ,CACb,IACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scenarios subview data layer — the checkout's evaluation suite
|
|
3
|
+
* (`scenarios/scenarios.json`) merged with its last score
|
|
4
|
+
* (`scenarios/scores.json`) into one navigable row list plus detail
|
|
5
|
+
* blocks per row. Local-first and pure fs: remote sync stays with the
|
|
6
|
+
* `scenarios-pull` / `scenarios-push` / `scores-pull` commands, so the
|
|
7
|
+
* view itself works offline and re-reads instantly after a pull.
|
|
8
|
+
*/
|
|
9
|
+
import { type LocalScenario, type LocalScores } from "@aui.io/apollo-core/services/scenarios.js";
|
|
10
|
+
export interface ScenariosData {
|
|
11
|
+
loadedAt: number;
|
|
12
|
+
suite?: LocalScenario[] | undefined;
|
|
13
|
+
scores?: LocalScores | undefined;
|
|
14
|
+
/** Parse/validation failure reading either file — shown, not thrown. */
|
|
15
|
+
error?: string | undefined;
|
|
16
|
+
}
|
|
17
|
+
/** Read both files; a broken one degrades to an error row, never a crash. */
|
|
18
|
+
export declare function loadScenariosData(checkoutRoot: string): Promise<ScenariosData>;
|
|
19
|
+
/** One paragraph of the detail pane; markdown renders rich when enabled. */
|
|
20
|
+
export interface ScenarioBlock {
|
|
21
|
+
heading?: string | undefined;
|
|
22
|
+
text: string;
|
|
23
|
+
markdown: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface ScenarioViewRow {
|
|
26
|
+
/** Stable id — cursor restoration keys off it. */
|
|
27
|
+
id: string;
|
|
28
|
+
kind: "summary" | "scenario" | "action" | "note";
|
|
29
|
+
label: string;
|
|
30
|
+
note?: string | undefined;
|
|
31
|
+
/** undefined = unscored (suite-only row). */
|
|
32
|
+
status?: "pass" | "open" | undefined;
|
|
33
|
+
/** Transcript ids — `t` (or the detail hint) jumps to the first. */
|
|
34
|
+
sessionIds: string[];
|
|
35
|
+
detailTitle: string;
|
|
36
|
+
blocks: ScenarioBlock[];
|
|
37
|
+
/** Slash command an action row dispatches. */
|
|
38
|
+
command?: string | undefined;
|
|
39
|
+
warn?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Flatten suite + scores into rows: the score summary first, then every
|
|
43
|
+
* scenario (suite order, score-only codes appended), then action rows.
|
|
44
|
+
*/
|
|
45
|
+
export declare function scenarioRows(data: ScenariosData | undefined): ScenarioViewRow[];
|
|
46
|
+
/** One-line summary for the Author home card. */
|
|
47
|
+
export declare function scenariosSummary(data: ScenariosData | undefined): string;
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scenarios subview data layer — the checkout's evaluation suite
|
|
3
|
+
* (`scenarios/scenarios.json`) merged with its last score
|
|
4
|
+
* (`scenarios/scores.json`) into one navigable row list plus detail
|
|
5
|
+
* blocks per row. Local-first and pure fs: remote sync stays with the
|
|
6
|
+
* `scenarios-pull` / `scenarios-push` / `scores-pull` commands, so the
|
|
7
|
+
* view itself works offline and re-reads instantly after a pull.
|
|
8
|
+
*/
|
|
9
|
+
import { readLocalScenarios, readLocalScores, REPORT_BLOCK_KEYS, } from "@aui.io/apollo-core/services/scenarios.js";
|
|
10
|
+
/** Read both files; a broken one degrades to an error row, never a crash. */
|
|
11
|
+
export async function loadScenariosData(checkoutRoot) {
|
|
12
|
+
try {
|
|
13
|
+
const [suite, scores] = await Promise.all([
|
|
14
|
+
readLocalScenarios(checkoutRoot),
|
|
15
|
+
readLocalScores(checkoutRoot),
|
|
16
|
+
]);
|
|
17
|
+
return {
|
|
18
|
+
loadedAt: Date.now(),
|
|
19
|
+
suite: suite?.scenarios,
|
|
20
|
+
scores,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
return {
|
|
25
|
+
loadedAt: Date.now(),
|
|
26
|
+
error: error instanceof Error ? error.message : String(error),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function totalsOf(scores) {
|
|
31
|
+
const rows = scores.scenarios ?? [];
|
|
32
|
+
const total = scores.total_scenarios ?? rows.length;
|
|
33
|
+
const pass = scores.pass_scenarios ?? rows.filter((row) => row.status === "pass").length;
|
|
34
|
+
return {
|
|
35
|
+
total,
|
|
36
|
+
pass,
|
|
37
|
+
pct: scores.pass_percentage ??
|
|
38
|
+
(total > 0 ? Math.round((pass / total) * 100) : 0),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function attemptsOf(result) {
|
|
42
|
+
if (result?.k === undefined)
|
|
43
|
+
return "";
|
|
44
|
+
return `${String(result.passed ?? 0)}/${String(result.k)}`;
|
|
45
|
+
}
|
|
46
|
+
function clip(text, max) {
|
|
47
|
+
const oneLine = text.replaceAll(/\s+/g, " ").trim();
|
|
48
|
+
return oneLine.length <= max ? oneLine : `${oneLine.slice(0, max - 1)}…`;
|
|
49
|
+
}
|
|
50
|
+
function summaryBlocks(scores) {
|
|
51
|
+
const blocks = [];
|
|
52
|
+
if (scores.summary) {
|
|
53
|
+
blocks.push({ text: scores.summary, markdown: true });
|
|
54
|
+
}
|
|
55
|
+
if (scores.residuals) {
|
|
56
|
+
blocks.push({ heading: "residuals", text: scores.residuals, markdown: true });
|
|
57
|
+
}
|
|
58
|
+
for (const key of REPORT_BLOCK_KEYS) {
|
|
59
|
+
const text = scores[key];
|
|
60
|
+
if (typeof text === "string" && text.trim()) {
|
|
61
|
+
blocks.push({ heading: key, text, markdown: true });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (scores.session_ids && scores.session_ids.length > 0) {
|
|
65
|
+
blocks.push({
|
|
66
|
+
heading: "run transcripts",
|
|
67
|
+
text: scores.session_ids.join("\n"),
|
|
68
|
+
markdown: false,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (blocks.length === 0) {
|
|
72
|
+
blocks.push({ text: "No report attached to this score.", markdown: false });
|
|
73
|
+
}
|
|
74
|
+
return blocks;
|
|
75
|
+
}
|
|
76
|
+
function scenarioBlocks(scenario, result) {
|
|
77
|
+
const blocks = [];
|
|
78
|
+
const goal = typeof scenario?.goal === "string" ? scenario.goal : "";
|
|
79
|
+
const description = typeof scenario?.description === "string" ? scenario.description : "";
|
|
80
|
+
if (goal)
|
|
81
|
+
blocks.push({ heading: "goal", text: goal, markdown: true });
|
|
82
|
+
if (description) {
|
|
83
|
+
blocks.push({ heading: "description", text: description, markdown: true });
|
|
84
|
+
}
|
|
85
|
+
// Extra suite keys (beyond code/goal/description) stay visible — the
|
|
86
|
+
// server preserves them verbatim, so authors do use them.
|
|
87
|
+
const extras = Object.entries(scenario ?? {}).filter(([key, value]) => key !== "code" &&
|
|
88
|
+
key !== "goal" &&
|
|
89
|
+
key !== "description" &&
|
|
90
|
+
value != null);
|
|
91
|
+
if (extras.length > 0) {
|
|
92
|
+
blocks.push({
|
|
93
|
+
heading: "extra",
|
|
94
|
+
text: extras
|
|
95
|
+
.map(([key, value]) => `${key}: ${typeof value === "string" ? value : JSON.stringify(value)}`)
|
|
96
|
+
.join("\n"),
|
|
97
|
+
markdown: false,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (result) {
|
|
101
|
+
const attempts = attemptsOf(result);
|
|
102
|
+
blocks.push({
|
|
103
|
+
heading: "result",
|
|
104
|
+
text: `${result.status}${attempts ? ` · ${attempts} attempts passed` : ""}`,
|
|
105
|
+
markdown: false,
|
|
106
|
+
});
|
|
107
|
+
if (result.comments) {
|
|
108
|
+
blocks.push({ heading: "comments", text: result.comments, markdown: true });
|
|
109
|
+
}
|
|
110
|
+
if (result.session_ids && result.session_ids.length > 0) {
|
|
111
|
+
blocks.push({
|
|
112
|
+
heading: "transcripts",
|
|
113
|
+
text: result.session_ids.join("\n"),
|
|
114
|
+
markdown: false,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
blocks.push({
|
|
120
|
+
text: "Not scored yet — the scoring skill writes scores.json.",
|
|
121
|
+
markdown: false,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return blocks;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Flatten suite + scores into rows: the score summary first, then every
|
|
128
|
+
* scenario (suite order, score-only codes appended), then action rows.
|
|
129
|
+
*/
|
|
130
|
+
export function scenarioRows(data) {
|
|
131
|
+
if (!data) {
|
|
132
|
+
return [
|
|
133
|
+
{
|
|
134
|
+
id: "loading",
|
|
135
|
+
kind: "note",
|
|
136
|
+
label: "loading scenarios…",
|
|
137
|
+
sessionIds: [],
|
|
138
|
+
detailTitle: "scenarios",
|
|
139
|
+
blocks: [],
|
|
140
|
+
},
|
|
141
|
+
];
|
|
142
|
+
}
|
|
143
|
+
if (data.error) {
|
|
144
|
+
return [
|
|
145
|
+
{
|
|
146
|
+
id: "error",
|
|
147
|
+
kind: "note",
|
|
148
|
+
label: data.error,
|
|
149
|
+
warn: true,
|
|
150
|
+
sessionIds: [],
|
|
151
|
+
detailTitle: "scenarios",
|
|
152
|
+
blocks: [
|
|
153
|
+
{ text: data.error, markdown: false },
|
|
154
|
+
{
|
|
155
|
+
text: "Fix the JSON in scenarios/ (or re-pull) and press r.",
|
|
156
|
+
markdown: false,
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
];
|
|
161
|
+
}
|
|
162
|
+
const rows = [];
|
|
163
|
+
const suite = data.suite ?? [];
|
|
164
|
+
const results = new Map((data.scores?.scenarios ?? []).map((row) => [row.scenario_code, row]));
|
|
165
|
+
if (data.scores) {
|
|
166
|
+
const totals = totalsOf(data.scores);
|
|
167
|
+
rows.push({
|
|
168
|
+
id: "summary",
|
|
169
|
+
kind: "summary",
|
|
170
|
+
label: "last score",
|
|
171
|
+
note: `${String(totals.pass)}/${String(totals.total)} pass (${String(totals.pct)}%)`,
|
|
172
|
+
sessionIds: data.scores.session_ids ?? [],
|
|
173
|
+
detailTitle: "last score",
|
|
174
|
+
blocks: summaryBlocks(data.scores),
|
|
175
|
+
...(totals.pass < totals.total ? { warn: true } : {}),
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
for (const scenario of suite) {
|
|
179
|
+
const result = results.get(scenario.code);
|
|
180
|
+
const attempts = attemptsOf(result);
|
|
181
|
+
const goal = typeof scenario.goal === "string" ? scenario.goal : "";
|
|
182
|
+
rows.push({
|
|
183
|
+
id: `s/${scenario.code}`,
|
|
184
|
+
kind: "scenario",
|
|
185
|
+
label: scenario.code,
|
|
186
|
+
note: [attempts, goal ? clip(goal, 48) : ""]
|
|
187
|
+
.filter(Boolean)
|
|
188
|
+
.join(" · ") || undefined,
|
|
189
|
+
status: result?.status,
|
|
190
|
+
sessionIds: result?.session_ids ?? [],
|
|
191
|
+
detailTitle: scenario.code,
|
|
192
|
+
blocks: scenarioBlocks(scenario, result),
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
// Scored codes missing from the local suite still render — a stale suite
|
|
196
|
+
// must not hide grades.
|
|
197
|
+
for (const [code, result] of results) {
|
|
198
|
+
if (suite.some((scenario) => scenario.code === code))
|
|
199
|
+
continue;
|
|
200
|
+
rows.push({
|
|
201
|
+
id: `s/${code}`,
|
|
202
|
+
kind: "scenario",
|
|
203
|
+
label: code,
|
|
204
|
+
note: "not in the local suite",
|
|
205
|
+
status: result.status,
|
|
206
|
+
sessionIds: result.session_ids ?? [],
|
|
207
|
+
detailTitle: code,
|
|
208
|
+
blocks: scenarioBlocks(undefined, result),
|
|
209
|
+
warn: true,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
if (suite.length === 0 && !data.scores) {
|
|
213
|
+
rows.push({
|
|
214
|
+
id: "empty",
|
|
215
|
+
kind: "note",
|
|
216
|
+
label: "no scenarios yet",
|
|
217
|
+
note: "pull the suite, or scaffold a new one",
|
|
218
|
+
sessionIds: [],
|
|
219
|
+
detailTitle: "scenarios",
|
|
220
|
+
blocks: [
|
|
221
|
+
{
|
|
222
|
+
text: "No scenarios/ files in this checkout. Pull the agent's suite, or scaffold an empty one and let a copilot fill it in.",
|
|
223
|
+
markdown: false,
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
rows.push({
|
|
229
|
+
id: "action/pull",
|
|
230
|
+
kind: "action",
|
|
231
|
+
label: "pull latest from remote",
|
|
232
|
+
note: "suite + intent files",
|
|
233
|
+
command: "scenarios-pull",
|
|
234
|
+
sessionIds: [],
|
|
235
|
+
detailTitle: "scenarios",
|
|
236
|
+
blocks: [],
|
|
237
|
+
}, {
|
|
238
|
+
id: "action/scores",
|
|
239
|
+
kind: "action",
|
|
240
|
+
label: "pull newest score",
|
|
241
|
+
note: "for the bound version",
|
|
242
|
+
command: "scores-pull",
|
|
243
|
+
sessionIds: [],
|
|
244
|
+
detailTitle: "scenarios",
|
|
245
|
+
blocks: [],
|
|
246
|
+
}, suite.length > 0 || data.scores
|
|
247
|
+
? {
|
|
248
|
+
id: "action/push",
|
|
249
|
+
kind: "action",
|
|
250
|
+
label: "push suite + scores",
|
|
251
|
+
note: "new bundle version",
|
|
252
|
+
command: "scenarios-push",
|
|
253
|
+
sessionIds: [],
|
|
254
|
+
detailTitle: "scenarios",
|
|
255
|
+
blocks: [],
|
|
256
|
+
}
|
|
257
|
+
: {
|
|
258
|
+
id: "action/generate",
|
|
259
|
+
kind: "action",
|
|
260
|
+
label: "scaffold scenarios/",
|
|
261
|
+
note: "suite skeleton + intent/",
|
|
262
|
+
command: "scenarios-generate",
|
|
263
|
+
sessionIds: [],
|
|
264
|
+
detailTitle: "scenarios",
|
|
265
|
+
blocks: [],
|
|
266
|
+
});
|
|
267
|
+
return rows;
|
|
268
|
+
}
|
|
269
|
+
/** One-line summary for the Author home card. */
|
|
270
|
+
export function scenariosSummary(data) {
|
|
271
|
+
if (!data)
|
|
272
|
+
return "s to inspect";
|
|
273
|
+
if (data.error)
|
|
274
|
+
return "unreadable — s to inspect";
|
|
275
|
+
if (data.scores) {
|
|
276
|
+
const totals = totalsOf(data.scores);
|
|
277
|
+
return `${String(totals.pass)}/${String(totals.total)} pass (${String(totals.pct)}%)`;
|
|
278
|
+
}
|
|
279
|
+
if (data.suite && data.suite.length > 0) {
|
|
280
|
+
return `${String(data.suite.length)} scenario(s) · unscored`;
|
|
281
|
+
}
|
|
282
|
+
return "none — s to start";
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=scenarios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenarios.js","sourceRoot":"","sources":["../../../src/author/scenarios.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,GAGlB,MAAM,2CAA2C,CAAC;AAWnD,6EAA6E;AAC7E,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,YAAoB;IAEpB,IAAI,CAAC;QACH,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACxC,kBAAkB,CAAC,YAAY,CAAC;YAChC,eAAe,CAAC,YAAY,CAAC;SAC9B,CAAC,CAAC;QACH,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE;YACpB,KAAK,EAAE,KAAK,EAAE,SAAS;YACvB,MAAM;SACP,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE;YACpB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC9D,CAAC;IACJ,CAAC;AACH,CAAC;AA0BD,SAAS,QAAQ,CAAC,MAAmB;IACnC,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC;IACpC,MAAM,KAAK,GAAG,MAAM,CAAC,eAAe,IAAI,IAAI,CAAC,MAAM,CAAC;IACpD,MAA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