@sylphx/flow 0.2.3 → 0.2.5
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/chunk-057m762a.js +4 -0
- package/dist/{chunk-7nht27vs.js.map → chunk-057m762a.js.map} +1 -1
- package/dist/chunk-2j2gmjg5.js +107 -0
- package/dist/{chunk-wnaa55wn.js.map → chunk-2j2gmjg5.js.map} +6 -5
- package/dist/{chunk-asr22mbn.js → chunk-2nfq57ym.js} +1 -1
- package/dist/{chunk-cs1s5c3g.js → chunk-372bgp30.js} +3 -3
- package/dist/{chunk-cs1s5c3g.js.map → chunk-372bgp30.js.map} +1 -1
- package/dist/{chunk-m9nt0bj3.js → chunk-51kpynby.js} +3 -3
- package/dist/{chunk-m9nt0bj3.js.map → chunk-51kpynby.js.map} +1 -1
- package/dist/{chunk-1rptg3yg.js → chunk-585jp0rg.js} +1 -1
- package/dist/{chunk-hj6r7703.js → chunk-66qzap9m.js} +2 -2
- package/dist/{chunk-hj6r7703.js.map → chunk-66qzap9m.js.map} +1 -1
- package/dist/{chunk-z2rtyk3d.js → chunk-6eb5a8kv.js} +4 -4
- package/dist/{chunk-z2rtyk3d.js.map → chunk-6eb5a8kv.js.map} +1 -1
- package/dist/chunk-7h737bp8.js +4 -0
- package/dist/{chunk-fs3f7acb.js.map → chunk-7h737bp8.js.map} +2 -2
- package/dist/chunk-8ep9gk6d.js +4 -0
- package/dist/{chunk-5szm4n3x.js.map → chunk-8ep9gk6d.js.map} +2 -2
- package/dist/{chunk-bnxtqetr.js → chunk-9qzv4trv.js} +3 -3
- package/dist/{chunk-bnxtqetr.js.map → chunk-9qzv4trv.js.map} +2 -2
- package/dist/chunk-b0047ggx.js +3 -0
- package/dist/{chunk-w2vbmr93.js.map → chunk-b0047ggx.js.map} +2 -2
- package/dist/{chunk-gyq335sw.js → chunk-ceyg2zjg.js} +3 -3
- package/dist/{chunk-gyq335sw.js.map → chunk-ceyg2zjg.js.map} +1 -1
- package/dist/chunk-cjy100rr.js +6 -0
- package/dist/{chunk-d4hj6d4t.js.map → chunk-cjy100rr.js.map} +2 -2
- package/dist/{chunk-gh83x9ya.js → chunk-d6k94684.js} +1 -1
- package/dist/chunk-e74zv5ct.js +19 -0
- package/dist/chunk-e74zv5ct.js.map +10 -0
- package/dist/{chunk-hxj4eapp.js → chunk-etqfkn4f.js} +3 -3
- package/dist/{chunk-hxj4eapp.js.map → chunk-etqfkn4f.js.map} +1 -1
- package/dist/{chunk-8z1sf25t.js → chunk-f676awyz.js} +3 -3
- package/dist/{chunk-8z1sf25t.js.map → chunk-f676awyz.js.map} +1 -1
- package/dist/{chunk-sxy6vp20.js → chunk-f9yb2zk3.js} +2 -2
- package/dist/{chunk-sxy6vp20.js.map → chunk-f9yb2zk3.js.map} +1 -1
- package/dist/{chunk-hft1735c.js → chunk-fyvtp08n.js} +2 -2
- package/dist/{chunk-hft1735c.js.map → chunk-fyvtp08n.js.map} +1 -1
- package/dist/chunk-gmmm7xpw.js +23 -0
- package/dist/{chunk-jgsq3xax.js.map → chunk-gmmm7xpw.js.map} +4 -4
- package/dist/{chunk-xata5rw6.js → chunk-mtrcdhzn.js} +3 -3
- package/dist/{chunk-xata5rw6.js.map → chunk-mtrcdhzn.js.map} +1 -1
- package/dist/{chunk-8krxe10w.js → chunk-ny1s8fnh.js} +2 -2
- package/dist/{chunk-8krxe10w.js.map → chunk-ny1s8fnh.js.map} +1 -1
- package/dist/{chunk-4fr8q0jy.js → chunk-rsagxdqj.js} +71 -71
- package/dist/{chunk-4fr8q0jy.js.map → chunk-rsagxdqj.js.map} +3 -3
- package/dist/{chunk-vjf57v4h.js → chunk-rvx8bgqk.js} +3 -3
- package/dist/{chunk-vjf57v4h.js.map → chunk-rvx8bgqk.js.map} +1 -1
- package/dist/{chunk-9c2nr2fz.js → chunk-sgafqzer.js} +3 -3
- package/dist/{chunk-9c2nr2fz.js.map → chunk-sgafqzer.js.map} +2 -2
- package/dist/{chunk-s6g21d1g.js → chunk-vc4xy6dm.js} +3 -3
- package/dist/{chunk-s6g21d1g.js.map → chunk-vc4xy6dm.js.map} +1 -1
- package/dist/chunk-weshapwk.js +27 -0
- package/dist/{chunk-wrx1n6q6.js.map → chunk-weshapwk.js.map} +11 -4
- package/dist/{chunk-ndah8mn9.js → chunk-z61qdct1.js} +2 -2
- package/dist/{chunk-ndah8mn9.js.map → chunk-z61qdct1.js.map} +1 -1
- package/dist/index.js +332 -331
- package/dist/index.js.map +15 -12
- package/package.json +1 -1
- package/dist/chunk-5szm4n3x.js +0 -4
- package/dist/chunk-7nht27vs.js +0 -4
- package/dist/chunk-d4hj6d4t.js +0 -6
- package/dist/chunk-f06ma45b.js +0 -15
- package/dist/chunk-f06ma45b.js.map +0 -16
- package/dist/chunk-fs3f7acb.js +0 -4
- package/dist/chunk-jgsq3xax.js +0 -23
- package/dist/chunk-w2vbmr93.js +0 -3
- package/dist/chunk-wd9qbbe5.js +0 -5
- package/dist/chunk-wd9qbbe5.js.map +0 -10
- package/dist/chunk-wnaa55wn.js +0 -108
- package/dist/chunk-wrx1n6q6.js +0 -16
- /package/dist/{chunk-asr22mbn.js.map → chunk-2nfq57ym.js.map} +0 -0
- /package/dist/{chunk-1rptg3yg.js.map → chunk-585jp0rg.js.map} +0 -0
- /package/dist/{chunk-gh83x9ya.js.map → chunk-d6k94684.js.map} +0 -0
package/dist/chunk-wnaa55wn.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import{Lb as j,Ob as L}from"./chunk-sxy6vp20.js";async function k($,q){let{AI_PROVIDERS:H}=await import("./chunk-z2rtyk3d.js"),{getProvider:F}=await import("./chunk-xata5rw6.js"),z=$.getConfig(),G=F(q).getConfigSchema(),Y=G.map((h)=>({label:h.label,value:h.key}));$.sendMessage(`Configure ${H[q].name} - Select setting:`);let W=await $.waitForInput({type:"selection",questions:[{id:"key",question:"Which setting do you want to configure?",options:Y}]}),J=typeof W==="object"&&!Array.isArray(W)?W.key:"";if(!J)return"Configuration cancelled.";let Q=G.find((h)=>h.key===J),Z;if(Q?.type==="boolean"){$.sendMessage(`Select value for ${J}:`);let h=await $.waitForInput({type:"selection",questions:[{id:"value",question:`${Q.label}:`,options:[{label:"true",value:"true"},{label:"false",value:"false"}]}]});Z=typeof h==="object"&&!Array.isArray(h)?h.value:""}else{$.sendMessage(`Enter value for ${J}:`);let h=await $.waitForInput({type:"text",prompt:`${J}:`});Z=typeof h==="string"?h:""}if(!Z)return"Value is required.";let b={...z,providers:{...z.providers,[q]:{...z.providers?.[q],[J]:Z}}};if(!z?.defaultProvider)b.defaultProvider=q;$.setAIConfig(b),await $.saveConfig(b);let U=G.find((h)=>h.key===J)?.secret?"***":Z;return`Set ${H[q].name} ${J} to: ${U}`}var J$={id:"provider",label:"/provider",description:"Manage AI providers",args:[{name:"action",description:'Action: "use" or "set"',required:!1,loadOptions:async($)=>{return[{id:"use",label:"use",value:"use"},{id:"set",label:"set",value:"set"}]}},{name:"provider-name",description:"Provider name (anthropic, openai, google, openrouter)",required:!1,loadOptions:async($)=>{let{AI_PROVIDERS:q}=await import("./chunk-z2rtyk3d.js");return Object.values(q).map((H)=>({id:H.id,label:H.name,value:H.id}))}},{name:"key",description:"Setting key (for set action)",required:!1,loadOptions:async($)=>{let q=$[1];if(!q)return[];try{let{getProvider:H}=await import("./chunk-xata5rw6.js");return H(q).getConfigSchema().map((G)=>({id:G.key,label:G.label,value:G.key}))}catch(H){return[]}}},{name:"value",description:"Setting value (for set action)",required:!1,loadOptions:async($)=>{let q=$[1],H=$[2];if(!q||!H)return[];try{let{getProvider:F}=await import("./chunk-xata5rw6.js");if(F(q).getConfigSchema().find((Y)=>Y.key===H)?.type==="boolean")return[{id:"true",label:"true",value:"true"},{id:"false",label:"false",value:"false"}];return[]}catch(F){return[]}}}],execute:async($)=>{let{AI_PROVIDERS:q}=await import("./chunk-z2rtyk3d.js"),H=$.getConfig();if($.args.length===0){$.sendMessage("What do you want to do?");let F=await $.waitForInput({type:"selection",questions:[{id:"action",question:"Select action:",options:[{label:"Use a provider",value:"use"},{label:"Configure a provider",value:"set"}]}]}),z=typeof F==="object"&&!Array.isArray(F)?F.action:"";if(!z)return"Action cancelled.";let{getProvider:X}=await import("./chunk-xata5rw6.js"),G=Object.values(q).map((J)=>{let Q=!1;try{let Z=X(J.id),b=H?.providers?.[J.id];Q=b?Z.isConfigured(b):!1}catch{}return{label:`${J.name} ${Q?"✓":""}`,value:J.id}});$.sendMessage(z==="use"?"Which provider do you want to use?":"Which provider do you want to configure?");let Y=await $.waitForInput({type:"selection",questions:[{id:"provider",question:z==="use"?"Select provider to use:":"Select provider to configure:",options:G}]}),W=typeof Y==="object"&&!Array.isArray(Y)?Y.provider:"";if(!W)return"Provider selection cancelled.";if(z==="use"){let{getProvider:J}=await import("./chunk-xata5rw6.js"),Q=J(W),Z=H?.providers?.[W];if(!Z||!Q.isConfigured(Z)){$.sendMessage(`${q[W].name} is not configured yet.`);let O=await $.waitForInput({type:"selection",questions:[{id:"configure",question:"Do you want to configure it now?",options:[{label:"Yes, configure now",value:"yes"},{label:"No, cancel",value:"no"}]}]});if(!(typeof O==="object"&&!Array.isArray(O)?O.configure==="yes":!1))return"Cancelled. You can configure later using: /provider set";let M=await k($,W),D=$.getConfig(),y=D?.providers?.[W];if(!y||!Q.isConfigured(y))return`${M}
|
|
2
|
-
|
|
3
|
-
Provider still not fully configured. Please continue configuration with: /provider set ${W}`;$.sendMessage(M);let _=y,E={...D,defaultProvider:W},{getDefaultModel:u}=await import("./chunk-s6g21d1g.js"),T=await u(W,_);if(!T)return`Provider configured but failed to get default model for ${q[W].name}`;E.providers={...E.providers,[W]:{..._,"default-model":T}},$.setAIConfig(E),await $.saveConfig(E),$.setUISelectedProvider(W),$.setUISelectedModel(T);let w=$.getCurrentSessionId();if(w)$.updateSessionProvider(w,W,T);else $.createSession(W,T);return`Now using ${q[W].name} with model: ${T}`}let b={...H,defaultProvider:W},{getDefaultModel:K}=await import("./chunk-s6g21d1g.js"),U=await K(W,Z);if(!U)return`Failed to get default model for ${q[W].name}`;b.providers={...b.providers,[W]:{...Z,"default-model":U}},$.setAIConfig(b),await $.saveConfig(b);let h=$.getCurrentSessionId();if(h)$.updateSessionProvider(h,W,U);else $.createSession(W,U);return`Switched to ${q[W].name}`}else return await k($,W)}if($.args.length===1&&$.args[0]==="use"){let{getProvider:F}=await import("./chunk-xata5rw6.js"),z=Object.values(q).map((K)=>{let U=!1;try{let h=F(K.id),O=H?.providers?.[K.id];U=O?h.isConfigured(O):!1}catch{}return{label:`${K.name} ${U?"✓":""}`,value:K.id}});$.sendMessage("Which provider do you want to use?");let X=await $.waitForInput({type:"selection",questions:[{id:"provider",question:"Select provider:",options:z}]}),G=typeof X==="object"&&!Array.isArray(X)?X.provider:"";if(!G)return"Provider selection cancelled.";let Y=F(G),W=H?.providers?.[G];if(!W||!Y.isConfigured(W)){$.sendMessage(`${q[G].name} is not configured yet.`);let K=await $.waitForInput({type:"selection",questions:[{id:"configure",question:"Do you want to configure it now?",options:[{label:"Yes, configure now",value:"yes"},{label:"No, cancel",value:"no"}]}]});if(!(typeof K==="object"&&!Array.isArray(K)?K.configure==="yes":!1))return"Cancelled. You can configure later using: /provider set";let h=await k($,G),O=$.getConfig(),B=O?.providers?.[G];if(!B||!Y.isConfigured(B))return`${h}
|
|
4
|
-
|
|
5
|
-
Provider still not fully configured. Please continue configuration with: /provider set ${G}`;$.sendMessage(h);let M=B,D={...O,defaultProvider:G},{getDefaultModel:y}=await import("./chunk-s6g21d1g.js"),_=await y(G,M);if(!_)return`Provider configured but failed to get default model for ${q[G].name}`;D.providers={...D.providers,[G]:{...M,"default-model":_}},$.setAIConfig(D),await $.saveConfig(D),$.setUISelectedProvider(G),$.setUISelectedModel(_);let E=$.getCurrentSessionId();if(E)$.updateSessionProvider(E,G,_);else $.createSession(G,_);return`Now using ${q[G].name} with model: ${_}`}let J={...H,defaultProvider:G},{getDefaultModel:Q}=await import("./chunk-s6g21d1g.js"),Z=await Q(G,W);if(!Z)return`Failed to get default model for ${q[G].name}`;J.providers={...J.providers,[G]:{...W,"default-model":Z}},$.setAIConfig(J),await $.saveConfig(J);let b=$.getCurrentSessionId();if(b)$.updateSessionProvider(b,G,Z);else $.createSession(G,Z);return`Switched to ${q[G].name}`}if($.args.length===2&&$.args[0]==="use"){let F=$.args[1];if(!(F in q))return`Invalid provider: ${F}. Available: ${Object.keys(q).join(", ")}`;let{getProvider:z}=await import("./chunk-xata5rw6.js"),X=z(F),G=H?.providers?.[F];if(!G||!X.isConfigured(G))return`${q[F].name} is not configured. Use: /provider set ${F}`;let Y={...H,defaultProvider:F},{getDefaultModel:W}=await import("./chunk-s6g21d1g.js"),J=await W(F,G);if(!J)return`Failed to get default model for ${q[F].name}`;Y.providers={...Y.providers,[F]:{...G,"default-model":J}},$.setAIConfig(Y),await $.saveConfig(Y);let Q=$.getCurrentSessionId();if(Q)$.updateSessionProvider(Q,F,J);else $.createSession(F,J);return`Switched to ${q[F].name}`}if($.args.length===1&&$.args[0]==="set"){let F=Object.values(q).map((b)=>({label:b.name,value:b.id}));$.sendMessage("Which provider do you want to configure?");let z=await $.waitForInput({type:"selection",questions:[{id:"provider",question:"Select provider:",options:F}]}),X=typeof z==="object"&&!Array.isArray(z)?z.provider:"";if(!X)return"Provider selection cancelled.";let{getProvider:G}=await import("./chunk-xata5rw6.js"),W=G(X).getConfigSchema(),J=W.map((b)=>({label:b.label,value:b.key}));$.sendMessage(`Configure ${q[X].name} - Select setting:`);let Q=await $.waitForInput({type:"selection",questions:[{id:"key",question:"Which setting do you want to configure?",options:J}]}),Z=typeof Q==="object"&&!Array.isArray(Q)?Q.key:"";if(!Z)return"Configuration cancelled.";{let b=W.find((B)=>B.key===Z),K;if(b?.type==="boolean"){$.sendMessage(`Select value for ${Z}:`);let B=await $.waitForInput({type:"selection",questions:[{id:"value",question:`${b.label}:`,options:[{label:"true",value:"true"},{label:"false",value:"false"}]}]});K=typeof B==="object"&&!Array.isArray(B)?B.value:""}else{$.sendMessage(`Enter value for ${Z}:`);let B=await $.waitForInput({type:"text",placeholder:`Enter ${Z}...`});K=typeof B==="string"?B:""}if(!K)return"Value is required.";let U={...H,providers:{...H.providers,[X]:{...H.providers?.[X],[Z]:K}}};if(!H?.defaultProvider)U.defaultProvider=X;$.setAIConfig(U),await $.saveConfig(U);let O=W.find((B)=>B.key===Z)?.secret?"***":K;return`Set ${q[X].name} ${Z} to: ${O}`}}if($.args.length===2&&$.args[0]==="set"){let F=$.args[1];if(!(F in q))return`Invalid provider: ${F}. Available: ${Object.keys(q).join(", ")}`;let{getProvider:z}=await import("./chunk-xata5rw6.js"),G=z(F).getConfigSchema(),Y=G.map((Q)=>({label:Q.label,value:Q.key}));$.sendMessage(`Configure ${q[F].name} - Select setting:`);let W=await $.waitForInput({type:"selection",questions:[{id:"key",question:"Which setting do you want to configure?",options:Y}]}),J=typeof W==="object"&&!Array.isArray(W)?W.key:"";if(!J)return"Configuration cancelled.";{let Q=G.find((h)=>h.key===J),Z;if(Q?.type==="boolean"){$.sendMessage(`Select value for ${J}:`);let h=await $.waitForInput({type:"selection",questions:[{id:"value",question:`${Q.label}:`,options:[{label:"true",value:"true"},{label:"false",value:"false"}]}]});Z=typeof h==="object"&&!Array.isArray(h)?h.value:""}else{$.sendMessage(`Enter value for ${J}:`);let h=await $.waitForInput({type:"text",placeholder:`Enter ${J}...`});Z=typeof h==="string"?h:""}if(!Z)return"Value is required.";let b={...H,providers:{...H.providers,[F]:{...H.providers?.[F],[J]:Z}}};if(!H?.defaultProvider)b.defaultProvider=F;$.setAIConfig(b),await $.saveConfig(b);let U=G.find((h)=>h.key===J)?.secret?"***":Z;return`Set ${q[F].name} ${J} to: ${U}`}}if($.args.length>=4&&$.args[0]==="set"){let F=$.args[1],z=$.args[2],X=$.args.slice(3).join(" ");if(!(F in q))return`Invalid provider: ${F}. Available: ${Object.keys(q).join(", ")}`;let{getProvider:G}=await import("./chunk-xata5rw6.js"),W=G(F).getConfigSchema(),J=W.map((K)=>K.key);if(!J.includes(z))return`Invalid key: ${z}. Valid keys for ${F}: ${J.join(", ")}`;let Q={...H,providers:{...H.providers,[F]:{...H.providers?.[F],[z]:X}}};if(!H?.defaultProvider)Q.defaultProvider=F;$.setAIConfig(Q),await $.saveConfig(Q);let b=W.find((K)=>K.key===z)?.secret?"***":X;return`Set ${q[F].name} ${z} to: ${b}`}return`Usage:
|
|
6
|
-
/provider - Select action and provider
|
|
7
|
-
/provider use - Select provider to use
|
|
8
|
-
/provider use [name] - Switch to provider
|
|
9
|
-
/provider set - Configure a provider
|
|
10
|
-
/provider set [name] - Configure specific provider
|
|
11
|
-
/provider set [name] [key] [value] - Set provider config directly`}},p=J$;var Q$={id:"model",label:"/model",description:"Switch AI model",args:[{name:"model-name",description:"Model to switch to",required:!1,loadOptions:async($,q)=>{try{let H=q?.getConfig();if(!H?.providers)return[];let z=q?.getCurrentSession()?.provider||H.defaultProvider;if(!z)return[];let X=H.providers[z];if(!X)return[];try{let{fetchModels:G}=await import("./chunk-7nht27vs.js");return(await G(z,X)).map((W)=>({id:W.id,label:W.name,value:W.id}))}catch(G){if(q)q.addLog(`Failed to fetch models for ${z}: ${G instanceof Error?G.message:String(G)}`);return[]}}catch(H){if(q)q.addLog(`Error loading models: ${H instanceof Error?H.message:String(H)}`);return[]}}}],execute:async($)=>{let q;if($.args.length===0)try{let Y=$.getConfig();if(!Y?.providers)return"No providers configured. Please configure a provider first.";let J=$.getCurrentSession()?.provider||Y.defaultProvider;if(!J)return"No provider selected. Use /provider to select a provider first.";let Q=Y.providers[J];if(!Q)return`Provider ${J} is not configured.`;let Z=[];try{let{fetchModels:K}=await import("./chunk-7nht27vs.js"),U=await K(J,Q);Z=U.map((h)=>({label:h.name,value:h.id})),$.addLog(`Loaded ${U.length} models from ${J}`)}catch(K){let U=K instanceof Error?K.message:String(K);return $.addLog(`Failed to fetch models for ${J}: ${U}`),`Failed to load models from ${J}: ${U}`}if(Z.length===0)return`No models available for ${J}`;$.sendMessage("Which model do you want to use?");let b=await $.waitForInput({type:"selection",questions:[{id:"model",question:"Which model do you want to use?",options:Z}]});q=typeof b==="object"&&!Array.isArray(b)?b.model:""}catch(Y){return`Failed to load models: ${Y instanceof Error?Y.message:String(Y)}`}else q=$.args[0];let H=$.getCurrentSession(),F=$.getConfig(),z=H?.provider||F?.defaultProvider;if(!z)return"No provider configured. Please configure a provider first.";let X={...F,defaultModel:q,providers:{...F.providers,[z]:{...F.providers?.[z],"default-model":q}}};$.setAIConfig(X),await $.saveConfig(X);let G=$.getCurrentSessionId();if(G)$.updateSessionModel(G,q);else $.createSession(z,q);return`Switched to model: ${q}`}},v=Q$;var X$={id:"logs",label:"/logs",description:"View debug logs",execute:async($)=>{return $.navigateTo("logs"),"Opening debug logs..."}},I=X$;var Y$={id:"help",label:"/help",description:"Show available commands",execute:async($)=>{let{commands:q}=await import("./chunk-wnaa55wn.js");return`Available commands:
|
|
12
|
-
${q.map((F)=>{let z=F.args?` ${F.args.map((X)=>`[${X.name}]`).join(" ")}`:"";return`${F.label}${z} - ${F.description}`}).join(`
|
|
13
|
-
`)}`}},f=Y$;var Z$={id:"survey",label:"/survey",description:"Test multi-question selection (demo)",execute:async($)=>{$.sendMessage("Let me ask you a few questions...");let q=await $.waitForInput({type:"selection",questions:[{id:"language",question:"What is your favorite programming language?",options:[{label:"TypeScript"},{label:"JavaScript"},{label:"Python"},{label:"Rust"},{label:"Go"}]},{id:"framework",question:"Which framework do you prefer?",options:[{label:"React"},{label:"Vue"},{label:"Angular"},{label:"Svelte"},{label:"Solid"}]},{id:"editor",question:"What is your favorite code editor?",options:[{label:"Visual Studio Code"},{label:"Vim/Neovim"},{label:"Emacs"},{label:"Sublime Text"},{label:"Atom"}]}]});if(typeof q==="object"&&!Array.isArray(q))return`Survey completed! Your answers: ${Object.entries(q).map(([F,z])=>`${F}: ${z}`).join(", ")}`;return"Survey cancelled."}},l=Z$;var b$={id:"context",label:"/context",description:"Display context window usage and token breakdown",execute:async($)=>{let{countTokens:q,formatTokenCount:H}=await import("./chunk-1rptg3yg.js"),{getSystemPrompt:F}=await import("./chunk-bnxtqetr.js"),{getAISDKTools:z}=await import("./chunk-f06ma45b.js"),X=$.getCurrentSession();if(!X)return"No active session. Start chatting first to see context usage.";let G=X.model,W=((N)=>{if(N.includes("gpt-4")){if(N.includes("32k")||N.includes("turbo"))return 128000;if(N.includes("vision"))return 128000;return 8192}if(N.includes("gpt-3.5")){if(N.includes("16k"))return 16385;return 4096}if(N.includes("claude-3")){if(N.includes("opus"))return 200000;if(N.includes("sonnet"))return 200000;if(N.includes("haiku"))return 200000}return 200000})(G);$.addLog(`[Context] Calculating token counts for ${G} (limit: ${H(W)})...`);let J=F(),Q=await q(J,G),{getEnabledRulesContent:Z}=await import("./chunk-d4hj6d4t.js"),{getCurrentSystemPrompt:b}=await import("./chunk-fs3f7acb.js"),K="You are Sylphx, an AI development assistant.",U={};try{U["Base prompt"]=await q(K,G);let N=Z();if(N)U.Rules=await q(N,G);let V=b();U["Agent prompt"]=await q(V,G)}catch(N){$.addLog(`[Context] Failed to calculate system prompt breakdown: ${N}`)}let h=z(),O={},B=0;for(let[N,V]of Object.entries(h)){let S={name:N,description:V.description||"",parameters:V.parameters||{}},R=JSON.stringify(S,null,0),P=await q(R,G);O[N]=P,B+=P}let M=0;for(let N of X.messages){let V=N.content;if(N.attachments&&N.attachments.length>0)try{let{readFile:R}=await import("node:fs/promises"),C=(await Promise.all(N.attachments.map(async(A)=>{try{let m=await R(A.path,"utf8");return{path:A.relativePath,content:m}}catch{return{path:A.relativePath,content:"[Error reading file]"}}}))).map((A)=>`
|
|
14
|
-
|
|
15
|
-
<file path="${A.path}">
|
|
16
|
-
${A.content}
|
|
17
|
-
</file>`).join("");V+=C}catch(R){console.warn("[Context] Failed to read attachments for token count:",R)}let S=await q(V,G);M+=S}let D=Q+B+M,y=W-D,_=Math.floor(W*0.225),E=y-_,u=(D/W*100).toFixed(1),T=(Q/W*100).toFixed(1),w=(B/W*100).toFixed(1),o=(M/W*100).toFixed(1),t=(E/W*100).toFixed(1),e=(_/W*100).toFixed(1),$$=()=>{let V=Math.floor(Q/W*30),S=Math.floor(B/W*30),R=Math.floor(M/W*30),C=30-(V+S+R),A="█".repeat(V)+"░".repeat(30-V),m="░".repeat(V)+"█".repeat(S)+"░".repeat(30-V-S),z$="░".repeat(V+S)+"█".repeat(R)+"░".repeat(C);return[A,m,z$]},[q$,W$,F$]=$$(),G$=Object.entries(O).sort((N,V)=>V[1]-N[1]).map(([N,V])=>` ${N}: ${H(V)} tokens`).join(`
|
|
18
|
-
`),H$=Object.entries(U).map(([N,V])=>` ${N}: ${H(V)} tokens`).join(`
|
|
19
|
-
`);return`
|
|
20
|
-
Context Usage: ${H(D)}/${H(W)} tokens (${u}%)
|
|
21
|
-
Model: ${G}
|
|
22
|
-
|
|
23
|
-
Visual Breakdown:
|
|
24
|
-
${q$} System prompt: ${H(Q)} (${T}%)
|
|
25
|
-
${W$} Tools: ${H(B)} (${w}%)
|
|
26
|
-
${F$} Messages: ${H(M)} (${o}%)
|
|
27
|
-
|
|
28
|
-
Available Space:
|
|
29
|
-
• Free: ${H(E)} tokens (${t}%)
|
|
30
|
-
• Buffer: ${H(_)} tokens (${e}%)
|
|
31
|
-
|
|
32
|
-
System Prompt Breakdown:
|
|
33
|
-
${H$}
|
|
34
|
-
|
|
35
|
-
System Tools (${Object.keys(h).length} total):
|
|
36
|
-
${G$}
|
|
37
|
-
`.trim()}},g=b$;var h$={id:"sessions",label:"/sessions",description:"View and switch between chat sessions",execute:async($)=>{let{formatSessionDisplay:q}=await import("./chunk-wd9qbbe5.js"),H=$.getSessions();if(H.length===0)return"No sessions available. Start chatting to create a session.";let F=$.getCurrentSessionId(),z=[...H].sort((Q,Z)=>{let b=Z.updated-Q.updated;if(b!==0)return b;return Z.created-Q.created}),X=z.map((Q)=>{let Z=Q.id===F,b=q(Q.title,Q.created);return{label:Z?`${b} (current)`:b,value:Q.id}});$.sendMessage("Select a session to switch to:");let G=await $.waitForInput({type:"selection",questions:[{id:"session",question:"Which session do you want to switch to?",options:X}]}),Y=typeof G==="object"&&!Array.isArray(G)?G.session:"";if(!Y)return"Session selection cancelled.";$.setCurrentSession(Y);let W=z.find((Q)=>Q.id===Y);return`Switched to session: ${W?q(W.title,W.created):"Unknown session"}`}},a=h$;var U$={id:"new",label:"/new",description:"Create a new chat session",execute:async($)=>{let q=$.getConfig();if(!q?.defaultProvider||!q?.defaultModel)return"No AI provider configured. Use /provider to configure a provider first.";let H=$.createSession(q.defaultProvider,q.defaultModel);return $.setCurrentSession(H),`Created new chat session with ${q.defaultProvider} (${q.defaultModel})`}},x=U$;var K$={id:"bashes",label:"/bashes",description:"Manage background bash processes",execute:async($)=>{let{bashManager:q}=await import("./chunk-vjf57v4h.js"),H=q.list();if(H.length===0)return"No background bash processes found.";let F=H.map((W)=>{let J=W.isRunning?"[*] Running":"[x] Completed",Q=Math.floor(W.duration/1000),Z=Q>60?`${Math.floor(Q/60)}m ${Q%60}s`:`${Q}s`;return{label:`${J} [${Z}] ${W.command}`,value:W.id}});$.sendMessage(`Found ${H.length} background bash process${H.length!==1?"es":""}:`);let z=await $.waitForInput({type:"selection",questions:[{id:"action",question:"What do you want to do?",options:[{label:"View details",value:"view"},{label:"Kill a process",value:"kill"},{label:"Cancel",value:"cancel"}]}]}),X=typeof z==="object"&&!Array.isArray(z)?z.action:"";if(!X||X==="cancel")return"Cancelled.";$.sendMessage("Select a process:");let G=await $.waitForInput({type:"selection",questions:[{id:"process",question:"Which process?",options:F}]}),Y=typeof G==="object"&&!Array.isArray(G)?G.process:"";if(!Y)return"No process selected.";if(X==="view"){let W=q.getOutput(Y);if(!W)return"Process not found.";let J=W.isRunning?"Running":`Completed (exit code: ${W.exitCode})`,Q=Math.floor(W.duration/1000),Z=`
|
|
38
|
-
Process: ${Y}
|
|
39
|
-
Command: ${W.command}
|
|
40
|
-
Status: ${J}
|
|
41
|
-
Duration: ${Q}s
|
|
42
|
-
|
|
43
|
-
=== stdout ===
|
|
44
|
-
${W.stdout||"(empty)"}
|
|
45
|
-
`;if(W.stderr)Z+=`
|
|
46
|
-
=== stderr ===
|
|
47
|
-
${W.stderr}`;return Z.trim()}if(X==="kill"){if(!q.kill(Y))return"Failed to kill process (not found).";return`Sent termination signal to process ${Y}`}return"Unknown action."}},c=K$;var j$={id:"agent",label:"/agent",description:"Switch between AI agents with different system prompts",args:[{name:"agent-name",description:"Agent to switch to (coder, planner, etc.)",required:!1,loadOptions:async($)=>{let{getAllAgents:q}=await import("./chunk-fs3f7acb.js");return q().map((F)=>({id:F.id,label:`${F.metadata.name} - ${F.metadata.description}`,value:F.id}))}}],execute:async($)=>{let{getAllAgents:q,getCurrentAgent:H,switchAgent:F}=await import("./chunk-fs3f7acb.js"),z;if($.args.length===0){let W=q(),J=H();if(W.length===0)return"No agents available.";let Q=W.map((b)=>{return{label:b.id===J.id?`${b.metadata.name} (current) - ${b.metadata.description}`:`${b.metadata.name} - ${b.metadata.description}`,value:b.id}});$.sendMessage("Which agent do you want to use?");let Z=await $.waitForInput({type:"selection",questions:[{id:"agent",question:"Select agent:",options:Q}]});if(z=typeof Z==="object"&&!Array.isArray(Z)?Z.agent:"",!z)return"Agent selection cancelled."}else z=$.args[0];if(!F(z))return`Agent not found: ${z}. Use /agent to see available agents.`;let{getAgentById:G}=await import("./chunk-fs3f7acb.js"),Y=G(z);if(!Y)return"Failed to get agent details.";return`Switched to agent: ${Y.metadata.name}
|
|
48
|
-
${Y.metadata.description}`}},s=j$;var L$={id:"rules",label:"/rules",description:"Select enabled shared system prompt rules",execute:async($)=>{let{getAllRules:q,getEnabledRuleIds:H,setEnabledRules:F}=await import("./chunk-d4hj6d4t.js"),z=q(),X=H();if(z.length===0)return"No rules available.";let G=z.map((U)=>({label:`${U.metadata.name} - ${U.metadata.description}`,value:U.id}));$.sendMessage(`Select rules to enable (currently ${X.length} enabled):`);let Y=await $.waitForInput({type:"selection",questions:[{id:"rules",question:"Select all rules you want to enable:",options:G,multiSelect:!0,preSelected:X}]}),W=typeof Y==="object"&&!Array.isArray(Y)?Array.isArray(Y.rules)?Y.rules:[]:[];if(!Array.isArray(W))return"Rule selection cancelled.";if(!F(W))return"Failed to update rules.";let Q=W.length,Z=z.length-Q,K=z.filter((U)=>W.includes(U.id)).map((U)=>` • ${U.metadata.name}`).join(`
|
|
49
|
-
`);return`Updated rules configuration:
|
|
50
|
-
${Q} enabled, ${Z} disabled
|
|
51
|
-
|
|
52
|
-
Enabled rules:
|
|
53
|
-
${K||" (none)"}`}},i=L$;var N$={id:"compact",label:"/compact",description:"Summarize current session and create a new session with the summary",execute:async($)=>{let q=$.getCurrentSession();if(!q)return"No active session to compact.";if(q.messages.length===0)return"Current session has no messages to compact.";let H=$.getConfig();if(!H?.defaultProvider||!H?.defaultModel)return"No AI provider configured. Use /provider to configure a provider first.";$.sendMessage("Analyzing conversation and creating detailed summary...");try{let{getProvider:F}=await import("./chunk-xata5rw6.js"),{streamText:z}=await import("./chunk-9c2nr2fz.js"),{getSystemPrompt:X}=await import("./chunk-bnxtqetr.js"),G=F(q.provider),Y=H.providers?.[q.provider];if(!Y||!G.isConfigured(Y))return`Provider ${q.provider} is not properly configured.`;let W=G.createClient(Y,q.model),Q=`You are a conversation summarizer. Your task is to create a comprehensive, detailed summary of the following conversation that preserves ALL important information.
|
|
54
|
-
|
|
55
|
-
CRITICAL REQUIREMENTS:
|
|
56
|
-
1. DO NOT omit any important details, decisions, code snippets, file paths, commands, or configurations
|
|
57
|
-
2. Preserve technical accuracy - include exact function names, variable names, file paths, and command syntax
|
|
58
|
-
3. Maintain chronological flow of the conversation
|
|
59
|
-
4. Highlight key decisions, problems solved, and solutions implemented
|
|
60
|
-
5. Include all context that would be needed to continue this conversation naturally
|
|
61
|
-
6. Use clear markdown formatting with sections and bullet points
|
|
62
|
-
7. If code was discussed or written, include the essential parts or describe what was implemented
|
|
63
|
-
|
|
64
|
-
The summary will be used to start a fresh conversation while maintaining full context.
|
|
65
|
-
|
|
66
|
-
CONVERSATION TO SUMMARIZE:
|
|
67
|
-
${q.messages.map((M)=>{let y=M.content.filter((_)=>_.type==="text").map((_)=>_.content).join(`
|
|
68
|
-
`);if(M.attachments&&M.attachments.length>0){let _=M.attachments.map((E)=>`[Attached: ${E.relativePath}]`).join(`
|
|
69
|
-
`);y+=`
|
|
70
|
-
${_}`}return`${M.role==="user"?"User":"Assistant"}: ${y}`}).join(`
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
`)}
|
|
75
|
-
|
|
76
|
-
Please provide a detailed, structured summary now:`,Z=await z({model:W,messages:[{role:"user",content:Q}],maxTokens:4096}),b="";for await(let M of Z.textStream)b+=M;if(!b||b.trim().length===0)return"Failed to generate summary. Please try again.";let K=$.createSession(q.provider,q.model),{useAppStore:U}=await import("./chunk-wrx1n6q6.js");U.getState().addMessage(K,"user",[{type:"text",content:`# Previous Conversation Summary
|
|
77
|
-
|
|
78
|
-
${b}
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
*This is a summary of our previous conversation. You can reference any details from above as we continue our discussion.*`}]),$.setCurrentSession(K);let O=q.messages.length;return`✓ Compacted session "${q.title||"Untitled session"}" (${O} messages)
|
|
83
|
-
✓ Created new session with detailed summary
|
|
84
|
-
✓ Switched to new session
|
|
85
|
-
|
|
86
|
-
You can now continue the conversation with full context preserved.`}catch(F){let z=F instanceof Error?F.message:String(F);return $.addLog(`[Compact] Error: ${z}`),`Failed to compact session: ${z}`}}},d=N$;var r={id:"notifications",label:"/notifications",description:"Manage notification settings for AI responses",args:[{name:"action",description:"Action to perform (show, enable, disable)",required:!0,suggestions:["show","enable","disable"]},{name:"type",description:"Notification type to configure (os, terminal, sound, all)",required:!1,suggestions:["os","terminal","sound","all"]}],async execute($,q){let{updateNotificationSettings:H,notificationSettings:F}=q;if($.length===0){q.updateOutput(`
|
|
87
|
-
❌ Please specify an action: show, enable, or disable
|
|
88
|
-
`);return}let z=$[0].toLowerCase();switch(z){case"show":q.updateOutput(`
|
|
89
|
-
\uD83D\uDD14 Notification Settings:
|
|
90
|
-
`),q.updateOutput(` OS Notifications: ${F.osNotifications?"✅ Enabled":"❌ Disabled"}
|
|
91
|
-
`),q.updateOutput(` Terminal Notifications: ${F.terminalNotifications?"✅ Enabled":"❌ Disabled"}
|
|
92
|
-
`),q.updateOutput(` Sound Effects: ${F.sound?"✅ Enabled":"❌ Disabled"}
|
|
93
|
-
`),q.updateOutput(`
|
|
94
|
-
Use /notifications enable/disable [type] to change settings.
|
|
95
|
-
`);break;case"enable":case"disable":{let X=z==="enable";if($.length===1||$[1]==="all")H({osNotifications:X,terminalNotifications:X,sound:X}),q.updateOutput(`
|
|
96
|
-
${X?"✅":"❌"} All notifications ${X?"enabled":"disabled"}
|
|
97
|
-
`);else{let G=$[1].toLowerCase(),Y={};switch(G){case"os":Y.osNotifications=X;break;case"terminal":Y.terminalNotifications=X;break;case"sound":Y.sound=X;break;default:q.updateOutput(`
|
|
98
|
-
❌ Unknown notification type: ${G}
|
|
99
|
-
`),q.updateOutput(`Valid types: os, terminal, sound, all
|
|
100
|
-
`);return}H(Y),q.updateOutput(`
|
|
101
|
-
${X?"✅":"❌"} ${G} notifications ${X?"enabled":"disabled"}
|
|
102
|
-
`)}break}default:q.updateOutput(`
|
|
103
|
-
❌ Unknown action: ${z}
|
|
104
|
-
`),q.updateOutput(`Valid actions: show, enable, disable
|
|
105
|
-
`)}}};var n=[p,v,s,i,d,r,I,f,l,g,a,x,c];function d$($){return n.find((q)=>q.id===$)}function r$($){return n.find((q)=>q.label===$)}export{r$ as getCommandByLabel,d$ as getCommand,n as commands};
|
|
106
|
-
export{n as s};
|
|
107
|
-
|
|
108
|
-
//# debugId=B900832BE92D553664756E2164756E21
|
package/dist/chunk-wrx1n6q6.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{pa as k}from"./chunk-jgsq3xax.js";import"./chunk-m9nt0bj3.js";import{Lb as _Z,Mb as PZ}from"./chunk-sxy6vp20.js";var eY=PZ((IZ,ZY)=>{(function(){function Z(Y,Q){Object.defineProperty(W.prototype,Y,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",Q[0],Q[1])}})}function X(Y){if(Y===null||typeof Y!=="object")return null;return Y=gY&&Y[gY]||Y["@@iterator"],typeof Y==="function"?Y:null}function G(Y,Q){Y=(Y=Y.constructor)&&(Y.displayName||Y.name)||"ReactClass";var $=Y+"."+Q;bY[$]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",Q,Y),bY[$]=!0)}function W(Y,Q,$){this.props=Y,this.context=Q,this.refs=NY,this.updater=$||yY}function B(){}function U(Y,Q,$){this.props=Y,this.context=Q,this.refs=NY,this.updater=$||yY}function K(){}function J(Y){return""+Y}function M(Y){try{J(Y);var Q=!1}catch(q){Q=!0}if(Q){Q=console;var $=Q.error,H=typeof Symbol==="function"&&Symbol.toStringTag&&Y[Symbol.toStringTag]||Y.constructor.name||"Object";return $.call(Q,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",H),J(Y)}}function O(Y){if(Y==null)return null;if(typeof Y==="function")return Y.$$typeof===DZ?null:Y.displayName||Y.name||null;if(typeof Y==="string")return Y;switch(Y){case MY:return"Fragment";case kY:return"Profiler";case TY:return"StrictMode";case vY:return"Suspense";case EZ:return"SuspenseList";case mY:return"Activity"}if(typeof Y==="object")switch(typeof Y.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),Y.$$typeof){case AY:return"Portal";case fY:return Y.displayName||"Context";case zY:return(Y._context.displayName||"Context")+".Consumer";case SY:var Q=Y.render;return Y=Y.displayName,Y||(Y=Q.displayName||Q.name||"",Y=Y!==""?"ForwardRef("+Y+")":"ForwardRef"),Y;case wY:return Q=Y.displayName||null,Q!==null?Q:O(Y.type)||"Memo";case u:Q=Y._payload,Y=Y._init;try{return O(Y(Q))}catch($){}}return null}function D(Y){if(Y===MY)return"<>";if(typeof Y==="object"&&Y!==null&&Y.$$typeof===u)return"<...>";try{var Q=O(Y);return Q?"<"+Q+">":"<...>"}catch($){return"<...>"}}function x(){var Y=w.A;return Y===null?null:Y.getOwner()}function E(){return Error("react-stack-top-frame")}function V(Y){if(a.call(Y,"key")){var Q=Object.getOwnPropertyDescriptor(Y,"key").get;if(Q&&Q.isReactWarning)return!1}return Y.key!==void 0}function _(Y,Q){function $(){cY||(cY=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",Q))}$.isReactWarning=!0,Object.defineProperty(Y,"key",{get:$,configurable:!0})}function I(){var Y=O(this.type);return pY[Y]||(pY[Y]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),Y=this.props.ref,Y!==void 0?Y:null}function A(Y,Q,$,H,q,N){var z=$.ref;return Y={$$typeof:KY,type:Y,key:Q,props:$,_owner:H},(z!==void 0?z:null)!==null?Object.defineProperty(Y,"ref",{enumerable:!1,get:I}):Object.defineProperty(Y,"ref",{enumerable:!1,value:null}),Y._store={},Object.defineProperty(Y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(Y,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(Y,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(Y,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:N}),Object.freeze&&(Object.freeze(Y.props),Object.freeze(Y)),Y}function LZ(Y,Q){return Q=A(Y.type,Q,Y.props,Y._owner,Y._debugStack,Y._debugTask),Y._store&&(Q._store.validated=Y._store.validated),Q}function IY(Y){m(Y)?Y._store&&(Y._store.validated=1):typeof Y==="object"&&Y!==null&&Y.$$typeof===u&&(Y._payload.status==="fulfilled"?m(Y._payload.value)&&Y._payload.value._store&&(Y._payload.value._store.validated=1):Y._store&&(Y._store.validated=1))}function m(Y){return typeof Y==="object"&&Y!==null&&Y.$$typeof===KY}function OZ(Y){var Q={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function($){return Q[$]})}function UY(Y,Q){return typeof Y==="object"&&Y!==null&&Y.key!=null?(M(Y.key),OZ(""+Y.key)):Q.toString(36)}function xZ(Y){switch(Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason;default:switch(typeof Y.status==="string"?Y.then(K,K):(Y.status="pending",Y.then(function(Q){Y.status==="pending"&&(Y.status="fulfilled",Y.value=Q)},function(Q){Y.status==="pending"&&(Y.status="rejected",Y.reason=Q)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}function g(Y,Q,$,H,q){var N=typeof Y;if(N==="undefined"||N==="boolean")Y=null;var z=!1;if(Y===null)z=!0;else switch(N){case"bigint":case"string":case"number":z=!0;break;case"object":switch(Y.$$typeof){case KY:case AY:z=!0;break;case u:return z=Y._init,g(z(Y._payload),Q,$,H,q)}}if(z){z=Y,q=q(z);var R=H===""?"."+UY(z,0):H;return uY(q)?($="",R!=null&&($=R.replace(nY,"$&/")+"/"),g(q,Q,$,"",function(T){return T})):q!=null&&(m(q)&&(q.key!=null&&(z&&z.key===q.key||M(q.key)),$=LZ(q,$+(q.key==null||z&&z.key===q.key?"":(""+q.key).replace(nY,"$&/")+"/")+R),H!==""&&z!=null&&m(z)&&z.key==null&&z._store&&!z._store.validated&&($._store.validated=2),q=$),Q.push(q)),1}if(z=0,R=H===""?".":H+":",uY(Y))for(var L=0;L<Y.length;L++)H=Y[L],N=R+UY(H,L),z+=g(H,Q,$,N,q);else if(L=X(Y),typeof L==="function")for(L===Y.entries&&(iY||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),iY=!0),Y=L.call(Y),L=0;!(H=Y.next()).done;)H=H.value,N=R+UY(H,L++),z+=g(H,Q,$,N,q);else if(N==="object"){if(typeof Y.then==="function")return g(xZ(Y),Q,$,H,q);throw Q=String(Y),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(Y).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return z}function s(Y,Q,$){if(Y==null)return Y;var H=[],q=0;return g(Y,H,"","",function(N){return Q.call($,N,q++)}),H}function RZ(Y){if(Y._status===-1){var Q=Y._ioInfo;Q!=null&&(Q.start=Q.end=performance.now()),Q=Y._result;var $=Q();if($.then(function(q){if(Y._status===0||Y._status===-1){Y._status=1,Y._result=q;var N=Y._ioInfo;N!=null&&(N.end=performance.now()),$.status===void 0&&($.status="fulfilled",$.value=q)}},function(q){if(Y._status===0||Y._status===-1){Y._status=2,Y._result=q;var N=Y._ioInfo;N!=null&&(N.end=performance.now()),$.status===void 0&&($.status="rejected",$.reason=q)}}),Q=Y._ioInfo,Q!=null){Q.value=$;var H=$.displayName;typeof H==="string"&&(Q.name=H)}Y._status===-1&&(Y._status=0,Y._result=$)}if(Y._status===1)return Q=Y._result,Q===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
2
|
-
|
|
3
|
-
Your code should look like:
|
|
4
|
-
const MyComponent = lazy(() => import('./MyComponent'))
|
|
5
|
-
|
|
6
|
-
Did you accidentally put curly braces around the import?`,Q),"default"in Q||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
7
|
-
|
|
8
|
-
Your code should look like:
|
|
9
|
-
const MyComponent = lazy(() => import('./MyComponent'))`,Q),Q.default;throw Y._result}function j(){var Y=w.H;return Y===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
10
|
-
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
11
|
-
2. You might be breaking the Rules of Hooks
|
|
12
|
-
3. You might have more than one copy of React in the same app
|
|
13
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),Y}function _Y(){w.asyncTransitions--}function o(Y){if(t===null)try{var Q=("require"+Math.random()).slice(0,7);t=(ZY&&ZY[Q]).call(ZY,"timers").setImmediate}catch($){t=function(H){oY===!1&&(oY=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var q=new MessageChannel;q.port1.onmessage=H,q.port2.postMessage(void 0)}}return t(Y)}function h(Y){return 1<Y.length&&typeof AggregateError==="function"?AggregateError(Y):Y[0]}function r(Y,Q){Q!==e-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),e=Q}function JY(Y,Q,$){var H=w.actQueue;if(H!==null)if(H.length!==0)try{qY(H),o(function(){return JY(Y,Q,$)});return}catch(q){w.thrownErrors.push(q)}else w.actQueue=null;0<w.thrownErrors.length?(H=h(w.thrownErrors),w.thrownErrors.length=0,$(H)):Q(Y)}function qY(Y){if(!LY){LY=!0;var Q=0;try{for(;Q<Y.length;Q++){var $=Y[Q];do{w.didUsePromise=!1;var H=$(!1);if(H!==null){if(w.didUsePromise){Y[Q]=$,Y.splice(0,Q);return}$=H}else break}while(1)}Y.length=0}catch(q){Y.splice(0,Q+1),w.thrownErrors.push(q)}finally{LY=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var KY=Symbol.for("react.transitional.element"),AY=Symbol.for("react.portal"),MY=Symbol.for("react.fragment"),TY=Symbol.for("react.strict_mode"),kY=Symbol.for("react.profiler"),zY=Symbol.for("react.consumer"),fY=Symbol.for("react.context"),SY=Symbol.for("react.forward_ref"),vY=Symbol.for("react.suspense"),EZ=Symbol.for("react.suspense_list"),wY=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),mY=Symbol.for("react.activity"),gY=Symbol.iterator,bY={},yY={isMounted:function(){return!1},enqueueForceUpdate:function(Y){G(Y,"forceUpdate")},enqueueReplaceState:function(Y){G(Y,"replaceState")},enqueueSetState:function(Y){G(Y,"setState")}},hY=Object.assign,NY={};Object.freeze(NY),W.prototype.isReactComponent={},W.prototype.setState=function(Y,Q){if(typeof Y!=="object"&&typeof Y!=="function"&&Y!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Y,Q,"setState")},W.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};var P={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(d in P)P.hasOwnProperty(d)&&Z(d,P[d]);B.prototype=W.prototype,P=U.prototype=new B,P.constructor=U,hY(P,W.prototype),P.isPureReactComponent=!0;var uY=Array.isArray,DZ=Symbol.for("react.client.reference"),w={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},a=Object.prototype.hasOwnProperty,dY=console.createTask?console.createTask:function(){return null};P={react_stack_bottom_frame:function(Y){return Y()}};var cY,lY,pY={},jZ=P.react_stack_bottom_frame.bind(P,E)(),FZ=dY(D(E)),iY=!1,nY=/\/+/g,sY=typeof reportError==="function"?reportError:function(Y){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Y==="object"&&Y!==null&&typeof Y.message==="string"?String(Y.message):String(Y),error:Y});if(!window.dispatchEvent(Q))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",Y);return}console.error(Y)},oY=!1,t=null,e=0,YY=!1,LY=!1,rY=typeof queueMicrotask==="function"?function(Y){queueMicrotask(function(){return queueMicrotask(Y)})}:o;P=Object.freeze({__proto__:null,c:function(Y){return j().useMemoCache(Y)}});var d={map:s,forEach:function(Y,Q,$){s(Y,function(){Q.apply(this,arguments)},$)},count:function(Y){var Q=0;return s(Y,function(){Q++}),Q},toArray:function(Y){return s(Y,function(Q){return Q})||[]},only:function(Y){if(!m(Y))throw Error("React.Children.only expected to receive a single React element child.");return Y}};IZ.Activity=mY,IZ.Children=d,IZ.Component=W,IZ.Fragment=MY,IZ.Profiler=kY,IZ.PureComponent=U,IZ.StrictMode=TY,IZ.Suspense=vY,IZ.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,IZ.__COMPILER_RUNTIME=P,IZ.act=function(Y){var Q=w.actQueue,$=e;e++;var H=w.actQueue=Q!==null?Q:[],q=!1;try{var N=Y()}catch(L){w.thrownErrors.push(L)}if(0<w.thrownErrors.length)throw r(Q,$),Y=h(w.thrownErrors),w.thrownErrors.length=0,Y;if(N!==null&&typeof N==="object"&&typeof N.then==="function"){var z=N;return rY(function(){q||YY||(YY=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(L,T){q=!0,z.then(function(b){if(r(Q,$),$===0){try{qY(H),o(function(){return JY(b,L,T)})}catch(CZ){w.thrownErrors.push(CZ)}if(0<w.thrownErrors.length){var VZ=h(w.thrownErrors);w.thrownErrors.length=0,T(VZ)}}else L(b)},function(b){r(Q,$),0<w.thrownErrors.length?(b=h(w.thrownErrors),w.thrownErrors.length=0,T(b)):T(b)})}}}var R=N;if(r(Q,$),$===0&&(qY(H),H.length!==0&&rY(function(){q||YY||(YY=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),w.actQueue=null),0<w.thrownErrors.length)throw Y=h(w.thrownErrors),w.thrownErrors.length=0,Y;return{then:function(L,T){q=!0,$===0?(w.actQueue=H,o(function(){return JY(R,L,T)})):L(R)}}},IZ.cache=function(Y){return function(){return Y.apply(null,arguments)}},IZ.cacheSignal=function(){return null},IZ.captureOwnerStack=function(){var Y=w.getCurrentStack;return Y===null?null:Y()},IZ.cloneElement=function(Y,Q,$){if(Y===null||Y===void 0)throw Error("The argument must be a React element, but you passed "+Y+".");var H=hY({},Y.props),q=Y.key,N=Y._owner;if(Q!=null){var z;Y:{if(a.call(Q,"ref")&&(z=Object.getOwnPropertyDescriptor(Q,"ref").get)&&z.isReactWarning){z=!1;break Y}z=Q.ref!==void 0}z&&(N=x()),V(Q)&&(M(Q.key),q=""+Q.key);for(R in Q)!a.call(Q,R)||R==="key"||R==="__self"||R==="__source"||R==="ref"&&Q.ref===void 0||(H[R]=Q[R])}var R=arguments.length-2;if(R===1)H.children=$;else if(1<R){z=Array(R);for(var L=0;L<R;L++)z[L]=arguments[L+2];H.children=z}H=A(Y.type,q,H,N,Y._debugStack,Y._debugTask);for(q=2;q<arguments.length;q++)IY(arguments[q]);return H},IZ.createContext=function(Y){return Y={$$typeof:fY,_currentValue:Y,_currentValue2:Y,_threadCount:0,Provider:null,Consumer:null},Y.Provider=Y,Y.Consumer={$$typeof:zY,_context:Y},Y._currentRenderer=null,Y._currentRenderer2=null,Y},IZ.createElement=function(Y,Q,$){for(var H=2;H<arguments.length;H++)IY(arguments[H]);H={};var q=null;if(Q!=null)for(L in lY||!("__self"in Q)||"key"in Q||(lY=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),V(Q)&&(M(Q.key),q=""+Q.key),Q)a.call(Q,L)&&L!=="key"&&L!=="__self"&&L!=="__source"&&(H[L]=Q[L]);var N=arguments.length-2;if(N===1)H.children=$;else if(1<N){for(var z=Array(N),R=0;R<N;R++)z[R]=arguments[R+2];Object.freeze&&Object.freeze(z),H.children=z}if(Y&&Y.defaultProps)for(L in N=Y.defaultProps,N)H[L]===void 0&&(H[L]=N[L]);q&&_(H,typeof Y==="function"?Y.displayName||Y.name||"Unknown":Y);var L=1e4>w.recentlyCreatedOwnerStacks++;return A(Y,q,H,x(),L?Error("react-stack-top-frame"):jZ,L?dY(D(Y)):FZ)},IZ.createRef=function(){var Y={current:null};return Object.seal(Y),Y},IZ.forwardRef=function(Y){Y!=null&&Y.$$typeof===wY?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof Y!=="function"?console.error("forwardRef requires a render function but was given %s.",Y===null?"null":typeof Y):Y.length!==0&&Y.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",Y.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),Y!=null&&Y.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var Q={$$typeof:SY,render:Y},$;return Object.defineProperty(Q,"displayName",{enumerable:!1,configurable:!0,get:function(){return $},set:function(H){$=H,Y.name||Y.displayName||(Object.defineProperty(Y,"name",{value:H}),Y.displayName=H)}}),Q},IZ.isValidElement=m,IZ.lazy=function(Y){Y={_status:-1,_result:Y};var Q={$$typeof:u,_payload:Y,_init:RZ},$={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return Y._ioInfo=$,Q._debugInfo=[{awaited:$}],Q},IZ.memo=function(Y,Q){Y==null&&console.error("memo: The first argument must be a component. Instead received: %s",Y===null?"null":typeof Y),Q={$$typeof:wY,type:Y,compare:Q===void 0?null:Q};var $;return Object.defineProperty(Q,"displayName",{enumerable:!1,configurable:!0,get:function(){return $},set:function(H){$=H,Y.name||Y.displayName||(Object.defineProperty(Y,"name",{value:H}),Y.displayName=H)}}),Q},IZ.startTransition=function(Y){var Q=w.T,$={};$._updatedFibers=new Set,w.T=$;try{var H=Y(),q=w.S;q!==null&&q($,H),typeof H==="object"&&H!==null&&typeof H.then==="function"&&(w.asyncTransitions++,H.then(_Y,_Y),H.then(K,sY))}catch(N){sY(N)}finally{Q===null&&$._updatedFibers&&(Y=$._updatedFibers.size,$._updatedFibers.clear(),10<Y&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),Q!==null&&$.types!==null&&(Q.types!==null&&Q.types!==$.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),Q.types=$.types),w.T=Q}},IZ.unstable_useCacheRefresh=function(){return j().useCacheRefresh()},IZ.use=function(Y){return j().use(Y)},IZ.useActionState=function(Y,Q,$){return j().useActionState(Y,Q,$)},IZ.useCallback=function(Y,Q){return j().useCallback(Y,Q)},IZ.useContext=function(Y){var Q=j();return Y.$$typeof===zY&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),Q.useContext(Y)},IZ.useDebugValue=function(Y,Q){return j().useDebugValue(Y,Q)},IZ.useDeferredValue=function(Y,Q){return j().useDeferredValue(Y,Q)},IZ.useEffect=function(Y,Q){return Y==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),j().useEffect(Y,Q)},IZ.useEffectEvent=function(Y){return j().useEffectEvent(Y)},IZ.useId=function(){return j().useId()},IZ.useImperativeHandle=function(Y,Q,$){return j().useImperativeHandle(Y,Q,$)},IZ.useInsertionEffect=function(Y,Q){return Y==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),j().useInsertionEffect(Y,Q)},IZ.useLayoutEffect=function(Y,Q){return Y==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),j().useLayoutEffect(Y,Q)},IZ.useMemo=function(Y,Q){return j().useMemo(Y,Q)},IZ.useOptimistic=function(Y,Q){return j().useOptimistic(Y,Q)},IZ.useReducer=function(Y,Q,$){return j().useReducer(Y,Q,$)},IZ.useRef=function(Y){return j().useRef(Y)},IZ.useState=function(Y){return j().useState(Y)},IZ.useSyncExternalStore=function(Y,Q,$){return j().useSyncExternalStore(Y,Q,$)},IZ.useTransition=function(){return j().useTransition()},IZ.version="19.2.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var aY=(Z)=>{let X,G=new Set,W=(O,D)=>{let x=typeof O==="function"?O(X):O;if(!Object.is(x,X)){let E=X;X=(D!=null?D:typeof x!=="object"||x===null)?x:Object.assign({},X,x),G.forEach((V)=>V(X,E))}},B=()=>X,J={setState:W,getState:B,getInitialState:()=>M,subscribe:(O)=>{return G.add(O),()=>G.delete(O)}},M=X=Z(W,B,J);return J},tY=(Z)=>Z?aY(Z):aY;var c=_Z(eY(),1);var AZ=(Z)=>Z;function TZ(Z,X=AZ){let G=c.default.useSyncExternalStore(Z.subscribe,c.default.useCallback(()=>X(Z.getState()),[Z,X]),c.default.useCallback(()=>X(Z.getInitialState()),[Z,X]));return c.default.useDebugValue(G),G}var YZ=(Z)=>{let X=tY(Z),G=(W)=>TZ(X,W);return Object.assign(G,X),G},ZZ=(Z)=>Z?YZ(Z):YZ;var HZ=Symbol.for("immer-nothing"),XZ=Symbol.for("immer-draftable"),C=Symbol.for("immer-state"),kZ=[function(Z){return`The plugin for '${Z}' has not been loaded into Immer. To enable the plugin, import and call \`enable${Z}()\` when initializing your application.`},function(Z){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${Z}'`},"This object has been frozen and should not be mutated",function(Z){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+Z},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(Z){return`'current' expects a draft, got: ${Z}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(Z){return`'original' expects a draft, got: ${Z}`}];function F(Z,...X){{let G=kZ[Z],W=typeof G==="function"?G.apply(null,X):G;throw Error(`[Immer] ${W}`)}throw Error(`[Immer] minified error nr: ${Z}. Full error at: https://bit.ly/3cXEKWf`)}var l=Object.getPrototypeOf;function y(Z){return!!Z&&!!Z[C]}function S(Z){if(!Z)return!1;return UZ(Z)||Array.isArray(Z)||!!Z[XZ]||!!Z.constructor?.[XZ]||n(Z)||$Y(Z)}var fZ=Object.prototype.constructor.toString(),GZ=new WeakMap;function UZ(Z){if(!Z||typeof Z!=="object")return!1;let X=Object.getPrototypeOf(Z);if(X===null||X===Object.prototype)return!0;let G=Object.hasOwnProperty.call(X,"constructor")&&X.constructor;if(G===Object)return!0;if(typeof G!=="function")return!1;let W=GZ.get(G);if(W===void 0)W=Function.toString.call(G),GZ.set(G,W);return W===fZ}function GY(Z,X,G=!0){if(BY(Z)===0)(G?Reflect.ownKeys(Z):Object.keys(Z)).forEach((B)=>{X(B,Z[B],Z)});else Z.forEach((W,B)=>X(B,W,Z))}function BY(Z){let X=Z[C];return X?X.type_:Array.isArray(Z)?1:n(Z)?2:$Y(Z)?3:0}function RY(Z,X){return BY(Z)===2?Z.has(X):Object.prototype.hasOwnProperty.call(Z,X)}function JZ(Z,X,G){let W=BY(Z);if(W===2)Z.set(X,G);else if(W===3)Z.add(G);else Z[X]=G}function SZ(Z,X){if(Z===X)return Z!==0||1/Z===1/X;else return Z!==Z&&X!==X}function n(Z){return Z instanceof Map}function $Y(Z){return Z instanceof Set}function f(Z){return Z.copy_||Z.base_}function EY(Z,X){if(n(Z))return new Map(Z);if($Y(Z))return new Set(Z);if(Array.isArray(Z))return Array.prototype.slice.call(Z);let G=UZ(Z);if(X===!0||X==="class_only"&&!G){let W=Object.getOwnPropertyDescriptors(Z);delete W[C];let B=Reflect.ownKeys(W);for(let U=0;U<B.length;U++){let K=B[U],J=W[K];if(J.writable===!1)J.writable=!0,J.configurable=!0;if(J.get||J.set)W[K]={configurable:!0,writable:!0,enumerable:J.enumerable,value:Z[K]}}return Object.create(l(Z),W)}else{let W=l(Z);if(W!==null&&G)return{...Z};let B=Object.create(W);return Object.assign(B,Z)}}function CY(Z,X=!1){if(HY(Z)||y(Z)||!S(Z))return Z;if(BY(Z)>1)Object.defineProperties(Z,{set:XY,add:XY,clear:XY,delete:XY});if(Object.freeze(Z),X)Object.values(Z).forEach((G)=>CY(G,!0));return Z}function vZ(){F(2)}var XY={value:vZ};function HY(Z){if(Z===null||typeof Z!=="object")return!0;return Object.isFrozen(Z)}var mZ={};function v(Z){let X=mZ[Z];if(!X)F(0,Z);return X}var p;function qZ(){return p}function gZ(Z,X){return{drafts_:[],parent_:Z,immer_:X,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function QZ(Z,X){if(X)v("Patches"),Z.patches_=[],Z.inversePatches_=[],Z.patchListener_=X}function DY(Z){jY(Z),Z.drafts_.forEach(bZ),Z.drafts_=null}function jY(Z){if(Z===p)p=Z.parent_}function WZ(Z){return p=gZ(p,Z)}function bZ(Z){let X=Z[C];if(X.type_===0||X.type_===1)X.revoke_();else X.revoked_=!0}function BZ(Z,X){X.unfinalizedDrafts_=X.drafts_.length;let G=X.drafts_[0];if(Z!==void 0&&Z!==G){if(G[C].modified_)DY(X),F(4);if(S(Z)){if(Z=QY(X,Z),!X.parent_)WY(X,Z)}if(X.patches_)v("Patches").generateReplacementPatches_(G[C].base_,Z,X.patches_,X.inversePatches_)}else Z=QY(X,G,[]);if(DY(X),X.patches_)X.patchListener_(X.patches_,X.inversePatches_);return Z!==HZ?Z:void 0}function QY(Z,X,G){if(HY(X))return X;let W=Z.immer_.shouldUseStrictIteration(),B=X[C];if(!B)return GY(X,(U,K)=>$Z(Z,B,X,U,K,G),W),X;if(B.scope_!==Z)return X;if(!B.modified_)return WY(Z,B.base_,!0),B.base_;if(!B.finalized_){B.finalized_=!0,B.scope_.unfinalizedDrafts_--;let U=B.copy_,K=U,J=!1;if(B.type_===3)K=new Set(U),U.clear(),J=!0;if(GY(K,(M,O)=>$Z(Z,B,U,M,O,G,J),W),WY(Z,U,!1),G&&Z.patches_)v("Patches").generatePatches_(B,G,Z.patches_,Z.inversePatches_)}return B.copy_}function $Z(Z,X,G,W,B,U,K){if(B==null)return;if(typeof B!=="object"&&!K)return;let J=HY(B);if(J&&!K)return;if(B===G)F(5);if(y(B)){let M=U&&X&&X.type_!==3&&!RY(X.assigned_,W)?U.concat(W):void 0,O=QY(Z,B,M);if(JZ(G,W,O),y(O))Z.canAutoFreeze_=!1;else return}else if(K)G.add(B);if(S(B)&&!J){if(!Z.immer_.autoFreeze_&&Z.unfinalizedDrafts_<1)return;if(X&&X.base_&&X.base_[W]===B&&J)return;if(QY(Z,B),(!X||!X.scope_.parent_)&&typeof W!=="symbol"&&(n(G)?G.has(W):Object.prototype.propertyIsEnumerable.call(G,W)))WY(Z,B)}}function WY(Z,X,G=!1){if(!Z.parent_&&Z.immer_.autoFreeze_&&Z.canAutoFreeze_)CY(X,G)}function yZ(Z,X){let G=Array.isArray(Z),W={type_:G?1:0,scope_:X?X.scope_:qZ(),modified_:!1,finalized_:!1,assigned_:{},parent_:X,base_:Z,draft_:null,copy_:null,revoke_:null,isManual_:!1},B=W,U=PY;if(G)B=[W],U=i;let{revoke:K,proxy:J}=Proxy.revocable(B,U);return W.draft_=J,W.revoke_=K,J}var PY={get(Z,X){if(X===C)return Z;let G=f(Z);if(!RY(G,X))return hZ(Z,G,X);let W=G[X];if(Z.finalized_||!S(W))return W;if(W===OY(Z.base_,X))return xY(Z),Z.copy_[X]=VY(W,Z);return W},has(Z,X){return X in f(Z)},ownKeys(Z){return Reflect.ownKeys(f(Z))},set(Z,X,G){let W=KZ(f(Z),X);if(W?.set)return W.set.call(Z.draft_,G),!0;if(!Z.modified_){let B=OY(f(Z),X),U=B?.[C];if(U&&U.base_===G)return Z.copy_[X]=G,Z.assigned_[X]=!1,!0;if(SZ(G,B)&&(G!==void 0||RY(Z.base_,X)))return!0;xY(Z),FY(Z)}if(Z.copy_[X]===G&&(G!==void 0||(X in Z.copy_))||Number.isNaN(G)&&Number.isNaN(Z.copy_[X]))return!0;return Z.copy_[X]=G,Z.assigned_[X]=!0,!0},deleteProperty(Z,X){if(OY(Z.base_,X)!==void 0||X in Z.base_)Z.assigned_[X]=!1,xY(Z),FY(Z);else delete Z.assigned_[X];if(Z.copy_)delete Z.copy_[X];return!0},getOwnPropertyDescriptor(Z,X){let G=f(Z),W=Reflect.getOwnPropertyDescriptor(G,X);if(!W)return W;return{writable:!0,configurable:Z.type_!==1||X!=="length",enumerable:W.enumerable,value:G[X]}},defineProperty(){F(11)},getPrototypeOf(Z){return l(Z.base_)},setPrototypeOf(){F(12)}},i={};GY(PY,(Z,X)=>{i[Z]=function(){return arguments[0]=arguments[0][0],X.apply(this,arguments)}});i.deleteProperty=function(Z,X){if(isNaN(parseInt(X)))F(13);return i.set.call(this,Z,X,void 0)};i.set=function(Z,X,G){if(X!=="length"&&isNaN(parseInt(X)))F(14);return PY.set.call(this,Z[0],X,G,Z[0])};function OY(Z,X){let G=Z[C];return(G?f(G):Z)[X]}function hZ(Z,X,G){let W=KZ(X,G);return W?"value"in W?W.value:W.get?.call(Z.draft_):void 0}function KZ(Z,X){if(!(X in Z))return;let G=l(Z);while(G){let W=Object.getOwnPropertyDescriptor(G,X);if(W)return W;G=l(G)}return}function FY(Z){if(!Z.modified_){if(Z.modified_=!0,Z.parent_)FY(Z.parent_)}}function xY(Z){if(!Z.copy_)Z.copy_=EY(Z.base_,Z.scope_.immer_.useStrictShallowCopy_)}var uZ=class{constructor(Z){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(X,G,W)=>{if(typeof X==="function"&&typeof G!=="function"){let U=G;G=X;let K=this;return function(M=U,...O){return K.produce(M,(D)=>G.call(this,D,...O))}}if(typeof G!=="function")F(6);if(W!==void 0&&typeof W!=="function")F(7);let B;if(S(X)){let U=WZ(this),K=VY(X,void 0),J=!0;try{B=G(K),J=!1}finally{if(J)DY(U);else jY(U)}return QZ(U,W),BZ(B,U)}else if(!X||typeof X!=="object"){if(B=G(X),B===void 0)B=X;if(B===HZ)B=void 0;if(this.autoFreeze_)CY(B,!0);if(W){let U=[],K=[];v("Patches").generateReplacementPatches_(X,B,U,K),W(U,K)}return B}else F(1,X)},this.produceWithPatches=(X,G)=>{if(typeof X==="function")return(K,...J)=>this.produceWithPatches(K,(M)=>X(M,...J));let W,B;return[this.produce(X,G,(K,J)=>{W=K,B=J}),W,B]},typeof Z?.autoFreeze==="boolean")this.setAutoFreeze(Z.autoFreeze);if(typeof Z?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy(Z.useStrictShallowCopy);if(typeof Z?.useStrictIteration==="boolean")this.setUseStrictIteration(Z.useStrictIteration)}createDraft(Z){if(!S(Z))F(8);if(y(Z))Z=dZ(Z);let X=WZ(this),G=VY(Z,void 0);return G[C].isManual_=!0,jY(X),G}finishDraft(Z,X){let G=Z&&Z[C];if(!G||!G.isManual_)F(9);let{scope_:W}=G;return QZ(W,X),BZ(void 0,W)}setAutoFreeze(Z){this.autoFreeze_=Z}setUseStrictShallowCopy(Z){this.useStrictShallowCopy_=Z}setUseStrictIteration(Z){this.useStrictIteration_=Z}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(Z,X){let G;for(G=X.length-1;G>=0;G--){let B=X[G];if(B.path.length===0&&B.op==="replace"){Z=B.value;break}}if(G>-1)X=X.slice(G+1);let W=v("Patches").applyPatches_;if(y(Z))return W(Z,X);return this.produce(Z,(B)=>W(B,X))}};function VY(Z,X){let G=n(Z)?v("MapSet").proxyMap_(Z,X):$Y(Z)?v("MapSet").proxySet_(Z,X):yZ(Z,X);return(X?X.scope_:qZ()).drafts_.push(G),G}function dZ(Z){if(!y(Z))F(10,Z);return MZ(Z)}function MZ(Z){if(!S(Z)||HY(Z))return Z;let X=Z[C],G,W=!0;if(X){if(!X.modified_)return X.base_;X.finalized_=!0,G=EY(Z,X.scope_.immer_.useStrictShallowCopy_),W=X.scope_.immer_.shouldUseStrictIteration()}else G=EY(Z,!0);if(GY(G,(B,U)=>{JZ(G,B,MZ(U))},W),X)X.finalized_=!1;return G}var cZ=new uZ,zZ=cZ.produce;var lZ=(Z)=>(X,G,W)=>{return W.setState=(B,U,...K)=>{let J=typeof B==="function"?zZ(B):B;return X(J,U,...K)},Z(W.setState,G,W)},wZ=lZ;var pZ=(Z)=>(X,G,W)=>{let B=W.subscribe;return W.subscribe=(K,J,M)=>{let O=K;if(J){let D=(M==null?void 0:M.equalityFn)||Object.is,x=K(W.getState());if(O=(E)=>{let V=K(E);if(!D(x,V)){let _=x;J(x=V,_)}},M==null?void 0:M.fireImmediately)J(x,x)}return B(O)},Z(X,G,W)},NZ=pZ;var s2=ZZ()(NZ(wZ((Z)=>({currentScreen:"chat",navigateTo:(X)=>Z((G)=>{G.currentScreen=X}),aiConfig:null,setAIConfig:(X)=>Z((G)=>{G.aiConfig=X}),updateProvider:(X,G)=>Z((W)=>{if(!W.aiConfig)W.aiConfig={providers:{}};if(!W.aiConfig.providers)W.aiConfig.providers={};W.aiConfig.providers[X]={...W.aiConfig.providers[X],...G}}),removeProvider:(X)=>Z((G)=>{if(G.aiConfig?.providers)delete G.aiConfig.providers[X];if(G.aiConfig?.defaultProvider===X)G.aiConfig.defaultProvider=void 0,G.aiConfig.defaultModel=void 0}),selectedProvider:null,selectedModel:null,setSelectedProvider:(X)=>Z((G)=>{G.selectedProvider=X}),setSelectedModel:(X)=>Z((G)=>{G.selectedModel=X}),sessions:[],currentSessionId:null,createSession:(X,G)=>{let W=`session-${Date.now()}`,B=Date.now();return Z((U)=>{U.sessions.push({id:W,provider:X,model:G,messages:[],todos:[],nextTodoId:1,created:B,updated:B}),U.currentSessionId=W}),k().then((U)=>{U.createSessionFromData({id:W,provider:X,model:G,nextTodoId:1,created:B,updated:B}).catch((K)=>{console.error("Failed to create session in database:",K)})}),W},updateSessionModel:(X,G)=>{k().then((W)=>{W.updateSessionModel(X,G).catch((B)=>{console.error("Failed to update session model in database:",B)})}),Z((W)=>{let B=W.sessions.find((U)=>U.id===X);if(B)B.model=G})},updateSessionProvider:(X,G,W)=>{k().then((B)=>{B.updateSessionProvider(X,G,W).catch((U)=>{console.error("Failed to update session provider in database:",U)})}),Z((B)=>{let U=B.sessions.find((K)=>K.id===X);if(U)U.provider=G,U.model=W})},updateSessionTitle:(X,G)=>{k().then((W)=>{W.updateSessionTitle(X,G).catch((B)=>{console.error("Failed to update session title in database:",B)})}),Z((W)=>{let B=W.sessions.find((U)=>U.id===X);if(B)B.title=G})},addMessage:(X,G,W,B,U,K,J,M)=>{let O=typeof W==="string"?[{type:"text",content:W}]:W;k().then((D)=>{D.addMessage(X,G,O,B,U,K,J,M).catch((x)=>{console.error("Failed to add message to database:",x)})}),Z((D)=>{let x=D.sessions.find((E)=>E.id===X);if(x)x.messages.push({role:G,content:O,timestamp:Date.now(),...B!==void 0&&B.length>0&&{attachments:B},...U!==void 0&&{usage:U},...K!==void 0&&{finishReason:K},...J!==void 0&&{metadata:J},...M!==void 0&&M.length>0&&{todoSnapshot:M}})})},setCurrentSession:(X)=>Z((G)=>{G.currentSessionId=X}),deleteSession:(X)=>{k().then((G)=>{G.deleteSession(X).catch((W)=>{console.error("Failed to delete session from database:",W)})}),Z((G)=>{if(G.sessions=G.sessions.filter((W)=>W.id!==X),G.currentSessionId===X)G.currentSessionId=null})},isLoading:!1,error:null,setLoading:(X)=>Z((G)=>{G.isLoading=X}),setError:(X)=>Z((G)=>{G.error=X}),currentAgentId:"coder",setCurrentAgentId:(X)=>Z((G)=>{G.currentAgentId=X}),enabledRuleIds:[],setEnabledRuleIds:(X)=>Z((G)=>{G.enabledRuleIds=X}),debugLogs:[],addDebugLog:(X)=>Z((G)=>{if(!process.env.DEBUG)return;let W=new Date().toLocaleTimeString();G.debugLogs.push(`[${W}] ${X}`);let B=1000;if(G.debugLogs.length>B)G.debugLogs=G.debugLogs.slice(-B/2)}),clearDebugLogs:()=>Z((X)=>{X.debugLogs=[]}),notificationSettings:{osNotifications:!0,terminalNotifications:!0,sound:!0},updateNotificationSettings:(X)=>Z((G)=>{G.notificationSettings={...G.notificationSettings,...X}}),updateTodos:(X,G)=>Z((W)=>{let B=W.sessions.find((J)=>J.id===X);if(!B)return;for(let J of G)if(J.id===void 0||J.id===null){let M=B.nextTodoId,O=B.todos.length>0?Math.max(...B.todos.map((D)=>D.ordering)):0;B.todos.push({id:M,content:J.content||"",activeForm:J.activeForm||"",status:J.status||"pending",ordering:O+10}),B.nextTodoId=M+1}else{let M=B.todos.find((O)=>O.id===J.id);if(!M)continue;if(J.content!==void 0)M.content=J.content;if(J.activeForm!==void 0)M.activeForm=J.activeForm;if(J.status!==void 0)M.status=J.status;if(J.reorder){let{type:O,id:D}=J.reorder;if(O==="top"){let x=Math.min(...B.todos.map((E)=>E.ordering));M.ordering=x-10}else if(O==="last"){let x=Math.max(...B.todos.map((E)=>E.ordering));M.ordering=x+10}else if(O==="before"&&D!==void 0){let x=B.todos.find((E)=>E.id===D);if(x){let E=[...B.todos].sort((I,A)=>I.ordering-A.ordering||I.id-A.id),V=E.findIndex((I)=>I.id===D),_=V>0?E[V-1]:null;if(_)M.ordering=Math.floor((_.ordering+x.ordering)/2);else M.ordering=x.ordering-10}}else if(O==="after"&&D!==void 0){let x=B.todos.find((E)=>E.id===D);if(x){let E=[...B.todos].sort((I,A)=>I.ordering-A.ordering||I.id-A.id),V=E.findIndex((I)=>I.id===D),_=V<E.length-1?E[V+1]:null;if(_)M.ordering=Math.floor((x.ordering+_.ordering)/2);else M.ordering=x.ordering+10}}}}let U=JSON.parse(JSON.stringify(B.todos)),K=B.nextTodoId;k().then((J)=>{J.updateTodos(X,U,K).catch((M)=>{console.error("Failed to update todos in database:",M)})})})}))));export{s2 as useAppStore};
|
|
14
|
-
export{eY as L,s2 as M};
|
|
15
|
-
|
|
16
|
-
//# debugId=1289C6BE3D6A205B64756E2164756E21
|
|
File without changes
|
|
File without changes
|
|
File without changes
|