@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.cjs CHANGED
@@ -5669,6 +5669,167 @@ var decisionCardTool = {
5669
5669
  required: ["type", "title", "question", "options"]
5670
5670
  }
5671
5671
  };
5672
+ var decisionQueueItemSchema = zod.z.object({
5673
+ id: zod.z.string().optional(),
5674
+ decision_type: zod.z.string().optional(),
5675
+ title: zod.z.string(),
5676
+ question: zod.z.string(),
5677
+ amount: zod.z.number().optional(),
5678
+ currency: zod.z.string().optional(),
5679
+ amount_label: zod.z.string().optional(),
5680
+ severity: zod.z.enum(["low", "medium", "high"]).optional(),
5681
+ flags: zod.z.array(
5682
+ zod.z.object({
5683
+ field: zod.z.string().optional(),
5684
+ issue: zod.z.string(),
5685
+ severity: zod.z.enum(["low", "medium", "high"]).optional()
5686
+ })
5687
+ ).max(6).optional(),
5688
+ options: zod.z.array(
5689
+ zod.z.object({
5690
+ id: zod.z.string().optional(),
5691
+ label: zod.z.string(),
5692
+ recommended: zod.z.boolean().optional(),
5693
+ value: zod.z.number().optional(),
5694
+ adjust: zod.z.object({
5695
+ min: zod.z.number(),
5696
+ max: zod.z.number(),
5697
+ step: zod.z.number().optional(),
5698
+ unit: zod.z.string().optional()
5699
+ }).optional()
5700
+ })
5701
+ ).min(1).max(5),
5702
+ source: zod.z.object({
5703
+ label: zod.z.string().optional(),
5704
+ url: zod.z.string().optional()
5705
+ }).optional()
5706
+ });
5707
+ var decisionQueueSchema = zod.z.object({
5708
+ type: zod.z.literal("decision-queue"),
5709
+ id: zod.z.string().optional(),
5710
+ title: zod.z.string().optional(),
5711
+ description: zod.z.string().optional(),
5712
+ submit_label: zod.z.string().optional(),
5713
+ items: zod.z.array(decisionQueueItemSchema).min(2).max(12),
5714
+ resolved: zod.z.object({
5715
+ decisions: zod.z.array(
5716
+ zod.z.object({
5717
+ id: zod.z.string().optional(),
5718
+ title: zod.z.string(),
5719
+ option: zod.z.string(),
5720
+ value: zod.z.number().optional()
5721
+ })
5722
+ )
5723
+ }).optional()
5724
+ });
5725
+ var OPTION_ITEM_JSON = {
5726
+ type: "object",
5727
+ properties: {
5728
+ id: { type: "string" },
5729
+ label: { type: "string" },
5730
+ recommended: { type: "boolean" },
5731
+ value: {
5732
+ type: "number",
5733
+ description: "Suggested numeric figure for this option (starting point of the adjuster)"
5734
+ },
5735
+ adjust: {
5736
+ type: "object",
5737
+ description: "Allow the user to tune `value` within this inclusive range before deciding",
5738
+ properties: {
5739
+ min: { type: "number" },
5740
+ max: { type: "number" },
5741
+ step: { type: "number" },
5742
+ unit: { type: "string", description: "Short unit suffix, e.g. 'units', '%', 'hrs'" }
5743
+ },
5744
+ required: ["min", "max"]
5745
+ }
5746
+ },
5747
+ required: ["label"]
5748
+ };
5749
+ var decisionQueueTool = {
5750
+ name: "render_decision_queue",
5751
+ 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.",
5752
+ input_schema: {
5753
+ type: "object",
5754
+ properties: {
5755
+ type: { type: "string", enum: ["decision-queue"] },
5756
+ id: { type: "string", description: "Stable id for update-in-place rendering" },
5757
+ title: {
5758
+ type: "string",
5759
+ description: "Batch headline shown in the header, e.g. 'Reconciliation exceptions'"
5760
+ },
5761
+ description: { type: "string", description: "One-line context above the queue" },
5762
+ submit_label: { type: "string", description: "CTA label; defaults to 'Submit N decisions'" },
5763
+ items: {
5764
+ type: "array",
5765
+ minItems: 2,
5766
+ maxItems: 12,
5767
+ description: "The pending judgments, in the order the user should take them. Each is a full decision-card body (no `type`).",
5768
+ items: {
5769
+ type: "object",
5770
+ properties: {
5771
+ id: { type: "string" },
5772
+ decision_type: {
5773
+ type: "string",
5774
+ description: "Short category eyebrow, e.g. 'Duplicate', 'Capitalization'"
5775
+ },
5776
+ title: { type: "string" },
5777
+ question: { type: "string" },
5778
+ amount: { type: "number" },
5779
+ currency: { type: "string" },
5780
+ amount_label: { type: "string" },
5781
+ severity: { type: "string", enum: ["low", "medium", "high"] },
5782
+ flags: {
5783
+ type: "array",
5784
+ maxItems: 6,
5785
+ items: {
5786
+ type: "object",
5787
+ properties: {
5788
+ field: { type: "string" },
5789
+ issue: { type: "string" },
5790
+ severity: { type: "string", enum: ["low", "medium", "high"] }
5791
+ },
5792
+ required: ["issue"]
5793
+ }
5794
+ },
5795
+ options: {
5796
+ type: "array",
5797
+ minItems: 1,
5798
+ maxItems: 5,
5799
+ items: OPTION_ITEM_JSON
5800
+ },
5801
+ source: {
5802
+ type: "object",
5803
+ properties: { label: { type: "string" }, url: { type: "string" } }
5804
+ }
5805
+ },
5806
+ required: ["title", "question", "options"]
5807
+ }
5808
+ },
5809
+ resolved: {
5810
+ type: "object",
5811
+ description: "Pre-resolved state for transcript replay",
5812
+ properties: {
5813
+ decisions: {
5814
+ type: "array",
5815
+ items: {
5816
+ type: "object",
5817
+ properties: {
5818
+ id: { type: "string" },
5819
+ title: { type: "string" },
5820
+ option: { type: "string" },
5821
+ value: { type: "number" }
5822
+ },
5823
+ required: ["title", "option"]
5824
+ }
5825
+ }
5826
+ },
5827
+ required: ["decisions"]
5828
+ }
5829
+ },
5830
+ required: ["type", "items"]
5831
+ }
5832
+ };
5672
5833
  var tabbyAuthSchema = zod.z.object({
5673
5834
  type: zod.z.literal("tabby-auth"),
5674
5835
  app: zod.z.string(),
@@ -5820,6 +5981,7 @@ var schemaRegistry = {
5820
5981
  "workflow-stepper": { schema: workflowStepperSchema, tool: workflowStepperTool },
5821
5982
  "document-field-extraction": { schema: documentFieldExtractionSchema, tool: documentFieldExtractionTool },
5822
5983
  "decision-card": { schema: decisionCardSchema, tool: decisionCardTool },
5984
+ "decision-queue": { schema: decisionQueueSchema, tool: decisionQueueTool },
5823
5985
  "tabby-auth": { schema: tabbyAuthSchema, tool: tabbyAuthTool }
5824
5986
  };
5825
5987
 
@@ -6533,17 +6695,17 @@ function SparklineTableResolver(p) {
6533
6695
  // src/composites/heatmap-table/resolver.tsx
6534
6696
  init_theme();
6535
6697
  init_ThemeContext();
6536
- function heatColor(z62) {
6537
- const clamped = Math.max(-3, Math.min(3, z62));
6698
+ function heatColor(z63) {
6699
+ const clamped = Math.max(-3, Math.min(3, z63));
6538
6700
  const abs = Math.abs(clamped);
6539
6701
  const lightness = 95 - abs * 8;
6540
6702
  const hue = clamped >= 0 ? 142 : 0;
6541
6703
  return `hsl(${hue} 60% ${lightness}%)`;
6542
6704
  }
6543
- function heatTextColor(z62) {
6544
- const abs = Math.abs(z62);
6545
- if (abs > 2) return z62 >= 0 ? "#14532d" : "#7f1d1d";
6546
- if (abs > 1) return z62 >= 0 ? "#166534" : "#991b1b";
6705
+ function heatTextColor(z63) {
6706
+ const abs = Math.abs(z63);
6707
+ if (abs > 2) return z63 >= 0 ? "#14532d" : "#7f1d1d";
6708
+ if (abs > 1) return z63 >= 0 ? "#166534" : "#991b1b";
6547
6709
  return "var(--foreground)";
6548
6710
  }
6549
6711
  var th2 = {
@@ -17594,7 +17756,8 @@ var DEFAULT_INTERACTION = {
17594
17756
  onStepSelect: void 0,
17595
17757
  resolvedDecisions: void 0,
17596
17758
  onDecisionResolve: void 0,
17597
- onDecisionSource: void 0
17759
+ onDecisionSource: void 0,
17760
+ onDecisionQueueSubmit: void 0
17598
17761
  };
17599
17762
  var GenUIInteractionContext = React45.createContext(DEFAULT_INTERACTION);
17600
17763
  function GenUIInteractionProvider({ value, children }) {
@@ -20382,7 +20545,8 @@ function DecisionCardRenderer({
20382
20545
  data,
20383
20546
  resolved = null,
20384
20547
  onResolve,
20385
- onOpenSource
20548
+ onOpenSource,
20549
+ eyebrow
20386
20550
  }) {
20387
20551
  var _a2, _b, _c;
20388
20552
  const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2, ACCENT_SOFT: ACCENT_SOFT2 } = useTheme();
@@ -20488,7 +20652,7 @@ function DecisionCardRenderer({
20488
20652
  },
20489
20653
  children: [
20490
20654
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 0, display: "flex", flexDirection: "column", gap: 4 }, children: [
20491
- /* @__PURE__ */ jsxRuntime.jsx(
20655
+ eyebrow === null ? null : /* @__PURE__ */ jsxRuntime.jsx(
20492
20656
  "span",
20493
20657
  {
20494
20658
  style: {
@@ -20498,7 +20662,7 @@ function DecisionCardRenderer({
20498
20662
  fontWeight: 700,
20499
20663
  color: ACCENT2
20500
20664
  },
20501
- children: data.decision_type ? `Decision needs you \xB7 ${data.decision_type}` : "Decision needs you"
20665
+ children: eyebrow !== void 0 ? eyebrow : data.decision_type ? `Decision needs you \xB7 ${data.decision_type}` : "Decision needs you"
20502
20666
  }
20503
20667
  ),
20504
20668
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -20718,6 +20882,325 @@ function DecisionCardResolver(p) {
20718
20882
  ) });
20719
20883
  }
20720
20884
  init_ThemeContext();
20885
+ var GREEN4 = "#15803d";
20886
+ var KEYFRAMES3 = `
20887
+ @keyframes dqSettle{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:none}}
20888
+ .dq-settle{animation:dqSettle 0.24s cubic-bezier(0.22,1,0.36,1) both}
20889
+ @keyframes dqFocus{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
20890
+ .dq-focus{animation:dqFocus 0.28s cubic-bezier(0.22,1,0.36,1) both}
20891
+ @media (prefers-reduced-motion: reduce){
20892
+ .dq-settle,.dq-focus{animation:none !important;opacity:1 !important;transform:none !important}
20893
+ }`;
20894
+ function figureOf(item, decision) {
20895
+ var _a2, _b, _c;
20896
+ if (decision.value == null) return decision.option;
20897
+ 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;
20898
+ return `${decision.option} \xB7 ${formatFigure(decision.value, unit)}`;
20899
+ }
20900
+ function composeQueueMessage(items, decisions) {
20901
+ const lines = items.map((item, i) => {
20902
+ const d = decisions[i];
20903
+ return `${i + 1}. ${item.title} \u2192 ${d ? figureOf(item, d) : "(undecided)"}`;
20904
+ });
20905
+ const done = decisions.filter(Boolean).length;
20906
+ return `Decisions (${done}/${items.length}):
20907
+ ${lines.join("\n")}`;
20908
+ }
20909
+ function Check({ size, color }) {
20910
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 13l4 4L19 7", stroke: color, strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }) });
20911
+ }
20912
+ function amountChip(item) {
20913
+ if (typeof item.amount !== "number") return null;
20914
+ const abs = Math.abs(item.amount);
20915
+ const sign = item.amount < 0 ? "-" : "";
20916
+ if (abs >= 1e6) return `${sign}$${(abs / 1e6).toFixed(abs >= 1e7 ? 0 : 1)}M`;
20917
+ if (abs >= 1e3) return `${sign}$${(abs / 1e3).toFixed(abs >= 1e4 ? 0 : 1)}K`;
20918
+ return `${sign}$${abs}`;
20919
+ }
20920
+ function DecisionQueueRenderer({
20921
+ data,
20922
+ submitted = null,
20923
+ onSubmit,
20924
+ hideSubmit,
20925
+ submitRef,
20926
+ onReady
20927
+ }) {
20928
+ var _a2;
20929
+ const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2 } = useTheme();
20930
+ const items = (_a2 = data.items) != null ? _a2 : [];
20931
+ const [decisions, setDecisions] = React45__default.default.useState(
20932
+ () => items.map(() => void 0)
20933
+ );
20934
+ const firstUndecided = decisions.findIndex((d) => !d);
20935
+ const [focusIdx, setFocusIdx] = React45__default.default.useState(firstUndecided >= 0 ? firstUndecided : null);
20936
+ const isSubmitted = submitted != null;
20937
+ const shown = isSubmitted ? items.map(
20938
+ (item, i) => {
20939
+ var _a3;
20940
+ return (_a3 = submitted.find((d) => d.id && d.id === item.id || d.title === item.title)) != null ? _a3 : submitted[i];
20941
+ }
20942
+ ) : decisions;
20943
+ const decidedCount = shown.filter(Boolean).length;
20944
+ const allDecided = decidedCount === items.length;
20945
+ const decide = (idx, option, value) => {
20946
+ const item = items[idx];
20947
+ const next = decisions.slice();
20948
+ next[idx] = { id: item.id, title: item.title, option, value };
20949
+ setDecisions(next);
20950
+ const order = [...Array(items.length).keys()];
20951
+ const after = order.slice(idx + 1).concat(order.slice(0, idx + 1));
20952
+ const target = after.find((j) => j !== idx && !next[j]);
20953
+ setFocusIdx(target != null ? target : null);
20954
+ };
20955
+ const handleSubmit = () => {
20956
+ if (!allDecided || isSubmitted) return;
20957
+ const final = decisions;
20958
+ onSubmit == null ? void 0 : onSubmit(final, composeQueueMessage(items, final));
20959
+ };
20960
+ const onReadyRef = React45__default.default.useRef(onReady);
20961
+ React45__default.default.useEffect(() => {
20962
+ onReadyRef.current = onReady;
20963
+ });
20964
+ React45__default.default.useEffect(() => {
20965
+ if (!onReadyRef.current) return;
20966
+ const msg = allDecided ? composeQueueMessage(items, decisions) : null;
20967
+ onReadyRef.current(allDecided && !isSubmitted, msg, decisions.filter(Boolean));
20968
+ }, [decisions, allDecided, isSubmitted]);
20969
+ React45__default.default.useEffect(() => {
20970
+ if (!submitRef) return;
20971
+ submitRef.current = handleSubmit;
20972
+ return () => {
20973
+ submitRef.current = null;
20974
+ };
20975
+ }, [submitRef, allDecided, isSubmitted, decisions]);
20976
+ return /* @__PURE__ */ jsxRuntime.jsxs(
20977
+ "div",
20978
+ {
20979
+ "data-testid": "decision-queue",
20980
+ "data-submitted": isSubmitted || void 0,
20981
+ style: {
20982
+ position: "relative",
20983
+ width: "100%",
20984
+ minWidth: 0,
20985
+ boxSizing: "border-box",
20986
+ borderRadius: "0.75rem",
20987
+ border: `1px solid ${BORDER4}`,
20988
+ background: "white",
20989
+ boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04)",
20990
+ padding: "16px 18px",
20991
+ display: "flex",
20992
+ flexDirection: "column",
20993
+ gap: 12,
20994
+ overflow: "hidden"
20995
+ },
20996
+ children: [
20997
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: KEYFRAMES3 }),
20998
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 3 }, children: [
20999
+ /* @__PURE__ */ jsxRuntime.jsx(
21000
+ "span",
21001
+ {
21002
+ style: {
21003
+ fontSize: 10.5,
21004
+ textTransform: "uppercase",
21005
+ letterSpacing: "0.07em",
21006
+ fontWeight: 700,
21007
+ color: isSubmitted ? GREEN4 : ACCENT2
21008
+ },
21009
+ children: isSubmitted ? "Decisions submitted" : "Decisions need you"
21010
+ }
21011
+ ),
21012
+ data.title && /* @__PURE__ */ jsxRuntime.jsx(
21013
+ "p",
21014
+ {
21015
+ style: {
21016
+ fontFamily: "var(--font-serif)",
21017
+ fontSize: 16,
21018
+ fontWeight: 400,
21019
+ color: "var(--foreground)",
21020
+ letterSpacing: "-0.01em",
21021
+ margin: 0,
21022
+ lineHeight: 1.25
21023
+ },
21024
+ children: data.title
21025
+ }
21026
+ ),
21027
+ data.description && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: 12.5, color: MUTED2, margin: 0, lineHeight: 1.45 }, children: data.description })
21028
+ ] }),
21029
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: items.map((item, idx) => {
21030
+ var _a3, _b, _c;
21031
+ const decision = shown[idx];
21032
+ const focused = !isSubmitted && focusIdx === idx;
21033
+ if (focused) {
21034
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dq-focus", "data-testid": `decision-queue-focus-${idx}`, children: /* @__PURE__ */ jsxRuntime.jsx(
21035
+ DecisionCardRenderer,
21036
+ {
21037
+ data: __spreadValues({ type: "decision-card" }, item),
21038
+ resolved: null,
21039
+ onResolve: (option, value) => decide(idx, option, value),
21040
+ eyebrow: `${idx + 1} of ${items.length}${item.decision_type ? ` \xB7 ${item.decision_type}` : ""}`
21041
+ }
21042
+ ) }, (_a3 = item.id) != null ? _a3 : `q-${idx}`);
21043
+ }
21044
+ if (decision) {
21045
+ return /* @__PURE__ */ jsxRuntime.jsxs(
21046
+ "button",
21047
+ {
21048
+ type: "button",
21049
+ className: "dq-settle",
21050
+ onClick: isSubmitted ? void 0 : () => setFocusIdx(idx),
21051
+ disabled: isSubmitted,
21052
+ title: isSubmitted ? void 0 : "Change this decision",
21053
+ "data-testid": `decision-queue-receipt-${idx}`,
21054
+ style: {
21055
+ display: "flex",
21056
+ alignItems: "center",
21057
+ gap: 8,
21058
+ width: "100%",
21059
+ textAlign: "left",
21060
+ border: "1px solid #dcfce7",
21061
+ background: "#f6fef9",
21062
+ borderRadius: 8,
21063
+ padding: "7px 11px",
21064
+ cursor: isSubmitted ? "default" : "pointer",
21065
+ font: "inherit"
21066
+ },
21067
+ children: [
21068
+ /* @__PURE__ */ jsxRuntime.jsx(Check, { size: 13, color: GREEN4 }),
21069
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 12.5, fontWeight: 600, color: "var(--foreground)", minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: item.title }),
21070
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", style: { color: MUTED2, fontSize: 12 }, children: "\u2192" }),
21071
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 12.5, fontWeight: 600, color: GREEN4, fontVariantNumeric: "tabular-nums", whiteSpace: "nowrap" }, children: figureOf(item, decision) }),
21072
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { flex: 1 } }),
21073
+ !isSubmitted && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 11, fontWeight: 600, color: MUTED2 }, children: "Change" })
21074
+ ]
21075
+ },
21076
+ (_b = item.id) != null ? _b : `q-${idx}`
21077
+ );
21078
+ }
21079
+ return /* @__PURE__ */ jsxRuntime.jsxs(
21080
+ "button",
21081
+ {
21082
+ type: "button",
21083
+ onClick: isSubmitted ? void 0 : () => setFocusIdx(idx),
21084
+ disabled: isSubmitted,
21085
+ "data-testid": `decision-queue-upcoming-${idx}`,
21086
+ style: {
21087
+ display: "flex",
21088
+ alignItems: "center",
21089
+ gap: 8,
21090
+ width: "100%",
21091
+ textAlign: "left",
21092
+ border: `1px dashed ${BORDER4}`,
21093
+ background: "white",
21094
+ borderRadius: 8,
21095
+ padding: "7px 11px",
21096
+ cursor: isSubmitted ? "default" : "pointer",
21097
+ font: "inherit",
21098
+ opacity: 0.75
21099
+ },
21100
+ children: [
21101
+ /* @__PURE__ */ jsxRuntime.jsx(
21102
+ "span",
21103
+ {
21104
+ "aria-hidden": "true",
21105
+ style: { width: 13, height: 13, borderRadius: "50%", border: `1.5px solid ${MUTED2}`, flexShrink: 0, boxSizing: "border-box" }
21106
+ }
21107
+ ),
21108
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: 12.5, fontWeight: 600, color: MUTED2, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
21109
+ item.decision_type ? `${item.decision_type} \xB7 ` : "",
21110
+ item.title
21111
+ ] }),
21112
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { flex: 1 } }),
21113
+ amountChip(item) && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 11.5, fontWeight: 700, color: MUTED2, fontVariantNumeric: "tabular-nums" }, children: amountChip(item) })
21114
+ ]
21115
+ },
21116
+ (_c = item.id) != null ? _c : `q-${idx}`
21117
+ );
21118
+ }) }),
21119
+ /* @__PURE__ */ jsxRuntime.jsxs(
21120
+ "div",
21121
+ {
21122
+ style: {
21123
+ display: "flex",
21124
+ alignItems: "center",
21125
+ gap: 10,
21126
+ paddingTop: 10,
21127
+ borderTop: `1px solid #f0f0f0`
21128
+ },
21129
+ children: [
21130
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "inline-flex", gap: 4 }, "aria-hidden": "true", children: items.map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
21131
+ "span",
21132
+ {
21133
+ style: {
21134
+ width: 7,
21135
+ height: 7,
21136
+ borderRadius: "50%",
21137
+ background: shown[i] ? isSubmitted ? GREEN4 : ACCENT2 : "#e8e8e8",
21138
+ transition: "background 0.2s"
21139
+ }
21140
+ },
21141
+ `dot-${i}`
21142
+ )) }),
21143
+ /* @__PURE__ */ jsxRuntime.jsxs(
21144
+ "span",
21145
+ {
21146
+ style: { fontSize: 11.5, fontWeight: 600, color: MUTED2, fontVariantNumeric: "tabular-nums" },
21147
+ "data-testid": "decision-queue-progress",
21148
+ children: [
21149
+ decidedCount,
21150
+ "/",
21151
+ items.length,
21152
+ " decided"
21153
+ ]
21154
+ }
21155
+ ),
21156
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { flex: 1 } }),
21157
+ isSubmitted ? /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 6, fontSize: 12.5, fontWeight: 600, color: GREEN4 }, children: [
21158
+ /* @__PURE__ */ jsxRuntime.jsx(Check, { size: 14, color: GREEN4 }),
21159
+ "Submitted"
21160
+ ] }) : hideSubmit ? null : /* @__PURE__ */ jsxRuntime.jsx(
21161
+ "button",
21162
+ {
21163
+ type: "button",
21164
+ onClick: handleSubmit,
21165
+ disabled: !allDecided,
21166
+ "data-testid": "decision-queue-submit",
21167
+ style: {
21168
+ border: `1px solid ${allDecided ? ACCENT2 : BORDER4}`,
21169
+ background: allDecided ? ACCENT2 : "#f6f6f6",
21170
+ color: allDecided ? "white" : MUTED2,
21171
+ borderRadius: 8,
21172
+ fontSize: 13,
21173
+ fontWeight: 600,
21174
+ padding: "8px 16px",
21175
+ cursor: allDecided ? "pointer" : "default",
21176
+ fontVariantNumeric: "tabular-nums",
21177
+ transition: "background 0.15s, border-color 0.15s, color 0.15s"
21178
+ },
21179
+ children: data.submit_label || `Submit ${items.length} decision${items.length === 1 ? "" : "s"}`
21180
+ }
21181
+ )
21182
+ ]
21183
+ }
21184
+ )
21185
+ ]
21186
+ }
21187
+ );
21188
+ }
21189
+ function DecisionQueueResolver(p) {
21190
+ var _a2, _b, _c, _d, _e, _f;
21191
+ const { resolvedDecisions, onDecisionQueueSubmit } = useGenUIInteraction();
21192
+ const queueId = (_b = (_a2 = p.id) != null ? _a2 : p.title) != null ? _b : "decision-queue";
21193
+ const replayed = (_d = (_c = p.resolved) == null ? void 0 : _c.decisions) != null ? _d : null;
21194
+ const [localSubmitted, setLocalSubmitted] = React45__default.default.useState(null);
21195
+ const hostLocked = (resolvedDecisions == null ? void 0 : resolvedDecisions[queueId]) != null;
21196
+ const submitted = (_e = replayed != null ? replayed : localSubmitted) != null ? _e : hostLocked ? [] : null;
21197
+ const handleSubmit = (decisions, message) => {
21198
+ setLocalSubmitted(decisions);
21199
+ onDecisionQueueSubmit == null ? void 0 : onDecisionQueueSubmit(queueId, decisions, message);
21200
+ };
21201
+ return /* @__PURE__ */ jsxRuntime.jsx(ComponentActions, { filename: (_f = p.title) != null ? _f : "decision-queue", children: /* @__PURE__ */ jsxRuntime.jsx(DecisionQueueRenderer, { data: p, submitted, onSubmit: handleSubmit }) });
21202
+ }
21203
+ init_ThemeContext();
20721
21204
  var CONNECTED_GREEN3 = "#15803d";
20722
21205
  var CONNECTED_GREEN_BG = "#dcfce7";
20723
21206
  var PENDING_AMBER = "#92400e";
@@ -21149,6 +21632,8 @@ function resolveUI(rawPayload) {
21149
21632
  return /* @__PURE__ */ jsxRuntime.jsx(DocumentFieldExtractionResolver, __spreadValues({}, payload));
21150
21633
  case "decision-card":
21151
21634
  return /* @__PURE__ */ jsxRuntime.jsx(DecisionCardResolver, __spreadValues({}, payload));
21635
+ case "decision-queue":
21636
+ return /* @__PURE__ */ jsxRuntime.jsx(DecisionQueueResolver, __spreadValues({}, payload));
21152
21637
  case "tabby-auth":
21153
21638
  return /* @__PURE__ */ jsxRuntime.jsx(TabbyAuthResolver, __spreadValues({}, payload));
21154
21639
  default: {