-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanychat-commandbar.auto.min.js
More file actions
1 lines (1 loc) · 29.3 KB
/
anychat-commandbar.auto.min.js
File metadata and controls
1 lines (1 loc) · 29.3 KB
1
function getFormattedTime(e=new Date){const t=e.getHours(),n=e.getMinutes();return`${t%12||12}:${String(n).padStart(2,"0")}${t<12?"am":"pm"}`}const installMineIfNeededAsync=async()=>{if(window.Mine)return;const e=`https://raw.githubusercontent.com/imaverage/usp/main/Mine.auto.min.js?cb=${Date.now()}`,t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch Mine.js: ${t.status}`);const n=new Blob([await t.text()],{type:"application/javascript"}),a=URL.createObjectURL(n);return new Promise((e,t)=>{const n=document.createElement("script");n.src=a,n.onload=()=>{URL.revokeObjectURL(a),e()},n.onerror=e=>t(new Error("Failed to load dependency lib")),document.head.appendChild(n)})},installRemotePageApiBridge=async()=>{await Mine.waitFor(()=>window.AppGlobalApiForTools,{timeoutMs:6e4,retryecheckIntervalMs:200}),window.AppGlobalApiForTools.MineExtensionAskRemotePageApiAsync=async(e,t,n={})=>await Mine.Extension.askRemotePageApiAsync(e,t,n)},main=async()=>{await installMineIfNeededAsync(),installRemotePageApiBridge().then();const e=["USER PROFILE","INTERFACE"];Mine.CB.sgcfa(async()=>{const t="/",n="/c/",a="/"===window.location.pathname,s="ok i haven't read your previous response yet; i wanted to give you another opportunity to ultrathink really hard to give me the most impactful high efficacy response and then we'll start from there. if your previous response is already perfect, just repeat that verbatim. no need to acknowledge your previous response (previous response will automatically be deleted)";if(!window.MineCC)return[{title:getFormattedTime(),subtitle:"in non-chat page",isStatusBar:!0},{title:"Go to Home",hotkeySequence:"h",analytics:{manualTimeSavedMs:5e3},run:async()=>{window.location.pathname="/"}}];const[i,o]=await Promise.all([MineCC.getCurrentChatResolvedAsync(),MineCC.getAppContextAsync()]),r=i?.systemPrompt===o?.defaultSystemPrompt?"":(()=>{const e=i?.systemPrompt?.length??0,t=o?.defaultSystemPrompt?.length??0,n=0===t?e>0?100:0:(e-t)/t*100,a=Math.abs(n);return`📜 sys.p. Δ(${n>=0?"+":"-"}${a>=1e3?`${Math.round(a/1e3)}k`:a.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})}%)`})(),c=i?.updatedAt?Mine.getHumanizedDurationMs(Date.now()-i.updatedAt,{ignoredUnits:["ms"]}):"",l=i?.messages?.map(e=>"user"===e.role&&Array.isArray(e.content)?e.content.filter(e=>!["text","thinking","tool_result"].includes(e.type)&&!e.superseded).map(t=>({message:e,contentRaw:t})):[]).flat()||[],u=l.length,d=i?.dynamicContextInstances?.length||0,m=(window.location.origin.includes("localhost"),i?.messages.filter(e=>e.starred).length),y=(()=>{const e=Mine.qs('[data-id="analytics-percentage"]');if(!e)return"";const t=parseFloat(e.innerText)||0,n=Math.round(t/25);return`${["🌑","🌘","🌗","🌖","🌕"][Math.max(0,Math.min(4,n))]} ${t}% full`})(),p=(()=>{try{return window.self!==window.top}catch(e){return!0}})(),h=[{title:[getFormattedTime(),i?.messages.length?"💬 "+Mine.pluralize(i?.messages.length,"msg"):"",c?`💤 ${c}`:""].filter(Boolean).join(" • "),subtitle:["/"===window.location.pathname?`${Mine.pluralize(o.numChats,"chat")}`:"",i?`🧠 ${i?.model}`:"",i?`💡 ${i?.modelParams?.reasoningEffort||"?"} effort`:"",y,i?r:"",i?.toolsAllEnabled?"🛠️ "+Mine.pluralize(i.enabledTools.length,"tool"):"",m?`📌 ${Mine.pluralize(m,"pin")}`:"",i?.userNotes?.trim()?"📝 notes":"",u?`🖇️ ${Mine.pluralize(u,"attmt")}`:"",d?`🔌 ${Mine.pluralize(d,"dci")}`:""].filter(Boolean).join(" • "),isStatusBar:!0},...l.map((e,t)=>({site:n,title:`📎 Go to attachment: ${t+1}`,hotkeySequence:t===l.length-1?"a+l":0===t?"a+f":"",subtitle:"> "+e.contentRaw.filename,analytics:{manualTimeSavedMs:15e3},run:async()=>{Mine.qs(`[data-message-id="${e.message.id}"]`).scrollIntoView({behavior:"smooth"})}})),{site:t,title:"Toggle Fullscreen",hotkeySequence:"f",analytics:{manualTimeSavedMs:7e3},run:async()=>{await MineCC.toggleFullscreenAsync()}},{site:n,title:"📑 Toggle topics index",hotkeySequence:"i",analytics:{manualTimeSavedMs:7e3},run:async()=>{Mine.qs('[aria-label="Navigate topics"]').click()}},{site:n,title:"📝 Notes | toggle",hotkeySequence:"n",analytics:{manualTimeSavedMs:7e3},run:async()=>{const e=Mine.qs('[aria-label="Toggle notes"]'),t=e.classList.contains("bg-accent");e.click(),t||(await Mine.sleep(500),MineCC.focusNotes())}},{site:n,title:"🖇️ Attachments panel | toggle",hotkeySequence:"a",analytics:{manualTimeSavedMs:7e3},run:async()=>{Mine.qs('[aria-label="Toggle attachments"]').click()}},{site:n,title:"📝 Notes | next item | send",hotkeySequence:"n+n",analytics:{manualTimeSavedMs:7e3},run:async()=>{const e=MineCC.getNotesValue();if(!e?.trim())return;const t=e.trimStart().split(/\n\s*\n+/),n=t.shift(),a=t.join("\n\n").trimStart();n&&n.trim()&&(MineCC.sendMessageAsync(n.trim()).then(),MineCC.setNotesValue(a))}},{site:n,title:"📝 Notes | all | send",hotkeySequence:"n+a",analytics:{manualTimeSavedMs:7e3},run:async()=>{const e=MineCC.getNotesValue();e?.trim()&&(MineCC.sendMessageAsync(e.trim()).then(),MineCC.setNotesValue(""))}},{site:n,title:"Research exhaustively",hotkeySequence:"r+e",analytics:{manualTimeSavedMs:7e3},run:async()=>{await MineCC.sendMessageAsync("research exhaustively as needed to ascertain",{enablePlugins:!0})}},{site:n,title:"🧭 Summarize positioning",analytics:{manualTimeSavedMs:3e4},hotkeySequence:"p+o",subtitle:"Request current orientation and positioning",run:async(e={})=>{const t=Mine.normalizeSpaceIndents("\n ```System message\n Status check: Describe our current situation orientation and positioning.\n What happens if we effectively do nothing now? What is the general timeline?\n Start with a TLDR sentence, followed by an HR divider, then your answer.\n ```\n ");MineCC.sendMessageAsync(t,{append:!0,enablePlugins:!0}).then()}},...["A","B","C","D","E","F"].map(e=>({site:n,title:`📝 Give feedback grade: ${e}`,analytics:{manualTimeSavedMs:1e4},hotkeySequence:`f+b+${e.toLowerCase()}`,run:async(t={})=>{const n=Mine.normalizeSpaceIndents(`\n \`\`\`System message\n User reacted to your response with grade _${e}_.\n \`\`\`\n `);MineCC.sendMessageAsync(n,{append:!0,enablePlugins:!0}).then()}})),{site:n,title:"TLDR last message",subtitle:"Adds TLDR overlays to sections",analytics:{manualTimeSavedMs:1e4},hotkeySequence:"t+l+d+r",run:async(e={})=>{const t=Mine.qsaa('[data-message-role="model"][data-message-id]').pop()?.getAttribute("data-message-id");await MineCC.sectionSummaryForMessageAsync(t)}},{site:n,title:"Copy last response",analytics:{manualTimeSavedMs:1e4},hotkeySequence:"c+r",run:async(e={})=>{Mine.qsaa('[aria-label="Copy AI response"]').pop().click()}},{site:n,title:"📝 Notes | append current draft text",subtitle:"Moves draft content to notebar",hotkeySequence:"n+a+p",analytics:{manualTimeSavedMs:7e3},run:async()=>{const e=Mine.qs("#chat-input-textbox");if(!e?.value?.trim())return;const t=MineCC.getNotesValue();MineCC.setNotesValue(t?t+"\n\n"+e.value:e.value),Mine.updateReactTypableFormValue(e,"")}},{site:t,title:"Dynamic context | inject context node",hotkeySequence:"d+c+i+n",analytics:{manualTimeSavedMs:5e4},run:async()=>{const e=await navigator.clipboard.readText(),t=e?.split("\n")[0]||"",n=prompt("Enter context node project name (ideally with ending ':')",t.trim()||"");if(!n?.trim())return;const a=await MineCC.addDynamicContextToCurrentChatAsync({toolId:await(async()=>await MineCC.getToolsDetailsAsync().then(e=>e.find(e=>"getProjectContextNotes"===e.name)?._appMetadata.id))(),requestSettings:{projectTitle:n,topLevelItemsToIgnoreCsv:"logs"},templateVariableName:(s=n,s.replace(/[^a-zA-Z0-9\s]/g," ").split(/\s+/).filter(Boolean).map((e,t)=>0===t?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(""))});var s;return a.error?Mine.toastError(a.error):a.isSuccess?void 0:Mine.toastError("couldn't inject item")}},...[{impl:!1,deep:!1},{impl:!0,deep:!1},{impl:!1,deep:!0},{impl:!0,deep:!0}].map(({impl:e,deep:t})=>({title:`Inject links${t?" with Deep dive":""}${e?" and get Implications":""}`,hotkeySequence:`i+l${t?"+d":""}${e?"+i":""}`,subtitle:`Uses clipboard as default input${t?"; includes links 1 level deep":""}${e?"; asks for implications":""}`,analytics:{manualTimeSavedMs:t?3e5:3e4},run:async n=>{let a=await navigator.clipboard.readText()||"";const s=e=>{const t=e.match(/https?:\/\/docs\.google\.com\/[^\s"'<>)}\]]+/g)||[],n=e.match(/(?<![\/\w])go\/\w+(?:[.-]\w+)*/g)||[];return[...new Set([...t,...n])]},i=e=>e.match(/\/d\/([a-zA-Z0-9_-]+)/)?.[1]||null;let o=s(a);if(o.length||(o=s(prompt("Enter text containing links (none found in clipboard):","")||"")),Mine.qs("textarea").focus(),!o.length)return Mine.toastError("No links found to process");const r=new Set,c=new Set(o);o.forEach(e=>{const t=i(e);t&&r.add(t)});let l=0,u=0;const d=e=>n?.setStatus(e),m=async(e,t,{suffix:n=""}={})=>(l=0,u=e.length,d(`${t} 1/${u}${n}`),Promise.all(e.map(async e=>{try{return await(async e=>{const t=await MineCC.runToolAsync("getLinkedArtifactDetails",{url:e});if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return n?.error?null:(await MineCC.addFileAttachmentAsync(JSON.stringify(n,null,2)),n)})(e)}catch(t){return console.warn(`Failed: ${e}`,t),null}finally{l++,d(`${t} ${Math.min(l+1,u)}/${u}${n}`)}}))),y=await m(o,"Injecting link",{suffix:t?" and their children":""});if(t){const e=[];for(const t of y)if(t)for(const n of s(JSON.stringify(t))){const t=i(n);t&&r.has(t)||c.has(n)||(t&&r.add(t),c.add(n),e.push(n))}e.length&&await m(e,"Fetching nested link")}e&&MineCC.sendMessageAsync("any implications of these for us?",{enablePlugins:!0,append:!0}).then()}})),{site:t,title:"🤙🏻 Go live",subtitle:"Use with headphones",hotkeySequence:"g+l",analytics:{manualTimeSavedMs:5e3},run:async(e={})=>{await Mine.waitFor(()=>!!MineTmStub.initGoLiveAsync),await MineTmStub.initGoLiveAsync({triggeredViaDirectUserInteraction:!0})}},{site:t,title:"Dynamic context | refresh all",hotkeySequence:"d+c+r",analytics:{manualTimeSavedMs:15e3},run:async()=>{await MineCC.currentChatDciRefreshAllActiveAsync()}},{site:n,title:"Cite sources",hotkeySequence:"c+s",analytics:{manualTimeSavedMs:15e3},run:async()=>{await MineCC.sendMessageAsync("Please cite sources (links) for each claim",{append:!0})}},{site:n,title:"Compress | since last marker (preserve attachments)",hotkeySequence:"c+l+m",analytics:{manualTimeSavedMs:3e4},run:async()=>{await MineCC.getCurrentChatResolvedAsync().then(e=>{const t=e.messages.findLastIndex(e=>"marker"===e.type);if(t<0)throw"no marker found";const n=e.messages.find((e,n)=>n>t&&"user"===e.role);if(!n)throw"cant find target user message";const a=document.querySelector(`[data-message-id="${n.id}"] button[aria-label="Compress from here (preserve attachments)"]`);if(!a)throw"cant find target compress button";a.click()})}},{site:n,title:"🧼 Fix/polish code",hotkeySequence:"f+c",analytics:{manualTimeSavedMs:1e4},run:async()=>{const e=Mine.normalizeSpaceIndents("\n ```⚙️ Fix/polish the code\n * no console logs unless absolutely necessary (and dont leak anything sensitive)\n * no unnecessary try catch\n * no unnecessary parenthesis/brackets\n * no unnecessary comments (but preserve mine). do not repeat implementation details in comments\n * prefer fat arrow notation\n * prefer clear explicit naming (with type suffix if in untyped environment)\n * use semicolons and such\n * 2-space indents\n * favor early returns\n * favor trailing commas\n * readable variable names, favoring const (for JS)\n * inline simple returns (for JS)\n * DRY, modular code\n * simplified\n * keep all contextual instructions/comments about integrating the code OUTSIDE of the code block\n * if I gave you code, then try to have minimal changes to what I provided\n ```\n ").trim();await MineCC.sendMessageAsync(e,{append:!0})}},{site:n,title:"🔉 Speak response",subtitle:"Speak the last AI response as soon as its ready",hotkeySequence:"s+r",analytics:{manualTimeSavedMs:15e3},run:async e=>{e?.setStatus("waiting for AI response"),await Mine.waitFor(()=>!Mine.qs('[aria-label="Stop generating"]'),{timeoutMs:3e5}),e?.setStatus(),Mine.qsaa('[aria-label="Speak response"]').pop().click()}},...["Settings","Tools","Home","Agents"].map(e=>({site:t,title:`Go to: ${e}`,hotkeySequence:`g+${e.toLowerCase()[0]}`,analytics:{manualTimeSavedMs:7e3},run:async t=>{"home"===e.toLowerCase()?window.location.pathname="/":Mine.qsaa("button").find(t=>t.innerText.trim()===e).click()}})),...Object.entries({"Claude Opus":{id:"[latest]claude-opus",hotkeySequence:"m+c+o"},"Claude Sonnet":{id:"[latest]claude-sonnet",hotkeySequence:"m+c+s"},"Claude Haiku":{id:"[latest]claude-haiku",hotkeySequence:"m+c+h"},"Gemini Pro":{id:"[latest]gemini-pro",hotkeySequence:"m+g+p"},"Gemini Pro (legacy)":{id:"Gemini 3 Pro Preview",hotkeySequence:"m+g+p+l"},"Gemini Flash":{id:"[latest]gemini-flash",hotkeySequence:"m+g+f"},"Gemini Image":{id:"[latest]gemini-pro-image",hotkeySequence:"m+g+i"},"xAI Grok":{id:"[latest]grok",hotkeySequence:"m+x+g"}}).flatMap(([e,a])=>[{site:t,title:`🧠 Switch to model: ${e}`,hotkeySequence:a.hotkeySequence,subtitle:a.id,analytics:{manualTimeSavedMs:1e4},run:async()=>{await MineCC.switchToModelAsync(a.id),Mine.qs("textarea").focus()}},{site:n,title:`🧠 Switch to model: ${e} and Regenerate`,hotkeySequence:`${a.hotkeySequence}+r`,subtitle:a.id,analytics:{manualTimeSavedMs:15e3},run:async()=>{await MineCC.switchToModelAsync(a.id),Mine.qs("textarea").focus(),MineCC.regenerateLastResponseAsync().then()}}]),{site:n,title:"Rename chat title | automatically",hotkeySequence:"r",analytics:{manualTimeSavedMs:1e4},run:async()=>{Mine.qs('[aria-label="Auto-generate title"]').click()}},{site:n,title:"Optimize response",subtitle:"Have it optimize for value",hotkeySequence:"o+r",analytics:{manualTimeSavedMs:1e4},run:async()=>{await MineCC.sendMessageAsync(s)}},...[Mine.qsaa("button").find(e=>"Recover Chat"===e.innerText)].filter(Boolean).map(e=>({title:"Undelete chat",hotkeySequence:"z",analytics:{manualTimeSavedMs:5e3},run:async()=>e.click()})),{site:n,title:"🍴 Fork chat",analytics:{manualTimeSavedMs:1e4},run:async()=>{Mine.qsaa('[aria-label="Fork from here"]').pop().click()}},{site:n,title:"Open links in last response",analytics:{manualTimeSavedMs:1e4},hotkeySequence:"o+l",run:async()=>{const e=Mine.qsaa("[data-message-id]").pop();if(!e)return;const t=Mine.deduplicate([...e.querySelectorAll("a")].map(e=>e.href));for(const e of t)await Mine.Extension.openTab({url:e})}},{site:n,title:"📌 Go to pinned | first",analytics:{manualTimeSavedMs:1e4},hotkeySequence:"p+f",run:async()=>{Mine.qsaa(".starred-message")[0]?.scrollIntoView({behavior:"smooth"})}},{site:n,title:"📌 Go to pinned | last",subtitle:m?`${Mine.pluralize(m,"pin")}`:"No pinned messages.",analytics:{manualTimeSavedMs:1e4},hotkeySequence:"p+l",run:async()=>{Mine.qsaa(".starred-message").pop()?.scrollIntoView({behavior:"smooth"})}},{site:t,title:"New chat",hotkeySequence:"n+c",analytics:{manualTimeSavedMs:1e4},run:async()=>{Mine.qsaa("button").find(e=>"New Chat"===e.innerText).click()}},{site:n,title:"Reset context here",subtitle:"Clear context before last user exchange",hotkeySequence:"r+c+h",analytics:{manualTimeSavedMs:1e4},run:async()=>{Mine.qsaa('[data-message-role="user"]').pop().querySelector('[aria-label="Clear context before"]').click()}},{site:t,title:"🗑️ Destructive exit",subtitle:a?"Closes tab":"Deletes this chat and closes the tab",hotkeySequence:"x",analytics:{manualTimeSavedMs:1e4},run:async()=>{if(a)return void Mine.Extension.closeTab();const e=await MineCC.getCurrentChatResolvedAsync();if(!e)throw"current chat not found";const t=e.messages.filter(e=>e.starred).length;t&&!confirm(`You have ${Mine.pluralize(t,"pin")}. Are you sure you still want to delete this chat?`)||(await MineCC.deleteCurrentChatAsync(),Mine.Extension.closeTab())}},{site:t,title:"⚙️ Edit System Prompt",hotkeySequence:"s+p",analytics:{manualTimeSavedMs:7e3},run:async()=>{Mine.qs('[aria-label="Chat settings"]').click()}},...["d+l","d"].map(e=>({site:n,title:"➖ Delete last exchange",hotkeySequence:e,analytics:{manualTimeSavedMs:15e3},run:async()=>{await MineCC.deleteLastExchangeAsync(),Mine.qs("#chat-input-textbox").focus()}})),...[!1,!0].map(a=>({site:a?n:t,title:"System prompt | ⬛ Redact personal info"+(a?" and Regenerate":""),subtitle:`sections: ${e.join(", ")}`,hotkeySequence:"s+p+r"+(a?"+r":""),analytics:{manualTimeSavedMs:15e3},run:async()=>{await(async()=>{const t=()=>"/"===window.location.pathname;if(t()&&(await MineCC.activateANewChatAsync(),await Mine.waitFor(()=>!t()),await Mine.sleep(500)),!await MineCC.redactSystemPromptSectionAsync(e[0]))return Mine.toastWarning("couldnt redact USER PROFILE");await MineCC.redactSystemPromptSectionAsync(e[1]),Mine.qs("textarea").focus()})(),a&&MineCC.regenerateLastResponseAsync().then()}})),...[!1,!0].map(e=>({site:e?n:t,title:"System prompt | ⬜ Clear"+(e?" and Regenerate":""),hotkeySequence:"s+p+c"+(e?"+r":""),analytics:{manualTimeSavedMs:7e3},run:async()=>{await MineCC.clearSystemPromptAsync(),Mine.qs("textarea").focus(),e&&MineCC.regenerateLastResponseAsync().then()}})),{site:n,title:"Workflow | absorb nutrients",hotkeySequence:"a+n",analytics:{manualTimeSavedMs:12e4},run:async e=>{await MineCC.sendMessageAsync("lets absorb its nutrients. think really hard on this",{append:!0}),await(e?.getShouldInterruptAsync())||await MineCC.sendMessageAsync(s,{append:!0})}},{site:n,title:"Transcript | Copy (lossy)",hotkeySequence:"t+c",analytics:{manualTimeSavedMs:6e4},run:async e=>{await MineCC.exportTranscriptAsync({toClipboard:!0})}},{site:n,title:"Transcript | Download (lossy)",subtitle:"Unencrypted",hotkeySequence:"t+d",analytics:{manualTimeSavedMs:6e4},run:async e=>{await MineCC.exportTranscriptAsync({asFile:!0})}},{site:n,title:"🗓️ Create calendar Events",hotkeySequence:"c+e",analytics:{manualTimeSavedMs:6e4},run:async e=>{await MineCC.sendMessageAsync('create a "add to Google Calendar" event link(s) please\n\n```cheat sheet\nGOOGLE CALENDAR EVENT LINK REFERENCE\nBase: https://calendar.google.com/calendar/render?action=TEMPLATE\n\nREQUIRED:\n action=TEMPLATE\n text={event title}\n dates={YYYYMMDD/YYYYMMDD} (all-day) or {YYYYMMDDTHHmmSSZ/YYYYMMDDTHHmmSSZ} (timed, UTC)\n\nOPTIONAL:\n details={description, url-encoded, supports line breaks as %0A}\n location={address or place name}\n ctz={timezone, e.g. America/Chicago} (use with local times, omit Z suffix)\n recur=RRULE:{RFC 5545 recurrence rule}\n add={comma-separated emails for guests}\n crm={AVAILABLE|BUSY|BLOCKING} (free/busy/OOO status)\n trp={true|false} (show as busy)\n sprop={source attribution, e.g. website:example.com}\n vcon=meet (auto-add Google Meet link)\n\nNOTES:\n- All values must be URL-encoded\n- Dates w/ Z suffix = UTC. Without Z + ctz param = local time.\n- No official Google docs for this endpoint; best ref: https://interactiondesignfoundation.github.io/add-event-to-calendar-docs/services/google.html\n```\n',{append:!0})}},{site:n,title:"Generate report",subtitle:"Optimized for high information density",hotkeySequence:"g+r",analytics:{manualTimeSavedMs:2e4},run:async e=>{MineCC.sendMessageAsync("generate a report of this chat (in a ```txt block). like a summary of sorts. super high information density, doesnt even have to be perfect english, just pack dense info. its gonna be for another AI to get some quick context. include identifiers/references where appropriate",{append:!0}).then()}},{site:t,title:"👾 Play GoodOldTetris",hotkeySequence:"p+g",analytics:{manualTimeSavedMs:7e3},run:async()=>{window.open("https://www.goodoldtetris.com/")}},{site:n,title:"See alternate response",subtitle:"For last ai response",hotkeySequence:"a+r",analytics:{manualTimeSavedMs:7e3},run:async()=>{Mine.qs("[data-element-id='see-alternate-response']")?.click()}},{site:t,title:"✨ Enable automatic Derived Enrichments",subtitle:"Performs additional OUTBOUND processing/researching/searches to enrich responses",hotkeySequence:"d+e",analytics:{manualTimeSavedMs:1e4},run:async()=>{await MineCC.setCurrentChatSettingsAsync({derivedEnrichment:!0})}},{site:t,title:"👾 Play Impossible Task Game",subtitle:"Enables storybook mode",hotkeySequence:"p+i+g",analytics:{manualTimeSavedMs:6e4},run:async()=>{await MineCC.setCurrentChatSettingsAsync({storybookMode:!0});const e=Mine.normalizeSpaceIndents('\n ```👾 Impossible Task Game Instructions\n 1. Host sets an achievable goal with clear success criteria and deadline (like "Get icecream by noon"). It should be a simple concept, but can be challenging\n 2. Player proposes a solution (like "walk to the ice cream store next door and get some")\n 3. Host introduces new obstacles that nullify the previous solution, providing logical reasoning that\'s entertaining, engaging, and ideally pragmatically educational (like "the store being closed because the FDA discovered that their ice cream\'s unique blue color comes from copper sulfate contamination - a common issue in older dairy facilities where copper pipes, originally chosen for their superior heat conductivity in pasteurization, get corroded by milk\'s natural acidity"). Each obstacle should:\n - Be engaging and plausible\n - Be creative and novel (avoid reusing or extending previous obstacles)\n - Teach something interesting with practical value when possible (social tips and tricks, industry facts, scientific principles, historical events)\n 4. Player adapts with new solution\n 5. Repeat steps 3-4 until either:\n - Player succeeds through clever thinking\n - Player or host relents\n\n Keep in mind\n - Original task/goal never changes. Do not pick the example scenario provided. Topics should not be nerdy or very technical. They must something that could be a fun story to talk about with their friends.\n - Each obstacle must be logically connected and somewhat plausible\n - No recycling previous obstacle types\n - Host must maintain plausible path to success\n\n Other notes\n - Use markdown, emojis, or formatting to keep responses visually engaging and fun\n - Add HR separators between major scene changes or sections\n - Bold key developments as they occur\n - The chat you are being interfaced with automatically generates consistent storybook images based on your responses, alongside it\n\n Best played with escalating complexity.\n ```\n\n Let\'s play! You can be the host.\n ').trim();MineCC.sendMessageAsync(e,{append:!0}).then()}},{site:n,title:"Scroll to last message",hotkeySequence:"l",analytics:{manualTimeSavedMs:1e4},run:async()=>{Mine.qsaa('[data-message-role="user"]').pop().scrollIntoView({behavior:"smooth"})}},{site:n,title:"Scroll to top",hotkeySequence:"t",analytics:{manualTimeSavedMs:1e4},run:async()=>{Mine.qs("[data-message-role]").scrollIntoView({behavior:"smooth"})}},{site:t,title:"Choose a model",hotkeySequence:"m",analytics:{manualTimeSavedMs:1e4},run:async()=>{Mine.qs('.chat-toolbar-container [data-element-id="model-selector-trigger"]').click()}},{site:t,title:"📦 Export everything",hotkeySequence:"e+e",analytics:{manualTimeSavedMs:3e4},run:async()=>{await MineCC.exportEverythingAsync()}},{site:n,title:"📦 Expand All compressed sections",hotkeySequence:"e+a",analytics:{manualTimeSavedMs:3e4},run:async()=>{Mine.qsaa('.compressed-section-toolbar button[aria-label="View summary"]').forEach(e=>e.click())}},{site:n,title:"🔖 Enrich with Citations",hotkeySequence:"e+c",analytics:{manualTimeSavedMs:2e4},run:async()=>{MineCC.sendMessageAsync("Say that again but add markdown footnotes to include citations (including links) for all claims or references (including links). If any claims are not yet substantiated, please use tools to research as necessary. Make corrections if necessary. Think of this as a fact-check.",{enablePlugins:!0}).then()}},{site:n,title:"🚀 Productionize code [WIP]",subtitle:"Test + polish",hotkeySequence:"p+c",analytics:{manualTimeSavedMs:2e4},run:async()=>{MineCC.sendMessageAsync("Test this code",{enablePlugins:!0}).then()}},{site:n,title:"⛳ Marker | add",hotkeySequence:"m+a",analytics:{manualTimeSavedMs:1e4},run:async()=>{await MineCC.addMarkerAsync()}},{site:n,title:"⛳ Marker | add as...",hotkeySequence:"m+a+s",analytics:{manualTimeSavedMs:1e4},run:async()=>{const e=prompt("Set Marker title as...");e?.trim()&&await MineCC.addMarkerAsync(e)}},{site:n,title:"⛳ Marker | last",hotkeySequence:"m+l",analytics:{manualTimeSavedMs:2e4},run:async()=>{const e=Mine.qsaa(".marker-divider").pop();e&&(e.scrollIntoView({behavior:"smooth"}),await Mine.sleep(750))}},{site:n,title:"⛳ Add marker as...",hotkeySequence:"a+m+a",analytics:{manualTimeSavedMs:1e4},run:async()=>{const e=prompt("Marker title");e?.trim()&&await MineCC.addMarkerAsync(e)}},{site:t,title:"☁️ Sync | upload",hotkeySequence:"s+u",analytics:{manualTimeSavedMs:15e3},run:async()=>{await MineCC.appSyncUploadAsync()}},{site:n,title:"Display last Thought details",hotkeySequence:"d+d",analytics:{manualTimeSavedMs:5e3},run:async()=>{Mine.qsaa("details.thinking-details summary").pop().click()}},{site:n,title:"🗝️ Keys | 🔄 cycle magazine",subtitle:`using ${(o.currentChat?.apiKeyIndexCurrent||0)+1}/${o.currentChat?.apiKeysSize} for active AI provider`,hotkeySequence:"k+c",analytics:{manualTimeSavedMs:3e4},run:async()=>{await MineCC.cycleCurrentChatApiKeysAsync({suppressToasts:!1})}},{site:n,title:"📌 Pin/unpin this message",hotkeySequence:"p",analytics:{manualTimeSavedMs:1e4},run:async()=>{const e=function(){const e=window.getSelection();if(e&&e.rangeCount>0&&!e.isCollapsed){let t=e.getRangeAt(0).commonAncestorContainer;for(;t&&t!==document.body;){if(1===t.nodeType&&t.hasAttribute("data-message-id"))return t;t=t.parentNode}}const t=document.querySelectorAll("[data-message-id]:hover");return t.length?t[t.length-1]:null}();e&&Mine.qs('[aria-label*="tar message"]',e).click()}},{title:"Pipe to text",isForUnhandledCommand:!0,run:async e=>{const t=e.userQuery,n=Mine.qs("textarea");Mine.updateReactTypableFormValue(n,t);const a=new KeyboardEvent("keydown",{key:"Enter",code:"Enter",keyCode:13,bubbles:!0,cancelable:!0}),s=new KeyboardEvent("keyup",{key:"Enter",code:"Enter",keyCode:13,bubbles:!0,cancelable:!0});n.dispatchEvent(a),n.dispatchEvent(s)}}];return p&&(h.push({site:t,title:"Reload this iframed chat",analytics:{manualTimeSavedMs:7e3},run:async()=>{window.location.reload()}}),h.push({site:t,title:"Open this iframed chat in new tab",analytics:{manualTimeSavedMs:7e3},run:async()=>{window.open(window.location.href)}})),h}),await Mine.waitFor(()=>window.MineCC,{timeoutMs:1e4});const t=await MineCC.getUserDefinedDataAsync(),n="personal"===t?.Environment?.Profile?.name||"personal"===Mine?.Environment?.Profile?.name,a=/iphone|ipod/i.test(navigator.userAgent);if(n&&!a){(()=>{const e=new BroadcastChannel("cora_audio_mutex");let t=null;const n=()=>{if(!t){e.postMessage("claim_throne");try{t=new(window.AudioContext||window.webkitAudioContext);const e=t.createOscillator(),n=t.createGain();n.gain.value=1e-4,e.connect(n),n.connect(t.destination),e.start(),console.log("🔈 Claimed audio dominance")}catch(e){console.error("Audio dominance failed",e)}}};e.onmessage=e=>{"claim_throne"===e.data&&t&&(console.log("🔇 Yielding audio dominance"),t.close().catch(()=>{}),t=null)},n(),window.addEventListener("focus",n),window.addEventListener("click",n)})();const e=navigator.platform.toLowerCase().includes("mac")?"mac":navigator.platform.toLowerCase().includes("linux")?"linux":navigator.platform.toLowerCase().includes("win")?"windows":"unknown";new Mine.PepperAgent(`cora.chat-os-${e}`,[{title:"Get current chat id",description:"Get current chat id",run:async()=>{let e;return e="/"===window.location.pathname?"[new tab]":(await MineCC.getCurrentChatResolvedAsync()).id,{success:!0,successMsg:e}}},{title:"Get current chat title",description:"Get current chat title",run:async()=>{let e;return e="/"===window.location.pathname?"":(await MineCC.getCurrentChatResolvedAsync()).title,{success:!0,successMsg:e}}},{title:"Find chats",description:"Find chats",run:async({query:e=""}={})=>({success:!0,data:await MineCC.searchChatsAsync(e),successMsg:""})},{title:"Get is chat busy",description:"Get is chat busy",run:async()=>({success:!0,data:await MineCC.getIsChatProcessingStateAsync(),successMsg:""})},{title:"Restart app",description:"Restart app",run:async()=>(setTimeout(()=>window.location.reload(),1e3),{success:!0,data:null,successMsg:"will do in 1s"})},{title:"Activate a new chat",description:"Activate a new chat",run:async({}={})=>{const{chatId:e}=await MineCC.activateANewChatAsync({autoCompressionStrategy:"slowly"});return{success:!0,data:{chatId:e},successMsg:""}}},{title:"Send message",description:"Send message",run:async({chatId:e,query:t,attachments:n=[],source:a,ephemeral:s=!1,returnTtsData:i=!1,returnMeta:o=!1,enablePrimer:r=!1,primerAdditionalInstructions:c=null,optimizeAttachments:l=!0,returnNewChatTitle:u=!1}={})=>{if(!e||!a||!n.length&&!t)return{success:!1,errorMsg:"missing arguments"};const d={returnAiResponse:!0,enablePlugins:!0,chatId:e,source:a,attachments:n,ephemeral:s,returnTtsData:i,returnMeta:o,enablePrimer:r,primerAdditionalInstructions:c,optimizeAttachments:l,returnNewChatTitle:u};let m=null;const y=await MineCC.sendMessageAsync(t,d).catch(e=>(m=e.toString(),null));return{success:!m,data:y,errorMsg:m,successMsg:""}}}],{authApiKey:t?.pagentSocketAuthApiKey})}};main().then();