@burdenoff/microfe-atheletebridge 2026.1024.1 → 2026.1031.1

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.
Files changed (27) hide show
  1. package/dist/atheletebridge/components/ai/DecisionCard.d.ts.map +1 -1
  2. package/dist/atheletebridge/components/ai/DecisionCard.js +217 -122
  3. package/dist/atheletebridge/components/ai/DecisionCard.js.map +1 -1
  4. package/dist/atheletebridge/components/ai/SubjectDecisions.d.ts +29 -0
  5. package/dist/atheletebridge/components/ai/SubjectDecisions.d.ts.map +1 -0
  6. package/dist/atheletebridge/components/ai/SubjectDecisions.js +69 -0
  7. package/dist/atheletebridge/components/ai/SubjectDecisions.js.map +1 -0
  8. package/dist/atheletebridge/components/ai/index.d.ts +2 -0
  9. package/dist/atheletebridge/components/ai/index.d.ts.map +1 -1
  10. package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts +10 -1
  11. package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts.map +1 -1
  12. package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +24 -15
  13. package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
  14. package/dist/atheletebridge/pages/athletes/AthleteProfilePage.d.ts.map +1 -1
  15. package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js +135 -118
  16. package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js.map +1 -1
  17. package/dist/atheletebridge/pages/programs/ProgramDetailPage.d.ts.map +1 -1
  18. package/dist/atheletebridge/pages/programs/ProgramDetailPage.js +42 -34
  19. package/dist/atheletebridge/pages/programs/ProgramDetailPage.js.map +1 -1
  20. package/dist/atheletebridge/pages/teams/TeamDetailPage.d.ts.map +1 -1
  21. package/dist/atheletebridge/pages/teams/TeamDetailPage.js +65 -57
  22. package/dist/atheletebridge/pages/teams/TeamDetailPage.js.map +1 -1
  23. package/dist/atheletebridge/utils/aiDecision.d.ts +12 -0
  24. package/dist/atheletebridge/utils/aiDecision.d.ts.map +1 -1
  25. package/dist/atheletebridge/utils/aiDecision.js +11 -1
  26. package/dist/atheletebridge/utils/aiDecision.js.map +1 -1
  27. package/package.json +5 -4
@@ -1 +1 @@
1
- {"version":3,"file":"DecisionCard.d.ts","sourceRoot":"","sources":["../../../../src/atheletebridge/components/ai/DecisionCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAYH,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAC;AAqBhE,UAAU,iBAAiB;IACzB,GAAG,EAAE,WAAW,CAAC;IACjB,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6LD,wBAAgB,YAAY,CAAC,EAAE,GAAG,EAAE,SAAiB,EAAE,SAAS,EAAE,EAAE,iBAAiB,+BAwLpF"}
1
+ {"version":3,"file":"DecisionCard.d.ts","sourceRoot":"","sources":["../../../../src/atheletebridge/components/ai/DecisionCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAYH,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAC;AAuBhE,UAAU,iBAAiB;IACzB,GAAG,EAAE,WAAW,CAAC;IACjB,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuSD,wBAAgB,YAAY,CAAC,EAAE,GAAG,EAAE,SAAiB,EAAE,SAAS,EAAE,EAAE,iBAAiB,+BAwMpF"}
@@ -5,20 +5,20 @@ import { useOverrideAgentRun as r, useProgramAiState as i, usePrograms as a } fr
5
5
  import { timeAgo as o } from "../../utils/timeAgo.js";
6
6
  import { FormField as s, fieldInputClass as c } from "../form.js";
7
7
  import { AiErrorNotice as l } from "./AiErrorNotice.js";
8
- import { formatConfidence as u, formatLoadChange as d, isRecord as f, programIdFromInputRefs as p, summarizeDecision as m, toProvenanceEntries as h } from "../../utils/aiDecision.js";
9
- import { ADJUSTMENT_STATUS_LABELS as g, ASSESSMENT_DESCRIPTIONS as _, ASSESSMENT_LABELS as v, ASSESSMENT_OPTIONS as y, ASSESSMENT_VARIANT as b } from "./assessment.js";
10
- import { useState as x } from "react";
11
- import { AlertTriangle as S, Check as C, FileSearch as w, Gavel as T, Loader2 as E } from "lucide-react";
12
- import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
13
- import { Badge as A, GlassCard as j } from "@burdenoff/fe-libs/ui";
8
+ import { formatConfidence as u, formatLoadChange as d, isRecord as f, programIdFromInputRefs as p, proposalStateFor as m, summarizeDecision as h, toProvenanceEntries as g } from "../../utils/aiDecision.js";
9
+ import { ADJUSTMENT_STATUS_LABELS as _, ASSESSMENT_DESCRIPTIONS as v, ASSESSMENT_LABELS as y, ASSESSMENT_OPTIONS as b, ASSESSMENT_VARIANT as x } from "./assessment.js";
10
+ import { useState as S } from "react";
11
+ import { AlertTriangle as C, Check as w, FileSearch as T, Gavel as E, Loader2 as D, Sparkles as O, X as k } from "lucide-react";
12
+ import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
13
+ import { Badge as N, GlassCard as P } from "@burdenoff/fe-libs/ui";
14
14
  //#region src/atheletebridge/components/ai/DecisionCard.tsx
15
- function M({ programId: e }) {
15
+ function F({ programId: e }) {
16
16
  let n = i(e);
17
- if (n.isLoading) return /* @__PURE__ */ k("p", {
17
+ if (n.isLoading) return /* @__PURE__ */ M("p", {
18
18
  className: "inline-flex items-center gap-1.5 text-xs text-text-muted",
19
- children: [/* @__PURE__ */ O(E, { className: "h-3 w-3 animate-spin" }), " Loading program state…"]
19
+ children: [/* @__PURE__ */ j(D, { className: "h-3 w-3 animate-spin" }), " Loading program state…"]
20
20
  });
21
- if (n.isError || !n.data) return /* @__PURE__ */ k("p", {
21
+ if (n.isError || !n.data) return /* @__PURE__ */ M("p", {
22
22
  className: "text-xs text-text-muted",
23
23
  children: [
24
24
  "Program ",
@@ -27,167 +27,253 @@ function M({ programId: e }) {
27
27
  ]
28
28
  });
29
29
  let r = n.data.context, a = f(r) ? r.lastAiAdjustment : null, o = f(a) && typeof a.status == "string" ? a.status : null, s = f(a) && typeof a.agentRunId == "string" ? a.agentRunId : null;
30
- return /* @__PURE__ */ k("div", {
30
+ return /* @__PURE__ */ M("div", {
31
31
  className: "flex flex-wrap items-center gap-2 text-xs text-text-secondary",
32
32
  children: [
33
- /* @__PURE__ */ O("span", {
33
+ /* @__PURE__ */ j("span", {
34
34
  className: "font-medium text-text-primary",
35
35
  children: n.data.name
36
36
  }),
37
- /* @__PURE__ */ O(t, { status: n.data.status }),
38
- o ? /* @__PURE__ */ k(D, { children: [
39
- /* @__PURE__ */ O("span", { children: "·" }),
40
- /* @__PURE__ */ O("span", { children: g[o] ?? o }),
41
- s && /* @__PURE__ */ O("span", {
37
+ /* @__PURE__ */ j(t, { status: n.data.status }),
38
+ o ? /* @__PURE__ */ M(A, { children: [
39
+ /* @__PURE__ */ j("span", { children: "·" }),
40
+ /* @__PURE__ */ j("span", { children: _[o] ?? o }),
41
+ s && /* @__PURE__ */ j("span", {
42
42
  className: "font-mono text-text-muted",
43
43
  children: s
44
44
  })
45
- ] }) : /* @__PURE__ */ O("span", {
45
+ ] }) : /* @__PURE__ */ j("span", {
46
46
  className: "text-text-muted",
47
47
  children: "· no AI adjustment recorded on this program"
48
48
  })
49
49
  ]
50
50
  });
51
51
  }
52
- function N({ run: e, knownProgramId: t, onCancel: n, onSuccess: i }) {
53
- let o = r(), u = a({ pagination: { limit: 100 } }), [d, f] = x(t ?? ""), [p, m] = x("MAINTAIN"), [h, g] = x(""), [b, S] = x(null);
54
- return /* @__PURE__ */ k("form", {
52
+ function I({ run: e, knownProgramId: t, initialAssessment: n = "MAINTAIN", onCancel: i, onSuccess: o }) {
53
+ let u = r(), d = a({ pagination: { limit: 100 } }), [f, p] = S(t ?? ""), [m, h] = S(n), [g, _] = S(""), [x, C] = S(null);
54
+ return /* @__PURE__ */ M("form", {
55
55
  onSubmit: (t) => {
56
- if (t.preventDefault(), S(null), !d) {
57
- S("Choose the program this decision concerns.");
56
+ if (t.preventDefault(), C(null), !f) {
57
+ C("Choose the program this decision concerns.");
58
58
  return;
59
59
  }
60
- if (!h.trim()) {
61
- S("A note is required — it is the record of why you decided this.");
60
+ if (!g.trim()) {
61
+ C("A note is required — it is the record of why you decided this.");
62
62
  return;
63
63
  }
64
- o.mutate({
64
+ u.mutate({
65
65
  runId: e.id,
66
- programId: d,
67
- assessment: p,
68
- note: h.trim()
66
+ programId: f,
67
+ assessment: m,
68
+ note: g.trim()
69
69
  }, { onSuccess: () => {
70
- g(""), i();
70
+ _(""), o();
71
71
  } });
72
72
  },
73
73
  className: "mt-4 space-y-4 border-t border-border-seam pt-4",
74
74
  children: [
75
- /* @__PURE__ */ O("p", {
75
+ /* @__PURE__ */ j("p", {
76
76
  className: "text-xs text-text-secondary",
77
77
  children: "Your decision is appended to the ledger as a new run that supersedes this one — the original is never edited. Filing the same call the AI made records it as accepted; a different one records it as overridden."
78
78
  }),
79
- t ? /* @__PURE__ */ O(s, {
79
+ t ? /* @__PURE__ */ j(s, {
80
80
  label: "Program",
81
81
  hint: "Taken from this run's provenance.",
82
- children: /* @__PURE__ */ O("input", {
82
+ children: /* @__PURE__ */ j("input", {
83
83
  className: c,
84
84
  value: t,
85
85
  readOnly: !0,
86
86
  "aria-label": "Program this decision concerns"
87
87
  })
88
- }) : /* @__PURE__ */ O(s, {
88
+ }) : /* @__PURE__ */ j(s, {
89
89
  label: "Program",
90
90
  htmlFor: `override-program-${e.id}`,
91
91
  required: !0,
92
92
  hint: "This run predates its program, so pick the one it produced. A program the run never touched is rejected.",
93
- children: /* @__PURE__ */ k("select", {
93
+ children: /* @__PURE__ */ M("select", {
94
94
  id: `override-program-${e.id}`,
95
95
  className: c,
96
- value: d,
97
- onChange: (e) => f(e.target.value),
98
- children: [/* @__PURE__ */ O("option", {
96
+ value: f,
97
+ onChange: (e) => p(e.target.value),
98
+ children: [/* @__PURE__ */ j("option", {
99
99
  value: "",
100
100
  children: "Select a program…"
101
- }), (u.data?.items ?? []).map((e) => /* @__PURE__ */ O("option", {
101
+ }), (d.data?.items ?? []).map((e) => /* @__PURE__ */ j("option", {
102
102
  value: e.id,
103
103
  children: e.name
104
104
  }, e.id))]
105
105
  })
106
106
  }),
107
- /* @__PURE__ */ O(s, {
107
+ /* @__PURE__ */ j(s, {
108
108
  label: "Your assessment",
109
109
  htmlFor: `override-assessment-${e.id}`,
110
110
  required: !0,
111
- hint: _[p],
112
- children: /* @__PURE__ */ O("select", {
111
+ hint: v[m],
112
+ children: /* @__PURE__ */ j("select", {
113
113
  id: `override-assessment-${e.id}`,
114
114
  className: c,
115
- value: p,
116
- onChange: (e) => m(e.target.value),
117
- children: y.map((e) => /* @__PURE__ */ O("option", {
115
+ value: m,
116
+ onChange: (e) => h(e.target.value),
117
+ children: b.map((e) => /* @__PURE__ */ j("option", {
118
118
  value: e,
119
- children: v[e]
119
+ children: y[e]
120
120
  }, e))
121
121
  })
122
122
  }),
123
- /* @__PURE__ */ O(s, {
123
+ /* @__PURE__ */ j(s, {
124
124
  label: "Note",
125
125
  htmlFor: `override-note-${e.id}`,
126
126
  required: !0,
127
- children: /* @__PURE__ */ O("textarea", {
127
+ children: /* @__PURE__ */ j("textarea", {
128
128
  id: `override-note-${e.id}`,
129
129
  className: c,
130
130
  rows: 3,
131
- value: h,
131
+ value: g,
132
132
  maxLength: 1e3,
133
- onChange: (e) => g(e.target.value),
133
+ onChange: (e) => _(e.target.value),
134
134
  placeholder: "Why this call — what you saw that the model did not."
135
135
  })
136
136
  }),
137
- b && /* @__PURE__ */ O("p", {
137
+ x && /* @__PURE__ */ j("p", {
138
138
  className: "text-sm text-status-error-text",
139
- children: b
139
+ children: x
140
140
  }),
141
- o.isError && /* @__PURE__ */ O(l, { error: o.error }),
142
- /* @__PURE__ */ k("div", {
141
+ u.isError && /* @__PURE__ */ j(l, { error: u.error }),
142
+ /* @__PURE__ */ M("div", {
143
143
  className: "flex items-center justify-end gap-2",
144
- children: [/* @__PURE__ */ O("button", {
144
+ children: [/* @__PURE__ */ j("button", {
145
145
  type: "button",
146
- onClick: n,
146
+ onClick: i,
147
147
  className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
148
148
  children: "Cancel"
149
- }), /* @__PURE__ */ k("button", {
149
+ }), /* @__PURE__ */ M("button", {
150
150
  type: "submit",
151
- disabled: o.isPending,
151
+ disabled: u.isPending,
152
152
  className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-60",
153
- children: [o.isPending ? /* @__PURE__ */ O(E, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ O(T, { className: "h-4 w-4" }), "File decision"]
153
+ children: [u.isPending ? /* @__PURE__ */ j(D, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ j(E, { className: "h-4 w-4" }), "File decision"]
154
154
  })]
155
155
  })
156
156
  ]
157
157
  });
158
158
  }
159
- function P({ run: r, isFocused: i = !1, className: a }) {
160
- let [s, c] = x(!1), [l, f] = x(!1), _ = m(r.decision), y = h(r.inputRefs), E = p(r.inputRefs), D = u(_.confidence), P = d(_.recommendedWeeklyLoadChangePct), F = r.status === "FAILED", I = F || _.isFailure;
161
- return /* @__PURE__ */ k(j, {
159
+ var L = {
160
+ accepted: "A coach accepted this proposal.",
161
+ overridden: "A coach overrode this proposal.",
162
+ superseded: "A later decision has replaced this one on the program.",
163
+ unknown: null
164
+ };
165
+ function R({ run: e, programId: t, proposed: n, onOverride: a, onDone: o }) {
166
+ let s = i(t), c = r();
167
+ if (s.isLoading) return /* @__PURE__ */ M("p", {
168
+ className: "inline-flex items-center gap-1.5 text-xs text-text-muted",
169
+ children: [/* @__PURE__ */ j(D, { className: "h-3 w-3 animate-spin" }), " Checking whether this proposal is still open…"]
170
+ });
171
+ let u = m(e.id, s.data?.context);
172
+ if (u !== "pending") {
173
+ let e = L[u];
174
+ return e ? /* @__PURE__ */ M("p", {
175
+ className: "inline-flex items-center gap-1.5 text-sm text-text-secondary",
176
+ "data-testid": "ai-proposal-resolved",
177
+ children: [
178
+ /* @__PURE__ */ j(w, {
179
+ className: "h-4 w-4 text-status-success-text",
180
+ "aria-hidden": "true"
181
+ }),
182
+ " ",
183
+ e
184
+ ]
185
+ }) : null;
186
+ }
187
+ return /* @__PURE__ */ M("div", {
188
+ className: "rounded-lg border border-border-seam bg-bg-sunken p-3",
189
+ "data-testid": "ai-proposal-review",
190
+ children: [
191
+ /* @__PURE__ */ M("p", {
192
+ className: "flex flex-wrap items-center gap-2 text-sm text-text-primary",
193
+ children: [
194
+ /* @__PURE__ */ j(O, {
195
+ className: "h-4 w-4 text-text-secondary",
196
+ "aria-hidden": "true"
197
+ }),
198
+ /* @__PURE__ */ M("span", { children: ["AI proposes ", /* @__PURE__ */ j("span", {
199
+ className: "font-semibold",
200
+ children: y[n]
201
+ })] }),
202
+ /* @__PURE__ */ M("span", {
203
+ className: "text-xs text-text-muted",
204
+ children: [
205
+ "by ",
206
+ e.provider,
207
+ "/",
208
+ e.model
209
+ ]
210
+ })
211
+ ]
212
+ }),
213
+ /* @__PURE__ */ j("p", {
214
+ className: "mt-1 text-xs text-text-secondary",
215
+ children: v[n]
216
+ }),
217
+ c.isError && /* @__PURE__ */ j(l, {
218
+ error: c.error,
219
+ className: "mt-2"
220
+ }),
221
+ /* @__PURE__ */ M("div", {
222
+ className: "mt-3 flex flex-wrap items-center gap-2",
223
+ children: [/* @__PURE__ */ M("button", {
224
+ type: "button",
225
+ disabled: c.isPending,
226
+ onClick: () => c.mutate({
227
+ runId: e.id,
228
+ programId: t,
229
+ assessment: n,
230
+ note: `Accepted the AI proposal (${y[n]}) from ${e.provider}/${e.model}.`
231
+ }, { onSuccess: o }),
232
+ className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-60",
233
+ children: [c.isPending ? /* @__PURE__ */ j(D, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ j(w, { className: "h-4 w-4" }), "Accept"]
234
+ }), /* @__PURE__ */ M("button", {
235
+ type: "button",
236
+ disabled: c.isPending,
237
+ onClick: a,
238
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-elevated disabled:opacity-60",
239
+ children: [/* @__PURE__ */ j(k, { className: "h-4 w-4" }), " Override"]
240
+ })]
241
+ })
242
+ ]
243
+ });
244
+ }
245
+ function z({ run: r, isFocused: i = !1, className: a }) {
246
+ let [s, c] = S(!1), [l, f] = S(!1), m = h(r.decision), v = g(r.inputRefs), D = p(r.inputRefs), O = u(m.confidence), k = d(m.recommendedWeeklyLoadChangePct), A = r.status === "FAILED", L = A || m.isFailure, z = !A && m.kind === "assessment", B = b.find((e) => e !== m.assessment) ?? "MAINTAIN";
247
+ return /* @__PURE__ */ M(P, {
162
248
  treatment: "insight",
163
249
  className: e("p-5", i && "ring-2 ring-[var(--color-focus-ring)]", a),
164
250
  children: [
165
- /* @__PURE__ */ k("div", {
251
+ /* @__PURE__ */ M("div", {
166
252
  className: "flex flex-wrap items-start justify-between gap-3",
167
- children: [/* @__PURE__ */ k("div", {
253
+ children: [/* @__PURE__ */ M("div", {
168
254
  className: "min-w-0",
169
- children: [/* @__PURE__ */ k("h3", {
170
- className: e("flex items-center gap-2 text-base font-semibold", I ? "text-status-error-text" : "text-text-primary"),
171
- children: [I && /* @__PURE__ */ O(S, {
255
+ children: [/* @__PURE__ */ M("h3", {
256
+ className: e("flex items-center gap-2 text-base font-semibold", L ? "text-status-error-text" : "text-text-primary"),
257
+ children: [L && /* @__PURE__ */ j(C, {
172
258
  className: "h-4 w-4 shrink-0",
173
259
  "aria-hidden": "true"
174
- }), F ? "Decision not reached" : _.title]
175
- }), /* @__PURE__ */ O("p", {
260
+ }), A ? "Decision not reached" : m.title]
261
+ }), /* @__PURE__ */ j("p", {
176
262
  className: "mt-1 text-sm text-text-secondary",
177
263
  children: r.promptSummary
178
264
  })]
179
- }), /* @__PURE__ */ k("div", {
265
+ }), /* @__PURE__ */ M("div", {
180
266
  className: "flex shrink-0 flex-wrap items-center gap-2",
181
- children: [_.assessment && /* @__PURE__ */ O(t, {
182
- status: v[_.assessment],
183
- variant: b[_.assessment]
184
- }), _.status && /* @__PURE__ */ O(A, {
267
+ children: [m.assessment && /* @__PURE__ */ j(t, {
268
+ status: y[m.assessment],
269
+ variant: x[m.assessment]
270
+ }), m.status && /* @__PURE__ */ j(N, {
185
271
  variant: "outline",
186
- children: g[_.status] ?? _.status
272
+ children: _[m.status] ?? m.status
187
273
  })]
188
274
  })]
189
275
  }),
190
- /* @__PURE__ */ k("p", {
276
+ /* @__PURE__ */ M("p", {
191
277
  className: "mt-2 text-xs text-text-muted",
192
278
  title: n(r.createdAt),
193
279
  children: [
@@ -198,81 +284,81 @@ function P({ run: r, isFocused: i = !1, className: a }) {
198
284
  o(r.createdAt),
199
285
  " · run",
200
286
  " ",
201
- /* @__PURE__ */ O("code", {
287
+ /* @__PURE__ */ j("code", {
202
288
  className: "font-mono",
203
289
  children: r.id
204
290
  })
205
291
  ]
206
292
  }),
207
- /* @__PURE__ */ O("div", {
293
+ /* @__PURE__ */ j("div", {
208
294
  className: "mt-4",
209
- children: F ? /* @__PURE__ */ k("div", {
295
+ children: A ? /* @__PURE__ */ M("div", {
210
296
  className: "rounded-lg border border-status-error-border bg-status-error-bg-subtle p-3",
211
- children: [/* @__PURE__ */ O("p", {
297
+ children: [/* @__PURE__ */ j("p", {
212
298
  className: "text-sm font-medium text-status-error-text",
213
299
  children: "The provider chain could not answer, so no decision was produced."
214
- }), r.error && /* @__PURE__ */ O("p", {
300
+ }), r.error && /* @__PURE__ */ j("p", {
215
301
  className: "mt-1.5 whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-status-error-text",
216
302
  children: r.error
217
303
  })]
218
- }) : _.kind === "parse-failure" ? /* @__PURE__ */ k("div", {
304
+ }) : m.kind === "parse-failure" ? /* @__PURE__ */ M("div", {
219
305
  className: "rounded-lg border border-status-error-border bg-status-error-bg-subtle p-3",
220
306
  children: [
221
- /* @__PURE__ */ O("p", {
307
+ /* @__PURE__ */ j("p", {
222
308
  className: "text-sm font-medium text-status-error-text",
223
309
  children: "The model replied, but the reply could not be used."
224
310
  }),
225
- /* @__PURE__ */ O("p", {
311
+ /* @__PURE__ */ j("p", {
226
312
  className: "mt-1.5 whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-status-error-text",
227
- children: _.parseError
313
+ children: m.parseError
228
314
  }),
229
- /* @__PURE__ */ O("p", {
315
+ /* @__PURE__ */ j("p", {
230
316
  className: "mt-1.5 text-xs text-text-secondary",
231
317
  children: "Nothing was applied to any program. The row is kept so the failure is auditable."
232
318
  })
233
319
  ]
234
- }) : _.kind === "none" ? /* @__PURE__ */ O("p", {
320
+ }) : m.kind === "none" ? /* @__PURE__ */ j("p", {
235
321
  className: "text-sm text-text-muted",
236
322
  children: "This run recorded no decision payload."
237
- }) : /* @__PURE__ */ k("div", {
323
+ }) : /* @__PURE__ */ M("div", {
238
324
  className: "space-y-3",
239
325
  children: [
240
- _.rationale && /* @__PURE__ */ O("p", {
326
+ m.rationale && /* @__PURE__ */ j("p", {
241
327
  className: "text-sm text-text-secondary",
242
- children: _.rationale
328
+ children: m.rationale
243
329
  }),
244
- _.note && /* @__PURE__ */ k("p", {
330
+ m.note && /* @__PURE__ */ M("p", {
245
331
  className: "rounded-lg bg-bg-sunken p-3 text-sm text-text-secondary",
246
- children: [/* @__PURE__ */ O("span", {
332
+ children: [/* @__PURE__ */ j("span", {
247
333
  className: "font-medium text-text-primary",
248
334
  children: "Coach note: "
249
- }), _.note]
335
+ }), m.note]
250
336
  }),
251
- (D || P) && /* @__PURE__ */ k("div", {
337
+ (O || k) && /* @__PURE__ */ M("div", {
252
338
  className: "flex flex-wrap gap-1.5",
253
- children: [D && /* @__PURE__ */ k("span", {
339
+ children: [O && /* @__PURE__ */ M("span", {
254
340
  className: "inline-flex items-center rounded-md border border-border-seam bg-bg-sunken px-2 py-0.5 text-xs font-medium tabular-nums text-text-secondary",
255
- children: ["Confidence ", D]
256
- }), P && /* @__PURE__ */ k("span", {
341
+ children: ["Confidence ", O]
342
+ }), k && /* @__PURE__ */ M("span", {
257
343
  className: "inline-flex items-center rounded-md border border-border-seam bg-bg-sunken px-2 py-0.5 text-xs font-medium tabular-nums text-text-secondary",
258
- children: ["Weekly load ", P]
344
+ children: ["Weekly load ", k]
259
345
  })]
260
346
  }),
261
- _.flags.length > 0 && /* @__PURE__ */ O("div", {
347
+ m.flags.length > 0 && /* @__PURE__ */ j("div", {
262
348
  className: "flex flex-wrap gap-1.5",
263
- children: _.flags.map((e) => /* @__PURE__ */ O("span", {
349
+ children: m.flags.map((e) => /* @__PURE__ */ j("span", {
264
350
  className: "inline-flex items-center rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-xs font-medium text-status-warning-text",
265
351
  children: e
266
352
  }, e))
267
353
  }),
268
- _.extra.length > 0 && /* @__PURE__ */ O("dl", {
354
+ m.extra.length > 0 && /* @__PURE__ */ j("dl", {
269
355
  className: "grid grid-cols-1 gap-x-6 gap-y-1 text-xs sm:grid-cols-2",
270
- children: _.extra.map((e) => /* @__PURE__ */ k("div", {
356
+ children: m.extra.map((e) => /* @__PURE__ */ M("div", {
271
357
  className: "flex gap-1.5",
272
- children: [/* @__PURE__ */ k("dt", {
358
+ children: [/* @__PURE__ */ M("dt", {
273
359
  className: "shrink-0 font-medium text-text-primary",
274
360
  children: [e.label, ":"]
275
- }), /* @__PURE__ */ O("dd", {
361
+ }), /* @__PURE__ */ j("dd", {
276
362
  className: "min-w-0 break-words text-text-secondary",
277
363
  children: e.value
278
364
  })]
@@ -281,63 +367,72 @@ function P({ run: r, isFocused: i = !1, className: a }) {
281
367
  ]
282
368
  })
283
369
  }),
284
- /* @__PURE__ */ k("div", {
370
+ /* @__PURE__ */ M("div", {
285
371
  className: "mt-4 border-t border-border-seam pt-3",
286
372
  children: [
287
- /* @__PURE__ */ k("h4", {
373
+ /* @__PURE__ */ M("h4", {
288
374
  className: "flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-text-muted",
289
- children: [/* @__PURE__ */ O(w, {
375
+ children: [/* @__PURE__ */ j(T, {
290
376
  className: "h-3.5 w-3.5",
291
377
  "aria-hidden": "true"
292
378
  }), "Considered"]
293
379
  }),
294
- y.length === 0 ? /* @__PURE__ */ O("p", {
380
+ v.length === 0 ? /* @__PURE__ */ j("p", {
295
381
  className: "mt-1.5 text-xs text-text-muted",
296
382
  children: "This run recorded no input references."
297
- }) : /* @__PURE__ */ O("dl", {
383
+ }) : /* @__PURE__ */ j("dl", {
298
384
  className: "mt-1.5 grid grid-cols-1 gap-x-6 gap-y-1 text-xs sm:grid-cols-2",
299
- children: y.map((e) => /* @__PURE__ */ k("div", {
385
+ children: v.map((e) => /* @__PURE__ */ M("div", {
300
386
  className: "flex gap-1.5",
301
- children: [/* @__PURE__ */ k("dt", {
387
+ children: [/* @__PURE__ */ M("dt", {
302
388
  className: "shrink-0 font-medium text-text-primary",
303
389
  children: [e.label, ":"]
304
- }), /* @__PURE__ */ O("dd", {
390
+ }), /* @__PURE__ */ j("dd", {
305
391
  className: "min-w-0 break-words text-text-secondary",
306
392
  children: e.value
307
393
  })]
308
394
  }, e.key))
309
395
  }),
310
- E && /* @__PURE__ */ O("div", {
396
+ D && /* @__PURE__ */ j("div", {
311
397
  className: "mt-2",
312
- children: /* @__PURE__ */ O(M, { programId: E })
398
+ children: /* @__PURE__ */ j(F, { programId: D })
313
399
  })
314
400
  ]
315
401
  }),
316
- /* @__PURE__ */ O("div", {
402
+ /* @__PURE__ */ j("div", {
317
403
  className: "mt-4",
318
- children: l && !s ? /* @__PURE__ */ k("p", {
404
+ children: l && !s ? /* @__PURE__ */ M("p", {
319
405
  className: "inline-flex items-center gap-1.5 text-sm text-status-success-text",
320
- children: [/* @__PURE__ */ O(C, { className: "h-4 w-4" }), " Your decision was recorded as a new ledger row."]
321
- }) : s ? /* @__PURE__ */ O(N, {
406
+ children: [/* @__PURE__ */ j(w, { className: "h-4 w-4" }), " Your decision was recorded as a new ledger row."]
407
+ }) : s ? /* @__PURE__ */ j(I, {
322
408
  run: r,
323
- knownProgramId: E,
409
+ knownProgramId: D,
410
+ initialAssessment: B,
324
411
  onCancel: () => c(!1),
325
412
  onSuccess: () => {
326
413
  c(!1), f(!0);
327
414
  }
328
- }) : /* @__PURE__ */ k("button", {
415
+ }) : z && D && m.assessment ? /* @__PURE__ */ j(R, {
416
+ run: r,
417
+ programId: D,
418
+ proposed: m.assessment,
419
+ onOverride: () => {
420
+ f(!1), c(!0);
421
+ },
422
+ onDone: () => f(!0)
423
+ }) : /* @__PURE__ */ M("button", {
329
424
  type: "button",
330
425
  onClick: () => {
331
426
  f(!1), c(!0);
332
427
  },
333
428
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
334
- children: [/* @__PURE__ */ O(T, { className: "h-4 w-4" }), " File a coach decision"]
429
+ children: [/* @__PURE__ */ j(E, { className: "h-4 w-4" }), " File a coach decision"]
335
430
  })
336
431
  })
337
432
  ]
338
433
  });
339
434
  }
340
435
  //#endregion
341
- export { P as DecisionCard };
436
+ export { z as DecisionCard };
342
437
 
343
438
  //# sourceMappingURL=DecisionCard.js.map