oneshot-gtm-server 0.2.0 → 0.3.0

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 (67) hide show
  1. package/dist/bin.mjs +1602 -1127
  2. package/dist/bin.mjs.map +1 -1
  3. package/dist/web/assets/{Badge-DE7L41a6.js → Badge-Bl9eBoUa.js} +2 -2
  4. package/dist/web/assets/{Badge-DE7L41a6.js.map → Badge-Bl9eBoUa.js.map} +1 -1
  5. package/dist/web/assets/Button-D1rFtlez.js +2 -0
  6. package/dist/web/assets/Button-D1rFtlez.js.map +1 -0
  7. package/dist/web/assets/{EmptyNote-DkmaZWuo.js → EmptyNote-CZaRRtmD.js} +2 -2
  8. package/dist/web/assets/{EmptyNote-DkmaZWuo.js.map → EmptyNote-CZaRRtmD.js.map} +1 -1
  9. package/dist/web/assets/{Field-B4mT8TGa.js → Field-DJ9InfU_.js} +2 -2
  10. package/dist/web/assets/{Field-B4mT8TGa.js.map → Field-DJ9InfU_.js.map} +1 -1
  11. package/dist/web/assets/{Modal-frAt7msr.js → Modal-CturxR2v.js} +2 -2
  12. package/dist/web/assets/{Modal-frAt7msr.js.map → Modal-CturxR2v.js.map} +1 -1
  13. package/dist/web/assets/{Skeleton-d2p06ghN.js → Skeleton-CHzR-B21.js} +2 -2
  14. package/dist/web/assets/{Skeleton-d2p06ghN.js.map → Skeleton-CHzR-B21.js.map} +1 -1
  15. package/dist/web/assets/cadences-D9cvMlfq.js +2 -0
  16. package/dist/web/assets/cadences-D9cvMlfq.js.map +1 -0
  17. package/dist/web/assets/chevron-down-J-vUa4uQ.js +2 -0
  18. package/dist/web/assets/chevron-down-J-vUa4uQ.js.map +1 -0
  19. package/dist/web/assets/chevron-right-DAxZefV9.js +2 -0
  20. package/dist/web/assets/chevron-right-DAxZefV9.js.map +1 -0
  21. package/dist/web/assets/inbox-Dsg3_bXr.js +2 -0
  22. package/dist/web/assets/{inbox-Dzd9QYT4.js.map → inbox-Dsg3_bXr.js.map} +1 -1
  23. package/dist/web/assets/{index-CzTgATNQ.js → index-BVno9lTD.js} +4 -4
  24. package/dist/web/assets/index-BVno9lTD.js.map +1 -0
  25. package/dist/web/assets/index-Ya_svHJk.css +2 -0
  26. package/dist/web/assets/loader-circle-B_w_dqVu.js +2 -0
  27. package/dist/web/assets/{loader-circle-BylpxA-u.js.map → loader-circle-B_w_dqVu.js.map} +1 -1
  28. package/dist/web/assets/{measure-S3BWSb2L.js → measure-CV7Towgf.js} +2 -2
  29. package/dist/web/assets/{measure-S3BWSb2L.js.map → measure-CV7Towgf.js.map} +1 -1
  30. package/dist/web/assets/{plays-DHIZA49D.js → plays-BSlXDDDK.js} +2 -2
  31. package/dist/web/assets/plays-BSlXDDDK.js.map +1 -0
  32. package/dist/web/assets/queue-BHKT-qjx.js +2 -0
  33. package/dist/web/assets/queue-BHKT-qjx.js.map +1 -0
  34. package/dist/web/assets/{receipts-BgXV3-De.js → receipts-opTtY1t7.js} +2 -2
  35. package/dist/web/assets/{receipts-BgXV3-De.js.map → receipts-opTtY1t7.js.map} +1 -1
  36. package/dist/web/assets/{refresh-cw-BpMRSA9y.js → refresh-cw-BO0blIzU.js} +2 -2
  37. package/dist/web/assets/{refresh-cw-BpMRSA9y.js.map → refresh-cw-BO0blIzU.js.map} +1 -1
  38. package/dist/web/assets/routes-BgDvPuJP.js +2 -0
  39. package/dist/web/assets/{routes-B9L9tBMF.js.map → routes-BgDvPuJP.js.map} +1 -1
  40. package/dist/web/assets/run._playName-CQU-5e18.js +5 -0
  41. package/dist/web/assets/run._playName-CQU-5e18.js.map +1 -0
  42. package/dist/web/assets/send-9D8YeqmY.js +2 -0
  43. package/dist/web/assets/send-9D8YeqmY.js.map +1 -0
  44. package/dist/web/assets/setup-CqCzlBdR.js +2 -0
  45. package/dist/web/assets/setup-CqCzlBdR.js.map +1 -0
  46. package/dist/web/assets/{summarizeRun-BsPt7szF.js → summarizeRun-D5Pd2arb.js} +1 -1
  47. package/dist/web/assets/{summarizeRun-BsPt7szF.js.map → summarizeRun-D5Pd2arb.js.map} +1 -1
  48. package/dist/web/index.html +3 -3
  49. package/package.json +1 -1
  50. package/dist/web/assets/Button-NJ1UVzeB.js +0 -2
  51. package/dist/web/assets/Button-NJ1UVzeB.js.map +0 -1
  52. package/dist/web/assets/cadences-CsU8vKw2.js +0 -2
  53. package/dist/web/assets/cadences-CsU8vKw2.js.map +0 -1
  54. package/dist/web/assets/chevron-right-BXb7J1cp.js +0 -2
  55. package/dist/web/assets/chevron-right-BXb7J1cp.js.map +0 -1
  56. package/dist/web/assets/inbox-Dzd9QYT4.js +0 -2
  57. package/dist/web/assets/index-ByTPAanr.css +0 -2
  58. package/dist/web/assets/index-CzTgATNQ.js.map +0 -1
  59. package/dist/web/assets/loader-circle-BylpxA-u.js +0 -2
  60. package/dist/web/assets/plays-DHIZA49D.js.map +0 -1
  61. package/dist/web/assets/queue-ClVxfeJ0.js +0 -2
  62. package/dist/web/assets/queue-ClVxfeJ0.js.map +0 -1
  63. package/dist/web/assets/routes-B9L9tBMF.js +0 -2
  64. package/dist/web/assets/run._playName-a3eeybKs.js +0 -5
  65. package/dist/web/assets/run._playName-a3eeybKs.js.map +0 -1
  66. package/dist/web/assets/setup-fs0DMLq4.js +0 -2
  67. package/dist/web/assets/setup-fs0DMLq4.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"routes-B9L9tBMF.js","names":["useQuery","Link","ArrowRight","api","NextStep","SchedulerStrip","SignalFeed","EmptyNote","SkeletonRow","cn","formatUsd","timeAgo","HomePage","home","queryKey","queryFn","refetchInterval","recent","receipts","limit","queueRecent","queue","d","data","fontFamily","fontSize","letterSpacing","lineHeight","fontWeight","Date","toLocaleDateString","undefined","weekday","year","month","day","String","repliedLast7d","sentLast7d","spendUsd7d","callsLast7d","activeCadences","rows","isLoading","Array","from","length","_","i","map","r","id","playName","callType","costUsd","createdAt","spendUsd30d","LedgerNumber","label","value","caption","tone","captionColor","color","component"],"sources":["../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/arrow-right.mjs","../../src/lib/useLocalStorage.ts","../../src/components/home/NextStep.tsx","../../src/components/home/SchedulerStrip.tsx","../../src/components/home/SignalFeed.tsx","../../src/routes/index.tsx?tsr-split=component"],"sourcesContent":["/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"m12 5 7 7-7 7\", key: \"xquz4c\" }]\n];\nconst ArrowRight = createLucideIcon(\"arrow-right\", __iconNode);\n\nexport { __iconNode, ArrowRight as default };\n//# sourceMappingURL=arrow-right.mjs.map\n","import { useEffect, useState } from \"react\";\n\n/**\n * Boolean-flag persistence to localStorage. SSR-safe (initial render uses\n * `initial`; the actual stored value is hydrated in an effect). Swallows\n * errors from private mode / disabled storage so the UI never crashes.\n *\n * First localStorage usage in the web app — kept intentionally minimal.\n * Generalize only when a second consumer appears.\n */\nexport function useLocalStorage(key: string, initial = false): [boolean, (v: boolean) => void] {\n const [value, setValue] = useState<boolean>(initial);\n useEffect(() => {\n try {\n const raw = localStorage.getItem(key);\n if (raw === \"1\" || raw === \"true\") setValue(true);\n } catch {\n // private mode / SSR — ignore\n }\n }, [key]);\n const set = (v: boolean): void => {\n setValue(v);\n try {\n localStorage.setItem(key, v ? \"1\" : \"0\");\n } catch {\n // ignore\n }\n };\n return [value, set];\n}\n","import { useQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { ArrowRight } from \"lucide-react\";\nimport { api } from \"../../api/client.ts\";\nimport { Button } from \"../primitives/Button.tsx\";\nimport { useLocalStorage } from \"../../lib/useLocalStorage.ts\";\n\ninterface Step {\n id: \"icp\" | \"find\" | \"drain\";\n title: string;\n lede: string;\n cta: string;\n href: \"/setup\" | \"/queue\";\n}\n\nconst STEPS: Step[] = [\n {\n id: \"icp\",\n title: \"Set your ICP\",\n lede: \"The find layer's classifier drops candidates that don't match. Without one, every result passes through and you'll review more noise than signal.\",\n cta: \"Open ICP setup\",\n href: \"/setup\",\n },\n {\n id: \"find\",\n title: \"Run your first finder\",\n lede: \"Pick a trigger (Show HN is cheapest) and click Run now. Results land in the queue for your review before anything sends.\",\n cta: \"Open the queue\",\n href: \"/queue\",\n },\n {\n id: \"drain\",\n title: \"Approve a target and drain\",\n lede: \"Approve a queued row, then click drain to send. The cadence engine takes over from there.\",\n cta: \"Open the queue\",\n href: \"/queue\",\n },\n];\n\nconst SKIP_KEY = \"oneshot-gtm:onboarding-skipped\";\n\nexport function NextStep() {\n const [skipped, setSkipped] = useLocalStorage(SKIP_KEY);\n\n const setup = useQuery({ queryKey: [\"setup\"], queryFn: api.setupStatus });\n const triggers = useQuery({ queryKey: [\"triggers\"], queryFn: api.triggers });\n // Reuses the cache key from index.tsx's home queue query.\n const queue = useQuery({\n queryKey: [\"queue\", \"recent\", \"home\"],\n queryFn: () => api.queue({ limit: 16 }),\n });\n\n if (skipped) return null;\n if (setup.isLoading || triggers.isLoading || queue.isLoading) return null;\n\n const icpDone = (setup.data?.cfg.icpOneLiner ?? \"\").trim().length > 0;\n const findDone =\n (triggers.data?.triggers ?? []).some((t) => t.lastPolledAt !== null) ||\n (queue.data?.counts.pending ?? 0) + (queue.data?.counts.sent ?? 0) > 0;\n const drainDone = (queue.data?.counts.sent ?? 0) > 0;\n\n const done: Record<Step[\"id\"], boolean> = { icp: icpDone, find: findDone, drain: drainDone };\n const ix = STEPS.findIndex((s) => !done[s.id]);\n if (ix === -1) return null;\n\n const step = STEPS[ix]!;\n\n return (\n <section className=\"border-b border-ink-rule bg-ink-bg-deep px-6 py-6\">\n <div className=\"flex items-start justify-between gap-6 rounded-[var(--radius-lg)] border border-ink-rule bg-ink-surface px-6 py-5 shadow-[var(--shadow-inset)]\">\n <div className=\"flex-1\">\n <div className=\"ln-eyebrow\">\n Next step · {ix + 1} of {STEPS.length}\n </div>\n <h2\n className=\"mt-1 text-ink-cream\"\n style={{\n fontFamily: \"var(--font-display)\",\n fontSize: 26,\n fontWeight: 600,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.05,\n }}\n >\n {step.title}\n </h2>\n <p className=\"mt-1.5 max-w-2xl text-sm leading-relaxed text-ink-cream-2\">{step.lede}</p>\n </div>\n <div className=\"flex flex-col items-end gap-2\">\n <Link to={step.href}>\n <Button size=\"sm\" variant=\"primary\">\n {step.cta} <ArrowRight size={12} />\n </Button>\n </Link>\n <button\n type=\"button\"\n onClick={() => setSkipped(true)}\n className=\"font-mono text-[11px] text-ink-faint transition-colors hover:text-ink-muted\"\n >\n Skip\n </button>\n </div>\n </div>\n </section>\n );\n}\n","import { useQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { ArrowRight, ChevronDown, ChevronRight } from \"lucide-react\";\nimport { useState } from \"react\";\nimport type { TriggerView } from \"@oneshot-gtm/shared-types\";\nimport { api } from \"../../api/client.ts\";\nimport { cn, timeAgo } from \"../../lib/cn.ts\";\nimport { humanInterval } from \"../../lib/humanInterval.ts\";\nimport { summarizeRun } from \"../../lib/summarizeRun.ts\";\nimport { Badge } from \"../primitives/Badge.tsx\";\nimport { EmptyNote } from \"../primitives/EmptyNote.tsx\";\nimport { SkeletonRow } from \"../primitives/Skeleton.tsx\";\n\n/**\n * Compact per-trigger status strip on /home. Answers the three questions\n * a founder asks when they suspect the scheduler is dead:\n * 1. Did anything run recently? — \"show-hn ran 4h ago\"\n * 2. Is anything due soon? — \"github-topics next in 2h\"\n * 3. What happened on the last run? — \"cand=50 · kept=0 · icp=5 · $0.05\"\n *\n * Read-only, no new API. Refetches every 30s alongside the other /home\n * sections. Drill-down is via the strip header → /queue, where the full\n * trigger management UI lives (toggle / run-now / edit config).\n */\n\ninterface Row {\n trigger: TriggerView;\n state: \"running\" | \"enabled\" | \"disabled\" | \"not-ready\";\n // Positive = due in N ms; negative = overdue N ms; null = no schedule\n // (disabled or never-polled-and-not-due).\n dueInMs: number | null;\n}\n\nexport function SchedulerStrip(): React.ReactElement {\n const triggersQuery = useQuery({\n queryKey: [\"triggers\"],\n queryFn: () => api.triggers(),\n refetchInterval: 30_000,\n });\n const [showDisabled, setShowDisabled] = useState(false);\n\n const triggers = triggersQuery.data?.triggers ?? [];\n const now = Date.now();\n\n const rows: Row[] = triggers.map((t) => {\n const state: Row[\"state\"] = t.running\n ? \"running\"\n : !t.enabled\n ? \"disabled\"\n : !t.ready\n ? \"not-ready\"\n : \"enabled\";\n // Compute next-due only for enabled+ready triggers that have polled\n // at least once. Never-polled rows would otherwise compute\n // `intervalMs - now()` (a ~57-year-overdue number) — they're not really\n // overdue, the scheduler just hasn't reached them yet, so render \"—\".\n let dueInMs: number | null = null;\n if (t.enabled && t.ready && !t.running && t.lastPolledAt) {\n const lastMs = new Date(t.lastPolledAt).getTime();\n const nextMs = lastMs + t.intervalMs;\n dueInMs = nextMs - now;\n }\n return { trigger: t, state, dueInMs };\n });\n\n // Enabled-first sort, with overdue floating above due-soon. Disabled\n // / not-ready sink to the bottom and get collapsed behind the chip.\n const visible = rows\n .filter((r) => r.state !== \"disabled\")\n .toSorted((a, b) => {\n // Running pins to top.\n if (a.state === \"running\" && b.state !== \"running\") return -1;\n if (b.state === \"running\" && a.state !== \"running\") return 1;\n // Then by due-in ascending (overdue = negative = smallest = top).\n const aDue = a.dueInMs ?? Number.POSITIVE_INFINITY;\n const bDue = b.dueInMs ?? Number.POSITIVE_INFINITY;\n return aDue - bDue;\n });\n const disabled = rows.filter((r) => r.state === \"disabled\");\n\n const enabledCount = rows.filter((r) => r.trigger.enabled).length;\n const overdueCount = rows.filter((r) => r.dueInMs != null && r.dueInMs < 0).length;\n\n return (\n <section className=\"flex flex-col border-b border-ink-rule\">\n <div className=\"flex items-baseline justify-between px-6 pb-2 pt-5\">\n <div className=\"flex items-baseline gap-3\">\n <div className=\"ln-eyebrow\">Scheduler</div>\n <div className=\"font-mono text-[11px] text-ink-faint\">\n {enabledCount} enabled\n {overdueCount > 0 && (\n <span className=\"ml-2 text-[color:var(--ink-blocked-2)]\">\n · {overdueCount} overdue\n </span>\n )}\n </div>\n </div>\n <Link\n to=\"/queue\"\n className=\"flex items-center gap-1 font-mono text-[11px] text-ink-muted transition-colors hover:text-ink-cream\"\n >\n manage <ArrowRight size={10} />\n </Link>\n </div>\n\n {triggersQuery.isLoading ? (\n <div>\n {Array.from({ length: 3 }, (_, i) => (\n <SkeletonRow key={i} />\n ))}\n </div>\n ) : rows.length === 0 ? (\n <div className=\"px-6 pb-6\">\n <EmptyNote\n note=\"No triggers stored yet. Enable one on /queue and it bootstraps on the next watch tick.\"\n cli=\"open http://127.0.0.1:3030/queue\"\n />\n </div>\n ) : (\n // Single table so visible + disabled rows share computed column\n // widths (a second standalone table doesn't align with the first).\n // Disabled rows render inside the same tbody, gated by `showDisabled`.\n // The toggle chip is a colspan row so semantically the disclosure\n // sits between the two row groups, not below the entire table.\n <table className=\"w-full text-[13px]\">\n <thead>\n <tr className=\"text-[10px] uppercase tracking-[0.14em] text-ink-faint\">\n <th className=\"px-6 py-2 text-left font-medium\">trigger</th>\n <th className=\"py-2 text-left font-medium\">state</th>\n <th className=\"py-2 text-left font-medium\">last run</th>\n <th className=\"py-2 text-right font-medium\">last polled</th>\n <th className=\"px-6 py-2 text-right font-medium\">next due</th>\n </tr>\n </thead>\n <tbody>\n {visible.map((r, i) => (\n <SchedulerRow key={r.trigger.name} row={r} zebra={i % 2 === 1} />\n ))}\n {disabled.length > 0 && (\n <tr className=\"border-t border-ink-rule/60\">\n <td colSpan={5} className=\"p-0\">\n <button\n type=\"button\"\n onClick={() => setShowDisabled((v) => !v)}\n aria-expanded={showDisabled}\n aria-label={`${showDisabled ? \"hide\" : \"show\"} ${disabled.length} disabled trigger${disabled.length === 1 ? \"\" : \"s\"}`}\n className=\"flex w-full items-center gap-1.5 px-6 py-2 text-left font-mono text-[11px] text-ink-faint transition-colors hover:bg-ink-surface/40 hover:text-ink-muted\"\n >\n {showDisabled ? (\n <ChevronDown size={11} aria-hidden=\"true\" />\n ) : (\n <ChevronRight size={11} aria-hidden=\"true\" />\n )}\n {disabled.length} disabled\n </button>\n </td>\n </tr>\n )}\n {showDisabled &&\n disabled.map((r, i) => (\n <SchedulerRow key={r.trigger.name} row={r} zebra={i % 2 === 1} />\n ))}\n </tbody>\n </table>\n )}\n </section>\n );\n}\n\nfunction SchedulerRow({ row, zebra }: { row: Row; zebra: boolean }): React.ReactElement {\n const { trigger, state, dueInMs } = row;\n return (\n <tr\n className={cn(\n \"border-t border-ink-rule/60 transition-colors duration-[var(--dur-stamp)]\",\n \"hover:bg-ink-surface/50\",\n zebra && \"bg-ink-surface/20\",\n )}\n >\n <td className=\"px-6 py-2 font-mono text-[12px]\">\n <span className={trigger.enabled ? \"text-ink-cream\" : \"text-ink-faint\"}>\n {trigger.name}\n </span>\n </td>\n <td className=\"py-2\">\n <StatePill state={state} reason={trigger.notReadyReason} />\n </td>\n <td className=\"py-2 font-mono text-[11.5px] text-ink-muted\">\n {summarizeRun(trigger.lastRunSummary)}\n </td>\n <td className=\"py-2 text-right font-mono text-[11.5px] text-ink-faint\">\n {trigger.lastPolledAt ? timeAgo(trigger.lastPolledAt) : \"never\"}\n </td>\n <td className=\"px-6 py-2 text-right font-mono text-[11.5px]\">\n <NextDuePill dueInMs={dueInMs} />\n </td>\n </tr>\n );\n}\n\nfunction StatePill({\n state,\n reason,\n}: {\n state: Row[\"state\"];\n reason: string | null;\n}): React.ReactElement {\n switch (state) {\n case \"running\":\n return <Badge tone=\"signal\">running</Badge>;\n case \"enabled\":\n return <Badge tone=\"receipt\">enabled</Badge>;\n case \"not-ready\":\n return (\n <Badge tone=\"blocked\" title={reason ?? undefined}>\n not ready\n </Badge>\n );\n case \"disabled\":\n return <Badge tone=\"neutral\">disabled</Badge>;\n }\n}\n\nfunction NextDuePill({ dueInMs }: { dueInMs: number | null }): React.ReactElement {\n if (dueInMs == null) return <span className=\"text-ink-faint\">—</span>;\n if (dueInMs <= 0) {\n return (\n <span className=\"text-[color:var(--ink-blocked-2)]\">overdue {humanInterval(-dueInMs)}</span>\n );\n }\n // Soon-ish (<30m): neutral cream. Otherwise: faint. Cheap visual nudge\n // that something's about to happen.\n const cls = dueInMs < 30 * 60_000 ? \"text-ink-cream-2\" : \"text-ink-faint\";\n return <span className={cls}>in {humanInterval(dueInMs)}</span>;\n}\n","import { Link } from \"@tanstack/react-router\";\nimport { ArrowRight, Inbox, Receipt } from \"lucide-react\";\nimport type { QueueRowView, ReceiptView } from \"@oneshot-gtm/shared-types\";\nimport { cn, timeAgo } from \"../../lib/cn.ts\";\n\n/**\n * A reverse-chron signal feed — the \"what's happening right now\" list\n * the founder checks first thing in the morning. Merges two event\n * streams (receipts + queue rows) into one ruled timeline.\n *\n * ● signed receipt — something was sent, spent, or searched\n * ◉ queued candidate — a trigger or finder landed a new target\n *\n * Each event links to its canonical source (receipt id / queue row) so\n * you can drill down. Pure client-side — no new API.\n */\n\ninterface FeedEvent {\n id: string;\n kind: \"receipt\" | \"queue\";\n at: string; // iso\n headline: string;\n meta: string;\n href?: string;\n}\n\nexport function SignalFeed({\n receipts,\n queue,\n loading,\n limit = 10,\n}: {\n receipts: ReceiptView[];\n queue: QueueRowView[];\n loading: boolean;\n limit?: number;\n}) {\n const events = merge(receipts, queue, limit);\n\n return (\n <section className=\"flex flex-col border-b border-ink-rule\">\n <div className=\"flex items-baseline justify-between px-6 pb-2 pt-5\">\n <div className=\"ln-eyebrow\">Signal feed</div>\n <div className=\"font-mono text-[11px] text-ink-faint\">newest first · refresh · 30s</div>\n </div>\n {loading ? (\n <div className=\"px-6 pb-5 font-mono text-[11.5px] text-ink-faint\">…</div>\n ) : events.length === 0 ? (\n <div className=\"px-6 pb-5\">\n <p className=\"ln-note max-w-[56ch] text-[13.5px] text-ink-cream-2\">\n Nothing on the wire yet. Send a play or run a trigger — events stream in here as they\n happen.\n </p>\n </div>\n ) : (\n <ol className=\"flex flex-col\">\n {events.map((e) => (\n <FeedLine key={e.id} event={e} />\n ))}\n </ol>\n )}\n </section>\n );\n}\n\nfunction FeedLine({ event }: { event: FeedEvent }) {\n const Icon = event.kind === \"receipt\" ? Receipt : Inbox;\n const tone =\n event.kind === \"receipt\"\n ? \"text-[color:var(--ink-receipt-2)]\"\n : \"text-[color:var(--ink-signal-2)]\";\n const body = (\n <>\n <span\n aria-hidden=\"true\"\n className={cn(\n \"inline-flex h-[18px] w-[18px] items-center justify-center\",\n \"rounded-[var(--radius-xs)] border border-ink-rule bg-ink-bg-deep shrink-0\",\n tone,\n )}\n >\n <Icon size={10} />\n </span>\n <span className=\"flex min-w-0 flex-1 items-baseline gap-2\">\n <span className=\"truncate text-ink-cream\">{event.headline}</span>\n <span className=\"truncate font-mono text-[11.5px] text-ink-faint\">· {event.meta}</span>\n </span>\n <time className=\"shrink-0 font-mono text-[11.5px] text-ink-muted\" dateTime={event.at}>\n {timeAgo(event.at)}\n </time>\n {event.href && (\n <ArrowRight\n size={11}\n className=\"shrink-0 text-ink-faint transition-colors group-hover:text-ink-cream-2\"\n />\n )}\n </>\n );\n\n const classes = cn(\n \"group flex items-center gap-3 border-t border-ink-rule/60 px-6 py-2\",\n \"transition-colors duration-[var(--dur-stamp)]\",\n event.href && \"hover:bg-ink-surface/60 cursor-pointer\",\n );\n\n if (event.href) {\n return (\n <li>\n <Link to={event.href} className={cn(classes, \"no-underline\")}>\n {body}\n </Link>\n </li>\n );\n }\n return <li className={classes}>{body}</li>;\n}\n\nfunction merge(receipts: ReceiptView[], queue: QueueRowView[], limit: number): FeedEvent[] {\n const events: FeedEvent[] = [];\n\n for (const r of receipts) {\n events.push({\n id: `r-${r.id}`,\n kind: \"receipt\",\n at: r.createdAt,\n headline: `${r.playName} · ${r.callType}`,\n meta: r.costUsd != null ? `$${r.costUsd.toFixed(2)}` : \"no cost on record\",\n href: \"/receipts\",\n });\n }\n\n for (const q of queue) {\n const email = extractEmail(q.payload);\n events.push({\n id: `q-${q.id}`,\n kind: \"queue\",\n at: q.foundAt,\n headline: `${q.playName} · ${email ?? \"(no email)\"}`,\n meta: `from ${q.source}`,\n href: \"/queue\",\n });\n }\n\n events.sort((a, b) => new Date(b.at).getTime() - new Date(a.at).getTime());\n return events.slice(0, limit);\n}\n\nfunction extractEmail(payload: unknown): string | null {\n if (!payload || typeof payload !== \"object\") return null;\n const p = payload as Record<string, unknown>;\n const email = p[\"email\"] ?? p[\"founderEmail\"];\n return typeof email === \"string\" ? email : null;\n}\n","import { useQuery } from \"@tanstack/react-query\";\nimport { createFileRoute, Link } from \"@tanstack/react-router\";\nimport { ArrowRight } from \"lucide-react\";\nimport { api } from \"../api/client.ts\";\nimport { NextStep } from \"../components/home/NextStep.tsx\";\nimport { SchedulerStrip } from \"../components/home/SchedulerStrip.tsx\";\nimport { SignalFeed } from \"../components/home/SignalFeed.tsx\";\nimport { EmptyNote } from \"../components/primitives/EmptyNote.tsx\";\nimport { SkeletonRow } from \"../components/primitives/Skeleton.tsx\";\nimport { cn, formatUsd, timeAgo } from \"../lib/cn.ts\";\n\nexport const Route = createFileRoute(\"/\")({\n component: HomePage,\n});\n\nfunction HomePage() {\n const home = useQuery({ queryKey: [\"home\"], queryFn: api.home, refetchInterval: 30_000 });\n const recent = useQuery({\n queryKey: [\"receipts\", \"recent\"],\n queryFn: () => api.receipts({ limit: 16 }),\n refetchInterval: 15_000,\n });\n const queueRecent = useQuery({\n queryKey: [\"queue\", \"recent\", \"home\"],\n queryFn: () => api.queue({ limit: 16 }),\n refetchInterval: 30_000,\n });\n const d = home.data;\n\n return (\n <div className=\"-mx-6 -my-6 flex flex-col\">\n {/* Masthead — newspaper-style, no card */}\n <section className=\"border-b border-ink-rule px-6 pb-5 pt-6\">\n <div className=\"flex items-end justify-between gap-6\">\n <div>\n <div className=\"ln-eyebrow\">The Ledger · Today</div>\n <h1\n className=\"mt-1 text-ink-cream\"\n style={{\n fontFamily: \"var(--font-display)\",\n fontSize: 44,\n letterSpacing: \"-0.025em\",\n lineHeight: 0.98,\n fontWeight: 600,\n }}\n >\n Signed, in ink.\n </h1>\n </div>\n <div className=\"hidden text-right font-mono text-[11px] text-ink-faint md:block\">\n {new Date().toLocaleDateString(undefined, {\n weekday: \"long\",\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n })}\n <div className=\"mt-0.5\">refresh · 30s</div>\n </div>\n </div>\n </section>\n\n {/* Onboarding nudge — disappears when ICP set + finder run + drain done. */}\n <NextStep />\n\n {/* KPI strip — 4 columns divided by vertical hairlines. No cards. */}\n <section className=\"grid grid-cols-2 divide-x divide-ink-rule border-b border-ink-rule lg:grid-cols-4\">\n <LedgerNumber\n label=\"Replied · 7d\"\n value={d ? String(d.repliedLast7d) : undefined}\n caption=\"reply · the only metric that matters\"\n tone=\"receipt\"\n />\n <LedgerNumber\n label=\"Sent · 7d\"\n value={d ? String(d.sentLast7d) : undefined}\n caption=\"drafts, linted, stamped\"\n />\n <LedgerNumber\n label=\"Spend · 7d\"\n value={d ? formatUsd(d.spendUsd7d) : undefined}\n caption={d ? `${d.callsLast7d} OneShot calls` : undefined}\n tone=\"spend\"\n />\n <LedgerNumber\n label=\"Active cadences\"\n value={d ? String(d.activeCadences) : undefined}\n caption=\"in flight, awaiting reply\"\n />\n </section>\n\n {/* Signal feed — reverse-chron timeline mixing receipts and queue events */}\n <SignalFeed\n receipts={recent.data?.receipts ?? []}\n queue={queueRecent.data?.rows ?? []}\n loading={recent.isLoading || queueRecent.isLoading}\n limit={10}\n />\n\n {/* Scheduler — per-trigger last-run + next-due strip */}\n <SchedulerStrip />\n\n {/* Receipts ledger — full-bleed table, no card, newspaper-style */}\n <section className=\"flex flex-col border-b border-ink-rule\">\n <div className=\"flex items-baseline justify-between px-6 pb-2 pt-5\">\n <div className=\"ln-eyebrow\">Recent receipts</div>\n <Link\n to=\"/receipts\"\n className=\"flex items-center gap-1 font-mono text-[11px] text-ink-muted transition-colors hover:text-ink-cream\"\n >\n all <ArrowRight size={10} />\n </Link>\n </div>\n {recent.isLoading ? (\n <div>\n {Array.from({ length: 5 }, (_, i) => (\n <SkeletonRow key={i} />\n ))}\n </div>\n ) : recent.data?.receipts.length === 0 ? (\n <div className=\"px-6 pb-6\">\n <EmptyNote\n note=\"No receipts yet. Every call the agent makes leaves one — a short ledger is an honest ledger.\"\n cli=\"oneshot-gtm motion show-hn\"\n />\n </div>\n ) : (\n <table className=\"w-full text-[13px]\">\n <thead>\n <tr className=\"text-[10px] uppercase tracking-[0.14em] text-ink-faint\">\n <th className=\"px-6 py-2 text-left font-medium\">id</th>\n <th className=\"py-2 text-left font-medium\">play</th>\n <th className=\"py-2 text-left font-medium\">type</th>\n <th className=\"py-2 text-right font-medium\">cost</th>\n <th className=\"px-6 py-2 text-right font-medium\">when</th>\n </tr>\n </thead>\n <tbody>\n {recent.data?.receipts.map((r, i) => (\n <tr\n key={r.id}\n className={cn(\n \"border-t border-ink-rule/60 transition-colors duration-[var(--dur-stamp)]\",\n \"hover:bg-ink-surface/50\",\n i % 2 === 1 && \"bg-ink-surface/20\",\n )}\n >\n <td className=\"px-6 py-2 font-mono text-[11px] text-ink-faint\">#{r.id}</td>\n <td className=\"py-2 text-ink-cream\">{r.playName}</td>\n <td className=\"py-2 font-mono text-[12px] text-ink-muted\">{r.callType}</td>\n <td className=\"py-2 text-right font-mono text-ink-cream\">\n {r.costUsd != null ? (\n formatUsd(r.costUsd)\n ) : (\n <span className=\"text-ink-faint\">—</span>\n )}\n </td>\n <td className=\"px-6 py-2 text-right font-mono text-[12px] text-ink-faint\">\n {timeAgo(r.createdAt)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n )}\n </section>\n\n {/* Editorial footnote — the \"why\" of spend, no card */}\n <section className=\"grid grid-cols-1 gap-8 px-6 py-8 lg:grid-cols-[1fr_280px]\">\n <div className=\"max-w-[58ch]\">\n <div className=\"ln-eyebrow\">Editor's note</div>\n <p className=\"ln-prose mt-2 max-w-[58ch] text-[14.5px] text-ink-cream-2\">\n Spend is the cost of proof. Every send came with a signed receipt; every receipt keeps\n you honest with yourself. A short ledger is an honest ledger — one send always beats\n zero.\n </p>\n </div>\n <div className=\"border-l border-ink-rule pl-6\">\n <div className=\"ln-eyebrow\">Spend · 30d</div>\n <div className=\"mt-1 text-ink-cream ln-numeral\" style={{ fontSize: 36, lineHeight: 1 }}>\n {d ? formatUsd(d.spendUsd30d) : <span className=\"text-ink-faint\">$—</span>}\n </div>\n <div className=\"mt-2 font-mono text-[11px] text-ink-muted\">\n {d ? `${d.callsLast7d} calls this week` : \"…\"}\n </div>\n </div>\n </section>\n </div>\n );\n}\n\n/**\n * A single KPI in ledger-column style. No card chrome — just a column of\n * eyebrow label, big numeral, and caption underneath, separated from\n * neighbours by the vertical hairline on the parent grid.\n */\nfunction LedgerNumber({\n label,\n value,\n caption,\n tone = \"neutral\",\n}: {\n label: string;\n value: string | undefined;\n caption?: string;\n /** A subtle caption tint — the number itself stays cream. */\n tone?: \"neutral\" | \"spend\" | \"receipt\";\n}) {\n const captionColor =\n tone === \"spend\"\n ? \"var(--ink-spend-2)\"\n : tone === \"receipt\"\n ? \"var(--ink-receipt-2)\"\n : \"var(--ink-faint)\";\n return (\n <div className=\"px-5 py-4\">\n <div className=\"ln-eyebrow\">{label}</div>\n <div\n className=\"mt-1 truncate text-ink-cream ln-numeral\"\n style={{ fontSize: 44, lineHeight: 1 }}\n >\n {value ?? <span className=\"text-ink-faint\">—</span>}\n </div>\n {caption && (\n <div className=\"mt-2 truncate font-mono text-[11px]\" style={{ color: captionColor }}>\n {caption}\n </div>\n )}\n </div>\n );\n}\n"],"x_google_ignoreList":[0],"mappings":"qYAaA,IAAM,EAAa,EAAiB,cAAe,CAHjD,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC1C,CAAC,OAAQ,CAAE,EAAG,gBAAiB,IAAK,SAAU,CAAC,CAEE,CAAW,YCH9D,SAAg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,qBAAf,EACE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,sBAAcH,EAAW,CAAA,EACxC,EAAA,EAAA,KAAC,MAAD,CACE,UAAU,0CACV,MAAO,CAAEjC,SAAU,GAAIE,WAAY,EAAG,UAErCgC,IAAS,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,0BAAiB,IAAQ,CAAA,CAChD,CAAA,CACJC,IACC,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,sCAAsC,MAAO,CAAEG,MAflEF,IAAS,QACL,qBACAA,IAAS,UACP,uBACA,mBAWiF,UAChFD,EAEJ,CAAA,CACG"}
1
+ {"version":3,"file":"routes-BgDvPuJP.js","names":["useQuery","Link","ArrowRight","api","NextStep","SchedulerStrip","SignalFeed","EmptyNote","SkeletonRow","cn","formatUsd","timeAgo","HomePage","home","queryKey","queryFn","refetchInterval","recent","receipts","limit","queueRecent","queue","d","data","fontFamily","fontSize","letterSpacing","lineHeight","fontWeight","Date","toLocaleDateString","undefined","weekday","year","month","day","String","repliedLast7d","sentLast7d","spendUsd7d","callsLast7d","activeCadences","rows","isLoading","Array","from","length","_","i","map","r","id","playName","callType","costUsd","createdAt","spendUsd30d","LedgerNumber","label","value","caption","tone","captionColor","color","component"],"sources":["../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/arrow-right.mjs","../../src/lib/useLocalStorage.ts","../../src/components/home/NextStep.tsx","../../src/components/home/SchedulerStrip.tsx","../../src/components/home/SignalFeed.tsx","../../src/routes/index.tsx?tsr-split=component"],"sourcesContent":["/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"m12 5 7 7-7 7\", key: \"xquz4c\" }]\n];\nconst ArrowRight = createLucideIcon(\"arrow-right\", __iconNode);\n\nexport { __iconNode, ArrowRight as default };\n//# sourceMappingURL=arrow-right.mjs.map\n","import { useEffect, useState } from \"react\";\n\n/**\n * Boolean-flag persistence to localStorage. SSR-safe (initial render uses\n * `initial`; the actual stored value is hydrated in an effect). Swallows\n * errors from private mode / disabled storage so the UI never crashes.\n *\n * First localStorage usage in the web app — kept intentionally minimal.\n * Generalize only when a second consumer appears.\n */\nexport function useLocalStorage(key: string, initial = false): [boolean, (v: boolean) => void] {\n const [value, setValue] = useState<boolean>(initial);\n useEffect(() => {\n try {\n const raw = localStorage.getItem(key);\n if (raw === \"1\" || raw === \"true\") setValue(true);\n } catch {\n // private mode / SSR — ignore\n }\n }, [key]);\n const set = (v: boolean): void => {\n setValue(v);\n try {\n localStorage.setItem(key, v ? \"1\" : \"0\");\n } catch {\n // ignore\n }\n };\n return [value, set];\n}\n","import { useQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { ArrowRight } from \"lucide-react\";\nimport { api } from \"../../api/client.ts\";\nimport { Button } from \"../primitives/Button.tsx\";\nimport { useLocalStorage } from \"../../lib/useLocalStorage.ts\";\n\ninterface Step {\n id: \"icp\" | \"find\" | \"drain\";\n title: string;\n lede: string;\n cta: string;\n href: \"/setup\" | \"/queue\";\n}\n\nconst STEPS: Step[] = [\n {\n id: \"icp\",\n title: \"Set your ICP\",\n lede: \"The find layer's classifier drops candidates that don't match. Without one, every result passes through and you'll review more noise than signal.\",\n cta: \"Open ICP setup\",\n href: \"/setup\",\n },\n {\n id: \"find\",\n title: \"Run your first finder\",\n lede: \"Pick a trigger (Show HN is cheapest) and click Run now. Results land in the queue for your review before anything sends.\",\n cta: \"Open the queue\",\n href: \"/queue\",\n },\n {\n id: \"drain\",\n title: \"Approve a target and drain\",\n lede: \"Approve a queued row, then click drain to send. The cadence engine takes over from there.\",\n cta: \"Open the queue\",\n href: \"/queue\",\n },\n];\n\nconst SKIP_KEY = \"oneshot-gtm:onboarding-skipped\";\n\nexport function NextStep() {\n const [skipped, setSkipped] = useLocalStorage(SKIP_KEY);\n\n const setup = useQuery({ queryKey: [\"setup\"], queryFn: api.setupStatus });\n const triggers = useQuery({ queryKey: [\"triggers\"], queryFn: api.triggers });\n // Reuses the cache key from index.tsx's home queue query.\n const queue = useQuery({\n queryKey: [\"queue\", \"recent\", \"home\"],\n queryFn: () => api.queue({ limit: 16 }),\n });\n\n if (skipped) return null;\n if (setup.isLoading || triggers.isLoading || queue.isLoading) return null;\n\n const icpDone = (setup.data?.cfg.icpOneLiner ?? \"\").trim().length > 0;\n const findDone =\n (triggers.data?.triggers ?? []).some((t) => t.lastPolledAt !== null) ||\n (queue.data?.counts.pending ?? 0) + (queue.data?.counts.sent ?? 0) > 0;\n const drainDone = (queue.data?.counts.sent ?? 0) > 0;\n\n const done: Record<Step[\"id\"], boolean> = { icp: icpDone, find: findDone, drain: drainDone };\n const ix = STEPS.findIndex((s) => !done[s.id]);\n if (ix === -1) return null;\n\n const step = STEPS[ix]!;\n\n return (\n <section className=\"border-b border-ink-rule bg-ink-bg-deep px-6 py-6\">\n <div className=\"flex items-start justify-between gap-6 rounded-[var(--radius-lg)] border border-ink-rule bg-ink-surface px-6 py-5 shadow-[var(--shadow-inset)]\">\n <div className=\"flex-1\">\n <div className=\"ln-eyebrow\">\n Next step · {ix + 1} of {STEPS.length}\n </div>\n <h2\n className=\"mt-1 text-ink-cream\"\n style={{\n fontFamily: \"var(--font-display)\",\n fontSize: 26,\n fontWeight: 600,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.05,\n }}\n >\n {step.title}\n </h2>\n <p className=\"mt-1.5 max-w-2xl text-sm leading-relaxed text-ink-cream-2\">{step.lede}</p>\n </div>\n <div className=\"flex flex-col items-end gap-2\">\n <Link to={step.href}>\n <Button size=\"sm\" variant=\"primary\">\n {step.cta} <ArrowRight size={12} />\n </Button>\n </Link>\n <button\n type=\"button\"\n onClick={() => setSkipped(true)}\n className=\"font-mono text-[11px] text-ink-faint transition-colors hover:text-ink-muted\"\n >\n Skip\n </button>\n </div>\n </div>\n </section>\n );\n}\n","import { useQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { ArrowRight, ChevronDown, ChevronRight } from \"lucide-react\";\nimport { useState } from \"react\";\nimport type { TriggerView } from \"@oneshot-gtm/shared-types\";\nimport { api } from \"../../api/client.ts\";\nimport { cn, timeAgo } from \"../../lib/cn.ts\";\nimport { humanInterval } from \"../../lib/humanInterval.ts\";\nimport { summarizeRun } from \"../../lib/summarizeRun.ts\";\nimport { Badge } from \"../primitives/Badge.tsx\";\nimport { EmptyNote } from \"../primitives/EmptyNote.tsx\";\nimport { SkeletonRow } from \"../primitives/Skeleton.tsx\";\n\n/**\n * Compact per-trigger status strip on /home. Answers the three questions\n * a founder asks when they suspect the scheduler is dead:\n * 1. Did anything run recently? — \"show-hn ran 4h ago\"\n * 2. Is anything due soon? — \"github-topics next in 2h\"\n * 3. What happened on the last run? — \"cand=50 · kept=0 · icp=5 · $0.05\"\n *\n * Read-only, no new API. Refetches every 30s alongside the other /home\n * sections. Drill-down is via the strip header → /queue, where the full\n * trigger management UI lives (toggle / run-now / edit config).\n */\n\ninterface Row {\n trigger: TriggerView;\n state: \"running\" | \"enabled\" | \"disabled\" | \"not-ready\";\n // Positive = due in N ms; negative = overdue N ms; null = no schedule\n // (disabled or never-polled-and-not-due).\n dueInMs: number | null;\n}\n\nexport function SchedulerStrip(): React.ReactElement {\n const triggersQuery = useQuery({\n queryKey: [\"triggers\"],\n queryFn: () => api.triggers(),\n refetchInterval: 30_000,\n });\n const [showDisabled, setShowDisabled] = useState(false);\n\n const triggers = triggersQuery.data?.triggers ?? [];\n const now = Date.now();\n\n const rows: Row[] = triggers.map((t) => {\n const state: Row[\"state\"] = t.running\n ? \"running\"\n : !t.enabled\n ? \"disabled\"\n : !t.ready\n ? \"not-ready\"\n : \"enabled\";\n // Compute next-due only for enabled+ready triggers that have polled\n // at least once. Never-polled rows would otherwise compute\n // `intervalMs - now()` (a ~57-year-overdue number) — they're not really\n // overdue, the scheduler just hasn't reached them yet, so render \"—\".\n let dueInMs: number | null = null;\n if (t.enabled && t.ready && !t.running && t.lastPolledAt) {\n const lastMs = new Date(t.lastPolledAt).getTime();\n const nextMs = lastMs + t.intervalMs;\n dueInMs = nextMs - now;\n }\n return { trigger: t, state, dueInMs };\n });\n\n // Enabled-first sort, with overdue floating above due-soon. Disabled\n // / not-ready sink to the bottom and get collapsed behind the chip.\n const visible = rows\n .filter((r) => r.state !== \"disabled\")\n .toSorted((a, b) => {\n // Running pins to top.\n if (a.state === \"running\" && b.state !== \"running\") return -1;\n if (b.state === \"running\" && a.state !== \"running\") return 1;\n // Then by due-in ascending (overdue = negative = smallest = top).\n const aDue = a.dueInMs ?? Number.POSITIVE_INFINITY;\n const bDue = b.dueInMs ?? Number.POSITIVE_INFINITY;\n return aDue - bDue;\n });\n const disabled = rows.filter((r) => r.state === \"disabled\");\n\n const enabledCount = rows.filter((r) => r.trigger.enabled).length;\n const overdueCount = rows.filter((r) => r.dueInMs != null && r.dueInMs < 0).length;\n\n return (\n <section className=\"flex flex-col border-b border-ink-rule\">\n <div className=\"flex items-baseline justify-between px-6 pb-2 pt-5\">\n <div className=\"flex items-baseline gap-3\">\n <div className=\"ln-eyebrow\">Scheduler</div>\n <div className=\"font-mono text-[11px] text-ink-faint\">\n {enabledCount} enabled\n {overdueCount > 0 && (\n <span className=\"ml-2 text-[color:var(--ink-blocked-2)]\">\n · {overdueCount} overdue\n </span>\n )}\n </div>\n </div>\n <Link\n to=\"/queue\"\n className=\"flex items-center gap-1 font-mono text-[11px] text-ink-muted transition-colors hover:text-ink-cream\"\n >\n manage <ArrowRight size={10} />\n </Link>\n </div>\n\n {triggersQuery.isLoading ? (\n <div>\n {Array.from({ length: 3 }, (_, i) => (\n <SkeletonRow key={i} />\n ))}\n </div>\n ) : rows.length === 0 ? (\n <div className=\"px-6 pb-6\">\n <EmptyNote\n note=\"No triggers stored yet. Enable one on /queue and it bootstraps on the next watch tick.\"\n cli=\"open http://127.0.0.1:3030/queue\"\n />\n </div>\n ) : (\n // Single table so visible + disabled rows share computed column\n // widths (a second standalone table doesn't align with the first).\n // Disabled rows render inside the same tbody, gated by `showDisabled`.\n // The toggle chip is a colspan row so semantically the disclosure\n // sits between the two row groups, not below the entire table.\n <table className=\"w-full text-[13px]\">\n <thead>\n <tr className=\"text-[10px] uppercase tracking-[0.14em] text-ink-faint\">\n <th className=\"px-6 py-2 text-left font-medium\">trigger</th>\n <th className=\"py-2 text-left font-medium\">state</th>\n <th className=\"py-2 text-left font-medium\">last run</th>\n <th className=\"py-2 text-right font-medium\">last polled</th>\n <th className=\"px-6 py-2 text-right font-medium\">next due</th>\n </tr>\n </thead>\n <tbody>\n {visible.map((r, i) => (\n <SchedulerRow key={r.trigger.name} row={r} zebra={i % 2 === 1} />\n ))}\n {disabled.length > 0 && (\n <tr className=\"border-t border-ink-rule/60\">\n <td colSpan={5} className=\"p-0\">\n <button\n type=\"button\"\n onClick={() => setShowDisabled((v) => !v)}\n aria-expanded={showDisabled}\n aria-label={`${showDisabled ? \"hide\" : \"show\"} ${disabled.length} disabled trigger${disabled.length === 1 ? \"\" : \"s\"}`}\n className=\"flex w-full items-center gap-1.5 px-6 py-2 text-left font-mono text-[11px] text-ink-faint transition-colors hover:bg-ink-surface/40 hover:text-ink-muted\"\n >\n {showDisabled ? (\n <ChevronDown size={11} aria-hidden=\"true\" />\n ) : (\n <ChevronRight size={11} aria-hidden=\"true\" />\n )}\n {disabled.length} disabled\n </button>\n </td>\n </tr>\n )}\n {showDisabled &&\n disabled.map((r, i) => (\n <SchedulerRow key={r.trigger.name} row={r} zebra={i % 2 === 1} />\n ))}\n </tbody>\n </table>\n )}\n </section>\n );\n}\n\nfunction SchedulerRow({ row, zebra }: { row: Row; zebra: boolean }): React.ReactElement {\n const { trigger, state, dueInMs } = row;\n return (\n <tr\n className={cn(\n \"border-t border-ink-rule/60 transition-colors duration-[var(--dur-stamp)]\",\n \"hover:bg-ink-surface/50\",\n zebra && \"bg-ink-surface/20\",\n )}\n >\n <td className=\"px-6 py-2 font-mono text-[12px]\">\n <span className={trigger.enabled ? \"text-ink-cream\" : \"text-ink-faint\"}>\n {trigger.name}\n </span>\n </td>\n <td className=\"py-2\">\n <StatePill state={state} reason={trigger.notReadyReason} />\n </td>\n <td className=\"py-2 font-mono text-[11.5px] text-ink-muted\">\n {summarizeRun(trigger.lastRunSummary)}\n </td>\n <td className=\"py-2 text-right font-mono text-[11.5px] text-ink-faint\">\n {trigger.lastPolledAt ? timeAgo(trigger.lastPolledAt) : \"never\"}\n </td>\n <td className=\"px-6 py-2 text-right font-mono text-[11.5px]\">\n <NextDuePill dueInMs={dueInMs} />\n </td>\n </tr>\n );\n}\n\nfunction StatePill({\n state,\n reason,\n}: {\n state: Row[\"state\"];\n reason: string | null;\n}): React.ReactElement {\n switch (state) {\n case \"running\":\n return <Badge tone=\"signal\">running</Badge>;\n case \"enabled\":\n return <Badge tone=\"receipt\">enabled</Badge>;\n case \"not-ready\":\n return (\n <Badge tone=\"blocked\" title={reason ?? undefined}>\n not ready\n </Badge>\n );\n case \"disabled\":\n return <Badge tone=\"neutral\">disabled</Badge>;\n }\n}\n\nfunction NextDuePill({ dueInMs }: { dueInMs: number | null }): React.ReactElement {\n if (dueInMs == null) return <span className=\"text-ink-faint\">—</span>;\n if (dueInMs <= 0) {\n return (\n <span className=\"text-[color:var(--ink-blocked-2)]\">overdue {humanInterval(-dueInMs)}</span>\n );\n }\n // Soon-ish (<30m): neutral cream. Otherwise: faint. Cheap visual nudge\n // that something's about to happen.\n const cls = dueInMs < 30 * 60_000 ? \"text-ink-cream-2\" : \"text-ink-faint\";\n return <span className={cls}>in {humanInterval(dueInMs)}</span>;\n}\n","import { Link } from \"@tanstack/react-router\";\nimport { ArrowRight, Inbox, Receipt } from \"lucide-react\";\nimport type { QueueRowView, ReceiptView } from \"@oneshot-gtm/shared-types\";\nimport { cn, timeAgo } from \"../../lib/cn.ts\";\n\n/**\n * A reverse-chron signal feed — the \"what's happening right now\" list\n * the founder checks first thing in the morning. Merges two event\n * streams (receipts + queue rows) into one ruled timeline.\n *\n * ● signed receipt — something was sent, spent, or searched\n * ◉ queued candidate — a trigger or finder landed a new target\n *\n * Each event links to its canonical source (receipt id / queue row) so\n * you can drill down. Pure client-side — no new API.\n */\n\ninterface FeedEvent {\n id: string;\n kind: \"receipt\" | \"queue\";\n at: string; // iso\n headline: string;\n meta: string;\n href?: string;\n}\n\nexport function SignalFeed({\n receipts,\n queue,\n loading,\n limit = 10,\n}: {\n receipts: ReceiptView[];\n queue: QueueRowView[];\n loading: boolean;\n limit?: number;\n}) {\n const events = merge(receipts, queue, limit);\n\n return (\n <section className=\"flex flex-col border-b border-ink-rule\">\n <div className=\"flex items-baseline justify-between px-6 pb-2 pt-5\">\n <div className=\"ln-eyebrow\">Signal feed</div>\n <div className=\"font-mono text-[11px] text-ink-faint\">newest first · refresh · 30s</div>\n </div>\n {loading ? (\n <div className=\"px-6 pb-5 font-mono text-[11.5px] text-ink-faint\">…</div>\n ) : events.length === 0 ? (\n <div className=\"px-6 pb-5\">\n <p className=\"ln-note max-w-[56ch] text-[13.5px] text-ink-cream-2\">\n Nothing on the wire yet. Send a play or run a trigger — events stream in here as they\n happen.\n </p>\n </div>\n ) : (\n <ol className=\"flex flex-col\">\n {events.map((e) => (\n <FeedLine key={e.id} event={e} />\n ))}\n </ol>\n )}\n </section>\n );\n}\n\nfunction FeedLine({ event }: { event: FeedEvent }) {\n const Icon = event.kind === \"receipt\" ? Receipt : Inbox;\n const tone =\n event.kind === \"receipt\"\n ? \"text-[color:var(--ink-receipt-2)]\"\n : \"text-[color:var(--ink-signal-2)]\";\n const body = (\n <>\n <span\n aria-hidden=\"true\"\n className={cn(\n \"inline-flex h-[18px] w-[18px] items-center justify-center\",\n \"rounded-[var(--radius-xs)] border border-ink-rule bg-ink-bg-deep shrink-0\",\n tone,\n )}\n >\n <Icon size={10} />\n </span>\n <span className=\"flex min-w-0 flex-1 items-baseline gap-2\">\n <span className=\"truncate text-ink-cream\">{event.headline}</span>\n <span className=\"truncate font-mono text-[11.5px] text-ink-faint\">· {event.meta}</span>\n </span>\n <time className=\"shrink-0 font-mono text-[11.5px] text-ink-muted\" dateTime={event.at}>\n {timeAgo(event.at)}\n </time>\n {event.href && (\n <ArrowRight\n size={11}\n className=\"shrink-0 text-ink-faint transition-colors group-hover:text-ink-cream-2\"\n />\n )}\n </>\n );\n\n const classes = cn(\n \"group flex items-center gap-3 border-t border-ink-rule/60 px-6 py-2\",\n \"transition-colors duration-[var(--dur-stamp)]\",\n event.href && \"hover:bg-ink-surface/60 cursor-pointer\",\n );\n\n if (event.href) {\n return (\n <li>\n <Link to={event.href} className={cn(classes, \"no-underline\")}>\n {body}\n </Link>\n </li>\n );\n }\n return <li className={classes}>{body}</li>;\n}\n\nfunction merge(receipts: ReceiptView[], queue: QueueRowView[], limit: number): FeedEvent[] {\n const events: FeedEvent[] = [];\n\n for (const r of receipts) {\n events.push({\n id: `r-${r.id}`,\n kind: \"receipt\",\n at: r.createdAt,\n headline: `${r.playName} · ${r.callType}`,\n meta: r.costUsd != null ? `$${r.costUsd.toFixed(2)}` : \"no cost on record\",\n href: \"/receipts\",\n });\n }\n\n for (const q of queue) {\n const email = extractEmail(q.payload);\n events.push({\n id: `q-${q.id}`,\n kind: \"queue\",\n at: q.foundAt,\n headline: `${q.playName} · ${email ?? \"(no email)\"}`,\n meta: `from ${q.source}`,\n href: \"/queue\",\n });\n }\n\n events.sort((a, b) => new Date(b.at).getTime() - new Date(a.at).getTime());\n return events.slice(0, limit);\n}\n\nfunction extractEmail(payload: unknown): string | null {\n if (!payload || typeof payload !== \"object\") return null;\n const p = payload as Record<string, unknown>;\n const email = p[\"email\"] ?? p[\"founderEmail\"];\n return typeof email === \"string\" ? email : null;\n}\n","import { useQuery } from \"@tanstack/react-query\";\nimport { createFileRoute, Link } from \"@tanstack/react-router\";\nimport { ArrowRight } from \"lucide-react\";\nimport { api } from \"../api/client.ts\";\nimport { NextStep } from \"../components/home/NextStep.tsx\";\nimport { SchedulerStrip } from \"../components/home/SchedulerStrip.tsx\";\nimport { SignalFeed } from \"../components/home/SignalFeed.tsx\";\nimport { EmptyNote } from \"../components/primitives/EmptyNote.tsx\";\nimport { SkeletonRow } from \"../components/primitives/Skeleton.tsx\";\nimport { cn, formatUsd, timeAgo } from \"../lib/cn.ts\";\n\nexport const Route = createFileRoute(\"/\")({\n component: HomePage,\n});\n\nfunction HomePage() {\n const home = useQuery({ queryKey: [\"home\"], queryFn: api.home, refetchInterval: 30_000 });\n const recent = useQuery({\n queryKey: [\"receipts\", \"recent\"],\n queryFn: () => api.receipts({ limit: 16 }),\n refetchInterval: 15_000,\n });\n const queueRecent = useQuery({\n queryKey: [\"queue\", \"recent\", \"home\"],\n queryFn: () => api.queue({ limit: 16 }),\n refetchInterval: 30_000,\n });\n const d = home.data;\n\n return (\n <div className=\"-mx-6 -my-6 flex flex-col\">\n {/* Masthead — newspaper-style, no card */}\n <section className=\"border-b border-ink-rule px-6 pb-5 pt-6\">\n <div className=\"flex items-end justify-between gap-6\">\n <div>\n <div className=\"ln-eyebrow\">The Ledger · Today</div>\n <h1\n className=\"mt-1 text-ink-cream\"\n style={{\n fontFamily: \"var(--font-display)\",\n fontSize: 44,\n letterSpacing: \"-0.025em\",\n lineHeight: 0.98,\n fontWeight: 600,\n }}\n >\n Signed, in ink.\n </h1>\n </div>\n <div className=\"hidden text-right font-mono text-[11px] text-ink-faint md:block\">\n {new Date().toLocaleDateString(undefined, {\n weekday: \"long\",\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n })}\n <div className=\"mt-0.5\">refresh · 30s</div>\n </div>\n </div>\n </section>\n\n {/* Onboarding nudge — disappears when ICP set + finder run + drain done. */}\n <NextStep />\n\n {/* KPI strip — 4 columns divided by vertical hairlines. No cards. */}\n <section className=\"grid grid-cols-2 divide-x divide-ink-rule border-b border-ink-rule lg:grid-cols-4\">\n <LedgerNumber\n label=\"Replied · 7d\"\n value={d ? String(d.repliedLast7d) : undefined}\n caption=\"reply · the only metric that matters\"\n tone=\"receipt\"\n />\n <LedgerNumber\n label=\"Sent · 7d\"\n value={d ? String(d.sentLast7d) : undefined}\n caption=\"drafts, linted, stamped\"\n />\n <LedgerNumber\n label=\"Spend · 7d\"\n value={d ? formatUsd(d.spendUsd7d) : undefined}\n caption={d ? `${d.callsLast7d} OneShot calls` : undefined}\n tone=\"spend\"\n />\n <LedgerNumber\n label=\"Active cadences\"\n value={d ? String(d.activeCadences) : undefined}\n caption=\"in flight, awaiting reply\"\n />\n </section>\n\n {/* Signal feed — reverse-chron timeline mixing receipts and queue events */}\n <SignalFeed\n receipts={recent.data?.receipts ?? []}\n queue={queueRecent.data?.rows ?? []}\n loading={recent.isLoading || queueRecent.isLoading}\n limit={10}\n />\n\n {/* Scheduler — per-trigger last-run + next-due strip */}\n <SchedulerStrip />\n\n {/* Receipts ledger — full-bleed table, no card, newspaper-style */}\n <section className=\"flex flex-col border-b border-ink-rule\">\n <div className=\"flex items-baseline justify-between px-6 pb-2 pt-5\">\n <div className=\"ln-eyebrow\">Recent receipts</div>\n <Link\n to=\"/receipts\"\n className=\"flex items-center gap-1 font-mono text-[11px] text-ink-muted transition-colors hover:text-ink-cream\"\n >\n all <ArrowRight size={10} />\n </Link>\n </div>\n {recent.isLoading ? (\n <div>\n {Array.from({ length: 5 }, (_, i) => (\n <SkeletonRow key={i} />\n ))}\n </div>\n ) : recent.data?.receipts.length === 0 ? (\n <div className=\"px-6 pb-6\">\n <EmptyNote\n note=\"No receipts yet. Every call the agent makes leaves one — a short ledger is an honest ledger.\"\n cli=\"oneshot-gtm motion show-hn\"\n />\n </div>\n ) : (\n <table className=\"w-full text-[13px]\">\n <thead>\n <tr className=\"text-[10px] uppercase tracking-[0.14em] text-ink-faint\">\n <th className=\"px-6 py-2 text-left font-medium\">id</th>\n <th className=\"py-2 text-left font-medium\">play</th>\n <th className=\"py-2 text-left font-medium\">type</th>\n <th className=\"py-2 text-right font-medium\">cost</th>\n <th className=\"px-6 py-2 text-right font-medium\">when</th>\n </tr>\n </thead>\n <tbody>\n {recent.data?.receipts.map((r, i) => (\n <tr\n key={r.id}\n className={cn(\n \"border-t border-ink-rule/60 transition-colors duration-[var(--dur-stamp)]\",\n \"hover:bg-ink-surface/50\",\n i % 2 === 1 && \"bg-ink-surface/20\",\n )}\n >\n <td className=\"px-6 py-2 font-mono text-[11px] text-ink-faint\">#{r.id}</td>\n <td className=\"py-2 text-ink-cream\">{r.playName}</td>\n <td className=\"py-2 font-mono text-[12px] text-ink-muted\">{r.callType}</td>\n <td className=\"py-2 text-right font-mono text-ink-cream\">\n {r.costUsd != null ? (\n formatUsd(r.costUsd)\n ) : (\n <span className=\"text-ink-faint\">—</span>\n )}\n </td>\n <td className=\"px-6 py-2 text-right font-mono text-[12px] text-ink-faint\">\n {timeAgo(r.createdAt)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n )}\n </section>\n\n {/* Editorial footnote — the \"why\" of spend, no card */}\n <section className=\"grid grid-cols-1 gap-8 px-6 py-8 lg:grid-cols-[1fr_280px]\">\n <div className=\"max-w-[58ch]\">\n <div className=\"ln-eyebrow\">Editor's note</div>\n <p className=\"ln-prose mt-2 max-w-[58ch] text-[14.5px] text-ink-cream-2\">\n Spend is the cost of proof. Every send came with a signed receipt; every receipt keeps\n you honest with yourself. A short ledger is an honest ledger — one send always beats\n zero.\n </p>\n </div>\n <div className=\"border-l border-ink-rule pl-6\">\n <div className=\"ln-eyebrow\">Spend · 30d</div>\n <div className=\"mt-1 text-ink-cream ln-numeral\" style={{ fontSize: 36, lineHeight: 1 }}>\n {d ? formatUsd(d.spendUsd30d) : <span className=\"text-ink-faint\">$—</span>}\n </div>\n <div className=\"mt-2 font-mono text-[11px] text-ink-muted\">\n {d ? `${d.callsLast7d} calls this week` : \"…\"}\n </div>\n </div>\n </section>\n </div>\n );\n}\n\n/**\n * A single KPI in ledger-column style. No card chrome — just a column of\n * eyebrow label, big numeral, and caption underneath, separated from\n * neighbours by the vertical hairline on the parent grid.\n */\nfunction LedgerNumber({\n label,\n value,\n caption,\n tone = \"neutral\",\n}: {\n label: string;\n value: string | undefined;\n caption?: string;\n /** A subtle caption tint — the number itself stays cream. */\n tone?: \"neutral\" | \"spend\" | \"receipt\";\n}) {\n const captionColor =\n tone === \"spend\"\n ? \"var(--ink-spend-2)\"\n : tone === \"receipt\"\n ? \"var(--ink-receipt-2)\"\n : \"var(--ink-faint)\";\n return (\n <div className=\"px-5 py-4\">\n <div className=\"ln-eyebrow\">{label}</div>\n <div\n className=\"mt-1 truncate text-ink-cream ln-numeral\"\n style={{ fontSize: 44, lineHeight: 1 }}\n >\n {value ?? <span className=\"text-ink-faint\">—</span>}\n </div>\n {caption && (\n <div className=\"mt-2 truncate font-mono text-[11px]\" style={{ color: captionColor }}>\n {caption}\n </div>\n )}\n </div>\n );\n}\n"],"x_google_ignoreList":[0],"mappings":"6aAaA,IAAM,EAAa,EAAiB,cAAe,CAHjD,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC1C,CAAC,OAAQ,CAAE,EAAG,gBAAiB,IAAK,SAAU,CAAC,CAEE,CAAW,YCH9D,SAAgB,EAAgB,EAAa,EAAU,GAAwC,CAC7F,GAAM,CAAC,EAAO,IAAA,EAAA,EAAA,UAA8B,EAAQ,CAiBpD,OAhBA,EAAA,EAAA,eAAgB,CACd,GAAI,CACF,IAAM,EAAM,aAAa,QAAQ,EAAI,EACjC,IAAQ,KAAO,IAAQ,SAAQ,EAAS,GAAK,MAC3C,IAGP,CAAC,EAAI,CAAC,CASF,CAAC,EARK,GAAqB,CAChC,EAAS,EAAE,CACX,GAAI,CACF,aAAa,QAAQ,EAAK,EAAI,IAAM,IAAI,MAClC,IAIS,WCbf,EAAgB,CACpB,CACE,GAAI,MACJ,MAAO,eACP,KAAM,oJACN,IAAK,iBACL,KAAM,SACP,CACD,CACE,GAAI,O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./Button-D1rFtlez.js";import{t as s}from"./refresh-cw-BO0blIzU.js";import{a as c,t as l,u}from"./index-BVno9lTD.js";import{t as d}from"./Badge-Bl9eBoUa.js";import{a as f,n as p,r as m,t as h}from"./Field-DJ9InfU_.js";var g=a(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),_=a(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),v=a(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),y=t(n());function b(e,t,n){let r=new Set;for(let t of e)t.kind===`send`&&t.receiptIds.length>0&&r.add(t.index);if(r.size===0)return{rows:t,dedupeKeys:n,prunedCount:0};let i=[],a=[];for(let e=0;e<t.length;e++)r.has(e)||(i.push(t[e]),a.push(n[e]??null));return{rows:i,dedupeKeys:a,prunedCount:r.size}}var x=e(),S={"show-hn":{description:`One-touch founder-to-founder reply to a recent Show HN post. References a specific comment thread.`,fields:[{key:`founderName`,label:`Founder name`,type:`text`,required:!0},{key:`founderEmail`,label:`Founder email`,type:`email`,required:!0},{key:`postTitle`,label:`Show HN title`,type:`text`,required:!0,placeholder:`Show HN: Acme — open-source durable workflows`},{key:`postUrl`,label:`Show HN URL`,type:`url`,required:!0},{key:`hookSummary`,label:`Hook (specific comment thread / detail to reference)`,type:`textarea`,required:!0}],defaultRow:{founderName:``,founderEmail:``,postTitle:``,postUrl:``,hookSummary:``}},"job-change":{description:`Triggered by a prospect starting a new role at a target company. Day-0 only here; cadence engine fires the day-5 follow-up automatically.`,fields:[{key:`name`,label:`Prospect name`,type:`text`,required:!0},{key:`email`,label:`Prospect email`,type:`email`,required:!0},{key:`newRole`,label:`New role`,type:`text`,required:!0},{key:`newCompany`,label:`New company`,type:`text`,required:!0},{key:`previousRole`,label:`Previous role`,type:`text`},{key:`previousCompany`,label:`Previous company`,type:`text`},{key:`linkedinUrl`,label:`LinkedIn URL (optional)`,type:`url`}],defaultRow:{name:``,email:``,newRole:``,newCompany:``,previousRole:``,previousCompany:``,linkedinUrl:``}},"accelerator-batch":{description:`Founder-to-founder outreach within or across accelerator batches (YC, On Deck, SPC, Antler, Techstars).`,fields:[{key:`name`,label:`Prospect name`,type:`text`,required:!0},{key:`email`,label:`Prospect email`,type:`email`,required:!0},{key:`company`,label:`Company`,type:`text`,required:!0},{key:`cohort`,label:`Cohort tag`,type:`text`,required:!0,placeholder:`e.g. yc-w26 · tx-s26 · antler-ldn-12`},{key:`launchUrl`,label:`Launch URL (optional)`,type:`url`},{key:`productOneLiner`,label:`Their product one-liner`,type:`text`},{key:`linkedinUrl`,label:`LinkedIn URL (optional)`,type:`url`}],defaultRow:{name:``,email:``,company:``,cohort:``,launchUrl:``,productOneLiner:``,linkedinUrl:``},extras:[{key:`senderCohort`,label:`Your cohort tag (sender)`,type:`text`,required:!0,placeholder:`e.g. yc-w23 · od-2 · (leave blank)`},{key:`freeForCohortOffer`,label:`Free-for-cohort offer (optional)`,type:`text`,placeholder:`e.g. Free for your batch through demo day — reply with your cohort.`}]},"post-funding":{description:`Triggered by a recent funding announcement. Day-0 here; cadence engine fires the day-9 follow-up and day-18 breakup automatically.`,fields:[{key:`name`,label:`Founder name`,type:`text`,required:!0},{key:`email`,label:`Founder email`,type:`email`,required:!0},{key:`company`,label:`Company`,type:`text`,required:!0},{key:`round`,label:`Round`,type:`text`,required:!0,placeholder:`Seed / Series A / Series B`},{key:`amountUsd`,label:`Amount (USD)`,type:`number`,required:!0,placeholder:`5000000`},{key:`leadInvestor`,label:`Lead investor (optional)`,type:`text`},{key:`sourceUrl`,label:`Announcement URL`,type:`url`,required:!0},{key:`linkedinUrl`,label:`LinkedIn URL (optional)`,type:`url`}],defaultRow:{name:``,email:``,company:``,round:``,amountUsd:``,leadInvestor:``,sourceUrl:``,linkedinUrl:``}},"hiring-signal":{description:`Triggered by a job post at a target company. One-touch email to the hiring manager with your ramp-time claim.`,fields:[{key:`name`,label:`Hiring manager name`,type:`text`,required:!0},{key:`email`,label:`Hiring manager email`,type:`email`,required:!0},{key:`company`,label:`Company`,type:`text`,required:!0},{key:`jobTitle`,label:`Job title they're hiring for`,type:`text`,required:!0},{key:`jobPostUrl`,label:`Job post URL (optional)`,type:`url`},{key:`yourClaim`,label:`Your ramp-time claim`,type:`textarea`,required:!0,placeholder:`We cut new-hire ramp time by ~30% on the team they're hiring for — happy to share how.`}],defaultRow:{name:``,email:``,company:``,jobTitle:``,jobPostUrl:``,yourClaim:``}},"podcast-guest":{description:`One-touch reply to a recent podcast guest referencing a specific moment from the episode.`,fields:[{key:`name`,label:`Guest name`,type:`text`,required:!0},{key:`email`,label:`Guest email`,type:`email`,required:!0},{key:`company`,label:`Guest company`,type:`text`,required:!0},{key:`podcast`,label:`Podcast`,type:`text`,required:!0,placeholder:`Latent Space`},{key:`episodeTitle`,label:`Episode title`,type:`text`,required:!0},{key:`hookQuote`,label:`Specific quote or moment`,type:`textarea`,required:!0},{key:`bridge`,label:`Why the moment matters to your work (one sentence)`,type:`text`}],defaultRow:{name:``,email:``,company:``,podcast:``,episodeTitle:``,hookQuote:``,bridge:``}},"competitor-switch":{description:`Migration-honesty pitch to a prospect using a vendor you replace. Cites a specific evidence URL or claim, includes one yourEdge fact.`,fields:[{key:`name`,label:`Prospect name`,type:`text`,required:!0},{key:`email`,label:`Prospect email`,type:`email`,required:!0},{key:`company`,label:`Company`,type:`text`,required:!0},{key:`competitor`,label:`Competitor (incumbent)`,type:`text`,required:!0,placeholder:`e.g. Salesforce · QuickBooks · Mailchimp`},{key:`yourEdge`,label:`Your edge (one sentence)`,type:`textarea`,required:!0,hint:`One specific advantage, not a feature list. e.g. 'setup takes an afternoon, not a quarter'.`},{key:`evidenceUrl`,label:`Evidence URL (optional)`,type:`url`,placeholder:`https://...`},{key:`evidenceText`,label:`Evidence text (optional — paste a quote/snippet)`,type:`textarea`},{key:`linkedinUrl`,label:`LinkedIn URL (optional)`,type:`url`}],defaultRow:{name:``,email:``,company:``,competitor:``,yourEdge:``,evidenceUrl:``,evidenceText:``,linkedinUrl:``}},"stack-consolidation":{description:`Consolidation-honesty pitch to a developer whose repo wires up several separate API vendors. One SDK collapses the sprawl; cites the detected stack and one yourEdge fact.`,fields:[{key:`name`,label:`Prospect name`,type:`text`,required:!0},{key:`email`,label:`Prospect email`,type:`email`,required:!0},{key:`company`,label:`Company`,type:`text`,required:!0},{key:`vendorStack`,label:`Vendor stack (comma-separated)`,type:`textarea`,required:!0,placeholder:`e.g. auth0, stripe, sendgrid, datadog`,hint:`API vendors detected in their repo. Comma-separated.`},{key:`yourEdge`,label:`Your edge (one sentence)`,type:`textarea`,required:!0,hint:`One specific way you collapse the sprawl. e.g. 'one integration replaces three separate vendors'.`},{key:`evidenceUrl`,label:`Repo URL (optional)`,type:`url`,placeholder:`https://github.com/...`},{key:`linkedinUrl`,label:`LinkedIn URL (optional)`,type:`url`}],defaultRow:{name:``,email:``,company:``,vendorStack:``,yourEdge:``,evidenceUrl:``,linkedinUrl:``}}};function C(){let{playName:e}=l.useParams(),t=l.useSearch(),n=S[e],[a,C]=(0,y.useState)(n?[{...n.defaultRow}]:[]),[E,D]=(0,y.useState)(n?[null]:[]),[O,k]=(0,y.useState)({}),[A,j]=(0,y.useState)(t.dryRun!==`0`),[M,N]=(0,y.useState)(!1),[P,F]=(0,y.useState)([]),[I,L]=(0,y.useState)(null),[R,z]=(0,y.useState)(!1),B=(0,y.useCallback)(async r=>{if(n)try{let a=await i.queue({play:e,status:`approved`,limit:t.limit??50});if(r?.cancelled)return;let o=a.rows.map(e=>({payload:e.payload,dedupeKey:e.dedupeKey})).filter(e=>!!e.payload&&typeof e.payload==`object`),s=o.map(({payload:e})=>{let t=Object.assign({},n.defaultRow);for(let n of Object.keys(e)){let r=e[n];t[n]=r==null?``:typeof r==`string`?r:JSON.stringify(r)}return t});if(s.length===0){z(!0),C([{...n.defaultRow}]),D([null]);return}z(!1),C(s),D(o.map(e=>e.dedupeKey));let c=e=>{for(let{payload:t}of o){let n=t[e];if(typeof n==`string`&&n.trim().length>0)return n}},l={};for(let e of[`senderCohort`,`freeForCohortOffer`]){let t=c(e);t&&(l[e]=t)}Object.keys(l).length>0&&k(e=>({...l,...e}))}catch(e){if(r?.cancelled)return;L(`failed to load approved targets from queue: ${e.message}`)}},[e,n,t.limit]);(0,y.useEffect)(()=>{if(t.fromQueue!==`1`)return;let e={cancelled:!1};return(async()=>{if(await B(e),e.cancelled)return;let n={};t.senderCohort&&(n.senderCohort=t.senderCohort),t.freeForCohortOffer&&(n.freeForCohortOffer=t.freeForCohortOffer),Object.keys(n).length>0&&k(e=>({...e,...n}))})(),()=>{e.cancelled=!0}},[]);let V=(0,y.useMemo)(()=>{let e=new Map;for(let t of P)if(t.kind===`draft`)e.set(t.index,{subject:t.subject,body:t.body,flags:t.flags});else if(t.kind===`send`){let n=e.get(t.index);n&&e.set(t.index,{...n,receiptIds:t.receiptIds})}return e},[P]),H=P.find(e=>e.kind===`done`),U=P.filter(e=>e.kind===`error`),W=P.find(e=>e.kind===`verify`),G=P.findLast(e=>e.kind===`stage`),K=(0,y.useMemo)(()=>{let e=V.size,t=0,n=0;for(let e of V.values())e.receiptIds&&e.receiptIds.length>0&&t++,e.flags.length>0&&n++;return{drafts:e,sent:t,flagged:n}},[V]);if(!n)return(0,x.jsx)(`div`,{className:`-mx-6 -my-6 flex flex-col`,children:(0,x.jsxs)(`section`,{className:`border-b border-ink-rule px-6 pb-5 pt-6`,children:[(0,x.jsxs)(u,{to:`/plays`,className:`inline-flex items-center gap-1 font-mono text-[11px] text-ink-muted hover:text-ink-cream`,children:[(0,x.jsx)(g,{size:11}),` back to plays`]}),(0,x.jsx)(`div`,{className:`ln-eyebrow mt-3`,children:`The Ledger · Run`}),(0,x.jsx)(`h1`,{className:`mt-1 text-ink-cream`,style:{fontFamily:`var(--font-display)`,fontSize:36,fontWeight:400,letterSpacing:`-0.02em`,lineHeight:1},children:`CLI-only play.`}),(0,x.jsxs)(`p`,{className:`ln-note mt-3 max-w-[64ch] text-[14px] text-ink-cream-2`,children:[(0,x.jsx)(`code`,{className:`font-mono text-[color:var(--ink-spend-2)]`,children:e}),` isn't exposed in the dashboard yet. Run it from the CLI; the copy-CLI button is on the`,` `,(0,x.jsx)(u,{to:`/plays`,className:`text-ink-cream underline decoration-ink-faint decoration-1 underline-offset-2`,children:`Plays page`}),`.`]})]})});let q=(e,t,r)=>{C(i=>{let a=i.slice();return a[e]={...a[e]??n.defaultRow,[t]:r},a})},J=()=>{C(e=>[...e,{...n.defaultRow}]),D(e=>[...e,null])},Y=e=>{C(t=>t.filter((t,n)=>n!==e)),D(t=>t.filter((t,n)=>n!==e))};return(0,x.jsxs)(`div`,{className:`-mx-6 -my-6 flex flex-col`,children:[(0,x.jsxs)(`section`,{className:`border-b border-ink-rule px-6 pb-5 pt-6`,children:[(0,x.jsxs)(u,{to:`/plays`,className:`inline-flex items-center gap-1 font-mono text-[11px] text-ink-muted hover:text-ink-cream`,children:[(0,x.jsx)(g,{size:11}),` back to plays`]}),(0,x.jsxs)(`div`,{className:`mt-3 flex items-baseline gap-3`,children:[(0,x.jsx)(`div`,{className:`ln-eyebrow`,children:`The Ledger · Run`}),(0,x.jsx)(`code`,{className:`font-mono text-[13px] text-[color:var(--ink-spend-2)]`,style:{fontFeatureSettings:`"zero"`},children:e}),t.fromQueue===`1`&&(0,x.jsxs)(`button`,{type:`button`,onClick:()=>void B(),disabled:M,title:`Re-load approved rows from the queue (drops your in-form edits)`,className:`ml-2 inline-flex items-center gap-1 font-mono text-[11px] text-ink-muted hover:text-ink-cream disabled:opacity-40`,children:[(0,x.jsx)(s,{size:11}),` refresh from queue`]})]}),(0,x.jsx)(`h1`,{className:`mt-1 text-ink-cream`,style:{fontFamily:`var(--font-display)`,fontSize:44,fontWeight:600,letterSpacing:`-0.025em`,lineHeight:.98},children:`Draft in dry-run, then send.`}),(0,x.jsx)(`p`,{className:`ln-note mt-3 max-w-[72ch] text-[14px] text-ink-cream-2`,children:n.description}),R&&(0,x.jsxs)(`p`,{className:`mt-3 font-mono text-[12px] text-ink-spend-2`,children:[`no approved targets in `,(0,x.jsx)(`code`,{children:e}),` queue right now — add rows below or approve some on the`,` `,(0,x.jsx)(u,{to:`/queue`,className:`underline decoration-ink-faint underline-offset-2`,children:`queue page`}),`.`]})]}),n.extras&&(0,x.jsx)(w,{eyebrow:`Run options`,children:(0,x.jsx)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:n.extras.map(e=>(0,x.jsx)(p,{label:e.label,hint:e.hint??``,children:(0,x.jsx)(m,{type:e.type===`textarea`?`text`:e.type,required:!!e.required,placeholder:e.placeholder??``,value:O[e.key]??``,onChange:t=>k(n=>({...n,[e.key]:t.target.value}))})},e.key))})}),(0,x.jsx)(w,{eyebrow:`Targets · ${a.length}`,action:(0,x.jsxs)(o,{variant:`secondary`,size:`sm`,onClick:J,children:[(0,x.jsx)(_,{size:12}),` add row`]}),children:(0,x.jsx)(`div`,{className:`flex flex-col gap-5`,children:a.map((e,t)=>(0,x.jsxs)(`div`,{className:`border-l-2 border-ink-rule pl-4`,children:[(0,x.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,x.jsxs)(`span`,{className:`font-mono text-[11px] text-ink-faint`,children:[`target #`,t+1]}),a.length>1&&(0,x.jsx)(o,{variant:`ghost`,size:`sm`,onClick:()=>Y(t),children:(0,x.jsx)(v,{size:12})})]}),(0,x.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:n.fields.map(n=>n.type===`textarea`?(0,x.jsx)(p,{label:n.label+(n.required?` *`:``),hint:n.hint??``,className:`md:col-span-2`,children:(0,x.jsx)(f,{required:!!n.required,placeholder:n.placeholder??``,value:e[n.key]??``,onChange:e=>q(t,n.key,e.target.value),rows:3})},n.key):(0,x.jsx)(p,{label:n.label+(n.required?` *`:``),hint:n.hint??``,children:(0,x.jsx)(m,{type:n.type,required:!!n.required,placeholder:n.placeholder??``,value:e[n.key]??``,onChange:e=>q(t,n.key,e.target.value)})},n.key))})]},`row-${t}`))})}),(0,x.jsxs)(`section`,{className:`sticky bottom-0 z-10 flex flex-wrap items-center justify-between gap-3 border-b border-t border-ink-rule bg-ink-bg/90 px-6 py-3 backdrop-blur-[2px]`,children:[(0,x.jsx)(h,{label:`Dry run — draft only, no send (a one-time enrich lookup may apply)`,checked:A,onChange:e=>j(e.target.checked)}),(0,x.jsxs)(`div`,{className:`flex items-center gap-4 font-mono text-[11.5px] text-ink-faint`,children:[K.drafts>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`span`,{className:`text-ink-cream-2`,children:K.drafts}),` drafted`]}),K.flagged>0&&(0,x.jsxs)(`span`,{className:`text-[color:var(--ink-blocked-2)]`,children:[`· `,K.flagged,` lint`]}),(0,x.jsxs)(`span`,{children:[`·`,` `,(0,x.jsx)(`span`,{className:K.sent>0?`text-[color:var(--ink-receipt-2)]`:`text-ink-muted`,children:K.sent}),` `,`sent`]}),H?.kind===`done`&&(0,x.jsx)(`span`,{className:`text-ink-muted`,children:`· done`})]}),M&&K.drafts===0&&(0,x.jsx)(`span`,{children:G?.kind===`stage`?`${G.stage}…`:`preparing…`})]}),(0,x.jsxs)(o,{onClick:async()=>{L(null),F([]),N(!0);let t=a,n=E,r={dryRun:A,targets:a.map(e=>T(e)),...E.some(e=>e!=null)?{dedupeKeys:E}:{},...O.senderCohort?{senderCohort:O.senderCohort}:{},...O.freeForCohortOffer?{freeForCohortOffer:O.freeForCohortOffer}:{}},i=[];try{let t=await fetch(`/api/run/${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`,accept:`text/event-stream`},body:JSON.stringify(r)});if(!t.ok||!t.body){let e=await t.text();throw Error(`${t.status}: ${e.slice(0,200)}`)}let n=t.body.getReader(),a=new TextDecoder,o=``;for(;;){let{value:e,done:t}=await n.read();if(t)break;o+=a.decode(e,{stream:!0});let r=o.split(`
2
+
3
+ `);o=r.pop()??``;for(let e of r){let t=e.split(`
4
+ `).find(e=>e.startsWith(`data:`));if(t)try{let e=JSON.parse(t.slice(5).trim());i.push(e),F(t=>[...t,e])}catch{}}}}catch(e){L(e.message)}finally{N(!1);let e=b(i,t,n);e.prunedCount>0&&(C(e.rows),D(e.dedupeKeys),F([]))}},disabled:M,children:[(0,x.jsx)(c,{size:14}),M?`Running…`:A?`Generate drafts`:`Send for real`]})]}),I&&(0,x.jsx)(`section`,{className:`border-b border-ink-rule border-l-2 border-l-[color:var(--ink-blocked)] bg-[color:var(--ink-blocked)]/8 px-6 py-3`,children:(0,x.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,x.jsx)(d,{tone:`blocked`,children:`error`}),(0,x.jsx)(`span`,{className:`font-mono text-[12px] text-[color:var(--ink-blocked-2)]`,children:I})]})}),W&&W.kind===`verify`&&W.dropped.length>0&&(0,x.jsxs)(`section`,{className:`border-b border-ink-rule border-l-2 border-l-ink-rule bg-ink-surface/40 px-6 py-3`,children:[(0,x.jsxs)(`div`,{className:`font-mono text-[11.5px] text-ink-faint`,children:[`verify · `,W.verified,` of `,W.total,` deliverable`,` · `,W.dropped.length,` dropped`]}),(0,x.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-ink-muted`,children:W.dropped.map(e=>(0,x.jsxs)(`div`,{children:[e.email||`(missing)`,` — `,e.reason]},`${e.email}::${e.reason}`))})]}),(P.length>0||M)&&(0,x.jsx)(w,{eyebrow:`Output`,children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[Array.from(V.entries()).toSorted((e,t)=>e[0]-t[0]).map(([e,t])=>(0,x.jsxs)(`div`,{className:r(`relative border-l-2 pl-4`,t.flags.length>0?`border-[color:var(--ink-blocked)]`:t.receiptIds?`border-[color:var(--ink-receipt)]`:`border-ink-rule`),children:[t.receiptIds&&t.receiptIds.length>0&&(0,x.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute right-0 top-1 -rotate-[8deg] select-none font-mono text-[9.5px] uppercase tracking-[0.2em] text-[color:var(--ink-receipt-2)]`,children:(0,x.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-[var(--radius-xs)] border border-[color:var(--ink-receipt)]/50 px-1.5 py-0.5`,children:`✓ signed`})}),(0,x.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,x.jsxs)(`span`,{className:`font-mono text-[11px] text-ink-faint`,children:[`#`,e+1]}),t.flags.length===0&&t.receiptIds&&(0,x.jsx)(d,{tone:`receipt`,children:`sent`}),t.flags.length===0&&!t.receiptIds&&A&&(0,x.jsx)(d,{children:`dry-run`}),t.flags.length>0&&(0,x.jsx)(d,{tone:`blocked`,children:`lint`})]}),(0,x.jsx)(`div`,{className:`ln-eyebrow mt-1`,style:{fontSize:10},children:`subject`}),(0,x.jsx)(`div`,{className:`mt-0.5 text-ink-cream`,style:{fontFamily:`var(--font-display)`,fontSize:18,fontWeight:400,letterSpacing:`-0.005em`},children:t.subject}),(0,x.jsx)(`div`,{className:`ln-eyebrow mt-3`,style:{fontSize:10},children:`body`}),(0,x.jsx)(`pre`,{className:`mt-0.5 ln-prose whitespace-pre-wrap text-[13.5px] text-ink-cream-2`,children:t.body}),t.flags.length>0&&(0,x.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:t.flags.map(e=>(0,x.jsx)(`span`,{className:`rounded-[var(--radius-xs)] border border-[color:var(--ink-blocked)]/40 bg-[color:var(--ink-blocked)]/10 px-1.5 py-0.5 font-mono text-[10.5px] text-[color:var(--ink-blocked-2)]`,children:e},e))}),t.receiptIds&&t.receiptIds.length>0&&(0,x.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 font-mono text-[11px]`,children:[(0,x.jsx)(`span`,{className:`text-ink-faint`,children:`receipts`}),t.receiptIds.map(e=>(0,x.jsxs)(u,{to:`/receipts`,className:`text-[color:var(--ink-receipt-2)] hover:underline`,children:[`#`,e]},e))]})]},e)),U.map(e=>e.kind===`error`?(0,x.jsxs)(`div`,{className:`font-mono text-[11.5px] text-[color:var(--ink-blocked-2)]`,children:[`error · `,e.message]},`${e.index}-${e.message}`):null),H&&H.kind===`done`&&(0,x.jsxs)(`div`,{className:`font-mono text-[11.5px] text-ink-muted`,children:[`done · `,H.sent,` of `,H.total,` sent`]})]})})]})}function w({eyebrow:e,action:t,children:n}){return(0,x.jsxs)(`section`,{className:`border-b border-ink-rule px-6 py-6`,children:[(0,x.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,x.jsx)(`div`,{className:`ln-eyebrow`,children:e}),t]}),n]})}function T(e){let t={};for(let[n,r]of Object.entries(e))r.trim().length>0&&(t[n]=r.trim());return t}export{C as component};
5
+ //# sourceMappingURL=run._playName-CQU-5e18.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run._playName-CQU-5e18.js","names":["__iconNode","__iconNode","Link","ArrowLeft","Play","Plus","RefreshCw","Trash2","useCallback","useEffect","useMemo","useState","api","Badge","Button","Checkbox","Field","Input","Textarea","cn","pruneSentRows","RunSearch","fromQueue","limit","dryRun","senderCohort","freeForCohortOffer","Route","FieldSpec","key","label","type","required","placeholder","hint","PlaySchema","fields","defaultRow","Record","description","extras","PLAY_SCHEMAS","founderName","founderEmail","postTitle","postUrl","hookSummary","name","email","newRole","newCompany","previousRole","previousCompany","linkedinUrl","company","cohort","launchUrl","productOneLiner","round","amountUsd","leadInvestor","sourceUrl","jobTitle","jobPostUrl","yourClaim","podcast","episodeTitle","hookQuote","bridge","competitor","yourEdge","evidenceUrl","evidenceText","vendorStack","RunPage","playName","useParams","search","useSearch","schema","rows","setRows","dedupeKeys","setDedupeKeys","setExtras","setDryRun","running","setRunning","events","setEvents","RunPlayEvent","error","setError","hydrationEmpty","setHydrationEmpty","hydrateFromQueue","cancelledRef","cancelled","Promise","res","queue","play","status","pairs","map","r","payload","dedupeKey","filter","p","Boolean","targets","out","Object","assign","k","keys","v","JSON","stringify","length","stampedString","trim","undefined","stamped","prev","err","Error","message","ref","ex","draftedByIndex","m","Map","subject","body","flags","receiptIds","e","kind","set","index","cur","get","doneEvent","find","errorEvents","verifyEvent","latestStage","findLast","aggregate","drafts","size","sent","flagged","d","values","fontFamily","fontSize","fontWeight","letterSpacing","lineHeight","updateRow","rowIdx","fieldKey","value","next","slice","addRow","removeRow","_","i","submit","rowsSnapshot","dedupeKeysSnapshot","stripEmpty","hasAnyDedupeKey","some","RunPlayRequest","streamedEvents","fetch","encodeURIComponent","method","headers","accept","ok","text","reader","getReader","decoder","TextDecoder","buf","done","read","decode","stream","frames","split","pop","frame","line","l","startsWith","ev","parse","push","pruned","prunedCount","fontFeatureSettings","f","s","target","row","checked","stage","dropped","verified","total","reason","Array","from","entries","toSorted","a","b","idx","rid","RunLedgerSection","eyebrow","action","children","React","ReactNode","component"],"sources":["../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/arrow-left.mjs","../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/plus.mjs","../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/trash-2.mjs","../../src/lib/pruneSentRows.ts","../../src/routes/run.$playName.tsx?tsr-split=component"],"sourcesContent":["/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"m12 19-7-7 7-7\", key: \"1l729n\" }],\n [\"path\", { d: \"M19 12H5\", key: \"x3x0zl\" }]\n];\nconst ArrowLeft = createLucideIcon(\"arrow-left\", __iconNode);\n\nexport { __iconNode, ArrowLeft as default };\n//# sourceMappingURL=arrow-left.mjs.map\n","/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"M12 5v14\", key: \"s699le\" }]\n];\nconst Plus = createLucideIcon(\"plus\", __iconNode);\n\nexport { __iconNode, Plus as default };\n//# sourceMappingURL=plus.mjs.map\n","/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M10 11v6\", key: \"nco0om\" }],\n [\"path\", { d: \"M14 11v6\", key: \"outv1u\" }],\n [\"path\", { d: \"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\", key: \"miytrc\" }],\n [\"path\", { d: \"M3 6h18\", key: \"d0wm0j\" }],\n [\"path\", { d: \"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\", key: \"e791ji\" }]\n];\nconst Trash2 = createLucideIcon(\"trash-2\", __iconNode);\n\nexport { __iconNode, Trash2 as default };\n//# sourceMappingURL=trash-2.mjs.map\n","import type { RunPlayEvent } from \"@oneshot-gtm/shared-types\";\n\n/**\n * After a /api/run SSE stream finishes, drop the row entries that\n * successfully sent (kind=\"send\" with non-empty receiptIds) so the form\n * doesn't redisplay them — and a second submission can't fire another\n * email to the same prospect. Held drafts, errored rows, and unsent rows\n * stay so the founder can fix + retry.\n *\n * Returns parallel-aligned `rows` + `dedupeKeys` with the same length,\n * preserving the original founder-entered order minus the pruned indices.\n * In dry-run there are no `send` events, so the input passes through.\n */\nexport function pruneSentRows(\n events: RunPlayEvent[],\n rows: Record<string, string>[],\n dedupeKeys: (string | null)[],\n): { rows: Record<string, string>[]; dedupeKeys: (string | null)[]; prunedCount: number } {\n const sentIndices = new Set<number>();\n for (const ev of events) {\n if (ev.kind === \"send\" && ev.receiptIds.length > 0) {\n sentIndices.add(ev.index);\n }\n }\n if (sentIndices.size === 0) {\n return { rows, dedupeKeys, prunedCount: 0 };\n }\n const survivingRows: Record<string, string>[] = [];\n const survivingKeys: (string | null)[] = [];\n for (let i = 0; i < rows.length; i++) {\n if (sentIndices.has(i)) continue;\n survivingRows.push(rows[i] as Record<string, string>);\n survivingKeys.push(dedupeKeys[i] ?? null);\n }\n return {\n rows: survivingRows,\n dedupeKeys: survivingKeys,\n prunedCount: sentIndices.size,\n };\n}\n","import { createFileRoute, Link } from \"@tanstack/react-router\";\nimport { ArrowLeft, Play, Plus, RefreshCw, Trash2 } from \"lucide-react\";\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { RunPlayEvent, RunPlayRequest } from \"@oneshot-gtm/shared-types\";\nimport { api } from \"../api/client.ts\";\nimport { Badge } from \"../components/primitives/Badge.tsx\";\nimport { Button } from \"../components/primitives/Button.tsx\";\nimport { Checkbox, Field, Input, Textarea } from \"../components/primitives/Field.tsx\";\nimport { cn } from \"../lib/cn.ts\";\nimport { pruneSentRows } from \"../lib/pruneSentRows.ts\";\n\n/**\n * Search-param contract for arrivals from the `/queue` drain modal.\n * `fromQueue=1` triggers a one-time fetch of approved rows for this play\n * which then hydrates the targets editor. The other params round-trip the\n * modal's collected fields so the founder can submit from /run as if they\n * never left /queue.\n */\ninterface RunSearch {\n fromQueue?: \"1\";\n limit?: number;\n dryRun?: \"0\" | \"1\";\n senderCohort?: string;\n freeForCohortOffer?: string;\n}\n\nexport const Route = createFileRoute(\"/run/$playName\")({\n component: RunPage,\n validateSearch: (search: Record<string, unknown>): RunSearch => {\n const out: RunSearch = {};\n if (search[\"fromQueue\"] === \"1\") out.fromQueue = \"1\";\n if (typeof search[\"limit\"] === \"number\") out.limit = search[\"limit\"];\n else if (typeof search[\"limit\"] === \"string\" && /^\\d+$/.test(search[\"limit\"])) {\n out.limit = Number.parseInt(search[\"limit\"], 10);\n }\n if (search[\"dryRun\"] === \"0\" || search[\"dryRun\"] === \"1\") out.dryRun = search[\"dryRun\"];\n if (typeof search[\"senderCohort\"] === \"string\") out.senderCohort = search[\"senderCohort\"];\n if (typeof search[\"freeForCohortOffer\"] === \"string\") {\n out.freeForCohortOffer = search[\"freeForCohortOffer\"];\n }\n return out;\n },\n});\n\ninterface FieldSpec {\n key: string;\n label: string;\n type: \"text\" | \"email\" | \"number\" | \"url\" | \"textarea\";\n required?: boolean;\n placeholder?: string;\n hint?: string;\n}\n\ninterface PlaySchema {\n fields: FieldSpec[];\n defaultRow: Record<string, string>;\n description: string;\n /** Extra non-target options surfaced as form fields above the rows. */\n extras?: FieldSpec[];\n}\n\nconst PLAY_SCHEMAS: Record<string, PlaySchema> = {\n \"show-hn\": {\n description:\n \"One-touch founder-to-founder reply to a recent Show HN post. References a specific comment thread.\",\n fields: [\n { key: \"founderName\", label: \"Founder name\", type: \"text\", required: true },\n { key: \"founderEmail\", label: \"Founder email\", type: \"email\", required: true },\n {\n key: \"postTitle\",\n label: \"Show HN title\",\n type: \"text\",\n required: true,\n placeholder: \"Show HN: Acme — open-source durable workflows\",\n },\n { key: \"postUrl\", label: \"Show HN URL\", type: \"url\", required: true },\n {\n key: \"hookSummary\",\n label: \"Hook (specific comment thread / detail to reference)\",\n type: \"textarea\",\n required: true,\n },\n ],\n defaultRow: {\n founderName: \"\",\n founderEmail: \"\",\n postTitle: \"\",\n postUrl: \"\",\n hookSummary: \"\",\n },\n },\n \"job-change\": {\n description:\n \"Triggered by a prospect starting a new role at a target company. Day-0 only here; cadence engine fires the day-5 follow-up automatically.\",\n fields: [\n { key: \"name\", label: \"Prospect name\", type: \"text\", required: true },\n { key: \"email\", label: \"Prospect email\", type: \"email\", required: true },\n { key: \"newRole\", label: \"New role\", type: \"text\", required: true },\n { key: \"newCompany\", label: \"New company\", type: \"text\", required: true },\n { key: \"previousRole\", label: \"Previous role\", type: \"text\" },\n { key: \"previousCompany\", label: \"Previous company\", type: \"text\" },\n { key: \"linkedinUrl\", label: \"LinkedIn URL (optional)\", type: \"url\" },\n ],\n defaultRow: {\n name: \"\",\n email: \"\",\n newRole: \"\",\n newCompany: \"\",\n previousRole: \"\",\n previousCompany: \"\",\n linkedinUrl: \"\",\n },\n },\n \"accelerator-batch\": {\n description:\n \"Founder-to-founder outreach within or across accelerator batches (YC, On Deck, SPC, Antler, Techstars).\",\n fields: [\n { key: \"name\", label: \"Prospect name\", type: \"text\", required: true },\n { key: \"email\", label: \"Prospect email\", type: \"email\", required: true },\n { key: \"company\", label: \"Company\", type: \"text\", required: true },\n {\n key: \"cohort\",\n label: \"Cohort tag\",\n type: \"text\",\n required: true,\n placeholder: \"e.g. yc-w26 · tx-s26 · antler-ldn-12\",\n },\n { key: \"launchUrl\", label: \"Launch URL (optional)\", type: \"url\" },\n { key: \"productOneLiner\", label: \"Their product one-liner\", type: \"text\" },\n { key: \"linkedinUrl\", label: \"LinkedIn URL (optional)\", type: \"url\" },\n ],\n defaultRow: {\n name: \"\",\n email: \"\",\n company: \"\",\n cohort: \"\",\n launchUrl: \"\",\n productOneLiner: \"\",\n linkedinUrl: \"\",\n },\n extras: [\n {\n key: \"senderCohort\",\n label: \"Your cohort tag (sender)\",\n type: \"text\",\n required: true,\n placeholder: \"e.g. yc-w23 · od-2 · (leave blank)\",\n },\n {\n key: \"freeForCohortOffer\",\n label: \"Free-for-cohort offer (optional)\",\n type: \"text\",\n placeholder: \"e.g. Free for your batch through demo day — reply with your cohort.\",\n },\n ],\n },\n \"post-funding\": {\n description:\n \"Triggered by a recent funding announcement. Day-0 here; cadence engine fires the day-9 follow-up and day-18 breakup automatically.\",\n fields: [\n { key: \"name\", label: \"Founder name\", type: \"text\", required: true },\n { key: \"email\", label: \"Founder email\", type: \"email\", required: true },\n { key: \"company\", label: \"Company\", type: \"text\", required: true },\n {\n key: \"round\",\n label: \"Round\",\n type: \"text\",\n required: true,\n placeholder: \"Seed / Series A / Series B\",\n },\n {\n key: \"amountUsd\",\n label: \"Amount (USD)\",\n type: \"number\",\n required: true,\n placeholder: \"5000000\",\n },\n { key: \"leadInvestor\", label: \"Lead investor (optional)\", type: \"text\" },\n { key: \"sourceUrl\", label: \"Announcement URL\", type: \"url\", required: true },\n { key: \"linkedinUrl\", label: \"LinkedIn URL (optional)\", type: \"url\" },\n ],\n defaultRow: {\n name: \"\",\n email: \"\",\n company: \"\",\n round: \"\",\n amountUsd: \"\",\n leadInvestor: \"\",\n sourceUrl: \"\",\n linkedinUrl: \"\",\n },\n },\n \"hiring-signal\": {\n description:\n \"Triggered by a job post at a target company. One-touch email to the hiring manager with your ramp-time claim.\",\n fields: [\n { key: \"name\", label: \"Hiring manager name\", type: \"text\", required: true },\n { key: \"email\", label: \"Hiring manager email\", type: \"email\", required: true },\n { key: \"company\", label: \"Company\", type: \"text\", required: true },\n { key: \"jobTitle\", label: \"Job title they're hiring for\", type: \"text\", required: true },\n { key: \"jobPostUrl\", label: \"Job post URL (optional)\", type: \"url\" },\n {\n key: \"yourClaim\",\n label: \"Your ramp-time claim\",\n type: \"textarea\",\n required: true,\n placeholder:\n \"We cut new-hire ramp time by ~30% on the team they're hiring for — happy to share how.\",\n },\n ],\n defaultRow: {\n name: \"\",\n email: \"\",\n company: \"\",\n jobTitle: \"\",\n jobPostUrl: \"\",\n yourClaim: \"\",\n },\n },\n \"podcast-guest\": {\n description:\n \"One-touch reply to a recent podcast guest referencing a specific moment from the episode.\",\n fields: [\n { key: \"name\", label: \"Guest name\", type: \"text\", required: true },\n { key: \"email\", label: \"Guest email\", type: \"email\", required: true },\n { key: \"company\", label: \"Guest company\", type: \"text\", required: true },\n {\n key: \"podcast\",\n label: \"Podcast\",\n type: \"text\",\n required: true,\n placeholder: \"Latent Space\",\n },\n { key: \"episodeTitle\", label: \"Episode title\", type: \"text\", required: true },\n {\n key: \"hookQuote\",\n label: \"Specific quote or moment\",\n type: \"textarea\",\n required: true,\n },\n {\n key: \"bridge\",\n label: \"Why the moment matters to your work (one sentence)\",\n type: \"text\",\n },\n ],\n defaultRow: {\n name: \"\",\n email: \"\",\n company: \"\",\n podcast: \"\",\n episodeTitle: \"\",\n hookQuote: \"\",\n bridge: \"\",\n },\n },\n \"competitor-switch\": {\n description:\n \"Migration-honesty pitch to a prospect using a vendor you replace. Cites a specific evidence URL or claim, includes one yourEdge fact.\",\n fields: [\n { key: \"name\", label: \"Prospect name\", type: \"text\", required: true },\n { key: \"email\", label: \"Prospect email\", type: \"email\", required: true },\n { key: \"company\", label: \"Company\", type: \"text\", required: true },\n {\n key: \"competitor\",\n label: \"Competitor (incumbent)\",\n type: \"text\",\n required: true,\n placeholder: \"e.g. Salesforce · QuickBooks · Mailchimp\",\n },\n {\n key: \"yourEdge\",\n label: \"Your edge (one sentence)\",\n type: \"textarea\",\n required: true,\n hint: \"One specific advantage, not a feature list. e.g. 'setup takes an afternoon, not a quarter'.\",\n },\n {\n key: \"evidenceUrl\",\n label: \"Evidence URL (optional)\",\n type: \"url\",\n placeholder: \"https://...\",\n },\n {\n key: \"evidenceText\",\n label: \"Evidence text (optional — paste a quote/snippet)\",\n type: \"textarea\",\n },\n { key: \"linkedinUrl\", label: \"LinkedIn URL (optional)\", type: \"url\" },\n ],\n defaultRow: {\n name: \"\",\n email: \"\",\n company: \"\",\n competitor: \"\",\n yourEdge: \"\",\n evidenceUrl: \"\",\n evidenceText: \"\",\n linkedinUrl: \"\",\n },\n },\n \"stack-consolidation\": {\n description:\n \"Consolidation-honesty pitch to a developer whose repo wires up several separate API vendors. One SDK collapses the sprawl; cites the detected stack and one yourEdge fact.\",\n fields: [\n { key: \"name\", label: \"Prospect name\", type: \"text\", required: true },\n { key: \"email\", label: \"Prospect email\", type: \"email\", required: true },\n { key: \"company\", label: \"Company\", type: \"text\", required: true },\n {\n key: \"vendorStack\",\n label: \"Vendor stack (comma-separated)\",\n type: \"textarea\",\n required: true,\n placeholder: \"e.g. auth0, stripe, sendgrid, datadog\",\n hint: \"API vendors detected in their repo. Comma-separated.\",\n },\n {\n key: \"yourEdge\",\n label: \"Your edge (one sentence)\",\n type: \"textarea\",\n required: true,\n hint: \"One specific way you collapse the sprawl. e.g. 'one integration replaces three separate vendors'.\",\n },\n {\n key: \"evidenceUrl\",\n label: \"Repo URL (optional)\",\n type: \"url\",\n placeholder: \"https://github.com/...\",\n },\n { key: \"linkedinUrl\", label: \"LinkedIn URL (optional)\", type: \"url\" },\n ],\n defaultRow: {\n name: \"\",\n email: \"\",\n company: \"\",\n vendorStack: \"\",\n yourEdge: \"\",\n evidenceUrl: \"\",\n linkedinUrl: \"\",\n },\n },\n};\n\nfunction RunPage() {\n const { playName } = Route.useParams();\n const search = Route.useSearch();\n const schema = PLAY_SCHEMAS[playName];\n\n const [rows, setRows] = useState<Record<string, string>[]>(\n schema ? [{ ...schema.defaultRow }] : [],\n );\n // Parallel to `rows`: each entry is the originating queue row's dedupeKey\n // (when hydrated from `?fromQueue=1`) or null (manual entry / added row).\n // The server uses these to persist drafts back to the matching queue row;\n // null entries get skipped (correct — there's nothing to update).\n const [dedupeKeys, setDedupeKeys] = useState<(string | null)[]>(schema ? [null] : []);\n const [extras, setExtras] = useState<Record<string, string>>({});\n // dryRun mirrors what the founder picked in the drain modal when arriving\n // via `?fromQueue=1`. Default true otherwise — manual /run entry is more\n // commonly a preview than a real send.\n const [dryRun, setDryRun] = useState(search.dryRun !== \"0\");\n const [running, setRunning] = useState(false);\n const [events, setEvents] = useState<RunPlayEvent[]>([]);\n const [error, setError] = useState<string | null>(null);\n // Set when navigated from /queue with fromQueue=1 AND the approved-rows\n // fetch returned zero. Surfaces a one-line empty-state hint so the\n // founder isn't confused by the schema's default empty row.\n const [hydrationEmpty, setHydrationEmpty] = useState(false);\n\n // Mount-only hydrate-from-queue.\n //\n // StrictMode (dev) double-invokes this effect; we use a closure-scoped\n // `cancelled` flag so the first invocation's fetch resolves into a no-op\n // and the second invocation's fetch is the one that updates state. A\n // `useRef`-based \"ran-once\" guard would persist across the remount and\n // make the SECOND invocation skip — leaving state un-hydrated even though\n // we ran a fetch (silent dev-only failure).\n //\n // Net cost: 1 extra GET in dev StrictMode; 1 GET total in production.\n const hydrateFromQueue = useCallback(\n async (cancelledRef?: { cancelled: boolean }): Promise<void> => {\n if (!schema) return;\n try {\n const res = await api.queue({\n play: playName,\n status: \"approved\",\n limit: search.limit ?? 50,\n });\n if (cancelledRef?.cancelled) return;\n const pairs = res.rows\n .map((r) => ({ payload: r.payload, dedupeKey: r.dedupeKey }))\n .filter((p): p is { payload: Record<string, unknown>; dedupeKey: string } => {\n return Boolean(p.payload) && typeof p.payload === \"object\";\n });\n const targets = pairs.map(({ payload }) => {\n const out: Record<string, string> = Object.assign({}, schema.defaultRow);\n for (const k of Object.keys(payload)) {\n const v = payload[k];\n out[k] = v == null ? \"\" : typeof v === \"string\" ? v : JSON.stringify(v);\n }\n return out;\n });\n if (targets.length === 0) {\n setHydrationEmpty(true);\n setRows([{ ...schema.defaultRow }]);\n setDedupeKeys([null]);\n return;\n }\n setHydrationEmpty(false);\n setRows(targets);\n setDedupeKeys(pairs.map((p) => p.dedupeKey));\n // Reflect any per-row extras the finder stamped (e.g. accelerator-batch's\n // senderCohort) in the form's extras, so the field shows the value that\n // will actually be used instead of sitting empty. prev wins, so a value\n // the founder typed (or the drain modal passed) is never clobbered.\n const stampedString = (key: string): string | undefined => {\n for (const { payload } of pairs) {\n const v = payload[key];\n if (typeof v === \"string\" && v.trim().length > 0) return v;\n }\n return undefined;\n };\n const stamped: Record<string, string> = {};\n for (const key of [\"senderCohort\", \"freeForCohortOffer\"]) {\n const v = stampedString(key);\n if (v) stamped[key] = v;\n }\n if (Object.keys(stamped).length > 0) {\n setExtras((prev) => ({ ...stamped, ...prev }));\n }\n } catch (err) {\n if (cancelledRef?.cancelled) return;\n setError(`failed to load approved targets from queue: ${(err as Error).message}`);\n }\n },\n [playName, schema, search.limit],\n );\n\n useEffect(() => {\n if (search.fromQueue !== \"1\") return;\n const ref = { cancelled: false };\n void (async () => {\n await hydrateFromQueue(ref);\n if (ref.cancelled) return;\n // Round-trip the modal's per-play extras (accelerator-batch only\n // today) so the founder doesn't have to retype senderCohort/offer.\n const ex: Record<string, string> = {};\n if (search.senderCohort) ex[\"senderCohort\"] = search.senderCohort;\n if (search.freeForCohortOffer) ex[\"freeForCohortOffer\"] = search.freeForCohortOffer;\n if (Object.keys(ex).length > 0) setExtras((prev) => ({ ...prev, ...ex }));\n })();\n return () => {\n ref.cancelled = true;\n };\n // Mount-only on purpose — re-running on search-param edits would clobber\n // founder edits to the loaded rows. The manual \"Refresh from queue\"\n // button invokes hydrateFromQueue directly on demand.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const draftedByIndex = useMemo(() => {\n const m = new Map<\n number,\n { subject: string; body: string; flags: string[]; receiptIds?: number[] }\n >();\n for (const e of events) {\n if (e.kind === \"draft\") {\n m.set(e.index, { subject: e.subject, body: e.body, flags: e.flags });\n } else if (e.kind === \"send\") {\n const cur = m.get(e.index);\n if (cur) m.set(e.index, { ...cur, receiptIds: e.receiptIds });\n }\n }\n return m;\n }, [events]);\n\n const doneEvent = events.find((e) => e.kind === \"done\");\n const errorEvents = events.filter((e) => e.kind === \"error\");\n const verifyEvent = events.find((e) => e.kind === \"verify\");\n // Latest pipeline stage (\"verifying\" / \"drafting + sending\"), shown while the\n // run is in flight so it doesn't read as frozen on a slow real send.\n const latestStage = events.findLast((e) => e.kind === \"stage\");\n\n const aggregate = useMemo(() => {\n const drafts = draftedByIndex.size;\n let sent = 0;\n let flagged = 0;\n for (const d of draftedByIndex.values()) {\n if (d.receiptIds && d.receiptIds.length > 0) sent++;\n if (d.flags.length > 0) flagged++;\n }\n return { drafts, sent, flagged };\n }, [draftedByIndex]);\n\n if (!schema) {\n return (\n <div className=\"-mx-6 -my-6 flex flex-col\">\n <section className=\"border-b border-ink-rule px-6 pb-5 pt-6\">\n <Link\n to=\"/plays\"\n className=\"inline-flex items-center gap-1 font-mono text-[11px] text-ink-muted hover:text-ink-cream\"\n >\n <ArrowLeft size={11} /> back to plays\n </Link>\n <div className=\"ln-eyebrow mt-3\">The Ledger · Run</div>\n <h1\n className=\"mt-1 text-ink-cream\"\n style={{\n fontFamily: \"var(--font-display)\",\n fontSize: 36,\n fontWeight: 400,\n letterSpacing: \"-0.02em\",\n lineHeight: 1,\n }}\n >\n CLI-only play.\n </h1>\n <p className=\"ln-note mt-3 max-w-[64ch] text-[14px] text-ink-cream-2\">\n <code className=\"font-mono text-[color:var(--ink-spend-2)]\">{playName}</code> isn&apos;t\n exposed in the dashboard yet. Run it from the CLI; the copy-CLI button is on the{\" \"}\n <Link\n to=\"/plays\"\n className=\"text-ink-cream underline decoration-ink-faint decoration-1 underline-offset-2\"\n >\n Plays page\n </Link>\n .\n </p>\n </section>\n </div>\n );\n }\n\n const updateRow = (rowIdx: number, fieldKey: string, value: string): void => {\n setRows((prev) => {\n const next = prev.slice();\n next[rowIdx] = { ...(next[rowIdx] ?? schema.defaultRow), [fieldKey]: value };\n return next;\n });\n };\n\n const addRow = (): void => {\n setRows((prev) => [...prev, { ...schema.defaultRow }]);\n // New rows have no queue origin → null in the parallel array. Keeps\n // indices aligned so server-side persistence skips them cleanly.\n setDedupeKeys((prev) => [...prev, null]);\n };\n\n const removeRow = (rowIdx: number): void => {\n setRows((prev) => prev.filter((_, i) => i !== rowIdx));\n setDedupeKeys((prev) => prev.filter((_, i) => i !== rowIdx));\n };\n\n const submit = async (): Promise<void> => {\n setError(null);\n setEvents([]);\n setRunning(true);\n\n // Snapshot rows/dedupeKeys at submit time so the post-run auto-prune\n // can reconcile by original index even though the form is disabled\n // during the run (state can't drift here, but the closure capture is\n // explicit and avoids any future foot-gun).\n const rowsSnapshot = rows;\n const dedupeKeysSnapshot = dedupeKeys;\n\n const targets = rows.map((r) => stripEmpty(r));\n // Only attach dedupeKeys when at least one row has one (i.e. arrived\n // from /queue). Pure-manual sessions skip the field; the server then\n // skips persistence entirely.\n const hasAnyDedupeKey = dedupeKeys.some((k) => k != null);\n const body: RunPlayRequest = {\n dryRun,\n targets,\n ...(hasAnyDedupeKey ? { dedupeKeys } : {}),\n ...(extras[\"senderCohort\"] ? { senderCohort: extras[\"senderCohort\"] } : {}),\n ...(extras[\"freeForCohortOffer\"] ? { freeForCohortOffer: extras[\"freeForCohortOffer\"] } : {}),\n };\n\n // Local mirror of the SSE event stream — avoids reading React state in\n // the finally block (which would be stale due to async update batching)\n // and keeps setState calls below pure (one setter per concern).\n const streamedEvents: RunPlayEvent[] = [];\n\n try {\n const res = await fetch(`/api/run/${encodeURIComponent(playName)}`, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\", accept: \"text/event-stream\" },\n body: JSON.stringify(body),\n });\n if (!res.ok || !res.body) {\n const text = await res.text();\n throw new Error(`${res.status}: ${text.slice(0, 200)}`);\n }\n const reader = res.body.getReader();\n const decoder = new TextDecoder();\n let buf = \"\";\n while (true) {\n const { value, done } = await reader.read();\n if (done) break;\n buf += decoder.decode(value, { stream: true });\n const frames = buf.split(\"\\n\\n\");\n buf = frames.pop() ?? \"\";\n for (const frame of frames) {\n const line = frame.split(\"\\n\").find((l) => l.startsWith(\"data:\"));\n if (!line) continue;\n try {\n const ev = JSON.parse(line.slice(5).trim()) as RunPlayEvent;\n streamedEvents.push(ev);\n setEvents((prev) => [...prev, ev]);\n } catch {\n // ignore parse errors\n }\n }\n }\n } catch (err) {\n setError((err as Error).message);\n } finally {\n setRunning(false);\n // After a real-send run, drop rows whose draft actually shipped so\n // they can't be resent by a second submission of the same form.\n // Held / errored / unsent rows stay so the founder can edit and retry.\n const pruned = pruneSentRows(streamedEvents, rowsSnapshot, dedupeKeysSnapshot);\n if (pruned.prunedCount > 0) {\n setRows(pruned.rows);\n setDedupeKeys(pruned.dedupeKeys);\n // The per-index draft/send details from the just-finished run no\n // longer line up with the surviving rows — clear so the UI doesn't\n // show stale previews under freshly-shifted indices.\n setEvents([]);\n }\n }\n };\n\n return (\n <div className=\"-mx-6 -my-6 flex flex-col\">\n {/* Masthead */}\n <section className=\"border-b border-ink-rule px-6 pb-5 pt-6\">\n <Link\n to=\"/plays\"\n className=\"inline-flex items-center gap-1 font-mono text-[11px] text-ink-muted hover:text-ink-cream\"\n >\n <ArrowLeft size={11} /> back to plays\n </Link>\n <div className=\"mt-3 flex items-baseline gap-3\">\n <div className=\"ln-eyebrow\">The Ledger · Run</div>\n <code\n className=\"font-mono text-[13px] text-[color:var(--ink-spend-2)]\"\n style={{ fontFeatureSettings: '\"zero\"' }}\n >\n {playName}\n </code>\n {search.fromQueue === \"1\" && (\n <button\n type=\"button\"\n onClick={() => void hydrateFromQueue()}\n disabled={running}\n title=\"Re-load approved rows from the queue (drops your in-form edits)\"\n className=\"ml-2 inline-flex items-center gap-1 font-mono text-[11px] text-ink-muted hover:text-ink-cream disabled:opacity-40\"\n >\n <RefreshCw size={11} /> refresh from queue\n </button>\n )}\n </div>\n <h1\n className=\"mt-1 text-ink-cream\"\n style={{\n fontFamily: \"var(--font-display)\",\n fontSize: 44,\n fontWeight: 600,\n letterSpacing: \"-0.025em\",\n lineHeight: 0.98,\n }}\n >\n Draft in dry-run, then send.\n </h1>\n <p className=\"ln-note mt-3 max-w-[72ch] text-[14px] text-ink-cream-2\">\n {schema.description}\n </p>\n {hydrationEmpty && (\n <p className=\"mt-3 font-mono text-[12px] text-ink-spend-2\">\n no approved targets in <code>{playName}</code> queue right now — add rows below or\n approve some on the{\" \"}\n <Link to=\"/queue\" className=\"underline decoration-ink-faint underline-offset-2\">\n queue page\n </Link>\n .\n </p>\n )}\n </section>\n\n {schema.extras && (\n <RunLedgerSection eyebrow=\"Run options\">\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n {schema.extras.map((f) => (\n <Field key={f.key} label={f.label} hint={f.hint ?? \"\"}>\n <Input\n type={f.type === \"textarea\" ? \"text\" : f.type}\n required={!!f.required}\n placeholder={f.placeholder ?? \"\"}\n value={extras[f.key] ?? \"\"}\n onChange={(e) => setExtras((s) => ({ ...s, [f.key]: e.target.value }))}\n />\n </Field>\n ))}\n </div>\n </RunLedgerSection>\n )}\n\n <RunLedgerSection\n eyebrow={`Targets · ${rows.length}`}\n action={\n <Button variant=\"secondary\" size=\"sm\" onClick={addRow}>\n <Plus size={12} /> add row\n </Button>\n }\n >\n <div className=\"flex flex-col gap-5\">\n {rows.map((row, rowIdx) => (\n <div\n // eslint-disable-next-line react/no-array-index-key\n key={`row-${rowIdx}`}\n className=\"border-l-2 border-ink-rule pl-4\"\n >\n <div className=\"mb-3 flex items-center justify-between\">\n <span className=\"font-mono text-[11px] text-ink-faint\">target #{rowIdx + 1}</span>\n {rows.length > 1 && (\n <Button variant=\"ghost\" size=\"sm\" onClick={() => removeRow(rowIdx)}>\n <Trash2 size={12} />\n </Button>\n )}\n </div>\n <div className=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n {schema.fields.map((f) =>\n f.type === \"textarea\" ? (\n <Field\n key={f.key}\n label={f.label + (f.required ? \" *\" : \"\")}\n hint={f.hint ?? \"\"}\n className=\"md:col-span-2\"\n >\n <Textarea\n required={!!f.required}\n placeholder={f.placeholder ?? \"\"}\n value={row[f.key] ?? \"\"}\n onChange={(e) => updateRow(rowIdx, f.key, e.target.value)}\n rows={3}\n />\n </Field>\n ) : (\n <Field\n key={f.key}\n label={f.label + (f.required ? \" *\" : \"\")}\n hint={f.hint ?? \"\"}\n >\n <Input\n type={f.type}\n required={!!f.required}\n placeholder={f.placeholder ?? \"\"}\n value={row[f.key] ?? \"\"}\n onChange={(e) => updateRow(rowIdx, f.key, e.target.value)}\n />\n </Field>\n ),\n )}\n </div>\n </div>\n ))}\n </div>\n </RunLedgerSection>\n\n {/* Action bar — sticky. Live aggregates appear in the middle once drafts land. */}\n <section className=\"sticky bottom-0 z-10 flex flex-wrap items-center justify-between gap-3 border-b border-t border-ink-rule bg-ink-bg/90 px-6 py-3 backdrop-blur-[2px]\">\n <Checkbox\n label=\"Dry run — draft only, no send (a one-time enrich lookup may apply)\"\n checked={dryRun}\n onChange={(e) => setDryRun(e.target.checked)}\n />\n <div className=\"flex items-center gap-4 font-mono text-[11.5px] text-ink-faint\">\n {aggregate.drafts > 0 && (\n <>\n <span>\n <span className=\"text-ink-cream-2\">{aggregate.drafts}</span> drafted\n </span>\n {aggregate.flagged > 0 && (\n <span className=\"text-[color:var(--ink-blocked-2)]\">\n · {aggregate.flagged} lint\n </span>\n )}\n <span>\n ·{\" \"}\n <span\n className={\n aggregate.sent > 0 ? \"text-[color:var(--ink-receipt-2)]\" : \"text-ink-muted\"\n }\n >\n {aggregate.sent}\n </span>{\" \"}\n sent\n </span>\n {doneEvent?.kind === \"done\" && <span className=\"text-ink-muted\">· done</span>}\n </>\n )}\n {running && aggregate.drafts === 0 && (\n <span>{latestStage?.kind === \"stage\" ? `${latestStage.stage}…` : \"preparing…\"}</span>\n )}\n </div>\n <Button onClick={submit} disabled={running}>\n <Play size={14} />\n {running ? \"Running…\" : dryRun ? \"Generate drafts\" : \"Send for real\"}\n </Button>\n </section>\n\n {error && (\n <section className=\"border-b border-ink-rule border-l-2 border-l-[color:var(--ink-blocked)] bg-[color:var(--ink-blocked)]/8 px-6 py-3\">\n <div className=\"flex items-start gap-2\">\n <Badge tone=\"blocked\">error</Badge>\n <span className=\"font-mono text-[12px] text-[color:var(--ink-blocked-2)]\">{error}</span>\n </div>\n </section>\n )}\n\n {verifyEvent && verifyEvent.kind === \"verify\" && verifyEvent.dropped.length > 0 && (\n <section className=\"border-b border-ink-rule border-l-2 border-l-ink-rule bg-ink-surface/40 px-6 py-3\">\n <div className=\"font-mono text-[11.5px] text-ink-faint\">\n verify · {verifyEvent.verified} of {verifyEvent.total} deliverable\n {\" · \"}\n {verifyEvent.dropped.length} dropped\n </div>\n <div className=\"mt-1 font-mono text-[11px] text-ink-muted\">\n {verifyEvent.dropped.map((d) => (\n <div key={`${d.email}::${d.reason}`}>\n {d.email || \"(missing)\"} — {d.reason}\n </div>\n ))}\n </div>\n </section>\n )}\n\n {(events.length > 0 || running) && (\n <RunLedgerSection eyebrow=\"Output\">\n <div className=\"flex flex-col gap-4\">\n {Array.from(draftedByIndex.entries())\n .toSorted((a, b) => a[0] - b[0])\n .map(([idx, d]) => (\n <div\n key={idx}\n className={cn(\n \"relative border-l-2 pl-4\",\n d.flags.length > 0\n ? \"border-[color:var(--ink-blocked)]\"\n : d.receiptIds\n ? \"border-[color:var(--ink-receipt)]\"\n : \"border-ink-rule\",\n )}\n >\n {/* Receipt seal — appears only on successfully sent drafts. */}\n {d.receiptIds && d.receiptIds.length > 0 && (\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute right-0 top-1 -rotate-[8deg] select-none font-mono text-[9.5px] uppercase tracking-[0.2em] text-[color:var(--ink-receipt-2)]\"\n >\n <span className=\"inline-flex items-center gap-1 rounded-[var(--radius-xs)] border border-[color:var(--ink-receipt)]/50 px-1.5 py-0.5\">\n ✓ signed\n </span>\n </span>\n )}\n <div className=\"mb-1 flex items-center gap-2\">\n <span className=\"font-mono text-[11px] text-ink-faint\">#{idx + 1}</span>\n {d.flags.length === 0 && d.receiptIds && <Badge tone=\"receipt\">sent</Badge>}\n {d.flags.length === 0 && !d.receiptIds && dryRun && <Badge>dry-run</Badge>}\n {d.flags.length > 0 && <Badge tone=\"blocked\">lint</Badge>}\n </div>\n <div className=\"ln-eyebrow mt-1\" style={{ fontSize: 10 }}>\n subject\n </div>\n <div\n className=\"mt-0.5 text-ink-cream\"\n style={{\n fontFamily: \"var(--font-display)\",\n fontSize: 18,\n fontWeight: 400,\n letterSpacing: \"-0.005em\",\n }}\n >\n {d.subject}\n </div>\n <div className=\"ln-eyebrow mt-3\" style={{ fontSize: 10 }}>\n body\n </div>\n <pre className=\"mt-0.5 ln-prose whitespace-pre-wrap text-[13.5px] text-ink-cream-2\">\n {d.body}\n </pre>\n {d.flags.length > 0 && (\n <div className=\"mt-2 flex flex-wrap gap-1\">\n {d.flags.map((f) => (\n <span\n key={f}\n className=\"rounded-[var(--radius-xs)] border border-[color:var(--ink-blocked)]/40 bg-[color:var(--ink-blocked)]/10 px-1.5 py-0.5 font-mono text-[10.5px] text-[color:var(--ink-blocked-2)]\"\n >\n {f}\n </span>\n ))}\n </div>\n )}\n {d.receiptIds && d.receiptIds.length > 0 && (\n <div className=\"mt-2 flex items-center gap-2 font-mono text-[11px]\">\n <span className=\"text-ink-faint\">receipts</span>\n {d.receiptIds.map((rid) => (\n <Link\n key={rid}\n to=\"/receipts\"\n className=\"text-[color:var(--ink-receipt-2)] hover:underline\"\n >\n #{rid}\n </Link>\n ))}\n </div>\n )}\n </div>\n ))}\n {errorEvents.map((e) =>\n e.kind === \"error\" ? (\n <div\n key={`${e.index}-${e.message}`}\n className=\"font-mono text-[11.5px] text-[color:var(--ink-blocked-2)]\"\n >\n error · {e.message}\n </div>\n ) : null,\n )}\n {doneEvent && doneEvent.kind === \"done\" && (\n <div className=\"font-mono text-[11.5px] text-ink-muted\">\n done · {doneEvent.sent} of {doneEvent.total} sent\n </div>\n )}\n </div>\n </RunLedgerSection>\n )}\n </div>\n );\n}\n\nfunction RunLedgerSection({\n eyebrow,\n action,\n children,\n}: {\n eyebrow: string;\n action?: React.ReactNode;\n children: React.ReactNode;\n}) {\n return (\n <section className=\"border-b border-ink-rule px-6 py-6\">\n <div className=\"mb-4 flex items-center justify-between\">\n <div className=\"ln-eyebrow\">{eyebrow}</div>\n {action}\n </div>\n {children}\n </section>\n );\n}\n\nfunction stripEmpty(row: Record<string, string>): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [k, v] of Object.entries(row)) {\n if (v.trim().length > 0) out[k] = v.trim();\n }\n return out;\n}\n"],"x_google_ignoreList":[0,1,2],"mappings":"sRAaA,IAAM,EAAY,EAAiB,aAAcA,CAH/C,CAAC,OAAQ,CAAE,EAAG,iBAAkB,IAAK,SAAU,CAAC,CAChD,CAAC,OA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AC,MAAD,CAAK,UAAU,sBAAcF,EAAa,CAAA,CACzCC,EACE,GACJC,EACO,GAId,SAASvD,EAAWqC,EAAqD,CACvE,IAAMpG,EAA8B,EAAE,CACtC,IAAK,GAAM,CAACG,EAAGE,KAAMJ,OAAO4G,QAAQT,EAAI,CAClC/F,EAAEK,MAAM,CAACF,OAAS,IAAGR,EAAIG,GAAKE,EAAEK,MAAM,EAE5C,OAAOV"}
@@ -0,0 +1,2 @@
1
+ import{s as e}from"./Button-D1rFtlez.js";var t=e(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]);export{t};
2
+ //# sourceMappingURL=send-9D8YeqmY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-9D8YeqmY.js","names":[],"sources":["../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/send.mjs"],"sourcesContent":["/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\",\n key: \"1ffxy3\"\n }\n ],\n [\"path\", { d: \"m21.854 2.147-10.94 10.939\", key: \"12cjpa\" }]\n];\nconst Send = createLucideIcon(\"send\", __iconNode);\n\nexport { __iconNode, Send as default };\n//# sourceMappingURL=send.mjs.map\n"],"x_google_ignoreList":[0],"mappings":"yCAmBA,IAAM,EAAO,EAAiB,OAAQ,CATpC,CACE,OACA,CACE,EAAG,kIACH,IAAK,SACN,CACF,CACD,CAAC,OAAQ,CAAE,EAAG,6BAA8B,IAAK,SAAU,CAAC,CAExB,CAAW"}
@@ -0,0 +1,2 @@
1
+ import{c as e,d as t,l as n,o as r,s as i,t as a}from"./Button-D1rFtlez.js";import{f as o,m as ee,n as te,p as s}from"./index-BVno9lTD.js";import{t as c}from"./Badge-Bl9eBoUa.js";import{a as l,i as u,n as d,r as f,t as p}from"./Field-DJ9InfU_.js";var ne=i(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),re=i(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),m=t(n()),h=e(),g={openrouter:`anthropic/claude-sonnet-4.6`,openai:`gpt-4o-mini`,anthropic:`claude-sonnet-4-6`},ie={OPENROUTER_API_KEY:`OpenRouter API key`,OPENAI_API_KEY:`OpenAI API key`,ANTHROPIC_API_KEY:`Anthropic API key`,CDP_API_KEY_ID:`CDP_API_KEY_ID`,CDP_API_KEY_SECRET:`CDP_API_KEY_SECRET`,CDP_WALLET_SECRET:`CDP_WALLET_SECRET`,AGENT_PRIVATE_KEY:`AGENT_PRIVATE_KEY`};function _(){let e=ee(),t=s({queryKey:[`setup`],queryFn:r.setupStatus}),n=s({queryKey:[`doctor`],queryFn:r.doctor}),[i,_]=(0,m.useState)(``),[b,x]=(0,m.useState)(``),[ae,oe]=(0,m.useState)(``),[se,ce]=(0,m.useState)(``),[le,S]=(0,m.useState)(``),[C,w]=(0,m.useState)(``),[T,ue]=(0,m.useState)(``),[E,D]=(0,m.useState)(null),[O,k]=(0,m.useState)(null),[A,j]=(0,m.useState)(`openrouter`),[M,N]=(0,m.useState)(``),[P,F]=(0,m.useState)(!0),[I,L]=(0,m.useState)(`cdp`),[R,z]=(0,m.useState)(``),[B,V]=(0,m.useState)(``),[H,U]=(0,m.useState)(``),[W,G]=(0,m.useState)(!1),[K,q]=(0,m.useState)({}),[de,fe]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(!t.data?.cfg)return;let e=t.data.cfg;_(e.founderName??``),x(e.founderEmail??``),oe(e.productOneLiner??``),ce(e.productDomain??``),S(e.sendingDomain??``),w(e.icpOneLiner??``),z(e.founderCredentials??``),V(e.productPortfolio??``),U(e.partners??``),G(e.mobileSignature??!1),j(e.llmProvider),N(e.llmModel||g[e.llmProvider]||``),F(e.telemetryEnabled),L(e.walletMode)},[t.data?.cfg]);let J=o({mutationFn:e=>r.deriveIcp(e),onSuccess:e=>{w(e.proposedIcp),k({url:e.sourceUrl,cost:e.costUsd}),D(null)},onError:e=>{D(e.message),k(null)}}),[Y,pe]=(0,m.useState)(0);(0,m.useEffect)(()=>{if(!J.isPending){pe(0);return}let e=Date.now(),t=setInterval(()=>{pe(Math.floor((Date.now()-e)/1e3))},250);return()=>clearInterval(t)},[J.isPending]);let me=Y<15?`Reading the page · ${Y}s`:Y<35?`Still reading — slow pages take a moment · ${Y}s`:`Asking the LLM to extract an ICP · ${Y}s`,X=o({mutationFn:async()=>{let e={};for(let[t,n]of Object.entries(K))n.trim().length>0&&(e[t]=n.trim());await r.setup({founderName:i,founderEmail:b,productOneLiner:ae,productDomain:se,sendingDomain:le,icpOneLiner:C,founderCredentials:R,productPortfolio:B,partners:H,mobileSignature:W,llmProvider:A,llmModel:M,telemetryEnabled:P,walletMode:I,secrets:e})},onSuccess:()=>{q({}),fe(Date.now()),e.invalidateQueries({queryKey:[`setup`]}),e.invalidateQueries({queryKey:[`doctor`]}),e.invalidateQueries({queryKey:[`home`]})}}),Z=t.data?.sources??{},Q=A===`openrouter`?`OPENROUTER_API_KEY`:A===`openai`?`OPENAI_API_KEY`:`ANTHROPIC_API_KEY`,$=(e,t)=>{q(n=>({...n,[e]:t}))};return(0,m.useEffect)(()=>{X.isError&&te.error(`couldn't save · ${X.error.message}`)},[X.isError,X.error]),(0,h.jsxs)(`div`,{className:`-mx-6 -my-6 flex flex-col`,children:[(0,h.jsxs)(`section`,{className:`flex items-end justify-between gap-4 border-b border-ink-rule px-6 pb-5 pt-6`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`ln-eyebrow`,children:`The Ledger · Setup`}),(0,h.jsx)(`h1`,{className:`mt-1 text-ink-cream`,style:{fontFamily:`var(--font-display)`,fontSize:44,fontWeight:600,letterSpacing:`-0.025em`,lineHeight:.98},children:`Profile, provider, wallet.`})]}),(0,h.jsxs)(`span`,{className:`text-[11px] text-ink-faint ln-mono`,children:[`saved to `,(0,h.jsx)(`span`,{className:`text-ink-muted`,children:`~/.oneshot-gtm/config.json`}),` ·`,` `,(0,h.jsx)(`span`,{className:`text-ink-muted`,children:`.env`}),` · chmod 600`]})]}),(0,h.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),X.mutate()},className:`flex flex-col`,children:[(0,h.jsx)(v,{eyebrow:`01 · Founder profile`,lede:`How prospects see you on the other side of the inbox.`,children:(0,h.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:[(0,h.jsx)(d,{label:`Name`,children:(0,h.jsx)(f,{value:i,onChange:e=>_(e.target.value),placeholder:`Jane Doe`})}),(0,h.jsx)(d,{label:`Reply-to email`,children:(0,h.jsx)(f,{type:`email`,value:b,onChange:e=>x(e.target.value),placeholder:`jane@yourcompany.com`})}),(0,h.jsx)(d,{label:`Signature domain`,hint:`Bare domain shown under your name in every email signature, e.g. yourcompany.com. Leave blank for no domain line.`,children:(0,h.jsx)(f,{value:se,onChange:e=>ce(e.target.value),placeholder:`yourcompany.com`})}),(0,h.jsx)(d,{label:`Sending domain`,hint:`The domain your OneShot wallet OWNS. Emails send from <your-first-name>@thisdomain. Must be wallet-owned or OneShot rejects the send. Leave blank to use the SDK default.`,children:(0,h.jsx)(f,{value:le,onChange:e=>S(e.target.value),placeholder:`yourcompany-mail.com`})}),(0,h.jsx)(d,{label:`Product one-liner`,hint:`What you're building, in one sentence.`,className:`md:col-span-2`,children:(0,h.jsx)(l,{value:ae,onChange:e=>oe(e.target.value),placeholder:`e.g. "Stripe for freight" · "AI bookkeeping for restaurants" · "scheduling for dog groomers"`,rows:2})})]})}),(0,h.jsx)(v,{eyebrow:`02 · Ideal customer profile`,lede:`A free-text classifier. The find layer uses this to drop candidates that don't match.`,children:(0,h.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,h.jsx)(d,{label:`Derive from a website`,hint:`Paste a domain (or full URL) of a company whose customers look like yours. We'll read the page and propose an ICP — you can edit before saving. Spends ~$0.02–0.05 (one webRead + one LLM call).`,children:(0,h.jsxs)(`div`,{className:`flex gap-2`,children:[(0,h.jsx)(f,{value:T,onChange:e=>ue(e.target.value),placeholder:`acme.com · https://yourcompany.com/customers`,onKeyDown:e=>{e.key===`Enter`&&!J.isPending&&T.trim().length>0&&(e.preventDefault(),J.mutate(T.trim()))}}),(0,h.jsxs)(a,{type:`button`,variant:`secondary`,className:`shrink-0 whitespace-nowrap`,disabled:J.isPending||T.trim().length===0,onClick:()=>J.mutate(T.trim()),children:[(0,h.jsx)(re,{size:12,className:J.isPending?`animate-pulse`:void 0}),J.isPending?`Working · ${Y}s`:`Derive ICP`]})]})}),J.isPending&&(0,h.jsxs)(`div`,{className:`flex items-center gap-2 font-mono text-[11px] text-ink-muted`,children:[(0,h.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-ink-cream-2`}),me]}),E&&(0,h.jsx)(`div`,{className:`border-l-2 border-[color:var(--ink-blocked)] bg-[color:var(--ink-blocked)]/10 px-3 py-2 font-mono text-[11.5px] text-[color:var(--ink-blocked-2)]`,children:E}),O&&!E&&(0,h.jsxs)(`div`,{className:`font-mono text-[11px] text-ink-muted`,children:[`drafted from`,` `,(0,h.jsx)(`a`,{href:O.url,target:`_blank`,rel:`noreferrer`,className:`text-ink-cream-2 underline decoration-ink-faint decoration-1 underline-offset-2 hover:decoration-ink-cream`,children:O.url}),` `,`· spent $`,O.cost.toFixed(3),` · edit below before saving.`]}),(0,h.jsx)(d,{label:`ICP one-liner`,hint:`Leave blank to disable filtering (every candidate passes through).`,children:(0,h.jsx)(l,{value:C,onChange:e=>w(e.target.value),placeholder:`e.g. "CFOs at Series-B SaaS" · "Shopify stores doing $1M+/yr" · "indie iOS devs"`,rows:3})})]})}),(0,h.jsx)(v,{eyebrow:`03 · Social proof`,lede:`All optional. Each maps to a different play type. Used by the LLM when drafting the second sentence of a first-touch email — never more than one beat per email.`,children:(0,h.jsxs)(`div`,{className:`grid grid-cols-1 gap-4`,children:[(0,h.jsx)(d,{label:`Founder background`,hint:`Prior companies, named past roles, anything that lets a stranger trust you. Used by job-change / podcast-guest / post-funding / breakup-revive.`,children:(0,h.jsx)(l,{value:R,onChange:e=>z(e.target.value),placeholder:`e.g. "ex-Stripe eng" · "VP Sales at Salesforce" · "ran a $2M Shopify store"`,rows:2})}),(0,h.jsx)(d,{label:`Products you've shipped`,hint:`Used in peer-founder outreach to show you've actually built things. Stack-consolidation / competitor-switch / show-hn / hiring-signal.`,children:(0,h.jsx)(l,{value:B,onChange:e=>V(e.target.value),placeholder:`Comma-separated list of products or projects you've shipped.`,rows:2})}),(0,h.jsx)(d,{label:`Notable partners / customers`,hint:`Brand names that open doors. Helps when the prospect doesn't know you yet. Accelerator-batch / demo-no-show.`,children:(0,h.jsx)(l,{value:H,onChange:e=>U(e.target.value),placeholder:`Comma-separated brand-name integrations or customers.`,rows:2})}),(0,h.jsx)(p,{checked:W,onChange:e=>G(e.target.checked),label:`Append "Sent from my iPhone" to every email signature`})]})}),(0,h.jsx)(v,{eyebrow:`04 · LLM provider`,lede:`Bring your own key. Swap providers freely; nothing is locked in.`,children:(0,h.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:[(0,h.jsx)(d,{label:`Provider`,children:(0,h.jsxs)(u,{value:A,onChange:e=>{let t=e.target.value;j(t),M||N(g[t]??``)},children:[(0,h.jsx)(`option`,{value:`openrouter`,children:`OpenRouter (recommended)`}),(0,h.jsx)(`option`,{value:`openai`,children:`OpenAI`}),(0,h.jsx)(`option`,{value:`anthropic`,children:`Anthropic`})]})}),(0,h.jsx)(d,{label:`Model`,children:(0,h.jsx)(f,{value:M,onChange:e=>N(e.target.value),placeholder:g[A]})}),(0,h.jsx)(d,{label:ie[Q]??Q,hint:Z[Q]===`env`?`Currently from shell env. Leaving blank keeps the env value.`:Z[Q]===`file`?`Currently from ~/.oneshot-gtm/.env. Leave blank to keep.`:`Not set. Paste it here to save (chmod 600).`,className:`md:col-span-2`,children:(0,h.jsx)(f,{type:`password`,placeholder:Z[Q]?`(unchanged)`:`sk-...`,value:K[Q]??``,onChange:e=>$(Q,e.target.value),autoComplete:`new-password`})})]})}),(0,h.jsx)(v,{eyebrow:`05 · OneShot wallet`,lede:`Keys live only in ~/.oneshot-gtm/.env chmod 600. Nothing leaves your machine.`,children:(0,h.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:[(0,h.jsx)(d,{label:`Wallet mode`,className:`md:col-span-2`,children:(0,h.jsxs)(u,{value:I,onChange:e=>L(e.target.value),children:[(0,h.jsx)(`option`,{value:`cdp`,children:`Coinbase CDP server wallet`}),(0,h.jsx)(`option`,{value:`private-key`,children:`Raw private key`})]})}),I===`cdp`?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d,{label:`CDP_API_KEY_ID`,hint:y(Z.CDP_API_KEY_ID),children:(0,h.jsx)(f,{type:`password`,placeholder:Z.CDP_API_KEY_ID?`(unchanged)`:``,value:K.CDP_API_KEY_ID??``,onChange:e=>$(`CDP_API_KEY_ID`,e.target.value),autoComplete:`new-password`})}),(0,h.jsx)(d,{label:`CDP_API_KEY_SECRET`,hint:y(Z.CDP_API_KEY_SECRET),children:(0,h.jsx)(f,{type:`password`,placeholder:Z.CDP_API_KEY_SECRET?`(unchanged)`:``,value:K.CDP_API_KEY_SECRET??``,onChange:e=>$(`CDP_API_KEY_SECRET`,e.target.value),autoComplete:`new-password`})}),(0,h.jsx)(d,{label:`CDP_WALLET_SECRET`,hint:y(Z.CDP_WALLET_SECRET),className:`md:col-span-2`,children:(0,h.jsx)(f,{type:`password`,placeholder:Z.CDP_WALLET_SECRET?`(unchanged)`:``,value:K.CDP_WALLET_SECRET??``,onChange:e=>$(`CDP_WALLET_SECRET`,e.target.value),autoComplete:`new-password`})})]}):(0,h.jsx)(d,{label:`AGENT_PRIVATE_KEY`,hint:y(Z.AGENT_PRIVATE_KEY),className:`md:col-span-2`,children:(0,h.jsx)(f,{type:`password`,placeholder:Z.AGENT_PRIVATE_KEY?`(unchanged)`:`0x...`,value:K.AGENT_PRIVATE_KEY??``,onChange:e=>$(`AGENT_PRIVATE_KEY`,e.target.value),autoComplete:`new-password`})})]})}),(0,h.jsx)(v,{eyebrow:`06 · Telemetry`,lede:`Off by default for your data, on by default for command-run counts. Opt out at will.`,children:(0,h.jsx)(p,{label:`Send anonymous opt-out telemetry (commands run, no data, no PII — see TELEMETRY.md)`,checked:P,onChange:e=>F(e.target.checked)})}),(0,h.jsxs)(`div`,{className:`sticky bottom-0 z-10 flex items-center justify-between gap-4 border-b border-t border-ink-rule bg-ink-bg/90 px-6 py-3 backdrop-blur-[2px]`,children:[(0,h.jsx)(`div`,{className:`font-mono text-[11px] text-ink-muted`,children:X.isSuccess&&de!=null?(0,h.jsxs)(`span`,{className:`text-[color:var(--ink-receipt-2)]`,children:[`· saved to `,(0,h.jsx)(`span`,{className:`text-ink-cream-2`,children:`.env`})]}):(0,h.jsx)(`span`,{className:`text-ink-faint`,children:`changes apply on save`})}),(0,h.jsxs)(a,{type:`submit`,disabled:X.isPending,children:[(0,h.jsx)(ne,{size:14}),X.isPending?`Saving…`:`Save changes`]})]})]}),(0,h.jsx)(v,{eyebrow:`— · Doctor`,lede:"Health of the local install. Run `oneshot-gtm doctor` for the CLI view.",children:(0,h.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:n.data?.checks.map(e=>(0,h.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px]`,children:[e.severity===`ok`&&(0,h.jsx)(c,{tone:`receipt`,children:`ok`}),e.severity===`warn`&&(0,h.jsx)(c,{tone:`spend`,children:`warn`}),e.severity===`fail`&&(0,h.jsx)(c,{tone:`blocked`,children:`fail`}),(0,h.jsx)(`span`,{className:`text-ink-muted`,children:e.name}),(0,h.jsx)(`span`,{className:`text-ink-cream`,children:e.message}),e.hint&&(0,h.jsxs)(`span`,{className:`ln-note text-ink-muted`,children:[`→ `,e.hint]})]},e.name))})})]})}function v({eyebrow:e,lede:t,children:n}){return(0,h.jsxs)(`section`,{className:`grid grid-cols-1 gap-6 border-b border-ink-rule px-6 py-6 lg:grid-cols-[220px_1fr]`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`ln-eyebrow`,children:e}),t&&(0,h.jsx)(`p`,{className:`ln-note mt-2 max-w-[32ch] text-[13px] text-ink-cream-2`,children:t})]}),(0,h.jsx)(`div`,{children:n})]})}function y(e){return e===`env`?`Currently from shell env. Leave blank to keep.`:e===`file`?`Currently from ~/.oneshot-gtm/.env. Leave blank to keep.`:`Not set yet.`}export{_ as component};
2
+ //# sourceMappingURL=setup-CqCzlBdR.js.map