@pickaxeproject/react 6.24.6 → 6.24.8
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/cjs/components/Pickaxe/Chat/History/Message.js +1 -1
- package/dist/cjs/components/Pickaxe/Provider.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMCPButton.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Components/List/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Renderer.js +1 -1
- package/dist/cjs/prose.css +1 -1
- package/dist/cjs/src/components/Pickaxe/Provider.d.ts +14 -1
- package/dist/cjs/src/hooks/pickaxe/usePickaxeContext.d.ts +15 -0
- package/dist/esm/components/Pickaxe/Chat/History/Message.js +1 -1
- package/dist/esm/components/Pickaxe/Provider.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMCPButton.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Components/List/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Renderer.js +1 -1
- package/dist/esm/prose.css +1 -1
- package/dist/esm/src/components/Pickaxe/Provider.d.ts +14 -1
- package/dist/esm/src/hooks/pickaxe/usePickaxeContext.d.ts +15 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../../../common/formatUserMessage.js"),t=require("../../common/PickaxeMarkdown/Renderer.js"),i=require("react"),a=require("../../../../hooks/pickaxe/usePickaxeContext.js"),r=require("../../../../hooks/studio/useStyleFontSize.js"),o=require("../../../../hooks/pickaxe/useResponseContext.js"),n=require("../../Addons/Artifact/hooks/useArtifact.js"),l=require("../../common/PickaxeMarkdown/index.js"),c=require("../../common/PickaxeIcon.js"),d=require("./Document.js"),m=require("../../common/PickaxeMessageActions.js"),u=require("../../common/PickaxeMessageParts/index.js"),x=require("../../../../common/cn.js"),p=require("../../../../common/isoMap.js"),f=require("franc-min"),j=require("../../common/ComposioConnectView.js"),g=require("../../common/SmitheryConnectView.js"),h=require("../../../../hooks/pickaxe/useTextToSpeech.js");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=v(require("remove-markdown"));exports.default=({index:v,message:k,smitheryData:y,resubmitPrompt:w,isLastMessage:O=!1})=>{var q,N;const{pickaxeId:C,pickaxe:I,styles:P,colors:R,misc:A,responsiveBy:M,disableHtml:S,disableJs:T,disableCss:L,isNewChat:H,isRtl:F}=a.usePickaxeContext(),{isGenerating:z}=o.useResponseContext(),{onLoadArtifact:J}=n.useArtifact(),U=r.useStyleFontSize(),V=null!==(q=null==I?void 0:I.chaticon)&&void 0!==q?q:`https://cdn.mail.studio/chaticons/${C}.png`,B=O&&z,D=null==I?void 0:I.enablereadout,{isLoading:_,isSpeaking:E,speak:G,stop:$}=h.useTextToSpeech(D&&"assistant"===k.role,{provider:null==I?void 0:I.readoutprovider,pickaxeId:C,voiceName:null==I?void 0:I.readoutvoice}),K=()=>{if(_||E)return void $();const e=k.parts.filter((e=>"text"===e.type)).map((e=>e.content)).join(" ");if(!e)return;const s=b.default(e,{stripListLeaders:!0,listUnicodeChar:"",gfm:!0,useImgAltText:!1}),t=f.franc(s),i=p.convertToIso1(t);G(s,i)},Q=!k.parts.some((e=>["text","reasoning","data-action-tool-caption","data-visualization"].includes(e.type)));return"assistant"===k.role?e.jsx("div",Object.assign({className:x.default("flex w-full",F?"justify-end":"justify-start")},{children:e.jsx("div",Object.assign({className:x.default("flex flex-col w-full",0===v&&H&&"viewport"===M&&"min-[767px]:max-w-[80%]",0===v&&H&&"container"===M&&"@[767px]/pickaxe-root:max-w-[80%]")},{children:e.jsxs("div",Object.assign({className:x.default("flex gap-x-3",F&&"flex-row-reverse")},{children:[A.isChatImage&&"NONE"!==V&&e.jsx(c.default,{src:V,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:R.text}),e.jsxs("div",Object.assign({className:x.default("flex flex-col flex-grow",F?"items-end":"items-start")},{children:[e.jsxs("div",Object.assign({className:x.default(U.b2,"chat-message pt-3 w-full",F?"text-right":"text-left")},{children:[e.jsx(l.PickaxeMarkdown,Object.assign({theme:P.theme,colors:R,isStreaming:B},F&&{rtl:!0},S&&{disableHtml:!0},T&&{disableJs:!0},L&&{disableCss:!0},{disableReasoning:null!==(N=null==I?void 0:I.enablereasoningdisplay)&&void 0!==N&&N,onArtifactClick:J},{children:e.jsx(u.default,{parts:k.parts,isStreaming:B})})),O&&y&&w&&("composio"===y.provider?e.jsx("div",Object.assign({className:"mt-4 px-1"},{children:e.jsx(j.default,{serverId:y.serverId,toolkitSlug:y.toolkitSlug||"",name:y.name,resubmitPrompt:()=>w()})})):e.jsx("div",Object.assign({className:"mt-4 px-1"},{children:e.jsx(g.default,{serverId:y.serverId,smitheryId:y.smitheryId||"",name:y.name||y.smitheryId,resubmitPrompt:()=>w()})})))]})),e.jsx("div",Object.assign({className:x.default("flex flex-col gap-6 my-4",Q&&"mt-2")},{children:B?e.jsx("div",Object.assign({className:"flex items-center gap-x-2 rounded"},{children:Array.from({length:3}).map(((s,t)=>e.jsx("div",{className:x.default("h-1.5 w-1.5 animate-dot rounded-full",1===t&&"animate-dot-down"),style:{backgroundColor:R.secondaryText}},t)))})):e.jsx(m.default,Object.assign({responseReference:k.responseReference,content:k.parts.filter((e=>e.isVisible&&"text"===e.type)).map((e=>e.content)).join("\n"),index:v},"intromessage"===k.area&&{isHideFeedback:!0,isHideResponseAction:!0},{onReadOut:K,isReadOut:D||!1,isReadOutLoading:_,isReading:E}))}))]}))]}))}))})):"user"===k.role?e.jsx("div",Object.assign({className:x.default("flex w-full",F?"justify-start":"justify-end")},{children:e.jsx("div",Object.assign({className:x.default("flex gap-x-3 max-w-[80%]",F?"pr-9":"pl-9","viewport"===M?F?"min-[767px]:pr-0":"min-[767px]:pl-0":F?"@[767px]/pickaxe-root:pr-0":"@[767px]/pickaxe-root:pl-0")},{children:e.jsxs("div",Object.assign({className:x.default(U.b2,"overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B] flex flex-col gap-y-3",F?"text-right":"text-left"),style:{backgroundColor:R.secondary+"80",color:R.secondaryText,borderRadius:P.cornerRadius}},{children:[k.documentIds&&k.documentIds.length>0&&e.jsx("div",Object.assign({className:x.default("flex flex-col gap-y-2",F?"items-start":"items-end")},{children:k.documentIds.map((s=>e.jsx(i.Fragment,{children:e.jsx(d.default,{documentId:s})},s)))})),e.jsx(l.PickaxeMarkdown,Object.assign({theme:P.theme,colors:R},F&&{rtl:!0},{disableHtml:!0,disableJs:!0,disableCss:!0},{children:k.parts.map(((i,a)=>"text"===i.type?e.jsx(t.PickaxeMarkdownRenderer,{value:s.formatUserMessage(i.content)},a):null))}))]}))}))})):e.jsx("div",{})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../../../common/formatUserMessage.js"),t=require("../../common/PickaxeMarkdown/Renderer.js"),i=require("react"),a=require("../../../../hooks/pickaxe/usePickaxeContext.js"),r=require("../../../../hooks/studio/useStyleFontSize.js"),o=require("../../../../hooks/pickaxe/useResponseContext.js"),n=require("../../Addons/Artifact/hooks/useArtifact.js"),l=require("../../common/PickaxeMarkdown/index.js"),c=require("../../common/PickaxeIcon.js"),d=require("./Document.js"),m=require("../../common/PickaxeMessageActions.js"),u=require("../../common/PickaxeMessageParts/index.js"),x=require("../../../../common/cn.js"),p=require("../../../../common/isoMap.js"),f=require("franc-min"),j=require("../../common/ComposioConnectView.js"),g=require("../../common/SmitheryConnectView.js"),h=require("../../../../hooks/pickaxe/useTextToSpeech.js");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=v(require("remove-markdown"));exports.default=({index:v,message:k,smitheryData:y,resubmitPrompt:w,isLastMessage:O=!1})=>{var q,N;const{pickaxeId:C,pickaxe:I,styles:P,colors:R,misc:A,responsiveBy:M,disableHtml:S,disableJs:T,disableCss:L,isNewChat:H,isRtl:F}=a.usePickaxeContext(),{isGenerating:z}=o.useResponseContext(),{onLoadArtifact:J}=n.useArtifact(),U=r.useStyleFontSize(),V=null!==(q=null==I?void 0:I.chaticon)&&void 0!==q?q:`https://cdn.mail.studio/chaticons/${C}.png`,B=O&&z,D=null==I?void 0:I.enablereadout,{isLoading:_,isSpeaking:E,speak:G,stop:$}=h.useTextToSpeech(D&&"assistant"===k.role,{provider:null==I?void 0:I.readoutprovider,pickaxeId:C,voiceName:null==I?void 0:I.readoutvoice}),K=()=>{if(_||E)return void $();const e=k.parts.filter((e=>"text"===e.type)).map((e=>e.content)).join(" ");if(!e)return;const s=b.default(e,{stripListLeaders:!0,listUnicodeChar:"",gfm:!0,useImgAltText:!1}),t=f.franc(s),i=p.convertToIso1(t);G(s,i)},Q=!k.parts.some((e=>["text","reasoning","data-action-tool-caption","data-visualization"].includes(e.type)));return"assistant"===k.role?e.jsx("div",Object.assign({className:x.default("flex w-full",F?"justify-end":"justify-start")},{children:e.jsx("div",Object.assign({className:x.default("flex flex-col w-full",0===v&&H&&"viewport"===M&&"min-[767px]:max-w-[80%]",0===v&&H&&"container"===M&&"@[767px]/pickaxe-root:max-w-[80%]")},{children:e.jsxs("div",Object.assign({className:x.default("flex gap-x-3",F&&"flex-row-reverse")},{children:[A.isChatImage&&"NONE"!==V&&e.jsx(c.default,{src:V,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:R.text}),e.jsxs("div",Object.assign({className:x.default("flex min-w-0 flex-col flex-grow",F?"items-end":"items-start")},{children:[e.jsxs("div",Object.assign({className:x.default(U.b2,"chat-message pt-3 w-full",F?"text-right":"text-left")},{children:[e.jsx(l.PickaxeMarkdown,Object.assign({theme:P.theme,colors:R,isStreaming:B},F&&{rtl:!0},S&&{disableHtml:!0},T&&{disableJs:!0},L&&{disableCss:!0},{disableReasoning:null!==(N=null==I?void 0:I.enablereasoningdisplay)&&void 0!==N&&N,onArtifactClick:J},{children:e.jsx(u.default,{parts:k.parts,isStreaming:B})})),O&&y&&w&&("composio"===y.provider?e.jsx("div",Object.assign({className:"mt-4 px-1"},{children:e.jsx(j.default,{serverId:y.serverId,toolkitSlug:y.toolkitSlug||"",name:y.name,resubmitPrompt:()=>w()})})):e.jsx("div",Object.assign({className:"mt-4 px-1"},{children:e.jsx(g.default,{serverId:y.serverId,smitheryId:y.smitheryId||"",name:y.name||y.smitheryId,resubmitPrompt:()=>w()})})))]})),e.jsx("div",Object.assign({className:x.default("flex flex-col gap-6 my-4",Q&&"mt-2")},{children:B?e.jsx("div",Object.assign({className:"flex items-center gap-x-2 rounded"},{children:Array.from({length:3}).map(((s,t)=>e.jsx("div",{className:x.default("h-1.5 w-1.5 animate-dot rounded-full",1===t&&"animate-dot-down"),style:{backgroundColor:R.secondaryText}},t)))})):e.jsx(m.default,Object.assign({responseReference:k.responseReference,content:k.parts.filter((e=>e.isVisible&&"text"===e.type)).map((e=>e.content)).join("\n"),index:v},"intromessage"===k.area&&{isHideFeedback:!0,isHideResponseAction:!0},{onReadOut:K,isReadOut:D||!1,isReadOutLoading:_,isReading:E}))}))]}))]}))}))})):"user"===k.role?e.jsx("div",Object.assign({className:x.default("flex w-full",F?"justify-start":"justify-end")},{children:e.jsx("div",Object.assign({className:x.default("flex gap-x-3 max-w-[80%]",F?"pr-9":"pl-9","viewport"===M?F?"min-[767px]:pr-0":"min-[767px]:pl-0":F?"@[767px]/pickaxe-root:pr-0":"@[767px]/pickaxe-root:pl-0")},{children:e.jsxs("div",Object.assign({className:x.default(U.b2,"overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B] flex flex-col gap-y-3",F?"text-right":"text-left"),style:{backgroundColor:R.secondary+"80",color:R.secondaryText,borderRadius:P.cornerRadius}},{children:[k.documentIds&&k.documentIds.length>0&&e.jsx("div",Object.assign({className:x.default("flex flex-col gap-y-2",F?"items-start":"items-end")},{children:k.documentIds.map((s=>e.jsx(i.Fragment,{children:e.jsx(d.default,{documentId:s})},s)))})),e.jsx(l.PickaxeMarkdown,Object.assign({theme:P.theme,colors:R},F&&{rtl:!0},{disableHtml:!0,disableJs:!0,disableCss:!0},{children:k.parts.map(((i,a)=>"text"===i.type?e.jsx(t.PickaxeMarkdownRenderer,{value:s.formatUserMessage(i.content)},a):null))}))]}))}))})):e.jsx("div",{})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react"),o=require("./Addons/Artifact/Provider.js"),n=require("./DimensionProvider.js"),a=require("./ResponseProvider.js"),s=require("./Addons/Document/Provider.js"),r=require("./Addons/Auth/Provider.js");function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}const l=i.createContext({});exports.PickaxeContext=l,exports.PickaxeProvider=({children:c,renderResponseAction:u,renderEmbedHeaderAction:p,origin:f,sender:g,senderType:m,deploymentId:h,portalId:y,deploymentType:b,deploymentDimensions:v,deploymentMisc:w,styles:S,colors:k,limits:P={},misc:C={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0,isResponseDownload:!1},translations:x,artifact:I={popupType:"auto"},responsiveBy:A="viewport",locale:F="en",opacity:q=1,forceMobile:T=!1,disableHtml:j=!1,disableJs:D=!1,disableCss:O=!1,loadFont:U=!0,isRtl:E=!1,isEmbed:R=!1,mcpEnabled:M=!1,mcpGuestId:L,studioSessionToken:G,isDropShadow:H=!1,allowGuestUsage:W=!0,persistActiveConversation:_=!1,preventInitialSessionId:B=!1,onUpgrade:N,onGenerateComplete:V,onSessionIdChange:Y})=>{const[X,z]=i.useState(""),[J,Q]=i.useState(""),[K,Z]=i.useState(""),[$,ee]=i.useState(""),[te,ie]=i.useState(g),[oe,ne]=i.useState(null),[ae,se]=i.useState(m),[re,de]=i.useState("loading"),[le,ce]=i.useState([]),[ue,pe]=i.useState(null),[fe,ge]=i.useState(null),[me,he]=i.useState(null),[ye,be]=i.useState(null),[ve,we]=i.useState("");i.useEffect((()=>we("")),[J]);const[Se,ke]=i.useState(!1),[Pe,Ce]=i.useState(!0),[xe,Ie]=i.useState(!0),[Ae,Fe]=i.useState(!1);return i.useEffect((()=>{ke(!1)}),[null==S?void 0:S.font]),i.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if("undefined"!=typeof window&&U&&!Se&&(null==S?void 0:S.font)&&"Real Head Pro"!==S.font)try{(yield Promise.resolve().then((function(){return d(require("webfontloader"))}))).default.load({google:{families:[S.font]},active:()=>{ke(!0)},inactive:()=>{console.error("[pxe] failed to load font {styles.font}"),ke(!0)}})}catch(e){console.error("[pxe] failed to load font:",e),ke(!0)}}))}),[U,Se,null==S?void 0:S.font]),i.useEffect((()=>{ie(g)}),[g]),t.jsx(l.Provider,Object.assign({value:Object.assign(Object.assign({origin:f,contextId:X,pickaxeId:J,sessionId:K,lastSessionId:$,sender:te,senderType:ae,portalId:y,deploymentId:h,deploymentType:b,validationStatus:re,validationUpgradeGroups:le,validationUpgradeUrl:ue,deploymentDimensions:v,deploymentMisc:w,accessGroup:oe,pickaxe:ye,selectedModel:ve,setSelectedModel:we,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},S),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},k),misc:C,translations:Object.assign({"form-next":"Next","form-progress":"Form progress","form-page-progress":"Question {current} of {total}","action-confirmation-needed":"Confirmation needed","action-confirmation-unavailable":"Confirmation unavailable","action-approved":"Approved","action-declined":"Declined","action-expired":"Expired","action-not-run":"Not run","action-label":"Action: {name}","action-confirmation-description":"Review this action before it runs. Your decision applies only to this call.","action-inputs":"Action inputs","decline-action":"Decline","approve-action":"Approve action","action-confirmation-resolved":"This confirmation has expired or already been resolved.","action-decision-failed":"Could not save your decision. Please try again.","ai-model":"AI model","default-ai-model":"Default ({model})","attach-files":"Attach files","new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website",copy:"Copy","file-limit-reached":"You have reached the file limit.","something-wrong-occured":"Something wrong occurred",save:"Save","save-as":"Save as","please-enter-email-to-continue":"Please enter your email to continue:","enter-email-to-continue":"Enter here your email to continue",submit:"Submit",sending:"Sending...","check-your-inbox":"Check your inbox","we-sent-your-an-activation-link":"We sent you an activation link. Please be sure to check your spam folder too.",resend:"Resend",resending:"Resending...","enter-verification-code":"Or enter the 6-digit code from the email","verification-code-session-missing":"Your login request could not be found. Please resend the email.","verification-code-invalid":"Invalid verification code.",verifying:"Verifying...",verify:"Verify","chat-history":"Chat History","exit-chat-history":"Exit Chat History","no-history":"No history yet.","mcp-use-with-ai-app":"Use with an AI app","mcp-use-agent-in-ai-app":"Use this agent in your AI app","mcp-connect-description":"Connect through MCP. Requests will be sent as your signed-in Studio user.","mcp-ai-app":"AI app","mcp-copy-configuration":"Copy MCP configuration","mcp-private-configuration-note":"Keep this configuration private. It contains your Studio session token and stops working when that session expires.","log-out":"Log Out","clear-form":"Clear form","form.clear-form":"Clear form",expand:"Expand","expand-artifact":"Expand artifact",collapse:"Collapse","collapse-artifact":"Collapse artifact",close:"Close","close-artifact":"Close artifact",download:"Download","copy-artifact-content":"Copy artifact content","download-artifact-content":"Download artifact content","delete-confirm":"Are you sure you want to delete this conversation?",other:"Other","select-options":"Select option(s)","select-an-option":"Select an option","type-your-answer":"Type your answer...",cancel:"Cancel","rename-chat":"Rename chat","delete-chat":"Delete chat","conversation-name":"Conversation name","not-available":"n/a","open-chat":"Open Chat",copied:"Copied!","copy-assistant-message":"Copy assistant message","failed-delete-conversation":"Failed to delete conversation.","failed-update-name":"Failed to update name.","failed-rename-chat":"Failed to rename chat.","failed-delete-chat":"Failed to delete chat.","drop-files-to-upload":"Drop files to upload","add-anything-to-the-conversation":"Add anything to the conversation","something-went-wrong-please-try-again":"Something went wrong. Please try again, or","contact-us":"contact us","for-help":"for help.",back:"Back","upgrade-required":"Upgrade Required","please-upgrade-to-continue-using-this-tool":"Please upgrade to continue using this tool.","access-locked":"Access Locked","this-tool-is-locked-contact-owner":"This tool is locked to use. Contact owner for more information.","access-denied":"Access Denied","login-is-required":"Login is required.","no-access-request-access":"It looks like you don't have access to these resources. Please request access to continue.","request-access":"Request Access",or:"or","sign-in-with-different-account":"Sign in with a different account","access-requested-successfully":"Successfully requested access!","open-tool":"Open Tool","fab-icon":"FAB Icon","iframe-artifact-fallback":"Iframe is not supported, please view this artifact in a browser that supports it.","html-preview":"HTML preview","image-link-is-broken":"[Image link is broken]","download-video":"Download Video","available-plans":"Available Plans",buy:"Buy",credits:"Credits",uses:"Uses",credits_upper:"CREDITS",uses_upper:"USES",free:"Free","pricing.free":"Free",unlimited:"Unlimited","pricing.unlimited":"Unlimited","authentication-required":"Authentication Required","smithery-auth-description-prefix":"The tool you are trying to use requires authentication with",dismiss:"Dismiss",connect:"Connect",connecting:"Connecting...","auth-failed":"Auth failed","failed-to-finalize-authentication":"Failed to finalize authentication.","must-be-logged-in-to-connect-smithery":"You must be logged in to connect Smithery MCPs.","feedback-dislike-input-placeholder":"Write here...","feedback-submit":"Submit","feedback-thanks":"Thanks for the feedback!","feedback-like-title":"What went right?","feedback-dislike-title":"What went wrong?","feedback-dislike-message":"Help us improve our answers","what-do-you-want-to-talk-about":"What do you want to talk about?","failed-to-start-generation":"Failed to start generation","response-too-long":"One or more of your responses is too long!","required-fields-missing":"You must fill out all required fields.","something-went-wrong":"Something went wrong.","something-went-wrong-try-again":"Something went wrong, please try again.","high-traffic-try-again-later":"Oops! We're experiencing high traffic at the moment. Please try again later.","queue-message":"Queue message","stop-response":"Stop response",steer:"Steer","steer-with":"Steer with",steering:"Steering...",starting:"Starting...","remove-queued-message":"Remove queued message","edit-message":"Edit message","more-options":"More options","failed-to-interrupt-current-response":"Failed to interrupt the current response.","current-response-still-stopping":"The current response is still stopping. Please send your message again in a moment.","queued-message-waiting":"A queued message is waiting for the previous response to finish.",listening:"Listening...",remaining:"remaining",upgrade:"Upgrade","pricing.upgrade":"Upgrade","email-address-cannot-be-empty":"Email address cannot be empty.","please-enter-valid-email-address":"Please enter a valid email address.","failed-to-send-sign-in-link":"Failed to send sign-in link.",tool:"Tool","document-processing-failed":"Document processing failed","invalid-upload-file-types":"You can only upload PDF, TXT, DOCX, CSV, XLSX, JSON, PPTX, MD, HTML, XML, PNG, JPEG, WEBP, GIF, or M4A files. Please try again.","invalid-website-or-youtube-link":"Please paste a valid website URL or Youtube video link to add to the knowledge base.","website-processing-failed":"Website processing failed, please try again.","invalid-website-url":"Please paste a valid website URL","document-upload-required":"Please paste a valid website/video link or drag a file to add to the knowledge base.",thinking:"Thinking...",thought:"Thought","thought-for":"Thought for",seconds:"seconds","untitled-artifact":"Untitled Artifact",created:"Created",updated:"Updated",rewrote:"Rewrote",artifact:"Artifact","iframe-not-supported-use-different-browser":"Iframe not supported, use a different browser."},x),artifact:I,renderResponseAction:u,renderEmbedHeaderAction:p,responsiveBy:A,locale:F,opacity:q,forceMobile:T,loadFont:U,disableHtml:j,disableJs:D,disableCss:O,isFontLoaded:Se,isNewChat:Pe,isShowIceBreaker:xe,isShowFeedbackMessage:Ae,isRtl:E,isEmbed:R,mcpEnabled:M,mcpGuestId:L,isDropShadow:H,allowGuestUsage:W,persistActiveConversation:_,clientSecret:me,stripeAccountId:fe,preventInitialSessionId:B,setClientSecret:he,setStripeAccountId:ge,setContextId:z,setValidationStatus:de,setValidationUpgradeGroups:ce,setValidationUpgradeUrl:pe,setPickaxeId:Q,setSessionId:e=>{Z((t=>{const i="function"==typeof e?e(t):e;return null==Y||Y(i),i}))},setLastSessionId:ee,setSender:ie,setSenderType:se,setAccessGroup:ne,setPickaxe:be,setIsFontLoaded:ke,setIsNewChat:Ce,setIsShowIceBreaker:Ie,setIsShowFeedbackMessage:Fe},N&&{onUpgrade:N}),V&&{onGenerateComplete:V})},{children:t.jsx(r.default,Object.assign({initialToken:G},{children:t.jsx(n.default,{children:t.jsx(a.default,Object.assign({limits:P},{children:t.jsx(s.default,{children:t.jsx(o.ArtifactProvider,Object.assign({},I,{children:c}))})}))})}))}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react"),o=require("./Addons/Artifact/Provider.js"),n=require("./DimensionProvider.js"),a=require("./ResponseProvider.js"),s=require("./Addons/Document/Provider.js"),r=require("./Addons/Auth/Provider.js");function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}const d={isOpen:!1,guestToken:null,isPreparing:!1,prepareError:!1},c=i.createContext({});exports.PickaxeContext=c,exports.PickaxeProvider=({children:u,renderResponseAction:p,renderEmbedHeaderAction:f,origin:g,sender:m,senderType:h,deploymentId:y,portalId:b,deploymentType:v,deploymentDimensions:w,deploymentMisc:S,styles:k,colors:P,limits:C={},misc:I={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0,isResponseDownload:!1},translations:x,artifact:A={popupType:"auto"},responsiveBy:F="viewport",locale:q="en",opacity:O=1,forceMobile:j=!1,disableHtml:D=!1,disableJs:T=!1,disableCss:E=!1,loadFont:R=!0,isRtl:U=!1,isEmbed:M=!1,mcpEnabled:L=!1,mcpInitiallyOpen:G=!1,mcpGuestId:H,studioSessionToken:W,isDropShadow:_=!1,allowGuestUsage:B=!0,persistActiveConversation:N=!1,preventInitialSessionId:V=!1,onUpgrade:Y,onGenerateComplete:X,onSessionIdChange:z})=>{const[J,Q]=i.useState(""),[K,Z]=i.useState(""),[$,ee]=i.useState(""),[te,ie]=i.useState(""),[oe,ne]=i.useState(m),[ae,se]=i.useState(null),[re,le]=i.useState(h),[de,ce]=i.useState("loading"),[ue,pe]=i.useState([]),[fe,ge]=i.useState(null),[me,he]=i.useState(null),[ye,be]=i.useState(null),[ve,we]=i.useState(null),[Se,ke]=i.useState("");i.useEffect((()=>ke("")),[K]);const[Pe,Ce]=i.useState(!1),[Ie,xe]=i.useState(!0),[Ae,Fe]=i.useState(!0),[qe,Oe]=i.useState(!1),[je,De]=i.useState({}),Te=i.useRef(new Set).current,Ee=i.useRef(new Set).current,Re=y||"",Ue=i.useCallback((e=>{De((t=>Object.assign(Object.assign({},t),{[Re]:"function"==typeof e?e(t[Re]||d):e})))}),[Re]);return i.useEffect((()=>{Ce(!1)}),[null==k?void 0:k.font]),i.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if("undefined"!=typeof window&&R&&!Pe&&(null==k?void 0:k.font)&&"Real Head Pro"!==k.font)try{(yield Promise.resolve().then((function(){return l(require("webfontloader"))}))).default.load({google:{families:[k.font]},active:()=>{Ce(!0)},inactive:()=>{console.error("[pxe] failed to load font {styles.font}"),Ce(!0)}})}catch(e){console.error("[pxe] failed to load font:",e),Ce(!0)}}))}),[R,Pe,null==k?void 0:k.font]),i.useEffect((()=>{ne(m)}),[m]),t.jsx(c.Provider,Object.assign({value:Object.assign(Object.assign({origin:g,contextId:J,pickaxeId:K,sessionId:$,lastSessionId:te,sender:oe,senderType:re,portalId:b,deploymentId:y,deploymentType:v,validationStatus:de,validationUpgradeGroups:ue,validationUpgradeUrl:fe,deploymentDimensions:w,deploymentMisc:S,accessGroup:ae,pickaxe:ve,selectedModel:Se,setSelectedModel:ke,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},k),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},P),misc:I,translations:Object.assign({"form-next":"Next","form-progress":"Form progress","form-page-progress":"Question {current} of {total}","action-confirmation-needed":"Confirmation needed","action-confirmation-unavailable":"Confirmation unavailable","action-approved":"Approved","action-declined":"Declined","action-expired":"Expired","action-not-run":"Not run","action-label":"Action: {name}","action-confirmation-description":"Review this action before it runs. Your decision applies only to this call.","action-inputs":"Action inputs","decline-action":"Decline","approve-action":"Approve action","action-confirmation-resolved":"This confirmation has expired or already been resolved.","action-decision-failed":"Could not save your decision. Please try again.","ai-model":"AI model","default-ai-model":"Default ({model})","attach-files":"Attach files","new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website",copy:"Copy","file-limit-reached":"You have reached the file limit.","something-wrong-occured":"Something wrong occurred",save:"Save","save-as":"Save as","please-enter-email-to-continue":"Please enter your email to continue:","enter-email-to-continue":"Enter here your email to continue",submit:"Submit",sending:"Sending...","check-your-inbox":"Check your inbox","we-sent-your-an-activation-link":"We sent you an activation link. Please be sure to check your spam folder too.",resend:"Resend",resending:"Resending...","enter-verification-code":"Or enter the 6-digit code from the email","verification-code-session-missing":"Your login request could not be found. Please resend the email.","verification-code-invalid":"Invalid verification code.",verifying:"Verifying...",verify:"Verify","chat-history":"Chat History","exit-chat-history":"Exit Chat History","no-history":"No history yet.","mcp-use-with-ai-app":"Use with an AI app","mcp-use-agent-in-ai-app":"Use this agent in your AI app","mcp-connect-description":"Connect through MCP. Requests will be sent as your signed-in Studio user.","mcp-ai-app":"AI app","mcp-copy-configuration":"Copy MCP configuration","mcp-private-configuration-note":"Keep this configuration private. It contains your Studio session token and stops working when that session expires.","log-out":"Log Out","clear-form":"Clear form","form.clear-form":"Clear form",expand:"Expand","expand-artifact":"Expand artifact",collapse:"Collapse","collapse-artifact":"Collapse artifact",close:"Close","close-artifact":"Close artifact",download:"Download","copy-artifact-content":"Copy artifact content","download-artifact-content":"Download artifact content","delete-confirm":"Are you sure you want to delete this conversation?",other:"Other","select-options":"Select option(s)","select-an-option":"Select an option","type-your-answer":"Type your answer...",cancel:"Cancel","rename-chat":"Rename chat","delete-chat":"Delete chat","conversation-name":"Conversation name","not-available":"n/a","open-chat":"Open Chat",copied:"Copied!","copy-assistant-message":"Copy assistant message","failed-delete-conversation":"Failed to delete conversation.","failed-update-name":"Failed to update name.","failed-rename-chat":"Failed to rename chat.","failed-delete-chat":"Failed to delete chat.","drop-files-to-upload":"Drop files to upload","add-anything-to-the-conversation":"Add anything to the conversation","something-went-wrong-please-try-again":"Something went wrong. Please try again, or","contact-us":"contact us","for-help":"for help.",back:"Back","upgrade-required":"Upgrade Required","please-upgrade-to-continue-using-this-tool":"Please upgrade to continue using this tool.","access-locked":"Access Locked","this-tool-is-locked-contact-owner":"This tool is locked to use. Contact owner for more information.","access-denied":"Access Denied","login-is-required":"Login is required.","no-access-request-access":"It looks like you don't have access to these resources. Please request access to continue.","request-access":"Request Access",or:"or","sign-in-with-different-account":"Sign in with a different account","access-requested-successfully":"Successfully requested access!","open-tool":"Open Tool","fab-icon":"FAB Icon","iframe-artifact-fallback":"Iframe is not supported, please view this artifact in a browser that supports it.","html-preview":"HTML preview","image-link-is-broken":"[Image link is broken]","download-video":"Download Video","available-plans":"Available Plans",buy:"Buy",credits:"Credits",uses:"Uses",credits_upper:"CREDITS",uses_upper:"USES",free:"Free","pricing.free":"Free",unlimited:"Unlimited","pricing.unlimited":"Unlimited","authentication-required":"Authentication Required","smithery-auth-description-prefix":"The tool you are trying to use requires authentication with",dismiss:"Dismiss",connect:"Connect",connecting:"Connecting...","auth-failed":"Auth failed","failed-to-finalize-authentication":"Failed to finalize authentication.","must-be-logged-in-to-connect-smithery":"You must be logged in to connect Smithery MCPs.","feedback-dislike-input-placeholder":"Write here...","feedback-submit":"Submit","feedback-thanks":"Thanks for the feedback!","feedback-like-title":"What went right?","feedback-dislike-title":"What went wrong?","feedback-dislike-message":"Help us improve our answers","what-do-you-want-to-talk-about":"What do you want to talk about?","failed-to-start-generation":"Failed to start generation","response-too-long":"One or more of your responses is too long!","required-fields-missing":"You must fill out all required fields.","something-went-wrong":"Something went wrong.","something-went-wrong-try-again":"Something went wrong, please try again.","high-traffic-try-again-later":"Oops! We're experiencing high traffic at the moment. Please try again later.","queue-message":"Queue message","stop-response":"Stop response",steer:"Steer","steer-with":"Steer with",steering:"Steering...",starting:"Starting...","remove-queued-message":"Remove queued message","edit-message":"Edit message","more-options":"More options","failed-to-interrupt-current-response":"Failed to interrupt the current response.","current-response-still-stopping":"The current response is still stopping. Please send your message again in a moment.","queued-message-waiting":"A queued message is waiting for the previous response to finish.",listening:"Listening...",remaining:"remaining",upgrade:"Upgrade","pricing.upgrade":"Upgrade","email-address-cannot-be-empty":"Email address cannot be empty.","please-enter-valid-email-address":"Please enter a valid email address.","failed-to-send-sign-in-link":"Failed to send sign-in link.",tool:"Tool","document-processing-failed":"Document processing failed","invalid-upload-file-types":"You can only upload PDF, TXT, DOCX, CSV, XLSX, JSON, PPTX, MD, HTML, XML, PNG, JPEG, WEBP, GIF, or M4A files. Please try again.","invalid-website-or-youtube-link":"Please paste a valid website URL or Youtube video link to add to the knowledge base.","website-processing-failed":"Website processing failed, please try again.","invalid-website-url":"Please paste a valid website URL","document-upload-required":"Please paste a valid website/video link or drag a file to add to the knowledge base.",thinking:"Thinking...",thought:"Thought","thought-for":"Thought for",seconds:"seconds","untitled-artifact":"Untitled Artifact",created:"Created",updated:"Updated",rewrote:"Rewrote",artifact:"Artifact","iframe-not-supported-use-different-browser":"Iframe not supported, use a different browser."},x),artifact:A,renderResponseAction:p,renderEmbedHeaderAction:f,responsiveBy:F,locale:q,opacity:O,forceMobile:j,loadFont:R,disableHtml:D,disableJs:T,disableCss:E,isFontLoaded:Pe,isNewChat:Ie,isShowIceBreaker:Ae,isShowFeedbackMessage:qe,isRtl:U,isEmbed:M,mcpEnabled:L,mcpInitiallyOpen:G,mcpGuestId:H,mcpDialog:je[Re]||d,setMCPDialog:Ue,mcpInitiallyOpenedDeployments:Te,mcpPreparingDeployments:Ee,isDropShadow:_,allowGuestUsage:B,persistActiveConversation:N,clientSecret:ye,stripeAccountId:me,preventInitialSessionId:V,setClientSecret:be,setStripeAccountId:he,setContextId:Q,setValidationStatus:ce,setValidationUpgradeGroups:pe,setValidationUpgradeUrl:ge,setPickaxeId:Z,setSessionId:e=>{ee((t=>{const i="function"==typeof e?e(t):e;return null==z||z(i),i}))},setLastSessionId:ie,setSender:ne,setSenderType:le,setAccessGroup:se,setPickaxe:we,setIsFontLoaded:Ce,setIsNewChat:xe,setIsShowIceBreaker:Fe,setIsShowFeedbackMessage:Oe},Y&&{onUpgrade:Y}),X&&{onGenerateComplete:X})},{children:t.jsx(r.default,Object.assign({initialToken:W},{children:t.jsx(n.default,{children:t.jsx(a.default,Object.assign({limits:C},{children:t.jsx(s.default,{children:t.jsx(o.ArtifactProvider,Object.assign({},A,{children:u}))})}))})}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),a=require("react"),t=require("copy-to-clipboard"),r=require("framer-motion"),i=require("../../Icons/terminal.svg.js"),o=require("../../Icons/copy.svg.js"),n=require("../../Icons/check.svg.js"),c=require("../../Icons/chevron-down.svg.js"),l=require("../../../common/api/utils.js"),d=require("../../../common/api/api.js"),u=require("../../../common/utils.js"),p=require("../../Core/Modal/index.js"),m=require("../../Core/Modal/Body.js"),h=require("../../Core/Modal/CloseButton.js"),g=require("../../../hooks/pickaxe/usePickaxeContext.js"),b=require("../../../hooks/studio/useStyleFontSize.js"),j=require("../Addons/Auth/hooks/useAuthContext.js"),x=require("./PickaxeSimpleButton.js");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=y(t);const v={codex:"Codex",claude:"Claude Code",cursor:"Cursor",vscode:"VS Code",other:"Other"};exports.default=()=>{const{colors:t,styles:y,deploymentId:C,deploymentType:O,mcpEnabled:k,mcpInitiallyOpen:w,mcpGuestId:N,mcpDialog:I,setMCPDialog:q,mcpInitiallyOpenedDeployments:P,mcpPreparingDeployments:$,pickaxeId:A,sender:R,translations:M}=g.usePickaxeContext(),{token:S,isAuthBootstrapComplete:_}=j.useAuthContext(),z=b.useStyleFontSize(),{isOpen:E,guestToken:T,isPreparing:U,prepareError:B}=I,[L,D]=a.useState(!1),[F,G]=a.useState(!1),[J,W]=a.useState("codex"),H=(e,s)=>{var a;return null!==(a=null==M?void 0:M[e])&&void 0!==a?a:s},K=a.useMemo((()=>{if(!C)return"";const e=process.env.NEXT_PUBLIC_API_MCP_URL||"https://mcp.pickaxe.co",s=new URL(e),a=s.pathname.replace(/\/+$/,"");return s.pathname=a.endsWith("/deployment")?a:`${a}/deployment`,s.searchParams.set("id",C),s.toString()}),[C]),V=S||T,X=a.useMemo((()=>{if(!V)return"";const e=`Bearer ${V}`;return"codex"===J?`[mcp_servers.pickaxe]\nurl = "${K}"\nhttp_headers = { Authorization = "${e}" }`:"claude"===J?`claude mcp add --transport http --scope user pickaxe "${K}" --header "Authorization: ${e}"`:"vscode"===J?JSON.stringify({servers:{pickaxe:{type:"http",url:K,headers:{Authorization:e}}}},null,2):"cursor"===J?JSON.stringify({mcpServers:{pickaxe:{url:K,headers:{Authorization:e}}}},null,2):`URL: ${K}\nAuthorization: ${e}`}),[J,K,V]),Q=a.useCallback((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(k&&C&&(q((e=>Object.assign(Object.assign({},e),{isOpen:!0}))),!V&&!$.has(C))){$.add(C),q((e=>Object.assign(Object.assign({},e),{isPreparing:!0,prepareError:!1})));try{const e=N||R||u.initializeEmbedUserId(),s=yield l.default.post("/pickaxe/mcp-session",{deploymentId:C,guestId:e});if(!s.data.success||!s.data.token)throw new Error("Guest MCP session was not created");q((e=>Object.assign(Object.assign({},e),{guestToken:s.data.token})))}catch(e){console.error("[pxe] failed to prepare MCP configuration",e),q((e=>Object.assign(Object.assign({},e),{prepareError:!0})))}finally{$.delete(C),q((e=>Object.assign(Object.assign({},e),{isPreparing:!1})))}}}))),[C,k,N,$,R,V,q]);if(a.useEffect((()=>{w&&k&&C&&_&&!P.has(C)&&(P.add(C),Q())}),[C,_,k,w,P,Q]),!k||!C)return null;return s.jsxs(s.Fragment,{children:[s.jsxs("div",Object.assign({className:"relative"},{children:[s.jsxs(x.default,Object.assign({className:"h-8 w-8 shrink-0 justify-center rounded-full",color:t.accent,onClick:()=>{P.add(C),d.api2.post("/track",{event:"useWithAIAppClick",guestId:N||R||u.initializeEmbedUserId(),metadata:{pickaxeId:A,deploymentId:C,deploymentType:O||"unknown",surface:"react"}}).catch((()=>{})),Q()},onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1)},{children:[s.jsx(i.default,{className:"h-5 w-5"}),s.jsx("span",Object.assign({className:"sr-only"},{children:H("mcp-use-with-ai-app","Use with an AI app")}))]})),s.jsx(r.AnimatePresence,{children:L?s.jsx(r.motion.div,Object.assign({className:"absolute right-0 top-10 z-20 w-max rounded px-3 py-2 text-xs font-medium",style:{background:t.accent,color:t.accentText},initial:{opacity:0,y:-8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}},{children:H("mcp-use-with-ai-app","Use with an AI app")})):null})]})),s.jsx(p.default,Object.assign({isOpen:E,onChange:e=>q((s=>Object.assign(Object.assign({},s),{isOpen:e})))},{children:s.jsx(m.default,Object.assign({portalClassName:"dark"===y.theme?"dark":void 0,wrapperClassName:"mx-4 w-[min(92vw,560px)]",className:"w-full overflow-hidden p-0",style:Object.assign({backgroundColor:t.secondary,borderColor:`${t.accent}40`,borderRadius:y.cornerRadius,color:t.secondaryText},"Real Head Pro"!==y.font&&{fontFamily:y.font})},{children:s.jsxs("div",Object.assign({className:"flex flex-col gap-5 p-6"},{children:[s.jsxs("div",Object.assign({className:"flex items-start justify-between gap-4"},{children:[s.jsxs("div",{children:[s.jsx("h2",Object.assign({className:`${z.h4} font-semibold`},{children:H("mcp-use-agent-in-ai-app","Use this agent in your AI app")})),s.jsx("p",Object.assign({className:`${z.b3} mt-1 opacity-70`},{children:H(S?"mcp-connect-description":"mcp-connect-description-guest",S?"Connect through MCP. Requests will be sent as your signed-in Studio user.":"Connect through MCP. Requests will be sent as this visitor.")}))]}),s.jsx(h.default,{className:"shrink-0"})]})),s.jsxs("label",Object.assign({className:`${z.l2} flex flex-col gap-2 font-medium`},{children:[H("mcp-ai-app","AI app"),s.jsxs("div",Object.assign({className:"relative"},{children:[s.jsx("select",Object.assign({className:"w-full appearance-none border py-2 pl-3 pr-10 outline-none",style:{backgroundColor:t.primary,borderColor:`${t.accent}40`,borderRadius:y.cornerRadius,color:t.text},value:J,onChange:e=>W(e.target.value)},{children:Object.entries(v).map((([e,a])=>s.jsx("option",Object.assign({value:e},{children:"other"===e?H("other","Other"):a}),e)))})),s.jsx(c.default,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2",style:{color:t.text}})]}))]})),U?s.jsx("div",Object.assign({className:"min-h-24 animate-pulse border p-4",role:"status",style:{backgroundColor:t.primary,borderColor:`${t.accent}40`,borderRadius:y.cornerRadius}},{children:s.jsx("span",Object.assign({className:"sr-only"},{children:H("mcp-preparing-configuration","Preparing your private configuration…")}))})):B?s.jsx("p",Object.assign({className:`${z.b3} border p-4`,style:{backgroundColor:t.primary,borderColor:`${t.accent}40`,borderRadius:y.cornerRadius,color:t.text}},{children:H("mcp-configuration-unavailable","This private configuration is unavailable. Close and try again.")})):X?s.jsxs("div",Object.assign({className:"relative min-w-0"},{children:[s.jsx("pre",Object.assign({className:"max-h-64 w-full overflow-auto whitespace-pre-wrap break-all border p-4 pr-12 text-xs",style:{backgroundColor:t.primary,borderColor:`${t.accent}40`,borderRadius:y.cornerRadius,color:t.text}},{children:X})),s.jsx("button",Object.assign({type:"button",className:"absolute right-3 top-3 border p-2 transition-opacity hover:opacity-70",style:{backgroundColor:t.accent,borderColor:t.accent,borderRadius:y.cornerRadius,color:t.accentText},"aria-label":H("mcp-copy-configuration","Copy MCP configuration"),onClick:()=>{X&&(f.default(X),G(!0),window.setTimeout((()=>G(!1)),1800))}},{children:F?s.jsx(n.default,{className:"h-4 w-4"}):s.jsx(o.default,{className:"h-4 w-4"})}))]})):null,s.jsx("p",Object.assign({className:`${z.b4} opacity-60`},{children:H("mcp-private-configuration-note","Keep this configuration private. It contains your Studio session token and stops working when that session expires.")}))]}))}))}))]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");exports.Li=({children:r})=>e.jsx("li",{children:r}),exports.Ol=({children:r})=>e.jsx("ol",{children:r}),exports.Ul=({children:r})=>e.jsx("ul",{children:r});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");exports.Li=({children:r})=>e.jsx("li",{children:r}),exports.Ol=({children:r,start:s})=>e.jsx("ol",Object.assign({start:s},{children:r})),exports.Ul=({children:r})=>e.jsx("ul",{children:r});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),s=require("react"),n=require("./hooks/usePickaxeMarkdownContext.js"),i=require("./utils/custom-plugins.js"),t=require("react-markdown"),o=require("remark-gfm"),a=require("remark-math"),l=require("rehype-katex"),c=require("rehype-raw"),u=require("./Components/A/index.js"),d=require("./Components/A/FilePreview.js"),p=require("./Components/P/index.js"),f=require("./Components/Img/index.js"),h=require("./Components/Iframe/index.js"),m=require("./Components/Code/index.js"),x=require("./Components/Headings/index.js"),g=require("./Components/List/index.js"),j=require("./Components/Table/index.js"),w=require("./Components/Others/index.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),s=require("react"),n=require("./hooks/usePickaxeMarkdownContext.js"),i=require("./utils/custom-plugins.js"),t=require("react-markdown"),o=require("remark-gfm"),a=require("remark-math"),l=require("rehype-katex"),c=require("rehype-raw"),u=require("./Components/A/index.js"),d=require("./Components/A/FilePreview.js"),p=require("./Components/P/index.js"),f=require("./Components/Img/index.js"),h=require("./Components/Iframe/index.js"),m=require("./Components/Code/index.js"),x=require("./Components/Headings/index.js"),g=require("./Components/List/index.js"),j=require("./Components/Table/index.js"),w=require("./Components/Others/index.js"),v=require("./Components/Action/index.js"),C=require("./Components/Artifact/index.js"),b=require("./Components/Others/Think.js"),k=require("../../../../common/cn.js");function q(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var P=q(t),R=q(o),y=q(a),S=q(l),O=q(c);exports.PickaxeMarkdownRenderer=({className:t,style:o,children:a,value:l,maxLines:c,maxChars:q,multiLineBreaks:$,onExpandClick:A,filePreviewSeenRef:U,suppressedRichPreviewUrls:H})=>{const{colors:M,rtl:T,disableHtml:E,disableJs:I,disableCss:_}=n.usePickaxeMarkdownContext(),[N,F]=s.useState({width:0,height:0}),[L,B]=s.useState(null),z=s.useRef(null),D=s.useMemo((()=>{if(!l)return"";if(E)return l;let e=l.trim();return e=e.replace(/<!--[\s\S]*?-->/g,""),e=e.replace(/\u200B/g,""),e=e.replace(/\\\((.*?)\\\)/g,"$$$ $1 $$$"),e=e.replace(/\\\[(.*?)\\\]/g,"$$$ $1 $$$"),e=e.replace(/<\/think>/g,"\n</think>"),$&&(e=e.replace(/```[\s\S]*?```|(\n(?=\n))/g,((e,r)=>r?"\n\n<br/>\n":e))),e||""}),[l,$,E]);s.useEffect((()=>{if(q)return void B(D.length>q?D.slice(0,q)+'<span class="pxe-expand-btn">...</span>':null);if(!c)return void B(null);if(!z.current||!D||L)return;const e=z.current,r=parseInt(window.getComputedStyle(e).lineHeight,10),s=c*r;if(!(N.height>s))return;const n=Math.floor(N.width/8),i=Math.floor(n*c);B(D.slice(0,i)+'<span class="pxe-expand-btn">...</span>')}),[D,c,q,N,L]);const J=s.useRef(new Set);U||(J.current=new Set);const W=null!=U?U:J,Q=s.useRef({colors:M,onExpandClick:A,filePreviewSeenRef:W,suppressedRichPreviewUrls:H});Q.current={colors:M,onExpandClick:A,filePreviewSeenRef:W,suppressedRichPreviewUrls:H};const G=s.useMemo((()=>({h1:x.H1,h2:x.H2,h3:x.H3,h4:x.H4,h5:x.H5,p:e=>r.jsx(p.P,Object.assign({},e,{suppressedRichPreviewUrls:Q.current.suppressedRichPreviewUrls})),a:e=>r.jsx(u.A,Object.assign({},e,{filePreviewSeenRef:Q.current.filePreviewSeenRef,suppressedRichPreviewUrls:Q.current.suppressedRichPreviewUrls})),img:e=>{const{colors:s,filePreviewSeenRef:n,suppressedRichPreviewUrls:i}=Q.current,t="string"==typeof e.src?e.src:"",o=d.getFilePreviewInfo(t);return o&&!d.shouldSuppressRichPreviewForUrl(o.url,i)?d.shouldRenderFilePreview(o,n)?r.jsx(d.default,{fileInfo:o,displayName:"string"==typeof e.alt?e.alt:void 0}):r.jsx("a",Object.assign({href:o.url,target:"_blank",rel:"noopener noreferrer",style:{color:s.accent}},{children:e.alt||o.fileName})):r.jsx(f.Img,Object.assign({},e))},iframe:h.Iframe,code:m.Code,ol:g.Ol,ul:g.Ul,li:g.Li,table:j.Table,th:j.Th,tr:j.Tr,td:j.Td,hr:w.Hr,br:w.Br,blockquote:w.Blockquote,span:s=>{var{children:n}=s,i=e.__rest(s,["children"]);const{colors:t,onExpandClick:o}=Q.current;return"pxe-expand-btn"===i.className?r.jsx("span",Object.assign({},i,{style:Object.assign({display:"inline",fontWeight:500,color:t.accent,marginLeft:".25rem",userSelect:"none"},o&&{cursor:"pointer"})},o&&{onClick:o},{children:n})):r.jsx("span",Object.assign({},i,{children:n}))},"action-caption":v.ActionCaption,"action-finished":v.ActionFinished,"action-error":v.ActionError,artifact:C.Artifact,"artifact-error":C.ArtifactError,think:b.Think})),[]);s.useEffect((()=>{if(!z.current)return;const e=new ResizeObserver((e=>{for(const r of e){const{width:e,height:s}=r.contentRect;F({width:e,height:s})}}));return e.observe(z.current),()=>{e.disconnect()}}),[]);const K=L||D;return r.jsxs("div",Object.assign({className:"pxe-markdown",ref:z,style:Object.assign({position:"relative",overflowWrap:"anywhere",display:"grid",gridTemplateColumns:"repeat(1, minmax(0, 1fr))",gap:".625rem",width:"100%"},o)},T&&{dir:"rtl"},{children:[r.jsx(P.default,Object.assign({className:k.default("pxe-prose",t),components:G,remarkPlugins:[R.default,[y.default,{singleDollarTextMath:!1}],[i.remarkDocumentCssAsCode,{disableCss:_}],i.remarkSmartQuotes],rehypePlugins:[i.rehypeCode,S.default,...E?[]:[O.default],[i.rehypeSanitize,{disableJs:I,disableCss:_}]]},{children:K})),a]}))};
|
package/dist/cjs/prose.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pxe-prose p:not(.pxe-artifact-create-header p){font-weight:350}.pxe-prose p:not(:only-child):not(.pxe-artifact-create-header p){margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe:not(.pxe-artifact-renderer iframe){margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-video{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-video{display:flex;justify-content:center;width:100%}.pxe-prose .pxe-markdown-code{margin-bottom:1.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px 10px 14px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{overflow:auto;position:relative}.pxe-prose .pxe-markdown-table:not(:only-child){margin-bottom:2.5rem}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child){margin-top:2.5rem}.pxe-prose h3:not(:first-child),.pxe-prose h4:not(:first-child)
|
|
1
|
+
.pxe-prose p:not(.pxe-artifact-create-header p){font-weight:350}.pxe-prose p:not(:only-child):not(.pxe-artifact-create-header p){margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe:not(.pxe-artifact-renderer iframe){margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-video{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-video{display:flex;justify-content:center;width:100%}.pxe-prose .pxe-markdown-code{margin-bottom:1.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px 10px 14px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{overflow:auto;position:relative}.pxe-prose .pxe-markdown-table:not(:only-child){margin-bottom:2.5rem}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child){margin-top:2.5rem}.pxe-prose h3:not(:first-child),.pxe-prose h4:not(:first-child){margin-top:1rem}.pxe-prose pre{max-width:100%;overflow-x:auto}.pxe-prose>pre:not(:first-child){margin-top:1rem}.pxe-prose .pxe-markdown-code{display:flex;flex-direction:column}.pxe-prose .pxe-markdown-code>div:first-child{background-color:#1d1f21;border-radius:.3em;display:flex;flex-direction:column;max-width:min-content;padding-top:1em;position:relative}.pxe-prose .pxe-markdown-code>div:first-child>div:first-child{display:flex;justify-content:flex-end;padding:0 1em}.pxe-prose .pxe-markdown-code>div:first-child>div:last-child{overflow:auto}.pxe-prose .pxe-action[data-action-id]:not(:nth-child(2)){margin-top:1rem}.pxe-prose .pxe-markdown-code-inline{background-color:#1d1f21;border-radius:.3em;color:#fff;font-size:10pt;padding:.15em .4em}.pxe-link-previews{display:flex;flex-direction:column;gap:2rem}.pxe-prose>p:first-child>.pxe-markdown-image,.pxe-prose>p:first-child>.pxe-markdown-video{margin-top:0}.pxe-prose .pxe-blink{animation:blink 1s ease-in-out infinite}.pxe-prose .pxe-red{color:red}.pxe-prose .pxe-action-error,.pxe-prose .pxe-artifact-error{display:flex;flex-direction:column}.pxe-prose .pxe-animated-token{animation:fadeIn .3s ease-out forwards;display:inline-block;opacity:0}.pxe-prose .pxe-spin{animation:spin 1s linear infinite}@keyframes fadeIn{0%{opacity:0;transform:translateX(5px)}to{opacity:1;transform:translateX(0)}}@keyframes blink{0%{opacity:1}50%{opacity:.5}to{opacity:1}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}
|
|
@@ -20,6 +20,12 @@ export type PickaxeResponseActionRenderer = (target: PickaxeResponseActionTarget
|
|
|
20
20
|
export type PickaxeTranslations = {
|
|
21
21
|
[key: string]: string;
|
|
22
22
|
};
|
|
23
|
+
type MCPDialogState = {
|
|
24
|
+
isOpen: boolean;
|
|
25
|
+
guestToken: string | null;
|
|
26
|
+
isPreparing: boolean;
|
|
27
|
+
prepareError: boolean;
|
|
28
|
+
};
|
|
23
29
|
export type PickaxeProviderStyles = {
|
|
24
30
|
theme: "light" | "dark";
|
|
25
31
|
portalTheme?: "light" | "dark";
|
|
@@ -126,7 +132,12 @@ type PickaxeContextType = {
|
|
|
126
132
|
isRtl: boolean;
|
|
127
133
|
isEmbed: boolean;
|
|
128
134
|
mcpEnabled: boolean;
|
|
135
|
+
mcpInitiallyOpen: boolean;
|
|
129
136
|
mcpGuestId?: string;
|
|
137
|
+
mcpDialog: MCPDialogState;
|
|
138
|
+
setMCPDialog: SetState<MCPDialogState>;
|
|
139
|
+
mcpInitiallyOpenedDeployments: Set<string>;
|
|
140
|
+
mcpPreparingDeployments: Set<string>;
|
|
130
141
|
isDropShadow: boolean;
|
|
131
142
|
allowGuestUsage: boolean;
|
|
132
143
|
persistActiveConversation: boolean;
|
|
@@ -182,6 +193,8 @@ export interface IPickaxeProviderProps {
|
|
|
182
193
|
isRtl?: boolean;
|
|
183
194
|
isEmbed?: boolean;
|
|
184
195
|
mcpEnabled?: boolean;
|
|
196
|
+
/** Open the MCP configuration once after authentication is ready. Requires mcpEnabled. */
|
|
197
|
+
mcpInitiallyOpen?: boolean;
|
|
185
198
|
mcpGuestId?: string;
|
|
186
199
|
studioSessionToken?: string | null;
|
|
187
200
|
isDropShadow?: boolean;
|
|
@@ -193,5 +206,5 @@ export interface IPickaxeProviderProps {
|
|
|
193
206
|
onSessionIdChange?: (sessionId: string) => void;
|
|
194
207
|
}
|
|
195
208
|
export declare const PickaxeContext: import("react").Context<PickaxeContextType>;
|
|
196
|
-
export declare const PickaxeProvider: ({ children, renderResponseAction, renderEmbedHeaderAction, origin, sender: _sender, senderType: _senderType, deploymentId, portalId, deploymentType, deploymentDimensions, deploymentMisc, styles, colors, limits, misc, translations, artifact, responsiveBy, locale, opacity, forceMobile, disableHtml, disableJs, disableCss, loadFont, isRtl, isEmbed, mcpEnabled, mcpGuestId, studioSessionToken, isDropShadow, allowGuestUsage, persistActiveConversation, preventInitialSessionId, onUpgrade, onGenerateComplete, onSessionIdChange, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
209
|
+
export declare const PickaxeProvider: ({ children, renderResponseAction, renderEmbedHeaderAction, origin, sender: _sender, senderType: _senderType, deploymentId, portalId, deploymentType, deploymentDimensions, deploymentMisc, styles, colors, limits, misc, translations, artifact, responsiveBy, locale, opacity, forceMobile, disableHtml, disableJs, disableCss, loadFont, isRtl, isEmbed, mcpEnabled, mcpInitiallyOpen, mcpGuestId, studioSessionToken, isDropShadow, allowGuestUsage, persistActiveConversation, preventInitialSessionId, onUpgrade, onGenerateComplete, onSessionIdChange, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
197
210
|
export {};
|
|
@@ -41,7 +41,22 @@ export declare const usePickaxeContext: () => {
|
|
|
41
41
|
isRtl: boolean;
|
|
42
42
|
isEmbed: boolean;
|
|
43
43
|
mcpEnabled: boolean;
|
|
44
|
+
mcpInitiallyOpen: boolean;
|
|
44
45
|
mcpGuestId?: string | undefined;
|
|
46
|
+
mcpDialog: {
|
|
47
|
+
isOpen: boolean;
|
|
48
|
+
guestToken: string | null;
|
|
49
|
+
isPreparing: boolean;
|
|
50
|
+
prepareError: boolean;
|
|
51
|
+
};
|
|
52
|
+
setMCPDialog: import("../../types/common").SetState<{
|
|
53
|
+
isOpen: boolean;
|
|
54
|
+
guestToken: string | null;
|
|
55
|
+
isPreparing: boolean;
|
|
56
|
+
prepareError: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
mcpInitiallyOpenedDeployments: Set<string>;
|
|
59
|
+
mcpPreparingDeployments: Set<string>;
|
|
45
60
|
isDropShadow: boolean;
|
|
46
61
|
allowGuestUsage: boolean;
|
|
47
62
|
persistActiveConversation: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as s}from"react/jsx-runtime";import{formatUserMessage as t}from"../../../../common/formatUserMessage.js";import{PickaxeMarkdownRenderer as i}from"../../common/PickaxeMarkdown/Renderer.js";import{Fragment as o}from"react";import{usePickaxeContext as a}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as r}from"../../../../hooks/studio/useStyleFontSize.js";import{useResponseContext as n}from"../../../../hooks/pickaxe/useResponseContext.js";import{useArtifact as m}from"../../Addons/Artifact/hooks/useArtifact.js";import{PickaxeMarkdown as l}from"../../common/PickaxeMarkdown/index.js";import c from"../../common/PickaxeIcon.js";import d from"./Document.js";import p from"../../common/PickaxeMessageActions.js";import x from"../../common/PickaxeMessageParts/index.js";import f from"../../../../common/cn.js";import{convertToIso1 as u}from"../../../../common/isoMap.js";import{franc as g}from"franc-min";import h from"../../common/ComposioConnectView.js";import b from"../../common/SmitheryConnectView.js";import{useTextToSpeech as v}from"../../../../hooks/pickaxe/useTextToSpeech.js";import j from"remove-markdown";const k=({index:k,message:y,smitheryData:w,resubmitPrompt:O,isLastMessage:N=!1})=>{var I,C;const{pickaxeId:R,pickaxe:A,styles:P,colors:S,misc:M,responsiveBy:L,disableHtml:H,disableJs:T,disableCss:J,isNewChat:V,isRtl:z}=a(),{isGenerating:B}=n(),{onLoadArtifact:D}=m(),F=r(),U=null!==(I=null==A?void 0:A.chaticon)&&void 0!==I?I:`https://cdn.mail.studio/chaticons/${R}.png`,E=N&&B,G=null==A?void 0:A.enablereadout,{isLoading:$,isSpeaking:q,speak:K,stop:Q}=v(G&&"assistant"===y.role,{provider:null==A?void 0:A.readoutprovider,pickaxeId:R,voiceName:null==A?void 0:A.readoutvoice}),W=()=>{if($||q)return void Q();const e=y.parts.filter((e=>"text"===e.type)).map((e=>e.content)).join(" ");if(!e)return;const s=j(e,{stripListLeaders:!0,listUnicodeChar:"",gfm:!0,useImgAltText:!1}),t=g(s),i=u(t);K(s,i)},X=!y.parts.some((e=>["text","reasoning","data-action-tool-caption","data-visualization"].includes(e.type)));return"assistant"===y.role?e("div",Object.assign({className:f("flex w-full",z?"justify-end":"justify-start")},{children:e("div",Object.assign({className:f("flex flex-col w-full",0===k&&V&&"viewport"===L&&"min-[767px]:max-w-[80%]",0===k&&V&&"container"===L&&"@[767px]/pickaxe-root:max-w-[80%]")},{children:s("div",Object.assign({className:f("flex gap-x-3",z&&"flex-row-reverse")},{children:[M.isChatImage&&"NONE"!==U&&e(c,{src:U,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:S.text}),s("div",Object.assign({className:f("flex flex-col flex-grow",z?"items-end":"items-start")},{children:[s("div",Object.assign({className:f(F.b2,"chat-message pt-3 w-full",z?"text-right":"text-left")},{children:[e(l,Object.assign({theme:P.theme,colors:S,isStreaming:E},z&&{rtl:!0},H&&{disableHtml:!0},T&&{disableJs:!0},J&&{disableCss:!0},{disableReasoning:null!==(C=null==A?void 0:A.enablereasoningdisplay)&&void 0!==C&&C,onArtifactClick:D},{children:e(x,{parts:y.parts,isStreaming:E})})),N&&w&&O&&("composio"===w.provider?e("div",Object.assign({className:"mt-4 px-1"},{children:e(h,{serverId:w.serverId,toolkitSlug:w.toolkitSlug||"",name:w.name,resubmitPrompt:()=>O()})})):e("div",Object.assign({className:"mt-4 px-1"},{children:e(b,{serverId:w.serverId,smitheryId:w.smitheryId||"",name:w.name||w.smitheryId,resubmitPrompt:()=>O()})})))]})),e("div",Object.assign({className:f("flex flex-col gap-6 my-4",X&&"mt-2")},{children:E?e("div",Object.assign({className:"flex items-center gap-x-2 rounded"},{children:Array.from({length:3}).map(((s,t)=>e("div",{className:f("h-1.5 w-1.5 animate-dot rounded-full",1===t&&"animate-dot-down"),style:{backgroundColor:S.secondaryText}},t)))})):e(p,Object.assign({responseReference:y.responseReference,content:y.parts.filter((e=>e.isVisible&&"text"===e.type)).map((e=>e.content)).join("\n"),index:k},"intromessage"===y.area&&{isHideFeedback:!0,isHideResponseAction:!0},{onReadOut:W,isReadOut:G||!1,isReadOutLoading:$,isReading:q}))}))]}))]}))}))})):"user"===y.role?e("div",Object.assign({className:f("flex w-full",z?"justify-start":"justify-end")},{children:e("div",Object.assign({className:f("flex gap-x-3 max-w-[80%]",z?"pr-9":"pl-9","viewport"===L?z?"min-[767px]:pr-0":"min-[767px]:pl-0":z?"@[767px]/pickaxe-root:pr-0":"@[767px]/pickaxe-root:pl-0")},{children:s("div",Object.assign({className:f(F.b2,"overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B] flex flex-col gap-y-3",z?"text-right":"text-left"),style:{backgroundColor:S.secondary+"80",color:S.secondaryText,borderRadius:P.cornerRadius}},{children:[y.documentIds&&y.documentIds.length>0&&e("div",Object.assign({className:f("flex flex-col gap-y-2",z?"items-start":"items-end")},{children:y.documentIds.map((s=>e(o,{children:e(d,{documentId:s})},s)))})),e(l,Object.assign({theme:P.theme,colors:S},z&&{rtl:!0},{disableHtml:!0,disableJs:!0,disableCss:!0},{children:y.parts.map(((s,o)=>"text"===s.type?e(i,{value:t(s.content)},o):null))}))]}))}))})):e("div",{})};export{k as default};
|
|
1
|
+
import{jsx as e,jsxs as s}from"react/jsx-runtime";import{formatUserMessage as t}from"../../../../common/formatUserMessage.js";import{PickaxeMarkdownRenderer as i}from"../../common/PickaxeMarkdown/Renderer.js";import{Fragment as o}from"react";import{usePickaxeContext as a}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as r}from"../../../../hooks/studio/useStyleFontSize.js";import{useResponseContext as n}from"../../../../hooks/pickaxe/useResponseContext.js";import{useArtifact as m}from"../../Addons/Artifact/hooks/useArtifact.js";import{PickaxeMarkdown as l}from"../../common/PickaxeMarkdown/index.js";import c from"../../common/PickaxeIcon.js";import d from"./Document.js";import p from"../../common/PickaxeMessageActions.js";import x from"../../common/PickaxeMessageParts/index.js";import f from"../../../../common/cn.js";import{convertToIso1 as u}from"../../../../common/isoMap.js";import{franc as g}from"franc-min";import h from"../../common/ComposioConnectView.js";import b from"../../common/SmitheryConnectView.js";import{useTextToSpeech as v}from"../../../../hooks/pickaxe/useTextToSpeech.js";import j from"remove-markdown";const k=({index:k,message:y,smitheryData:w,resubmitPrompt:O,isLastMessage:N=!1})=>{var I,C;const{pickaxeId:R,pickaxe:A,styles:P,colors:S,misc:M,responsiveBy:L,disableHtml:H,disableJs:T,disableCss:J,isNewChat:V,isRtl:z}=a(),{isGenerating:B}=n(),{onLoadArtifact:D}=m(),F=r(),U=null!==(I=null==A?void 0:A.chaticon)&&void 0!==I?I:`https://cdn.mail.studio/chaticons/${R}.png`,E=N&&B,G=null==A?void 0:A.enablereadout,{isLoading:$,isSpeaking:q,speak:K,stop:Q}=v(G&&"assistant"===y.role,{provider:null==A?void 0:A.readoutprovider,pickaxeId:R,voiceName:null==A?void 0:A.readoutvoice}),W=()=>{if($||q)return void Q();const e=y.parts.filter((e=>"text"===e.type)).map((e=>e.content)).join(" ");if(!e)return;const s=j(e,{stripListLeaders:!0,listUnicodeChar:"",gfm:!0,useImgAltText:!1}),t=g(s),i=u(t);K(s,i)},X=!y.parts.some((e=>["text","reasoning","data-action-tool-caption","data-visualization"].includes(e.type)));return"assistant"===y.role?e("div",Object.assign({className:f("flex w-full",z?"justify-end":"justify-start")},{children:e("div",Object.assign({className:f("flex flex-col w-full",0===k&&V&&"viewport"===L&&"min-[767px]:max-w-[80%]",0===k&&V&&"container"===L&&"@[767px]/pickaxe-root:max-w-[80%]")},{children:s("div",Object.assign({className:f("flex gap-x-3",z&&"flex-row-reverse")},{children:[M.isChatImage&&"NONE"!==U&&e(c,{src:U,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:S.text}),s("div",Object.assign({className:f("flex min-w-0 flex-col flex-grow",z?"items-end":"items-start")},{children:[s("div",Object.assign({className:f(F.b2,"chat-message pt-3 w-full",z?"text-right":"text-left")},{children:[e(l,Object.assign({theme:P.theme,colors:S,isStreaming:E},z&&{rtl:!0},H&&{disableHtml:!0},T&&{disableJs:!0},J&&{disableCss:!0},{disableReasoning:null!==(C=null==A?void 0:A.enablereasoningdisplay)&&void 0!==C&&C,onArtifactClick:D},{children:e(x,{parts:y.parts,isStreaming:E})})),N&&w&&O&&("composio"===w.provider?e("div",Object.assign({className:"mt-4 px-1"},{children:e(h,{serverId:w.serverId,toolkitSlug:w.toolkitSlug||"",name:w.name,resubmitPrompt:()=>O()})})):e("div",Object.assign({className:"mt-4 px-1"},{children:e(b,{serverId:w.serverId,smitheryId:w.smitheryId||"",name:w.name||w.smitheryId,resubmitPrompt:()=>O()})})))]})),e("div",Object.assign({className:f("flex flex-col gap-6 my-4",X&&"mt-2")},{children:E?e("div",Object.assign({className:"flex items-center gap-x-2 rounded"},{children:Array.from({length:3}).map(((s,t)=>e("div",{className:f("h-1.5 w-1.5 animate-dot rounded-full",1===t&&"animate-dot-down"),style:{backgroundColor:S.secondaryText}},t)))})):e(p,Object.assign({responseReference:y.responseReference,content:y.parts.filter((e=>e.isVisible&&"text"===e.type)).map((e=>e.content)).join("\n"),index:k},"intromessage"===y.area&&{isHideFeedback:!0,isHideResponseAction:!0},{onReadOut:W,isReadOut:G||!1,isReadOutLoading:$,isReading:q}))}))]}))]}))}))})):"user"===y.role?e("div",Object.assign({className:f("flex w-full",z?"justify-start":"justify-end")},{children:e("div",Object.assign({className:f("flex gap-x-3 max-w-[80%]",z?"pr-9":"pl-9","viewport"===L?z?"min-[767px]:pr-0":"min-[767px]:pl-0":z?"@[767px]/pickaxe-root:pr-0":"@[767px]/pickaxe-root:pl-0")},{children:s("div",Object.assign({className:f(F.b2,"overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B] flex flex-col gap-y-3",z?"text-right":"text-left"),style:{backgroundColor:S.secondary+"80",color:S.secondaryText,borderRadius:P.cornerRadius}},{children:[y.documentIds&&y.documentIds.length>0&&e("div",Object.assign({className:f("flex flex-col gap-y-2",z?"items-start":"items-end")},{children:y.documentIds.map((s=>e(o,{children:e(d,{documentId:s})},s)))})),e(l,Object.assign({theme:P.theme,colors:S},z&&{rtl:!0},{disableHtml:!0,disableJs:!0,disableCss:!0},{children:y.parts.map(((s,o)=>"text"===s.type?e(i,{value:t(s.content)},o):null))}))]}))}))})):e("div",{})};export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";import{createContext as i,useState as o,useEffect as n}from"react";import{ArtifactProvider as a}from"./Addons/Artifact/Provider.js";import s from"./DimensionProvider.js";import r from"./ResponseProvider.js";import d from"./Addons/Document/Provider.js";import l from"./Addons/Auth/Provider.js";const c=i({}),p=({children:i,renderResponseAction:p,renderEmbedHeaderAction:u,origin:m,sender:g,senderType:f,deploymentId:h,portalId:y,deploymentType:b,deploymentDimensions:v,deploymentMisc:w,styles:k,colors:S,limits:C={},misc:I={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0,isResponseDownload:!1},translations:P,artifact:A={popupType:"auto"},responsiveBy:F="viewport",locale:x="en",opacity:T=1,forceMobile:D=!1,disableHtml:U=!1,disableJs:q=!1,disableCss:R=!1,loadFont:E=!0,isRtl:O=!1,isEmbed:M=!1,mcpEnabled:j=!1,mcpGuestId:L,studioSessionToken:G,isDropShadow:H=!1,allowGuestUsage:W=!0,persistActiveConversation:B=!1,preventInitialSessionId:N=!1,onUpgrade:V,onGenerateComplete:Y,onSessionIdChange:X})=>{const[J,_]=o(""),[z,Q]=o(""),[K,Z]=o(""),[$,ee]=o(""),[te,ie]=o(g),[oe,ne]=o(null),[ae,se]=o(f),[re,de]=o("loading"),[le,ce]=o([]),[pe,ue]=o(null),[me,ge]=o(null),[fe,he]=o(null),[ye,be]=o(null),[ve,we]=o("");n((()=>we("")),[z]);const[ke,Se]=o(!1),[Ce,Ie]=o(!0),[Pe,Ae]=o(!0),[Fe,xe]=o(!1);return n((()=>{Se(!1)}),[null==k?void 0:k.font]),n((()=>{e(void 0,void 0,void 0,(function*(){if("undefined"!=typeof window&&E&&!ke&&(null==k?void 0:k.font)&&"Real Head Pro"!==k.font)try{(yield import("webfontloader")).default.load({google:{families:[k.font]},active:()=>{Se(!0)},inactive:()=>{console.error("[pxe] failed to load font {styles.font}"),Se(!0)}})}catch(e){console.error("[pxe] failed to load font:",e),Se(!0)}}))}),[E,ke,null==k?void 0:k.font]),n((()=>{ie(g)}),[g]),t(c.Provider,Object.assign({value:Object.assign(Object.assign({origin:m,contextId:J,pickaxeId:z,sessionId:K,lastSessionId:$,sender:te,senderType:ae,portalId:y,deploymentId:h,deploymentType:b,validationStatus:re,validationUpgradeGroups:le,validationUpgradeUrl:pe,deploymentDimensions:v,deploymentMisc:w,accessGroup:oe,pickaxe:ye,selectedModel:ve,setSelectedModel:we,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},k),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},S),misc:I,translations:Object.assign({"form-next":"Next","form-progress":"Form progress","form-page-progress":"Question {current} of {total}","action-confirmation-needed":"Confirmation needed","action-confirmation-unavailable":"Confirmation unavailable","action-approved":"Approved","action-declined":"Declined","action-expired":"Expired","action-not-run":"Not run","action-label":"Action: {name}","action-confirmation-description":"Review this action before it runs. Your decision applies only to this call.","action-inputs":"Action inputs","decline-action":"Decline","approve-action":"Approve action","action-confirmation-resolved":"This confirmation has expired or already been resolved.","action-decision-failed":"Could not save your decision. Please try again.","ai-model":"AI model","default-ai-model":"Default ({model})","attach-files":"Attach files","new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website",copy:"Copy","file-limit-reached":"You have reached the file limit.","something-wrong-occured":"Something wrong occurred",save:"Save","save-as":"Save as","please-enter-email-to-continue":"Please enter your email to continue:","enter-email-to-continue":"Enter here your email to continue",submit:"Submit",sending:"Sending...","check-your-inbox":"Check your inbox","we-sent-your-an-activation-link":"We sent you an activation link. Please be sure to check your spam folder too.",resend:"Resend",resending:"Resending...","enter-verification-code":"Or enter the 6-digit code from the email","verification-code-session-missing":"Your login request could not be found. Please resend the email.","verification-code-invalid":"Invalid verification code.",verifying:"Verifying...",verify:"Verify","chat-history":"Chat History","exit-chat-history":"Exit Chat History","no-history":"No history yet.","mcp-use-with-ai-app":"Use with an AI app","mcp-use-agent-in-ai-app":"Use this agent in your AI app","mcp-connect-description":"Connect through MCP. Requests will be sent as your signed-in Studio user.","mcp-ai-app":"AI app","mcp-copy-configuration":"Copy MCP configuration","mcp-private-configuration-note":"Keep this configuration private. It contains your Studio session token and stops working when that session expires.","log-out":"Log Out","clear-form":"Clear form","form.clear-form":"Clear form",expand:"Expand","expand-artifact":"Expand artifact",collapse:"Collapse","collapse-artifact":"Collapse artifact",close:"Close","close-artifact":"Close artifact",download:"Download","copy-artifact-content":"Copy artifact content","download-artifact-content":"Download artifact content","delete-confirm":"Are you sure you want to delete this conversation?",other:"Other","select-options":"Select option(s)","select-an-option":"Select an option","type-your-answer":"Type your answer...",cancel:"Cancel","rename-chat":"Rename chat","delete-chat":"Delete chat","conversation-name":"Conversation name","not-available":"n/a","open-chat":"Open Chat",copied:"Copied!","copy-assistant-message":"Copy assistant message","failed-delete-conversation":"Failed to delete conversation.","failed-update-name":"Failed to update name.","failed-rename-chat":"Failed to rename chat.","failed-delete-chat":"Failed to delete chat.","drop-files-to-upload":"Drop files to upload","add-anything-to-the-conversation":"Add anything to the conversation","something-went-wrong-please-try-again":"Something went wrong. Please try again, or","contact-us":"contact us","for-help":"for help.",back:"Back","upgrade-required":"Upgrade Required","please-upgrade-to-continue-using-this-tool":"Please upgrade to continue using this tool.","access-locked":"Access Locked","this-tool-is-locked-contact-owner":"This tool is locked to use. Contact owner for more information.","access-denied":"Access Denied","login-is-required":"Login is required.","no-access-request-access":"It looks like you don't have access to these resources. Please request access to continue.","request-access":"Request Access",or:"or","sign-in-with-different-account":"Sign in with a different account","access-requested-successfully":"Successfully requested access!","open-tool":"Open Tool","fab-icon":"FAB Icon","iframe-artifact-fallback":"Iframe is not supported, please view this artifact in a browser that supports it.","html-preview":"HTML preview","image-link-is-broken":"[Image link is broken]","download-video":"Download Video","available-plans":"Available Plans",buy:"Buy",credits:"Credits",uses:"Uses",credits_upper:"CREDITS",uses_upper:"USES",free:"Free","pricing.free":"Free",unlimited:"Unlimited","pricing.unlimited":"Unlimited","authentication-required":"Authentication Required","smithery-auth-description-prefix":"The tool you are trying to use requires authentication with",dismiss:"Dismiss",connect:"Connect",connecting:"Connecting...","auth-failed":"Auth failed","failed-to-finalize-authentication":"Failed to finalize authentication.","must-be-logged-in-to-connect-smithery":"You must be logged in to connect Smithery MCPs.","feedback-dislike-input-placeholder":"Write here...","feedback-submit":"Submit","feedback-thanks":"Thanks for the feedback!","feedback-like-title":"What went right?","feedback-dislike-title":"What went wrong?","feedback-dislike-message":"Help us improve our answers","what-do-you-want-to-talk-about":"What do you want to talk about?","failed-to-start-generation":"Failed to start generation","response-too-long":"One or more of your responses is too long!","required-fields-missing":"You must fill out all required fields.","something-went-wrong":"Something went wrong.","something-went-wrong-try-again":"Something went wrong, please try again.","high-traffic-try-again-later":"Oops! We're experiencing high traffic at the moment. Please try again later.","queue-message":"Queue message","stop-response":"Stop response",steer:"Steer","steer-with":"Steer with",steering:"Steering...",starting:"Starting...","remove-queued-message":"Remove queued message","edit-message":"Edit message","more-options":"More options","failed-to-interrupt-current-response":"Failed to interrupt the current response.","current-response-still-stopping":"The current response is still stopping. Please send your message again in a moment.","queued-message-waiting":"A queued message is waiting for the previous response to finish.",listening:"Listening...",remaining:"remaining",upgrade:"Upgrade","pricing.upgrade":"Upgrade","email-address-cannot-be-empty":"Email address cannot be empty.","please-enter-valid-email-address":"Please enter a valid email address.","failed-to-send-sign-in-link":"Failed to send sign-in link.",tool:"Tool","document-processing-failed":"Document processing failed","invalid-upload-file-types":"You can only upload PDF, TXT, DOCX, CSV, XLSX, JSON, PPTX, MD, HTML, XML, PNG, JPEG, WEBP, GIF, or M4A files. Please try again.","invalid-website-or-youtube-link":"Please paste a valid website URL or Youtube video link to add to the knowledge base.","website-processing-failed":"Website processing failed, please try again.","invalid-website-url":"Please paste a valid website URL","document-upload-required":"Please paste a valid website/video link or drag a file to add to the knowledge base.",thinking:"Thinking...",thought:"Thought","thought-for":"Thought for",seconds:"seconds","untitled-artifact":"Untitled Artifact",created:"Created",updated:"Updated",rewrote:"Rewrote",artifact:"Artifact","iframe-not-supported-use-different-browser":"Iframe not supported, use a different browser."},P),artifact:A,renderResponseAction:p,renderEmbedHeaderAction:u,responsiveBy:F,locale:x,opacity:T,forceMobile:D,loadFont:E,disableHtml:U,disableJs:q,disableCss:R,isFontLoaded:ke,isNewChat:Ce,isShowIceBreaker:Pe,isShowFeedbackMessage:Fe,isRtl:O,isEmbed:M,mcpEnabled:j,mcpGuestId:L,isDropShadow:H,allowGuestUsage:W,persistActiveConversation:B,clientSecret:fe,stripeAccountId:me,preventInitialSessionId:N,setClientSecret:he,setStripeAccountId:ge,setContextId:_,setValidationStatus:de,setValidationUpgradeGroups:ce,setValidationUpgradeUrl:ue,setPickaxeId:Q,setSessionId:e=>{Z((t=>{const i="function"==typeof e?e(t):e;return null==X||X(i),i}))},setLastSessionId:ee,setSender:ie,setSenderType:se,setAccessGroup:ne,setPickaxe:be,setIsFontLoaded:Se,setIsNewChat:Ie,setIsShowIceBreaker:Ae,setIsShowFeedbackMessage:xe},V&&{onUpgrade:V}),Y&&{onGenerateComplete:Y})},{children:t(l,Object.assign({initialToken:G},{children:t(s,{children:t(r,Object.assign({limits:C},{children:t(d,{children:t(a,Object.assign({},A,{children:i}))})}))})}))}))};export{c as PickaxeContext,p as PickaxeProvider};
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";import{createContext as i,useState as o,useEffect as n,useRef as a,useCallback as s}from"react";import{ArtifactProvider as r}from"./Addons/Artifact/Provider.js";import l from"./DimensionProvider.js";import d from"./ResponseProvider.js";import c from"./Addons/Document/Provider.js";import p from"./Addons/Auth/Provider.js";const u={isOpen:!1,guestToken:null,isPreparing:!1,prepareError:!1},m=i({}),g=({children:i,renderResponseAction:g,renderEmbedHeaderAction:f,origin:h,sender:y,senderType:b,deploymentId:v,portalId:w,deploymentType:k,deploymentDimensions:S,deploymentMisc:C,styles:I,colors:P,limits:A={},misc:F={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0,isResponseDownload:!1},translations:x,artifact:T={popupType:"auto"},responsiveBy:D="viewport",locale:O="en",opacity:U=1,forceMobile:q=!1,disableHtml:R=!1,disableJs:E=!1,disableCss:j=!1,loadFont:M=!0,isRtl:L=!1,isEmbed:G=!1,mcpEnabled:H=!1,mcpInitiallyOpen:W=!1,mcpGuestId:B,studioSessionToken:N,isDropShadow:V=!1,allowGuestUsage:Y=!0,persistActiveConversation:X=!1,preventInitialSessionId:J=!1,onUpgrade:_,onGenerateComplete:z,onSessionIdChange:Q})=>{const[K,Z]=o(""),[$,ee]=o(""),[te,ie]=o(""),[oe,ne]=o(""),[ae,se]=o(y),[re,le]=o(null),[de,ce]=o(b),[pe,ue]=o("loading"),[me,ge]=o([]),[fe,he]=o(null),[ye,be]=o(null),[ve,we]=o(null),[ke,Se]=o(null),[Ce,Ie]=o("");n((()=>Ie("")),[$]);const[Pe,Ae]=o(!1),[Fe,xe]=o(!0),[Te,De]=o(!0),[Oe,Ue]=o(!1),[qe,Re]=o({}),Ee=a(new Set).current,je=a(new Set).current,Me=v||"",Le=s((e=>{Re((t=>Object.assign(Object.assign({},t),{[Me]:"function"==typeof e?e(t[Me]||u):e})))}),[Me]);return n((()=>{Ae(!1)}),[null==I?void 0:I.font]),n((()=>{e(void 0,void 0,void 0,(function*(){if("undefined"!=typeof window&&M&&!Pe&&(null==I?void 0:I.font)&&"Real Head Pro"!==I.font)try{(yield import("webfontloader")).default.load({google:{families:[I.font]},active:()=>{Ae(!0)},inactive:()=>{console.error("[pxe] failed to load font {styles.font}"),Ae(!0)}})}catch(e){console.error("[pxe] failed to load font:",e),Ae(!0)}}))}),[M,Pe,null==I?void 0:I.font]),n((()=>{se(y)}),[y]),t(m.Provider,Object.assign({value:Object.assign(Object.assign({origin:h,contextId:K,pickaxeId:$,sessionId:te,lastSessionId:oe,sender:ae,senderType:de,portalId:w,deploymentId:v,deploymentType:k,validationStatus:pe,validationUpgradeGroups:me,validationUpgradeUrl:fe,deploymentDimensions:S,deploymentMisc:C,accessGroup:re,pickaxe:ke,selectedModel:Ce,setSelectedModel:Ie,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},I),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},P),misc:F,translations:Object.assign({"form-next":"Next","form-progress":"Form progress","form-page-progress":"Question {current} of {total}","action-confirmation-needed":"Confirmation needed","action-confirmation-unavailable":"Confirmation unavailable","action-approved":"Approved","action-declined":"Declined","action-expired":"Expired","action-not-run":"Not run","action-label":"Action: {name}","action-confirmation-description":"Review this action before it runs. Your decision applies only to this call.","action-inputs":"Action inputs","decline-action":"Decline","approve-action":"Approve action","action-confirmation-resolved":"This confirmation has expired or already been resolved.","action-decision-failed":"Could not save your decision. Please try again.","ai-model":"AI model","default-ai-model":"Default ({model})","attach-files":"Attach files","new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website",copy:"Copy","file-limit-reached":"You have reached the file limit.","something-wrong-occured":"Something wrong occurred",save:"Save","save-as":"Save as","please-enter-email-to-continue":"Please enter your email to continue:","enter-email-to-continue":"Enter here your email to continue",submit:"Submit",sending:"Sending...","check-your-inbox":"Check your inbox","we-sent-your-an-activation-link":"We sent you an activation link. Please be sure to check your spam folder too.",resend:"Resend",resending:"Resending...","enter-verification-code":"Or enter the 6-digit code from the email","verification-code-session-missing":"Your login request could not be found. Please resend the email.","verification-code-invalid":"Invalid verification code.",verifying:"Verifying...",verify:"Verify","chat-history":"Chat History","exit-chat-history":"Exit Chat History","no-history":"No history yet.","mcp-use-with-ai-app":"Use with an AI app","mcp-use-agent-in-ai-app":"Use this agent in your AI app","mcp-connect-description":"Connect through MCP. Requests will be sent as your signed-in Studio user.","mcp-ai-app":"AI app","mcp-copy-configuration":"Copy MCP configuration","mcp-private-configuration-note":"Keep this configuration private. It contains your Studio session token and stops working when that session expires.","log-out":"Log Out","clear-form":"Clear form","form.clear-form":"Clear form",expand:"Expand","expand-artifact":"Expand artifact",collapse:"Collapse","collapse-artifact":"Collapse artifact",close:"Close","close-artifact":"Close artifact",download:"Download","copy-artifact-content":"Copy artifact content","download-artifact-content":"Download artifact content","delete-confirm":"Are you sure you want to delete this conversation?",other:"Other","select-options":"Select option(s)","select-an-option":"Select an option","type-your-answer":"Type your answer...",cancel:"Cancel","rename-chat":"Rename chat","delete-chat":"Delete chat","conversation-name":"Conversation name","not-available":"n/a","open-chat":"Open Chat",copied:"Copied!","copy-assistant-message":"Copy assistant message","failed-delete-conversation":"Failed to delete conversation.","failed-update-name":"Failed to update name.","failed-rename-chat":"Failed to rename chat.","failed-delete-chat":"Failed to delete chat.","drop-files-to-upload":"Drop files to upload","add-anything-to-the-conversation":"Add anything to the conversation","something-went-wrong-please-try-again":"Something went wrong. Please try again, or","contact-us":"contact us","for-help":"for help.",back:"Back","upgrade-required":"Upgrade Required","please-upgrade-to-continue-using-this-tool":"Please upgrade to continue using this tool.","access-locked":"Access Locked","this-tool-is-locked-contact-owner":"This tool is locked to use. Contact owner for more information.","access-denied":"Access Denied","login-is-required":"Login is required.","no-access-request-access":"It looks like you don't have access to these resources. Please request access to continue.","request-access":"Request Access",or:"or","sign-in-with-different-account":"Sign in with a different account","access-requested-successfully":"Successfully requested access!","open-tool":"Open Tool","fab-icon":"FAB Icon","iframe-artifact-fallback":"Iframe is not supported, please view this artifact in a browser that supports it.","html-preview":"HTML preview","image-link-is-broken":"[Image link is broken]","download-video":"Download Video","available-plans":"Available Plans",buy:"Buy",credits:"Credits",uses:"Uses",credits_upper:"CREDITS",uses_upper:"USES",free:"Free","pricing.free":"Free",unlimited:"Unlimited","pricing.unlimited":"Unlimited","authentication-required":"Authentication Required","smithery-auth-description-prefix":"The tool you are trying to use requires authentication with",dismiss:"Dismiss",connect:"Connect",connecting:"Connecting...","auth-failed":"Auth failed","failed-to-finalize-authentication":"Failed to finalize authentication.","must-be-logged-in-to-connect-smithery":"You must be logged in to connect Smithery MCPs.","feedback-dislike-input-placeholder":"Write here...","feedback-submit":"Submit","feedback-thanks":"Thanks for the feedback!","feedback-like-title":"What went right?","feedback-dislike-title":"What went wrong?","feedback-dislike-message":"Help us improve our answers","what-do-you-want-to-talk-about":"What do you want to talk about?","failed-to-start-generation":"Failed to start generation","response-too-long":"One or more of your responses is too long!","required-fields-missing":"You must fill out all required fields.","something-went-wrong":"Something went wrong.","something-went-wrong-try-again":"Something went wrong, please try again.","high-traffic-try-again-later":"Oops! We're experiencing high traffic at the moment. Please try again later.","queue-message":"Queue message","stop-response":"Stop response",steer:"Steer","steer-with":"Steer with",steering:"Steering...",starting:"Starting...","remove-queued-message":"Remove queued message","edit-message":"Edit message","more-options":"More options","failed-to-interrupt-current-response":"Failed to interrupt the current response.","current-response-still-stopping":"The current response is still stopping. Please send your message again in a moment.","queued-message-waiting":"A queued message is waiting for the previous response to finish.",listening:"Listening...",remaining:"remaining",upgrade:"Upgrade","pricing.upgrade":"Upgrade","email-address-cannot-be-empty":"Email address cannot be empty.","please-enter-valid-email-address":"Please enter a valid email address.","failed-to-send-sign-in-link":"Failed to send sign-in link.",tool:"Tool","document-processing-failed":"Document processing failed","invalid-upload-file-types":"You can only upload PDF, TXT, DOCX, CSV, XLSX, JSON, PPTX, MD, HTML, XML, PNG, JPEG, WEBP, GIF, or M4A files. Please try again.","invalid-website-or-youtube-link":"Please paste a valid website URL or Youtube video link to add to the knowledge base.","website-processing-failed":"Website processing failed, please try again.","invalid-website-url":"Please paste a valid website URL","document-upload-required":"Please paste a valid website/video link or drag a file to add to the knowledge base.",thinking:"Thinking...",thought:"Thought","thought-for":"Thought for",seconds:"seconds","untitled-artifact":"Untitled Artifact",created:"Created",updated:"Updated",rewrote:"Rewrote",artifact:"Artifact","iframe-not-supported-use-different-browser":"Iframe not supported, use a different browser."},x),artifact:T,renderResponseAction:g,renderEmbedHeaderAction:f,responsiveBy:D,locale:O,opacity:U,forceMobile:q,loadFont:M,disableHtml:R,disableJs:E,disableCss:j,isFontLoaded:Pe,isNewChat:Fe,isShowIceBreaker:Te,isShowFeedbackMessage:Oe,isRtl:L,isEmbed:G,mcpEnabled:H,mcpInitiallyOpen:W,mcpGuestId:B,mcpDialog:qe[Me]||u,setMCPDialog:Le,mcpInitiallyOpenedDeployments:Ee,mcpPreparingDeployments:je,isDropShadow:V,allowGuestUsage:Y,persistActiveConversation:X,clientSecret:ve,stripeAccountId:ye,preventInitialSessionId:J,setClientSecret:we,setStripeAccountId:be,setContextId:Z,setValidationStatus:ue,setValidationUpgradeGroups:ge,setValidationUpgradeUrl:he,setPickaxeId:ee,setSessionId:e=>{ie((t=>{const i="function"==typeof e?e(t):e;return null==Q||Q(i),i}))},setLastSessionId:ne,setSender:se,setSenderType:ce,setAccessGroup:le,setPickaxe:Se,setIsFontLoaded:Ae,setIsNewChat:xe,setIsShowIceBreaker:De,setIsShowFeedbackMessage:Ue},_&&{onUpgrade:_}),z&&{onGenerateComplete:z})},{children:t(p,Object.assign({initialToken:N},{children:t(l,{children:t(d,Object.assign({limits:A},{children:t(c,{children:t(r,Object.assign({},T,{children:i}))})}))})}))}))};export{m as PickaxeContext,g as PickaxeProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";import{useState as s,useMemo as a,useCallback as i,useEffect as n}from"react";import c from"copy-to-clipboard";import{AnimatePresence as l,motion as p}from"framer-motion";import d from"../../Icons/terminal.svg.js";import m from"../../Icons/copy.svg.js";import u from"../../Icons/check.svg.js";import h from"../../Icons/chevron-down.svg.js";import g from"../../../common/api/utils.js";import{api2 as b}from"../../../common/api/api.js";import{initializeEmbedUserId as y}from"../../../common/utils.js";import f from"../../Core/Modal/index.js";import j from"../../Core/Modal/Body.js";import v from"../../Core/Modal/CloseButton.js";import{usePickaxeContext as O}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as x}from"../../../hooks/studio/useStyleFontSize.js";import{useAuthContext as C}from"../Addons/Auth/hooks/useAuthContext.js";import k from"./PickaxeSimpleButton.js";const w={codex:"Codex",claude:"Claude Code",cursor:"Cursor",vscode:"VS Code",other:"Other"},N=()=>{const{colors:N,styles:I,deploymentId:$,deploymentType:P,mcpEnabled:R,mcpInitiallyOpen:A,mcpGuestId:M,mcpDialog:S,setMCPDialog:T,mcpInitiallyOpenedDeployments:_,mcpPreparingDeployments:z,pickaxeId:E,sender:U,translations:B}=O(),{token:L,isAuthBootstrapComplete:D}=C(),q=x(),{isOpen:F,guestToken:G,isPreparing:J,prepareError:W}=S,[H,K]=s(!1),[V,X]=s(!1),[Q,Y]=s("codex"),Z=(e,o)=>{var r;return null!==(r=null==B?void 0:B[e])&&void 0!==r?r:o},ee=a((()=>{if(!$)return"";const e=process.env.NEXT_PUBLIC_API_MCP_URL||"https://mcp.pickaxe.co",o=new URL(e),r=o.pathname.replace(/\/+$/,"");return o.pathname=r.endsWith("/deployment")?r:`${r}/deployment`,o.searchParams.set("id",$),o.toString()}),[$]),oe=L||G,re=a((()=>{if(!oe)return"";const e=`Bearer ${oe}`;return"codex"===Q?`[mcp_servers.pickaxe]\nurl = "${ee}"\nhttp_headers = { Authorization = "${e}" }`:"claude"===Q?`claude mcp add --transport http --scope user pickaxe "${ee}" --header "Authorization: ${e}"`:"vscode"===Q?JSON.stringify({servers:{pickaxe:{type:"http",url:ee,headers:{Authorization:e}}}},null,2):"cursor"===Q?JSON.stringify({mcpServers:{pickaxe:{url:ee,headers:{Authorization:e}}}},null,2):`URL: ${ee}\nAuthorization: ${e}`}),[Q,ee,oe]),te=i((()=>e(void 0,void 0,void 0,(function*(){if(R&&$&&(T((e=>Object.assign(Object.assign({},e),{isOpen:!0}))),!oe&&!z.has($))){z.add($),T((e=>Object.assign(Object.assign({},e),{isPreparing:!0,prepareError:!1})));try{const e=M||U||y(),o=yield g.post("/pickaxe/mcp-session",{deploymentId:$,guestId:e});if(!o.data.success||!o.data.token)throw new Error("Guest MCP session was not created");T((e=>Object.assign(Object.assign({},e),{guestToken:o.data.token})))}catch(e){console.error("[pxe] failed to prepare MCP configuration",e),T((e=>Object.assign(Object.assign({},e),{prepareError:!0})))}finally{z.delete($),T((e=>Object.assign(Object.assign({},e),{isPreparing:!1})))}}}))),[$,R,M,z,U,oe,T]);if(n((()=>{A&&R&&$&&D&&!_.has($)&&(_.add($),te())}),[$,D,R,A,_,te]),!R||!$)return null;return o(r,{children:[o("div",Object.assign({className:"relative"},{children:[o(k,Object.assign({className:"h-8 w-8 shrink-0 justify-center rounded-full",color:N.accent,onClick:()=>{_.add($),b.post("/track",{event:"useWithAIAppClick",guestId:M||U||y(),metadata:{pickaxeId:E,deploymentId:$,deploymentType:P||"unknown",surface:"react"}}).catch((()=>{})),te()},onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1)},{children:[t(d,{className:"h-5 w-5"}),t("span",Object.assign({className:"sr-only"},{children:Z("mcp-use-with-ai-app","Use with an AI app")}))]})),t(l,{children:H?t(p.div,Object.assign({className:"absolute right-0 top-10 z-20 w-max rounded px-3 py-2 text-xs font-medium",style:{background:N.accent,color:N.accentText},initial:{opacity:0,y:-8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}},{children:Z("mcp-use-with-ai-app","Use with an AI app")})):null})]})),t(f,Object.assign({isOpen:F,onChange:e=>T((o=>Object.assign(Object.assign({},o),{isOpen:e})))},{children:t(j,Object.assign({portalClassName:"dark"===I.theme?"dark":void 0,wrapperClassName:"mx-4 w-[min(92vw,560px)]",className:"w-full overflow-hidden p-0",style:Object.assign({backgroundColor:N.secondary,borderColor:`${N.accent}40`,borderRadius:I.cornerRadius,color:N.secondaryText},"Real Head Pro"!==I.font&&{fontFamily:I.font})},{children:o("div",Object.assign({className:"flex flex-col gap-5 p-6"},{children:[o("div",Object.assign({className:"flex items-start justify-between gap-4"},{children:[o("div",{children:[t("h2",Object.assign({className:`${q.h4} font-semibold`},{children:Z("mcp-use-agent-in-ai-app","Use this agent in your AI app")})),t("p",Object.assign({className:`${q.b3} mt-1 opacity-70`},{children:Z(L?"mcp-connect-description":"mcp-connect-description-guest",L?"Connect through MCP. Requests will be sent as your signed-in Studio user.":"Connect through MCP. Requests will be sent as this visitor.")}))]}),t(v,{className:"shrink-0"})]})),o("label",Object.assign({className:`${q.l2} flex flex-col gap-2 font-medium`},{children:[Z("mcp-ai-app","AI app"),o("div",Object.assign({className:"relative"},{children:[t("select",Object.assign({className:"w-full appearance-none border py-2 pl-3 pr-10 outline-none",style:{backgroundColor:N.primary,borderColor:`${N.accent}40`,borderRadius:I.cornerRadius,color:N.text},value:Q,onChange:e=>Y(e.target.value)},{children:Object.entries(w).map((([e,o])=>t("option",Object.assign({value:e},{children:"other"===e?Z("other","Other"):o}),e)))})),t(h,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2",style:{color:N.text}})]}))]})),J?t("div",Object.assign({className:"min-h-24 animate-pulse border p-4",role:"status",style:{backgroundColor:N.primary,borderColor:`${N.accent}40`,borderRadius:I.cornerRadius}},{children:t("span",Object.assign({className:"sr-only"},{children:Z("mcp-preparing-configuration","Preparing your private configuration…")}))})):W?t("p",Object.assign({className:`${q.b3} border p-4`,style:{backgroundColor:N.primary,borderColor:`${N.accent}40`,borderRadius:I.cornerRadius,color:N.text}},{children:Z("mcp-configuration-unavailable","This private configuration is unavailable. Close and try again.")})):re?o("div",Object.assign({className:"relative min-w-0"},{children:[t("pre",Object.assign({className:"max-h-64 w-full overflow-auto whitespace-pre-wrap break-all border p-4 pr-12 text-xs",style:{backgroundColor:N.primary,borderColor:`${N.accent}40`,borderRadius:I.cornerRadius,color:N.text}},{children:re})),t("button",Object.assign({type:"button",className:"absolute right-3 top-3 border p-2 transition-opacity hover:opacity-70",style:{backgroundColor:N.accent,borderColor:N.accent,borderRadius:I.cornerRadius,color:N.accentText},"aria-label":Z("mcp-copy-configuration","Copy MCP configuration"),onClick:()=>{re&&(c(re),X(!0),window.setTimeout((()=>X(!1)),1800))}},{children:t(V?u:m,{className:"h-4 w-4"})}))]})):null,t("p",Object.assign({className:`${q.b4} opacity-60`},{children:Z("mcp-private-configuration-note","Keep this configuration private. It contains your Studio session token and stops working when that session expires.")}))]}))}))}))]})};export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";const e=({children:e})=>r("ol",{children:e}),i=({children:e})=>r("ul",{children:e}),
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";const e=({children:e,start:i})=>r("ol",Object.assign({start:i},{children:e})),i=({children:e})=>r("ul",{children:e}),t=({children:e})=>r("li",{children:e});export{t as Li,e as Ol,i as Ul};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsx as r,jsxs as n}from"react/jsx-runtime";import{useState as s,useRef as t,useMemo as i,useEffect as o}from"react";import{usePickaxeMarkdownContext as l}from"./hooks/usePickaxeMarkdownContext.js";import{remarkDocumentCssAsCode as a,remarkSmartQuotes as c,rehypeCode as p,rehypeSanitize as m}from"./utils/custom-plugins.js";import d from"react-markdown";import f from"remark-gfm";import h from"remark-math";import u from"rehype-katex";import g from"rehype-raw";import{A as x}from"./Components/A/index.js";import w,{getFilePreviewInfo as b,shouldSuppressRichPreviewForUrl as j,shouldRenderFilePreview as v}from"./Components/A/FilePreview.js";import{P as C}from"./Components/P/index.js";import{Img as k}from"./Components/Img/index.js";import{Iframe as P}from"./Components/Iframe/index.js";import{Code as R}from"./Components/Code/index.js";import{H1 as
|
|
1
|
+
import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsx as r,jsxs as n}from"react/jsx-runtime";import{useState as s,useRef as t,useMemo as i,useEffect as o}from"react";import{usePickaxeMarkdownContext as l}from"./hooks/usePickaxeMarkdownContext.js";import{remarkDocumentCssAsCode as a,remarkSmartQuotes as c,rehypeCode as p,rehypeSanitize as m}from"./utils/custom-plugins.js";import d from"react-markdown";import f from"remark-gfm";import h from"remark-math";import u from"rehype-katex";import g from"rehype-raw";import{A as x}from"./Components/A/index.js";import w,{getFilePreviewInfo as b,shouldSuppressRichPreviewForUrl as j,shouldRenderFilePreview as v}from"./Components/A/FilePreview.js";import{P as C}from"./Components/P/index.js";import{Img as k}from"./Components/Img/index.js";import{Iframe as P}from"./Components/Iframe/index.js";import{Code as R}from"./Components/Code/index.js";import{H1 as y,H2 as $,H3 as O,H4 as S,H5 as U}from"./Components/Headings/index.js";import{Ol as N,Ul as A,Li as E}from"./Components/List/index.js";import{Table as I,Th as L,Tr as M,Td as T}from"./Components/Table/index.js";import{Hr as H,Br as _,Blockquote as B}from"./Components/Others/index.js";import{ActionCaption as J,ActionFinished as W,ActionError as q}from"./Components/Action/index.js";import{Artifact as z,ArtifactError as D}from"./Components/Artifact/index.js";import{Think as F}from"./Components/Others/Think.js";import G from"../../../../common/cn.js";const K=({className:K,style:Q,children:V,value:X,maxLines:Y,maxChars:Z,multiLineBreaks:ee,onExpandClick:re,filePreviewSeenRef:ne,suppressedRichPreviewUrls:se})=>{const{colors:te,rtl:ie,disableHtml:oe,disableJs:le,disableCss:ae}=l(),[ce,pe]=s({width:0,height:0}),[me,de]=s(null),fe=t(null),he=i((()=>{if(!X)return"";if(oe)return X;let e=X.trim();return e=e.replace(/<!--[\s\S]*?-->/g,""),e=e.replace(/\u200B/g,""),e=e.replace(/\\\((.*?)\\\)/g,"$$$ $1 $$$"),e=e.replace(/\\\[(.*?)\\\]/g,"$$$ $1 $$$"),e=e.replace(/<\/think>/g,"\n</think>"),ee&&(e=e.replace(/```[\s\S]*?```|(\n(?=\n))/g,((e,r)=>r?"\n\n<br/>\n":e))),e||""}),[X,ee,oe]);o((()=>{if(Z)return void de(he.length>Z?he.slice(0,Z)+'<span class="pxe-expand-btn">...</span>':null);if(!Y)return void de(null);if(!fe.current||!he||me)return;const e=fe.current,r=parseInt(window.getComputedStyle(e).lineHeight,10),n=Y*r;if(!(ce.height>n))return;const s=Math.floor(ce.width/8),t=Math.floor(s*Y);de(he.slice(0,t)+'<span class="pxe-expand-btn">...</span>')}),[he,Y,Z,ce,me]);const ue=t(new Set);ne||(ue.current=new Set);const ge=null!=ne?ne:ue,xe=t({colors:te,onExpandClick:re,filePreviewSeenRef:ge,suppressedRichPreviewUrls:se});xe.current={colors:te,onExpandClick:re,filePreviewSeenRef:ge,suppressedRichPreviewUrls:se};const we=i((()=>({h1:y,h2:$,h3:O,h4:S,h5:U,p:e=>r(C,Object.assign({},e,{suppressedRichPreviewUrls:xe.current.suppressedRichPreviewUrls})),a:e=>r(x,Object.assign({},e,{filePreviewSeenRef:xe.current.filePreviewSeenRef,suppressedRichPreviewUrls:xe.current.suppressedRichPreviewUrls})),img:e=>{const{colors:n,filePreviewSeenRef:s,suppressedRichPreviewUrls:t}=xe.current,i="string"==typeof e.src?e.src:"",o=b(i);return o&&!j(o.url,t)?v(o,s)?r(w,{fileInfo:o,displayName:"string"==typeof e.alt?e.alt:void 0}):r("a",Object.assign({href:o.url,target:"_blank",rel:"noopener noreferrer",style:{color:n.accent}},{children:e.alt||o.fileName})):r(k,Object.assign({},e))},iframe:P,code:R,ol:N,ul:A,li:E,table:I,th:L,tr:M,td:T,hr:H,br:_,blockquote:B,span:n=>{var{children:s}=n,t=e(n,["children"]);const{colors:i,onExpandClick:o}=xe.current;return"pxe-expand-btn"===t.className?r("span",Object.assign({},t,{style:Object.assign({display:"inline",fontWeight:500,color:i.accent,marginLeft:".25rem",userSelect:"none"},o&&{cursor:"pointer"})},o&&{onClick:o},{children:s})):r("span",Object.assign({},t,{children:s}))},"action-caption":J,"action-finished":W,"action-error":q,artifact:z,"artifact-error":D,think:F})),[]);o((()=>{if(!fe.current)return;const e=new ResizeObserver((e=>{for(const r of e){const{width:e,height:n}=r.contentRect;pe({width:e,height:n})}}));return e.observe(fe.current),()=>{e.disconnect()}}),[]);const be=me||he;return n("div",Object.assign({className:"pxe-markdown",ref:fe,style:Object.assign({position:"relative",overflowWrap:"anywhere",display:"grid",gridTemplateColumns:"repeat(1, minmax(0, 1fr))",gap:".625rem",width:"100%"},Q)},ie&&{dir:"rtl"},{children:[r(d,Object.assign({className:G("pxe-prose",K),components:we,remarkPlugins:[f,[h,{singleDollarTextMath:!1}],[a,{disableCss:ae}],c],rehypePlugins:[p,u,...oe?[]:[g],[m,{disableJs:le,disableCss:ae}]]},{children:be})),V]}))};export{K as PickaxeMarkdownRenderer};
|
package/dist/esm/prose.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pxe-prose p:not(.pxe-artifact-create-header p){font-weight:350}.pxe-prose p:not(:only-child):not(.pxe-artifact-create-header p){margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe:not(.pxe-artifact-renderer iframe){margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-video{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-video{display:flex;justify-content:center;width:100%}.pxe-prose .pxe-markdown-code{margin-bottom:1.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px 10px 14px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{overflow:auto;position:relative}.pxe-prose .pxe-markdown-table:not(:only-child){margin-bottom:2.5rem}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child){margin-top:2.5rem}.pxe-prose h3:not(:first-child),.pxe-prose h4:not(:first-child)
|
|
1
|
+
.pxe-prose p:not(.pxe-artifact-create-header p){font-weight:350}.pxe-prose p:not(:only-child):not(.pxe-artifact-create-header p){margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe:not(.pxe-artifact-renderer iframe){margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-video{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-video{display:flex;justify-content:center;width:100%}.pxe-prose .pxe-markdown-code{margin-bottom:1.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px 10px 14px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{overflow:auto;position:relative}.pxe-prose .pxe-markdown-table:not(:only-child){margin-bottom:2.5rem}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child){margin-top:2.5rem}.pxe-prose h3:not(:first-child),.pxe-prose h4:not(:first-child){margin-top:1rem}.pxe-prose pre{max-width:100%;overflow-x:auto}.pxe-prose>pre:not(:first-child){margin-top:1rem}.pxe-prose .pxe-markdown-code{display:flex;flex-direction:column}.pxe-prose .pxe-markdown-code>div:first-child{background-color:#1d1f21;border-radius:.3em;display:flex;flex-direction:column;max-width:min-content;padding-top:1em;position:relative}.pxe-prose .pxe-markdown-code>div:first-child>div:first-child{display:flex;justify-content:flex-end;padding:0 1em}.pxe-prose .pxe-markdown-code>div:first-child>div:last-child{overflow:auto}.pxe-prose .pxe-action[data-action-id]:not(:nth-child(2)){margin-top:1rem}.pxe-prose .pxe-markdown-code-inline{background-color:#1d1f21;border-radius:.3em;color:#fff;font-size:10pt;padding:.15em .4em}.pxe-link-previews{display:flex;flex-direction:column;gap:2rem}.pxe-prose>p:first-child>.pxe-markdown-image,.pxe-prose>p:first-child>.pxe-markdown-video{margin-top:0}.pxe-prose .pxe-blink{animation:blink 1s ease-in-out infinite}.pxe-prose .pxe-red{color:red}.pxe-prose .pxe-action-error,.pxe-prose .pxe-artifact-error{display:flex;flex-direction:column}.pxe-prose .pxe-animated-token{animation:fadeIn .3s ease-out forwards;display:inline-block;opacity:0}.pxe-prose .pxe-spin{animation:spin 1s linear infinite}@keyframes fadeIn{0%{opacity:0;transform:translateX(5px)}to{opacity:1;transform:translateX(0)}}@keyframes blink{0%{opacity:1}50%{opacity:.5}to{opacity:1}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}
|
|
@@ -20,6 +20,12 @@ export type PickaxeResponseActionRenderer = (target: PickaxeResponseActionTarget
|
|
|
20
20
|
export type PickaxeTranslations = {
|
|
21
21
|
[key: string]: string;
|
|
22
22
|
};
|
|
23
|
+
type MCPDialogState = {
|
|
24
|
+
isOpen: boolean;
|
|
25
|
+
guestToken: string | null;
|
|
26
|
+
isPreparing: boolean;
|
|
27
|
+
prepareError: boolean;
|
|
28
|
+
};
|
|
23
29
|
export type PickaxeProviderStyles = {
|
|
24
30
|
theme: "light" | "dark";
|
|
25
31
|
portalTheme?: "light" | "dark";
|
|
@@ -126,7 +132,12 @@ type PickaxeContextType = {
|
|
|
126
132
|
isRtl: boolean;
|
|
127
133
|
isEmbed: boolean;
|
|
128
134
|
mcpEnabled: boolean;
|
|
135
|
+
mcpInitiallyOpen: boolean;
|
|
129
136
|
mcpGuestId?: string;
|
|
137
|
+
mcpDialog: MCPDialogState;
|
|
138
|
+
setMCPDialog: SetState<MCPDialogState>;
|
|
139
|
+
mcpInitiallyOpenedDeployments: Set<string>;
|
|
140
|
+
mcpPreparingDeployments: Set<string>;
|
|
130
141
|
isDropShadow: boolean;
|
|
131
142
|
allowGuestUsage: boolean;
|
|
132
143
|
persistActiveConversation: boolean;
|
|
@@ -182,6 +193,8 @@ export interface IPickaxeProviderProps {
|
|
|
182
193
|
isRtl?: boolean;
|
|
183
194
|
isEmbed?: boolean;
|
|
184
195
|
mcpEnabled?: boolean;
|
|
196
|
+
/** Open the MCP configuration once after authentication is ready. Requires mcpEnabled. */
|
|
197
|
+
mcpInitiallyOpen?: boolean;
|
|
185
198
|
mcpGuestId?: string;
|
|
186
199
|
studioSessionToken?: string | null;
|
|
187
200
|
isDropShadow?: boolean;
|
|
@@ -193,5 +206,5 @@ export interface IPickaxeProviderProps {
|
|
|
193
206
|
onSessionIdChange?: (sessionId: string) => void;
|
|
194
207
|
}
|
|
195
208
|
export declare const PickaxeContext: import("react").Context<PickaxeContextType>;
|
|
196
|
-
export declare const PickaxeProvider: ({ children, renderResponseAction, renderEmbedHeaderAction, origin, sender: _sender, senderType: _senderType, deploymentId, portalId, deploymentType, deploymentDimensions, deploymentMisc, styles, colors, limits, misc, translations, artifact, responsiveBy, locale, opacity, forceMobile, disableHtml, disableJs, disableCss, loadFont, isRtl, isEmbed, mcpEnabled, mcpGuestId, studioSessionToken, isDropShadow, allowGuestUsage, persistActiveConversation, preventInitialSessionId, onUpgrade, onGenerateComplete, onSessionIdChange, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
209
|
+
export declare const PickaxeProvider: ({ children, renderResponseAction, renderEmbedHeaderAction, origin, sender: _sender, senderType: _senderType, deploymentId, portalId, deploymentType, deploymentDimensions, deploymentMisc, styles, colors, limits, misc, translations, artifact, responsiveBy, locale, opacity, forceMobile, disableHtml, disableJs, disableCss, loadFont, isRtl, isEmbed, mcpEnabled, mcpInitiallyOpen, mcpGuestId, studioSessionToken, isDropShadow, allowGuestUsage, persistActiveConversation, preventInitialSessionId, onUpgrade, onGenerateComplete, onSessionIdChange, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
197
210
|
export {};
|
|
@@ -41,7 +41,22 @@ export declare const usePickaxeContext: () => {
|
|
|
41
41
|
isRtl: boolean;
|
|
42
42
|
isEmbed: boolean;
|
|
43
43
|
mcpEnabled: boolean;
|
|
44
|
+
mcpInitiallyOpen: boolean;
|
|
44
45
|
mcpGuestId?: string | undefined;
|
|
46
|
+
mcpDialog: {
|
|
47
|
+
isOpen: boolean;
|
|
48
|
+
guestToken: string | null;
|
|
49
|
+
isPreparing: boolean;
|
|
50
|
+
prepareError: boolean;
|
|
51
|
+
};
|
|
52
|
+
setMCPDialog: import("../../types/common").SetState<{
|
|
53
|
+
isOpen: boolean;
|
|
54
|
+
guestToken: string | null;
|
|
55
|
+
isPreparing: boolean;
|
|
56
|
+
prepareError: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
mcpInitiallyOpenedDeployments: Set<string>;
|
|
59
|
+
mcpPreparingDeployments: Set<string>;
|
|
45
60
|
isDropShadow: boolean;
|
|
46
61
|
allowGuestUsage: boolean;
|
|
47
62
|
persistActiveConversation: boolean;
|