@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.
- package/dist/atheletebridge/components/ai/DecisionCard.d.ts.map +1 -1
- package/dist/atheletebridge/components/ai/DecisionCard.js +217 -122
- package/dist/atheletebridge/components/ai/DecisionCard.js.map +1 -1
- package/dist/atheletebridge/components/ai/SubjectDecisions.d.ts +29 -0
- package/dist/atheletebridge/components/ai/SubjectDecisions.d.ts.map +1 -0
- package/dist/atheletebridge/components/ai/SubjectDecisions.js +69 -0
- package/dist/atheletebridge/components/ai/SubjectDecisions.js.map +1 -0
- package/dist/atheletebridge/components/ai/index.d.ts +2 -0
- package/dist/atheletebridge/components/ai/index.d.ts.map +1 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts +10 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts.map +1 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +24 -15
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js +135 -118
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js +42 -34
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js +65 -57
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js.map +1 -1
- package/dist/atheletebridge/utils/aiDecision.d.ts +12 -0
- package/dist/atheletebridge/utils/aiDecision.d.ts.map +1 -1
- package/dist/atheletebridge/utils/aiDecision.js +11 -1
- package/dist/atheletebridge/utils/aiDecision.js.map +1 -1
- 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;
|
|
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,
|
|
9
|
-
import { ADJUSTMENT_STATUS_LABELS as
|
|
10
|
-
import { useState as
|
|
11
|
-
import { AlertTriangle as
|
|
12
|
-
import { Fragment as
|
|
13
|
-
import { Badge as
|
|
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
|
|
15
|
+
function F({ programId: e }) {
|
|
16
16
|
let n = i(e);
|
|
17
|
-
if (n.isLoading) return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
33
|
+
/* @__PURE__ */ j("span", {
|
|
34
34
|
className: "font-medium text-text-primary",
|
|
35
35
|
children: n.data.name
|
|
36
36
|
}),
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
o ? /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
s && /* @__PURE__ */
|
|
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__ */
|
|
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
|
|
53
|
-
let
|
|
54
|
-
return /* @__PURE__ */
|
|
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(),
|
|
57
|
-
|
|
56
|
+
if (t.preventDefault(), C(null), !f) {
|
|
57
|
+
C("Choose the program this decision concerns.");
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
-
if (!
|
|
61
|
-
|
|
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
|
-
|
|
64
|
+
u.mutate({
|
|
65
65
|
runId: e.id,
|
|
66
|
-
programId:
|
|
67
|
-
assessment:
|
|
68
|
-
note:
|
|
66
|
+
programId: f,
|
|
67
|
+
assessment: m,
|
|
68
|
+
note: g.trim()
|
|
69
69
|
}, { onSuccess: () => {
|
|
70
|
-
|
|
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__ */
|
|
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__ */
|
|
79
|
+
t ? /* @__PURE__ */ j(s, {
|
|
80
80
|
label: "Program",
|
|
81
81
|
hint: "Taken from this run's provenance.",
|
|
82
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
93
|
+
children: /* @__PURE__ */ M("select", {
|
|
94
94
|
id: `override-program-${e.id}`,
|
|
95
95
|
className: c,
|
|
96
|
-
value:
|
|
97
|
-
onChange: (e) =>
|
|
98
|
-
children: [/* @__PURE__ */
|
|
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
|
-
}), (
|
|
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__ */
|
|
107
|
+
/* @__PURE__ */ j(s, {
|
|
108
108
|
label: "Your assessment",
|
|
109
109
|
htmlFor: `override-assessment-${e.id}`,
|
|
110
110
|
required: !0,
|
|
111
|
-
hint:
|
|
112
|
-
children: /* @__PURE__ */
|
|
111
|
+
hint: v[m],
|
|
112
|
+
children: /* @__PURE__ */ j("select", {
|
|
113
113
|
id: `override-assessment-${e.id}`,
|
|
114
114
|
className: c,
|
|
115
|
-
value:
|
|
116
|
-
onChange: (e) =>
|
|
117
|
-
children:
|
|
115
|
+
value: m,
|
|
116
|
+
onChange: (e) => h(e.target.value),
|
|
117
|
+
children: b.map((e) => /* @__PURE__ */ j("option", {
|
|
118
118
|
value: e,
|
|
119
|
-
children:
|
|
119
|
+
children: y[e]
|
|
120
120
|
}, e))
|
|
121
121
|
})
|
|
122
122
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ j(s, {
|
|
124
124
|
label: "Note",
|
|
125
125
|
htmlFor: `override-note-${e.id}`,
|
|
126
126
|
required: !0,
|
|
127
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ j("textarea", {
|
|
128
128
|
id: `override-note-${e.id}`,
|
|
129
129
|
className: c,
|
|
130
130
|
rows: 3,
|
|
131
|
-
value:
|
|
131
|
+
value: g,
|
|
132
132
|
maxLength: 1e3,
|
|
133
|
-
onChange: (e) =>
|
|
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
|
-
|
|
137
|
+
x && /* @__PURE__ */ j("p", {
|
|
138
138
|
className: "text-sm text-status-error-text",
|
|
139
|
-
children:
|
|
139
|
+
children: x
|
|
140
140
|
}),
|
|
141
|
-
|
|
142
|
-
/* @__PURE__ */
|
|
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__ */
|
|
144
|
+
children: [/* @__PURE__ */ j("button", {
|
|
145
145
|
type: "button",
|
|
146
|
-
onClick:
|
|
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__ */
|
|
149
|
+
}), /* @__PURE__ */ M("button", {
|
|
150
150
|
type: "submit",
|
|
151
|
-
disabled:
|
|
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: [
|
|
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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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__ */
|
|
251
|
+
/* @__PURE__ */ M("div", {
|
|
166
252
|
className: "flex flex-wrap items-start justify-between gap-3",
|
|
167
|
-
children: [/* @__PURE__ */
|
|
253
|
+
children: [/* @__PURE__ */ M("div", {
|
|
168
254
|
className: "min-w-0",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
170
|
-
className: e("flex items-center gap-2 text-base font-semibold",
|
|
171
|
-
children: [
|
|
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
|
-
}),
|
|
175
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
265
|
+
}), /* @__PURE__ */ M("div", {
|
|
180
266
|
className: "flex shrink-0 flex-wrap items-center gap-2",
|
|
181
|
-
children: [
|
|
182
|
-
status:
|
|
183
|
-
variant:
|
|
184
|
-
}),
|
|
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:
|
|
272
|
+
children: _[m.status] ?? m.status
|
|
187
273
|
})]
|
|
188
274
|
})]
|
|
189
275
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
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__ */
|
|
287
|
+
/* @__PURE__ */ j("code", {
|
|
202
288
|
className: "font-mono",
|
|
203
289
|
children: r.id
|
|
204
290
|
})
|
|
205
291
|
]
|
|
206
292
|
}),
|
|
207
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ j("div", {
|
|
208
294
|
className: "mt-4",
|
|
209
|
-
children:
|
|
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__ */
|
|
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__ */
|
|
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
|
-
}) :
|
|
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__ */
|
|
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__ */
|
|
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:
|
|
313
|
+
children: m.parseError
|
|
228
314
|
}),
|
|
229
|
-
/* @__PURE__ */
|
|
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
|
-
}) :
|
|
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__ */
|
|
323
|
+
}) : /* @__PURE__ */ M("div", {
|
|
238
324
|
className: "space-y-3",
|
|
239
325
|
children: [
|
|
240
|
-
|
|
326
|
+
m.rationale && /* @__PURE__ */ j("p", {
|
|
241
327
|
className: "text-sm text-text-secondary",
|
|
242
|
-
children:
|
|
328
|
+
children: m.rationale
|
|
243
329
|
}),
|
|
244
|
-
|
|
330
|
+
m.note && /* @__PURE__ */ M("p", {
|
|
245
331
|
className: "rounded-lg bg-bg-sunken p-3 text-sm text-text-secondary",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
332
|
+
children: [/* @__PURE__ */ j("span", {
|
|
247
333
|
className: "font-medium text-text-primary",
|
|
248
334
|
children: "Coach note: "
|
|
249
|
-
}),
|
|
335
|
+
}), m.note]
|
|
250
336
|
}),
|
|
251
|
-
(
|
|
337
|
+
(O || k) && /* @__PURE__ */ M("div", {
|
|
252
338
|
className: "flex flex-wrap gap-1.5",
|
|
253
|
-
children: [
|
|
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 ",
|
|
256
|
-
}),
|
|
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 ",
|
|
344
|
+
children: ["Weekly load ", k]
|
|
259
345
|
})]
|
|
260
346
|
}),
|
|
261
|
-
|
|
347
|
+
m.flags.length > 0 && /* @__PURE__ */ j("div", {
|
|
262
348
|
className: "flex flex-wrap gap-1.5",
|
|
263
|
-
children:
|
|
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
|
-
|
|
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:
|
|
356
|
+
children: m.extra.map((e) => /* @__PURE__ */ M("div", {
|
|
271
357
|
className: "flex gap-1.5",
|
|
272
|
-
children: [/* @__PURE__ */
|
|
358
|
+
children: [/* @__PURE__ */ M("dt", {
|
|
273
359
|
className: "shrink-0 font-medium text-text-primary",
|
|
274
360
|
children: [e.label, ":"]
|
|
275
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
370
|
+
/* @__PURE__ */ M("div", {
|
|
285
371
|
className: "mt-4 border-t border-border-seam pt-3",
|
|
286
372
|
children: [
|
|
287
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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
|
-
|
|
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__ */
|
|
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:
|
|
385
|
+
children: v.map((e) => /* @__PURE__ */ M("div", {
|
|
300
386
|
className: "flex gap-1.5",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ M("dt", {
|
|
302
388
|
className: "shrink-0 font-medium text-text-primary",
|
|
303
389
|
children: [e.label, ":"]
|
|
304
|
-
}), /* @__PURE__ */
|
|
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
|
-
|
|
396
|
+
D && /* @__PURE__ */ j("div", {
|
|
311
397
|
className: "mt-2",
|
|
312
|
-
children: /* @__PURE__ */
|
|
398
|
+
children: /* @__PURE__ */ j(F, { programId: D })
|
|
313
399
|
})
|
|
314
400
|
]
|
|
315
401
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ j("div", {
|
|
317
403
|
className: "mt-4",
|
|
318
|
-
children: l && !s ? /* @__PURE__ */
|
|
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__ */
|
|
321
|
-
}) : s ? /* @__PURE__ */
|
|
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:
|
|
409
|
+
knownProgramId: D,
|
|
410
|
+
initialAssessment: B,
|
|
324
411
|
onCancel: () => c(!1),
|
|
325
412
|
onSuccess: () => {
|
|
326
413
|
c(!1), f(!0);
|
|
327
414
|
}
|
|
328
|
-
}) : /* @__PURE__ */
|
|
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__ */
|
|
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 {
|
|
436
|
+
export { z as DecisionCard };
|
|
342
437
|
|
|
343
438
|
//# sourceMappingURL=DecisionCard.js.map
|