PageSourceSearch

https://smritea.ai/assets/AppDetailPage-Dq3_HvML.js

js smritea.ai collected 2026-10-05 15:07:08 UTC 29,017 bytes, 57 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AppAdvancedManagedTab-Dg1dbVSd.js","assets/index-OkXy-d5Y.js","assets/index-aq_88fSt.css","assets/alert-0QuNooNy.js","assets/card-BOYNs0rn.js","assets/label-B8fcy5Qd.js","assets/draftConfigMapping-DFlHEMSm.js","assets/select-Dpk4TeIL.js","assets/chevron-down-D6eBPoHA.js","assets/skeleton-CTnX7jIE.js","assets/trash-2-D_SaHreE.js","assets/plus-CqeGYQIF.js","assets/appConfigDraftSlice-Dh8czg1U.js","assets/drafts-client-CbJfUKYS.js","assets/triangle-alert-CDwBzzS8.js","assets/loader-circle-Cq8KN2OP.js","assets/badge-D70DEMXH.js","assets/tabs-DOaoAkMM.js","assets/CopyButton-Bg3eIyIl.js","assets/EmptyState-B-dhNU1x.js","assets/date-utils-BapGj4Cw.js","assets/MemoryRow-Bzu-xJPf.js","assets/chevron-right-KD1l2-eL.js","assets/appsSlice-B3WyvwFA.js","assets/alert-dialog-Dc3pT7KS.js","assets/separator-D5JjMsAa.js","assets/circle-alert-CQF3oPcN.js","assets/drawer-BKNRAhtm.js","assets/ApiKeyRow-Bp3E9QkA.js","assets/apiKeysSlice-CHmcOGx4.js","assets/orgsSlice-mdJJI7Vn.js","assets/key-BiiylvYb.js","assets/useUrlState-BpAdUcU0.js","assets/memoriesSlice-ClQDWo33.js","assets/settings-2-Cg1wNlM7.js","assets/brain-miUL15Zz.js","assets/arrow-left-BG1TkwtI.js"])))=>i.map(i=>d[i]);
2import{c as ae,r as u,ay as Ne,az as Ce,j as e,P as re,aA as W,aB as ke,aC as Ae,aD as we,a0 as De,d as te,e as L,o as N,I as T,B as y,t as A,k as Ie,m as ie,aE as Pe,a4 as Se}from"./index-OkXy-d5Y.js";import{S as B}from"./skeleton-CTnX7jIE.js";import{A as $,b as Ke,a as V}from"./alert-0QuNooNy.js";import{B as U}from"./badge-D70DEMXH.js";import{C as R,a as H,c as q,d as ne,b as _}from"./card-BOYNs0rn.js";import{T as Ee,a as Te,b as S,c as K}from"./tabs-DOaoAkMM.js";import{C as E}from"./CopyButton-Bg3eIyIl.js";import{E as le}from"./EmptyState-B-dhNU1x.js";import{f as Re}from"./date-utils-BapGj4Cw.js";import{M as _e,C as Oe}from"./MemoryRow-Bzu-xJPf.js";import{c as Ue,d as Le,e as Me,g as Be,h as ze,i as Fe,j as $e,r as Ve,k as Ge,l as He,s as qe}from"./appsSlice-B3WyvwFA.js";import{A as oe,a as Xe,b as ce,c as de,d as me,e as pe,f as he,g as ue,h as We}from"./alert-dialog-Dc3pT7KS.js";import{L as D}from"./label-B8fcy5Qd.js";import{u as Ye,S as Je,a as Qe,b as Ze,c as es,e as Y,f as J,d as Q}from"./select-Dpk4TeIL.js";import{S as z}from"./separator-D5JjMsAa.js";import{C as xe}from"./circle-alert-CQF3oPcN.js";import{I as ss,T as as}from"./triangle-alert-CDwBzzS8.js";import{L as rs}from"./loader-circle-Cq8KN2OP.js";import{T as fe}from"./trash-2-D_SaHreE.js";import{e as ts,f as is,j as ns,D as ls,d as os,k as cs,g as ds,h as ms,i as ps,a as hs,b as us,c as xs}from"./drawer-BKNRAhtm.js";import{A as fs}from"./ApiKeyRow-Bp3E9QkA.js";import{s as ve,b as vs,c as js,d as gs,r as Z,f as G,e as ee}from"./apiKeysSlice-CHmcOGx4.js";import{a as ys}from"./orgsSlice-mdJJI7Vn.js";import{P as bs}from"./plus-CqeGYQIF.js";import{K as Ns}from"./key-BiiylvYb.js";import{u as Cs,a as ks}from"./useUrlState-BpAdUcU0.js";import{s as As,a as ws,b as Ds,c as Is,f as Ps}from"./memoriesSlice-ClQDWo33.js";import{S as Ss}from"./settings-2-Cg1wNlM7.js";import{B as Ks}from"./brain-miUL15Zz.js";import{C as Es}from"./chevron-right-KD1l2-eL.js";import{A as Ts}from"./arrow-left-BG1TkwtI.js";/**
3 * @license lucide-react v0.487.0 - ISC
4 *
5 * This source code is licensed under the ISC license.
6 * See the LICENSE file in the root directory of this source tree.
7 */const Rs=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],_s=ae("code",Rs);/**
8 * @license lucide-react v0.487.0 - ISC
9 *
10 * This source code is licensed under the ISC license.
11 * See the LICENSE file in the root directory of this source tree.
12 */const Os=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Us=ae("save",Os);var X="Checkbox",[Ls]=we(X),[Ms,Bs]=Ls(X),je=u.forwardRef((a,o)=>{const{__scopeCheckbox:s,name:d,checked:l,defaultChecked:m,required:x,disabled:i,value:c="on",onCheckedChange:t,form:r,...n}=a,[p,b]=u.useState(null),v=Ne(o,j=>b(j)),C=u.useRef(!1),g=p?r||!!p.closest("form"):!0,[h=!1,f]=Ce({prop:l,defaultProp:m,onChange:t}
12),k=u.useRef(h);return u.useEffect(()=>{const j=p==null?void 0:p.form;if(j){const w=()=>f(k.current);return j.addEventListener("reset",w),()=>j.removeEventListener("reset",w)}},[p,f]),e.jsxs(Ms,{scope:s,state:h,disabled:i,children:[e.jsx(re.button,{type:"button",role:"checkbox","aria-checked":I(h)?"mixed":h,"aria-required":x,"data-state":be(h),"data-disabled":i?"":void 0,disabled:i,value:c,...n,ref:v,onKeyDown:W(a.onKeyDown,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:W(a.onClick,j=>{f(w=>I(w)?!0:!w),g&&(C.current=j.isPropagationStopped(),C.current||j.stopPropagation())})}),g&&e.jsx(zs,{control:p,bubbles:!C.current,name:d,value:c,checked:h,required:x,disabled:i,form:r,style:{transform:"translateX(-100%)"},defaultChecked:I(m)?!1:m})]})});je.displayName=X;var ge="CheckboxIndicator",ye=u.forwardRef((a,o)=>{const{__scopeCheckbox:s,forceMount:d,...l}=a,m=Bs(ge,s);return e.jsx(ke,{present:d||I(m.state)||m.state===!0,children:e.jsx(re.span,{"data-state":be(m.state),"data-disabled":m.disabled?"":void 0,...l,ref:o,style:{pointerEvents:"none",...a.style}})})});ye.displayName=ge;var zs=a=>{const{control:o,checked:s,bubbles:d=!0,defaultChecked:l,...m}=a,x=u.useRef(null),i=Ye(s),c=Ae(o);u.useEffect(()=>{const r=x.current,n=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(n,"checked").set;if(i!==s&&b){const v=new Event("click",{bubbles:d});r.indeterminate=I(s),b.call(r,I(s)?!1:s),r.dispatchEvent(v)}},[i,s,d]);const t=u.useRef(I(s)?!1:s);return e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l??t.current,...m,tabIndex:-1,ref:x,style:{...a.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function I(a){return a==="indeterminate"}function be(a){return I(a)?"indeterminate":a?"checked":"unchecked"}var Fs=je,$s=ye;function Vs({className:a,...o}){return e.jsx(Fs,{"data-slot":"checkbox",className:te("peer border bg-input-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",a),...o,children:e.jsx($s,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:e.jsx(De,{className:"size-3.5"})})})}const Gs=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"gemini",label:"Gemini"},{value:"deepseek",label:"DeepSeek"},{value:"ollama",label:"Ollama"},{value:"glm",label:"GLM"}],Hs=[{value:"openai_custom",label:"OpenAI (Custom)"},{value:"anthropic_custom",label:"Anthropic (Custom)"}],qs=[{value:"openai",label:"OpenAI"},{value:"voyageai",label:"VoyageAI"},{value:"ollama",label:"Ollama"}],Xs=[{value:"openai_custom",label:"OpenAI (Custom)"}],Ws=[{value:"voyageai",label:"VoyageAI"},{value:"cohere",label:"Cohere"},{value:"jina",label:"Jina"}],Ys=[{value:"voyageai_custom",label:"VoyageAI (Custom)"},{value:"cohere_custom",label:"Cohere (Custom)"},{value:"jina_custom",label:"Jina (Custom)"}],O=()=>({provider:"",apiKey:"",model:"",baseUrl:""}),se=()=>({...O(),dimensions:""});function Js({appId:a}){const o=L(),s=N(Ue(a)),d=N(Le),l=N(Me),m=N(Be),x=N(ze),[i,c]=u.useState(O()),[t,r]=u.useState(se()),[n,p]=u.useState(O());u.useEffect(()=>{o(Fe(a))},[o,a]),u.useEffect(()=>{s&&(s.llm&&c({provider:s.llm.provider??"",apiKey:"",model:s.llm.model??"",baseUrl:""}),s.embedding&&r({provider:s.embedding.provider??"",apiKey:"",model:s.embedding.model??"",baseUrl:"",dimensions:s.embedding.dimensions?String(s.embedding.dimensions):""}),s.reranker&&p({provider:s.reranker.provider??"",apiKey:"",model:s.reranker.model??"",baseUrl:""}))},[s]);const b=(s==null?void 0:s.configured)===!0,v=f=>f.endsWith("_custom"),C=f=>f==="openai"||f==="openai_custom",g=async()=>{if(!i.provider||!t.provider||!n.provider){A({title:"Error",description:"All three providers (LLM, Embedding, Reranker) must be selected before saving.",variant:"destructive"});return}if(v(i.provider)&&!i.baseUrl){A({title:"Error",description:"LLM custom provider requires a Base URL.",variant:"destructive"});return}if(v(t.provider)&&!t.baseUrl){A({title:"Error",description:"Embedding custom provider requires a Base URL.",variant:"destructive"});return}if(v(n.provider)&&!n.baseUrl){A({title:"Error",description:"Reranker custom provider requires a Base URL.",variant:"destructive"});return}const f=P=>v(P)||P==="ollama",k={provider:i.provider,...i.apiKey&&{apiKey:i.apiKey},...i.model&&{model:i.model},...f(i.provider)&&i.baseUrl&&{baseUrl:i.baseUrl}},j={provider:t.provider,...t.apiKey&&{apiKey:t.apiKey},...t.model&&{model:t.model},...f(t.provider)&&t.baseUrl&&{baseUrl:t.baseUrl},...C(t.provider)&&t.dimensions&&{dimensions:parseInt(t.dimensions,10)}},w={provider:n.provider,...n.apiKey&&{apiKey:n.apiKey},...n.model&&{model:n.model},...f(n.provider)&&n.baseUrl&&{baseUrl:n.baseUrl}},M={llm:k,embedding:j,reranker:w};try{await o($e({appId:a,config:M})).unwrap(),A({title:"AI provider configuration saved."})}catch{}},h=async()=>{try{await o(Ve(a)).unwrap(),c(O()),r(se()),p(O()),A({title:"AI provider configuration removed. System credentials restored."})}catch{}};
12return e.jsxs(R,{children:[e.jsxs(H,{children:[e.jsx(q,{children:"AI Provider Configuration"}),e.jsx(ne,{children:"Configure custom AI providers for this app. When set, these credentials are used exclusively instead of system defaults."})]}),e.jsxs(_,{className:"space-y-8",children:[x&&e.jsxs($,{variant:"destructive",children:[e.jsx(xe,{className:"h-4 w-4"}),e.jsx(Ke,{children:"Failed to load AI configuration"}),e.jsx(V,{children:x})]}),!b&&!x&&!d&&e.jsxs($,{children:[e.jsx(ss,{className:"h-4 w-4"}),e.jsx(V,{children:"Not configured — this app uses the system default AI credentials. Set custom providers below to override."})]}),e.jsx(F,{title:"LLM Provider",description:"Language model for memory operations (entity extraction, summarization, etc.)",status:s==null?void 0:s.llm,fields:i,onFieldChange:(f,k)=>c(j=>({...j,[f]:k})),standardOptions:Gs,customOptions:Hs,showBaseUrl:v(i.provider)||i.provider==="ollama",isOllama:i.provider==="ollama"}),e.jsx(z,{}),e.jsx(F,{title:"Embedding Provider",description:"Embedding model for vector indexing and similarity search",status:s==null?void 0:s.embedding,fields:t,onFieldChange:(f,k)=>r(j=>({...j,[f]:k})),standardOptions:qs,customOptions:Xs,showBaseUrl:v(t.provider)||t.provider==="ollama",isOllama:t.provider==="ollama",children:C(t.provider)&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{children:"Dimensions"}),e.jsx(T,{type:"number",placeholder:"512",min:1,max:4096,value:t.dimensions,onChange:f=>r(k=>({...k,dimensions:f.target.value}))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Vector dimensionality (1-4096). Cannot be changed after memories are created."})]})}),e.jsx(z,{}),e.jsx(F,{title:"Reranker Provider",description:"Reranker for re-scoring search results after initial retrieval",status:s==null?void 0:s.reranker,fields:n,onFieldChange:(f,k)=>p(j=>({...j,[f]:k})),standardOptions:Ws,customOptions:Ys,showBaseUrl:v(n.provider)||n.provider==="ollama"}),e.jsx(z,{}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(y,{onClick:g,disabled:l||d,children:[l?e.jsx(rs,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(Us,{className:"mr-2 h-4 w-4"}),l?"Saving...":"Save Configuration"]}),b&&e.jsxs(oe,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs(y,{variant:"destructive",disabled:m||d,children:[e.jsx(fe,{className:"mr-2 h-4 w-4"}),"Remove Configuration"]})}),e.jsxs(ce,{children:[e.jsxs(de,{children:[e.jsx(me,{children:"Remove AI Configuration?"}),e.jsx(pe,{children:"This will revert all AI operations to system credentials."})]}),e.jsxs(he,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(We,{onClick:h,children:"Remove"})]})]})]})]})]})]})}function F({title:a,description:o,status:s,fields:d,onFieldChange:l,standardOptions:m,customOptions:x,showBaseUrl:i,isOllama:c,children:t}){return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-sm font-semibold",children:a}),(s==null?void 0:s.provider)&&e.jsx(U,{variant:"secondary",children:s.provider}),(s==null?void 0:s.model)&&e.jsx(U,{variant:"outline",children:s.model})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:o}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{children:"Provider"}),e.jsxs(Je,{value:d.provider,onValueChange:r=>l("provider",r),children:[e.jsx(Qe,{className:"w-full",children:e.jsx(Ze,{placeholder:"Select provider"})}),e.jsxs(es,{children:[e.jsxs(Y,{children:[e.jsx(J,{children:"Standard"}),m.map(r=>e.jsx(Q,{value:r.value,children:r.label},r.value))]}),e.jsxs(Y,{children:[e.jsx(J,{children:"Custom Endpoint"}),x.map(r=>e.jsx(Q,{value:r.value,children:r.label},r.value))]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[c?e.jsxs(D,{children:["API Key ",e.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}):e.jsxs(D,{children:["API Key ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(T,{type:"password",placeholder:c?"Optional for Ollama":"Enter API key",value:d.apiKey,onChange:r=>l("apiKey",r.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{children:"Model"}),e.jsx(T,{placeholder:"Leave empty for provider default",value:d.model,onChange:r=>l("model",r.target.value)})]}),i&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{children:"Base URL"}),e.jsx(T,{placeholder:"https://your-endpoint.example.com",value:d.baseUrl,onChange:r=>l("baseUrl",r.target.value)})]}),t]})]})}function Qs({appId:a,appName:o}){const s=L(),d=N(ys),l=N(ve),m=N(vs),x=N(js),i=Ie(),c=l[a]||[],[t,r]=u.useState(!1),[n,p]=u.useState(""),b=async()=>
12{if(!d||!a||!n.trim())return;const g=await s(ee({orgId:d,data:{name:n,appId:a}}));ee.fulfilled.match(g)?(p(""),r(!1),s(G({appId:a})),A({title:"API key created"})):A({title:"Error",description:g.payload??"Failed to create API key",variant:"destructive"})},v=async g=>{if(!d)return;const h=await s(Z({orgId:d,keyId:g}));Z.fulfilled.match(h)?(s(G({appId:a})),A({title:"API key revoked"})):A({title:"Error",description:h.payload??"Failed to revoke API key",variant:"destructive"})},C=e.jsxs(e.Fragment,{children:[i?e.jsxs(ds,{children:[e.jsx(ms,{children:"Create API Key"}),e.jsxs(ps,{children:["Create a new API key for ",o,"."]})]}):e.jsxs(hs,{children:[e.jsx(us,{children:"Create API Key"}),e.jsxs(xs,{children:["Create a new API key for ",o,"."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{children:"Key Name"}),e.jsx(T,{placeholder:"e.g. Production Key",value:n,onChange:g=>p(g.target.value)})]})]});return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-lg",children:"API Keys"}),e.jsxs(y,{size:"sm",onClick:()=>r(!0),children:[e.jsx(bs,{className:"mr-2 h-4 w-4"})," Create Key"]})]}),x&&e.jsx(R,{className:"border-success-border bg-success-surface",children:e.jsxs(_,{className:"py-4",children:[e.jsx("p",{className:"text-sm mb-2 font-medium",children:"Your new API key (shown only once — save it now):"}),e.jsxs("div",{className:"flex items-center gap-2 bg-background rounded p-2 border",children:[e.jsx("code",{className:"text-sm font-mono flex-1 break-all",children:x.apiKey??""}),e.jsx(E,{text:x.apiKey??""})]}),e.jsx(y,{variant:"ghost",size:"sm",className:"mt-2",onClick:()=>s(gs()),children:"Dismiss"})]})}),m?e.jsx(B,{className:"h-32 w-full rounded-lg"}):c.length===0?e.jsx(le,{icon:Ns,title:"No API keys",description:"Create an API key to start using this application.",actionLabel:"Create Key",onAction:()=>r(!0)}):e.jsx(R,{children:e.jsx(_,{className:"py-2",children:c.map(g=>e.jsx(fs,{apiKey:g,onRevoke:v},g.id))})}),i?e.jsx(ts,{open:t,onOpenChange:r,children:e.jsxs(is,{children:[C,e.jsxs(ns,{children:[e.jsx(y,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(y,{onClick:b,disabled:!n.trim(),children:"Create"})]})]})}):e.jsx(ls,{open:t,onOpenChange:r,children:e.jsxs(os,{children:[C,e.jsxs(cs,{children:[e.jsx(y,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(y,{onClick:b,disabled:!n.trim(),children:"Create"})]})]})})]})}function Zs({appId:a,appName:o,apiKeyHint:s,onCreateKey:d,hasKeys:l}){const m="https://api.smritea.ai";
12return e.jsxs(R,{children:[e.jsxs(H,{children:[e.jsxs(q,{className:"text-base flex items-center gap-2",children:[e.jsx(_s,{className:"h-4 w-4"})," Integration Guide"]}),e.jsxs(ne,{children:["Get started with ",o," using the Smritea SDK or REST API."]})]}),e.jsxs(_,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"App ID"}),e.jsxs("div",{className:"flex items-center gap-2 bg-muted rounded px-3 py-2",children:[e.jsx("code",{className:"text-sm font-mono flex-1 truncate",children:a}),e.jsx(E,{text:a})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"API Key"}),e.jsxs("div",{className:"flex items-center gap-2 bg-muted rounded px-3 py-2",children:[e.jsx("code",{className:"text-sm font-mono flex-1 truncate",children:s}),!l&&d&&e.jsx(y,{size:"sm",variant:"ghost",onClick:d,children:"Create Key"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"1. Install the SDK"}),e.jsxs("div",{className:"relative",children:[e.jsx("pre",{className:"bg-muted p-4 rounded-lg text-sm font-mono overflow-auto",children:"npm install smritea-sdk"}),e.jsx("div",{className:"absolute top-2 right-2",children:e.jsx(E,{text:"npm install smritea-sdk"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"2. Initialize & store a memory"}),e.jsxs("div",{className:"relative",children:[e.jsx("pre",{className:"bg-muted p-4 rounded-lg text-sm font-mono overflow-auto",children:`import { SmriteaClient } from 'smritea-sdk';
13
14const client = new SmriteaClient({
15  apiKey: '${s}',
16  appId: '${a}',
17});
18
19// Store a memory
20await client.add(
21  "User prefers dark mode and TypeScript",
22  { scope: { actorId: "user_123", actorType: "user" } }
23);
24
25// Search memories
26const results = await client.search(
27  "What does the user prefer?",
28  { scope: { actorId: "user_123", actorType: "user" } }
29);`}),e.jsx("div",{className:"absolute top-2 right-2",children:e.jsx(E,{text:`import { SmriteaClient } from 'smritea-sdk';
30
31const client = new SmriteaClient({
32  apiKey: '${s}',
33  appId: '${a}',
34});
35
36await client.add(
37  "User prefers dark mode and TypeScript",
38  { scope: { actorId: "user_123", actorType: "user" } }
39);
40
41const results = await client.search(
42  "What does the user prefer?",
43  { scope: { actorId: "user_123", actorType: "user" } }
44);`})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"3. Or use the REST API directly"}),e.jsxs("div",{className:"relative",children:[e.jsx("pre",{className:"bg-muted p-4 rounded-lg text-sm font-mono overflow-auto",children:`curl -X POST ${m}/api/v1/sdk/memories \\
45  -H "X-API-Key: ${s}" \\
46  -H "Content-Type: application/json" \\
47  -d '{
48    "app_id": "${a}",
49    "content": "User prefers dark mode",
50    "scope": {
51      "actor_id": "user_123",
52      "actor_type": "user"
53    }
54  }'`}),e.jsx("div",{className:"absolute top-2 right-2",children:e.jsx(E,{text:`curl -X POST ${m}/api/v1/sdk/memories \\
55  -H "X-API-Key: ${s}" \\
56  -H "Content-Type: application/json" \\
57  -d '{"app_id":"${a}","content":"User prefers dark mode","scope":{"actor_id":"user_123","actor_type":"user"}}'`})})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(y,{variant:"outline",size:"sm",asChild:!0,children:e.jsx("a",{href:"/examples",target:"_blank",rel:"noopener noreferrer",children:"View Examples"})}),e.jsx(y,{size:"sm",asChild:!0,children:e.jsx("a",{href:"/dashboard/playground",children:"Try in Playground"})})]})]})]})}const ea=u.lazy(()=>Pe(()=>import("./AppAdvancedManagedTab-Dg1dbVSd.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36])).then(a=>({default:a.AppAdvancedManagedTab})));function sa({app:a}){var f,k,j,w,M;const o=L(),s=ie(),d=N(ve),l=N(As),m=N(ws),x=N(Ds),i=N(Is),c=((f=a.response)==null?void 0:f.id)??"",t=((k=a.response)==null?void 0:k.name)??"",r=a.hasPendingDraft??!1,n=d[c]||[],[p,b]=Cs("overview"),[v,C]=ks(),g=(x==null?void 0:x.totalPages)??1,h=((j=n[0])==null?void 0:j.name)??"YOUR_API_KEY";return u.useEffect(()=>{p==="memories"&&o(Ps({appId:c,page:v,pageSize:10}))},[o,c,p,v]),e.jsxs(Ee,{value:p,onValueChange:b,children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs(Te,{className:"flex max-w-full flex-wrap gap-1 overflow-x-auto",children:[e.jsx(S,{value:"overview",className:"min-h-12",children:"Overview"}),e.jsx(S,{value:"api-keys",className:"min-h-12",children:"API Keys"}),e.jsx(S,{value:"memories",className:"min-h-12",children:"Memories"}),e.jsx(S,{value:"integration",className:"min-h-12",children:"Integration Guide"}),e.jsx(S,{value:"ai-provider",className:"min-h-12",children:"AI Provider"}),e.jsx(S,{value:"advanced",className:"min-h-12",children:"Advanced (managed)"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[r&&e.jsx(U,{variant:"outline",className:"bg-warning-surface border-warning-border text-warning",children:"Draft pending"}),e.jsxs(y,{variant:"outline",className:"min-h-12 w-full sm:w-auto",onClick:()=>s(`/dashboard/apps/${c}
57/configure`),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"})," ",r?"Resume draft":"Configure"]})]})]}),e.jsx(K,{value:"overview",className:"space-y-4",children:e.jsxs(R,{children:[e.jsx(H,{children:e.jsx(q,{className:"text-base",children:"Application Details"})}),e.jsxs(_,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"App ID"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("code",{className:"text-sm font-mono",children:c}),e.jsx(E,{text:c})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Created"}),e.jsx("span",{className:"text-sm",children:Re((w=a.response)==null?void 0:w.createdAt,"medium",{fallback:"—"})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Data Plane"}),e.jsx("span",{className:"text-sm",children:a.dataPlaneRegion?`${a.dataPlaneRegion} (${a.dataPlaneCloud})`:a.dataPlaneId||"—"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"API Keys"}),e.jsx(U,{variant:"secondary",children:n.length})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Status"}),e.jsx(U,{className:"bg-success-surface text-success border border-success-border",children:"Active"})]})]})]})}),e.jsx(K,{value:"api-keys",className:"space-y-4",children:e.jsx(Qs,{appId:c,appName:t})}),e.jsxs(K,{value:"memories",className:"space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("h3",{className:"text-lg",children:"Memories"})}),m?e.jsx("div",{className:"space-y-2",children:[1,2,3].map(P=>e.jsx(B,{className:"h-14 rounded-lg"},P))}):i?e.jsxs($,{variant:"destructive",children:[e.jsx(xe,{className:"h-4 w-4"}),e.jsx(V,{children:i})]}):l.length===0?e.jsx(le,{icon:Ks,title:"No memories found",description:"This app has no memories yet. Add memories using the SDK or API."}):e.jsxs(e.Fragment,{children:[e.jsx(R,{children:e.jsx(_,{className:"py-0",children:l.map(P=>e.jsx(_e,{memory:P,onClick:()=>{}},P.id))})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Page ",v," of ",g]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{variant:"outline",size:"sm",disabled:v<=1,onClick:()=>C(v-1),children:e.jsx(Oe,{className:"h-4 w-4"})}),e.jsx(y,{variant:"outline",size:"sm",disabled:v>=g,onClick:()=>C(v+1),children:e.jsx(Es,{className:"h-4 w-4"})})]})]})]})]}),e.jsx(K,{value:"integration",className:"space-y-4",children:e.jsx(Zs,{appId:c,appName:t,apiKeyHint:h,hasKeys:n.length>0})}),e.jsx(K,{value:"ai-provider",className:"space-y-4",children:e.jsx(Js,{appId:((M=a.response)==null?void 0:M.id)??""})}),e.jsx(K,{value:"advanced",className:"space-y-4",children:p==="advanced"&&e.jsx(u.Suspense,{fallback:e.jsx("div",{className:"min-h-[240px]"}),children:e.jsx(ea,{app:a})})})]})}function aa({app:a,open:o,onOpenChange:s,onDeleted:d}){const l=L(),[m,x]=u.useState(""),[i,c]=u.useState(!1),[t,r]=u.useState(!1),[n,p]=u.useState(null);u.useEffect(()=>{o||(x(""),c(!1),p(null),r(!1))},[o]);const b=m===a.name,v=b&&i&&!t&&a.name.length>0,C=h=>{t||s(h)},g=async()=>{r(!0),p(null);try{await l(Ge(a.id)).unwrap(),d(),s(!1)}catch(h){const f=h&&typeof h=="object"&&"message"in h&&typeof h.message=="string"?h.message:"Failed to delete app. Please try again.";p(f),r(!1)}};return e.jsx(oe,{open:o,onOpenChange:C,children:e.jsxs(ce,{onEscapeKeyDown:h=>{t&&h.preventDefault()},children:[e.jsxs(de,{children:[e.jsxs(me,{className:"flex items-center gap-2 text-destructive",children:[e.jsx(as,{className:"h-5 w-5","aria-hidden":"true"}),"Delete app"]}),e.jsxs(pe,{children:["This will permanently delete ",e.jsx("span",{className:"font-medium text-foreground",children:a.name})," ","and every memory associated with it. This action cannot be undone."]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(D,{htmlFor:"delete-app-confirm-name",children:["Type ",e.jsx("span",{className:"font-medium text-foreground",children:a.name})," to confirm"]}),e.jsx(T,{id:"delete-app-confirm-name",value:m,onChange:h=>x(h.target.value),disabled:t,autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-invalid":m.length>0&&!b})]}),e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-destructive/30 bg-destructive/5 p-3",children:[e.jsx(Vs,{id:"delete-app-ack",checked:i,onCheckedChange:h=>c(h===!0),disabled:t,className:"mt-0.5 min-h-6 min-w-6"}),e.jsx(D,{htmlFor:"delete-app-ack",className:"text-sm font-normal leading-relaxed",children:"I understand that deleting an app will delete all the memories associated with it, and cannot be recovered"})]}),n&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:n})]}),e.jsxs(he,{children:[e.jsx(ue,{disabled:t,children:"Cancel"}),e.jsx(y,{type:"button",variant:"destructive",disabled:!v,onClick:g,className:te("min-h-10"),children:t?"Deleting…":"Delete this app"})]})]})})}function ra(){var i,c,t,r;const{appId:a}=Se(),o=ie(),s=L(),l=N(qe).find(n=>{var p;return((p=n.response)==null?void 0:p.id)===a}),[m,x]=u.useState(!1);return u.useEffect(()=>{a&&(s(He(a)),s(G({appId:a})))},[s,a]),l?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsx(y,{variant:"ghost",size:"sm",className:"min-h-12 min-w-12 sm:min-h-0 sm:min-w-0",onClick:()=>
57o("/dashboard/apps"),children:e.jsx(Ts,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h1",{className:"text-2xl",children:(i=l.response)==null?void 0:i.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:((c=l.response)==null?void 0:c.description)||"No description"})]}),e.jsxs(y,{className:"w-full sm:w-auto min-h-12 sm:min-h-0",variant:"destructive",size:"sm",onClick:()=>x(!0),children:[e.jsx(fe,{className:"mr-2 h-4 w-4"})," Delete"]})]}),e.jsx(sa,{app:l}),e.jsx(aa,{app:{id:((t=l.response)==null?void 0:t.id)??"",name:((r=l.response)==null?void 0:r.name)??""},open:m,onOpenChange:x,onDeleted:()=>{o("/dashboard/apps"),A({title:"Application deleted"})}})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(B,{className:"h-8 w-48"}),e.jsx(B,{className:"h-64 w-full rounded-lg"})]})}const _a=Object.freeze(Object.defineProperty({__proto__:null,AppDetailPage:ra},Symbol.toStringTag,{value:"Module"}));export{_a as A,Vs as C};

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