@peasant-labs/fairtrade 0.0.17 → 0.0.19
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 +11 -2
- package/THIRD_PARTY_NOTICES.md +31 -0
- package/dist/lib/{InUseShell-CY5Acw6t.js → GraphLegend-BB0V2w59.js} +780 -558
- package/dist/lib/commons.js +139 -139
- package/dist/lib/components.css +1 -1
- package/dist/lib/graph.css +1 -1
- package/dist/lib/graph.js +921 -359
- package/dist/lib/types/BrandMark.d.ts +2 -2
- package/dist/lib/types/commons/providers.d.ts +1 -1
- package/dist/lib/types/graph/index.d.ts +16 -0
- package/dist/lib/types/provider-policy.d.ts +2 -2
- package/dist/lib/types/transcript/OutcomeChip.d.ts +18 -0
- package/dist/lib/types/transcript/UsageDisclosure.d.ts +8 -0
- package/dist/lib/types/transcript/analytics.d.ts +3 -6
- package/dist/lib/types/transcript/graph/engine/GraphControls.d.ts +13 -0
- package/dist/lib/types/transcript/graph/engine/TrajectoryGraph.d.ts +18 -0
- package/dist/lib/types/transcript/graph/engine/TrajectoryGraphLegend.d.ts +18 -0
- package/dist/lib/types/transcript/graph/engine/constants.d.ts +37 -0
- package/dist/lib/types/transcript/graph/engine/index.d.ts +23 -0
- package/dist/lib/types/transcript/graph/engine/nodes/SubagentBranchNode.d.ts +11 -0
- package/dist/lib/types/transcript/graph/engine/nodes/ToolPillNode.d.ts +11 -0
- package/dist/lib/types/transcript/graph/engine/nodes/TurnCardNode.d.ts +11 -0
- package/dist/lib/types/transcript/graph/engine/turnsToFlow.d.ts +47 -0
- package/dist/lib/types/transcript/graph/engine/types.d.ts +131 -0
- package/dist/lib/types/transcript/graph/engine/useCanvasSync.d.ts +17 -0
- package/dist/lib/types/transcript/index.d.ts +5 -0
- package/dist/lib/types/transcript/state-capabilities.d.ts +2 -1
- package/dist/lib/types/transcript/time.d.ts +22 -0
- package/dist/lib/types/transcript/title.d.ts +48 -0
- package/dist/lib/types/transcript/turnNav.d.ts +9 -0
- package/dist/lib/types/transcript/usage.d.ts +19 -0
- package/dist/lib/types/transcript/view-model.d.ts +61 -0
- package/dist/lib/{ui-yIg-1YXY.js → ui-DkPbLhcp.js} +2872 -2731
- package/dist/lib/ui.js +4 -4
- package/package.json +29 -8
package/dist/lib/graph.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D,
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { Box as
|
|
5
|
-
import { AllChangeBindings as
|
|
1
|
+
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as A, c as j, et as M, f as ee, g as N, h as P, ht as F, i as I, it as te, j as ne, k as re, m as ie, n as ae, nt as oe, o as se, ot as ce, pt as le, q as ue, r as de, rt as fe, s as pe, t as me, tt as he, ut as ge, v as L, w as _e, x as ve, xt as ye, y as be, z as xe } from "./GraphLegend-BB0V2w59.js";
|
|
2
|
+
import { memo as Se, useCallback as R, useEffect as z, useMemo as B, useRef as V, useState as H } from "react";
|
|
3
|
+
import { Fragment as Ce, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
4
|
+
import { Box as we, Check as Te, ChevronDown as Ee, ChevronRight as G, Coins as De, CornerDownRight as Oe, FileCode as ke, FileDiff as Ae, FileText as je, Folder as Me, GitMerge as Ne, Hash as Pe, Map as Fe, Maximize2 as Ie, MessageSquare as Le, Minus as Re, Plus as ze, RotateCcw as Be, RotateCw as Ve, Search as He, Share2 as Ue, Tag as We, TriangleAlert as Ge, X as Ke } from "lucide-react";
|
|
5
|
+
import { AllChangeBindings as qe, AllDiffLineKinds as Je, AllEdgeViolationKinds as Ye, AllFileChangeStatuses as Xe, AllInsightKinds as Ze, AllInsightProvenances as Qe, AllMapNodeKinds as $e, AllReadAttributionStates as et, AllReadStateGrades as tt, ChangeBinding as nt, DiffLineKind as rt, EdgeViolationKind as it, FileChangeStatus as at, InsightKind as ot, InsightProvenance as st, MapNodeKind as ct, ReadAttributionState as lt, ReadStateGrade as ut, isChangeBinding as dt, isDiffLineKind as ft, isEdgeViolationKind as pt, isFileChangeStatus as mt, isInsightKind as ht, isInsightProvenance as gt, isMapNodeKind as _t, isReadAttributionState as vt, isReadStateGrade as yt } from "@peasant-labs/schema";
|
|
6
|
+
import { Background as bt, BackgroundVariant as xt, Handle as K, MiniMap as St, Position as q, ReactFlow as Ct, ReactFlowProvider as wt, useEdgesState as Tt, useNodesState as Et, useReactFlow as Dt } from "@xyflow/react";
|
|
6
7
|
//#region src/ui/graph/changeGraph.js
|
|
7
|
-
var
|
|
8
|
-
function
|
|
8
|
+
var Ot = 6e4, kt = 60 * Ot, At = 24 * kt, jt = 7 * At;
|
|
9
|
+
function J(e, t) {
|
|
9
10
|
if (e == null) return "";
|
|
10
11
|
let n = Math.max(0, t - e);
|
|
11
|
-
return n <
|
|
12
|
+
return n < kt ? `${Math.max(1, Math.floor(n / Ot))}m ago` : n < At ? `${Math.floor(n / kt)}h ago` : n < jt ? `${Math.floor(n / At)}d ago` : `${Math.floor(n / jt)}wk ago`;
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
let n = e.recentCommits ?? [], r = e.changes ?? [], i = e.defaultBranch, a = e.sessions ?? [], o = new Map(a.map((e) => [e.sessionId, e])), s = new Set(n.flatMap((e) => e.sessionIds ?? [])), c = r.filter((e) => !e.merged).slice().sort((e, t) =>
|
|
14
|
+
function Mt(e, { nowMs: t }) {
|
|
15
|
+
let n = e.recentCommits ?? [], r = e.changes ?? [], i = e.defaultBranch, a = e.sessions ?? [], o = new Map(a.map((e) => [e.sessionId, e])), s = new Set(n.flatMap((e) => e.sessionIds ?? [])), c = r.filter((e) => !e.merged).slice().sort((e, t) => Nt(t) - Nt(e) || e.branch.localeCompare(t.branch)), l = r.filter((e) => e.merged && !e.reverted), u = r.filter((e) => e.merged && e.reverted), d = new Map(l.filter((e) => e.mergeCommitHash).map((e) => [e.mergeCommitHash, e])), f = c.map((e, t) => ({
|
|
15
16
|
change: e,
|
|
16
17
|
lane: t + 1,
|
|
17
18
|
baseHash: e.baseHash,
|
|
@@ -31,7 +32,7 @@ function ut(e, { nowMs: t }) {
|
|
|
31
32
|
branch: i.branch,
|
|
32
33
|
session: (i.sessionCount ?? 0) > 0,
|
|
33
34
|
tip: !0,
|
|
34
|
-
time:
|
|
35
|
+
time: J(n.tipMs, t)
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
};
|
|
@@ -50,13 +51,13 @@ function ut(e, { nowMs: t }) {
|
|
|
50
51
|
return t ? [t] : [];
|
|
51
52
|
}),
|
|
52
53
|
merged: c ? !0 : void 0,
|
|
53
|
-
time:
|
|
54
|
+
time: J(e.timeMs, t)
|
|
54
55
|
});
|
|
55
56
|
}), h(-Infinity);
|
|
56
57
|
let g = u.map((e) => ({
|
|
57
58
|
branch: e.branch,
|
|
58
59
|
mergedAtMs: e.mergedAtMs ?? null,
|
|
59
|
-
when:
|
|
60
|
+
when: J(e.mergedAtMs, t)
|
|
60
61
|
})), _ = a.filter((e) => e.hasCommitBinding === !0 && !s.has(e.sessionId));
|
|
61
62
|
return {
|
|
62
63
|
commits: p,
|
|
@@ -67,33 +68,33 @@ function ut(e, { nowMs: t }) {
|
|
|
67
68
|
outsideWindowSessions: _
|
|
68
69
|
};
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
+
function Nt(e) {
|
|
71
72
|
return e.tipCommitMs ?? Infinity;
|
|
72
73
|
}
|
|
73
74
|
//#endregion
|
|
74
75
|
//#region src/ui/graph/Changes.jsx
|
|
75
|
-
function
|
|
76
|
-
let u = l ?? Date.now(), { commits: d, reverted: f, unlinkedSessions: p, outsideWindowSessions: m, openCount: h, mergedCount: g } =
|
|
77
|
-
|
|
76
|
+
function Pt({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelectChange: i, onOpenMap: a, hasMore: o = !1, onShowOlder: s, onOpenSession: c, nowMs: l }) {
|
|
77
|
+
let u = l ?? Date.now(), { commits: d, reverted: f, unlinkedSessions: p, outsideWindowSessions: m, openCount: h, mergedCount: g } = B(() => Mt(e, { nowMs: u }), [e, u]), _ = e.defaultBranch, v = B(() => new Set(d.filter((e) => (e.sessionRefs?.length ?? 0) > 2).map((e) => e.id)), [d]), [y, b] = H([]);
|
|
78
|
+
z(() => {
|
|
78
79
|
b((e) => {
|
|
79
80
|
let t = e.filter((e) => v.has(e));
|
|
80
81
|
return t.length === e.length ? e : t;
|
|
81
82
|
});
|
|
82
83
|
}, [v]);
|
|
83
|
-
let x =
|
|
84
|
+
let x = R((e) => {
|
|
84
85
|
v.has(e) && b((t) => {
|
|
85
86
|
let n = new Set(t);
|
|
86
87
|
return n.has(e) ? n.delete(e) : n.add(e), [...n];
|
|
87
88
|
});
|
|
88
89
|
}, [v]);
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
+
return /* @__PURE__ */ W("div", {
|
|
90
91
|
className: "gmp-root gmp-changes-root",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
92
|
+
children: [/* @__PURE__ */ W("div", {
|
|
92
93
|
className: "gmp-changes-head",
|
|
93
|
-
children: [/* @__PURE__ */
|
|
94
|
+
children: [/* @__PURE__ */ W("div", { children: [t && /* @__PURE__ */ W("span", {
|
|
94
95
|
className: "label",
|
|
95
96
|
children: ["lines of work · ", t]
|
|
96
|
-
}), /* @__PURE__ */
|
|
97
|
+
}), /* @__PURE__ */ W("div", {
|
|
97
98
|
className: "gmp-changes-sub mono",
|
|
98
99
|
children: [
|
|
99
100
|
_ ? `default branch ${_} · ` : "",
|
|
@@ -102,21 +103,21 @@ function ft({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
|
|
|
102
103
|
g,
|
|
103
104
|
" merged"
|
|
104
105
|
]
|
|
105
|
-
})] }), /* @__PURE__ */
|
|
106
|
+
})] }), /* @__PURE__ */ W("button", {
|
|
106
107
|
type: "button",
|
|
107
108
|
className: "btn btn-secondary btn-sm",
|
|
108
109
|
onClick: () => {
|
|
109
110
|
r ? r({ type: "open-map" }) : a?.();
|
|
110
111
|
},
|
|
111
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ U(we, {
|
|
112
113
|
size: 14,
|
|
113
114
|
"aria-hidden": "true"
|
|
114
115
|
}), " open the map"]
|
|
115
116
|
})]
|
|
116
|
-
}), /* @__PURE__ */
|
|
117
|
+
}), /* @__PURE__ */ W("div", {
|
|
117
118
|
className: "gmp-changes-body",
|
|
118
119
|
children: [
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ U(M, {
|
|
120
121
|
className: "gmp-cg",
|
|
121
122
|
commits: d,
|
|
122
123
|
selectedId: n,
|
|
@@ -129,16 +130,16 @@ function ft({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
|
|
|
129
130
|
expandedCommitSessions: y,
|
|
130
131
|
onToggleCommitSessions: x
|
|
131
132
|
}),
|
|
132
|
-
p.length > 0 && /* @__PURE__ */
|
|
133
|
+
p.length > 0 && /* @__PURE__ */ W("section", {
|
|
133
134
|
className: "gmp-unlinked-sessions",
|
|
134
135
|
"aria-labelledby": "gmp-unlinked-sessions-heading",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
136
|
+
children: [/* @__PURE__ */ U("h2", {
|
|
136
137
|
id: "gmp-unlinked-sessions-heading",
|
|
137
138
|
className: "sb-head gmp-unlinked-sessions-head",
|
|
138
139
|
children: "sessions not linked to a commit"
|
|
139
|
-
}), /* @__PURE__ */
|
|
140
|
+
}), /* @__PURE__ */ U("div", {
|
|
140
141
|
className: "gmp-unlinked-sessions-list",
|
|
141
|
-
children: p.map((e) => /* @__PURE__ */
|
|
142
|
+
children: p.map((e) => /* @__PURE__ */ W("button", {
|
|
142
143
|
type: "button",
|
|
143
144
|
className: "gmp-unlinked-session",
|
|
144
145
|
onClick: () => {
|
|
@@ -148,20 +149,20 @@ function ft({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
|
|
|
148
149
|
source: { kind: "unlinked" }
|
|
149
150
|
}) : c?.(e.sessionId);
|
|
150
151
|
},
|
|
151
|
-
children: [/* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ U(ge, { harness: e.harness }), /* @__PURE__ */ U("span", { children: e.title || e.sessionId })]
|
|
152
153
|
}, e.sessionId))
|
|
153
154
|
})]
|
|
154
155
|
}),
|
|
155
|
-
m.length > 0 && /* @__PURE__ */
|
|
156
|
+
m.length > 0 && /* @__PURE__ */ W("section", {
|
|
156
157
|
className: "gmp-unlinked-sessions",
|
|
157
158
|
"aria-labelledby": "gmp-outside-window-sessions-heading",
|
|
158
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ U("h2", {
|
|
159
160
|
id: "gmp-outside-window-sessions-heading",
|
|
160
161
|
className: "sb-head gmp-unlinked-sessions-head",
|
|
161
162
|
children: "sessions linked outside this visible commit window"
|
|
162
|
-
}), /* @__PURE__ */
|
|
163
|
+
}), /* @__PURE__ */ U("div", {
|
|
163
164
|
className: "gmp-unlinked-sessions-list",
|
|
164
|
-
children: m.map((e) => /* @__PURE__ */
|
|
165
|
+
children: m.map((e) => /* @__PURE__ */ W("button", {
|
|
165
166
|
type: "button",
|
|
166
167
|
className: "gmp-unlinked-session",
|
|
167
168
|
onClick: () => {
|
|
@@ -171,18 +172,18 @@ function ft({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
|
|
|
171
172
|
source: { kind: "outside-window" }
|
|
172
173
|
}) : c?.(e.sessionId);
|
|
173
174
|
},
|
|
174
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ U(ge, { harness: e.harness }), /* @__PURE__ */ U("span", { children: e.title || e.sessionId })]
|
|
175
176
|
}, e.sessionId))
|
|
176
177
|
})]
|
|
177
178
|
}),
|
|
178
|
-
f.length > 0 && /* @__PURE__ */
|
|
179
|
+
f.length > 0 && /* @__PURE__ */ W("div", {
|
|
179
180
|
className: "gmp-merged-sec",
|
|
180
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ U("div", {
|
|
181
182
|
className: "sb-head gmp-merged-head",
|
|
182
183
|
children: "already merged in"
|
|
183
|
-
}), /* @__PURE__ */
|
|
184
|
+
}), /* @__PURE__ */ U("div", {
|
|
184
185
|
className: "gmp-merged-list",
|
|
185
|
-
children: f.map((e) => /* @__PURE__ */
|
|
186
|
+
children: f.map((e) => /* @__PURE__ */ W("button", {
|
|
186
187
|
type: "button",
|
|
187
188
|
className: "gmp-merged-chip gmp-merged-revert",
|
|
188
189
|
onClick: () => {
|
|
@@ -199,7 +200,7 @@ function ft({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
|
|
|
199
200
|
}) : i?.(t);
|
|
200
201
|
},
|
|
201
202
|
children: [
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ U(Ne, {
|
|
203
204
|
size: 13,
|
|
204
205
|
"aria-hidden": "true"
|
|
205
206
|
}),
|
|
@@ -211,12 +212,12 @@ function ft({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
|
|
|
211
212
|
}, e.branch))
|
|
212
213
|
})]
|
|
213
214
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ W("div", {
|
|
215
216
|
className: "gmp-changes-legend",
|
|
216
217
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ W("span", {
|
|
218
219
|
className: "gmp-legend-item",
|
|
219
|
-
children: [/* @__PURE__ */
|
|
220
|
+
children: [/* @__PURE__ */ U("span", {
|
|
220
221
|
className: "cg-dot cg-dot-filled",
|
|
221
222
|
style: {
|
|
222
223
|
width: 9,
|
|
@@ -225,9 +226,9 @@ function ft({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
|
|
|
225
226
|
"aria-hidden": "true"
|
|
226
227
|
}), " commit with a recorded session"]
|
|
227
228
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ W("span", {
|
|
229
230
|
className: "gmp-legend-item",
|
|
230
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ U("span", {
|
|
231
232
|
className: "cg-dot cg-dot-hollow",
|
|
232
233
|
style: {
|
|
233
234
|
width: 9,
|
|
@@ -236,7 +237,7 @@ function ft({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
|
|
|
236
237
|
"aria-hidden": "true"
|
|
237
238
|
}), " no session captured"]
|
|
238
239
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ U("span", {
|
|
240
241
|
className: "gmp-legend-item gmp-legend-dim",
|
|
241
242
|
children: "a filled dot also flies a sparkle · select a commit to open it"
|
|
242
243
|
})
|
|
@@ -248,29 +249,29 @@ function ft({ payload: e, projectLabel: t, selectedId: n, onNavigate: r, onSelec
|
|
|
248
249
|
}
|
|
249
250
|
//#endregion
|
|
250
251
|
//#region src/ui/graph/ChangeDetail.jsx
|
|
251
|
-
var
|
|
252
|
+
var Ft = {
|
|
252
253
|
M: "changed",
|
|
253
254
|
A: "added",
|
|
254
255
|
D: "deleted",
|
|
255
256
|
R: "renamed"
|
|
256
|
-
},
|
|
257
|
+
}, It = {
|
|
257
258
|
A: "chip-ok",
|
|
258
259
|
M: "",
|
|
259
260
|
D: "chip-err",
|
|
260
261
|
R: "chip-warn"
|
|
261
|
-
},
|
|
262
|
+
}, Lt = {
|
|
262
263
|
context: "ctx",
|
|
263
264
|
add: "add",
|
|
264
265
|
del: "del"
|
|
265
266
|
};
|
|
266
|
-
function
|
|
267
|
+
function Rt(e) {
|
|
267
268
|
let t = (e.split("/").pop() ?? e).replace(/[-_]+/g, " ").trim();
|
|
268
269
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
269
270
|
}
|
|
270
|
-
var
|
|
271
|
-
function
|
|
271
|
+
var zt = (e) => e >= 1e3 ? `≈${(e / 1e3).toFixed(1)}k` : String(e);
|
|
272
|
+
function Bt(e) {
|
|
272
273
|
let t = e.oldStart, n = e.newStart, r = e.lines.map((e) => {
|
|
273
|
-
let r =
|
|
274
|
+
let r = Lt[e.kind] ?? "ctx";
|
|
274
275
|
return r === "add" ? {
|
|
275
276
|
type: r,
|
|
276
277
|
newNo: n++,
|
|
@@ -291,109 +292,109 @@ function vt(e) {
|
|
|
291
292
|
lines: r
|
|
292
293
|
};
|
|
293
294
|
}
|
|
294
|
-
function
|
|
295
|
-
|
|
296
|
-
let
|
|
297
|
-
return /* @__PURE__ */
|
|
295
|
+
function Vt({ file: t, diff: n, open: r, onToggle: i }) {
|
|
296
|
+
n && E(n);
|
|
297
|
+
let a = t.status, o = n ? new Set(n.hunks.map((e) => e.sessionId).filter(Boolean)).size : null;
|
|
298
|
+
return /* @__PURE__ */ W("div", {
|
|
298
299
|
className: "gmp-file",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
300
|
+
children: [/* @__PURE__ */ W("button", {
|
|
300
301
|
type: "button",
|
|
301
302
|
className: "gmp-file-head",
|
|
302
|
-
"aria-expanded":
|
|
303
|
-
onClick:
|
|
303
|
+
"aria-expanded": r,
|
|
304
|
+
onClick: i,
|
|
304
305
|
children: [
|
|
305
|
-
|
|
306
|
+
U(r ? Ee : G, {
|
|
306
307
|
size: 14,
|
|
307
308
|
"aria-hidden": "true"
|
|
308
309
|
}),
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ U("span", {
|
|
310
311
|
className: "mono gmp-file-path",
|
|
311
|
-
children:
|
|
312
|
+
children: t.path
|
|
312
313
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
className: "chip gmp-file-status " + (
|
|
315
|
-
children:
|
|
314
|
+
/* @__PURE__ */ U("span", {
|
|
315
|
+
className: "chip gmp-file-status " + (It[a] ?? ""),
|
|
316
|
+
children: Ft[a] ?? a
|
|
316
317
|
}),
|
|
317
|
-
|
|
318
|
+
o != null && o > 0 && /* @__PURE__ */ W("span", {
|
|
318
319
|
className: "gmp-file-convos metaitem",
|
|
319
320
|
children: [
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ U(Le, {
|
|
321
322
|
size: 13,
|
|
322
323
|
"aria-hidden": "true"
|
|
323
324
|
}),
|
|
324
325
|
" ",
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ U("span", {
|
|
326
327
|
className: "tnum",
|
|
327
|
-
children:
|
|
328
|
+
children: o
|
|
328
329
|
})
|
|
329
330
|
]
|
|
330
331
|
})
|
|
331
332
|
]
|
|
332
|
-
}),
|
|
333
|
+
}), r && /* @__PURE__ */ U("div", {
|
|
333
334
|
className: "gmp-file-body",
|
|
334
|
-
children:
|
|
335
|
+
children: n ? n.error ? /* @__PURE__ */ U("p", {
|
|
335
336
|
className: "gmp-diff-state gmp-diff-error mono",
|
|
336
|
-
children:
|
|
337
|
-
}) :
|
|
337
|
+
children: n.error
|
|
338
|
+
}) : n.binary ? /* @__PURE__ */ U("p", {
|
|
338
339
|
className: "gmp-diff-state mono",
|
|
339
340
|
children: "binary file — no textual diff."
|
|
340
|
-
}) :
|
|
341
|
+
}) : n.hunks.length === 0 ? /* @__PURE__ */ U("p", {
|
|
341
342
|
className: "gmp-diff-state mono",
|
|
342
343
|
children: "no line changes."
|
|
343
|
-
}) :
|
|
344
|
+
}) : n.hunks.map((t, r) => /* @__PURE__ */ W("div", {
|
|
344
345
|
className: "gmp-hunk",
|
|
345
346
|
children: [
|
|
346
|
-
|
|
347
|
+
t.sessionTitle && /* @__PURE__ */ W("div", {
|
|
347
348
|
className: "gmp-hunk-attrib",
|
|
348
349
|
children: [
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ U(Oe, {
|
|
350
351
|
size: 13,
|
|
351
352
|
"aria-hidden": "true"
|
|
352
353
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ U("span", {
|
|
354
355
|
className: "gmp-hunk-from",
|
|
355
356
|
children: "from"
|
|
356
357
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ U("span", {
|
|
358
359
|
className: "gmp-hunk-link",
|
|
359
|
-
children:
|
|
360
|
+
children: t.sessionTitle
|
|
360
361
|
}),
|
|
361
|
-
|
|
362
|
+
t.sessionId && /* @__PURE__ */ U("span", {
|
|
362
363
|
className: "mono gmp-hunk-hash",
|
|
363
|
-
children:
|
|
364
|
+
children: t.sessionId.slice(0, 7)
|
|
364
365
|
})
|
|
365
366
|
]
|
|
366
367
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ U(e, {
|
|
368
369
|
file: "",
|
|
369
|
-
hunks: [
|
|
370
|
+
hunks: [Bt(t)],
|
|
370
371
|
className: "gmp-hunk-diff"
|
|
371
372
|
}),
|
|
372
|
-
|
|
373
|
+
n.truncated && r === n.hunks.length - 1 && /* @__PURE__ */ U("p", {
|
|
373
374
|
className: "gmp-diff-state mono",
|
|
374
375
|
children: "diff truncated (file exceeds the size cap)."
|
|
375
376
|
})
|
|
376
377
|
]
|
|
377
|
-
},
|
|
378
|
+
}, r)) : /* @__PURE__ */ U("p", {
|
|
378
379
|
className: "gmp-diff-state mono",
|
|
379
380
|
children: "loading diff…"
|
|
380
381
|
})
|
|
381
382
|
})]
|
|
382
383
|
});
|
|
383
384
|
}
|
|
384
|
-
function
|
|
385
|
-
|
|
386
|
-
let [
|
|
385
|
+
function Ht({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnotation: i, onRemoveAnnotation: a, onOpenMap: o, onShare: s, onCopyRecap: c, initialOpenFiles: l = {} }) {
|
|
386
|
+
w(e);
|
|
387
|
+
let [u, d] = H(l), [f, p] = H(null), [m, h] = H(!1), [g, _] = H(""), v = V({}), y = V(null), b = n ?? Rt(e.branch), x = e.work.length, S = e.newEdges.length, C = e.removedEdges.length, T = (e) => d((t) => ({
|
|
387
388
|
...t,
|
|
388
389
|
[e]: !t[e]
|
|
389
390
|
}));
|
|
390
391
|
function E(e, t) {
|
|
391
|
-
if (
|
|
392
|
-
|
|
392
|
+
if (p(e), t) {
|
|
393
|
+
d((e) => ({
|
|
393
394
|
...e,
|
|
394
395
|
[t]: !0
|
|
395
396
|
}));
|
|
396
|
-
let e =
|
|
397
|
+
let e = v.current[t], n = y.current;
|
|
397
398
|
if (e && n) {
|
|
398
399
|
let t = window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
399
400
|
n.scrollTo({
|
|
@@ -405,104 +406,104 @@ function bt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
|
|
|
405
406
|
}
|
|
406
407
|
function D(e) {
|
|
407
408
|
e.preventDefault();
|
|
408
|
-
let t =
|
|
409
|
-
t && i?.(t),
|
|
409
|
+
let t = g.trim();
|
|
410
|
+
t && i?.(t), h(!1), _("");
|
|
410
411
|
}
|
|
411
412
|
let O = e.files[0]?.path;
|
|
412
|
-
return /* @__PURE__ */
|
|
413
|
+
return /* @__PURE__ */ W("div", {
|
|
413
414
|
className: "gmp-root gmp-detail-root",
|
|
414
|
-
ref:
|
|
415
|
+
ref: y,
|
|
415
416
|
children: [
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ W("div", {
|
|
417
418
|
className: "gmp-detail-head",
|
|
418
419
|
children: [
|
|
419
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ W("div", {
|
|
420
421
|
className: "crumb",
|
|
421
422
|
children: [
|
|
422
423
|
"review ",
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ U(G, {
|
|
424
425
|
size: 13,
|
|
425
426
|
"aria-hidden": "true"
|
|
426
427
|
}),
|
|
427
428
|
" ",
|
|
428
429
|
e.defaultBranch,
|
|
429
430
|
" ",
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ U(G, {
|
|
431
432
|
size: 13,
|
|
432
433
|
"aria-hidden": "true"
|
|
433
434
|
}),
|
|
434
435
|
" ",
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ U("span", {
|
|
436
437
|
className: "cur",
|
|
437
438
|
children: e.branch
|
|
438
439
|
})
|
|
439
440
|
]
|
|
440
441
|
}),
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ U("div", {
|
|
442
443
|
className: "gmp-detail-title",
|
|
443
|
-
children:
|
|
444
|
+
children: b
|
|
444
445
|
}),
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ W("p", {
|
|
446
447
|
className: "gmp-caption",
|
|
447
448
|
children: [
|
|
448
449
|
"this line of work touched",
|
|
449
450
|
" ",
|
|
450
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ W("button", {
|
|
451
452
|
type: "button",
|
|
452
|
-
className: "gmp-frag" + (
|
|
453
|
+
className: "gmp-frag" + (f === "files" ? " gmp-frag-on" : ""),
|
|
453
454
|
onClick: () => E("files", O),
|
|
454
455
|
children: [e.filesChanged, " files"]
|
|
455
456
|
}),
|
|
456
457
|
" ",
|
|
457
458
|
"across",
|
|
458
459
|
" ",
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ W("button", {
|
|
460
461
|
type: "button",
|
|
461
|
-
className: "gmp-frag" + (
|
|
462
|
+
className: "gmp-frag" + (f === "conversations" ? " gmp-frag-on" : ""),
|
|
462
463
|
onClick: () => E("conversations"),
|
|
463
|
-
children: [
|
|
464
|
+
children: [x, " conversations"]
|
|
464
465
|
}),
|
|
465
466
|
", reshaping",
|
|
466
467
|
" ",
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ W("button", {
|
|
468
469
|
type: "button",
|
|
469
|
-
className: "gmp-frag" + (
|
|
470
|
+
className: "gmp-frag" + (f === "conn" ? " gmp-frag-on" : ""),
|
|
470
471
|
onClick: () => E("conn"),
|
|
471
472
|
children: [
|
|
472
473
|
"+",
|
|
473
|
-
|
|
474
|
+
S,
|
|
474
475
|
"/−",
|
|
475
|
-
|
|
476
|
+
C,
|
|
476
477
|
" connections"
|
|
477
478
|
]
|
|
478
479
|
}),
|
|
479
480
|
"."
|
|
480
481
|
]
|
|
481
482
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ U("span", {
|
|
483
484
|
className: "gmp-caption-hint mono",
|
|
484
485
|
children: "click any number to jump to its proof"
|
|
485
486
|
})
|
|
486
487
|
]
|
|
487
488
|
}),
|
|
488
|
-
(e.frictions.length > 0 || e.violations.length > 0) && /* @__PURE__ */
|
|
489
|
+
(e.frictions.length > 0 || e.violations.length > 0) && /* @__PURE__ */ W("div", {
|
|
489
490
|
className: "gmp-signals",
|
|
490
|
-
children: [e.frictions.map((e, t) => /* @__PURE__ */
|
|
491
|
+
children: [e.frictions.map((e, t) => /* @__PURE__ */ W("span", {
|
|
491
492
|
className: "gmp-signal",
|
|
492
493
|
children: [
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ U(Ve, {
|
|
494
495
|
size: 14,
|
|
495
496
|
"aria-hidden": "true"
|
|
496
497
|
}),
|
|
497
498
|
" ",
|
|
498
499
|
e.label,
|
|
499
500
|
" · ",
|
|
500
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ U("span", {
|
|
501
502
|
className: "mono",
|
|
502
503
|
children: e.file
|
|
503
504
|
}),
|
|
504
505
|
" ",
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ W("b", {
|
|
506
507
|
className: "tnum",
|
|
507
508
|
children: [e.count, "×"]
|
|
508
509
|
}),
|
|
@@ -510,15 +511,15 @@ function bt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
|
|
|
510
511
|
e.sessions,
|
|
511
512
|
" conversations"
|
|
512
513
|
]
|
|
513
|
-
}, t)), e.violations.length > 0 && /* @__PURE__ */
|
|
514
|
+
}, t)), e.violations.length > 0 && /* @__PURE__ */ W("span", {
|
|
514
515
|
className: "gmp-signal gmp-signal-warn",
|
|
515
516
|
children: [
|
|
516
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ U(Ge, {
|
|
517
518
|
size: 14,
|
|
518
519
|
"aria-hidden": "true"
|
|
519
520
|
}),
|
|
520
521
|
" ",
|
|
521
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ U("b", {
|
|
522
523
|
className: "tnum",
|
|
523
524
|
children: e.violations.length
|
|
524
525
|
}),
|
|
@@ -526,13 +527,13 @@ function bt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
|
|
|
526
527
|
]
|
|
527
528
|
})]
|
|
528
529
|
}),
|
|
529
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ W("div", {
|
|
530
531
|
className: "gmp-totals",
|
|
531
532
|
children: [
|
|
532
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ W("span", {
|
|
533
534
|
className: "metaitem tnum",
|
|
534
535
|
children: [
|
|
535
|
-
/* @__PURE__ */
|
|
536
|
+
/* @__PURE__ */ U(Ae, {
|
|
536
537
|
size: 14,
|
|
537
538
|
"aria-hidden": "true"
|
|
538
539
|
}),
|
|
@@ -541,37 +542,37 @@ function bt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
|
|
|
541
542
|
" files touched"
|
|
542
543
|
]
|
|
543
544
|
}),
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ W("span", {
|
|
545
546
|
className: "metaitem tnum",
|
|
546
547
|
children: [
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ W("span", {
|
|
548
549
|
className: "gmp-add",
|
|
549
|
-
children: ["+",
|
|
550
|
+
children: ["+", S]
|
|
550
551
|
}),
|
|
551
552
|
"/",
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
+
/* @__PURE__ */ W("span", {
|
|
553
554
|
className: "gmp-del",
|
|
554
|
-
children: ["−",
|
|
555
|
+
children: ["−", C]
|
|
555
556
|
}),
|
|
556
557
|
" connections"
|
|
557
558
|
]
|
|
558
559
|
}),
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
+
/* @__PURE__ */ W("span", {
|
|
560
561
|
className: "metaitem tnum",
|
|
561
562
|
children: [
|
|
562
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ U(Pe, {
|
|
563
564
|
size: 14,
|
|
564
565
|
"aria-hidden": "true"
|
|
565
566
|
}),
|
|
566
567
|
" ai wrote ",
|
|
567
|
-
|
|
568
|
+
zt(Number(e.outputTokens)),
|
|
568
569
|
" tokens"
|
|
569
570
|
]
|
|
570
571
|
}),
|
|
571
|
-
e.costUsd != null && /* @__PURE__ */
|
|
572
|
+
e.costUsd != null && /* @__PURE__ */ W("span", {
|
|
572
573
|
className: "metaitem tnum",
|
|
573
574
|
children: [
|
|
574
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ U(De, {
|
|
575
576
|
size: 14,
|
|
576
577
|
"aria-hidden": "true"
|
|
577
578
|
}),
|
|
@@ -581,62 +582,62 @@ function bt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
|
|
|
581
582
|
})
|
|
582
583
|
]
|
|
583
584
|
}),
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ W("div", {
|
|
585
586
|
className: "gmp-detail-sec",
|
|
586
|
-
children: [/* @__PURE__ */
|
|
587
|
+
children: [/* @__PURE__ */ U("div", {
|
|
587
588
|
className: "sb-head gmp-detail-sechead",
|
|
588
589
|
children: "files changed · click a path to open its diff"
|
|
589
|
-
}), /* @__PURE__ */
|
|
590
|
+
}), /* @__PURE__ */ U("div", {
|
|
590
591
|
className: "gmp-files",
|
|
591
|
-
children: e.files.map((e) => /* @__PURE__ */
|
|
592
|
+
children: e.files.map((e) => /* @__PURE__ */ U("div", {
|
|
592
593
|
ref: (t) => {
|
|
593
|
-
|
|
594
|
+
v.current[e.path] = t;
|
|
594
595
|
},
|
|
595
|
-
children: /* @__PURE__ */
|
|
596
|
+
children: /* @__PURE__ */ U(Vt, {
|
|
596
597
|
file: e,
|
|
597
|
-
diff:
|
|
598
|
-
open: !!
|
|
598
|
+
diff: u[e.path] ? t?.(e) : void 0,
|
|
599
|
+
open: !!u[e.path],
|
|
599
600
|
onToggle: () => T(e.path)
|
|
600
601
|
})
|
|
601
602
|
}, e.path))
|
|
602
603
|
})]
|
|
603
604
|
}),
|
|
604
|
-
/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ W("div", {
|
|
605
606
|
className: "gmp-detail-sec",
|
|
606
|
-
children: [/* @__PURE__ */
|
|
607
|
+
children: [/* @__PURE__ */ U("div", {
|
|
607
608
|
className: "sb-head gmp-detail-sechead",
|
|
608
609
|
children: "your annotation"
|
|
609
|
-
}), /* @__PURE__ */
|
|
610
|
+
}), /* @__PURE__ */ W("div", {
|
|
610
611
|
className: "gmp-annot",
|
|
611
612
|
children: [
|
|
612
|
-
r && /* @__PURE__ */
|
|
613
|
+
r && /* @__PURE__ */ W("span", {
|
|
613
614
|
className: "gmp-label-chip gmp-annot-chip",
|
|
614
615
|
children: [
|
|
615
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ U(We, {
|
|
616
617
|
size: 12,
|
|
617
618
|
"aria-hidden": "true"
|
|
618
619
|
}),
|
|
619
620
|
" ",
|
|
620
621
|
r,
|
|
621
|
-
/* @__PURE__ */
|
|
622
|
+
/* @__PURE__ */ U("button", {
|
|
622
623
|
type: "button",
|
|
623
624
|
className: "gmp-annot-x",
|
|
624
625
|
"aria-label": "remove annotation",
|
|
625
626
|
onClick: () => a?.(),
|
|
626
|
-
children: /* @__PURE__ */
|
|
627
|
+
children: /* @__PURE__ */ U(Ke, {
|
|
627
628
|
size: 11,
|
|
628
629
|
"aria-hidden": "true"
|
|
629
630
|
})
|
|
630
631
|
})
|
|
631
632
|
]
|
|
632
633
|
}),
|
|
633
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ W("button", {
|
|
634
635
|
type: "button",
|
|
635
636
|
className: "gmp-annot-add",
|
|
636
|
-
"aria-expanded":
|
|
637
|
-
onClick: () =>
|
|
637
|
+
"aria-expanded": m,
|
|
638
|
+
onClick: () => h((e) => !e),
|
|
638
639
|
children: [
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ U(We, {
|
|
640
641
|
size: 13,
|
|
641
642
|
"aria-hidden": "true"
|
|
642
643
|
}),
|
|
@@ -644,34 +645,34 @@ function bt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
|
|
|
644
645
|
r ? "change label" : "add a label"
|
|
645
646
|
]
|
|
646
647
|
}),
|
|
647
|
-
|
|
648
|
+
m && /* @__PURE__ */ W("form", {
|
|
648
649
|
className: "gmp-annot-pop",
|
|
649
650
|
onSubmit: D,
|
|
650
651
|
children: [
|
|
651
|
-
/* @__PURE__ */
|
|
652
|
+
/* @__PURE__ */ U("span", {
|
|
652
653
|
className: "label",
|
|
653
654
|
children: "user.custom_label"
|
|
654
655
|
}),
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
+
/* @__PURE__ */ U("input", {
|
|
656
657
|
className: "input",
|
|
657
658
|
type: "text",
|
|
658
659
|
autoFocus: !0,
|
|
659
|
-
value:
|
|
660
|
-
onChange: (e) =>
|
|
660
|
+
value: g,
|
|
661
|
+
onChange: (e) => _(e.target.value),
|
|
661
662
|
placeholder: "e.g. good handoff",
|
|
662
663
|
"aria-label": "annotation value"
|
|
663
664
|
}),
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
+
/* @__PURE__ */ W("div", {
|
|
665
666
|
className: "gmp-annot-pop-foot",
|
|
666
|
-
children: [/* @__PURE__ */
|
|
667
|
+
children: [/* @__PURE__ */ U("button", {
|
|
667
668
|
type: "button",
|
|
668
669
|
className: "btn btn-ghost btn-sm",
|
|
669
|
-
onClick: () =>
|
|
670
|
+
onClick: () => h(!1),
|
|
670
671
|
children: "cancel"
|
|
671
|
-
}), /* @__PURE__ */
|
|
672
|
+
}), /* @__PURE__ */ W("button", {
|
|
672
673
|
type: "submit",
|
|
673
674
|
className: "btn btn-primary btn-sm",
|
|
674
|
-
children: [/* @__PURE__ */
|
|
675
|
+
children: [/* @__PURE__ */ U(Te, {
|
|
675
676
|
size: 13,
|
|
676
677
|
"aria-hidden": "true"
|
|
677
678
|
}), " save"]
|
|
@@ -682,42 +683,42 @@ function bt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
|
|
|
682
683
|
]
|
|
683
684
|
})]
|
|
684
685
|
}),
|
|
685
|
-
/* @__PURE__ */
|
|
686
|
+
/* @__PURE__ */ W("div", {
|
|
686
687
|
className: "gmp-exits",
|
|
687
688
|
children: [
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
+
/* @__PURE__ */ W("button", {
|
|
689
690
|
type: "button",
|
|
690
691
|
className: "btn btn-secondary btn-sm",
|
|
691
692
|
onClick: () => o?.(),
|
|
692
|
-
children: [/* @__PURE__ */
|
|
693
|
+
children: [/* @__PURE__ */ U(we, {
|
|
693
694
|
size: 14,
|
|
694
695
|
"aria-hidden": "true"
|
|
695
696
|
}), " see this work on the code map"]
|
|
696
697
|
}),
|
|
697
|
-
/* @__PURE__ */
|
|
698
|
+
/* @__PURE__ */ W("button", {
|
|
698
699
|
type: "button",
|
|
699
700
|
className: "btn btn-secondary btn-sm",
|
|
700
|
-
onClick: () =>
|
|
701
|
+
onClick: () => s?.(),
|
|
701
702
|
children: [
|
|
702
|
-
/* @__PURE__ */
|
|
703
|
+
/* @__PURE__ */ U(Ue, {
|
|
703
704
|
size: 14,
|
|
704
705
|
"aria-hidden": "true"
|
|
705
706
|
}),
|
|
706
707
|
" share ",
|
|
707
|
-
|
|
708
|
+
x,
|
|
708
709
|
" conversations…"
|
|
709
710
|
]
|
|
710
711
|
}),
|
|
711
|
-
/* @__PURE__ */
|
|
712
|
+
/* @__PURE__ */ W("button", {
|
|
712
713
|
type: "button",
|
|
713
714
|
className: "btn btn-secondary btn-sm",
|
|
714
|
-
onClick: () =>
|
|
715
|
-
children: [/* @__PURE__ */
|
|
715
|
+
onClick: () => c?.(),
|
|
716
|
+
children: [/* @__PURE__ */ U(je, {
|
|
716
717
|
size: 14,
|
|
717
718
|
"aria-hidden": "true"
|
|
718
719
|
}), " copy recap"]
|
|
719
720
|
}),
|
|
720
|
-
/* @__PURE__ */
|
|
721
|
+
/* @__PURE__ */ W("code", {
|
|
721
722
|
className: "gmp-gitdiff mono",
|
|
722
723
|
children: [
|
|
723
724
|
"git diff ",
|
|
@@ -728,7 +729,7 @@ function bt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
|
|
|
728
729
|
})
|
|
729
730
|
]
|
|
730
731
|
}),
|
|
731
|
-
/* @__PURE__ */
|
|
732
|
+
/* @__PURE__ */ U("p", {
|
|
732
733
|
className: "gmp-boundary mono",
|
|
733
734
|
children: "shows what changed and the recorded work behind it, not whether the change is correct or secure."
|
|
734
735
|
})
|
|
@@ -737,34 +738,34 @@ function bt({ payload: e, getDiff: t, title: n, annotation: r = "", onSaveAnnota
|
|
|
737
738
|
}
|
|
738
739
|
//#endregion
|
|
739
740
|
//#region src/ui/graph/CodeMap.jsx
|
|
740
|
-
var
|
|
741
|
+
var Ut = Object.freeze({
|
|
741
742
|
project: "overview",
|
|
742
743
|
package: "folders",
|
|
743
744
|
file: "files"
|
|
744
|
-
}),
|
|
745
|
+
}), Wt = Object.freeze({
|
|
745
746
|
overview: "project",
|
|
746
747
|
folders: "package",
|
|
747
748
|
files: "file"
|
|
748
749
|
});
|
|
749
|
-
function
|
|
750
|
-
let g =
|
|
750
|
+
function Gt({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i, onExpand: a, highlightedIds: o, nodeDeltas: s, structureEdgeDeltas: c, height: l = 520, ariaLabel: u = "code map", className: d = "", viewport: f, onViewportChange: p, state: m, onStateChange: h }) {
|
|
751
|
+
let g = B(() => {
|
|
751
752
|
let t = /* @__PURE__ */ new Map();
|
|
752
753
|
for (let n of e?.nodes ?? []) t.set(n.id, n);
|
|
753
754
|
return t;
|
|
754
|
-
}, [e?.nodes]), _ =
|
|
755
|
+
}, [e?.nodes]), _ = B(() => m === void 0 ? null : L(m), [m]), v = B(() => _ ? be(e, _) : null, [e, _]), b = B(() => Kt(e && {
|
|
755
756
|
...e,
|
|
756
757
|
nodes: v?.canvas.allNodes ?? e.nodes
|
|
757
|
-
}), [e, v?.canvas.allNodes]),
|
|
758
|
-
|
|
759
|
-
function
|
|
758
|
+
}), [e, v?.canvas.allNodes]), x = v ? Ut[v.canvas.grain] ?? "folders" : Ut[t?.level ?? "package"], S = v?.canvas.expandedIds ?? t?.expanded, C = V(x);
|
|
759
|
+
C.current = x;
|
|
760
|
+
function w(e) {
|
|
760
761
|
if (!_) return;
|
|
761
|
-
let t =
|
|
762
|
-
|
|
762
|
+
let t = y(_, e);
|
|
763
|
+
D(_, t) || h?.(t);
|
|
763
764
|
}
|
|
764
|
-
return /* @__PURE__ */
|
|
765
|
-
data:
|
|
766
|
-
grain:
|
|
767
|
-
expandedIds:
|
|
765
|
+
return /* @__PURE__ */ U(ie, {
|
|
766
|
+
data: b,
|
|
767
|
+
grain: x,
|
|
768
|
+
expandedIds: S,
|
|
768
769
|
visibleIds: v?.canvas.visibleIds,
|
|
769
770
|
hierarchy: v?.canvas.hierarchy,
|
|
770
771
|
selectedId: v ? v.canvas.selectedId : r,
|
|
@@ -776,14 +777,14 @@ function Ct({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i,
|
|
|
776
777
|
},
|
|
777
778
|
onExpand: a,
|
|
778
779
|
onGrainChange: (e) => {
|
|
779
|
-
|
|
780
|
-
level:
|
|
780
|
+
C.current = e, n?.({
|
|
781
|
+
level: Wt[e] ?? "package",
|
|
781
782
|
expanded: []
|
|
782
783
|
});
|
|
783
784
|
},
|
|
784
785
|
onExpandedIdsChange: (e) => {
|
|
785
786
|
n?.({
|
|
786
|
-
level:
|
|
787
|
+
level: Wt[C.current] ?? "package",
|
|
787
788
|
expanded: e
|
|
788
789
|
});
|
|
789
790
|
},
|
|
@@ -794,20 +795,20 @@ function Ct({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i,
|
|
|
794
795
|
onViewportChange: (e) => {
|
|
795
796
|
p?.(e);
|
|
796
797
|
},
|
|
797
|
-
onStateAction: _ ?
|
|
798
|
+
onStateAction: _ ? w : void 0,
|
|
798
799
|
canonicalControlled: _ !== null
|
|
799
800
|
});
|
|
800
801
|
}
|
|
801
|
-
function
|
|
802
|
-
e &&
|
|
803
|
-
let t = e?.nodes ?? [], n =
|
|
802
|
+
function Kt(e) {
|
|
803
|
+
e && _(e);
|
|
804
|
+
let t = e?.nodes ?? [], n = Jt(e?.violations ?? []);
|
|
804
805
|
return {
|
|
805
806
|
nodes: t.map((e) => ({
|
|
806
807
|
id: e.id,
|
|
807
808
|
label: e.name || e.id,
|
|
808
809
|
kind: e.kind === "file" ? "file" : "folder",
|
|
809
810
|
loc: e.loc ?? 0,
|
|
810
|
-
coverage:
|
|
811
|
+
coverage: qt(e.recordedFiles, e.totalFiles),
|
|
811
812
|
parent: e.parent || void 0,
|
|
812
813
|
violations: n.get(e.id) ?? 0,
|
|
813
814
|
layer: e.layer,
|
|
@@ -821,24 +822,24 @@ function wt(e) {
|
|
|
821
822
|
}))
|
|
822
823
|
};
|
|
823
824
|
}
|
|
824
|
-
function
|
|
825
|
+
function qt(e, t) {
|
|
825
826
|
let n = Number(t) || 0;
|
|
826
827
|
if (n <= 0) return 0;
|
|
827
828
|
let r = Math.max(0, Math.min(1, (Number(e) || 0) / n));
|
|
828
829
|
return Math.max(0, Math.min(4, Math.round(r * 4)));
|
|
829
830
|
}
|
|
830
|
-
function
|
|
831
|
+
function Jt(e) {
|
|
831
832
|
let t = /* @__PURE__ */ new Map();
|
|
832
|
-
for (let n of e)
|
|
833
|
+
for (let n of e) Yt(t, n.from), Yt(t, n.to);
|
|
833
834
|
return t;
|
|
834
835
|
}
|
|
835
|
-
function
|
|
836
|
+
function Yt(e, t) {
|
|
836
837
|
t && e.set(t, (e.get(t) ?? 0) + 1);
|
|
837
838
|
}
|
|
838
839
|
//#endregion
|
|
839
840
|
//#region src/ui/graph/CodeMapNavigator.jsx
|
|
840
|
-
function
|
|
841
|
-
let [p, m] =
|
|
841
|
+
function Xt({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsChange: r, selectedId: i = null, onSelect: a, focusedId: o, onFocusChange: s, filter: c = "", onFilterChange: l, onOpenMap: u, onStateAction: d, ariaLabel: f = "code map navigator" }) {
|
|
842
|
+
let [p, m] = H(() => /* @__PURE__ */ new Set()), [h, g] = H(null), _ = n === void 0 ? p : new Set(n), v = o === void 0 ? h : o, y = V(/* @__PURE__ */ new Map()), b = B(() => be(e, L({
|
|
842
843
|
grain: t,
|
|
843
844
|
expandedIds: Array.from(_),
|
|
844
845
|
selectedId: i,
|
|
@@ -847,7 +848,7 @@ function Ot({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsCha
|
|
|
847
848
|
})), [
|
|
848
849
|
e,
|
|
849
850
|
t,
|
|
850
|
-
|
|
851
|
+
Qt(_),
|
|
851
852
|
i,
|
|
852
853
|
v,
|
|
853
854
|
c
|
|
@@ -890,27 +891,27 @@ function Ot({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsCha
|
|
|
890
891
|
} else return;
|
|
891
892
|
e.preventDefault(), i && O(i);
|
|
892
893
|
}
|
|
893
|
-
return /* @__PURE__ */
|
|
894
|
+
return /* @__PURE__ */ W("section", {
|
|
894
895
|
className: "gmp-navigator",
|
|
895
896
|
"aria-label": f,
|
|
896
897
|
children: [
|
|
897
|
-
/* @__PURE__ */
|
|
898
|
+
/* @__PURE__ */ W("header", {
|
|
898
899
|
className: "gmp-navigator-head",
|
|
899
|
-
children: [/* @__PURE__ */
|
|
900
|
+
children: [/* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
|
|
900
901
|
className: "gmp-navigator-kicker",
|
|
901
902
|
children: "browse the codebase"
|
|
902
|
-
}), /* @__PURE__ */
|
|
903
|
+
}), /* @__PURE__ */ U("p", {
|
|
903
904
|
className: "gmp-navigator-note",
|
|
904
905
|
children: "choose an area for its recorded work, then open the spatial map when relationships matter"
|
|
905
|
-
})] }), /* @__PURE__ */
|
|
906
|
+
})] }), /* @__PURE__ */ W("label", {
|
|
906
907
|
className: "gmp-navigator-search",
|
|
907
908
|
children: [
|
|
908
|
-
/* @__PURE__ */
|
|
909
|
-
/* @__PURE__ */
|
|
909
|
+
/* @__PURE__ */ U(He, { "aria-hidden": "true" }),
|
|
910
|
+
/* @__PURE__ */ U("span", {
|
|
910
911
|
className: "mc-sr",
|
|
911
912
|
children: "filter code areas"
|
|
912
913
|
}),
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
+
/* @__PURE__ */ U("input", {
|
|
914
915
|
value: c,
|
|
915
916
|
onChange: (e) => {
|
|
916
917
|
d?.({
|
|
@@ -923,13 +924,13 @@ function Ot({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsCha
|
|
|
923
924
|
]
|
|
924
925
|
})]
|
|
925
926
|
}),
|
|
926
|
-
b.staleSelectedId ? /* @__PURE__ */
|
|
927
|
+
b.staleSelectedId ? /* @__PURE__ */ W("p", {
|
|
927
928
|
className: "gmp-navigator-missing",
|
|
928
929
|
role: "status",
|
|
929
930
|
children: [
|
|
930
931
|
"the selected code area is not present in this map.",
|
|
931
932
|
" ",
|
|
932
|
-
/* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ U("button", {
|
|
933
934
|
type: "button",
|
|
934
935
|
onClick: () => {
|
|
935
936
|
d?.({ type: "clear-selection" }), a?.(null, null);
|
|
@@ -938,20 +939,20 @@ function Ot({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsCha
|
|
|
938
939
|
})
|
|
939
940
|
]
|
|
940
941
|
}) : null,
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ W("div", {
|
|
942
943
|
className: "gmp-navigator-body",
|
|
943
|
-
children: [/* @__PURE__ */
|
|
944
|
+
children: [/* @__PURE__ */ U("div", {
|
|
944
945
|
role: "tree",
|
|
945
946
|
"aria-label": "code areas",
|
|
946
947
|
className: "gmp-navigator-tree",
|
|
947
948
|
"data-grain": t,
|
|
948
|
-
children: x.length === 0 ? /* @__PURE__ */
|
|
949
|
+
children: x.length === 0 ? /* @__PURE__ */ U("p", {
|
|
949
950
|
className: "gmp-navigator-empty",
|
|
950
951
|
role: "status",
|
|
951
952
|
children: "no code areas match this filter"
|
|
952
953
|
}) : x.map((e, t) => {
|
|
953
954
|
let n = e.canExpand || e.forcedOpen, r = e.expanded, a = S === e.node.id;
|
|
954
|
-
return /* @__PURE__ */
|
|
955
|
+
return /* @__PURE__ */ U(Zt, {
|
|
955
956
|
row: e,
|
|
956
957
|
hasChildren: n,
|
|
957
958
|
isExpanded: r,
|
|
@@ -970,25 +971,25 @@ function Ot({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsCha
|
|
|
970
971
|
onKeyDown: (e) => A(e, t)
|
|
971
972
|
}, e.node.id);
|
|
972
973
|
})
|
|
973
|
-
}), /* @__PURE__ */
|
|
974
|
+
}), /* @__PURE__ */ U("aside", {
|
|
974
975
|
className: "gmp-navigator-actions",
|
|
975
976
|
"aria-label": "selected code area",
|
|
976
|
-
children: C ? /* @__PURE__ */
|
|
977
|
-
/* @__PURE__ */
|
|
977
|
+
children: C ? /* @__PURE__ */ W(Ce, { children: [
|
|
978
|
+
/* @__PURE__ */ U("p", {
|
|
978
979
|
className: "gmp-navigator-selected",
|
|
979
980
|
children: C.name || C.id
|
|
980
981
|
}),
|
|
981
|
-
/* @__PURE__ */
|
|
982
|
+
/* @__PURE__ */ U("p", {
|
|
982
983
|
className: "gmp-navigator-selected-path",
|
|
983
984
|
children: C.id
|
|
984
985
|
}),
|
|
985
|
-
T ? /* @__PURE__ */
|
|
986
|
+
T ? /* @__PURE__ */ W("button", {
|
|
986
987
|
type: "button",
|
|
987
988
|
className: "gmp-navigator-action",
|
|
988
989
|
onClick: () => D(C.id),
|
|
989
|
-
children: [/* @__PURE__ */
|
|
990
|
+
children: [/* @__PURE__ */ U(G, { "aria-hidden": "true" }), _.has(C.id) ? "hide children" : "show children"]
|
|
990
991
|
}) : null,
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
+
/* @__PURE__ */ W("button", {
|
|
992
993
|
type: "button",
|
|
993
994
|
className: "gmp-navigator-action gmp-navigator-action--primary",
|
|
994
995
|
onClick: () => {
|
|
@@ -997,9 +998,9 @@ function Ot({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsCha
|
|
|
997
998
|
id: C.id
|
|
998
999
|
}), u?.(C.id);
|
|
999
1000
|
},
|
|
1000
|
-
children: [/* @__PURE__ */
|
|
1001
|
+
children: [/* @__PURE__ */ U(Fe, { "aria-hidden": "true" }), " open in map"]
|
|
1001
1002
|
})
|
|
1002
|
-
] }) : /* @__PURE__ */
|
|
1003
|
+
] }) : /* @__PURE__ */ U("p", {
|
|
1003
1004
|
className: "gmp-navigator-empty",
|
|
1004
1005
|
children: "select an area to see its recorded work and map context"
|
|
1005
1006
|
})
|
|
@@ -1008,13 +1009,13 @@ function Ot({ payload: e, grain: t = "package", expandedIds: n, onExpandedIdsCha
|
|
|
1008
1009
|
]
|
|
1009
1010
|
});
|
|
1010
1011
|
}
|
|
1011
|
-
function
|
|
1012
|
-
return /* @__PURE__ */
|
|
1012
|
+
function Zt({ row: e, hasChildren: t, isExpanded: n, selected: r, tabbable: i, setRef: a, onFocus: o, onSelect: s, onToggle: c, onKeyDown: l }) {
|
|
1013
|
+
return /* @__PURE__ */ W("div", {
|
|
1013
1014
|
role: "none",
|
|
1014
1015
|
className: "gmp-navigator-row-wrap",
|
|
1015
1016
|
"data-selected": r,
|
|
1016
1017
|
style: { "--gmp-tree-depth": e.depth },
|
|
1017
|
-
children: [t ? /* @__PURE__ */
|
|
1018
|
+
children: [t ? /* @__PURE__ */ U("button", {
|
|
1018
1019
|
type: "button",
|
|
1019
1020
|
className: "gmp-navigator-disclosure",
|
|
1020
1021
|
tabIndex: -1,
|
|
@@ -1025,14 +1026,14 @@ function kt({ row: e, hasChildren: t, isExpanded: n, selected: r, tabbable: i, s
|
|
|
1025
1026
|
onClick: (t) => {
|
|
1026
1027
|
t.stopPropagation(), e.forcedOpen || c();
|
|
1027
1028
|
},
|
|
1028
|
-
children: /* @__PURE__ */
|
|
1029
|
+
children: /* @__PURE__ */ U(G, {
|
|
1029
1030
|
className: "gmp-navigator-chevron",
|
|
1030
1031
|
"aria-hidden": "true"
|
|
1031
1032
|
})
|
|
1032
|
-
}) : /* @__PURE__ */
|
|
1033
|
+
}) : /* @__PURE__ */ U("span", {
|
|
1033
1034
|
className: "gmp-navigator-disclosure-placeholder",
|
|
1034
1035
|
"aria-hidden": "true"
|
|
1035
|
-
}), /* @__PURE__ */
|
|
1036
|
+
}), /* @__PURE__ */ W("div", {
|
|
1036
1037
|
ref: a,
|
|
1037
1038
|
role: "treeitem",
|
|
1038
1039
|
"aria-level": e.depth + 1,
|
|
@@ -1047,77 +1048,77 @@ function kt({ row: e, hasChildren: t, isExpanded: n, selected: r, tabbable: i, s
|
|
|
1047
1048
|
},
|
|
1048
1049
|
onKeyDown: l,
|
|
1049
1050
|
children: [
|
|
1050
|
-
e.node.kind === "file" ? /* @__PURE__ */
|
|
1051
|
-
/* @__PURE__ */
|
|
1051
|
+
e.node.kind === "file" ? /* @__PURE__ */ U(ke, { "aria-hidden": "true" }) : /* @__PURE__ */ U(Me, { "aria-hidden": "true" }),
|
|
1052
|
+
/* @__PURE__ */ U("span", {
|
|
1052
1053
|
className: "gmp-navigator-path",
|
|
1053
1054
|
children: e.node.name || e.node.id
|
|
1054
1055
|
}),
|
|
1055
|
-
/* @__PURE__ */
|
|
1056
|
+
/* @__PURE__ */ W("span", {
|
|
1056
1057
|
className: "gmp-navigator-meta",
|
|
1057
|
-
children: [/* @__PURE__ */
|
|
1058
|
+
children: [/* @__PURE__ */ W("span", { children: [$t(e.node.loc ?? 0), " lines"] }), /* @__PURE__ */ U("span", { children: en(e.node.recordedFiles, e.node.totalFiles) })]
|
|
1058
1059
|
})
|
|
1059
1060
|
]
|
|
1060
1061
|
})]
|
|
1061
1062
|
});
|
|
1062
1063
|
}
|
|
1063
|
-
function
|
|
1064
|
+
function Qt(e) {
|
|
1064
1065
|
return Array.from(e).sort().join("\0");
|
|
1065
1066
|
}
|
|
1066
|
-
function
|
|
1067
|
+
function $t(e) {
|
|
1067
1068
|
return new Intl.NumberFormat("en", {
|
|
1068
1069
|
notation: "compact",
|
|
1069
1070
|
maximumFractionDigits: 1
|
|
1070
1071
|
}).format(Number(e) || 0);
|
|
1071
1072
|
}
|
|
1072
|
-
function
|
|
1073
|
+
function en(e, t) {
|
|
1073
1074
|
let n = Number(t) || 0;
|
|
1074
1075
|
return n <= 0 ? "no coverage data" : `${Math.round((Number(e) || 0) / n * 100)}% recorded`;
|
|
1075
1076
|
}
|
|
1076
1077
|
//#endregion
|
|
1077
1078
|
//#region src/ui/graph/CodeMapComposition.jsx
|
|
1078
|
-
function
|
|
1079
|
-
let
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
]),
|
|
1084
|
-
function F(e, t) {
|
|
1085
|
-
E === void 0 && ee(e), k?.(e), t?.(e);
|
|
1086
|
-
}
|
|
1079
|
+
function tn({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i, onExpand: a, highlightedIds: o, nodeDeltas: s, structureEdgeDeltas: c, height: l = 480, ariaLabel: u = "code map", canvasSlot: d, rail: f, toolbar: p, sheetTitle: m = "code area", sheetMeta: h, railSide: g = "right", legend: _, canvasWrapperClassName: v = "", canvasWrapperStyle: b, className: x = "", presentation: S = "canvas", navigatorSlot: C, onPresentationChange: w, viewport: T, onViewportChange: E, state: O, defaultState: k, onStateChange: A }) {
|
|
1080
|
+
let j = O !== void 0 || k !== void 0, [M, N] = H(() => L(k)), P = B(() => j ? L(O ?? M) : null, [
|
|
1081
|
+
j,
|
|
1082
|
+
O,
|
|
1083
|
+
M
|
|
1084
|
+
]), F = P?.presentation ?? S;
|
|
1087
1085
|
function I(e, t) {
|
|
1088
|
-
|
|
1089
|
-
let n = D(N, e);
|
|
1090
|
-
M(N, n) || F(n, t);
|
|
1086
|
+
O === void 0 && N(e), A?.(e), t?.(e);
|
|
1091
1087
|
}
|
|
1092
|
-
|
|
1088
|
+
function te(e, t) {
|
|
1089
|
+
if (!P) return;
|
|
1090
|
+
let n = y(P, e);
|
|
1091
|
+
D(P, n) || I(n, t);
|
|
1092
|
+
}
|
|
1093
|
+
let ne = j || w ? /* @__PURE__ */ W(Ce, { children: [/* @__PURE__ */ W("div", {
|
|
1093
1094
|
className: "gmp-presentation-switch",
|
|
1094
1095
|
role: "group",
|
|
1095
1096
|
"aria-label": "code map view",
|
|
1096
|
-
children: [/* @__PURE__ */
|
|
1097
|
+
children: [/* @__PURE__ */ U("button", {
|
|
1097
1098
|
type: "button",
|
|
1098
|
-
"aria-pressed":
|
|
1099
|
-
onClick: () =>
|
|
1099
|
+
"aria-pressed": F === "navigator",
|
|
1100
|
+
onClick: () => j ? te({
|
|
1100
1101
|
type: "set-presentation",
|
|
1101
1102
|
presentation: "navigator"
|
|
1102
|
-
}, () =>
|
|
1103
|
-
children:
|
|
1104
|
-
}), /* @__PURE__ */
|
|
1103
|
+
}, () => w?.("navigator")) : w?.("navigator"),
|
|
1104
|
+
children: F === "canvas" ? "back to browse" : "browse"
|
|
1105
|
+
}), /* @__PURE__ */ U("button", {
|
|
1105
1106
|
type: "button",
|
|
1106
|
-
"aria-pressed":
|
|
1107
|
-
onClick: () =>
|
|
1107
|
+
"aria-pressed": F === "canvas",
|
|
1108
|
+
onClick: () => j ? te({
|
|
1108
1109
|
type: "set-presentation",
|
|
1109
1110
|
presentation: "canvas"
|
|
1110
|
-
}, () =>
|
|
1111
|
+
}, () => w?.("canvas")) : w?.("canvas"),
|
|
1111
1112
|
children: "spatial map"
|
|
1112
1113
|
})]
|
|
1113
|
-
}), p] }) : p,
|
|
1114
|
+
}), p] }) : p, re = d ?? /* @__PURE__ */ U(Gt, {
|
|
1114
1115
|
payload: e,
|
|
1115
|
-
zoom:
|
|
1116
|
-
level:
|
|
1117
|
-
expanded:
|
|
1116
|
+
zoom: P ? {
|
|
1117
|
+
level: P.grain,
|
|
1118
|
+
expanded: P.expandedIds
|
|
1118
1119
|
} : t,
|
|
1119
1120
|
onZoomChange: n,
|
|
1120
|
-
selectedId:
|
|
1121
|
+
selectedId: P ? P.selectedId : r,
|
|
1121
1122
|
onSelect: i,
|
|
1122
1123
|
onExpand: a,
|
|
1123
1124
|
highlightedIds: o,
|
|
@@ -1125,76 +1126,76 @@ function Nt({ payload: e, zoom: t, onZoomChange: n, selectedId: r, onSelect: i,
|
|
|
1125
1126
|
structureEdgeDeltas: c,
|
|
1126
1127
|
height: l,
|
|
1127
1128
|
ariaLabel: u,
|
|
1128
|
-
viewport:
|
|
1129
|
-
onViewportChange:
|
|
1130
|
-
state:
|
|
1131
|
-
onStateChange:
|
|
1132
|
-
}),
|
|
1129
|
+
viewport: P ? P.viewport ?? void 0 : T,
|
|
1130
|
+
onViewportChange: E,
|
|
1131
|
+
state: P ?? void 0,
|
|
1132
|
+
onStateChange: P ? (e) => I(e) : void 0
|
|
1133
|
+
}), ie = C ?? (P && e ? /* @__PURE__ */ U(Xt, {
|
|
1133
1134
|
payload: e,
|
|
1134
|
-
grain:
|
|
1135
|
-
expandedIds:
|
|
1136
|
-
selectedId:
|
|
1137
|
-
focusedId:
|
|
1138
|
-
filter:
|
|
1139
|
-
onStateAction: (t) =>
|
|
1135
|
+
grain: P.grain,
|
|
1136
|
+
expandedIds: P.expandedIds,
|
|
1137
|
+
selectedId: P.selectedId,
|
|
1138
|
+
focusedId: P.navigatorFocusedId,
|
|
1139
|
+
filter: P.navigatorFilter,
|
|
1140
|
+
onStateAction: (t) => te(t, () => {
|
|
1140
1141
|
t.type === "select" ? i?.(t.id, e.nodes.find((e) => e.id === t.id) ?? null) : t.type === "clear-selection" ? i?.(null, null) : t.type === "set-expanded" ? n?.({
|
|
1141
|
-
level:
|
|
1142
|
+
level: P.grain,
|
|
1142
1143
|
expanded: Array.from(t.ids)
|
|
1143
|
-
}) : t.type === "open-in-map" && (i?.(t.id, e.nodes.find((e) => e.id === t.id) ?? null),
|
|
1144
|
+
}) : t.type === "open-in-map" && (i?.(t.id, e.nodes.find((e) => e.id === t.id) ?? null), w?.("canvas"));
|
|
1144
1145
|
}),
|
|
1145
1146
|
ariaLabel: `browse ${u}`
|
|
1146
|
-
}) : null),
|
|
1147
|
-
return /* @__PURE__ */
|
|
1148
|
-
className: ["gmp-root",
|
|
1149
|
-
children: /* @__PURE__ */
|
|
1150
|
-
toolbar:
|
|
1147
|
+
}) : null), ae = F === "navigator" && ie !== null;
|
|
1148
|
+
return /* @__PURE__ */ U("div", {
|
|
1149
|
+
className: ["gmp-root", x].filter(Boolean).join(" "),
|
|
1150
|
+
children: /* @__PURE__ */ W(ee, {
|
|
1151
|
+
toolbar: ne,
|
|
1151
1152
|
rail: f,
|
|
1152
1153
|
sheetTitle: m,
|
|
1153
1154
|
sheetMeta: h,
|
|
1154
1155
|
railSide: g,
|
|
1155
|
-
children: [/* @__PURE__ */
|
|
1156
|
+
children: [/* @__PURE__ */ U("div", {
|
|
1156
1157
|
className: ["gmp-map-canvas-region", v].filter(Boolean).join(" "),
|
|
1157
|
-
style:
|
|
1158
|
+
style: b,
|
|
1158
1159
|
"data-testid": "gmp-map-canvas-region",
|
|
1159
|
-
children:
|
|
1160
|
-
}), !
|
|
1160
|
+
children: ae ? ie : re
|
|
1161
|
+
}), !ae && _ !== !1 && (_ ?? /* @__PURE__ */ U(nn, {}))]
|
|
1161
1162
|
})
|
|
1162
1163
|
});
|
|
1163
1164
|
}
|
|
1164
|
-
function
|
|
1165
|
-
return /* @__PURE__ */
|
|
1165
|
+
function nn() {
|
|
1166
|
+
return /* @__PURE__ */ W("p", {
|
|
1166
1167
|
className: "gmp-map-legend",
|
|
1167
1168
|
children: [
|
|
1168
|
-
/* @__PURE__ */
|
|
1169
|
+
/* @__PURE__ */ W("span", {
|
|
1169
1170
|
className: "gmp-legend-item",
|
|
1170
|
-
children: [/* @__PURE__ */
|
|
1171
|
+
children: [/* @__PURE__ */ U("span", {
|
|
1171
1172
|
className: "gmp-map-swatch",
|
|
1172
1173
|
"aria-hidden": "true"
|
|
1173
1174
|
}), " code area (folder or file)"]
|
|
1174
1175
|
}),
|
|
1175
|
-
/* @__PURE__ */
|
|
1176
|
+
/* @__PURE__ */ W("span", {
|
|
1176
1177
|
className: "gmp-legend-item gmp-legend-dim",
|
|
1177
|
-
children: [/* @__PURE__ */
|
|
1178
|
+
children: [/* @__PURE__ */ U("span", {
|
|
1178
1179
|
className: "gmp-map-swatch gmp-map-swatch--empty",
|
|
1179
1180
|
"aria-hidden": "true"
|
|
1180
1181
|
}), " no saved conversation behind it"]
|
|
1181
1182
|
}),
|
|
1182
|
-
/* @__PURE__ */
|
|
1183
|
+
/* @__PURE__ */ U("span", {
|
|
1183
1184
|
className: "gmp-legend-item gmp-legend-dim",
|
|
1184
1185
|
children: "brighter = more of it built with AI on record"
|
|
1185
1186
|
}),
|
|
1186
|
-
/* @__PURE__ */
|
|
1187
|
+
/* @__PURE__ */ W("span", {
|
|
1187
1188
|
className: "gmp-legend-item gmp-legend-dim",
|
|
1188
|
-
children: [/* @__PURE__ */
|
|
1189
|
+
children: [/* @__PURE__ */ U("span", {
|
|
1189
1190
|
className: "gmp-map-swatch gmp-map-swatch--edge",
|
|
1190
1191
|
"aria-hidden": "true"
|
|
1191
1192
|
}), " one area uses another"]
|
|
1192
1193
|
}),
|
|
1193
|
-
/* @__PURE__ */
|
|
1194
|
+
/* @__PURE__ */ U("span", {
|
|
1194
1195
|
className: "gmp-legend-item gmp-map-legend-danger",
|
|
1195
1196
|
children: "⚠ tangle — two areas that depend on each other"
|
|
1196
1197
|
}),
|
|
1197
|
-
/* @__PURE__ */
|
|
1198
|
+
/* @__PURE__ */ U("span", {
|
|
1198
1199
|
className: "gmp-legend-item gmp-legend-dim",
|
|
1199
1200
|
children: "double-click a folder to open its files"
|
|
1200
1201
|
})
|
|
@@ -1203,26 +1204,26 @@ function Pt() {
|
|
|
1203
1204
|
}
|
|
1204
1205
|
//#endregion
|
|
1205
1206
|
//#region src/ui/graph/timelineNavigation.js
|
|
1206
|
-
function
|
|
1207
|
+
function Y(e) {
|
|
1207
1208
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1208
1209
|
}
|
|
1209
|
-
function
|
|
1210
|
+
function X(e, t) {
|
|
1210
1211
|
let n = Object.keys(e).sort();
|
|
1211
1212
|
return n.length === t.length && t.slice().sort().every((e, t) => e === n[t]);
|
|
1212
1213
|
}
|
|
1213
|
-
function
|
|
1214
|
+
function rn(e) {
|
|
1214
1215
|
return typeof e == "string" && e.length > 0;
|
|
1215
1216
|
}
|
|
1216
|
-
function
|
|
1217
|
-
return e === null ||
|
|
1217
|
+
function an(e) {
|
|
1218
|
+
return e === null || rn(e);
|
|
1218
1219
|
}
|
|
1219
|
-
function
|
|
1220
|
+
function on(e) {
|
|
1220
1221
|
let t = !1;
|
|
1221
|
-
if (
|
|
1222
|
+
if (Y(e) && typeof e.type == "string" && (e.type === "open-change" && X(e, ["type", "change"]) && Y(e.change) ? t = X(e.change, ["id", "branch"]) && rn(e.change.id) && an(e.change.branch) : e.type === "open-session" && X(e, [
|
|
1222
1223
|
"type",
|
|
1223
1224
|
"sessionId",
|
|
1224
1225
|
"source"
|
|
1225
|
-
]) &&
|
|
1226
|
+
]) && rn(e.sessionId) && Y(e.source) ? e.source.kind === "commit" && X(e.source, ["kind", "commit"]) && Y(e.source.commit) ? t = X(e.source.commit, ["id", "branch"]) && rn(e.source.commit.id) && an(e.source.commit.branch) : (e.source.kind === "unlinked" || e.source.kind === "outside-window") && X(e.source, ["kind"]) && (t = !0) : (e.type === "open-map" || e.type === "show-older") && X(e, ["type"]) && (t = !0)), !t) throw TypeError([
|
|
1226
1227
|
"Timeline navigation action rejected.",
|
|
1227
1228
|
"What went wrong: the value is not an exact supported TimelineNavigationAction.",
|
|
1228
1229
|
"Why it happened: an untyped caller supplied an unknown action, missing context, or extra fields.",
|
|
@@ -1234,32 +1235,32 @@ function It(e) {
|
|
|
1234
1235
|
}
|
|
1235
1236
|
//#endregion
|
|
1236
1237
|
//#region src/ui/graph/ScentTag.jsx
|
|
1237
|
-
function
|
|
1238
|
-
if (!
|
|
1239
|
-
return
|
|
1238
|
+
function sn({ tag: e, hoverText: n, active: r = !1, onToggle: i, className: a = "", ...o }) {
|
|
1239
|
+
if (!t.includes(e)) throw Error(`ScentTag render failed: what went wrong: unknown scent tag ${JSON.stringify(e)}; why: the value is not a member of the closed SCENT_TAGS set; where: src/ui/graph/ScentTag.jsx; when: rendering a ranked-list row; what it means: an upstream ranking derivation produced a value outside the frozen vocabulary; how to fix: only pass one of ${t.join(", ")}.`);
|
|
1240
|
+
return i ? /* @__PURE__ */ W("button", {
|
|
1240
1241
|
type: "button",
|
|
1241
|
-
className: `tlp-scent tlp-scent-filter${
|
|
1242
|
-
title:
|
|
1243
|
-
"aria-pressed":
|
|
1244
|
-
onClick: () => r
|
|
1245
|
-
...
|
|
1246
|
-
children: [e, /* @__PURE__ */
|
|
1242
|
+
className: `tlp-scent tlp-scent-filter${r ? " tlp-scent-filter-active" : ""}${a ? ` ${a}` : ""}`,
|
|
1243
|
+
title: n || void 0,
|
|
1244
|
+
"aria-pressed": r,
|
|
1245
|
+
onClick: () => i(r ? null : e),
|
|
1246
|
+
...o,
|
|
1247
|
+
children: [e, /* @__PURE__ */ U("span", {
|
|
1247
1248
|
className: "tlp-sr",
|
|
1248
1249
|
role: "status",
|
|
1249
1250
|
"aria-live": "polite",
|
|
1250
|
-
children:
|
|
1251
|
+
children: r ? `filtering by ${e}` : ""
|
|
1251
1252
|
})]
|
|
1252
|
-
}) : /* @__PURE__ */
|
|
1253
|
-
className: `tlp-scent${
|
|
1254
|
-
title:
|
|
1255
|
-
...
|
|
1253
|
+
}) : /* @__PURE__ */ U("span", {
|
|
1254
|
+
className: `tlp-scent${a ? ` ${a}` : ""}`,
|
|
1255
|
+
title: n || void 0,
|
|
1256
|
+
...o,
|
|
1256
1257
|
children: e
|
|
1257
1258
|
});
|
|
1258
1259
|
}
|
|
1259
1260
|
//#endregion
|
|
1260
1261
|
//#region src/ui/graph/RankedRow.jsx
|
|
1261
|
-
function
|
|
1262
|
-
return /* @__PURE__ */
|
|
1262
|
+
function cn({ row: e, loc: t = 0, selected: n = !1, onSelect: r, className: i = "", ...a }) {
|
|
1263
|
+
return /* @__PURE__ */ W("button", {
|
|
1263
1264
|
type: "button",
|
|
1264
1265
|
className: [
|
|
1265
1266
|
"tlp-ranked-row",
|
|
@@ -1270,9 +1271,9 @@ function Rt({ row: e, loc: t = 0, selected: n = !1, onSelect: r, className: i =
|
|
|
1270
1271
|
onClick: () => r?.(e.id),
|
|
1271
1272
|
...a,
|
|
1272
1273
|
children: [
|
|
1273
|
-
/* @__PURE__ */
|
|
1274
|
+
/* @__PURE__ */ U(le, {
|
|
1274
1275
|
className: "tlp-ranked-doi-scope",
|
|
1275
|
-
children: /* @__PURE__ */
|
|
1276
|
+
children: /* @__PURE__ */ U(F, {
|
|
1276
1277
|
label: e.name,
|
|
1277
1278
|
loc: t,
|
|
1278
1279
|
recorded: e.doi,
|
|
@@ -1282,20 +1283,20 @@ function Rt({ row: e, loc: t = 0, selected: n = !1, onSelect: r, className: i =
|
|
|
1282
1283
|
className: "tlp-ranked-doi"
|
|
1283
1284
|
})
|
|
1284
1285
|
}),
|
|
1285
|
-
/* @__PURE__ */
|
|
1286
|
+
/* @__PURE__ */ U("span", {
|
|
1286
1287
|
className: "tlp-ranked-name",
|
|
1287
1288
|
title: e.name,
|
|
1288
1289
|
children: e.name
|
|
1289
1290
|
}),
|
|
1290
|
-
/* @__PURE__ */
|
|
1291
|
+
/* @__PURE__ */ U("span", {
|
|
1291
1292
|
className: "tlp-ranked-tags",
|
|
1292
1293
|
"aria-label": "comprehension signals",
|
|
1293
|
-
children: e.scentTags.map((t) => /* @__PURE__ */
|
|
1294
|
+
children: e.scentTags.map((t) => /* @__PURE__ */ U(sn, {
|
|
1294
1295
|
tag: t,
|
|
1295
1296
|
hoverText: t.startsWith("agent wrote:") ? e.hoverText ?? void 0 : void 0
|
|
1296
1297
|
}, t))
|
|
1297
1298
|
}),
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
+
/* @__PURE__ */ U("span", {
|
|
1299
1300
|
className: "tlp-ranked-doi-val tnum",
|
|
1300
1301
|
"aria-hidden": "true",
|
|
1301
1302
|
children: e.doi.toFixed(2)
|
|
@@ -1305,42 +1306,42 @@ function Rt({ row: e, loc: t = 0, selected: n = !1, onSelect: r, className: i =
|
|
|
1305
1306
|
}
|
|
1306
1307
|
//#endregion
|
|
1307
1308
|
//#region src/ui/graph/RankModeControl.jsx
|
|
1308
|
-
var
|
|
1309
|
+
var Z = [
|
|
1309
1310
|
"relevance",
|
|
1310
1311
|
"debt",
|
|
1311
1312
|
"churn"
|
|
1312
1313
|
];
|
|
1313
|
-
function
|
|
1314
|
-
let i =
|
|
1315
|
-
let n =
|
|
1314
|
+
function ln({ rankMode: e, onChange: t, className: n = "", ...r }) {
|
|
1315
|
+
let i = V([]), a = (e) => {
|
|
1316
|
+
let n = Z[e];
|
|
1316
1317
|
n && (t(n), i.current[e]?.focus());
|
|
1317
1318
|
}, o = (e, t) => {
|
|
1318
1319
|
let n;
|
|
1319
1320
|
switch (e.key) {
|
|
1320
1321
|
case "ArrowRight":
|
|
1321
1322
|
case "ArrowDown":
|
|
1322
|
-
n = (t + 1) %
|
|
1323
|
+
n = (t + 1) % Z.length;
|
|
1323
1324
|
break;
|
|
1324
1325
|
case "ArrowLeft":
|
|
1325
1326
|
case "ArrowUp":
|
|
1326
|
-
n = (t - 1 +
|
|
1327
|
+
n = (t - 1 + Z.length) % Z.length;
|
|
1327
1328
|
break;
|
|
1328
1329
|
case "Home":
|
|
1329
1330
|
n = 0;
|
|
1330
1331
|
break;
|
|
1331
1332
|
case "End":
|
|
1332
|
-
n =
|
|
1333
|
+
n = Z.length - 1;
|
|
1333
1334
|
break;
|
|
1334
1335
|
default: return;
|
|
1335
1336
|
}
|
|
1336
1337
|
e.preventDefault(), a(n);
|
|
1337
1338
|
};
|
|
1338
|
-
return /* @__PURE__ */
|
|
1339
|
+
return /* @__PURE__ */ W("span", {
|
|
1339
1340
|
className: `tlp-rank-mode${n ? ` ${n}` : ""}`,
|
|
1340
1341
|
role: "radiogroup",
|
|
1341
1342
|
"aria-label": "rank mode",
|
|
1342
1343
|
...r,
|
|
1343
|
-
children: [
|
|
1344
|
+
children: [Z.map((n, r) => /* @__PURE__ */ U("button", {
|
|
1344
1345
|
type: "button",
|
|
1345
1346
|
role: "radio",
|
|
1346
1347
|
"aria-checked": e === n,
|
|
@@ -1352,7 +1353,7 @@ function zt({ rankMode: e, onChange: t, className: n = "", ...r }) {
|
|
|
1352
1353
|
onClick: () => t(n),
|
|
1353
1354
|
onKeyDown: (e) => o(e, r),
|
|
1354
1355
|
children: n
|
|
1355
|
-
}, n)), /* @__PURE__ */
|
|
1356
|
+
}, n)), /* @__PURE__ */ U("span", {
|
|
1356
1357
|
className: "tlp-sr",
|
|
1357
1358
|
role: "status",
|
|
1358
1359
|
"aria-live": "polite",
|
|
@@ -1362,8 +1363,8 @@ function zt({ rankMode: e, onChange: t, className: n = "", ...r }) {
|
|
|
1362
1363
|
}
|
|
1363
1364
|
//#endregion
|
|
1364
1365
|
//#region src/ui/graph/InsightPanel.jsx
|
|
1365
|
-
function
|
|
1366
|
-
if (
|
|
1366
|
+
function un({ insights: e, onOpenEvidence: t, className: n = "", ...r }) {
|
|
1367
|
+
if (C(e), e.length === 0) return /* @__PURE__ */ U("p", {
|
|
1367
1368
|
className: `tlp-insight-empty${n ? ` ${n}` : ""}`,
|
|
1368
1369
|
...r,
|
|
1369
1370
|
children: "no insights recorded for this node yet."
|
|
@@ -1373,35 +1374,35 @@ function Bt({ insights: e, onOpenEvidence: t, className: n = "", ...r }) {
|
|
|
1373
1374
|
let e = i.get(t.kind) ?? [];
|
|
1374
1375
|
e.push(t), i.set(t.kind, e);
|
|
1375
1376
|
}
|
|
1376
|
-
return /* @__PURE__ */
|
|
1377
|
+
return /* @__PURE__ */ U("div", {
|
|
1377
1378
|
className: `tlp-insight-panel${n ? ` ${n}` : ""}`,
|
|
1378
1379
|
...r,
|
|
1379
|
-
children: [...i.entries()].map(([e, n]) => /* @__PURE__ */
|
|
1380
|
+
children: [...i.entries()].map(([e, n]) => /* @__PURE__ */ W("section", {
|
|
1380
1381
|
className: "tlp-insight-group",
|
|
1381
|
-
"aria-label":
|
|
1382
|
-
children: [/* @__PURE__ */
|
|
1382
|
+
"aria-label": c[e],
|
|
1383
|
+
children: [/* @__PURE__ */ U("h3", {
|
|
1383
1384
|
className: "tlp-insight-group-title",
|
|
1384
|
-
children:
|
|
1385
|
-
}), /* @__PURE__ */
|
|
1385
|
+
children: c[e]
|
|
1386
|
+
}), /* @__PURE__ */ U("ul", {
|
|
1386
1387
|
className: "tlp-insight-list",
|
|
1387
|
-
children: n.map((e, n) => /* @__PURE__ */
|
|
1388
|
+
children: n.map((e, n) => /* @__PURE__ */ W("li", {
|
|
1388
1389
|
className: "tlp-insight-item",
|
|
1389
1390
|
children: [
|
|
1390
|
-
/* @__PURE__ */
|
|
1391
|
-
className: `tlp-insight-provenance ${
|
|
1391
|
+
/* @__PURE__ */ U("span", {
|
|
1392
|
+
className: `tlp-insight-provenance ${x[e.provenance].markerClass}`,
|
|
1392
1393
|
"aria-hidden": "true"
|
|
1393
1394
|
}),
|
|
1394
|
-
/* @__PURE__ */
|
|
1395
|
+
/* @__PURE__ */ U("span", {
|
|
1395
1396
|
className: "tlp-insight-title",
|
|
1396
1397
|
children: e.title
|
|
1397
1398
|
}),
|
|
1398
|
-
e.summary && /* @__PURE__ */
|
|
1399
|
+
e.summary && /* @__PURE__ */ U("span", {
|
|
1399
1400
|
className: "tlp-insight-summary",
|
|
1400
1401
|
children: e.summary
|
|
1401
1402
|
}),
|
|
1402
|
-
/* @__PURE__ */
|
|
1403
|
+
/* @__PURE__ */ U("span", {
|
|
1403
1404
|
className: "tlp-insight-evidence",
|
|
1404
|
-
children: e.evidence.map((e, n) => /* @__PURE__ */
|
|
1405
|
+
children: e.evidence.map((e, n) => /* @__PURE__ */ U("button", {
|
|
1405
1406
|
type: "button",
|
|
1406
1407
|
className: "tlp-insight-evidence-link",
|
|
1407
1408
|
onClick: () => t?.(e.sessionId),
|
|
@@ -1415,4 +1416,565 @@ function Bt({ insights: e, onOpenEvidence: t, className: n = "", ...r }) {
|
|
|
1415
1416
|
});
|
|
1416
1417
|
}
|
|
1417
1418
|
//#endregion
|
|
1418
|
-
|
|
1419
|
+
//#region src/ui/transcript/graph/engine/constants.js
|
|
1420
|
+
var Q = Object.freeze({
|
|
1421
|
+
turnWidth: 320,
|
|
1422
|
+
turnBaseHeight: 120,
|
|
1423
|
+
toolCallWidth: 200,
|
|
1424
|
+
toolCallHeight: 48,
|
|
1425
|
+
laneGap: 40,
|
|
1426
|
+
verticalGap: 24,
|
|
1427
|
+
toolSideGap: 24,
|
|
1428
|
+
subagentIndent: 48,
|
|
1429
|
+
phasePadding: 12
|
|
1430
|
+
}), $ = Object.freeze({
|
|
1431
|
+
sequentialColor: "var(--edge)",
|
|
1432
|
+
sequentialColorDark: "var(--edge)",
|
|
1433
|
+
sequentialWidth: 1.5,
|
|
1434
|
+
phaseTransitionWidth: 2,
|
|
1435
|
+
subagentSpawnColor: "var(--edge)",
|
|
1436
|
+
subagentReturnColor: "var(--edge)",
|
|
1437
|
+
errorColor: "var(--edge-error)"
|
|
1438
|
+
}), dn = {
|
|
1439
|
+
planning: "var(--edge)",
|
|
1440
|
+
exploration: "var(--edge)",
|
|
1441
|
+
implementation: "var(--edge)",
|
|
1442
|
+
testing: "var(--edge)",
|
|
1443
|
+
error: "var(--edge-error)",
|
|
1444
|
+
debug: "var(--edge)",
|
|
1445
|
+
"retry-loop": "var(--edge-error)",
|
|
1446
|
+
"user-correction": "var(--edge)",
|
|
1447
|
+
recovery: "var(--edge)",
|
|
1448
|
+
abandonment: "var(--edge)"
|
|
1449
|
+
};
|
|
1450
|
+
function fn(e) {
|
|
1451
|
+
let t = /* @__PURE__ */ new Map();
|
|
1452
|
+
for (let n of e) {
|
|
1453
|
+
let e = t.get(n.turnIndex) ?? [];
|
|
1454
|
+
e.push(n), t.set(n.turnIndex, e);
|
|
1455
|
+
}
|
|
1456
|
+
return t;
|
|
1457
|
+
}
|
|
1458
|
+
function pn(e) {
|
|
1459
|
+
let t = /* @__PURE__ */ new Map();
|
|
1460
|
+
for (let n of e) for (let e = n.startTurn; e <= n.endTurn; e++) t.set(e, n.type);
|
|
1461
|
+
return t;
|
|
1462
|
+
}
|
|
1463
|
+
function mn({ turns: e, toolVMsByTurn: t, phases: n, annotations: r, searchMatches: i, filteredIndices: a, searchQuery: o, selectedTurns: s }) {
|
|
1464
|
+
let c = fn(r), l = pn(n), u = new Set(i), d = [], f = [], p = 0, m = 0, h = null, g, _ = 0, v = !1;
|
|
1465
|
+
for (let n = 0; n < e.length; n++) {
|
|
1466
|
+
let r = e[n], i = !!r.content?.trim(), y = (r.toolCalls?.length ?? 0) > 0;
|
|
1467
|
+
if (!i && !y || r.role === "system" && !y && (!r.content || r.content.trim().length < 8)) continue;
|
|
1468
|
+
let b = r.depth ?? 0, x = l.get(n), S = c.get(n) ?? [], C = u.has(n), w = a.size > 0 && !a.has(n);
|
|
1469
|
+
m += (r.tokensIn ?? 0) + (r.tokensOut ?? 0);
|
|
1470
|
+
let T = b * Q.subagentIndent, E = p, D = `turn-${r.index}`, O = {
|
|
1471
|
+
turn: r,
|
|
1472
|
+
annotations: S,
|
|
1473
|
+
phaseType: x,
|
|
1474
|
+
isSearchMatch: C,
|
|
1475
|
+
isFilteredOut: w,
|
|
1476
|
+
isSelected: s?.has(r.index) ?? !1,
|
|
1477
|
+
turnNumber: r.index + 1,
|
|
1478
|
+
tokensCumulative: m,
|
|
1479
|
+
searchQuery: C ? o : void 0
|
|
1480
|
+
};
|
|
1481
|
+
d.push({
|
|
1482
|
+
id: D,
|
|
1483
|
+
type: "turn",
|
|
1484
|
+
position: {
|
|
1485
|
+
x: T,
|
|
1486
|
+
y: E
|
|
1487
|
+
},
|
|
1488
|
+
data: O,
|
|
1489
|
+
style: { width: Q.turnWidth }
|
|
1490
|
+
});
|
|
1491
|
+
let k = r.toolCalls ?? [];
|
|
1492
|
+
if (k.length > 0) {
|
|
1493
|
+
let e = `tools-${r.index}`, n = k.reduce((e, t) => e + (t.durationMs ?? 0), 0), i = k.some((e) => e.isError || e.exitCode !== void 0 && e.exitCode !== 0), a = {};
|
|
1494
|
+
for (let e of t?.get(r.index) ?? []) a[e.id] = e.preview;
|
|
1495
|
+
let o = {
|
|
1496
|
+
turnIndex: r.index,
|
|
1497
|
+
toolCalls: k,
|
|
1498
|
+
previewById: a,
|
|
1499
|
+
totalDurationMs: n,
|
|
1500
|
+
hasError: i,
|
|
1501
|
+
isFilteredOut: w,
|
|
1502
|
+
phaseType: x
|
|
1503
|
+
}, s = T + Q.turnWidth + Q.toolSideGap, c = E + (Q.turnBaseHeight - Q.toolCallHeight) / 2;
|
|
1504
|
+
d.push({
|
|
1505
|
+
id: e,
|
|
1506
|
+
type: "toolCall",
|
|
1507
|
+
position: {
|
|
1508
|
+
x: s,
|
|
1509
|
+
y: c
|
|
1510
|
+
},
|
|
1511
|
+
data: o,
|
|
1512
|
+
style: { width: Q.toolCallWidth }
|
|
1513
|
+
}), f.push({
|
|
1514
|
+
id: `e-${D}-${e}`,
|
|
1515
|
+
source: D,
|
|
1516
|
+
sourceHandle: "tool-source",
|
|
1517
|
+
target: e,
|
|
1518
|
+
targetHandle: "tool-target",
|
|
1519
|
+
type: "straight",
|
|
1520
|
+
style: {
|
|
1521
|
+
stroke: "var(--edge)",
|
|
1522
|
+
strokeWidth: 1,
|
|
1523
|
+
strokeDasharray: "4 4",
|
|
1524
|
+
...w ? { opacity: .2 } : {}
|
|
1525
|
+
},
|
|
1526
|
+
data: { edgeType: "turn-to-tool" }
|
|
1527
|
+
});
|
|
1528
|
+
}
|
|
1529
|
+
if (h) {
|
|
1530
|
+
let e = x !== g && x !== void 0, t = b !== _, n = "sequential", r = $.sequentialColor, i = $.sequentialWidth, a;
|
|
1531
|
+
t && b > _ ? (n = "spawn", r = $.subagentSpawnColor, i = 2, a = "6 4") : t && b < _ ? (n = "return", r = $.subagentReturnColor, i = 1.5, a = "2 3") : e && x && (n = "phase-transition", r = dn[x] ?? $.sequentialColor, i = $.phaseTransitionWidth), S.some((e) => e.type === "error") && (n = "error", r = $.errorColor, i = 2);
|
|
1532
|
+
let o = w || v;
|
|
1533
|
+
f.push({
|
|
1534
|
+
id: `e-${h}-${D}`,
|
|
1535
|
+
source: h,
|
|
1536
|
+
target: D,
|
|
1537
|
+
type: "smoothstep",
|
|
1538
|
+
animated: n === "error" && !o,
|
|
1539
|
+
style: {
|
|
1540
|
+
stroke: r,
|
|
1541
|
+
strokeWidth: i,
|
|
1542
|
+
...a ? { strokeDasharray: a } : {},
|
|
1543
|
+
...o ? { opacity: .15 } : {}
|
|
1544
|
+
},
|
|
1545
|
+
data: {
|
|
1546
|
+
edgeType: n,
|
|
1547
|
+
phaseColor: x ? dn[x] : void 0
|
|
1548
|
+
}
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1551
|
+
p = E + Q.turnBaseHeight + Q.verticalGap, h = D, g = x, _ = b, v = w;
|
|
1552
|
+
}
|
|
1553
|
+
return {
|
|
1554
|
+
nodes: d,
|
|
1555
|
+
edges: f
|
|
1556
|
+
};
|
|
1557
|
+
}
|
|
1558
|
+
function hn(e) {
|
|
1559
|
+
let t = /* @__PURE__ */ new Map();
|
|
1560
|
+
for (let n of e) {
|
|
1561
|
+
if (n.type !== "turn") continue;
|
|
1562
|
+
let e = n.data, r = e.turn.depth ?? 0;
|
|
1563
|
+
if (r === 0) continue;
|
|
1564
|
+
let i = t.get(r);
|
|
1565
|
+
(!i || n.position.y < i.minY) && t.set(r, {
|
|
1566
|
+
agentName: e.turn.agentName ?? `Agent ${r}`,
|
|
1567
|
+
x: n.position.x,
|
|
1568
|
+
minY: n.position.y
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
let n = [];
|
|
1572
|
+
for (let [e, { agentName: r, x: i, minY: a }] of t) n.push({
|
|
1573
|
+
id: `lane-header-${e}`,
|
|
1574
|
+
type: "subagentLane",
|
|
1575
|
+
position: {
|
|
1576
|
+
x: i,
|
|
1577
|
+
y: a - 32
|
|
1578
|
+
},
|
|
1579
|
+
data: {
|
|
1580
|
+
depth: e,
|
|
1581
|
+
agentName: r
|
|
1582
|
+
},
|
|
1583
|
+
selectable: !1,
|
|
1584
|
+
draggable: !1
|
|
1585
|
+
});
|
|
1586
|
+
return n;
|
|
1587
|
+
}
|
|
1588
|
+
//#endregion
|
|
1589
|
+
//#region src/ui/transcript/graph/engine/useCanvasSync.js
|
|
1590
|
+
function gn(e, t, n) {
|
|
1591
|
+
let r = Dt();
|
|
1592
|
+
return {
|
|
1593
|
+
focusPhase: R((i) => {
|
|
1594
|
+
let a = e[i];
|
|
1595
|
+
if (!a) return;
|
|
1596
|
+
let o = /* @__PURE__ */ new Set();
|
|
1597
|
+
for (let e = a.startTurn; e <= a.endTurn; e++) t[e] && o.add(t[e].index);
|
|
1598
|
+
let s = r.getNodes().filter((e) => {
|
|
1599
|
+
if (e.type !== "turn") return !1;
|
|
1600
|
+
let t = e.data;
|
|
1601
|
+
return o.has(t.turn.index);
|
|
1602
|
+
});
|
|
1603
|
+
if (s.length === 0) return;
|
|
1604
|
+
let c = Infinity, l = Infinity, u = -Infinity, d = -Infinity;
|
|
1605
|
+
for (let e of s) c = Math.min(c, e.position.x), l = Math.min(l, e.position.y), u = Math.max(u, e.position.x + Q.turnWidth), d = Math.max(d, e.position.y + Q.turnBaseHeight);
|
|
1606
|
+
r.fitBounds({
|
|
1607
|
+
x: c - 20,
|
|
1608
|
+
y: l - 20,
|
|
1609
|
+
width: u - c + 40,
|
|
1610
|
+
height: d - l + 40
|
|
1611
|
+
}, {
|
|
1612
|
+
padding: .1,
|
|
1613
|
+
duration: 400
|
|
1614
|
+
}), n?.(i);
|
|
1615
|
+
}, [
|
|
1616
|
+
e,
|
|
1617
|
+
t,
|
|
1618
|
+
r,
|
|
1619
|
+
n
|
|
1620
|
+
]),
|
|
1621
|
+
focusTurn: R((e) => {
|
|
1622
|
+
let n = t[e]?.index ?? e, i = r.getNodes().find((e) => e.type === "turn" && e.data.turn.index === n);
|
|
1623
|
+
i && r.setCenter(i.position.x + Q.turnWidth / 2, i.position.y + Q.turnBaseHeight / 2, {
|
|
1624
|
+
zoom: 1,
|
|
1625
|
+
duration: 300
|
|
1626
|
+
});
|
|
1627
|
+
}, [r, t])
|
|
1628
|
+
};
|
|
1629
|
+
}
|
|
1630
|
+
//#endregion
|
|
1631
|
+
//#region src/ui/transcript/graph/engine/nodes/TurnCardNode.jsx
|
|
1632
|
+
function _n(e, t) {
|
|
1633
|
+
if (!e) return "";
|
|
1634
|
+
let n = e.replace(/\s+/g, " ").trim();
|
|
1635
|
+
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
1636
|
+
}
|
|
1637
|
+
function vn({ data: e, selected: t }) {
|
|
1638
|
+
let { turn: n, annotations: r, isSearchMatch: i, isFilteredOut: a, isSelected: o, turnNumber: s, provider: c } = e, l = n.depth ?? 0, u = n.role === "assistant" && l > 0, d = r.some((e) => e.type === "error"), f = r.some((e) => e.type === "retry"), p = r.some((e) => e.type === "revert");
|
|
1639
|
+
return /* @__PURE__ */ W("div", {
|
|
1640
|
+
"data-turn-index": n.index,
|
|
1641
|
+
"data-harness": u ? void 0 : n.role === "assistant" ? c : void 0,
|
|
1642
|
+
style: { width: Q.turnWidth },
|
|
1643
|
+
children: [
|
|
1644
|
+
/* @__PURE__ */ U(K, {
|
|
1645
|
+
type: "target",
|
|
1646
|
+
position: q.Top,
|
|
1647
|
+
className: "tb-gnode-handle tb-gnode-handle-top"
|
|
1648
|
+
}),
|
|
1649
|
+
/* @__PURE__ */ U(O, {
|
|
1650
|
+
role: n.role,
|
|
1651
|
+
agentName: u ? n.agentName : void 0,
|
|
1652
|
+
turnNumber: s,
|
|
1653
|
+
contentPreview: _n(n.content, 160),
|
|
1654
|
+
toolCount: n.toolCalls?.length ?? 0,
|
|
1655
|
+
totalTokens: (n.tokensIn ?? 0) + (n.tokensOut ?? 0),
|
|
1656
|
+
tokensIn: n.tokensIn ?? void 0,
|
|
1657
|
+
tokensOut: n.tokensOut ?? void 0,
|
|
1658
|
+
hasError: d,
|
|
1659
|
+
hasRetry: f,
|
|
1660
|
+
hasRevert: p,
|
|
1661
|
+
isSearchMatch: i,
|
|
1662
|
+
isFilteredOut: a,
|
|
1663
|
+
isSelected: t || o,
|
|
1664
|
+
provider: c
|
|
1665
|
+
}),
|
|
1666
|
+
/* @__PURE__ */ U(K, {
|
|
1667
|
+
type: "source",
|
|
1668
|
+
position: q.Bottom,
|
|
1669
|
+
className: "tb-gnode-handle tb-gnode-handle-bottom"
|
|
1670
|
+
}),
|
|
1671
|
+
/* @__PURE__ */ U(K, {
|
|
1672
|
+
type: "source",
|
|
1673
|
+
id: "tool-source",
|
|
1674
|
+
position: q.Right,
|
|
1675
|
+
className: "tb-gnode-handle tb-gnode-handle-right"
|
|
1676
|
+
})
|
|
1677
|
+
]
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
1680
|
+
var yn = Se(vn);
|
|
1681
|
+
//#endregion
|
|
1682
|
+
//#region src/ui/transcript/graph/engine/nodes/ToolPillNode.jsx
|
|
1683
|
+
function bn({ data: e }) {
|
|
1684
|
+
let { toolCalls: t, previewById: n, totalDurationMs: r, hasError: i, isFilteredOut: a } = e, o = t.map((e) => ({
|
|
1685
|
+
id: e.id,
|
|
1686
|
+
name: e.name,
|
|
1687
|
+
kind: e.toolKind,
|
|
1688
|
+
filePath: e.filePath,
|
|
1689
|
+
isError: e.isError,
|
|
1690
|
+
exitCode: e.exitCode ?? void 0,
|
|
1691
|
+
preview: n[e.id] ?? ""
|
|
1692
|
+
}));
|
|
1693
|
+
return /* @__PURE__ */ W("div", {
|
|
1694
|
+
style: { width: Q.toolCallWidth },
|
|
1695
|
+
children: [/* @__PURE__ */ U(K, {
|
|
1696
|
+
type: "target",
|
|
1697
|
+
id: "tool-target",
|
|
1698
|
+
position: q.Left,
|
|
1699
|
+
className: "tb-gnode-handle tb-gnode-handle-left"
|
|
1700
|
+
}), /* @__PURE__ */ U(I, {
|
|
1701
|
+
tools: o,
|
|
1702
|
+
totalDurationMs: r,
|
|
1703
|
+
hasError: i,
|
|
1704
|
+
isFilteredOut: a
|
|
1705
|
+
})]
|
|
1706
|
+
});
|
|
1707
|
+
}
|
|
1708
|
+
var xn = Se(bn);
|
|
1709
|
+
//#endregion
|
|
1710
|
+
//#region src/ui/transcript/graph/engine/nodes/SubagentBranchNode.jsx
|
|
1711
|
+
function Sn({ data: e }) {
|
|
1712
|
+
let { agentName: t, depth: n } = e;
|
|
1713
|
+
return /* @__PURE__ */ U(de, {
|
|
1714
|
+
agentName: t,
|
|
1715
|
+
depth: n
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
var Cn = Se(Sn);
|
|
1719
|
+
//#endregion
|
|
1720
|
+
//#region src/ui/transcript/graph/engine/GraphControls.jsx
|
|
1721
|
+
function wn({ className: e = "" }) {
|
|
1722
|
+
let t = Dt();
|
|
1723
|
+
return /* @__PURE__ */ W("div", {
|
|
1724
|
+
className: ["tb-graph-controls", e].filter(Boolean).join(" "),
|
|
1725
|
+
children: [
|
|
1726
|
+
/* @__PURE__ */ U(Tn, {
|
|
1727
|
+
label: "zoom in",
|
|
1728
|
+
onClick: () => t.zoomIn({ duration: 150 }),
|
|
1729
|
+
children: /* @__PURE__ */ U(ze, {
|
|
1730
|
+
size: 12,
|
|
1731
|
+
strokeWidth: 2
|
|
1732
|
+
})
|
|
1733
|
+
}),
|
|
1734
|
+
/* @__PURE__ */ U(Tn, {
|
|
1735
|
+
label: "zoom out",
|
|
1736
|
+
onClick: () => t.zoomOut({ duration: 150 }),
|
|
1737
|
+
children: /* @__PURE__ */ U(Re, {
|
|
1738
|
+
size: 12,
|
|
1739
|
+
strokeWidth: 2
|
|
1740
|
+
})
|
|
1741
|
+
}),
|
|
1742
|
+
/* @__PURE__ */ U(Tn, {
|
|
1743
|
+
label: "fit view",
|
|
1744
|
+
onClick: () => t.fitView({
|
|
1745
|
+
padding: .1,
|
|
1746
|
+
duration: 250
|
|
1747
|
+
}),
|
|
1748
|
+
children: /* @__PURE__ */ U(Ie, {
|
|
1749
|
+
size: 11,
|
|
1750
|
+
strokeWidth: 1.75
|
|
1751
|
+
})
|
|
1752
|
+
}),
|
|
1753
|
+
/* @__PURE__ */ U(Tn, {
|
|
1754
|
+
label: "reset",
|
|
1755
|
+
onClick: () => t.setViewport({
|
|
1756
|
+
x: 0,
|
|
1757
|
+
y: 0,
|
|
1758
|
+
zoom: 1
|
|
1759
|
+
}, { duration: 200 }),
|
|
1760
|
+
children: /* @__PURE__ */ U(Be, {
|
|
1761
|
+
size: 11,
|
|
1762
|
+
strokeWidth: 1.75
|
|
1763
|
+
})
|
|
1764
|
+
})
|
|
1765
|
+
]
|
|
1766
|
+
});
|
|
1767
|
+
}
|
|
1768
|
+
function Tn({ label: e, onClick: t, children: n }) {
|
|
1769
|
+
return /* @__PURE__ */ U("button", {
|
|
1770
|
+
type: "button",
|
|
1771
|
+
onClick: t,
|
|
1772
|
+
"aria-label": e,
|
|
1773
|
+
title: e,
|
|
1774
|
+
className: "tb-graph-controls-btn",
|
|
1775
|
+
children: n
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
1778
|
+
//#endregion
|
|
1779
|
+
//#region src/ui/transcript/graph/engine/TrajectoryGraphLegend.jsx
|
|
1780
|
+
function En({ provider: e, className: t = "" }) {
|
|
1781
|
+
let n = e && ye(e).toLocaleLowerCase("en-US") || "agent";
|
|
1782
|
+
return /* @__PURE__ */ U(ae, {
|
|
1783
|
+
className: ["tb-graph-legend", t].filter(Boolean).join(" "),
|
|
1784
|
+
items: [
|
|
1785
|
+
{
|
|
1786
|
+
kind: "user",
|
|
1787
|
+
label: "you"
|
|
1788
|
+
},
|
|
1789
|
+
{
|
|
1790
|
+
kind: "assistant",
|
|
1791
|
+
label: n,
|
|
1792
|
+
provider: e
|
|
1793
|
+
},
|
|
1794
|
+
{
|
|
1795
|
+
kind: "subagent",
|
|
1796
|
+
label: "subagent"
|
|
1797
|
+
},
|
|
1798
|
+
{
|
|
1799
|
+
kind: "tool",
|
|
1800
|
+
label: "tool"
|
|
1801
|
+
},
|
|
1802
|
+
{
|
|
1803
|
+
kind: "error",
|
|
1804
|
+
label: "error"
|
|
1805
|
+
}
|
|
1806
|
+
]
|
|
1807
|
+
});
|
|
1808
|
+
}
|
|
1809
|
+
//#endregion
|
|
1810
|
+
//#region src/ui/transcript/graph/engine/TrajectoryGraph.jsx
|
|
1811
|
+
var Dn = {
|
|
1812
|
+
turn: yn,
|
|
1813
|
+
toolCall: xn,
|
|
1814
|
+
subagentLane: Cn
|
|
1815
|
+
};
|
|
1816
|
+
function On(e) {
|
|
1817
|
+
return /* @__PURE__ */ U(wt, { children: /* @__PURE__ */ U(kn, { ...e }) });
|
|
1818
|
+
}
|
|
1819
|
+
function kn({ turns: e, toolVMsByTurn: t, filteredTurns: n, phases: r, annotations: i, searchMatches: a, searchQuery: o, activeMatchIndex: s, focusTurn: c, focusPhase: l, onPhaseActivate: u, onViewportChange: d, selectedTurns: f, provider: p, className: m = "" }) {
|
|
1820
|
+
let h = Dt(), { focusTurn: g, focusPhase: _ } = gn(r, e, u), v = B(() => {
|
|
1821
|
+
if (n.length === e.length) return /* @__PURE__ */ new Set();
|
|
1822
|
+
let t = new Set(n), r = /* @__PURE__ */ new Set();
|
|
1823
|
+
for (let n = 0; n < e.length; n++) t.has(e[n]) && r.add(n);
|
|
1824
|
+
return r;
|
|
1825
|
+
}, [e, n]), y = B(() => mn({
|
|
1826
|
+
turns: e,
|
|
1827
|
+
toolVMsByTurn: t,
|
|
1828
|
+
phases: r,
|
|
1829
|
+
annotations: i,
|
|
1830
|
+
searchMatches: a,
|
|
1831
|
+
filteredIndices: v,
|
|
1832
|
+
searchQuery: o,
|
|
1833
|
+
selectedTurns: f
|
|
1834
|
+
}), [
|
|
1835
|
+
e,
|
|
1836
|
+
t,
|
|
1837
|
+
r,
|
|
1838
|
+
i,
|
|
1839
|
+
a,
|
|
1840
|
+
v,
|
|
1841
|
+
o,
|
|
1842
|
+
f
|
|
1843
|
+
]), b = B(() => y.nodes.map((e) => e.type === "turn" ? {
|
|
1844
|
+
...e,
|
|
1845
|
+
data: {
|
|
1846
|
+
...e.data,
|
|
1847
|
+
provider: p
|
|
1848
|
+
}
|
|
1849
|
+
} : e), [y.nodes, p]), x = B(() => hn(b), [b]), S = B(() => y.edges.map((e) => {
|
|
1850
|
+
let t = e.sourceHandle === "tool-source";
|
|
1851
|
+
return {
|
|
1852
|
+
...e,
|
|
1853
|
+
style: {
|
|
1854
|
+
...e.style,
|
|
1855
|
+
...t ? {
|
|
1856
|
+
stroke: "var(--edge)",
|
|
1857
|
+
strokeWidth: 1
|
|
1858
|
+
} : {}
|
|
1859
|
+
},
|
|
1860
|
+
animated: t ? !1 : e.animated
|
|
1861
|
+
};
|
|
1862
|
+
}), [y.edges]), C = B(() => [...x, ...b], [x, b]), [w, T, E] = Et(C), [D, O, k] = Tt(S), A = V(e.length), j = V(o), M = V(n.length);
|
|
1863
|
+
z(() => {
|
|
1864
|
+
(e.length !== A.current || o !== j.current || n.length !== M.current) && (T(C), O(S), A.current = e.length, j.current = o, M.current = n.length);
|
|
1865
|
+
}, [
|
|
1866
|
+
C,
|
|
1867
|
+
S,
|
|
1868
|
+
e.length,
|
|
1869
|
+
o,
|
|
1870
|
+
n.length,
|
|
1871
|
+
T,
|
|
1872
|
+
O
|
|
1873
|
+
]), z(() => {
|
|
1874
|
+
if (s === void 0) return;
|
|
1875
|
+
let t = e[s]?.index;
|
|
1876
|
+
if (t === void 0) return;
|
|
1877
|
+
let n = w.find((e) => e.type === "turn" && e.data.turn.index === t);
|
|
1878
|
+
n && h.setCenter(n.position.x + Q.turnWidth / 2, n.position.y + Q.turnBaseHeight / 2, {
|
|
1879
|
+
zoom: 1,
|
|
1880
|
+
duration: 350
|
|
1881
|
+
});
|
|
1882
|
+
}, [
|
|
1883
|
+
s,
|
|
1884
|
+
w,
|
|
1885
|
+
h,
|
|
1886
|
+
e
|
|
1887
|
+
]);
|
|
1888
|
+
let ee = V(-1);
|
|
1889
|
+
z(() => {
|
|
1890
|
+
!c || c.seq === ee.current || (ee.current = c.seq, g(c.target));
|
|
1891
|
+
}, [c, g]);
|
|
1892
|
+
let N = V(-1);
|
|
1893
|
+
z(() => {
|
|
1894
|
+
!l || l.seq === N.current || (N.current = l.seq, _(l.target));
|
|
1895
|
+
}, [l, _]);
|
|
1896
|
+
let P = V(!1);
|
|
1897
|
+
z(() => {
|
|
1898
|
+
w.length > 0 && !P.current && (P.current = !0, setTimeout(() => {
|
|
1899
|
+
let e = w.find((e) => e.type === "turn");
|
|
1900
|
+
e ? h.setCenter(e.position.x + Q.turnWidth / 2, e.position.y + Q.turnBaseHeight, {
|
|
1901
|
+
zoom: 1.05,
|
|
1902
|
+
duration: 300
|
|
1903
|
+
}) : h.fitView({
|
|
1904
|
+
padding: .1,
|
|
1905
|
+
duration: 300
|
|
1906
|
+
});
|
|
1907
|
+
}, 100));
|
|
1908
|
+
}, [
|
|
1909
|
+
w.length,
|
|
1910
|
+
h,
|
|
1911
|
+
w
|
|
1912
|
+
]);
|
|
1913
|
+
let F = R((e) => {
|
|
1914
|
+
if (e.type === "turn") {
|
|
1915
|
+
let t = e.data;
|
|
1916
|
+
return t.annotations?.some?.((e) => e.type === "error") ? "var(--danger)" : t.isFilteredOut ? "var(--rule)" : t.turn.role === "user" ? "var(--teal)" : t.turn.role === "assistant" ? "var(--amber)" : "var(--ink-2)";
|
|
1917
|
+
}
|
|
1918
|
+
return e.type === "toolCall" ? "var(--ink-3)" : "var(--rule)";
|
|
1919
|
+
}, []), I = R((e, t) => {
|
|
1920
|
+
if (t.type !== "turn") return;
|
|
1921
|
+
let n = t.data;
|
|
1922
|
+
d?.({
|
|
1923
|
+
start: n.turn.index,
|
|
1924
|
+
end: n.turn.index
|
|
1925
|
+
});
|
|
1926
|
+
}, [d]);
|
|
1927
|
+
return /* @__PURE__ */ U("div", {
|
|
1928
|
+
className: [
|
|
1929
|
+
"tb-root",
|
|
1930
|
+
"tb-graph",
|
|
1931
|
+
m
|
|
1932
|
+
].filter(Boolean).join(" "),
|
|
1933
|
+
children: /* @__PURE__ */ W("div", {
|
|
1934
|
+
className: "tb-graph-flow",
|
|
1935
|
+
children: [
|
|
1936
|
+
/* @__PURE__ */ W(Ct, {
|
|
1937
|
+
nodes: w,
|
|
1938
|
+
edges: D,
|
|
1939
|
+
onNodesChange: E,
|
|
1940
|
+
onEdgesChange: k,
|
|
1941
|
+
onNodeClick: I,
|
|
1942
|
+
nodeTypes: Dn,
|
|
1943
|
+
fitView: !1,
|
|
1944
|
+
minZoom: .2,
|
|
1945
|
+
maxZoom: 2,
|
|
1946
|
+
defaultEdgeOptions: { style: {
|
|
1947
|
+
stroke: $.sequentialColor,
|
|
1948
|
+
strokeWidth: $.sequentialWidth
|
|
1949
|
+
} },
|
|
1950
|
+
proOptions: { hideAttribution: !0 },
|
|
1951
|
+
nodesDraggable: !1,
|
|
1952
|
+
nodesConnectable: !1,
|
|
1953
|
+
edgesFocusable: !1,
|
|
1954
|
+
selectNodesOnDrag: !1,
|
|
1955
|
+
panOnDrag: !0,
|
|
1956
|
+
panOnScroll: !0,
|
|
1957
|
+
zoomOnScroll: !0,
|
|
1958
|
+
children: [/* @__PURE__ */ U(bt, {
|
|
1959
|
+
variant: xt.Dots,
|
|
1960
|
+
gap: 20,
|
|
1961
|
+
size: 1,
|
|
1962
|
+
color: "var(--rule)"
|
|
1963
|
+
}), /* @__PURE__ */ U(St, {
|
|
1964
|
+
zoomable: !0,
|
|
1965
|
+
pannable: !0,
|
|
1966
|
+
nodeColor: F,
|
|
1967
|
+
nodeStrokeColor: "var(--rule)",
|
|
1968
|
+
nodeBorderRadius: 0,
|
|
1969
|
+
maskColor: "color-mix(in srgb, var(--canvas) 70%, transparent)",
|
|
1970
|
+
className: "tb-graph-minimap"
|
|
1971
|
+
})]
|
|
1972
|
+
}),
|
|
1973
|
+
/* @__PURE__ */ U(wn, {}),
|
|
1974
|
+
/* @__PURE__ */ U(En, { provider: p })
|
|
1975
|
+
]
|
|
1976
|
+
})
|
|
1977
|
+
});
|
|
1978
|
+
}
|
|
1979
|
+
//#endregion
|
|
1980
|
+
export { qe as AllChangeBindings, Je as AllDiffLineKinds, Ye as AllEdgeViolationKinds, Xe as AllFileChangeStatuses, Ze as AllInsightKinds, Qe as AllInsightProvenances, $e as AllMapNodeKinds, et as AllReadAttributionStates, tt as AllReadStateGrades, s as CHANGE_BINDINGS, P as CODE_MAP_STATE_VERSION, N as CODE_MAP_VIEWPORT_SCALE, _e as COVERAGE_CAP, nt as ChangeBinding, Ht as ChangeDetail, Pt as Changes, Gt as CodeMap, tn as CodeMapComposition, Xt as CodeMapNavigator, b as DEBT_VIEWED, d as DIFF_LINE_KINDS, a as DOI_WEIGHTS, nn as DefaultMapLegend, rt as DiffLineKind, $ as EDGE_DEFAULTS, ue as EDGE_VIOLATION_KINDS, it as EdgeViolationKind, u as FILE_CHANGE_STATUSES, at as FileChangeStatus, se as GRAPH_APP_SECTIONS, me as GRAPH_LEGEND_ITEMS, ce as GhostCommitNode, te as GhostGroup, pe as GraphAppShell, wn as GraphControls, ae as GraphLegend, j as GraphSectionNav, de as GraphSubagentBranch, I as GraphToolNode, O as GraphTurnNode, oe as HighlightEdge, ot as InsightKind, un as InsightPanel, st as InsightProvenance, T as MAP_NODE_KINDS, ct as MapNodeKind, Q as NODE_DIMENSIONS, i as RANK_CAP, h as RANK_FLOOR, re as RECENCY_HALF_LIFE_DAYS, ln as RankModeControl, cn as RankedRow, lt as ReadAttributionState, ut as ReadStateGrade, t as SCENT_TAGS, sn as ScentTag, k as SessionLane, fe as SessionOverflowDisclosure, Cn as SubagentBranchNode, xn as ToolPillNode, he as TouchedFileCluster, On as TrajectoryGraph, En as TrajectoryGraphLegend, yn as TurnCardNode, w as assertChangeDetailPayloadEnums, E as assertChangeDiffPayloadEnums, _ as assertCodeMapPayloadEnums, on as assertTimelineNavigationAction, Mt as buildChangesGraph, Kt as codeMapPayloadToMapData, D as codeMapStatesEqual, hn as computeLaneHeaders, ne as coverage, L as createCodeMapState, p as debt, m as debtHoverText, g as debtState, be as deriveCodeMapView, o as deriveRankedRows, A as deriveTimelineHighlight, l as gateRankedRows, J as humanizeAge, f as hunkClears, dt as isChangeBinding, ve as isCodeMapViewportScale, ft as isDiffLineKind, pt as isEdgeViolationKind, mt as isFileChangeStatus, ht as isInsightKind, gt as isInsightProvenance, _t as isMapNodeKind, vt as isReadAttributionState, yt as isReadStateGrade, v as partialReadHoverText, xe as rankMapNodes, n as rankMapNodesIntrinsic, y as reduceCodeMapState, r as resolveEscapeAction, S as scentTagsFor, mn as turnsToFlow, gn as useCanvasSync };
|