oneshot-gtm-server 0.2.0 → 0.4.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.
- package/dist/bin.mjs +2232 -1211
- package/dist/bin.mjs.map +1 -1
- package/dist/web/assets/Badge-B2tW85qr.js +1 -0
- package/dist/web/assets/Button-C-XcKplu.js +1 -0
- package/dist/web/assets/EmptyNote-zvLnRLPo.js +1 -0
- package/dist/web/assets/Field-BxSk5tbg.js +1 -0
- package/dist/web/assets/Modal-CU0ZPvE2.js +1 -0
- package/dist/web/assets/Skeleton-DNAfO8PV.js +1 -0
- package/dist/web/assets/StrategistPanel-DMjQbPlQ.js +6 -0
- package/dist/web/assets/cadences-CvBPoULf.js +1 -0
- package/dist/web/assets/chevron-down-CDjJN-YY.js +1 -0
- package/dist/web/assets/chevron-right-BTFaTdbr.js +1 -0
- package/dist/web/assets/cn-CS0Arupu.js +1 -0
- package/dist/web/assets/inbox-CzzgtWQf.js +1 -0
- package/dist/web/assets/index-B_nrqLlS.js +54 -0
- package/dist/web/assets/index-Ya_svHJk.css +2 -0
- package/dist/web/assets/loader-circle-CKkt6cSn.js +1 -0
- package/dist/web/assets/measure-CEgySDdR.js +1 -0
- package/dist/web/assets/plays-CuudkOHb.js +1 -0
- package/dist/web/assets/queue-C7vGtsQ5.js +1 -0
- package/dist/web/assets/receipts-B5u3oLpw.js +1 -0
- package/dist/web/assets/refresh-cw-Bz4Kdt55.js +1 -0
- package/dist/web/assets/routes-DHC_we4Z.js +1 -0
- package/dist/web/assets/run._playName-B9sG9Msq.js +4 -0
- package/dist/web/assets/send-Bv2Dd-HU.js +1 -0
- package/dist/web/assets/setup-BRVBiCEX.js +1 -0
- package/dist/web/assets/{summarizeRun-BsPt7szF.js → summarizeRun-CVWcweeA.js} +1 -2
- package/dist/web/assets/x-CPdidoxn.js +1 -0
- package/dist/web/index.html +3 -3
- package/package.json +1 -1
- package/dist/web/assets/Badge-DE7L41a6.js +0 -2
- package/dist/web/assets/Badge-DE7L41a6.js.map +0 -1
- package/dist/web/assets/Button-NJ1UVzeB.js +0 -2
- package/dist/web/assets/Button-NJ1UVzeB.js.map +0 -1
- package/dist/web/assets/EmptyNote-DkmaZWuo.js +0 -2
- package/dist/web/assets/EmptyNote-DkmaZWuo.js.map +0 -1
- package/dist/web/assets/Field-B4mT8TGa.js +0 -2
- package/dist/web/assets/Field-B4mT8TGa.js.map +0 -1
- package/dist/web/assets/Modal-frAt7msr.js +0 -2
- package/dist/web/assets/Modal-frAt7msr.js.map +0 -1
- package/dist/web/assets/Skeleton-d2p06ghN.js +0 -2
- package/dist/web/assets/Skeleton-d2p06ghN.js.map +0 -1
- package/dist/web/assets/cadences-CsU8vKw2.js +0 -2
- package/dist/web/assets/cadences-CsU8vKw2.js.map +0 -1
- package/dist/web/assets/chevron-right-BXb7J1cp.js +0 -2
- package/dist/web/assets/chevron-right-BXb7J1cp.js.map +0 -1
- package/dist/web/assets/inbox-Dzd9QYT4.js +0 -2
- package/dist/web/assets/inbox-Dzd9QYT4.js.map +0 -1
- package/dist/web/assets/index-ByTPAanr.css +0 -2
- package/dist/web/assets/index-CzTgATNQ.js +0 -60
- package/dist/web/assets/index-CzTgATNQ.js.map +0 -1
- package/dist/web/assets/loader-circle-BylpxA-u.js +0 -2
- package/dist/web/assets/loader-circle-BylpxA-u.js.map +0 -1
- package/dist/web/assets/measure-S3BWSb2L.js +0 -2
- package/dist/web/assets/measure-S3BWSb2L.js.map +0 -1
- package/dist/web/assets/plays-DHIZA49D.js +0 -2
- package/dist/web/assets/plays-DHIZA49D.js.map +0 -1
- package/dist/web/assets/queue-ClVxfeJ0.js +0 -2
- package/dist/web/assets/queue-ClVxfeJ0.js.map +0 -1
- package/dist/web/assets/receipts-BgXV3-De.js +0 -2
- package/dist/web/assets/receipts-BgXV3-De.js.map +0 -1
- package/dist/web/assets/refresh-cw-BpMRSA9y.js +0 -2
- package/dist/web/assets/refresh-cw-BpMRSA9y.js.map +0 -1
- package/dist/web/assets/routes-B9L9tBMF.js +0 -2
- package/dist/web/assets/routes-B9L9tBMF.js.map +0 -1
- package/dist/web/assets/run._playName-a3eeybKs.js +0 -5
- package/dist/web/assets/run._playName-a3eeybKs.js.map +0 -1
- package/dist/web/assets/setup-fs0DMLq4.js +0 -2
- package/dist/web/assets/setup-fs0DMLq4.js.map +0 -1
- package/dist/web/assets/summarizeRun-BsPt7szF.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"receipts-BgXV3-De.js","names":["useQuery","useMemo","useState","api","EmptyNote","Modal","Skeleton","SkeletonRow","cn","formatUsd","timeAgo","DayGroup","key","label","count","totalCost","rows","ReceiptView","SYNC_CALL_TYPES","Set","ReceiptsPage","activeId","setActiveId","receipts","queryKey","queryFn","limit","refetchInterval","detail","Promise","resolve","receipt","enabled","groups","groupByDay","data","reduce","a","r","costUsd","fontFamily","fontSize","fontWeight","letterSpacing","lineHeight","length","isLoading","Array","from","_","i","map","g","id","playName","callType","JSON","stringify","signedReceipt","DaySection","group","onClickRow","createdAt","oneshotRequestId","has","now","Date","today","dayKey","yesterday","d","setDate","getDate","byKey","Map","Number","isNaN","getTime","get","formatDayLabel","set","push","getFullYear","String","getMonth","padStart","toLocaleDateString","undefined","weekday","month","day","component"],"sources":["../../src/routes/receipts.tsx?tsr-split=component"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { useMemo, useState } from \"react\";\nimport type { ReceiptView } from \"@oneshot-gtm/shared-types\";\nimport { api } from \"../api/client.ts\";\nimport { EmptyNote } from \"../components/primitives/EmptyNote.tsx\";\nimport { Modal } from \"../components/primitives/Modal.tsx\";\nimport { Skeleton, SkeletonRow } from \"../components/primitives/Skeleton.tsx\";\nimport { cn, formatUsd, timeAgo } from \"../lib/cn.ts\";\n\nexport const Route = createFileRoute(\"/receipts\")({\n component: ReceiptsPage,\n});\n\ninterface DayGroup {\n key: string;\n label: string;\n count: number;\n totalCost: number;\n rows: ReceiptView[];\n}\n\n// Synchronous OneShot primitives don't return a `request_id` (request and\n// response complete in one hop, no async job to reference). Render a `sync`\n// chip so a missing ID reads as by-design, not as a missing field.\nconst SYNC_CALL_TYPES = new Set([\"web.search\"]);\n\nfunction ReceiptsPage() {\n const [activeId, setActiveId] = useState<number | null>(null);\n const receipts = useQuery({\n queryKey: [\"receipts\", \"list\"],\n queryFn: () => api.receipts({ limit: 200 }),\n refetchInterval: 20_000,\n });\n const detail = useQuery({\n queryKey: [\"receipts\", \"detail\", activeId],\n queryFn: () => (activeId == null ? Promise.resolve(null) : api.receipt(activeId)),\n enabled: activeId != null,\n });\n\n const groups = useMemo(() => groupByDay(receipts.data?.receipts ?? []), [receipts.data]);\n const totalCost = useMemo(\n () => (receipts.data?.receipts ?? []).reduce((a, r) => a + (r.costUsd ?? 0), 0),\n [receipts.data],\n );\n\n return (\n <div className=\"-mx-6 -my-6 flex flex-col\">\n {/* Masthead */}\n <section className=\"flex items-end justify-between gap-4 border-b border-ink-rule px-6 pb-5 pt-6\">\n <div>\n <div className=\"ln-eyebrow\">The Ledger · Receipts</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 Signed, most recent first.\n </h1>\n </div>\n <div className=\"text-right font-mono text-[11px] text-ink-faint\">\n {receipts.data ? (\n <>\n <div>\n <span className=\"text-ink-cream-2\">{receipts.data.receipts.length}</span>{\" \"}\n <span className=\"text-ink-muted\">shown</span>\n </div>\n <div className=\"mt-0.5\">\n <span className=\"text-[color:var(--ink-spend-2)]\">{formatUsd(totalCost)}</span>{\" \"}\n <span className=\"text-ink-muted\">total</span>\n </div>\n </>\n ) : (\n <Skeleton lines={2} widths={[\"96px\", \"64px\"]} />\n )}\n </div>\n </section>\n\n {/* Receipts timeline — grouped by day, newest day first */}\n <section>\n {receipts.isLoading ? (\n <div>\n {Array.from({ length: 8 }, (_, i) => (\n <SkeletonRow key={i} />\n ))}\n </div>\n ) : receipts.data?.receipts.length === 0 ? (\n <div className=\"px-6 py-8\">\n <EmptyNote\n note=\"No receipts yet. Every call the agent makes leaves one; one always beats zero.\"\n cli=\"oneshot-gtm motion show-hn\"\n />\n </div>\n ) : (\n <div>\n {groups.map((g) => (\n <DaySection key={g.key} group={g} onClickRow={(id) => setActiveId(id)} />\n ))}\n </div>\n )}\n </section>\n\n <Modal\n open={activeId != null}\n title={detail.data?.receipt.playName ?? \"receipt\"}\n subtitle={detail.data ? `#${activeId} · ${detail.data.receipt.callType}` : `#${activeId}`}\n onClose={() => setActiveId(null)}\n width={720}\n >\n {detail.isLoading ? (\n <Skeleton lines={8} />\n ) : (\n <pre className=\"max-h-[60vh] overflow-auto rounded-[var(--radius-md)] border border-ink-rule bg-ink-bg-deep p-3 font-mono text-[12px] leading-[1.55] text-ink-cream-2\">\n {JSON.stringify(detail.data?.receipt.signedReceipt ?? {}, null, 2)}\n </pre>\n )}\n </Modal>\n </div>\n );\n}\n\nfunction DaySection({ group, onClickRow }: { group: DayGroup; onClickRow: (id: number) => void }) {\n return (\n <div>\n {/* Day header — sticky so you always know which day you're scrolling through. */}\n <div className=\"sticky top-0 z-10 flex items-baseline justify-between border-b border-ink-rule/80 bg-ink-bg/95 px-6 py-2.5 backdrop-blur-[2px]\">\n <div className=\"ln-eyebrow text-ink-cream-2\">{group.label}</div>\n <div className=\"font-mono text-[11px] text-ink-faint\">\n <span className=\"text-ink-cream-2\">{group.count}</span> call\n {group.count === 1 ? \"\" : \"s\"}\n {group.totalCost > 0 && (\n <>\n {\" · \"}\n <span className=\"text-[color:var(--ink-spend-2)]\">{formatUsd(group.totalCost)}</span>\n </>\n )}\n </div>\n </div>\n <table className=\"w-full text-[13px]\">\n <tbody>\n {group.rows.map((r, i) => (\n <tr\n key={r.id}\n onClick={() => onClickRow(r.id)}\n className={cn(\n \"cursor-pointer border-b border-ink-rule/50\",\n \"transition-colors duration-[var(--dur-stamp)]\",\n \"hover:bg-ink-surface/60\",\n i % 2 === 1 && \"bg-ink-surface/15\",\n )}\n >\n <td className=\"w-[72px] 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=\"w-[88px] 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=\"w-[72px] py-2 text-right font-mono text-[12px] text-ink-muted\">\n {timeAgo(r.createdAt)}\n </td>\n <td className=\"w-[200px] px-6 py-2 text-right font-mono text-[11px] text-ink-faint truncate\">\n {r.oneshotRequestId ? (\n r.oneshotRequestId\n ) : SYNC_CALL_TYPES.has(r.callType) ? (\n <span\n className=\"inline-flex items-center rounded-[var(--radius-xs)] border border-ink-rule/60 px-1.5 py-[1.5px] text-[10px] uppercase tracking-[0.08em] text-ink-faint\"\n title=\"Synchronous call — no async request ID by design\"\n >\n sync\n </span>\n ) : (\n \"—\"\n )}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n\n/**\n * Bucket receipts by local-calendar day. Assumes `receipts` is already in\n * reverse-chron order from the server; within a bucket we preserve that\n * order so the first row is the most recent.\n */\nfunction groupByDay(receipts: ReceiptView[]): DayGroup[] {\n const now = new Date();\n const today = dayKey(now);\n const yesterday = (() => {\n const d = new Date(now);\n d.setDate(d.getDate() - 1);\n return dayKey(d);\n })();\n\n const groups: DayGroup[] = [];\n const byKey = new Map<string, DayGroup>();\n\n for (const r of receipts) {\n const d = new Date(r.createdAt);\n if (Number.isNaN(d.getTime())) continue;\n const key = dayKey(d);\n let g = byKey.get(key);\n if (!g) {\n g = {\n key,\n label: formatDayLabel(d, key, today, yesterday),\n count: 0,\n totalCost: 0,\n rows: [],\n };\n byKey.set(key, g);\n groups.push(g);\n }\n g.rows.push(r);\n g.count++;\n g.totalCost += r.costUsd ?? 0;\n }\n return groups;\n}\n\nfunction dayKey(d: Date): string {\n return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, \"0\")}-${String(d.getDate()).padStart(2, \"0\")}`;\n}\n\nfunction formatDayLabel(d: Date, key: string, today: string, yesterday: string): string {\n if (key === today) return \"Today\";\n if (key === yesterday) return \"Yesterday\";\n return d.toLocaleDateString(undefined, {\n weekday: \"long\",\n month: \"long\",\n day: \"numeric\",\n });\n}\n"],"mappings":"oRAyBMkB,EAAkB,IAAIC,IAAI,CAAC,aAAa,CAAC,CAE/C,SAASC,GAAe,CACtB,GAAM,CAACC,EAAUC,IAAAA,EAAAA,EAAAA,UAAuC,KAAK,CACvDC,EAAWvB,EAAS,CACxBwB,SAAU,CAAC,WAAY,OAAO,CAC9BC,YAAetB,EAAIoB,SAAS,CAAEG,MAAO,IAAK,CAAC,CAC3CC,gBAAiB,IAClB,CAAC,CACIC,EAAS5B,EAAS,CACtBwB,SAAU,CAAC,WAAY,SAAUH,EAAS,CAC1CI,YAAgBJ,GAAY,KAAOQ,QAAQC,QAAQ,KAAK,CAAG3B,EAAI4B,QAAQV,EAAU,CACjFW,QAASX,GAAY,KACtB,CAAC,CAEIY,GAAAA,EAAAA,EAAAA,aAAuBC,EAAWX,EAASY,MAAMZ,UAAY,EAAE,CAAC,CAAE,CAACA,EAASY,KAAK,CAAC,CAClFpB,GAAAA,EAAAA,EAAAA,cACGQ,EAASY,MAAMZ,UAAY,EAAE,EAAEa,QAAQC,EAAGC,IAAMD,GAAKC,EAAEC,SAAW,GAAI,EAAE,CAC/E,CAAChB,EAASY,KACZ,CAAC,CAED,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,qCAAf,EAEE,EAAA,EAAA,MAAC,UAAD,CAAS,UAAU,wFAAnB,EACE,EAAA,EAAA,MAAC,MAAD,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,MAAD,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C,EAAI,IAAIJ,KAAK5B,EAAEwB,UAAU,CAC/B,GAAIa,OAAOC,MAAMN,EAAEO,SAAS,CAAC,CAAE,SAC/B,IAAMjE,EAAMwD,EAAOE,EAAE,CACjBlB,EAAIqB,EAAMK,IAAIlE,EAAI,CACjBwC,IACHA,EAAI,CACFxC,MACAC,MAAOkE,EAAeT,EAAG1D,EAAKuD,EAAOE,EAAU,CAC/CvD,MAAO,EACPC,UAAW,EACXC,KAAM,EAAA,CACP,CACDyD,EAAMO,IAAIpE,EAAKwC,EAAE,CACjBnB,EAAOgD,KAAK7B,EAAE,EAEhBA,EAAEpC,KAAKiE,KAAK3C,EAAE,CACdc,EAAEtC,QACFsC,EAAErC,WAAauB,EAAEC,SAAW,EAE9B,OAAON,EAGT,SAASmC,EAAOE,EAAiB,CAC/B,MAAO,GAAGA,EAAEY,aAAa,CAAA,GAAIC,OAAOb,EAAEc,UAAU,CAAG,EAAE,CAACC,SAAS,EAAG,IAAI,CAAA,GAAIF,OAAOb,EAAEE,SAAS,CAAC,CAACa,SAAS,EAAG,IAAI,GAGhH,SAASN,EAAeT,EAAS1D,EAAauD,EAAeE,EAA2B,CAGtF,OAFIzD,IAAQuD,EAAc,QACtBvD,IAAQyD,EAAkB,YACvBC,EAAEgB,mBAAmBC,IAAAA,GAAW,CACrCC,QAAS,OACTC,MAAO,OACPC,IAAK,UACN,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{s as e}from"./Button-NJ1UVzeB.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
|
|
2
|
-
//# sourceMappingURL=refresh-cw-BpMRSA9y.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"refresh-cw-BpMRSA9y.js","names":[],"sources":["../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/refresh-cw.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 [\"path\", { d: \"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\", key: \"v9h5vc\" }],\n [\"path\", { d: \"M21 3v5h-5\", key: \"1q7to0\" }],\n [\"path\", { d: \"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\", key: \"3uifl3\" }],\n [\"path\", { d: \"M8 16H3v5\", key: \"1cv678\" }]\n];\nconst RefreshCw = createLucideIcon(\"refresh-cw\", __iconNode);\n\nexport { __iconNode, RefreshCw as default };\n//# sourceMappingURL=refresh-cw.mjs.map\n"],"x_google_ignoreList":[0],"mappings":"yCAeA,IAAM,EAAY,EAAiB,aAAc,CAL/C,CAAC,OAAQ,CAAE,EAAG,qDAAsD,IAAK,SAAU,CAAC,CACpF,CAAC,OAAQ,CAAE,EAAG,aAAc,IAAK,SAAU,CAAC,CAC5C,CAAC,OAAQ,CAAE,EAAG,sDAAuD,IAAK,SAAU,CAAC,CACrF,CAAC,OAAQ,CAAE,EAAG,YAAa,IAAK,SAAU,CAAC,CAEI,CAAW"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as e,d as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./Button-NJ1UVzeB.js";import{n as l,t as u}from"./chevron-right-BXb7J1cp.js";import{i as d,p as f,s as p,u as m}from"./index-CzTgATNQ.js";import{t as h}from"./Badge-DE7L41a6.js";import{t as g}from"./EmptyNote-DkmaZWuo.js";import{n as _}from"./Skeleton-d2p06ghN.js";import{n as v,t as y}from"./summarizeRun-BsPt7szF.js";var b=s(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),x=t(r(),1);function S(e,t=!1){let[n,r]=(0,x.useState)(t);return(0,x.useEffect)(()=>{try{let t=localStorage.getItem(e);(t===`1`||t===`true`)&&r(!0)}catch{}},[e]),[n,t=>{r(t);try{localStorage.setItem(e,t?`1`:`0`)}catch{}}]}var C=e(),w=[{id:`icp`,title:`Set your ICP`,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.`,cta:`Open ICP setup`,href:`/setup`},{id:`find`,title:`Run your first finder`,lede:`Pick a trigger (Show HN is cheapest) and click Run now. Results land in the queue for your review before anything sends.`,cta:`Open the queue`,href:`/queue`},{id:`drain`,title:`Approve a target and drain`,lede:`Approve a queued row, then click drain to send. The cadence engine takes over from there.`,cta:`Open the queue`,href:`/queue`}],T=`oneshot-gtm:onboarding-skipped`;function E(){let[e,t]=S(T),n=f({queryKey:[`setup`],queryFn:a.setupStatus}),r=f({queryKey:[`triggers`],queryFn:a.triggers}),i=f({queryKey:[`queue`,`recent`,`home`],queryFn:()=>a.queue({limit:16})});if(e||n.isLoading||r.isLoading||i.isLoading)return null;let o={icp:(n.data?.cfg.icpOneLiner??``).trim().length>0,find:(r.data?.triggers??[]).some(e=>e.lastPolledAt!==null)||(i.data?.counts.pending??0)+(i.data?.counts.sent??0)>0,drain:(i.data?.counts.sent??0)>0},s=w.findIndex(e=>!o[e.id]);if(s===-1)return null;let l=w[s];return(0,C.jsx)(`section`,{className:`border-b border-ink-rule bg-ink-bg-deep px-6 py-6`,children:(0,C.jsxs)(`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)]`,children:[(0,C.jsxs)(`div`,{className:`flex-1`,children:[(0,C.jsxs)(`div`,{className:`ln-eyebrow`,children:[`Next step · `,s+1,` of `,w.length]}),(0,C.jsx)(`h2`,{className:`mt-1 text-ink-cream`,style:{fontFamily:`var(--font-display)`,fontSize:26,fontWeight:600,letterSpacing:`-0.02em`,lineHeight:1.05},children:l.title}),(0,C.jsx)(`p`,{className:`mt-1.5 max-w-2xl text-sm leading-relaxed text-ink-cream-2`,children:l.lede})]}),(0,C.jsxs)(`div`,{className:`flex flex-col items-end gap-2`,children:[(0,C.jsx)(m,{to:l.href,children:(0,C.jsxs)(c,{size:`sm`,variant:`primary`,children:[l.cta,` `,(0,C.jsx)(b,{size:12})]})}),(0,C.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:`font-mono text-[11px] text-ink-faint transition-colors hover:text-ink-muted`,children:`Skip`})]})]})})}function D(){let e=f({queryKey:[`triggers`],queryFn:()=>a.triggers(),refetchInterval:3e4}),[t,n]=(0,x.useState)(!1),r=e.data?.triggers??[],i=Date.now(),o=r.map(e=>{let t=e.running?`running`:e.enabled?e.ready?`enabled`:`not-ready`:`disabled`,n=null;return e.enabled&&e.ready&&!e.running&&e.lastPolledAt&&(n=new Date(e.lastPolledAt).getTime()+e.intervalMs-i),{trigger:e,state:t,dueInMs:n}}),s=o.filter(e=>e.state!==`disabled`).toSorted((e,t)=>e.state===`running`&&t.state!==`running`?-1:t.state===`running`&&e.state!==`running`?1:(e.dueInMs??1/0)-(t.dueInMs??1/0)),c=o.filter(e=>e.state===`disabled`),d=o.filter(e=>e.trigger.enabled).length,p=o.filter(e=>e.dueInMs!=null&&e.dueInMs<0).length;return(0,C.jsxs)(`section`,{className:`flex flex-col border-b border-ink-rule`,children:[(0,C.jsxs)(`div`,{className:`flex items-baseline justify-between px-6 pb-2 pt-5`,children:[(0,C.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,C.jsx)(`div`,{className:`ln-eyebrow`,children:`Scheduler`}),(0,C.jsxs)(`div`,{className:`font-mono text-[11px] text-ink-faint`,children:[d,` enabled`,p>0&&(0,C.jsxs)(`span`,{className:`ml-2 text-[color:var(--ink-blocked-2)]`,children:[`· `,p,` overdue`]})]})]}),(0,C.jsxs)(m,{to:`/queue`,className:`flex items-center gap-1 font-mono text-[11px] text-ink-muted transition-colors hover:text-ink-cream`,children:[`manage `,(0,C.jsx)(b,{size:10})]})]}),e.isLoading?(0,C.jsx)(`div`,{children:Array.from({length:3},(e,t)=>(0,C.jsx)(_,{},t))}):o.length===0?(0,C.jsx)(`div`,{className:`px-6 pb-6`,children:(0,C.jsx)(g,{note:`No triggers stored yet. Enable one on /queue and it bootstraps on the next watch tick.`,cli:`open http://127.0.0.1:3030/queue`})}):(0,C.jsxs)(`table`,{className:`w-full text-[13px]`,children:[(0,C.jsx)(`thead`,{children:(0,C.jsxs)(`tr`,{className:`text-[10px] uppercase tracking-[0.14em] text-ink-faint`,children:[(0,C.jsx)(`th`,{className:`px-6 py-2 text-left font-medium`,children:`trigger`}),(0,C.jsx)(`th`,{className:`py-2 text-left font-medium`,children:`state`}),(0,C.jsx)(`th`,{className:`py-2 text-left font-medium`,children:`last run`}),(0,C.jsx)(`th`,{className:`py-2 text-right font-medium`,children:`last polled`}),(0,C.jsx)(`th`,{className:`px-6 py-2 text-right font-medium`,children:`next due`})]})}),(0,C.jsxs)(`tbody`,{children:[s.map((e,t)=>(0,C.jsx)(O,{row:e,zebra:t%2==1},e.trigger.name)),c.length>0&&(0,C.jsx)(`tr`,{className:`border-t border-ink-rule/60`,children:(0,C.jsx)(`td`,{colSpan:5,className:`p-0`,children:(0,C.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-expanded":t,"aria-label":`${t?`hide`:`show`} ${c.length} disabled trigger${c.length===1?``:`s`}`,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`,children:[t?(0,C.jsx)(l,{size:11,"aria-hidden":`true`}):(0,C.jsx)(u,{size:11,"aria-hidden":`true`}),c.length,` disabled`]})})}),t&&c.map((e,t)=>(0,C.jsx)(O,{row:e,zebra:t%2==1},e.trigger.name))]})]})]})}function O({row:e,zebra:t}){let{trigger:r,state:a,dueInMs:o}=e;return(0,C.jsxs)(`tr`,{className:i(`border-t border-ink-rule/60 transition-colors duration-[var(--dur-stamp)]`,`hover:bg-ink-surface/50`,t&&`bg-ink-surface/20`),children:[(0,C.jsx)(`td`,{className:`px-6 py-2 font-mono text-[12px]`,children:(0,C.jsx)(`span`,{className:r.enabled?`text-ink-cream`:`text-ink-faint`,children:r.name})}),(0,C.jsx)(`td`,{className:`py-2`,children:(0,C.jsx)(k,{state:a,reason:r.notReadyReason})}),(0,C.jsx)(`td`,{className:`py-2 font-mono text-[11.5px] text-ink-muted`,children:y(r.lastRunSummary)}),(0,C.jsx)(`td`,{className:`py-2 text-right font-mono text-[11.5px] text-ink-faint`,children:r.lastPolledAt?n(r.lastPolledAt):`never`}),(0,C.jsx)(`td`,{className:`px-6 py-2 text-right font-mono text-[11.5px]`,children:(0,C.jsx)(A,{dueInMs:o})})]})}function k({state:e,reason:t}){switch(e){case`running`:return(0,C.jsx)(h,{tone:`signal`,children:`running`});case`enabled`:return(0,C.jsx)(h,{tone:`receipt`,children:`enabled`});case`not-ready`:return(0,C.jsx)(h,{tone:`blocked`,title:t??void 0,children:`not ready`});case`disabled`:return(0,C.jsx)(h,{tone:`neutral`,children:`disabled`})}}function A({dueInMs:e}){return e==null?(0,C.jsx)(`span`,{className:`text-ink-faint`,children:`—`}):e<=0?(0,C.jsxs)(`span`,{className:`text-[color:var(--ink-blocked-2)]`,children:[`overdue `,v(-e)]}):(0,C.jsxs)(`span`,{className:e<30*6e4?`text-ink-cream-2`:`text-ink-faint`,children:[`in `,v(e)]})}function j({receipts:e,queue:t,loading:n,limit:r=10}){let i=N(e,t,r);return(0,C.jsxs)(`section`,{className:`flex flex-col border-b border-ink-rule`,children:[(0,C.jsxs)(`div`,{className:`flex items-baseline justify-between px-6 pb-2 pt-5`,children:[(0,C.jsx)(`div`,{className:`ln-eyebrow`,children:`Signal feed`}),(0,C.jsx)(`div`,{className:`font-mono text-[11px] text-ink-faint`,children:`newest first · refresh · 30s`})]}),n?(0,C.jsx)(`div`,{className:`px-6 pb-5 font-mono text-[11.5px] text-ink-faint`,children:`…`}):i.length===0?(0,C.jsx)(`div`,{className:`px-6 pb-5`,children:(0,C.jsx)(`p`,{className:`ln-note max-w-[56ch] text-[13.5px] text-ink-cream-2`,children:`Nothing on the wire yet. Send a play or run a trigger — events stream in here as they happen.`})}):(0,C.jsx)(`ol`,{className:`flex flex-col`,children:i.map(e=>(0,C.jsx)(M,{event:e},e.id))})]})}function M({event:e}){let t=e.kind===`receipt`?d:p,r=(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{"aria-hidden":`true`,className:i(`inline-flex h-[18px] w-[18px] items-center justify-center`,`rounded-[var(--radius-xs)] border border-ink-rule bg-ink-bg-deep shrink-0`,e.kind===`receipt`?`text-[color:var(--ink-receipt-2)]`:`text-[color:var(--ink-signal-2)]`),children:(0,C.jsx)(t,{size:10})}),(0,C.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[(0,C.jsx)(`span`,{className:`truncate text-ink-cream`,children:e.headline}),(0,C.jsxs)(`span`,{className:`truncate font-mono text-[11.5px] text-ink-faint`,children:[`· `,e.meta]})]}),(0,C.jsx)(`time`,{className:`shrink-0 font-mono text-[11.5px] text-ink-muted`,dateTime:e.at,children:n(e.at)}),e.href&&(0,C.jsx)(b,{size:11,className:`shrink-0 text-ink-faint transition-colors group-hover:text-ink-cream-2`})]}),a=i(`group flex items-center gap-3 border-t border-ink-rule/60 px-6 py-2`,`transition-colors duration-[var(--dur-stamp)]`,e.href&&`hover:bg-ink-surface/60 cursor-pointer`);return e.href?(0,C.jsx)(`li`,{children:(0,C.jsx)(m,{to:e.href,className:i(a,`no-underline`),children:r})}):(0,C.jsx)(`li`,{className:a,children:r})}function N(e,t,n){let r=[];for(let t of e)r.push({id:`r-${t.id}`,kind:`receipt`,at:t.createdAt,headline:`${t.playName} · ${t.callType}`,meta:t.costUsd==null?`no cost on record`:`$${t.costUsd.toFixed(2)}`,href:`/receipts`});for(let e of t){let t=P(e.payload);r.push({id:`q-${e.id}`,kind:`queue`,at:e.foundAt,headline:`${e.playName} · ${t??`(no email)`}`,meta:`from ${e.source}`,href:`/queue`})}return r.sort((e,t)=>new Date(t.at).getTime()-new Date(e.at).getTime()),r.slice(0,n)}function P(e){if(!e||typeof e!=`object`)return null;let t=e,n=t.email??t.founderEmail;return typeof n==`string`?n:null}function F(){let e=f({queryKey:[`home`],queryFn:a.home,refetchInterval:3e4}),t=f({queryKey:[`receipts`,`recent`],queryFn:()=>a.receipts({limit:16}),refetchInterval:15e3}),r=f({queryKey:[`queue`,`recent`,`home`],queryFn:()=>a.queue({limit:16}),refetchInterval:3e4}),s=e.data;return(0,C.jsxs)(`div`,{className:`-mx-6 -my-6 flex flex-col`,children:[(0,C.jsx)(`section`,{className:`border-b border-ink-rule px-6 pb-5 pt-6`,children:(0,C.jsxs)(`div`,{className:`flex items-end justify-between gap-6`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`ln-eyebrow`,children:`The Ledger · Today`}),(0,C.jsx)(`h1`,{className:`mt-1 text-ink-cream`,style:{fontFamily:`var(--font-display)`,fontSize:44,letterSpacing:`-0.025em`,lineHeight:.98,fontWeight:600},children:`Signed, in ink.`})]}),(0,C.jsxs)(`div`,{className:`hidden text-right font-mono text-[11px] text-ink-faint md:block`,children:[new Date().toLocaleDateString(void 0,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`}),(0,C.jsx)(`div`,{className:`mt-0.5`,children:`refresh · 30s`})]})]})}),(0,C.jsx)(E,{}),(0,C.jsxs)(`section`,{className:`grid grid-cols-2 divide-x divide-ink-rule border-b border-ink-rule lg:grid-cols-4`,children:[(0,C.jsx)(I,{label:`Replied · 7d`,value:s?String(s.repliedLast7d):void 0,caption:`reply · the only metric that matters`,tone:`receipt`}),(0,C.jsx)(I,{label:`Sent · 7d`,value:s?String(s.sentLast7d):void 0,caption:`drafts, linted, stamped`}),(0,C.jsx)(I,{label:`Spend · 7d`,value:s?o(s.spendUsd7d):void 0,caption:s?`${s.callsLast7d} OneShot calls`:void 0,tone:`spend`}),(0,C.jsx)(I,{label:`Active cadences`,value:s?String(s.activeCadences):void 0,caption:`in flight, awaiting reply`})]}),(0,C.jsx)(j,{receipts:t.data?.receipts??[],queue:r.data?.rows??[],loading:t.isLoading||r.isLoading,limit:10}),(0,C.jsx)(D,{}),(0,C.jsxs)(`section`,{className:`flex flex-col border-b border-ink-rule`,children:[(0,C.jsxs)(`div`,{className:`flex items-baseline justify-between px-6 pb-2 pt-5`,children:[(0,C.jsx)(`div`,{className:`ln-eyebrow`,children:`Recent receipts`}),(0,C.jsxs)(m,{to:`/receipts`,className:`flex items-center gap-1 font-mono text-[11px] text-ink-muted transition-colors hover:text-ink-cream`,children:[`all `,(0,C.jsx)(b,{size:10})]})]}),t.isLoading?(0,C.jsx)(`div`,{children:Array.from({length:5},(e,t)=>(0,C.jsx)(_,{},t))}):t.data?.receipts.length===0?(0,C.jsx)(`div`,{className:`px-6 pb-6`,children:(0,C.jsx)(g,{note:`No receipts yet. Every call the agent makes leaves one — a short ledger is an honest ledger.`,cli:`oneshot-gtm motion show-hn`})}):(0,C.jsxs)(`table`,{className:`w-full text-[13px]`,children:[(0,C.jsx)(`thead`,{children:(0,C.jsxs)(`tr`,{className:`text-[10px] uppercase tracking-[0.14em] text-ink-faint`,children:[(0,C.jsx)(`th`,{className:`px-6 py-2 text-left font-medium`,children:`id`}),(0,C.jsx)(`th`,{className:`py-2 text-left font-medium`,children:`play`}),(0,C.jsx)(`th`,{className:`py-2 text-left font-medium`,children:`type`}),(0,C.jsx)(`th`,{className:`py-2 text-right font-medium`,children:`cost`}),(0,C.jsx)(`th`,{className:`px-6 py-2 text-right font-medium`,children:`when`})]})}),(0,C.jsx)(`tbody`,{children:t.data?.receipts.map((e,t)=>(0,C.jsxs)(`tr`,{className:i(`border-t border-ink-rule/60 transition-colors duration-[var(--dur-stamp)]`,`hover:bg-ink-surface/50`,t%2==1&&`bg-ink-surface/20`),children:[(0,C.jsxs)(`td`,{className:`px-6 py-2 font-mono text-[11px] text-ink-faint`,children:[`#`,e.id]}),(0,C.jsx)(`td`,{className:`py-2 text-ink-cream`,children:e.playName}),(0,C.jsx)(`td`,{className:`py-2 font-mono text-[12px] text-ink-muted`,children:e.callType}),(0,C.jsx)(`td`,{className:`py-2 text-right font-mono text-ink-cream`,children:e.costUsd==null?(0,C.jsx)(`span`,{className:`text-ink-faint`,children:`—`}):o(e.costUsd)}),(0,C.jsx)(`td`,{className:`px-6 py-2 text-right font-mono text-[12px] text-ink-faint`,children:n(e.createdAt)})]},e.id))})]})]}),(0,C.jsxs)(`section`,{className:`grid grid-cols-1 gap-8 px-6 py-8 lg:grid-cols-[1fr_280px]`,children:[(0,C.jsxs)(`div`,{className:`max-w-[58ch]`,children:[(0,C.jsx)(`div`,{className:`ln-eyebrow`,children:`Editor's note`}),(0,C.jsx)(`p`,{className:`ln-prose mt-2 max-w-[58ch] text-[14.5px] text-ink-cream-2`,children:`Spend is the cost of proof. Every send came with a signed receipt; every receipt keeps you honest with yourself. A short ledger is an honest ledger — one send always beats zero.`})]}),(0,C.jsxs)(`div`,{className:`border-l border-ink-rule pl-6`,children:[(0,C.jsx)(`div`,{className:`ln-eyebrow`,children:`Spend · 30d`}),(0,C.jsx)(`div`,{className:`mt-1 text-ink-cream ln-numeral`,style:{fontSize:36,lineHeight:1},children:s?o(s.spendUsd30d):(0,C.jsx)(`span`,{className:`text-ink-faint`,children:`$—`})}),(0,C.jsx)(`div`,{className:`mt-2 font-mono text-[11px] text-ink-muted`,children:s?`${s.callsLast7d} calls this week`:`…`})]})]})]})}function I({label:e,value:t,caption:n,tone:r=`neutral`}){return(0,C.jsxs)(`div`,{className:`px-5 py-4`,children:[(0,C.jsx)(`div`,{className:`ln-eyebrow`,children:e}),(0,C.jsx)(`div`,{className:`mt-1 truncate text-ink-cream ln-numeral`,style:{fontSize:44,lineHeight:1},children:t??(0,C.jsx)(`span`,{className:`text-ink-faint`,children:`—`})}),n&&(0,C.jsx)(`div`,{className:`mt-2 truncate font-mono text-[11px]`,style:{color:r===`spend`?`var(--ink-spend-2)`:r===`receipt`?`var(--ink-receipt-2)`:`var(--ink-faint)`},children:n})]})}export{F as component};
|
|
2
|
-
//# sourceMappingURL=routes-B9L9tBMF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,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,OACJ,MAAO,wBACP,KAAM,2HACN,IAAK,iBAC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s}from"./refresh-cw-BpMRSA9y.js";import{a as c,t as l,u}from"./index-CzTgATNQ.js";import{t as d}from"./Badge-DE7L41a6.js";import{a as f,n as p,r as m,t as h}from"./Field-B4mT8TGa.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:`yc-w26`},{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:`yc-w23`},{key:`freeForCohortOffer`,label:`Free-for-cohort offer (optional)`,type:`text`,placeholder:`Free for current YC W26 through demo day, just reply with your batch.`}]},"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:`Apollo.io`},{key:`yourEdge`,label:`Your edge (one sentence)`,type:`textarea`,required:!0,hint:`One specific advantage, not a feature list. e.g. 'we don't sell scraped emails'.`},{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:`stripe, twilio, sendgrid`,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 SDK + on-chain receipts replaces vendor stitching'.`},{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))}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-a3eeybKs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run._playName-a3eeybKs.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","err","Error","message","ref","ex","prev","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","trim","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: \"yc-w26\",\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: \"yc-w23\",\n },\n {\n key: \"freeForCohortOffer\",\n label: \"Free-for-cohort offer (optional)\",\n type: \"text\",\n placeholder: \"Free for current YC W26 through demo day, just reply with your batch.\",\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: \"Apollo.io\",\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. 'we don't sell scraped emails'.\",\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: \"stripe, twilio, sendgrid\",\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 SDK + on-chain receipts replaces vendor stitching'.\",\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 } 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'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,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAEKA,CAAW,CCAtD,EAAO,EAAiB,OAAQC,CAHpC,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC1C,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAENA,CAAW,CCG3C,EAAS,EAAiB,UAAW,CANzC,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC1C,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC1C,CAAC,OAAQ,CAAE,EAAG,2CAA4C,IAAK,SAAU,CAAC,CAC1E,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,SAAU,CAAC,CACzC,CAAC,OAAQ,CAAE,EAAG,yCAA0C,IAAK,SAAU,CAAC,CAE/B,CAAW,UCHtD,SAAA,EAAA,EAAA,EAAA,EAAA,eAME,IAAA,IAAA,KAAA,EAAA,EAAA,OAAA,QAAA,EAAA,WAAA,OAAA,GAAA,EAAA,IAAA,EAAA,MAAA,CAKA,GAAA,EAAA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OACE,EAAA,EAAA,MAAC,UAAD,CAAS,UAAU,8CAAnB,EACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,kDAAf,EACE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,sBAAcF,EAAa,CAAA,CACzCC,EACE,GACJC,EACO,GAId,SAASxD,EAAWsC,EAAqD,CACvE,IAAMjG,EAA8B,EAAE,CACtC,IAAK,GAAM,CAACG,EAAGE,KAAMJ,OAAOyG,QAAQT,EAAI,CAClC5F,EAAEoF,MAAM,CAACjF,OAAS,IAAGR,EAAIG,GAAKE,EAAEoF,MAAM,EAE5C,OAAOzF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as e,d as t,l as n,o as r,s as i,t as a}from"./Button-NJ1UVzeB.js";import{f as o,m as ee,n as te,p as s}from"./index-CzTgATNQ.js";import{t as c}from"./Badge-DE7L41a6.js";import{a as l,i as u,n as d,r as f,t as ne}from"./Field-B4mT8TGa.js";var p=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`},_={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 v(){let e=ee(),t=s({queryKey:[`setup`],queryFn:r.setupStatus}),n=s({queryKey:[`doctor`],queryFn:r.doctor}),[i,v]=(0,m.useState)(``),[x,S]=(0,m.useState)(``),[C,w]=(0,m.useState)(``),[T,E]=(0,m.useState)(``),[D,O]=(0,m.useState)(``),[k,A]=(0,m.useState)(``),[j,M]=(0,m.useState)(``),[N,P]=(0,m.useState)(null),[F,I]=(0,m.useState)(null),[L,R]=(0,m.useState)(`openrouter`),[z,B]=(0,m.useState)(``),[V,H]=(0,m.useState)(!0),[U,W]=(0,m.useState)(`cdp`),[G,K]=(0,m.useState)({}),[ie,ae]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(!t.data?.cfg)return;let e=t.data.cfg;v(e.founderName??``),S(e.founderEmail??``),w(e.productOneLiner??``),E(e.productDomain??``),O(e.sendingDomain??``),A(e.icpOneLiner??``),R(e.llmProvider),B(e.llmModel||g[e.llmProvider]||``),H(e.telemetryEnabled),W(e.walletMode)},[t.data?.cfg]);let q=o({mutationFn:e=>r.deriveIcp(e),onSuccess:e=>{A(e.proposedIcp),I({url:e.sourceUrl,cost:e.costUsd}),P(null)},onError:e=>{P(e.message),I(null)}}),[J,Y]=(0,m.useState)(0);(0,m.useEffect)(()=>{if(!q.isPending){Y(0);return}let e=Date.now(),t=setInterval(()=>{Y(Math.floor((Date.now()-e)/1e3))},250);return()=>clearInterval(t)},[q.isPending]);let oe=J<15?`Reading the page · ${J}s`:J<35?`Still reading — slow pages take a moment · ${J}s`:`Asking the LLM to extract an ICP · ${J}s`,X=o({mutationFn:async()=>{let e={};for(let[t,n]of Object.entries(G))n.trim().length>0&&(e[t]=n.trim());await r.setup({founderName:i,founderEmail:x,productOneLiner:C,productDomain:T,sendingDomain:D,icpOneLiner:k,llmProvider:L,llmModel:z,telemetryEnabled:V,walletMode:U,secrets:e})},onSuccess:()=>{K({}),ae(Date.now()),e.invalidateQueries({queryKey:[`setup`]}),e.invalidateQueries({queryKey:[`doctor`]}),e.invalidateQueries({queryKey:[`home`]})}}),Z=t.data?.sources??{},Q=L===`openrouter`?`OPENROUTER_API_KEY`:L===`openai`?`OPENAI_API_KEY`:`ANTHROPIC_API_KEY`,$=(e,t)=>{K(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)(y,{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=>v(e.target.value),placeholder:`Jane Doe`})}),(0,h.jsx)(d,{label:`Reply-to email`,children:(0,h.jsx)(f,{type:`email`,value:x,onChange:e=>S(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. oneshotagent.com. Leave blank for no domain line.`,children:(0,h.jsx)(f,{value:T,onChange:e=>E(e.target.value),placeholder:`oneshotagent.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:D,onChange:e=>O(e.target.value),placeholder:`oneshotagents.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:C,onChange:e=>w(e.target.value),placeholder:`Open-source GTM agent for technical founders, paid per-result.`,rows:2})})]})}),(0,h.jsx)(y,{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:j,onChange:e=>M(e.target.value),placeholder:`acme.com · https://yourcompany.com/customers`,onKeyDown:e=>{e.key===`Enter`&&!q.isPending&&j.trim().length>0&&(e.preventDefault(),q.mutate(j.trim()))}}),(0,h.jsxs)(a,{type:`button`,variant:`secondary`,className:`shrink-0 whitespace-nowrap`,disabled:q.isPending||j.trim().length===0,onClick:()=>q.mutate(j.trim()),children:[(0,h.jsx)(re,{size:12,className:q.isPending?`animate-pulse`:void 0}),q.isPending?`Working · ${J}s`:`Derive ICP`]})]})}),q.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`}),oe]}),N&&(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:N}),F&&!N&&(0,h.jsxs)(`div`,{className:`font-mono text-[11px] text-ink-muted`,children:[`drafted from`,` `,(0,h.jsx)(`a`,{href:F.url,target:`_blank`,rel:`noreferrer`,className:`text-ink-cream-2 underline decoration-ink-faint decoration-1 underline-offset-2 hover:decoration-ink-cream`,children:F.url}),` `,`· spent $`,F.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:k,onChange:e=>A(e.target.value),placeholder:`Developers shipping autonomous AI agents who need deterministic spend tracking and on-chain receipts.`,rows:3})})]})}),(0,h.jsx)(y,{eyebrow:`03 · 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:L,onChange:e=>{let t=e.target.value;R(t),z||B(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:z,onChange:e=>B(e.target.value),placeholder:g[L]})}),(0,h.jsx)(d,{label:_[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:G[Q]??``,onChange:e=>$(Q,e.target.value),autoComplete:`new-password`})})]})}),(0,h.jsx)(y,{eyebrow:`04 · 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:U,onChange:e=>W(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`})]})}),U===`cdp`?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d,{label:`CDP_API_KEY_ID`,hint:b(Z.CDP_API_KEY_ID),children:(0,h.jsx)(f,{type:`password`,placeholder:Z.CDP_API_KEY_ID?`(unchanged)`:``,value:G.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:b(Z.CDP_API_KEY_SECRET),children:(0,h.jsx)(f,{type:`password`,placeholder:Z.CDP_API_KEY_SECRET?`(unchanged)`:``,value:G.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:b(Z.CDP_WALLET_SECRET),className:`md:col-span-2`,children:(0,h.jsx)(f,{type:`password`,placeholder:Z.CDP_WALLET_SECRET?`(unchanged)`:``,value:G.CDP_WALLET_SECRET??``,onChange:e=>$(`CDP_WALLET_SECRET`,e.target.value),autoComplete:`new-password`})})]}):(0,h.jsx)(d,{label:`AGENT_PRIVATE_KEY`,hint:b(Z.AGENT_PRIVATE_KEY),className:`md:col-span-2`,children:(0,h.jsx)(f,{type:`password`,placeholder:Z.AGENT_PRIVATE_KEY?`(unchanged)`:`0x...`,value:G.AGENT_PRIVATE_KEY??``,onChange:e=>$(`AGENT_PRIVATE_KEY`,e.target.value),autoComplete:`new-password`})})]})}),(0,h.jsx)(y,{eyebrow:`05 · Telemetry`,lede:`Off by default for your data, on by default for command-run counts. Opt out at will.`,children:(0,h.jsx)(ne,{label:`Send anonymous opt-out telemetry (commands run, no data, no PII — see TELEMETRY.md)`,checked:V,onChange:e=>H(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&&ie!=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)(p,{size:14}),X.isPending?`Saving…`:`Save changes`]})]})]}),(0,h.jsx)(y,{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 y({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 b(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{v as component};
|
|
2
|
-
//# sourceMappingURL=setup-fs0DMLq4.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-fs0DMLq4.js","names":["__iconNode","useMutation","useQuery","useQueryClient","Save","Wand2","useEffect","useState","toast","api","Badge","Button","Checkbox","Field","Input","Select","Textarea","LLM_DEFAULTS","Record","openrouter","openai","anthropic","SECRET_LABELS","OPENROUTER_API_KEY","OPENAI_API_KEY","ANTHROPIC_API_KEY","CDP_API_KEY_ID","CDP_API_KEY_SECRET","CDP_WALLET_SECRET","AGENT_PRIVATE_KEY","SetupPage","qc","status","queryKey","queryFn","setupStatus","doctor","founderName","setFounderName","founderEmail","setFounderEmail","productOneLiner","setProductOneLiner","productDomain","setProductDomain","sendingDomain","setSendingDomain","icpOneLiner","setIcpOneLiner","icpDomain","setIcpDomain","icpDeriveError","setIcpDeriveError","icpDeriveSource","setIcpDeriveSource","url","cost","llmProvider","setLlmProvider","llmModel","setLlmModel","telemetryEnabled","setTelemetryEnabled","walletMode","setWalletMode","secrets","setSecrets","savedAt","setSavedAt","data","cfg","c","deriveIcp","mutationFn","domain","onSuccess","res","proposedIcp","sourceUrl","costUsd","onError","err","Error","message","deriveElapsed","setDeriveElapsed","isPending","started","Date","now","t","setInterval","Math","floor","clearInterval","derivePhase","save","filteredSecrets","k","v","Object","entries","trim","length","setup","invalidateQueries","sources","llmSecretKey","setSecret","key","value","s","isError","error","fontFamily","fontSize","fontWeight","letterSpacing","lineHeight","e","preventDefault","mutate","target","undefined","toFixed","hintFor","checked","isSuccess","checks","map","name","severity","hint","LedgerSection","eyebrow","lede","children","ReactNode","source","component"],"sources":["../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/save.mjs","../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/wand-sparkles.mjs","../../src/routes/setup.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 [\n \"path\",\n {\n 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\",\n key: \"1c8476\"\n }\n ],\n [\"path\", { d: \"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7\", key: \"1ydtos\" }],\n [\"path\", { d: \"M7 3v4a1 1 0 0 0 1 1h7\", key: \"t51u73\" }]\n];\nconst Save = createLucideIcon(\"save\", __iconNode);\n\nexport { __iconNode, Save as default };\n//# sourceMappingURL=save.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 [\n \"path\",\n {\n 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\",\n key: \"ul74o6\"\n }\n ],\n [\"path\", { d: \"m14 7 3 3\", key: \"1r5n42\" }],\n [\"path\", { d: \"M5 6v4\", key: \"ilb8ba\" }],\n [\"path\", { d: \"M19 14v4\", key: \"blhpug\" }],\n [\"path\", { d: \"M10 2v2\", key: \"7u0qdc\" }],\n [\"path\", { d: \"M7 8H3\", key: \"zfb6yr\" }],\n [\"path\", { d: \"M21 16h-4\", key: \"1cnmox\" }],\n [\"path\", { d: \"M11 3H9\", key: \"1obp7u\" }]\n];\nconst WandSparkles = createLucideIcon(\"wand-sparkles\", __iconNode);\n\nexport { __iconNode, WandSparkles as default };\n//# sourceMappingURL=wand-sparkles.mjs.map\n","import { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { Save, Wand2 } from \"lucide-react\";\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport { toast } from \"sonner\";\nimport { api } from \"../api/client.ts\";\nimport { Badge } from \"../components/primitives/Badge.tsx\";\nimport { Button } from \"../components/primitives/Button.tsx\";\nimport { Checkbox, Field, Input, Select, Textarea } from \"../components/primitives/Field.tsx\";\n\nexport const Route = createFileRoute(\"/setup\")({\n component: SetupPage,\n});\n\nconst LLM_DEFAULTS: Record<string, string> = {\n openrouter: \"anthropic/claude-sonnet-4.6\",\n openai: \"gpt-4o-mini\",\n anthropic: \"claude-sonnet-4-6\",\n};\n\nconst SECRET_LABELS: Record<string, string> = {\n OPENROUTER_API_KEY: \"OpenRouter API key\",\n OPENAI_API_KEY: \"OpenAI API key\",\n ANTHROPIC_API_KEY: \"Anthropic API key\",\n CDP_API_KEY_ID: \"CDP_API_KEY_ID\",\n CDP_API_KEY_SECRET: \"CDP_API_KEY_SECRET\",\n CDP_WALLET_SECRET: \"CDP_WALLET_SECRET\",\n AGENT_PRIVATE_KEY: \"AGENT_PRIVATE_KEY\",\n};\n\nfunction SetupPage() {\n const qc = useQueryClient();\n const status = useQuery({ queryKey: [\"setup\"], queryFn: api.setupStatus });\n const doctor = useQuery({ queryKey: [\"doctor\"], queryFn: api.doctor });\n\n const [founderName, setFounderName] = useState(\"\");\n const [founderEmail, setFounderEmail] = useState(\"\");\n const [productOneLiner, setProductOneLiner] = useState(\"\");\n const [productDomain, setProductDomain] = useState(\"\");\n const [sendingDomain, setSendingDomain] = useState(\"\");\n const [icpOneLiner, setIcpOneLiner] = useState(\"\");\n const [icpDomain, setIcpDomain] = useState(\"\");\n const [icpDeriveError, setIcpDeriveError] = useState<string | null>(null);\n const [icpDeriveSource, setIcpDeriveSource] = useState<{ url: string; cost: number } | null>(\n null,\n );\n const [llmProvider, setLlmProvider] = useState<\"openrouter\" | \"openai\" | \"anthropic\">(\n \"openrouter\",\n );\n const [llmModel, setLlmModel] = useState(\"\");\n const [telemetryEnabled, setTelemetryEnabled] = useState(true);\n const [walletMode, setWalletMode] = useState<\"cdp\" | \"private-key\">(\"cdp\");\n const [secrets, setSecrets] = useState<Record<string, string>>({});\n const [savedAt, setSavedAt] = useState<number | null>(null);\n\n useEffect(() => {\n if (!status.data?.cfg) return;\n const c = status.data.cfg;\n setFounderName(c.founderName ?? \"\");\n setFounderEmail(c.founderEmail ?? \"\");\n setProductOneLiner(c.productOneLiner ?? \"\");\n setProductDomain(c.productDomain ?? \"\");\n setSendingDomain(c.sendingDomain ?? \"\");\n setIcpOneLiner(c.icpOneLiner ?? \"\");\n setLlmProvider(c.llmProvider);\n setLlmModel(c.llmModel || LLM_DEFAULTS[c.llmProvider] || \"\");\n setTelemetryEnabled(c.telemetryEnabled);\n setWalletMode(c.walletMode);\n }, [status.data?.cfg]);\n\n const deriveIcp = useMutation({\n mutationFn: (domain: string) => api.deriveIcp(domain),\n onSuccess: (res) => {\n setIcpOneLiner(res.proposedIcp);\n setIcpDeriveSource({ url: res.sourceUrl, cost: res.costUsd });\n setIcpDeriveError(null);\n },\n onError: (err: Error) => {\n setIcpDeriveError(err.message);\n setIcpDeriveSource(null);\n },\n });\n\n // Elapsed counter so the ~30–60s derive feels alive instead of frozen.\n // Server doesn't stream progress; we cycle a phase label by elapsed time.\n const [deriveElapsed, setDeriveElapsed] = useState(0);\n useEffect(() => {\n if (!deriveIcp.isPending) {\n setDeriveElapsed(0);\n return;\n }\n const started = Date.now();\n const t = setInterval(() => {\n setDeriveElapsed(Math.floor((Date.now() - started) / 1000));\n }, 250);\n return () => clearInterval(t);\n }, [deriveIcp.isPending]);\n const derivePhase =\n deriveElapsed < 15\n ? `Reading the page · ${deriveElapsed}s`\n : deriveElapsed < 35\n ? `Still reading — slow pages take a moment · ${deriveElapsed}s`\n : `Asking the LLM to extract an ICP · ${deriveElapsed}s`;\n\n const save = useMutation({\n mutationFn: async () => {\n const filteredSecrets: Record<string, string> = {};\n for (const [k, v] of Object.entries(secrets)) {\n if (v.trim().length > 0) filteredSecrets[k] = v.trim();\n }\n await api.setup({\n founderName,\n founderEmail,\n productOneLiner,\n productDomain,\n sendingDomain,\n icpOneLiner,\n llmProvider,\n llmModel,\n telemetryEnabled,\n walletMode,\n secrets: filteredSecrets as never,\n });\n },\n onSuccess: () => {\n setSecrets({});\n setSavedAt(Date.now());\n void qc.invalidateQueries({ queryKey: [\"setup\"] });\n void qc.invalidateQueries({ queryKey: [\"doctor\"] });\n void qc.invalidateQueries({ queryKey: [\"home\"] });\n },\n });\n\n const sources = status.data?.sources ?? {};\n const llmSecretKey =\n llmProvider === \"openrouter\"\n ? \"OPENROUTER_API_KEY\"\n : llmProvider === \"openai\"\n ? \"OPENAI_API_KEY\"\n : \"ANTHROPIC_API_KEY\";\n\n const setSecret = (key: string, value: string): void => {\n setSecrets((s) => ({ ...s, [key]: value }));\n };\n\n useEffect(() => {\n if (save.isError) toast.error(`couldn't save · ${save.error.message}`);\n }, [save.isError, save.error]);\n\n return (\n <div className=\"-mx-6 -my-6 flex flex-col\">\n {/* Masthead */}\n <section className=\"flex items-end justify-between gap-4 border-b border-ink-rule px-6 pb-5 pt-6\">\n <div>\n <div className=\"ln-eyebrow\">The Ledger · Setup</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 Profile, provider, wallet.\n </h1>\n </div>\n <span className=\"text-[11px] text-ink-faint ln-mono\">\n saved to <span className=\"text-ink-muted\">~/.oneshot-gtm/config.json</span> ·{\" \"}\n <span className=\"text-ink-muted\">.env</span> · chmod 600\n </span>\n </section>\n\n <form\n onSubmit={(e) => {\n e.preventDefault();\n save.mutate();\n }}\n className=\"flex flex-col\"\n >\n <LedgerSection\n eyebrow=\"01 · Founder profile\"\n lede=\"How prospects see you on the other side of the inbox.\"\n >\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n <Field label=\"Name\">\n <Input\n value={founderName}\n onChange={(e) => setFounderName(e.target.value)}\n placeholder=\"Jane Doe\"\n />\n </Field>\n <Field label=\"Reply-to email\">\n <Input\n type=\"email\"\n value={founderEmail}\n onChange={(e) => setFounderEmail(e.target.value)}\n placeholder=\"jane@yourcompany.com\"\n />\n </Field>\n <Field\n label=\"Signature domain\"\n hint=\"Bare domain shown under your name in every email signature, e.g. oneshotagent.com. Leave blank for no domain line.\"\n >\n <Input\n value={productDomain}\n onChange={(e) => setProductDomain(e.target.value)}\n placeholder=\"oneshotagent.com\"\n />\n </Field>\n <Field\n label=\"Sending domain\"\n 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.\"\n >\n <Input\n value={sendingDomain}\n onChange={(e) => setSendingDomain(e.target.value)}\n placeholder=\"oneshotagents.com\"\n />\n </Field>\n <Field\n label=\"Product one-liner\"\n hint=\"What you're building, in one sentence.\"\n className=\"md:col-span-2\"\n >\n <Textarea\n value={productOneLiner}\n onChange={(e) => setProductOneLiner(e.target.value)}\n placeholder=\"Open-source GTM agent for technical founders, paid per-result.\"\n rows={2}\n />\n </Field>\n </div>\n </LedgerSection>\n\n <LedgerSection\n eyebrow=\"02 · Ideal customer profile\"\n lede=\"A free-text classifier. The find layer uses this to drop candidates that don't match.\"\n >\n <div className=\"flex flex-col gap-4\">\n <Field\n label=\"Derive from a website\"\n 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).\"\n >\n <div className=\"flex gap-2\">\n <Input\n value={icpDomain}\n onChange={(e) => setIcpDomain(e.target.value)}\n placeholder=\"acme.com · https://yourcompany.com/customers\"\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && !deriveIcp.isPending && icpDomain.trim().length > 0) {\n e.preventDefault();\n deriveIcp.mutate(icpDomain.trim());\n }\n }}\n />\n <Button\n type=\"button\"\n variant=\"secondary\"\n className=\"shrink-0 whitespace-nowrap\"\n disabled={deriveIcp.isPending || icpDomain.trim().length === 0}\n onClick={() => deriveIcp.mutate(icpDomain.trim())}\n >\n <Wand2 size={12} className={deriveIcp.isPending ? \"animate-pulse\" : undefined} />\n {deriveIcp.isPending ? `Working · ${deriveElapsed}s` : \"Derive ICP\"}\n </Button>\n </div>\n </Field>\n\n {deriveIcp.isPending && (\n <div className=\"flex items-center gap-2 font-mono text-[11px] text-ink-muted\">\n <span className=\"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-ink-cream-2\" />\n {derivePhase}\n </div>\n )}\n\n {icpDeriveError && (\n <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)]\">\n {icpDeriveError}\n </div>\n )}\n {icpDeriveSource && !icpDeriveError && (\n <div className=\"font-mono text-[11px] text-ink-muted\">\n drafted from{\" \"}\n <a\n href={icpDeriveSource.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"text-ink-cream-2 underline decoration-ink-faint decoration-1 underline-offset-2 hover:decoration-ink-cream\"\n >\n {icpDeriveSource.url}\n </a>{\" \"}\n · spent ${icpDeriveSource.cost.toFixed(3)} · edit below before saving.\n </div>\n )}\n\n <Field\n label=\"ICP one-liner\"\n hint=\"Leave blank to disable filtering (every candidate passes through).\"\n >\n <Textarea\n value={icpOneLiner}\n onChange={(e) => setIcpOneLiner(e.target.value)}\n placeholder=\"Developers shipping autonomous AI agents who need deterministic spend tracking and on-chain receipts.\"\n rows={3}\n />\n </Field>\n </div>\n </LedgerSection>\n\n <LedgerSection\n eyebrow=\"03 · LLM provider\"\n lede=\"Bring your own key. Swap providers freely; nothing is locked in.\"\n >\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n <Field label=\"Provider\">\n <Select\n value={llmProvider}\n onChange={(e) => {\n const v = e.target.value as typeof llmProvider;\n setLlmProvider(v);\n if (!llmModel) setLlmModel(LLM_DEFAULTS[v] ?? \"\");\n }}\n >\n <option value=\"openrouter\">OpenRouter (recommended)</option>\n <option value=\"openai\">OpenAI</option>\n <option value=\"anthropic\">Anthropic</option>\n </Select>\n </Field>\n <Field label=\"Model\">\n <Input\n value={llmModel}\n onChange={(e) => setLlmModel(e.target.value)}\n placeholder={LLM_DEFAULTS[llmProvider]}\n />\n </Field>\n <Field\n label={SECRET_LABELS[llmSecretKey] ?? llmSecretKey}\n hint={\n sources[llmSecretKey] === \"env\"\n ? \"Currently from shell env. Leaving blank keeps the env value.\"\n : sources[llmSecretKey] === \"file\"\n ? \"Currently from ~/.oneshot-gtm/.env. Leave blank to keep.\"\n : \"Not set. Paste it here to save (chmod 600).\"\n }\n className=\"md:col-span-2\"\n >\n <Input\n type=\"password\"\n placeholder={sources[llmSecretKey] ? \"(unchanged)\" : \"sk-...\"}\n value={secrets[llmSecretKey] ?? \"\"}\n onChange={(e) => setSecret(llmSecretKey, e.target.value)}\n autoComplete=\"new-password\"\n />\n </Field>\n </div>\n </LedgerSection>\n\n <LedgerSection\n eyebrow=\"04 · OneShot wallet\"\n lede=\"Keys live only in ~/.oneshot-gtm/.env chmod 600. Nothing leaves your machine.\"\n >\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n <Field label=\"Wallet mode\" className=\"md:col-span-2\">\n <Select\n value={walletMode}\n onChange={(e) => setWalletMode(e.target.value as typeof walletMode)}\n >\n <option value=\"cdp\">Coinbase CDP server wallet</option>\n <option value=\"private-key\">Raw private key</option>\n </Select>\n </Field>\n {walletMode === \"cdp\" ? (\n <>\n <Field label=\"CDP_API_KEY_ID\" hint={hintFor(sources[\"CDP_API_KEY_ID\"])}>\n <Input\n type=\"password\"\n placeholder={sources[\"CDP_API_KEY_ID\"] ? \"(unchanged)\" : \"\"}\n value={secrets[\"CDP_API_KEY_ID\"] ?? \"\"}\n onChange={(e) => setSecret(\"CDP_API_KEY_ID\", e.target.value)}\n autoComplete=\"new-password\"\n />\n </Field>\n <Field label=\"CDP_API_KEY_SECRET\" hint={hintFor(sources[\"CDP_API_KEY_SECRET\"])}>\n <Input\n type=\"password\"\n placeholder={sources[\"CDP_API_KEY_SECRET\"] ? \"(unchanged)\" : \"\"}\n value={secrets[\"CDP_API_KEY_SECRET\"] ?? \"\"}\n onChange={(e) => setSecret(\"CDP_API_KEY_SECRET\", e.target.value)}\n autoComplete=\"new-password\"\n />\n </Field>\n <Field\n label=\"CDP_WALLET_SECRET\"\n hint={hintFor(sources[\"CDP_WALLET_SECRET\"])}\n className=\"md:col-span-2\"\n >\n <Input\n type=\"password\"\n placeholder={sources[\"CDP_WALLET_SECRET\"] ? \"(unchanged)\" : \"\"}\n value={secrets[\"CDP_WALLET_SECRET\"] ?? \"\"}\n onChange={(e) => setSecret(\"CDP_WALLET_SECRET\", e.target.value)}\n autoComplete=\"new-password\"\n />\n </Field>\n </>\n ) : (\n <Field\n label=\"AGENT_PRIVATE_KEY\"\n hint={hintFor(sources[\"AGENT_PRIVATE_KEY\"])}\n className=\"md:col-span-2\"\n >\n <Input\n type=\"password\"\n placeholder={sources[\"AGENT_PRIVATE_KEY\"] ? \"(unchanged)\" : \"0x...\"}\n value={secrets[\"AGENT_PRIVATE_KEY\"] ?? \"\"}\n onChange={(e) => setSecret(\"AGENT_PRIVATE_KEY\", e.target.value)}\n autoComplete=\"new-password\"\n />\n </Field>\n )}\n </div>\n </LedgerSection>\n\n <LedgerSection\n eyebrow=\"05 · Telemetry\"\n lede=\"Off by default for your data, on by default for command-run counts. Opt out at will.\"\n >\n <Checkbox\n label=\"Send anonymous opt-out telemetry (commands run, no data, no PII — see TELEMETRY.md)\"\n checked={telemetryEnabled}\n onChange={(e) => setTelemetryEnabled(e.target.checked)}\n />\n </LedgerSection>\n\n <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]\">\n <div className=\"font-mono text-[11px] text-ink-muted\">\n {save.isSuccess && savedAt != null ? (\n <span className=\"text-[color:var(--ink-receipt-2)]\">\n · saved to <span className=\"text-ink-cream-2\">.env</span>\n </span>\n ) : (\n <span className=\"text-ink-faint\">changes apply on save</span>\n )}\n </div>\n <Button type=\"submit\" disabled={save.isPending}>\n <Save size={14} />\n {save.isPending ? \"Saving…\" : \"Save changes\"}\n </Button>\n </div>\n </form>\n\n <LedgerSection\n eyebrow=\"— · Doctor\"\n lede=\"Health of the local install. Run `oneshot-gtm doctor` for the CLI view.\"\n >\n <div className=\"flex flex-col gap-1.5\">\n {doctor.data?.checks.map((c) => (\n <div key={c.name} className=\"flex items-center gap-2 text-[13px]\">\n {c.severity === \"ok\" && <Badge tone=\"receipt\">ok</Badge>}\n {c.severity === \"warn\" && <Badge tone=\"spend\">warn</Badge>}\n {c.severity === \"fail\" && <Badge tone=\"blocked\">fail</Badge>}\n <span className=\"text-ink-muted\">{c.name}</span>\n <span className=\"text-ink-cream\">{c.message}</span>\n {c.hint && <span className=\"ln-note text-ink-muted\">→ {c.hint}</span>}\n </div>\n ))}\n </div>\n </LedgerSection>\n </div>\n );\n}\n\nfunction LedgerSection({\n eyebrow,\n lede,\n children,\n}: {\n eyebrow: string;\n lede?: string;\n children: ReactNode;\n}) {\n return (\n <section className=\"grid grid-cols-1 gap-6 border-b border-ink-rule px-6 py-6 lg:grid-cols-[220px_1fr]\">\n <div>\n <div className=\"ln-eyebrow\">{eyebrow}</div>\n {lede && <p className=\"ln-note mt-2 max-w-[32ch] text-[13px] text-ink-cream-2\">{lede}</p>}\n </div>\n <div>{children}</div>\n </section>\n );\n}\n\nfunction hintFor(source: \"env\" | \"file\" | null | undefined): string {\n if (source === \"env\") return \"Currently from shell env. Leave blank to keep.\";\n if (source === \"file\") return \"Currently from ~/.oneshot-gtm/.env. Leave blank to keep.\";\n return \"Not set yet.\";\n}\n"],"x_google_ignoreList":[0,1],"mappings":"wPAoBA,IAAM,EAAO,EAAiB,OAAQA,CAVpC,CACE,OACA,CACE,EAAG,qGACH,IAAK,SACN,CACF,CACD,CAAC,OAAQ,CAAE,EAAG,4CAA6C,IAAK,SAAU,CAAC,CAC3E,CAAC,OAAQ,CAAE,EAAG,yBAA0B,IAAK,SAAU,CAAC,CAEpBA,CAAW,CCK3C,GAAe,EAAiB,gBAAiB,CAfrD,CACE,OACA,CACE,EAAG,gJACH,IAAK,SACN,CACF,CACD,CAAC,OAAQ,CAAE,EAAG,YAAa,IAAK,SAAU,CAAC,CAC3C,CAAC,OAAQ,CAAE,EAAG,SAAU,IAAK,SAAU,CAAC,CACxC,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC1C,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,SAAU,CAAC,CACzC,CAAC,OAAQ,CAAE,EAAG,SAAU,IAAK,SAAU,CAAC,CACxC,CAAC,OAAQ,CAAE,EAAG,YAAa,IAAK,SAAU,CAAC,CAC3C,CAAC,OAAQ,CAAE,EAAG,UAA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BAAcF,EAAa,CAAA,CACzCC,IAAQ,EAAA,EAAA,KAAC,IAAD,CAAG,UAAU,kEAA0DA,EAAS,CAAA,CACtF,CAAA,CAAA,EACL,EAAA,EAAA,KAAC,MAAD,CAAMC,WAAc,CAAA,CACZ,GAId,SAASX,EAAQa,EAAmD,CAGlE,OAFIA,IAAW,MAAc,iDACzBA,IAAW,OAAe,2DACvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"summarizeRun-BsPt7szF.js","names":[],"sources":["../../src/lib/humanInterval.ts","../../src/lib/summarizeRun.ts"],"sourcesContent":["/**\n * Format a millisecond duration in interval-sized units — minutes/hours/\n * days rather than seconds/minutes. Use for trigger intervals, \"next due\n * in N\", \"overdue N\" — anything where the number is naturally on the\n * order of hours or days.\n *\n * For sub-minute spinner countups use `humanDuration` in `triggerRunState.ts`.\n *\n * 45_000 → \"45s\"\n * 90_000 → \"2m\"\n * 5_400_000 → \"1.5h\"\n * 86_400_000 → \"1d\"\n * 86_400_000 * 7 → \"7d\"\n */\nexport function humanInterval(ms: number): string {\n if (ms < 60_000) return `${Math.round(ms / 1000)}s`;\n if (ms < 3600_000) return `${Math.round(ms / 60_000)}m`;\n const hours = ms / 3600_000;\n if (hours >= 48) return `${(hours / 24).toFixed(hours % 24 === 0 ? 0 : 1)}d`;\n return `${hours.toFixed(hours % 1 === 0 ? 0 : 1)}h`;\n}\n","/**\n * Compact one-liner for a trigger's most-recent run summary. Reads the\n * `FinderResult`-shaped JSON the server persists in `triggers.last_run_summary`\n * (or `{error: string}` on a thrown run).\n *\n * Returns \"—\" when nothing's been run yet. Precedence:\n * 1. `error: <msg>` — thrown / 500\n * 2. `halted · <reason>` — finder returned `halted: \"...\"`\n * 3. counter breakdown: `cand=N · kept=M · icp=K · low=L · $X.YY`\n * 4. `—` when summary exists but has no usable fields\n *\n * Used by:\n * - `/queue` Triggers table (run column)\n * - `/home` SchedulerStrip (last run column)\n */\nexport function summarizeRun(summary: unknown): string {\n if (!summary || typeof summary !== \"object\") return \"—\";\n const s = summary as Record<string, unknown>;\n if (typeof s[\"error\"] === \"string\") return `error: ${(s[\"error\"] as string).slice(0, 60)}`;\n if (typeof s[\"halted\"] === \"string\" && s[\"halted\"]) {\n return `halted · ${(s[\"halted\"] as string).slice(0, 80)}`;\n }\n const parts: string[] = [];\n if (typeof s[\"candidates\"] === \"number\") parts.push(`cand=${s[\"candidates\"]}`);\n if (typeof s[\"enqueued\"] === \"number\") parts.push(`kept=${s[\"enqueued\"]}`);\n if (typeof s[\"droppedIcp\"] === \"number\") parts.push(`icp=${s[\"droppedIcp\"]}`);\n if (typeof s[\"droppedLowSignal\"] === \"number\" && (s[\"droppedLowSignal\"] as number) > 0) {\n parts.push(`low=${s[\"droppedLowSignal\"]}`);\n }\n if (typeof s[\"costUsd\"] === \"number\") {\n parts.push(`$${(s[\"costUsd\"] as number).toFixed(2)}`);\n }\n // Per-cohort breakdown for the accelerator-batch sweep (set only by that\n // finder). Renders cohorts with hits first, then a tail count of zeros so\n // the operator's eye lands on signal first. Truncated to keep\n // SchedulerStrip's one-line layout intact.\n const perCohort = s[\"perCohort\"];\n if (Array.isArray(perCohort) && perCohort.length > 0) {\n const cohortLine = formatPerCohort(perCohort as unknown[]);\n if (cohortLine.length > 0) parts.push(cohortLine);\n }\n return parts.length > 0 ? parts.join(\" · \") : \"—\";\n}\n\n/**\n * Format the per-cohort sweep breakdown for SchedulerStrip. Cohorts with\n * non-zero records come first (sorted by record count desc), zero-result\n * cohorts collapse into a trailing summary like `+3 empty (spc-2026-1, …)`\n * so the one-line layout doesn't blow out when the sweep is wide.\n */\nfunction formatPerCohort(perCohort: unknown[]): string {\n type Row = { cohort: string; records: number; error: string | null };\n const rows: Row[] = [];\n for (const entry of perCohort) {\n if (!entry || typeof entry !== \"object\") continue;\n const e = entry as Record<string, unknown>;\n const cohort = typeof e[\"cohort\"] === \"string\" ? e[\"cohort\"] : null;\n if (!cohort) continue;\n const records = typeof e[\"records\"] === \"number\" ? e[\"records\"] : 0;\n const error =\n typeof e[\"error\"] === \"string\" && (e[\"error\"] as string).length > 0\n ? (e[\"error\"] as string).slice(0, 30)\n : null;\n rows.push({ cohort, records, error });\n }\n if (rows.length === 0) return \"\";\n const hits = rows.filter((r) => r.records > 0).toSorted((a, b) => b.records - a.records);\n const zeros = rows.filter((r) => r.records === 0);\n const segs: string[] = [];\n for (const r of hits) segs.push(`${r.cohort}: ${r.records}`);\n if (zeros.length > 0) {\n const tags = zeros\n .slice(0, 3)\n .map((r) => r.cohort)\n .join(\", \");\n const overflow = zeros.length > 3 ? `, …` : \"\";\n segs.push(`+${zeros.length} empty (${tags}${overflow})`);\n }\n const joined = segs.join(\", \");\n return joined.length > 200 ? `${joined.slice(0, 197)}…` : joined;\n}\n"],"mappings":"AAcA,SAAgB,EAAc,EAAoB,CAChD,GAAI,EAAK,IAAQ,MAAO,GAAG,KAAK,MAAM,EAAK,IAAK,CAAC,GACjD,GAAI,EAAK,KAAU,MAAO,GAAG,KAAK,MAAM,EAAK,IAAO,CAAC,GACrD,IAAM,EAAQ,EAAK,KAEnB,OADI,GAAS,GAAW,IAAI,EAAQ,IAAI,QAAQ,EAAQ,IAAO,EAAI,EAAI,EAAE,CAAC,GACnE,GAAG,EAAM,QAAQ,EAAQ,GAAM,EAAI,EAAI,EAAE,CAAC,GCJnD,SAAgB,EAAa,EAA0B,CACrD,GAAI,CAAC,GAAW,OAAO,GAAY,SAAU,MAAO,IACpD,IAAM,EAAI,EACV,GAAI,OAAO,EAAE,OAAa,SAAU,MAAO,UAAW,EAAE,MAAoB,MAAM,EAAG,GAAG,GACxF,GAAI,OAAO,EAAE,QAAc,UAAY,EAAE,OACvC,MAAO,YAAa,EAAE,OAAqB,MAAM,EAAG,GAAG,GAEzD,IAAM,EAAkB,EAAE,CACtB,OAAO,EAAE,YAAkB,UAAU,EAAM,KAAK,QAAQ,EAAE,aAAgB,CAC1E,OAAO,EAAE,UAAgB,UAAU,EAAM,KAAK,QAAQ,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