PageSourceSearch

https://promoter-ai-rouge.vercel.app/_next/static/chunks/app/agent…?dpl=dpl_7D6UqrY1RbyMhFqMS2trqUQim537

js promoter-ai-rouge.vercel.app collected 2026-10-03 07:33:01 UTC 18,770 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9652],{458:(e,t,o)=>{"use strict";o.d(t,{D:()=>r,X:()=>a});let n=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=new URLSearchParams(e).getAll("workspace_id");if(!t.length)return null;if(1!==t.length||!n.test(t[0]))throw Error("invalid_workspace_selection");return t[0].toLowerCase()}function a(e,t){if("string"!=typeof e||!e.startsWith("/")||e.startsWith("//")||/[\\\u0000-\u001f]/.test(e))throw Error("invalid_workspace_path");let o=new URL(e,"https://workspace.invalid");if("https://workspace.invalid"!==o.origin)throw Error("invalid_workspace_path");if(null!=t){if(!n.test(t))throw Error("invalid_workspace_selection");o.searchParams.set("workspace_id",t.toLowerCase())}return"".concat(o.pathname).concat(o.search).concat(o.hash)}},473:(e,t,o)=>{Promise.resolve().then(o.bind(o,9630))},909:(e,t,o)=>{"use strict";o.d(t,{b:()=>a});var n=o(65);let r=null;function a(){return r||(r=(0,n.UU)("https://nfgqtsjlvegifvfmofpq.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im5mZ3F0c2psdmVnaWZ2Zm1vZnBxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzk2MTMyMjUsImV4cCI6MjA5NTE4OTIyNX0.p4kHt_gDBW_xMd26bQJUeneIrm9QkMYthnPkIIp13fg")),r}},5694:(e,t,o)=>{"use strict";var n=o(7410);o.o(n,"usePathname")&&o.d(t,{usePathname:function(){return n.usePathname}}),o.o(n,"useRouter")&&o.d(t,{useRouter:function(){return n.useRouter}}),o.o(n,"useSearchParams")&&o.d(t,{useSearchParams:function(){return n.useSearchParams}})},6282:(e,t,o)=>{"use strict";o.d(t,{G8:()=>h,Hv:()=>p,Un:()=>b,ZF:()=>m,d1:()=>w,f3:()=>f,oX:()=>g});var n=o(9693),r=o(1177),a=o(909),i=o(5694),s=o(458);let l=(0,r.createContext)(null),c=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;class d extends Error{constructor(e={},t=500){super(e.detail||e.title||e.error||"The request could not be completed."),this.name="ApiProblem",this.status=Number(e.status)||t,this.code=e.code||e.error||"request_failed",this.errors=Array.isArray(e.errors)?e.errors:[],this.blockers=Array.isArray(e.blockers)?e.blockers:[],this.extensions=e&&"object"==typeof e?{...e}:{}}}async function u(e){let t=(e.headers.get("content-type")||"").includes("json")?await e.json().catch(()=>({})):{detail:await e.text().catch(()=>"")};if(!e.ok)throw new d(t,e.status);return t}function h(e){return Array.isArray(e)?e:Array.isArray(null==e?void 0:e.data)?e.data:Array.isArray(null==e?void 0:e.items)?e.items:[]}function p(e){return e&&Object.prototype.hasOwnProperty.call(e,"data")&&!Array.isArray(e.data)?e.data:e}function m(e){let{children:t}=e,o=function(){var e;let t=(0,i.usePathname)(),[o,n]=(0,r.useState)(void 0),[l,h]=(0,r.useState)({userId:null,state:"waiting",id:null,directory:null,problem:null}),m=(0,r.useRef)(l),w=(0,r.useCallback)(e=>{m.current=e,h(e)},[]);(0,r.useEffect)(()=>{let e=!0,t=!1,o=(0,a.b)();o.auth.getSession().then(o=>{let{data:r}=o;e&&!t&&n(r.session||null)});let{data:r}=o.auth.onAuthStateChange((o,r)=>{e&&(t=!0,n(r||null))});return()=>{var t;e=!1,null==r||null==(t=r.subscription)||t.unsubscribe()}},[]);let f=(null==o||null==(e=o.user)?void 0:e.id)||null,b=(null==o?void 0:o.access_token)||null;(0,r.useEffect)(()=>{let e;if(void 0===o)return;if(!f||!b)return void w({userId:null,state:"waiting",id:null,directory:null,problem:null});if(m.current.userId===f&&m.current.id)return;let t=!0,n=new AbortController;w({userId:f,state:"loading",id:null,directory:null,problem:null});let r=new Headers({Authorization:"Bearer ".concat(b),Accept:"application/json"});try{e=(0,s.D)(window.location.search)}catch(e){w({userId:f,state:"error",id:null,directory:null,problem:new d({status:400,code:"invalid_workspace_selection",detail:"This link does not identify one valid workspace."},400)});return}return e&&r.set("X-Promoter-Workspace-Id",e),fetch("/api/v1/workspaces",{method:"GET",headers:r,cache:"no-store",signal:n.signal}).then(u).then(o=>{if(!t)return;let n=p(o)||{},r=String(n.active_workspace_id||"").trim().toLowerCase();if(!c.test(r)||e&&r!==e)throw new d({status:409,code:"workspace_context_unavailable",detail:"The active workspace could not be bound to this tab."},409);w({userId:f,state:"ready",id:r,directory:n,problem:null})}).catch(e=>{t&&(null==e?void 0:e.name)!=="AbortError"&&w({userId:f,state:"error",id:null,directory:null,problem:e instanceof d?e:ne
1w d({status:409,code:"workspace_context_unavailable",detail:"The active workspace could not be bound to this tab."},409)})}),()=>{t=!1,n.abort()}},[o,f,b,w]),(0,r.useEffect)(()=>{let e;if("ready"===l.state&&l.userId===f){try{e=(0,s.D)(window.location.search)}catch(e){window.location.reload();return}if(e&&e!==l.id)return void window.location.reload();e||window.history.replaceState(window.history.state,"",(0,s.X)("".concat(window.location.pathname).concat(window.location.search).concat(window.location.hash),l.id))}},[t,l,f]);let g=(0,r.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(null==o?void 0:o.access_token))throw new d({status:401,code:"unauthorized",detail:"Sign in to continue."},401);let n=String(t.method||"GET").toUpperCase(),r=String(e||"").split("?",1)[0],a=l.userId===f&&"ready"===l.state?l.id:null;if(!a&&("GET"!==n||"/api/v1/workspaces"!==r))throw l.problem||new d({status:409,code:"workspace_context_unavailable",detail:"The active workspace could not be bound to this tab."},409);let i=new Headers(t.headers||{});return i.set("Authorization","Bearer ".concat(o.access_token)),i.set("Accept","application/json"),a&&i.set("X-Promoter-Workspace-Id",a),void 0===t.body||t.body instanceof FormData||i.set("Content-Type","application/json"),u(await fetch(e,{...t,headers:i,body:void 0===t.body||t.body instanceof FormData?t.body:JSON.stringify(t.body)}))},[o,f,l]),y=l.userId===f,k=!!o&&(!y||["waiting","loading"].includes(l.state)),v=(0,r.useCallback)(async()=>{let e=p(await g("/api/v1/workspaces"))||{},t=String(e.active_workspace_id||"").trim().toLowerCase();if(!c.test(t)||t!==m.current.id)throw new d({status:409,code:"workspace_context_changed",detail:"The active workspace changed. Reload before continuing."},409);return w({...m.current,directory:e,problem:null}),e},[g,w]);return(0,r.useMemo)(()=>({loading:void 0===o||k,signedIn:!!o,session:o,workspaceId:y?l.id:null,workspaceDirectory:y?l.directory:null,workspaceProblem:y?l.problem:null,refreshWorkspaceDirectory:v,request:g}),[o,y,l,k,g,v])}();return(0,n.jsx)(l.Provider,{value:o,children:t})}function w(){let e=(0,r.useContext)(l);if(!e)throw Error("WorkspaceApiProvider is required.");return e}function f(e){let t=w();return(0,r.useEffect)(()=>{if(!t.loading&&!t.signedIn){let t=e;try{t=(0,s.X)(e,(0,s.D)(window.location.search))}catch(e){t="".concat(window.location.pathname).concat(window.location.search).concat(window.location.hash)}window.location.assign("/login?next=".concat(encodeURIComponent(t)))}},[t.loading,t.signedIn,e]),t}function b(e){var t;let o=e.workspaceDirectory,n=!e.signedIn||e.loading||o?null:e.workspaceProblem||new d({status:409,code:"workspace_context_unavailable",detail:"The workspace capability directory is unavailable."},409),r=e.loading||!e.signedIn?"waiting":n?"error":(null==o||null==(t=o.capabilities)?void 0:t.linkedin_outreach)===!0?"allowed":"unavailable";return{state:r,loading:e.loading,allowed:e.signedIn&&"allowed"===r,unavailable:e.signedIn&&"unavailable"===r,problem:n,retry:()=>{e.refreshWorkspaceDirectory().catch(()=>{})}}}function g(e){let t=f(e),o=b(t);return{...t,loading:o.loading,signedIn:o.allowed,featureUnavailable:o.unavailable,featureProblem:o.problem,retryFeatureCheck:o.retry}}},9630:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>u});var n=o(9693),r=o(1177),a=o(6282);let i=["Find me 5 AI speakers with 50k+ followers","Build an audience from this speaker: <linkedin url>","What's my usage this month?","Monitor the Cyber Security topic for me","Write outreach for my webinar on <topic>, <date>","Connect my LinkedIn account","Show my workspace team and invitations","Create a read-only API key securely","Redeem my Showrunner code"],s=/^[A-Z0-9]{2,}(?:-[A-Z0-9]{2,})+$/i,l=/\b(?:pk_promoter_|whsec_|pci_)[A-Za-z0-9_-]{8,}\b/i;function c(e,t){if("string"!=typeof e||!e.trim())throw Error("The secure handoff did not return a destination URL.");let o=new URL(e.trim()),n="http:"===o.protocol&&["localhost","127.0.0.1"].includes(o.hostname);if("https:"!==o.protocol&&!n)throw Error("The secure handoff URL was rejected.");let r=o.hostname.toLowerCase(),a=String(t||"").toLowerCase();if(!n&&(!a||r!==a&&!r.endsWith(".".concat(a))))throw Error("The secure handoff destination was not an approved provider host.");return o.toString()}function d(){let[e,t]=(0,r.useState)([]),[o,d]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),[p,m]=(0,r.useState)(null),[w,f]=(0,r.useState)({}),[b,g]=(0,r.useState)(null),[y,k]=(0,r.useState)({}),[v,_]=(0,r.useState)({}),x=(0,r.useRef)(null),{loading:I,signedIn:j,request:S}=(0,a.d1)();async function C(n){let r=(null!=n?n:o).trim();if(r&&!u){if(d(""),l.test(r))return void t(e=>[...e,{role:"user",content:"I tried to paste a Promoter credential."},{role:"assistant",content:"I kept that credential out of Agent model history. Use its secure browser control, and rotate it if it was exposed anywhere else."}]);if(/\b(?:promo|bonus|showrunner)\s+code\b/i.test(r)||s.test(r)){var a;let e=window.crypto.randomUUID(),o=(null==(a=r.toUpperCase().match(/\b([A-Z0-9]{2,}(?:-[A-Z0-9]{2,})+)\b/))?void 0:a[1])||"";o&&_(t=>({...t,[e]:o})),t(t=>[...t,{role:"user",content:"Redeem a Promoter promo code securely."},{role:"assistant",content:"Enter the code in the secure browser form below. It is never sent to the Agent model.",browserActions:[{action_id:e,type:"promo_redemption",label:"Redeem code for this whole-product workspace",body:{},execution:"browser_only",model_receives_secret:!1}]}]);return}t(e=>[...e,{role:"user",content:r}]),h(!0);try{if(!j){location.href="/login?next=/agent";return}let o=[...e,{role:"user",content:r}].map(e=>{let{role:t,content:o}=e;return{role:t,content:o}}),n=await S("/api/agent",{method:"POST",body:{messages:o}});t(e=>[...e,{role:"assistant",content:n.reply||n.error||"…",steps:n.steps,confirmations:n.confirmations,browserActions:n.browser_actions}])}catch(e){t(t=>[...t,{role:"assistant",content:"Something broke: ".concat(String((null==e?void 0:e.message)||e))}])}h(!1)}}async function A(e,t){let o=await S("/api/agent/confirm",{method:"POST",body:{confirmation_id:e,browser_completion:t}});return f(t=>({...t,[e]:o})),o}
1async function P(e,t){let{confirmationId:o=null}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e||"browser_only"!==e.execution||b)return;let n=e.body&&"object"==typeof e.body&&!Array.isArray(e.body)?e.body:{};g(t),k(e=>({...e,[t]:{state:"working"}}));try{let r={state:"complete",label:"Secure browser step completed."},a={ok:!0,code:"browser_action_completed",status:"completed"},i=null;if("reload_workspace"===e.type)i="/agent",r={state:"complete",label:"Opening the selected workspace…"};else if("linkedin_contributor_portal"===e.type){if(!/^[0-9a-f-]{36}$/i.test(n.workspace_id||""))throw Error("The secure workspace handoff is invalid.");i="/account-contributors?manage_workspace=".concat(encodeURIComponent(n.workspace_id)),r={state:"complete",label:"Opening browser-only contributor controls…"}}else if("linkedin_hosted_auth"===e.type){let e=await S("/api/v1/linkedin/accounts/hosted-auth",{method:"POST",body:n}),t=(null==e?void 0:e.data)||e;i=c(null==t?void 0:t.url,"unipile.com"),a={ok:!0,code:"hosted_auth_link_created",status:"redirecting"},r={state:"complete",label:"Opening provider-hosted LinkedIn authentication…"}}else if("rotate_api_key"===e.type){let e=await S("/api/keys",{method:"POST",body:n});if(!(null==e?void 0:e.key)||!String(e.key).startsWith("pk_promoter_"))throw Error("The one-time API key was not returned safely.");r={state:"secret",kind:"API key",secret:e.key,label:"Copy this API key now. It is held only in this browser tab and is never shown again.",detail:"".concat(e.prefix||""," \xb7 ").concat((e.scopes||[]).join(", "))},a={ok:!0,code:"api_key_rotated",id:e.id,status:"created"}}else if("create_webhook_endpoint"===e.type){let e=await S("/api/v1/webhooks",{method:"POST",body:n}),t=(null==e?void 0:e.data)||e;if(!(null==t?void 0:t.signing_secret)||!String(t.signing_secret).startsWith("whsec_"))throw Error("The one-time webhook signing secret was not returned safely.");r={state:"secret",kind:"Webhook signing secret",secret:t.signing_secret,label:"Copy this signing secret now. It is held only in this browser tab and is never shown again.",detail:"".concat(t.url||""," \xb7 ").concat(t.secret_fingerprint||"")},a={ok:!0,code:"webhook_endpoint_created",id:t.id,status:"created"}}else if("billing_checkout"===e.type){let e=await S("/api/billing/checkout",{method:"POST",body:n});i=c(null==e?void 0:e.url,"stripe.com"),a={ok:!0,code:"billing_checkout_created",status:"redirecting"},r={state:"complete",label:"Opening secure whole-product checkout…"}}else if("promo_redemption"===e.type){let e=String(v[t]||"").trim();if(!e)throw Error("Enter the promo code first.");let o=await S("/api/promo/redeem",{method:"POST",body:{code:e}});_(e=>({...e,[t]:""})),r={state:"complete",label:"".concat(o.plan||"Promoter"," is active").concat(o.until?" until ".concat(new Date(o.until).toLocaleDateString()):"",".")}}else throw Error("This secure browser action is not supported.");k(e=>({...e,[t]:r})),o&&await A(o,a),i&&window.location.assign(i)}catch(n){let e=String((null==n?void 0:n.message)||n||"The browser action failed safely.");if(o)try{await A(o,{ok:!1,code:"browser_action_failed",error:e,status:"failed"})}catch(e){}k(o=>{var n;return(null==(n=o[t])?void 0:n.state)==="secret"?{...o,[t]:{...o[t],detail:"".concat(o[t].detail||""," \xb7 Audit receipt uncertain; do not rotate again.")}}:{...o,[t]:{state:"failed",label:e}}})}finally{g(null)}}async function T(e){if(!(null==e?void 0:e.confirmation_id)||p)return;let t=e.confirmation_id;m(t);try{var o;let e=await S("/api/agent/confirm",{method:"POST",body:{confirmation_id:t}});f(o=>({...o,[t]:e}));let n=null==e||null==(o=e.result)?void 0:o.browser_action;(null==e?void 0:e.browser_completion_required)===!0&&n?await P(n,t,{confirmationId:t}):n&&await P(n,t)}catch(e){f(o=>({...o,[t]:{result:{ok:!1,error:e.message||"The confirmation failed safely."}}}))}finally{m(null)}}if((0,r.useEffect)(()=>{var e;null==(e=x.current)||e.scrollIntoView({behavior:"smooth"})},[e,u]),I)return(0,n.jsx)("main",{className:"wrap",children:(0,n.jsx)("p",{className:"mut",children:"Loading…"})});if(!j)return location.href="/login?next=/agent",null;function E(e,t){let o=e.action_id||t,r=y[o];return(null==r?void 0:r.state)==="secret"?(0,n.jsxs)("section",{className:"agent-secure-result","aria-label":r.kind,children:[(0,n.jsx)("strong",{children:r.kind}),(0,n.jsx)("p",{children:r.label}),(0,n.jsx)("code",{children:r.secret}),r.detail&&(0,n.jsx)("small",{children:r.detail}),(0,n.jsx)("button",{className:"btn",type:"button",onClick:()=>navigator.clipboard.writeText(r.secret),children:"Copy securely"})]},o):r?(0,n.jsx)("span",{className:"confirmation-outcome ".concat("failed"===r.state?"failed":"complete"),children:r.label},o):(0,n.jsxs)("section",{className:"agent-browser-action",children:["promo_redemption"===e.type&&(0,n.jsx)("input",{type:"password",autoComplete:"off","aria-label":"Promo code",placeholder:"Promo code",value:v[o]||"",onChange:e=>_(t=>({...t,[o]:e.target.value}))}),(0,n.jsx)("button",{className:"btn hot",type:"button",disabled:!!b,onClick:()=>P(e,o),children:b===o?"Working…":e.label||"Continue securely"}),(0,n.jsx)("small",{children:"This step runs only in your signed-in browser. One-time secrets never enter Agent history."})]},o)}return(0,n.jsxs)("main",{className:"agent-shell",children:[(0,n.jsxs)("div",{className:"chat",children:[0===e.length&&(0,n.jsxs)("div",{className:"msg bot",children:["\uD83D\uDC4B I'm your promotion agent. I find speakers, watch what your audience talks about, build invite lists from real engagement, write the outreach, and prepare safe campaigns.","\n\n","What are we filling seats for?"]}),e.map((e,t)=>{var o,r,a;return(0,n.jsxs)("div",{className:"msg ".concat("user"===e.role?"user":"bot"),children:[e.content,(null==(o=e.steps)?void 0:o.length)>0&&(0,n.jsxs)("span",{className:"steps",children:["\uD83D\uDD27 ",e.steps.map(e=>"".concat(e.confirmation_required?"◷":e.ok?"✓":"✕"," ").concat(e.tool)).join(" \xb7 ")]}),null==(r=e.confirmations)?void 0:r.map(e=>{var t;let o=e.confirmation_id,r=w[o],a=null==r?void 0:r.result,i=e.summary||{};return(0,n.jsxs)("section",{className:"agent-confirmation","aria-label":"Confirm high-impact action",children:[(0,n.jsx)("strong",{children:i.title||"Confirm exact action"}),(0,n.jsx)("p",{children:i.impact||"Review this exact action before it executes."}),i.target_id&&(0,n.jsxs)("small",{children:[i.target_label||"Target",": ",(0,n.jsx)("code",{children:i.target_id})]}),i.reason&&(0,n.jsxs)("small",{children:["Reason: ",i.reason]}),i.changes&&(0,n.jsxs)("small",{children:["Exact changes: ",(0,n.jsx)("code",{children:JSON.stringify(i.changes)})]}),void 0!==i.exact_text&&(0,n.jsx)("blockquote",{children:i.exact_text}),a?(0,n.jsx)("span",{className:"confirmation-outcome ".concat(!1===a.ok?"failed":"complete"),children:!1===a.ok?"Blocked safely: ".concat(a.error||a.code||"Action failed."):(null==r||null==(t=r.confirmation)?void 0:t.status)==="claimed"?"Confirmed. Completing the exact browser step…":"Confirmed and completed."}):(0,n.jsx)("button",{className:"btn hot",type:"button",disabled:!!p,onClick:()=>T(e),children:p===o?"Confirming…":"Confirm this exact action"}),!a&&(0,n.jsxs)("small",{children:["Expires ",new Date(e.expires_at).toLocaleTimeString(),". No action has executed yet."]}),y[o]&&E({action_id:o},o)]},o)}),null==(a=e.browserActions)?void 0:a.map(e=>E(e,"".concat(t,":").concat(e.type)))]},t)}),u&&(0,n.jsx)("div",{className:"msg bot mut",children:"working…"}),(0,n.jsx)("div",{ref:x})]}),0===e.length&&(0,n.jsx)("div",{className:"chips",children:i.map(e=>(0,n.jsx)("button",{className:"chip",onClick:()=>e.includes("<")?d(e):C(e),children:e},e))}),(0,n.jsxs)("div",{className:"composer",children:[(0,n.jsx)("input",{placeholder:"Tell me about your event, or ask for speakers…",value:o,onChange:e=>d(e.target.value),onKeyDown:e=>"Enter"===e.key&&C()}),(0,n.jsx)("button",{className:"btn hot",disabled:u,onClick:()=>C(),children:u?"…":"Send"})]})]})}function u(){return(0,n.jsx)(r.Suspense,{fallback:null,children:(0,n.jsx)(d,{})})}}},e=>{e.O(0,[9945,4260,828,1661,7358],()=>e(e.s=473)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.