@adoptai/genui-components 0.1.58 → 0.1.59

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 (40) hide show
  1. package/dist/composites/document-field-extraction/resolver.cjs +1920 -0
  2. package/dist/composites/document-field-extraction/resolver.cjs.map +1 -0
  3. package/dist/composites/document-field-extraction/resolver.js +1913 -0
  4. package/dist/composites/document-field-extraction/resolver.js.map +1 -0
  5. package/dist/composites/tabby-auth/resolver.cjs +597 -0
  6. package/dist/composites/tabby-auth/resolver.cjs.map +1 -0
  7. package/dist/composites/tabby-auth/resolver.d.ts +3 -0
  8. package/dist/composites/tabby-auth/resolver.d.ts.map +1 -0
  9. package/dist/composites/tabby-auth/resolver.js +595 -0
  10. package/dist/composites/tabby-auth/resolver.js.map +1 -0
  11. package/dist/composites/workflow-stepper/resolver.cjs +86 -18
  12. package/dist/composites/workflow-stepper/resolver.cjs.map +1 -1
  13. package/dist/composites/workflow-stepper/resolver.d.ts.map +1 -1
  14. package/dist/composites/workflow-stepper/resolver.js +86 -18
  15. package/dist/composites/workflow-stepper/resolver.js.map +1 -1
  16. package/dist/index.cjs +492 -27
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.js +492 -27
  19. package/dist/index.js.map +1 -1
  20. package/dist/renderer.cjs +492 -27
  21. package/dist/renderer.cjs.map +1 -1
  22. package/dist/renderer.js +492 -27
  23. package/dist/renderer.js.map +1 -1
  24. package/dist/resolver.cjs +492 -27
  25. package/dist/resolver.cjs.map +1 -1
  26. package/dist/resolver.d.ts.map +1 -1
  27. package/dist/resolver.js +492 -27
  28. package/dist/resolver.js.map +1 -1
  29. package/dist/schemas/index.cjs +84 -3
  30. package/dist/schemas/index.cjs.map +1 -1
  31. package/dist/schemas/index.d.ts +118 -0
  32. package/dist/schemas/index.d.ts.map +1 -1
  33. package/dist/schemas/index.js +84 -3
  34. package/dist/schemas/index.js.map +1 -1
  35. package/dist/schemas/tabby-auth.d.ts +58 -0
  36. package/dist/schemas/tabby-auth.d.ts.map +1 -0
  37. package/dist/schemas/workflow-stepper.d.ts +60 -0
  38. package/dist/schemas/workflow-stepper.d.ts.map +1 -1
  39. package/dist/tool-definitions.json +102 -3
  40. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../src/resolver.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA+D3D,KAAK,UAAU,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;AAE9C,wBAAgB,SAAS,CAAC,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC,YAAY,CAsFpE"}
1
+ {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../src/resolver.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAgE3D,KAAK,UAAU,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;AAE9C,wBAAgB,SAAS,CAAC,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC,YAAY,CAuFpE"}
package/dist/resolver.js CHANGED
@@ -5217,7 +5217,32 @@ var workflowStepperSchema = z.object({
5217
5217
  n: z.number().int().positive().optional(),
5218
5218
  title: z.string(),
5219
5219
  sub: z.string().optional(),
5220
- status: z.enum(["done", "active", "review", "pending", "blocked", "failed"]),
5220
+ status: z.enum([
5221
+ "done",
5222
+ "active",
5223
+ "running",
5224
+ "review",
5225
+ "pending",
5226
+ "blocked",
5227
+ "failed"
5228
+ ]),
5229
+ // Optional quality-gate verdict for a step run by an executor (e.g. a
5230
+ // pipeline). Surfaces a subtle trust badge; flags hint at issues a human
5231
+ // should review (the full list lives in the escalation dock).
5232
+ eval: z.object({
5233
+ score: z.number().min(0).max(1).nullable().optional(),
5234
+ verdict: z.enum(["good", "bad"]).optional(),
5235
+ reasoning: z.string().optional(),
5236
+ judge_ok: z.boolean().optional(),
5237
+ data_quality_flags: z.array(
5238
+ z.object({
5239
+ field: z.string().optional(),
5240
+ issue: z.string().optional(),
5241
+ severity: z.enum(["low", "medium", "high"]).optional(),
5242
+ details: z.string().optional()
5243
+ })
5244
+ ).optional()
5245
+ }).optional(),
5221
5246
  assignees: z.array(
5222
5247
  z.object({
5223
5248
  name: z.string(),
@@ -5253,7 +5278,32 @@ var workflowStepperTool = {
5253
5278
  n: { type: "number", description: "Step number; defaults to index + 1" },
5254
5279
  title: { type: "string" },
5255
5280
  sub: { type: "string", description: "Short status caption, e.g. '7 accounts \xB7 2 exceptions'" },
5256
- status: { type: "string", enum: ["done", "active", "review", "pending", "blocked", "failed"] },
5281
+ status: {
5282
+ type: "string",
5283
+ enum: ["done", "active", "running", "review", "pending", "blocked", "failed"]
5284
+ },
5285
+ eval: {
5286
+ type: "object",
5287
+ description: "Optional quality-gate verdict for an executor-run step.",
5288
+ properties: {
5289
+ score: { type: "number" },
5290
+ verdict: { type: "string", enum: ["good", "bad"] },
5291
+ reasoning: { type: "string" },
5292
+ judge_ok: { type: "boolean" },
5293
+ data_quality_flags: {
5294
+ type: "array",
5295
+ items: {
5296
+ type: "object",
5297
+ properties: {
5298
+ field: { type: "string" },
5299
+ issue: { type: "string" },
5300
+ severity: { type: "string", enum: ["low", "medium", "high"] },
5301
+ details: { type: "string" }
5302
+ }
5303
+ }
5304
+ }
5305
+ }
5306
+ },
5257
5307
  assignees: {
5258
5308
  type: "array",
5259
5309
  maxItems: 6,
@@ -5557,6 +5607,36 @@ var decisionCardTool = {
5557
5607
  required: ["type", "title", "question", "options"]
5558
5608
  }
5559
5609
  };
5610
+ var tabbyAuthSchema = z.object({
5611
+ type: z.literal("tabby-auth"),
5612
+ app: z.string(),
5613
+ url: z.string(),
5614
+ workspace: z.string().optional(),
5615
+ state: z.enum(["pending", "connected"]).optional(),
5616
+ ctaLabel: z.string().optional(),
5617
+ steps: z.array(z.string()).optional(),
5618
+ description: z.string().optional(),
5619
+ iconUrl: z.string().optional()
5620
+ });
5621
+ var tabbyAuthTool = {
5622
+ name: "render_tabby_auth",
5623
+ description: "Render a dedicated, trustworthy sign-in card when a harness skill needs the member to authenticate with a third-party app (e.g. Sage Intacct, Airbnb, an ERP) before a `call_web_api` request can proceed. Use this for the `login_required` path instead of a raw markdown link or a connect-integration card. `app` is the human display name (drives the title context, subtitle, and CTA). `url` is the login/short-link the prominent CTA opens in a new tab. `workspace` adds a subtitle suffix ('{app} \xB7 {workspace} workspace'). `state='pending'` (default) is the first-time connect; `state='connected'` is the verify/re-auth case (session already live) with a green badge and an Open deep-link. `steps` overrides the default numbered instructions; `description` is a one-line intro. The card title ('Authentication required') and the 'Credentials not stored by Adopt' trust footer are hardcoded brand constants \u2014 never supplied here.",
5624
+ input_schema: {
5625
+ type: "object",
5626
+ properties: {
5627
+ type: { type: "string", enum: ["tabby-auth"] },
5628
+ app: { type: "string" },
5629
+ url: { type: "string" },
5630
+ workspace: { type: "string" },
5631
+ state: { type: "string", enum: ["pending", "connected"] },
5632
+ ctaLabel: { type: "string" },
5633
+ steps: { type: "array", items: { type: "string" } },
5634
+ description: { type: "string" },
5635
+ iconUrl: { type: "string" }
5636
+ },
5637
+ required: ["type", "app", "url"]
5638
+ }
5639
+ };
5560
5640
 
5561
5641
  // src/schemas/index.ts
5562
5642
  var schemaRegistry = {
@@ -5618,7 +5698,8 @@ var schemaRegistry = {
5618
5698
  "pipeline-preview": { schema: pipelinePreviewSchema, tool: pipelinePreviewTool },
5619
5699
  "workflow-stepper": { schema: workflowStepperSchema, tool: workflowStepperTool },
5620
5700
  "document-field-extraction": { schema: documentFieldExtractionSchema, tool: documentFieldExtractionTool },
5621
- "decision-card": { schema: decisionCardSchema, tool: decisionCardTool }
5701
+ "decision-card": { schema: decisionCardSchema, tool: decisionCardTool },
5702
+ "tabby-auth": { schema: tabbyAuthSchema, tool: tabbyAuthTool }
5622
5703
  };
5623
5704
 
5624
5705
  // src/schemas/coercePayload.ts
@@ -6356,17 +6437,17 @@ function SparklineTableResolver(p) {
6356
6437
  // src/composites/heatmap-table/resolver.tsx
6357
6438
  init_theme();
6358
6439
  init_ThemeContext();
6359
- function heatColor(z60) {
6360
- const clamped = Math.max(-3, Math.min(3, z60));
6440
+ function heatColor(z61) {
6441
+ const clamped = Math.max(-3, Math.min(3, z61));
6361
6442
  const abs = Math.abs(clamped);
6362
6443
  const lightness = 95 - abs * 8;
6363
6444
  const hue = clamped >= 0 ? 142 : 0;
6364
6445
  return `hsl(${hue} 60% ${lightness}%)`;
6365
6446
  }
6366
- function heatTextColor(z60) {
6367
- const abs = Math.abs(z60);
6368
- if (abs > 2) return z60 >= 0 ? "#14532d" : "#7f1d1d";
6369
- if (abs > 1) return z60 >= 0 ? "#166534" : "#991b1b";
6447
+ function heatTextColor(z61) {
6448
+ const abs = Math.abs(z61);
6449
+ if (abs > 2) return z61 >= 0 ? "#14532d" : "#7f1d1d";
6450
+ if (abs > 1) return z61 >= 0 ? "#166534" : "#991b1b";
6370
6451
  return "var(--foreground)";
6371
6452
  }
6372
6453
  var th2 = {
@@ -17424,6 +17505,8 @@ var STATUS_COLORS3 = {
17424
17505
  done: "#15803d",
17425
17506
  active: "",
17426
17507
  // filled from theme ACCENT at render time
17508
+ running: "",
17509
+ // filled from theme ACCENT at render time (executor in flight)
17427
17510
  review: "#f59e0b",
17428
17511
  pending: "#9ca3af",
17429
17512
  blocked: "#b45309",
@@ -17432,6 +17515,7 @@ var STATUS_COLORS3 = {
17432
17515
  var STATUS_LABELS = {
17433
17516
  done: "Complete",
17434
17517
  active: "In progress",
17518
+ running: "Running",
17435
17519
  review: "In review",
17436
17520
  pending: "Pending",
17437
17521
  blocked: "Blocked",
@@ -17535,6 +17619,26 @@ function IndexDot({ step, index, accent }) {
17535
17619
  if (step.status === "failed") {
17536
17620
  return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "#dc2626", color: "white" }), children: /* @__PURE__ */ jsx("span", { style: { fontSize: 10 }, children: "!" }) });
17537
17621
  }
17622
+ if (step.status === "running") {
17623
+ return /* @__PURE__ */ jsxs("div", { style: __spreadProps(__spreadValues({}, base), { position: "relative", background: `${accent}1f`, color: accent }), children: [
17624
+ /* @__PURE__ */ jsx(
17625
+ "span",
17626
+ {
17627
+ className: "wfs-anim",
17628
+ "aria-hidden": "true",
17629
+ style: {
17630
+ position: "absolute",
17631
+ inset: 0,
17632
+ borderRadius: "50%",
17633
+ border: `1.5px solid ${accent}33`,
17634
+ borderTopColor: accent,
17635
+ animation: "wfsSpin 0.8s linear infinite"
17636
+ }
17637
+ }
17638
+ ),
17639
+ /* @__PURE__ */ jsx("span", { style: { fontSize: 9 }, children: n })
17640
+ ] });
17641
+ }
17538
17642
  if (step.status === "active") {
17539
17643
  return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: accent, color: "white" }), children: n });
17540
17644
  }
@@ -17543,6 +17647,44 @@ function IndexDot({ step, index, accent }) {
17543
17647
  }
17544
17648
  return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "#f2f2f2", color: "#9ca3af" }), children: n });
17545
17649
  }
17650
+ function EvalBadge({ step }) {
17651
+ var _a;
17652
+ const ev = step.eval;
17653
+ if (!ev || ev.judge_ok === false) return null;
17654
+ const score = typeof ev.score === "number" ? ev.score : null;
17655
+ const flags = (_a = ev.data_quality_flags) != null ? _a : [];
17656
+ const bad = ev.verdict === "bad" || score !== null && score < 0.8;
17657
+ const tip = flags.length > 0 ? flags.map((f) => {
17658
+ var _a2;
17659
+ return `${(_a2 = f.severity) != null ? _a2 : "?"}: ${f.details || f.issue || f.field || "issue"}`;
17660
+ }).join("\n") : ev.reasoning || void 0;
17661
+ const label = score !== null ? score.toFixed(2) : bad ? "flagged" : "ok";
17662
+ return /* @__PURE__ */ jsxs(
17663
+ "span",
17664
+ {
17665
+ title: tip,
17666
+ "data-testid": `workflow-stepper-eval-${step.id}`,
17667
+ style: {
17668
+ display: "inline-flex",
17669
+ alignItems: "center",
17670
+ gap: 3,
17671
+ fontSize: 9,
17672
+ fontWeight: 700,
17673
+ padding: "1px 6px",
17674
+ borderRadius: 9999,
17675
+ background: bad ? "#fff7ed" : "#dcfce7",
17676
+ color: bad ? "#b45309" : "#15803d",
17677
+ whiteSpace: "nowrap",
17678
+ flexShrink: 0
17679
+ },
17680
+ children: [
17681
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: bad ? "\u26A0" : "\u2713" }),
17682
+ label,
17683
+ flags.length > 0 ? ` \xB7 ${flags.length}` : ""
17684
+ ]
17685
+ }
17686
+ );
17687
+ }
17546
17688
  var CARD_MIN = 132;
17547
17689
  var CARD_GAP = 16;
17548
17690
  var AUTO_COMPACT_BELOW = 360;
@@ -17567,6 +17709,7 @@ var KEYFRAMES = `
17567
17709
  @keyframes wfsLampPulse{0%,100%{box-shadow:0 0 0 0 var(--wfs-accent,#6366f1)73}50%{box-shadow:0 0 0 4px transparent}}
17568
17710
  @keyframes wfsRise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
17569
17711
  @keyframes wfsShimmer{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}
17712
+ @keyframes wfsSpin{to{transform:rotate(360deg)}}
17570
17713
  .wfs-rise{animation:wfsRise 0.32s cubic-bezier(0.22,1,0.36,1) both}
17571
17714
  @media (prefers-reduced-motion: reduce){
17572
17715
  .wfs-anim,.wfs-rise,.wfs-shim{animation:none !important}
@@ -17647,7 +17790,7 @@ function WorkflowStepperRenderer({
17647
17790
  const steps = (_a = data.steps) != null ? _a : [];
17648
17791
  const activeStepId = (_d = (_c = data.active_step) != null ? _c : (_b = steps.find((s) => s.status === "active")) == null ? void 0 : _b.id) != null ? _d : null;
17649
17792
  const interactive = typeof onSelectStep === "function";
17650
- const statusColor3 = (s) => s === "active" ? ACCENT2 : STATUS_COLORS3[s];
17793
+ const statusColor3 = (s) => s === "active" || s === "running" ? ACCENT2 : STATUS_COLORS3[s];
17651
17794
  const doneCount = steps.filter((s) => s.status === "done").length;
17652
17795
  const rootRef = React45.useRef(null);
17653
17796
  const containerW = useContainerWidth(rootRef);
@@ -17875,6 +18018,7 @@ function WorkflowStepperRenderer({
17875
18018
  var _a2;
17876
18019
  const isSelected = selectedStep === step.id;
17877
18020
  const isActive = step.status === "active";
18021
+ const isRunning = step.status === "running";
17878
18022
  const reached = step.status !== "pending";
17879
18023
  const clickable = interactive && reached;
17880
18024
  const color = statusColor3(step.status);
@@ -17971,36 +18115,41 @@ function WorkflowStepperRenderer({
17971
18115
  }
17972
18116
  }
17973
18117
  ),
17974
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
17975
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
18118
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 4 }, children: [
18119
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6, minWidth: 0 }, children: [
17976
18120
  /* @__PURE__ */ jsx(IndexDot, { step, index: i, accent: ACCENT2 }),
17977
18121
  /* @__PURE__ */ jsx(
17978
18122
  "span",
17979
18123
  {
17980
- className: isActive ? "wfs-anim" : void 0,
18124
+ className: isActive || isRunning ? "wfs-anim" : void 0,
17981
18125
  style: {
17982
18126
  width: 6,
17983
18127
  height: 6,
17984
18128
  borderRadius: "50%",
17985
18129
  background: color,
17986
- animation: isActive ? "wfsLampPulse 1.8s ease-in-out infinite" : "none"
18130
+ flexShrink: 0,
18131
+ animation: isActive || isRunning ? "wfsLampPulse 1.8s ease-in-out infinite" : "none"
17987
18132
  }
17988
18133
  }
17989
18134
  )
17990
18135
  ] }),
17991
- /* @__PURE__ */ jsx(
17992
- "span",
17993
- {
17994
- style: {
17995
- fontSize: 9,
17996
- fontWeight: 600,
17997
- letterSpacing: "0.05em",
17998
- textTransform: "uppercase",
17999
- color
18000
- },
18001
- children: STATUS_LABELS[step.status]
18002
- }
18003
- )
18136
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4, minWidth: 0 }, children: [
18137
+ /* @__PURE__ */ jsx(EvalBadge, { step }),
18138
+ /* @__PURE__ */ jsx(
18139
+ "span",
18140
+ {
18141
+ style: {
18142
+ fontSize: 9,
18143
+ fontWeight: 600,
18144
+ letterSpacing: "0.05em",
18145
+ textTransform: "uppercase",
18146
+ color,
18147
+ whiteSpace: "nowrap"
18148
+ },
18149
+ children: STATUS_LABELS[step.status]
18150
+ }
18151
+ )
18152
+ ] })
18004
18153
  ] }),
18005
18154
  /* @__PURE__ */ jsxs("div", { style: { minWidth: 0 }, children: [
18006
18155
  /* @__PURE__ */ jsx(
@@ -18190,12 +18339,14 @@ var BADGE_TITLE = {
18190
18339
  var BADGE_STYLE = {
18191
18340
  SC: { bg: "#dcfce7", fg: "#15803d" },
18192
18341
  CN: { bg: "#eff6ff", fg: "#0364ff" },
18342
+ // theme-ok (SECONDARY)
18193
18343
  AB: { bg: "#fff7ed", fg: "#92400e" },
18194
18344
  SW: { bg: "#fef2f2", fg: "#dc2626" }
18195
18345
  };
18196
18346
  var STATE_DOT = {
18197
18347
  ok: "#15803d",
18198
18348
  corrected: "#0364ff",
18349
+ // theme-ok (SECONDARY)
18199
18350
  missing: "#dc2626",
18200
18351
  warn: "#f59e0b"
18201
18352
  };
@@ -18558,6 +18709,7 @@ var BADGE_DOT = {
18558
18709
  missing: "#dc2626",
18559
18710
  red: "#dc2626",
18560
18711
  corrected: "#0364ff"
18712
+ // theme-ok (SECONDARY)
18561
18713
  };
18562
18714
  function FieldDetails({
18563
18715
  summary,
@@ -20076,6 +20228,317 @@ function DecisionCardResolver(p) {
20076
20228
  }
20077
20229
  ) });
20078
20230
  }
20231
+ init_ThemeContext();
20232
+ var CONNECTED_GREEN3 = "#15803d";
20233
+ var CONNECTED_GREEN_BG = "#dcfce7";
20234
+ var PENDING_AMBER = "#92400e";
20235
+ var PENDING_AMBER_BG = "#fff7ed";
20236
+ var CARD_TITLE = "Authentication required";
20237
+ var TRUST_FOOTER = "Credentials not stored by Adopt";
20238
+ var DEFAULT_STEPS = (app, ctaLabel, connected) => connected ? [
20239
+ `Click ${ctaLabel} below to open ${app} in a new tab.`,
20240
+ "Confirm you are signed in \u2014 re-authenticate if prompted.",
20241
+ "Return here \u2014 the request continues automatically."
20242
+ ] : [
20243
+ `Click ${ctaLabel} below to open the sign-in page.`,
20244
+ `Sign in with your ${app} credentials \u2014 SSO is supported.`,
20245
+ "Return here \u2014 the request resumes automatically."
20246
+ ];
20247
+ function humanizeApp(raw) {
20248
+ const v = raw.trim();
20249
+ if (!v) return v;
20250
+ const looksLikeSlug = /^[a-z0-9]+([_-][a-z0-9]+)*$/.test(v);
20251
+ if (!looksLikeSlug) return v;
20252
+ return v.split(/[_-]+/).map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
20253
+ }
20254
+ function ShieldIcon({ color }) {
20255
+ return /* @__PURE__ */ jsxs(
20256
+ "svg",
20257
+ {
20258
+ width: "13",
20259
+ height: "13",
20260
+ viewBox: "0 0 24 24",
20261
+ fill: "none",
20262
+ stroke: color,
20263
+ strokeWidth: "2",
20264
+ strokeLinecap: "round",
20265
+ strokeLinejoin: "round",
20266
+ "aria-hidden": "true",
20267
+ style: { flexShrink: 0 },
20268
+ children: [
20269
+ /* @__PURE__ */ jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }),
20270
+ /* @__PURE__ */ jsx("path", { d: "m9 12 2 2 4-4" })
20271
+ ]
20272
+ }
20273
+ );
20274
+ }
20275
+ function ExternalIcon() {
20276
+ return /* @__PURE__ */ jsxs(
20277
+ "svg",
20278
+ {
20279
+ width: "13",
20280
+ height: "13",
20281
+ viewBox: "0 0 24 24",
20282
+ fill: "none",
20283
+ stroke: "currentColor",
20284
+ strokeWidth: "2",
20285
+ strokeLinecap: "round",
20286
+ strokeLinejoin: "round",
20287
+ "aria-hidden": "true",
20288
+ style: { flexShrink: 0 },
20289
+ children: [
20290
+ /* @__PURE__ */ jsx("path", { d: "M15 3h6v6" }),
20291
+ /* @__PURE__ */ jsx("path", { d: "M10 14 21 3" }),
20292
+ /* @__PURE__ */ jsx("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })
20293
+ ]
20294
+ }
20295
+ );
20296
+ }
20297
+ function TabbyAuthResolver(p) {
20298
+ var _a, _b, _c;
20299
+ const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2, ACCENT_SOFT: ACCENT_SOFT2 } = useTheme();
20300
+ const [cardHovered, setCardHovered] = useState(false);
20301
+ const [btnHovered, setBtnHovered] = useState(false);
20302
+ const [imgFailed, setImgFailed] = useState(false);
20303
+ const app = humanizeApp(p.app || "the app");
20304
+ const connected = p.state === "connected";
20305
+ const accent = connected ? CONNECTED_GREEN3 : ACCENT2;
20306
+ const ctaLabel = (_a = p.ctaLabel) != null ? _a : connected ? `Open ${app}` : `Connect ${app}`;
20307
+ const subtitle = p.workspace ? `${app} \xB7 ${p.workspace} workspace` : app;
20308
+ const steps = ((_b = p.steps) == null ? void 0 : _b.length) ? p.steps : DEFAULT_STEPS(app, ctaLabel, connected);
20309
+ const description = (_c = p.description) != null ? _c : connected ? `Your ${app} session is active. Open ${app} to continue, or re-authenticate if prompted.` : `Your ${app} account is not yet connected to this workspace. Complete sign-in once to enable automatic access.`;
20310
+ const iconSrc = p.iconUrl || brandIconUrl(app);
20311
+ const showImg = Boolean(iconSrc) && !imgFailed;
20312
+ const initial = app.charAt(0).toUpperCase();
20313
+ const badge = connected ? { label: "Connected", bg: CONNECTED_GREEN_BG, color: CONNECTED_GREEN3 } : { label: "Pending sign-in", bg: PENDING_AMBER_BG, color: PENDING_AMBER };
20314
+ const sectionPad = "13px 16px";
20315
+ return /* @__PURE__ */ jsx(ComponentActions, { filename: `${app} authentication`, children: /* @__PURE__ */ jsx("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: "10px" }, children: /* @__PURE__ */ jsxs(
20316
+ "div",
20317
+ {
20318
+ onMouseEnter: () => setCardHovered(true),
20319
+ onMouseLeave: () => setCardHovered(false),
20320
+ style: {
20321
+ display: "flex",
20322
+ flexDirection: "row",
20323
+ alignItems: "stretch",
20324
+ borderRadius: "0.75rem",
20325
+ border: `1px solid ${cardHovered ? "#d2d2d2" : BORDER4}`,
20326
+ background: "white",
20327
+ overflow: "hidden",
20328
+ boxShadow: cardHovered ? "0 1px 3px rgba(0,0,0,0.05), 0 6px 18px rgba(0,0,0,0.06)" : "0 1px 2px rgba(0,0,0,0.03)",
20329
+ transition: "box-shadow 0.18s ease, border-color 0.18s ease"
20330
+ },
20331
+ children: [
20332
+ /* @__PURE__ */ jsx("div", { style: { width: "3px", flexShrink: 0, background: accent } }),
20333
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column" }, children: [
20334
+ /* @__PURE__ */ jsxs(
20335
+ "div",
20336
+ {
20337
+ style: {
20338
+ display: "flex",
20339
+ alignItems: "flex-start",
20340
+ gap: "12px",
20341
+ padding: sectionPad
20342
+ },
20343
+ children: [
20344
+ /* @__PURE__ */ jsx(
20345
+ "div",
20346
+ {
20347
+ style: {
20348
+ position: "relative",
20349
+ width: "34px",
20350
+ height: "34px",
20351
+ borderRadius: "9px",
20352
+ flexShrink: 0,
20353
+ display: "flex",
20354
+ alignItems: "center",
20355
+ justifyContent: "center",
20356
+ background: showImg ? "white" : "#fff3ee",
20357
+ boxShadow: "inset 0 0 0 1px rgba(0,0,0,0.06)",
20358
+ overflow: "hidden"
20359
+ },
20360
+ children: showImg ? /* @__PURE__ */ jsx(
20361
+ "img",
20362
+ {
20363
+ src: iconSrc,
20364
+ alt: app,
20365
+ onError: () => setImgFailed(true),
20366
+ style: { width: "22px", height: "22px", objectFit: "contain" }
20367
+ }
20368
+ ) : /* @__PURE__ */ jsx(
20369
+ "span",
20370
+ {
20371
+ style: {
20372
+ fontFamily: "var(--font-serif)",
20373
+ fontSize: "17px",
20374
+ fontWeight: 400,
20375
+ color: ACCENT2,
20376
+ lineHeight: 1
20377
+ },
20378
+ children: initial
20379
+ }
20380
+ )
20381
+ }
20382
+ ),
20383
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column", gap: "2px" }, children: [
20384
+ /* @__PURE__ */ jsx(
20385
+ "span",
20386
+ {
20387
+ style: {
20388
+ fontFamily: "var(--font-serif)",
20389
+ fontSize: "15px",
20390
+ fontWeight: 400,
20391
+ color: "var(--foreground)",
20392
+ letterSpacing: "-0.01em",
20393
+ lineHeight: 1.2
20394
+ },
20395
+ children: CARD_TITLE
20396
+ }
20397
+ ),
20398
+ /* @__PURE__ */ jsx(
20399
+ "span",
20400
+ {
20401
+ style: {
20402
+ fontSize: "12px",
20403
+ color: MUTED2,
20404
+ whiteSpace: "nowrap",
20405
+ overflow: "hidden",
20406
+ textOverflow: "ellipsis"
20407
+ },
20408
+ children: subtitle
20409
+ }
20410
+ )
20411
+ ] }),
20412
+ /* @__PURE__ */ jsxs(
20413
+ "span",
20414
+ {
20415
+ style: {
20416
+ display: "inline-flex",
20417
+ alignItems: "center",
20418
+ gap: "5px",
20419
+ flexShrink: 0,
20420
+ fontSize: "10.5px",
20421
+ fontWeight: 600,
20422
+ padding: "3px 9px",
20423
+ borderRadius: "9999px",
20424
+ background: badge.bg,
20425
+ color: badge.color,
20426
+ whiteSpace: "nowrap"
20427
+ },
20428
+ children: [
20429
+ /* @__PURE__ */ jsx(
20430
+ "span",
20431
+ {
20432
+ style: {
20433
+ width: "6px",
20434
+ height: "6px",
20435
+ borderRadius: "9999px",
20436
+ background: badge.color
20437
+ }
20438
+ }
20439
+ ),
20440
+ badge.label
20441
+ ]
20442
+ }
20443
+ )
20444
+ ]
20445
+ }
20446
+ ),
20447
+ /* @__PURE__ */ jsxs(
20448
+ "div",
20449
+ {
20450
+ style: {
20451
+ borderTop: `1px solid ${BORDER4}`,
20452
+ padding: sectionPad,
20453
+ display: "flex",
20454
+ flexDirection: "column",
20455
+ gap: "12px"
20456
+ },
20457
+ children: [
20458
+ description && /* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: "12.5px", lineHeight: 1.5, color: "var(--foreground)" }, children: description }),
20459
+ /* @__PURE__ */ jsx("ol", { style: { margin: 0, padding: 0, listStyle: "none", display: "flex", flexDirection: "column", gap: "8px" }, children: steps.map((step, i) => /* @__PURE__ */ jsxs("li", { style: { display: "flex", alignItems: "flex-start", gap: "10px" }, children: [
20460
+ /* @__PURE__ */ jsx(
20461
+ "span",
20462
+ {
20463
+ style: {
20464
+ flexShrink: 0,
20465
+ width: "18px",
20466
+ height: "18px",
20467
+ borderRadius: "9999px",
20468
+ background: accent,
20469
+ color: "white",
20470
+ fontSize: "10.5px",
20471
+ fontWeight: 600,
20472
+ display: "flex",
20473
+ alignItems: "center",
20474
+ justifyContent: "center",
20475
+ marginTop: "1px"
20476
+ },
20477
+ children: i + 1
20478
+ }
20479
+ ),
20480
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "12.5px", lineHeight: 1.45, color: "var(--foreground)" }, children: step })
20481
+ ] }, i)) })
20482
+ ]
20483
+ }
20484
+ ),
20485
+ /* @__PURE__ */ jsxs(
20486
+ "div",
20487
+ {
20488
+ style: {
20489
+ borderTop: `1px solid ${BORDER4}`,
20490
+ padding: sectionPad,
20491
+ background: "#fbfbfb",
20492
+ display: "flex",
20493
+ alignItems: "center",
20494
+ justifyContent: "space-between",
20495
+ gap: "12px",
20496
+ flexWrap: "wrap"
20497
+ },
20498
+ children: [
20499
+ /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: "6px", color: MUTED2, fontSize: "11.5px" }, children: [
20500
+ /* @__PURE__ */ jsx(ShieldIcon, { color: CONNECTED_GREEN3 }),
20501
+ TRUST_FOOTER
20502
+ ] }),
20503
+ /* @__PURE__ */ jsxs(
20504
+ "a",
20505
+ {
20506
+ href: p.url,
20507
+ target: "_blank",
20508
+ rel: "noopener noreferrer",
20509
+ onMouseEnter: () => setBtnHovered(true),
20510
+ onMouseLeave: () => setBtnHovered(false),
20511
+ style: {
20512
+ display: "inline-flex",
20513
+ alignItems: "center",
20514
+ gap: "7px",
20515
+ flexShrink: 0,
20516
+ borderRadius: "8px",
20517
+ padding: "8px 15px",
20518
+ fontSize: "12.5px",
20519
+ fontWeight: 600,
20520
+ textDecoration: "none",
20521
+ whiteSpace: "nowrap",
20522
+ cursor: "pointer",
20523
+ color: "white",
20524
+ border: "1px solid transparent",
20525
+ background: btnHovered ? connected ? "#126a33" : ACCENT_SOFT2 : accent,
20526
+ transition: "background 0.15s ease"
20527
+ },
20528
+ children: [
20529
+ /* @__PURE__ */ jsx(ExternalIcon, {}),
20530
+ ctaLabel
20531
+ ]
20532
+ }
20533
+ )
20534
+ ]
20535
+ }
20536
+ )
20537
+ ] })
20538
+ ]
20539
+ }
20540
+ ) }) });
20541
+ }
20079
20542
  function resolveUI(rawPayload) {
20080
20543
  const payload = coercePayload(rawPayload);
20081
20544
  switch (payload.type) {
@@ -20197,6 +20660,8 @@ function resolveUI(rawPayload) {
20197
20660
  return /* @__PURE__ */ jsx(DocumentFieldExtractionResolver, __spreadValues({}, payload));
20198
20661
  case "decision-card":
20199
20662
  return /* @__PURE__ */ jsx(DecisionCardResolver, __spreadValues({}, payload));
20663
+ case "tabby-auth":
20664
+ return /* @__PURE__ */ jsx(TabbyAuthResolver, __spreadValues({}, payload));
20200
20665
  default: {
20201
20666
  return /* @__PURE__ */ jsx(
20202
20667
  "div",