@adoptai/genui-components 0.1.60 → 0.1.62

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 (37) hide show
  1. package/dist/composites/decision-card/resolver.cjs +7 -4
  2. package/dist/composites/decision-card/resolver.cjs.map +1 -1
  3. package/dist/composites/decision-card/resolver.d.ts +7 -1
  4. package/dist/composites/decision-card/resolver.d.ts.map +1 -1
  5. package/dist/composites/decision-card/resolver.js +7 -5
  6. package/dist/composites/decision-card/resolver.js.map +1 -1
  7. package/dist/composites/decision-queue/resolver.d.ts +33 -0
  8. package/dist/composites/decision-queue/resolver.d.ts.map +1 -0
  9. package/dist/composites/workflow-stepper/resolver.cjs +2 -1
  10. package/dist/composites/workflow-stepper/resolver.cjs.map +1 -1
  11. package/dist/composites/workflow-stepper/resolver.js +2 -1
  12. package/dist/composites/workflow-stepper/resolver.js.map +1 -1
  13. package/dist/index.cjs +495 -10
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.js +495 -10
  16. package/dist/index.js.map +1 -1
  17. package/dist/renderer.cjs +495 -10
  18. package/dist/renderer.cjs.map +1 -1
  19. package/dist/renderer.js +495 -10
  20. package/dist/renderer.js.map +1 -1
  21. package/dist/resolver.cjs +495 -10
  22. package/dist/resolver.cjs.map +1 -1
  23. package/dist/resolver.d.ts.map +1 -1
  24. package/dist/resolver.js +495 -10
  25. package/dist/resolver.js.map +1 -1
  26. package/dist/schemas/decision-queue.d.ts +227 -0
  27. package/dist/schemas/decision-queue.d.ts.map +1 -0
  28. package/dist/schemas/index.cjs +162 -0
  29. package/dist/schemas/index.cjs.map +1 -1
  30. package/dist/schemas/index.d.ts +227 -0
  31. package/dist/schemas/index.d.ts.map +1 -1
  32. package/dist/schemas/index.js +162 -0
  33. package/dist/schemas/index.js.map +1 -1
  34. package/dist/shared/InteractionContext.d.ts +10 -0
  35. package/dist/shared/InteractionContext.d.ts.map +1 -1
  36. package/dist/tool-definitions.json +203 -3
  37. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5641,6 +5641,167 @@ var decisionCardTool = {
5641
5641
  required: ["type", "title", "question", "options"]
5642
5642
  }
5643
5643
  };
5644
+ var decisionQueueItemSchema = z.object({
5645
+ id: z.string().optional(),
5646
+ decision_type: z.string().optional(),
5647
+ title: z.string(),
5648
+ question: z.string(),
5649
+ amount: z.number().optional(),
5650
+ currency: z.string().optional(),
5651
+ amount_label: z.string().optional(),
5652
+ severity: z.enum(["low", "medium", "high"]).optional(),
5653
+ flags: z.array(
5654
+ z.object({
5655
+ field: z.string().optional(),
5656
+ issue: z.string(),
5657
+ severity: z.enum(["low", "medium", "high"]).optional()
5658
+ })
5659
+ ).max(6).optional(),
5660
+ options: z.array(
5661
+ z.object({
5662
+ id: z.string().optional(),
5663
+ label: z.string(),
5664
+ recommended: z.boolean().optional(),
5665
+ value: z.number().optional(),
5666
+ adjust: z.object({
5667
+ min: z.number(),
5668
+ max: z.number(),
5669
+ step: z.number().optional(),
5670
+ unit: z.string().optional()
5671
+ }).optional()
5672
+ })
5673
+ ).min(1).max(5),
5674
+ source: z.object({
5675
+ label: z.string().optional(),
5676
+ url: z.string().optional()
5677
+ }).optional()
5678
+ });
5679
+ var decisionQueueSchema = z.object({
5680
+ type: z.literal("decision-queue"),
5681
+ id: z.string().optional(),
5682
+ title: z.string().optional(),
5683
+ description: z.string().optional(),
5684
+ submit_label: z.string().optional(),
5685
+ items: z.array(decisionQueueItemSchema).min(2).max(12),
5686
+ resolved: z.object({
5687
+ decisions: z.array(
5688
+ z.object({
5689
+ id: z.string().optional(),
5690
+ title: z.string(),
5691
+ option: z.string(),
5692
+ value: z.number().optional()
5693
+ })
5694
+ )
5695
+ }).optional()
5696
+ });
5697
+ var OPTION_ITEM_JSON = {
5698
+ type: "object",
5699
+ properties: {
5700
+ id: { type: "string" },
5701
+ label: { type: "string" },
5702
+ recommended: { type: "boolean" },
5703
+ value: {
5704
+ type: "number",
5705
+ description: "Suggested numeric figure for this option (starting point of the adjuster)"
5706
+ },
5707
+ adjust: {
5708
+ type: "object",
5709
+ description: "Allow the user to tune `value` within this inclusive range before deciding",
5710
+ properties: {
5711
+ min: { type: "number" },
5712
+ max: { type: "number" },
5713
+ step: { type: "number" },
5714
+ unit: { type: "string", description: "Short unit suffix, e.g. 'units', '%', 'hrs'" }
5715
+ },
5716
+ required: ["min", "max"]
5717
+ }
5718
+ },
5719
+ required: ["label"]
5720
+ };
5721
+ var decisionQueueTool = {
5722
+ name: "render_decision_queue",
5723
+ description: "Render a SEQUENTIAL QUEUE of 2-12 related human-in-the-loop judgments, decided one at a time at full decision-card richness (amount at stake, data-quality flags, adjustable figures, source links) and submitted TOGETHER as one reply. Use whenever MORE THAN ONE decision is pending in the same turn \u2014 never emit multiple loose decision-cards. Give deferrable items an explicit 'leave open'-style option so the user can always complete the queue. For a single judgment use decision-card; for typed field input (names, dates, uploads) use render_builder.",
5724
+ input_schema: {
5725
+ type: "object",
5726
+ properties: {
5727
+ type: { type: "string", enum: ["decision-queue"] },
5728
+ id: { type: "string", description: "Stable id for update-in-place rendering" },
5729
+ title: {
5730
+ type: "string",
5731
+ description: "Batch headline shown in the header, e.g. 'Reconciliation exceptions'"
5732
+ },
5733
+ description: { type: "string", description: "One-line context above the queue" },
5734
+ submit_label: { type: "string", description: "CTA label; defaults to 'Submit N decisions'" },
5735
+ items: {
5736
+ type: "array",
5737
+ minItems: 2,
5738
+ maxItems: 12,
5739
+ description: "The pending judgments, in the order the user should take them. Each is a full decision-card body (no `type`).",
5740
+ items: {
5741
+ type: "object",
5742
+ properties: {
5743
+ id: { type: "string" },
5744
+ decision_type: {
5745
+ type: "string",
5746
+ description: "Short category eyebrow, e.g. 'Duplicate', 'Capitalization'"
5747
+ },
5748
+ title: { type: "string" },
5749
+ question: { type: "string" },
5750
+ amount: { type: "number" },
5751
+ currency: { type: "string" },
5752
+ amount_label: { type: "string" },
5753
+ severity: { type: "string", enum: ["low", "medium", "high"] },
5754
+ flags: {
5755
+ type: "array",
5756
+ maxItems: 6,
5757
+ items: {
5758
+ type: "object",
5759
+ properties: {
5760
+ field: { type: "string" },
5761
+ issue: { type: "string" },
5762
+ severity: { type: "string", enum: ["low", "medium", "high"] }
5763
+ },
5764
+ required: ["issue"]
5765
+ }
5766
+ },
5767
+ options: {
5768
+ type: "array",
5769
+ minItems: 1,
5770
+ maxItems: 5,
5771
+ items: OPTION_ITEM_JSON
5772
+ },
5773
+ source: {
5774
+ type: "object",
5775
+ properties: { label: { type: "string" }, url: { type: "string" } }
5776
+ }
5777
+ },
5778
+ required: ["title", "question", "options"]
5779
+ }
5780
+ },
5781
+ resolved: {
5782
+ type: "object",
5783
+ description: "Pre-resolved state for transcript replay",
5784
+ properties: {
5785
+ decisions: {
5786
+ type: "array",
5787
+ items: {
5788
+ type: "object",
5789
+ properties: {
5790
+ id: { type: "string" },
5791
+ title: { type: "string" },
5792
+ option: { type: "string" },
5793
+ value: { type: "number" }
5794
+ },
5795
+ required: ["title", "option"]
5796
+ }
5797
+ }
5798
+ },
5799
+ required: ["decisions"]
5800
+ }
5801
+ },
5802
+ required: ["type", "items"]
5803
+ }
5804
+ };
5644
5805
  var tabbyAuthSchema = z.object({
5645
5806
  type: z.literal("tabby-auth"),
5646
5807
  app: z.string(),
@@ -5792,6 +5953,7 @@ var schemaRegistry = {
5792
5953
  "workflow-stepper": { schema: workflowStepperSchema, tool: workflowStepperTool },
5793
5954
  "document-field-extraction": { schema: documentFieldExtractionSchema, tool: documentFieldExtractionTool },
5794
5955
  "decision-card": { schema: decisionCardSchema, tool: decisionCardTool },
5956
+ "decision-queue": { schema: decisionQueueSchema, tool: decisionQueueTool },
5795
5957
  "tabby-auth": { schema: tabbyAuthSchema, tool: tabbyAuthTool }
5796
5958
  };
5797
5959
 
@@ -6505,17 +6667,17 @@ function SparklineTableResolver(p) {
6505
6667
  // src/composites/heatmap-table/resolver.tsx
6506
6668
  init_theme();
6507
6669
  init_ThemeContext();
6508
- function heatColor(z62) {
6509
- const clamped = Math.max(-3, Math.min(3, z62));
6670
+ function heatColor(z63) {
6671
+ const clamped = Math.max(-3, Math.min(3, z63));
6510
6672
  const abs = Math.abs(clamped);
6511
6673
  const lightness = 95 - abs * 8;
6512
6674
  const hue = clamped >= 0 ? 142 : 0;
6513
6675
  return `hsl(${hue} 60% ${lightness}%)`;
6514
6676
  }
6515
- function heatTextColor(z62) {
6516
- const abs = Math.abs(z62);
6517
- if (abs > 2) return z62 >= 0 ? "#14532d" : "#7f1d1d";
6518
- if (abs > 1) return z62 >= 0 ? "#166534" : "#991b1b";
6677
+ function heatTextColor(z63) {
6678
+ const abs = Math.abs(z63);
6679
+ if (abs > 2) return z63 >= 0 ? "#14532d" : "#7f1d1d";
6680
+ if (abs > 1) return z63 >= 0 ? "#166534" : "#991b1b";
6519
6681
  return "var(--foreground)";
6520
6682
  }
6521
6683
  var th2 = {
@@ -17566,7 +17728,8 @@ var DEFAULT_INTERACTION = {
17566
17728
  onStepSelect: void 0,
17567
17729
  resolvedDecisions: void 0,
17568
17730
  onDecisionResolve: void 0,
17569
- onDecisionSource: void 0
17731
+ onDecisionSource: void 0,
17732
+ onDecisionQueueSubmit: void 0
17570
17733
  };
17571
17734
  var GenUIInteractionContext = createContext(DEFAULT_INTERACTION);
17572
17735
  function GenUIInteractionProvider({ value, children }) {
@@ -20354,7 +20517,8 @@ function DecisionCardRenderer({
20354
20517
  data,
20355
20518
  resolved = null,
20356
20519
  onResolve,
20357
- onOpenSource
20520
+ onOpenSource,
20521
+ eyebrow
20358
20522
  }) {
20359
20523
  var _a2, _b, _c;
20360
20524
  const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2, ACCENT_SOFT: ACCENT_SOFT2 } = useTheme();
@@ -20460,7 +20624,7 @@ function DecisionCardRenderer({
20460
20624
  },
20461
20625
  children: [
20462
20626
  /* @__PURE__ */ jsxs("div", { style: { minWidth: 0, display: "flex", flexDirection: "column", gap: 4 }, children: [
20463
- /* @__PURE__ */ jsx(
20627
+ eyebrow === null ? null : /* @__PURE__ */ jsx(
20464
20628
  "span",
20465
20629
  {
20466
20630
  style: {
@@ -20470,7 +20634,7 @@ function DecisionCardRenderer({
20470
20634
  fontWeight: 700,
20471
20635
  color: ACCENT2
20472
20636
  },
20473
- children: data.decision_type ? `Decision needs you \xB7 ${data.decision_type}` : "Decision needs you"
20637
+ children: eyebrow !== void 0 ? eyebrow : data.decision_type ? `Decision needs you \xB7 ${data.decision_type}` : "Decision needs you"
20474
20638
  }
20475
20639
  ),
20476
20640
  /* @__PURE__ */ jsx(
@@ -20690,6 +20854,325 @@ function DecisionCardResolver(p) {
20690
20854
  ) });
20691
20855
  }
20692
20856
  init_ThemeContext();
20857
+ var GREEN4 = "#15803d";
20858
+ var KEYFRAMES3 = `
20859
+ @keyframes dqSettle{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:none}}
20860
+ .dq-settle{animation:dqSettle 0.24s cubic-bezier(0.22,1,0.36,1) both}
20861
+ @keyframes dqFocus{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
20862
+ .dq-focus{animation:dqFocus 0.28s cubic-bezier(0.22,1,0.36,1) both}
20863
+ @media (prefers-reduced-motion: reduce){
20864
+ .dq-settle,.dq-focus{animation:none !important;opacity:1 !important;transform:none !important}
20865
+ }`;
20866
+ function figureOf(item, decision) {
20867
+ var _a2, _b, _c;
20868
+ if (decision.value == null) return decision.option;
20869
+ const unit = (_c = (_b = ((_a2 = item.options) != null ? _a2 : []).find((o) => o.label === decision.option)) == null ? void 0 : _b.adjust) == null ? void 0 : _c.unit;
20870
+ return `${decision.option} \xB7 ${formatFigure(decision.value, unit)}`;
20871
+ }
20872
+ function composeQueueMessage(items, decisions) {
20873
+ const lines = items.map((item, i) => {
20874
+ const d = decisions[i];
20875
+ return `${i + 1}. ${item.title} \u2192 ${d ? figureOf(item, d) : "(undecided)"}`;
20876
+ });
20877
+ const done = decisions.filter(Boolean).length;
20878
+ return `Decisions (${done}/${items.length}):
20879
+ ${lines.join("\n")}`;
20880
+ }
20881
+ function Check({ size, color }) {
20882
+ return /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M5 13l4 4L19 7", stroke: color, strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }) });
20883
+ }
20884
+ function amountChip(item) {
20885
+ if (typeof item.amount !== "number") return null;
20886
+ const abs = Math.abs(item.amount);
20887
+ const sign = item.amount < 0 ? "-" : "";
20888
+ if (abs >= 1e6) return `${sign}$${(abs / 1e6).toFixed(abs >= 1e7 ? 0 : 1)}M`;
20889
+ if (abs >= 1e3) return `${sign}$${(abs / 1e3).toFixed(abs >= 1e4 ? 0 : 1)}K`;
20890
+ return `${sign}$${abs}`;
20891
+ }
20892
+ function DecisionQueueRenderer({
20893
+ data,
20894
+ submitted = null,
20895
+ onSubmit,
20896
+ hideSubmit,
20897
+ submitRef,
20898
+ onReady
20899
+ }) {
20900
+ var _a2;
20901
+ const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2 } = useTheme();
20902
+ const items = (_a2 = data.items) != null ? _a2 : [];
20903
+ const [decisions, setDecisions] = React45.useState(
20904
+ () => items.map(() => void 0)
20905
+ );
20906
+ const firstUndecided = decisions.findIndex((d) => !d);
20907
+ const [focusIdx, setFocusIdx] = React45.useState(firstUndecided >= 0 ? firstUndecided : null);
20908
+ const isSubmitted = submitted != null;
20909
+ const shown = isSubmitted ? items.map(
20910
+ (item, i) => {
20911
+ var _a3;
20912
+ return (_a3 = submitted.find((d) => d.id && d.id === item.id || d.title === item.title)) != null ? _a3 : submitted[i];
20913
+ }
20914
+ ) : decisions;
20915
+ const decidedCount = shown.filter(Boolean).length;
20916
+ const allDecided = decidedCount === items.length;
20917
+ const decide = (idx, option, value) => {
20918
+ const item = items[idx];
20919
+ const next = decisions.slice();
20920
+ next[idx] = { id: item.id, title: item.title, option, value };
20921
+ setDecisions(next);
20922
+ const order = [...Array(items.length).keys()];
20923
+ const after = order.slice(idx + 1).concat(order.slice(0, idx + 1));
20924
+ const target = after.find((j) => j !== idx && !next[j]);
20925
+ setFocusIdx(target != null ? target : null);
20926
+ };
20927
+ const handleSubmit = () => {
20928
+ if (!allDecided || isSubmitted) return;
20929
+ const final = decisions;
20930
+ onSubmit == null ? void 0 : onSubmit(final, composeQueueMessage(items, final));
20931
+ };
20932
+ const onReadyRef = React45.useRef(onReady);
20933
+ React45.useEffect(() => {
20934
+ onReadyRef.current = onReady;
20935
+ });
20936
+ React45.useEffect(() => {
20937
+ if (!onReadyRef.current) return;
20938
+ const msg = allDecided ? composeQueueMessage(items, decisions) : null;
20939
+ onReadyRef.current(allDecided && !isSubmitted, msg, decisions.filter(Boolean));
20940
+ }, [decisions, allDecided, isSubmitted]);
20941
+ React45.useEffect(() => {
20942
+ if (!submitRef) return;
20943
+ submitRef.current = handleSubmit;
20944
+ return () => {
20945
+ submitRef.current = null;
20946
+ };
20947
+ }, [submitRef, allDecided, isSubmitted, decisions]);
20948
+ return /* @__PURE__ */ jsxs(
20949
+ "div",
20950
+ {
20951
+ "data-testid": "decision-queue",
20952
+ "data-submitted": isSubmitted || void 0,
20953
+ style: {
20954
+ position: "relative",
20955
+ width: "100%",
20956
+ minWidth: 0,
20957
+ boxSizing: "border-box",
20958
+ borderRadius: "0.75rem",
20959
+ border: `1px solid ${BORDER4}`,
20960
+ background: "white",
20961
+ boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04)",
20962
+ padding: "16px 18px",
20963
+ display: "flex",
20964
+ flexDirection: "column",
20965
+ gap: 12,
20966
+ overflow: "hidden"
20967
+ },
20968
+ children: [
20969
+ /* @__PURE__ */ jsx("style", { children: KEYFRAMES3 }),
20970
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 3 }, children: [
20971
+ /* @__PURE__ */ jsx(
20972
+ "span",
20973
+ {
20974
+ style: {
20975
+ fontSize: 10.5,
20976
+ textTransform: "uppercase",
20977
+ letterSpacing: "0.07em",
20978
+ fontWeight: 700,
20979
+ color: isSubmitted ? GREEN4 : ACCENT2
20980
+ },
20981
+ children: isSubmitted ? "Decisions submitted" : "Decisions need you"
20982
+ }
20983
+ ),
20984
+ data.title && /* @__PURE__ */ jsx(
20985
+ "p",
20986
+ {
20987
+ style: {
20988
+ fontFamily: "var(--font-serif)",
20989
+ fontSize: 16,
20990
+ fontWeight: 400,
20991
+ color: "var(--foreground)",
20992
+ letterSpacing: "-0.01em",
20993
+ margin: 0,
20994
+ lineHeight: 1.25
20995
+ },
20996
+ children: data.title
20997
+ }
20998
+ ),
20999
+ data.description && /* @__PURE__ */ jsx("p", { style: { fontSize: 12.5, color: MUTED2, margin: 0, lineHeight: 1.45 }, children: data.description })
21000
+ ] }),
21001
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: items.map((item, idx) => {
21002
+ var _a3, _b, _c;
21003
+ const decision = shown[idx];
21004
+ const focused = !isSubmitted && focusIdx === idx;
21005
+ if (focused) {
21006
+ return /* @__PURE__ */ jsx("div", { className: "dq-focus", "data-testid": `decision-queue-focus-${idx}`, children: /* @__PURE__ */ jsx(
21007
+ DecisionCardRenderer,
21008
+ {
21009
+ data: __spreadValues({ type: "decision-card" }, item),
21010
+ resolved: null,
21011
+ onResolve: (option, value) => decide(idx, option, value),
21012
+ eyebrow: `${idx + 1} of ${items.length}${item.decision_type ? ` \xB7 ${item.decision_type}` : ""}`
21013
+ }
21014
+ ) }, (_a3 = item.id) != null ? _a3 : `q-${idx}`);
21015
+ }
21016
+ if (decision) {
21017
+ return /* @__PURE__ */ jsxs(
21018
+ "button",
21019
+ {
21020
+ type: "button",
21021
+ className: "dq-settle",
21022
+ onClick: isSubmitted ? void 0 : () => setFocusIdx(idx),
21023
+ disabled: isSubmitted,
21024
+ title: isSubmitted ? void 0 : "Change this decision",
21025
+ "data-testid": `decision-queue-receipt-${idx}`,
21026
+ style: {
21027
+ display: "flex",
21028
+ alignItems: "center",
21029
+ gap: 8,
21030
+ width: "100%",
21031
+ textAlign: "left",
21032
+ border: "1px solid #dcfce7",
21033
+ background: "#f6fef9",
21034
+ borderRadius: 8,
21035
+ padding: "7px 11px",
21036
+ cursor: isSubmitted ? "default" : "pointer",
21037
+ font: "inherit"
21038
+ },
21039
+ children: [
21040
+ /* @__PURE__ */ jsx(Check, { size: 13, color: GREEN4 }),
21041
+ /* @__PURE__ */ jsx("span", { style: { fontSize: 12.5, fontWeight: 600, color: "var(--foreground)", minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: item.title }),
21042
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: { color: MUTED2, fontSize: 12 }, children: "\u2192" }),
21043
+ /* @__PURE__ */ jsx("span", { style: { fontSize: 12.5, fontWeight: 600, color: GREEN4, fontVariantNumeric: "tabular-nums", whiteSpace: "nowrap" }, children: figureOf(item, decision) }),
21044
+ /* @__PURE__ */ jsx("span", { style: { flex: 1 } }),
21045
+ !isSubmitted && /* @__PURE__ */ jsx("span", { style: { fontSize: 11, fontWeight: 600, color: MUTED2 }, children: "Change" })
21046
+ ]
21047
+ },
21048
+ (_b = item.id) != null ? _b : `q-${idx}`
21049
+ );
21050
+ }
21051
+ return /* @__PURE__ */ jsxs(
21052
+ "button",
21053
+ {
21054
+ type: "button",
21055
+ onClick: isSubmitted ? void 0 : () => setFocusIdx(idx),
21056
+ disabled: isSubmitted,
21057
+ "data-testid": `decision-queue-upcoming-${idx}`,
21058
+ style: {
21059
+ display: "flex",
21060
+ alignItems: "center",
21061
+ gap: 8,
21062
+ width: "100%",
21063
+ textAlign: "left",
21064
+ border: `1px dashed ${BORDER4}`,
21065
+ background: "white",
21066
+ borderRadius: 8,
21067
+ padding: "7px 11px",
21068
+ cursor: isSubmitted ? "default" : "pointer",
21069
+ font: "inherit",
21070
+ opacity: 0.75
21071
+ },
21072
+ children: [
21073
+ /* @__PURE__ */ jsx(
21074
+ "span",
21075
+ {
21076
+ "aria-hidden": "true",
21077
+ style: { width: 13, height: 13, borderRadius: "50%", border: `1.5px solid ${MUTED2}`, flexShrink: 0, boxSizing: "border-box" }
21078
+ }
21079
+ ),
21080
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: 12.5, fontWeight: 600, color: MUTED2, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
21081
+ item.decision_type ? `${item.decision_type} \xB7 ` : "",
21082
+ item.title
21083
+ ] }),
21084
+ /* @__PURE__ */ jsx("span", { style: { flex: 1 } }),
21085
+ amountChip(item) && /* @__PURE__ */ jsx("span", { style: { fontSize: 11.5, fontWeight: 700, color: MUTED2, fontVariantNumeric: "tabular-nums" }, children: amountChip(item) })
21086
+ ]
21087
+ },
21088
+ (_c = item.id) != null ? _c : `q-${idx}`
21089
+ );
21090
+ }) }),
21091
+ /* @__PURE__ */ jsxs(
21092
+ "div",
21093
+ {
21094
+ style: {
21095
+ display: "flex",
21096
+ alignItems: "center",
21097
+ gap: 10,
21098
+ paddingTop: 10,
21099
+ borderTop: `1px solid #f0f0f0`
21100
+ },
21101
+ children: [
21102
+ /* @__PURE__ */ jsx("span", { style: { display: "inline-flex", gap: 4 }, "aria-hidden": "true", children: items.map((_, i) => /* @__PURE__ */ jsx(
21103
+ "span",
21104
+ {
21105
+ style: {
21106
+ width: 7,
21107
+ height: 7,
21108
+ borderRadius: "50%",
21109
+ background: shown[i] ? isSubmitted ? GREEN4 : ACCENT2 : "#e8e8e8",
21110
+ transition: "background 0.2s"
21111
+ }
21112
+ },
21113
+ `dot-${i}`
21114
+ )) }),
21115
+ /* @__PURE__ */ jsxs(
21116
+ "span",
21117
+ {
21118
+ style: { fontSize: 11.5, fontWeight: 600, color: MUTED2, fontVariantNumeric: "tabular-nums" },
21119
+ "data-testid": "decision-queue-progress",
21120
+ children: [
21121
+ decidedCount,
21122
+ "/",
21123
+ items.length,
21124
+ " decided"
21125
+ ]
21126
+ }
21127
+ ),
21128
+ /* @__PURE__ */ jsx("span", { style: { flex: 1 } }),
21129
+ isSubmitted ? /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 6, fontSize: 12.5, fontWeight: 600, color: GREEN4 }, children: [
21130
+ /* @__PURE__ */ jsx(Check, { size: 14, color: GREEN4 }),
21131
+ "Submitted"
21132
+ ] }) : hideSubmit ? null : /* @__PURE__ */ jsx(
21133
+ "button",
21134
+ {
21135
+ type: "button",
21136
+ onClick: handleSubmit,
21137
+ disabled: !allDecided,
21138
+ "data-testid": "decision-queue-submit",
21139
+ style: {
21140
+ border: `1px solid ${allDecided ? ACCENT2 : BORDER4}`,
21141
+ background: allDecided ? ACCENT2 : "#f6f6f6",
21142
+ color: allDecided ? "white" : MUTED2,
21143
+ borderRadius: 8,
21144
+ fontSize: 13,
21145
+ fontWeight: 600,
21146
+ padding: "8px 16px",
21147
+ cursor: allDecided ? "pointer" : "default",
21148
+ fontVariantNumeric: "tabular-nums",
21149
+ transition: "background 0.15s, border-color 0.15s, color 0.15s"
21150
+ },
21151
+ children: data.submit_label || `Submit ${items.length} decision${items.length === 1 ? "" : "s"}`
21152
+ }
21153
+ )
21154
+ ]
21155
+ }
21156
+ )
21157
+ ]
21158
+ }
21159
+ );
21160
+ }
21161
+ function DecisionQueueResolver(p) {
21162
+ var _a2, _b, _c, _d, _e, _f;
21163
+ const { resolvedDecisions, onDecisionQueueSubmit } = useGenUIInteraction();
21164
+ const queueId = (_b = (_a2 = p.id) != null ? _a2 : p.title) != null ? _b : "decision-queue";
21165
+ const replayed = (_d = (_c = p.resolved) == null ? void 0 : _c.decisions) != null ? _d : null;
21166
+ const [localSubmitted, setLocalSubmitted] = React45.useState(null);
21167
+ const hostLocked = (resolvedDecisions == null ? void 0 : resolvedDecisions[queueId]) != null;
21168
+ const submitted = (_e = replayed != null ? replayed : localSubmitted) != null ? _e : hostLocked ? [] : null;
21169
+ const handleSubmit = (decisions, message) => {
21170
+ setLocalSubmitted(decisions);
21171
+ onDecisionQueueSubmit == null ? void 0 : onDecisionQueueSubmit(queueId, decisions, message);
21172
+ };
21173
+ return /* @__PURE__ */ jsx(ComponentActions, { filename: (_f = p.title) != null ? _f : "decision-queue", children: /* @__PURE__ */ jsx(DecisionQueueRenderer, { data: p, submitted, onSubmit: handleSubmit }) });
21174
+ }
21175
+ init_ThemeContext();
20693
21176
  var CONNECTED_GREEN3 = "#15803d";
20694
21177
  var CONNECTED_GREEN_BG = "#dcfce7";
20695
21178
  var PENDING_AMBER = "#92400e";
@@ -21121,6 +21604,8 @@ function resolveUI(rawPayload) {
21121
21604
  return /* @__PURE__ */ jsx(DocumentFieldExtractionResolver, __spreadValues({}, payload));
21122
21605
  case "decision-card":
21123
21606
  return /* @__PURE__ */ jsx(DecisionCardResolver, __spreadValues({}, payload));
21607
+ case "decision-queue":
21608
+ return /* @__PURE__ */ jsx(DecisionQueueResolver, __spreadValues({}, payload));
21124
21609
  case "tabby-auth":
21125
21610
  return /* @__PURE__ */ jsx(TabbyAuthResolver, __spreadValues({}, payload));
21126
21611
  default: {