@goondocks/myco 0.21.0 → 0.21.1

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.
Files changed (145) hide show
  1. package/bin/myco-run +68 -7
  2. package/dist/{agent-eval-RJSQI5S2.js → agent-eval-YK2VP2S4.js} +7 -6
  3. package/dist/{agent-eval-RJSQI5S2.js.map → agent-eval-YK2VP2S4.js.map} +1 -1
  4. package/dist/{agent-run-2JSYFOKU.js → agent-run-GEJBD2YD.js} +5 -5
  5. package/dist/{agent-tasks-APFJIM2T.js → agent-tasks-5XSRGTRX.js} +5 -5
  6. package/dist/{chunk-R2JIJBCL.js → chunk-6ALVMIB4.js} +3 -3
  7. package/dist/{chunk-JZS6GZ6T.js → chunk-AUIXX33A.js} +10 -3
  8. package/dist/chunk-AUIXX33A.js.map +1 -0
  9. package/dist/{chunk-RL5R4CQU.js → chunk-DTWUHHFI.js} +39 -2
  10. package/dist/{chunk-RL5R4CQU.js.map → chunk-DTWUHHFI.js.map} +1 -1
  11. package/dist/{chunk-CESKJD44.js → chunk-EEOJWLMP.js} +5 -9
  12. package/dist/chunk-EEOJWLMP.js.map +1 -0
  13. package/dist/{chunk-BUTL6IFS.js → chunk-ENZR5NG7.js} +2 -2
  14. package/dist/{chunk-P66DLD6G.js → chunk-KTTSXYEK.js} +2 -2
  15. package/dist/chunk-LQIPXVDH.js +17 -0
  16. package/dist/chunk-LQIPXVDH.js.map +1 -0
  17. package/dist/{chunk-5ZG4RMUH.js → chunk-N2DGFACQ.js} +2 -2
  18. package/dist/{chunk-F3OEQYLS.js → chunk-N7Z3LUEZ.js} +33 -22
  19. package/dist/{chunk-F3OEQYLS.js.map → chunk-N7Z3LUEZ.js.map} +1 -1
  20. package/dist/{chunk-G6QIBNZM.js → chunk-NFO7BRCO.js} +4 -4
  21. package/dist/{chunk-VHNRMM4O.js → chunk-OTQH5KZW.js} +87 -37
  22. package/dist/chunk-OTQH5KZW.js.map +1 -0
  23. package/dist/{chunk-DJ3IHNYO.js → chunk-OZ3FBAK5.js} +2 -2
  24. package/dist/{chunk-6LB7XELY.js → chunk-QATYARI5.js} +15 -13
  25. package/dist/chunk-QATYARI5.js.map +1 -0
  26. package/dist/{chunk-JR54LTPP.js → chunk-QDLVIW2O.js} +3 -3
  27. package/dist/{chunk-LVIY7P35.js → chunk-QLLBJEM7.js} +5 -1
  28. package/dist/chunk-QLLBJEM7.js.map +1 -0
  29. package/dist/chunk-TSM6VESW.js +25 -0
  30. package/dist/chunk-TSM6VESW.js.map +1 -0
  31. package/dist/{chunk-ILJPRYES.js → chunk-USVFEWYL.js} +2 -2
  32. package/dist/{chunk-75Z7UKDY.js → chunk-VRI56337.js} +2 -2
  33. package/dist/{chunk-NGH7U6A3.js → chunk-X2IRGXGF.js} +336 -77
  34. package/dist/chunk-X2IRGXGF.js.map +1 -0
  35. package/dist/{chunk-NGROSFOH.js → chunk-Z66IT5KL.js} +14 -9
  36. package/dist/chunk-Z66IT5KL.js.map +1 -0
  37. package/dist/{cli-LNYSTDQM.js → cli-HSLIG7EX.js} +37 -37
  38. package/dist/{client-NWE4TCNO.js → client-Z43DNLJH.js} +3 -3
  39. package/dist/{detect-PXNM6TA7.js → detect-7NUD5B5R.js} +2 -2
  40. package/dist/{doctor-TI7EZ3RW.js → doctor-HJCWHAU4.js} +6 -6
  41. package/dist/{executor-F2YU7HXJ.js → executor-DO6QFC6G.js} +11 -10
  42. package/dist/{init-KG3TYVGE.js → init-4KVK7W2E.js} +9 -9
  43. package/dist/{installer-UMH7OJ5A.js → installer-N4UTEACX.js} +2 -2
  44. package/dist/{loader-NAVVZK63.js → loader-UDNUMEDA.js} +3 -2
  45. package/dist/{main-5PRQNEEE.js → main-4J4QZZTZ.js} +121 -62
  46. package/dist/main-4J4QZZTZ.js.map +1 -0
  47. package/dist/{open-5A27BCSB.js → open-7TXJQM3H.js} +5 -5
  48. package/dist/{post-compact-USAODKPQ.js → post-compact-7AEFVCZS.js} +7 -7
  49. package/dist/{post-tool-use-GMMSYBII.js → post-tool-use-TZINWWDH.js} +6 -6
  50. package/dist/{post-tool-use-failure-NZVSL2PO.js → post-tool-use-failure-TCFEU2GI.js} +7 -7
  51. package/dist/{pre-compact-LZ57DLUS.js → pre-compact-LO2VZCGR.js} +7 -7
  52. package/dist/{registry-M2Z5QBWH.js → registry-F3THYC5M.js} +4 -3
  53. package/dist/{remove-T3KE6C5N.js → remove-F77AAALE.js} +7 -7
  54. package/dist/{restart-YWDEVZUJ.js → restart-UEFDPMLT.js} +6 -6
  55. package/dist/{search-GKFDGELR.js → search-NHNVUAQQ.js} +6 -6
  56. package/dist/{server-AHUR6CWF.js → server-AZJSTQEK.js} +5 -5
  57. package/dist/{session-2ZEPLWW6.js → session-3HLC5KOD.js} +5 -5
  58. package/dist/{session-end-LWJYQAXX.js → session-end-FS46UARX.js} +6 -6
  59. package/dist/{session-start-WTA6GCOQ.js → session-start-46KPFV2H.js} +10 -10
  60. package/dist/{setup-llm-E7UU5IO7.js → setup-llm-JMWSNQ2C.js} +5 -5
  61. package/dist/src/agent/definitions/tasks/cortex-instructions.yaml +63 -41
  62. package/dist/src/agent/definitions/tasks/skill-evolve.yaml +177 -21
  63. package/dist/src/agent/definitions/tasks/skill-generate.yaml +20 -6
  64. package/dist/src/agent/definitions/tasks/vault-evolve.yaml +65 -55
  65. package/dist/src/cli.js +1 -1
  66. package/dist/src/daemon/main.js +1 -1
  67. package/dist/src/hooks/post-tool-use.js +1 -1
  68. package/dist/src/hooks/session-end.js +1 -1
  69. package/dist/src/hooks/session-start.js +1 -1
  70. package/dist/src/hooks/stop.js +1 -1
  71. package/dist/src/hooks/user-prompt-submit.js +1 -1
  72. package/dist/src/mcp/server.js +1 -1
  73. package/dist/src/symbionts/manifests/opencode.yaml +7 -0
  74. package/dist/src/symbionts/templates/agents-starter.md +1 -1
  75. package/dist/{stats-DFG6S23S.js → stats-MKMETHMA.js} +6 -6
  76. package/dist/{stop-WRBTXEVT.js → stop-OUEX6KA4.js} +6 -6
  77. package/dist/{stop-failure-32MGIG2Q.js → stop-failure-2BWVNZEG.js} +7 -7
  78. package/dist/{subagent-start-VFGHQFVL.js → subagent-start-J4VV6DEE.js} +7 -7
  79. package/dist/{subagent-stop-663FXG3P.js → subagent-stop-JMLVEPIA.js} +7 -7
  80. package/dist/{task-completed-ZCQYEFMZ.js → task-completed-65CHMMKA.js} +7 -7
  81. package/dist/{team-JTI5CDUO.js → team-U2LDKIS4.js} +3 -3
  82. package/dist/ui/assets/{index-DGf1h-Ha.js → index-BUGor9dk.js} +1 -1
  83. package/dist/ui/index.html +1 -1
  84. package/dist/{update-3NBQTG32.js → update-ZSHVXWSQ.js} +7 -7
  85. package/dist/{user-prompt-submit-ME2TBKOS.js → user-prompt-submit-APMO6FVU.js} +6 -6
  86. package/dist/{version-GQAFBBPX.js → version-TXPPS3L5.js} +2 -2
  87. package/package.json +1 -1
  88. package/skills/myco-rules/SKILL.md +94 -0
  89. package/skills/{rules → myco-rules}/references/rules-bad-example.md +1 -1
  90. package/skills/{rules → myco-rules}/references/rules-good-example.md +1 -1
  91. package/dist/chunk-6LB7XELY.js.map +0 -1
  92. package/dist/chunk-CESKJD44.js.map +0 -1
  93. package/dist/chunk-CUDIZJY7.js +0 -36
  94. package/dist/chunk-CUDIZJY7.js.map +0 -1
  95. package/dist/chunk-JZS6GZ6T.js.map +0 -1
  96. package/dist/chunk-LVIY7P35.js.map +0 -1
  97. package/dist/chunk-NGH7U6A3.js.map +0 -1
  98. package/dist/chunk-NGROSFOH.js.map +0 -1
  99. package/dist/chunk-VHNRMM4O.js.map +0 -1
  100. package/dist/main-5PRQNEEE.js.map +0 -1
  101. package/skills/myco-curate/SKILL.md +0 -86
  102. package/skills/rules/SKILL.md +0 -214
  103. /package/dist/{agent-run-2JSYFOKU.js.map → agent-run-GEJBD2YD.js.map} +0 -0
  104. /package/dist/{agent-tasks-APFJIM2T.js.map → agent-tasks-5XSRGTRX.js.map} +0 -0
  105. /package/dist/{chunk-R2JIJBCL.js.map → chunk-6ALVMIB4.js.map} +0 -0
  106. /package/dist/{chunk-BUTL6IFS.js.map → chunk-ENZR5NG7.js.map} +0 -0
  107. /package/dist/{chunk-P66DLD6G.js.map → chunk-KTTSXYEK.js.map} +0 -0
  108. /package/dist/{chunk-5ZG4RMUH.js.map → chunk-N2DGFACQ.js.map} +0 -0
  109. /package/dist/{chunk-G6QIBNZM.js.map → chunk-NFO7BRCO.js.map} +0 -0
  110. /package/dist/{chunk-DJ3IHNYO.js.map → chunk-OZ3FBAK5.js.map} +0 -0
  111. /package/dist/{chunk-JR54LTPP.js.map → chunk-QDLVIW2O.js.map} +0 -0
  112. /package/dist/{chunk-ILJPRYES.js.map → chunk-USVFEWYL.js.map} +0 -0
  113. /package/dist/{chunk-75Z7UKDY.js.map → chunk-VRI56337.js.map} +0 -0
  114. /package/dist/{cli-LNYSTDQM.js.map → cli-HSLIG7EX.js.map} +0 -0
  115. /package/dist/{client-NWE4TCNO.js.map → client-Z43DNLJH.js.map} +0 -0
  116. /package/dist/{detect-PXNM6TA7.js.map → detect-7NUD5B5R.js.map} +0 -0
  117. /package/dist/{doctor-TI7EZ3RW.js.map → doctor-HJCWHAU4.js.map} +0 -0
  118. /package/dist/{executor-F2YU7HXJ.js.map → executor-DO6QFC6G.js.map} +0 -0
  119. /package/dist/{init-KG3TYVGE.js.map → init-4KVK7W2E.js.map} +0 -0
  120. /package/dist/{installer-UMH7OJ5A.js.map → installer-N4UTEACX.js.map} +0 -0
  121. /package/dist/{loader-NAVVZK63.js.map → loader-UDNUMEDA.js.map} +0 -0
  122. /package/dist/{open-5A27BCSB.js.map → open-7TXJQM3H.js.map} +0 -0
  123. /package/dist/{post-compact-USAODKPQ.js.map → post-compact-7AEFVCZS.js.map} +0 -0
  124. /package/dist/{post-tool-use-GMMSYBII.js.map → post-tool-use-TZINWWDH.js.map} +0 -0
  125. /package/dist/{post-tool-use-failure-NZVSL2PO.js.map → post-tool-use-failure-TCFEU2GI.js.map} +0 -0
  126. /package/dist/{pre-compact-LZ57DLUS.js.map → pre-compact-LO2VZCGR.js.map} +0 -0
  127. /package/dist/{registry-M2Z5QBWH.js.map → registry-F3THYC5M.js.map} +0 -0
  128. /package/dist/{remove-T3KE6C5N.js.map → remove-F77AAALE.js.map} +0 -0
  129. /package/dist/{restart-YWDEVZUJ.js.map → restart-UEFDPMLT.js.map} +0 -0
  130. /package/dist/{search-GKFDGELR.js.map → search-NHNVUAQQ.js.map} +0 -0
  131. /package/dist/{server-AHUR6CWF.js.map → server-AZJSTQEK.js.map} +0 -0
  132. /package/dist/{session-2ZEPLWW6.js.map → session-3HLC5KOD.js.map} +0 -0
  133. /package/dist/{session-end-LWJYQAXX.js.map → session-end-FS46UARX.js.map} +0 -0
  134. /package/dist/{session-start-WTA6GCOQ.js.map → session-start-46KPFV2H.js.map} +0 -0
  135. /package/dist/{setup-llm-E7UU5IO7.js.map → setup-llm-JMWSNQ2C.js.map} +0 -0
  136. /package/dist/{stats-DFG6S23S.js.map → stats-MKMETHMA.js.map} +0 -0
  137. /package/dist/{stop-WRBTXEVT.js.map → stop-OUEX6KA4.js.map} +0 -0
  138. /package/dist/{stop-failure-32MGIG2Q.js.map → stop-failure-2BWVNZEG.js.map} +0 -0
  139. /package/dist/{subagent-start-VFGHQFVL.js.map → subagent-start-J4VV6DEE.js.map} +0 -0
  140. /package/dist/{subagent-stop-663FXG3P.js.map → subagent-stop-JMLVEPIA.js.map} +0 -0
  141. /package/dist/{task-completed-ZCQYEFMZ.js.map → task-completed-65CHMMKA.js.map} +0 -0
  142. /package/dist/{team-JTI5CDUO.js.map → team-U2LDKIS4.js.map} +0 -0
  143. /package/dist/{update-3NBQTG32.js.map → update-ZSHVXWSQ.js.map} +0 -0
  144. /package/dist/{user-prompt-submit-ME2TBKOS.js.map → user-prompt-submit-APMO6FVU.js.map} +0 -0
  145. /package/dist/{version-GQAFBBPX.js.map → version-TXPPS3L5.js.map} +0 -0
@@ -1,14 +1,14 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
2
  import {
3
3
  sendEvent
4
- } from "./chunk-G6QIBNZM.js";
4
+ } from "./chunk-NFO7BRCO.js";
5
5
  import "./chunk-V7XG6V6C.js";
6
- import "./chunk-5ZG4RMUH.js";
6
+ import "./chunk-N2DGFACQ.js";
7
7
  import "./chunk-ZXZPJJN3.js";
8
- import "./chunk-CUDIZJY7.js";
9
- import "./chunk-P66DLD6G.js";
10
- import "./chunk-BUTL6IFS.js";
11
- import "./chunk-NGROSFOH.js";
8
+ import "./chunk-TSM6VESW.js";
9
+ import "./chunk-KTTSXYEK.js";
10
+ import "./chunk-ENZR5NG7.js";
11
+ import "./chunk-Z66IT5KL.js";
12
12
  import "./chunk-LPUQPDC2.js";
13
13
  import "./chunk-6C6QZ4PM.js";
14
14
  import "./chunk-UUHLLQXO.js";
@@ -30,4 +30,4 @@ async function main() {
30
30
  export {
31
31
  main
32
32
  };
33
- //# sourceMappingURL=subagent-stop-663FXG3P.js.map
33
+ //# sourceMappingURL=subagent-stop-JMLVEPIA.js.map
@@ -1,14 +1,14 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
2
  import {
3
3
  sendEvent
4
- } from "./chunk-G6QIBNZM.js";
4
+ } from "./chunk-NFO7BRCO.js";
5
5
  import "./chunk-V7XG6V6C.js";
6
- import "./chunk-5ZG4RMUH.js";
6
+ import "./chunk-N2DGFACQ.js";
7
7
  import "./chunk-ZXZPJJN3.js";
8
- import "./chunk-CUDIZJY7.js";
9
- import "./chunk-P66DLD6G.js";
10
- import "./chunk-BUTL6IFS.js";
11
- import "./chunk-NGROSFOH.js";
8
+ import "./chunk-TSM6VESW.js";
9
+ import "./chunk-KTTSXYEK.js";
10
+ import "./chunk-ENZR5NG7.js";
11
+ import "./chunk-Z66IT5KL.js";
12
12
  import "./chunk-LPUQPDC2.js";
13
13
  import "./chunk-6C6QZ4PM.js";
14
14
  import "./chunk-UUHLLQXO.js";
@@ -29,4 +29,4 @@ async function main() {
29
29
  export {
30
30
  main
31
31
  };
32
- //# sourceMappingURL=task-completed-ZCQYEFMZ.js.map
32
+ //# sourceMappingURL=task-completed-65CHMMKA.js.map
@@ -4,8 +4,8 @@ import {
4
4
  teamInit,
5
5
  teamUpgrade,
6
6
  upgradeWorker
7
- } from "./chunk-R2JIJBCL.js";
8
- import "./chunk-RL5R4CQU.js";
7
+ } from "./chunk-6ALVMIB4.js";
8
+ import "./chunk-DTWUHHFI.js";
9
9
  import "./chunk-53RPGOEN.js";
10
10
  import "./chunk-OUJSQSKE.js";
11
11
  import "./chunk-POEPHBQK.js";
@@ -21,4 +21,4 @@ export {
21
21
  teamUpgrade,
22
22
  upgradeWorker
23
23
  };
24
- //# sourceMappingURL=team-JTI5CDUO.js.map
24
+ //# sourceMappingURL=team-U2LDKIS4.js.map
@@ -57,7 +57,7 @@ Error generating stack: `+y.message+`
57
57
  * @license MIT
58
58
  */var Ej="popstate";function jj(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function bz(e={}){function t(r,a){var d;let i=(d=a.state)==null?void 0:d.masked,{pathname:s,search:o,hash:f}=i||r.location;return A1("",{pathname:s,search:o,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default",i?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:Pf(a)}return Sz(t,n,null,e)}function yn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function li(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function wz(){return Math.random().toString(36).substring(2,10)}function kj(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function A1(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Uc(t):t,state:n,key:t&&t.key||r||wz(),unstable_mask:a}}function Pf({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Uc(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Sz(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:i=!1}=r,s=a.history,o="POP",f=null,d=h();d==null&&(d=0,s.replaceState({...s.state,idx:d},""));function h(){return(s.state||{idx:null}).idx}function m(){o="POP";let w=h(),S=w==null?null:w-d;d=w,f&&f({action:o,location:b.location,delta:S})}function v(w,S){o="PUSH";let C=jj(w)?w:A1(b.location,w,S);d=h()+1;let N=kj(C,d),k=b.createHref(C.unstable_mask||C);try{s.pushState(N,"",k)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;a.location.assign(k)}i&&f&&f({action:o,location:b.location,delta:1})}function x(w,S){o="REPLACE";let C=jj(w)?w:A1(b.location,w,S);d=h();let N=kj(C,d),k=b.createHref(C.unstable_mask||C);s.replaceState(N,"",k),i&&f&&f({action:o,location:b.location,delta:0})}function g(w){return Nz(w)}let b={get action(){return o},get location(){return e(a,s)},listen(w){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(Ej,m),f=w,()=>{a.removeEventListener(Ej,m),f=null}},createHref(w){return t(a,w)},createURL:g,encodeLocation(w){let S=g(w);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:v,replace:x,go(w){return s.go(w)}};return b}function Nz(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),yn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Pf(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function o_(e,t,n="/"){return Cz(e,t,n,!1)}function Cz(e,t,n,r){let a=typeof t=="string"?Uc(t):t,i=ys(a.pathname||"/",n);if(i==null)return null;let s=u_(e);Ez(s);let o=null;for(let f=0;o==null&&f<s.length;++f){let d=Pz(i);o=Lz(s[f],d,r)}return o}function u_(e,t=[],n=[],r="",a=!1){let i=(s,o,f=a,d)=>{let h={relativePath:d===void 0?s.path||"":d,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(r)&&f)return;yn(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length)}let m=Di([r,h.relativePath]),v=n.concat(h);s.children&&s.children.length>0&&(yn(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),u_(s.children,t,v,m,f)),!(s.path==null&&!s.index)&&t.push({path:m,score:_z(m,s.index),routesMeta:v})};return e.forEach((s,o)=>{var f;if(s.path===""||!((f=s.path)!=null&&f.includes("?")))i(s,o);else for(let d of c_(s.path))i(s,o,!0,d)}),t}function c_(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let s=c_(r.join("/")),o=[];return o.push(...s.map(f=>f===""?i:[i,f].join("/"))),a&&o.push(...s),o.map(f=>e.startsWith("/")&&f===""?"/":f)}function Ez(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Mz(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var jz=/^:[\w-]+$/,kz=3,Tz=2,Rz=1,Az=10,Dz=-2,Tj=e=>e==="*";function _z(e,t){let n=e.split("/"),r=n.length;return n.some(Tj)&&(r+=Dz),t&&(r+=Tz),n.filter(a=>!Tj(a)).reduce((a,i)=>a+(jz.test(i)?kz:i===""?Rz:Az),r)}function Mz(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function Lz(e,t,n=!1){let{routesMeta:r}=e,a={},i="/",s=[];for(let o=0;o<r.length;++o){let f=r[o],d=o===r.length-1,h=i==="/"?t:t.slice(i.length)||"/",m=Xp({path:f.relativePath,caseSensitive:f.caseSensitive,end:d},h),v=f.route;if(!m&&d&&n&&!r[r.length-1].route.index&&(m=Xp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},h)),!m)return null;Object.assign(a,m.params),s.push({params:a,pathname:Di([i,m.pathname]),pathnameBase:Fz(Di([i,m.pathnameBase])),route:v}),m.pathnameBase!=="/"&&(i=Di([i,m.pathnameBase]))}return s}function Xp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Oz(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],s=i.replace(/(.)\/+$/,"$1"),o=a.slice(1);return{params:r.reduce((d,{paramName:h,isOptional:m},v)=>{if(h==="*"){let g=o[v]||"";s=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const x=o[v];return m&&!x?d[h]=void 0:d[h]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:s,pattern:e}}function Oz(e,t=!1,n=!0){li(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,f,d,h)=>{if(r.push({paramName:o,isOptional:f!=null}),f){let m=h.charAt(d+s.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function Pz(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return li(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ys(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var Bz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function zz(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Uc(e):e,i;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?i=Rj(n.substring(1),"/"):i=Rj(n,t)):i=t,{pathname:i,search:Uz(r),hash:qz(a)}}function Rj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Ux(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Iz(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function d_(e){let t=Iz(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Fw(e,t,n,r=!1){let a;typeof e=="string"?a=Uc(e):(a={...e},yn(!a.pathname||!a.pathname.includes("?"),Ux("?","pathname","search",a)),yn(!a.pathname||!a.pathname.includes("#"),Ux("#","pathname","hash",a)),yn(!a.search||!a.search.includes("#"),Ux("#","search","hash",a)));let i=e===""||a.pathname==="",s=i?"/":a.pathname,o;if(s==null)o=n;else{let m=t.length-1;if(!r&&s.startsWith("..")){let v=s.split("/");for(;v[0]==="..";)v.shift(),m-=1;a.pathname=v.join("/")}o=m>=0?t[m]:"/"}let f=zz(a,o),d=s&&s!=="/"&&s.endsWith("/"),h=(i||s===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(d||h)&&(f.pathname+="/"),f}var Di=e=>e.join("/").replace(/\/\/+/g,"/"),Fz=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Uz=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qz=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Vz=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Hz(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function $z(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var f_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function h_(e,t){let n=e;if(typeof n!="string"||!Bz.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(f_)try{let i=new URL(window.location.href),s=n.startsWith("//")?new URL(i.protocol+n):new URL(n),o=ys(s.pathname,t);s.origin===i.origin&&o!=null?n=o+s.search+s.hash:a=!0}catch{li(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var m_=["POST","PUT","PATCH","DELETE"];new Set(m_);var Gz=["GET",...m_];new Set(Gz);var qc=T.createContext(null);qc.displayName="DataRouter";var Rv=T.createContext(null);Rv.displayName="DataRouterState";var Kz=T.createContext(!1),p_=T.createContext({isTransitioning:!1});p_.displayName="ViewTransition";var Yz=T.createContext(new Map);Yz.displayName="Fetchers";var Qz=T.createContext(null);Qz.displayName="Await";var Xa=T.createContext(null);Xa.displayName="Navigation";var uh=T.createContext(null);uh.displayName="Location";var hi=T.createContext({outlet:null,matches:[],isDataRoute:!1});hi.displayName="Route";var Uw=T.createContext(null);Uw.displayName="RouteError";var v_="REACT_ROUTER_ERROR",Xz="REDIRECT",Wz="ROUTE_ERROR_RESPONSE";function Zz(e){if(e.startsWith(`${v_}:${Xz}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Jz(e){if(e.startsWith(`${v_}:${Wz}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Vz(t.status,t.statusText,t.data)}catch{}}function eI(e,{relative:t}={}){yn(ch(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=T.useContext(Xa),{hash:a,pathname:i,search:s}=dh(e,{relative:t}),o=i;return n!=="/"&&(o=i==="/"?n:Di([n,i])),r.createHref({pathname:o,search:s,hash:a})}function ch(){return T.useContext(uh)!=null}function Ea(){return yn(ch(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(uh).location}var g_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function y_(e){T.useContext(Xa).static||T.useLayoutEffect(e)}function ja(){let{isDataRoute:e}=T.useContext(hi);return e?vI():tI()}function tI(){yn(ch(),"useNavigate() may be used only in the context of a <Router> component.");let e=T.useContext(qc),{basename:t,navigator:n}=T.useContext(Xa),{matches:r}=T.useContext(hi),{pathname:a}=Ea(),i=JSON.stringify(d_(r)),s=T.useRef(!1);return y_(()=>{s.current=!0}),T.useCallback((f,d={})=>{if(li(s.current,g_),!s.current)return;if(typeof f=="number"){n.go(f);return}let h=Fw(f,JSON.parse(i),a,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Di([t,h.pathname])),(d.replace?n.replace:n.push)(h,d.state,d)},[t,n,i,a,e])}var nI=T.createContext(null);function rI(e){let t=T.useContext(hi).outlet;return T.useMemo(()=>t&&T.createElement(nI.Provider,{value:e},t),[t,e])}function aI(){let{matches:e}=T.useContext(hi),t=e[e.length-1];return t?t.params:{}}function dh(e,{relative:t}={}){let{matches:n}=T.useContext(hi),{pathname:r}=Ea(),a=JSON.stringify(d_(n));return T.useMemo(()=>Fw(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function iI(e,t){return x_(e,t)}function x_(e,t,n){var w;yn(ch(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=T.useContext(Xa),{matches:a}=T.useContext(hi),i=a[a.length-1],s=i?i.params:{},o=i?i.pathname:"/",f=i?i.pathnameBase:"/",d=i&&i.route;{let S=d&&d.path||"";w_(o,!d||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${o}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
59
 
60
- Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let h=Ea(),m;if(t){let S=typeof t=="string"?Uc(t):t;yn(f==="/"||((w=S.pathname)==null?void 0:w.startsWith(f)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${S.pathname}" was given in the \`location\` prop.`),m=S}else m=h;let v=m.pathname||"/",x=v;if(f!=="/"){let S=f.replace(/^\//,"").split("/");x="/"+v.replace(/^\//,"").split("/").slice(S.length).join("/")}let g=o_(e,{pathname:x});li(d||g!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),li(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let b=cI(g&&g.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Di([f,r.encodeLocation?r.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?f:Di([f,r.encodeLocation?r.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),a,n);return t&&b?T.createElement(uh.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},b):b}function sI(){let e=pI(),t=Hz(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:i},"ErrorBoundary")," or"," ",T.createElement("code",{style:i},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},t),n?T.createElement("pre",{style:a},n):null,s)}var lI=T.createElement(sI,null),b_=class extends T.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=Jz(e.digest);n&&(e=n)}let t=e!==void 0?T.createElement(hi.Provider,{value:this.props.routeContext},T.createElement(Uw.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?T.createElement(oI,{error:e},t):t}};b_.contextType=Kz;var qx=new WeakMap;function oI({children:e,error:t}){let{basename:n}=T.useContext(Xa);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=Zz(t.digest);if(r){let a=qx.get(t);if(a)throw a;let i=h_(r.location,n);if(f_&&!qx.get(t))if(i.isExternal||r.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:r.replace}));throw qx.set(t,s),s}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function uI({routeContext:e,match:t,children:n}){let r=T.useContext(qc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),T.createElement(hi.Provider,{value:e},n)}function cI(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,i=r==null?void 0:r.errors;if(i!=null){let h=a.findIndex(m=>m.route.id&&(i==null?void 0:i[m.route.id])!==void 0);yn(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,h+1))}let s=!1,o=-1;if(n&&r){s=r.renderFallback;for(let h=0;h<a.length;h++){let m=a[h];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(o=h),m.route.id){let{loaderData:v,errors:x}=r,g=m.route.loader&&!v.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||g){n.isStatic&&(s=!0),o>=0?a=a.slice(0,o+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,d=r&&f?(h,m)=>{var v,x;f(h,{location:r.location,params:((x=(v=r.matches)==null?void 0:v[0])==null?void 0:x.params)??{},unstable_pattern:$z(r.matches),errorInfo:m})}:void 0;return a.reduceRight((h,m,v)=>{let x,g=!1,b=null,w=null;r&&(x=i&&m.route.id?i[m.route.id]:void 0,b=m.route.errorElement||lI,s&&(o<0&&v===0?(w_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,w=null):o===v&&(g=!0,w=m.route.hydrateFallbackElement||null)));let S=t.concat(a.slice(0,v+1)),C=()=>{let N;return x?N=b:g?N=w:m.route.Component?N=T.createElement(m.route.Component,null):m.route.element?N=m.route.element:N=h,T.createElement(uI,{match:m,routeContext:{outlet:h,matches:S,isDataRoute:r!=null},children:N})};return r&&(m.route.ErrorBoundary||m.route.errorElement||v===0)?T.createElement(b_,{location:r.location,revalidation:r.revalidation,component:b,error:x,children:C(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:d}):C()},null)}function qw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function dI(e){let t=T.useContext(qc);return yn(t,qw(e)),t}function fI(e){let t=T.useContext(Rv);return yn(t,qw(e)),t}function hI(e){let t=T.useContext(hi);return yn(t,qw(e)),t}function Vw(e){let t=hI(e),n=t.matches[t.matches.length-1];return yn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function mI(){return Vw("useRouteId")}function pI(){var r;let e=T.useContext(Uw),t=fI("useRouteError"),n=Vw("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function vI(){let{router:e}=dI("useNavigate"),t=Vw("useNavigate"),n=T.useRef(!1);return y_(()=>{n.current=!0}),T.useCallback(async(a,i={})=>{li(n.current,g_),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var Aj={};function w_(e,t,n){!t&&!Aj[e]&&(Aj[e]=!0,li(!1,n))}T.memo(gI);function gI({routes:e,future:t,state:n,isStatic:r,onError:a}){return x_(e,void 0,{state:n,isStatic:r,onError:a})}function yI(e){return rI(e.context)}function ma(e){yn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function xI({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,unstable_useTransitions:s}){yn(!ch(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),f=T.useMemo(()=>({basename:o,navigator:a,static:i,unstable_useTransitions:s,future:{}}),[o,a,i,s]);typeof n=="string"&&(n=Uc(n));let{pathname:d="/",search:h="",hash:m="",state:v=null,key:x="default",unstable_mask:g}=n,b=T.useMemo(()=>{let w=ys(d,o);return w==null?null:{location:{pathname:w,search:h,hash:m,state:v,key:x,unstable_mask:g},navigationType:r}},[o,d,h,m,v,x,r,g]);return li(b!=null,`<Router basename="${o}"> is not able to match the URL "${d}${h}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:T.createElement(Xa.Provider,{value:f},T.createElement(uh.Provider,{children:t,value:b}))}function bI({children:e,location:t}){return iI(D1(e),t)}function D1(e,t=[]){let n=[];return T.Children.forEach(e,(r,a)=>{if(!T.isValidElement(r))return;let i=[...t,a];if(r.type===T.Fragment){n.push.apply(n,D1(r.props.children,i));return}yn(r.type===ma,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),yn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let s={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=D1(r.props.children,i)),n.push(s)}),n}var _p="get",Mp="application/x-www-form-urlencoded";function Av(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function wI(e){return Av(e)&&e.tagName.toLowerCase()==="button"}function SI(e){return Av(e)&&e.tagName.toLowerCase()==="form"}function NI(e){return Av(e)&&e.tagName.toLowerCase()==="input"}function CI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function EI(e,t){return e.button===0&&(!t||t==="_self")&&!CI(e)}function _1(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function jI(e,t){let n=_1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}var np=null;function kI(){if(np===null)try{new FormData(document.createElement("form"),0),np=!1}catch{np=!0}return np}var TI=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Vx(e){return e!=null&&!TI.has(e)?(li(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Mp}"`),null):e}function RI(e,t){let n,r,a,i,s;if(SI(e)){let o=e.getAttribute("action");r=o?ys(o,t):null,n=e.getAttribute("method")||_p,a=Vx(e.getAttribute("enctype"))||Mp,i=new FormData(e)}else if(wI(e)||NI(e)&&(e.type==="submit"||e.type==="image")){let o=e.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||o.getAttribute("action");if(r=f?ys(f,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||_p,a=Vx(e.getAttribute("formenctype"))||Vx(o.getAttribute("enctype"))||Mp,i=new FormData(o,e),!kI()){let{name:d,type:h,value:m}=e;if(h==="image"){let v=d?`${d}.`:"";i.append(`${v}x`,"0"),i.append(`${v}y`,"0")}else d&&i.append(d,m)}}else{if(Av(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=_p,r=null,a=Mp,s=e}return i&&a==="text/plain"&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Hw(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function AI(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&ys(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function DI(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function _I(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function MI(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let s=await DI(i,n);return s.links?s.links():[]}return[]}));return BI(r.flat(1).filter(_I).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Dj(e,t,n,r,a,i){let s=(f,d)=>n[d]?f.route.id!==n[d].route.id:!0,o=(f,d)=>{var h;return n[d].pathname!==f.pathname||((h=n[d].route.path)==null?void 0:h.endsWith("*"))&&n[d].params["*"]!==f.params["*"]};return i==="assets"?t.filter((f,d)=>s(f,d)||o(f,d)):i==="data"?t.filter((f,d)=>{var m;let h=r.routes[f.route.id];if(!h||!h.hasLoader)return!1;if(s(f,d)||o(f,d))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function LI(e,t,{includeHydrateFallback:n}={}){return OI(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function OI(e){return[...new Set(e)]}function PI(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function BI(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(PI(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function S_(){let e=T.useContext(qc);return Hw(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function zI(){let e=T.useContext(Rv);return Hw(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var $w=T.createContext(void 0);$w.displayName="FrameworkContext";function N_(){let e=T.useContext($w);return Hw(e,"You must render this element inside a <HydratedRouter> element"),e}function II(e,t){let n=T.useContext($w),[r,a]=T.useState(!1),[i,s]=T.useState(!1),{onFocus:o,onBlur:f,onMouseEnter:d,onMouseLeave:h,onTouchStart:m}=t,v=T.useRef(null);T.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let b=S=>{S.forEach(C=>{s(C.isIntersecting)})},w=new IntersectionObserver(b,{threshold:.5});return v.current&&w.observe(v.current),()=>{w.disconnect()}}},[e]),T.useEffect(()=>{if(r){let b=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(b)}}},[r]);let x=()=>{a(!0)},g=()=>{a(!1),s(!1)};return n?e!=="intent"?[i,v,{}]:[i,v,{onFocus:Wd(o,x),onBlur:Wd(f,g),onMouseEnter:Wd(d,x),onMouseLeave:Wd(h,g),onTouchStart:Wd(m,x)}]:[!1,v,{}]}function Wd(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function FI({page:e,...t}){let{router:n}=S_(),r=T.useMemo(()=>o_(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?T.createElement(qI,{page:e,matches:r,...t}):null}function UI(e){let{manifest:t,routeModules:n}=N_(),[r,a]=T.useState([]);return T.useEffect(()=>{let i=!1;return MI(e,t,n).then(s=>{i||a(s)}),()=>{i=!0}},[e,t,n]),r}function qI({page:e,matches:t,...n}){let r=Ea(),{future:a,manifest:i,routeModules:s}=N_(),{basename:o}=S_(),{loaderData:f,matches:d}=zI(),h=T.useMemo(()=>Dj(e,t,d,i,r,"data"),[e,t,d,i,r]),m=T.useMemo(()=>Dj(e,t,d,i,r,"assets"),[e,t,d,i,r]),v=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,w=!1;if(t.forEach(C=>{var k;let N=i.routes[C.route.id];!N||!N.hasLoader||(!h.some(D=>D.route.id===C.route.id)&&C.route.id in f&&((k=s[C.route.id])!=null&&k.shouldRevalidate)||N.hasClientLoader?w=!0:b.add(C.route.id))}),b.size===0)return[];let S=AI(e,o,a.unstable_trailingSlashAwareDataRequests,"data");return w&&b.size>0&&S.searchParams.set("_routes",t.filter(C=>b.has(C.route.id)).map(C=>C.route.id).join(",")),[S.pathname+S.search]},[o,a.unstable_trailingSlashAwareDataRequests,f,r,i,h,t,e,s]),x=T.useMemo(()=>LI(m,i),[m,i]),g=UI(m);return T.createElement(T.Fragment,null,v.map(b=>T.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),x.map(b=>T.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),g.map(({key:b,link:w})=>T.createElement("link",{key:b,nonce:n.nonce,...w,crossOrigin:w.crossOrigin??n.crossOrigin})))}function VI(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var HI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{HI&&(window.__reactRouterVersion="7.13.1")}catch{}function $I({basename:e,children:t,unstable_useTransitions:n,window:r}){let a=T.useRef();a.current==null&&(a.current=bz({window:r,v5Compat:!0}));let i=a.current,[s,o]=T.useState({action:i.action,location:i.location}),f=T.useCallback(d=>{n===!1?o(d):T.startTransition(()=>o(d))},[n]);return T.useLayoutEffect(()=>i.listen(f),[i,f]),T.createElement(xI,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:i,unstable_useTransitions:n})}var C_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ka=T.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:s,unstable_mask:o,state:f,target:d,to:h,preventScrollReset:m,viewTransition:v,unstable_defaultShouldRevalidate:x,...g},b){let{basename:w,navigator:S,unstable_useTransitions:C}=T.useContext(Xa),N=typeof h=="string"&&C_.test(h),k=h_(h,w);h=k.to;let D=eI(h,{relative:a}),R=Ea(),A=null;if(o){let H=Fw(o,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);w!=="/"&&(H.pathname=H.pathname==="/"?w:Di([w,H.pathname])),A=S.createHref(H)}let[M,z,_]=II(r,g),P=YI(h,{replace:s,unstable_mask:o,state:f,target:d,preventScrollReset:m,relative:a,viewTransition:v,unstable_defaultShouldRevalidate:x,unstable_useTransitions:C});function L(H){t&&t(H),H.defaultPrevented||P(H)}let F=!(k.isExternal||i),V=T.createElement("a",{...g,..._,href:(F?A:void 0)||k.absoluteURL||D,onClick:F?L:t,ref:VI(b,z),target:d,"data-discover":!N&&n==="render"?"true":void 0});return M&&!N?T.createElement(T.Fragment,null,V,T.createElement(FI,{page:D})):V});Ka.displayName="Link";var Gw=T.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:i,to:s,viewTransition:o,children:f,...d},h){let m=dh(s,{relative:d.relative}),v=Ea(),x=T.useContext(Rv),{navigator:g,basename:b}=T.useContext(Xa),w=x!=null&&eF(m)&&o===!0,S=g.encodeLocation?g.encodeLocation(m).pathname:m.pathname,C=v.pathname,N=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(C=C.toLowerCase(),N=N?N.toLowerCase():null,S=S.toLowerCase()),N&&b&&(N=ys(N,b)||N);const k=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let D=C===S||!a&&C.startsWith(S)&&C.charAt(k)==="/",R=N!=null&&(N===S||!a&&N.startsWith(S)&&N.charAt(S.length)==="/"),A={isActive:D,isPending:R,isTransitioning:w},M=D?t:void 0,z;typeof r=="function"?z=r(A):z=[r,D?"active":null,R?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let _=typeof i=="function"?i(A):i;return T.createElement(Ka,{...d,"aria-current":M,className:z,ref:h,style:_,to:s,viewTransition:o},typeof f=="function"?f(A):f)});Gw.displayName="NavLink";var GI=T.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:s=_p,action:o,onSubmit:f,relative:d,preventScrollReset:h,viewTransition:m,unstable_defaultShouldRevalidate:v,...x},g)=>{let{unstable_useTransitions:b}=T.useContext(Xa),w=ZI(),S=JI(o,{relative:d}),C=s.toLowerCase()==="get"?"get":"post",N=typeof o=="string"&&C_.test(o),k=D=>{if(f&&f(D),D.defaultPrevented)return;D.preventDefault();let R=D.nativeEvent.submitter,A=(R==null?void 0:R.getAttribute("formmethod"))||s,M=()=>w(R||D.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:a,state:i,relative:d,preventScrollReset:h,viewTransition:m,unstable_defaultShouldRevalidate:v});b&&n!==!1?T.startTransition(()=>M()):M()};return T.createElement("form",{ref:g,method:C,action:S,onSubmit:r?f:k,...x,"data-discover":!N&&e==="render"?"true":void 0})});GI.displayName="Form";function KI(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function E_(e){let t=T.useContext(qc);return yn(t,KI(e)),t}function YI(e,{target:t,replace:n,unstable_mask:r,state:a,preventScrollReset:i,relative:s,viewTransition:o,unstable_defaultShouldRevalidate:f,unstable_useTransitions:d}={}){let h=ja(),m=Ea(),v=dh(e,{relative:s});return T.useCallback(x=>{if(EI(x,t)){x.preventDefault();let g=n!==void 0?n:Pf(m)===Pf(v),b=()=>h(e,{replace:g,unstable_mask:r,state:a,preventScrollReset:i,relative:s,viewTransition:o,unstable_defaultShouldRevalidate:f});d?T.startTransition(()=>b()):b()}},[m,h,v,n,r,a,t,e,i,s,o,f,d])}function QI(e){li(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=T.useRef(_1(e)),n=T.useRef(!1),r=Ea(),a=T.useMemo(()=>jI(r.search,n.current?null:t.current),[r.search]),i=ja(),s=T.useCallback((o,f)=>{const d=_1(typeof o=="function"?o(new URLSearchParams(a)):o);n.current=!0,i("?"+d,f)},[i,a]);return[a,s]}var XI=0,WI=()=>`__${String(++XI)}__`;function ZI(){let{router:e}=E_("useSubmit"),{basename:t}=T.useContext(Xa),n=mI(),r=e.fetch,a=e.navigate;return T.useCallback(async(i,s={})=>{let{action:o,method:f,encType:d,formData:h,body:m}=RI(i,t);if(s.navigate===!1){let v=s.fetcherKey||WI();await r(v,n,s.action||o,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:h,body:m,formMethod:s.method||f,formEncType:s.encType||d,flushSync:s.flushSync})}else await a(s.action||o,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:h,body:m,formMethod:s.method||f,formEncType:s.encType||d,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[r,a,t,n])}function JI(e,{relative:t}={}){let{basename:n}=T.useContext(Xa),r=T.useContext(hi);yn(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...dh(e||".",{relative:t})},s=Ea();if(e==null){i.search=s.search;let o=new URLSearchParams(i.search),f=o.getAll("index");if(f.some(h=>h==="")){o.delete("index"),f.filter(m=>m).forEach(m=>o.append("index",m));let h=o.toString();i.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:Di([n,i.pathname])),Pf(i)}function eF(e,{relative:t}={}){let n=T.useContext(p_);yn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=E_("useViewTransitionState"),a=dh(e,{relative:t});if(!n.isTransitioning)return!1;let i=ys(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=ys(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Xp(a.pathname,s)!=null||Xp(a.pathname,i)!=null}var fh=HD();const tF=oh(fh),_j=6e4,nF=3e5,rF=200,Mj={active:1,idle:2,deep_sleep:5,hidden:10},Lj=["mousemove","mousedown","keydown","scroll","touchstart"],j_=T.createContext(void 0);function aF({children:e}){const[t,n]=T.useState("active"),r=T.useRef(null),a=T.useRef(null),i=T.useRef(Date.now()),s=T.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),a.current&&(clearTimeout(a.current),a.current=null)},[]),o=T.useCallback(()=>{s(),r.current=setTimeout(()=>{n("idle"),a.current=setTimeout(()=>{n("deep_sleep")},nF-_j)},_j)},[s]),f=T.useCallback(()=>{const h=Date.now();h-i.current<rF||(i.current=h,n("active"),o())},[o]),d=T.useCallback(()=>{document.hidden?(s(),n("hidden")):(n("active"),i.current=Date.now(),o())},[s,o]);return T.useEffect(()=>{o();for(const h of Lj)document.addEventListener(h,f,{passive:!0});return document.addEventListener("visibilitychange",d),()=>{s();for(const h of Lj)document.removeEventListener(h,f);document.removeEventListener("visibilitychange",d)}},[f,d,o,s]),u.jsx(j_.Provider,{value:{powerState:t},children:e})}function iF(){const e=T.useContext(j_);if(!e)throw new Error("usePowerState must be used within a PowerProvider");return e.powerState}const sF="/api",Oj="0.21.0";let Pj=!1;function lF(e){if(Pj)return;const t=e.headers.get("X-Myco-Api-Version");t&&t!==Oj&&(Pj=!0,console.warn(`[myco] UI version ${Oj} is talking to daemon ${t} — reload to pick up the new UI build.`))}async function it(e,t){var s;const n=(s=t==null?void 0:t.method)==null?void 0:s.toUpperCase(),a=n==="POST"||n==="PUT"?{"Content-Type":"application/json",...t==null?void 0:t.headers}:t==null?void 0:t.headers,i=await fetch(`${sF}${e}`,{...t,headers:a});if(lF(i),!i.ok){const o=await i.json().catch(()=>({}));throw new k_(i.status,o)}return i.json()}async function It(e,t){return it(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async function Jo(e,t){return it(e,{method:"PUT",body:JSON.stringify(t)})}async function hh(e){return it(e,{method:"DELETE"})}function oF(e){return it("/config/merged",{signal:e})}function uF(e){return it("/config/local",{signal:e})}function Hx(e,t,n){const r={scope:e,patch:t};return n&&n.length>0&&(r.clear=n),Jo("/config/scoped",r)}function Bj(e){return Jo("/config/scoped",{scope:"local",patch:{},clear:e})}class k_ extends Error{constructor(t,n){const r=typeof n=="object"&&n!==null&&"error"in n?String(n.error):null;super(r?`${r} (API ${t})`:`API error ${t}`),this.status=t,this.body=n}}function Wp(e,t){const n=t.split(".");let r=e;for(const a of n){if(r==null||typeof r!="object")return;r=r[a]}return r}function $x(e,t,n){const r=t.split("."),a=r[r.length-1];if(a===void 0)return;let i=e;for(let s=0;s<r.length-1;s+=1){const o=r[s];if(o===void 0)return;const f=i[o];(f==null||typeof f!="object"||Array.isArray(f))&&(i[o]={}),i=i[o]}i[a]=n}const Gx=["config","merged"],zj=["config","local"],cF=["notifications"];function Wa(){const e=Gt(),t=Lt({queryKey:Gx,queryFn:({signal:g})=>oF(g)}),n=Lt({queryKey:zj,queryFn:({signal:g})=>uF(g)}),r=T.useRef(t.data);r.current=t.data;const a=T.useRef(n.data);a.current=n.data;const i=T.useCallback(()=>{e.invalidateQueries({queryKey:cF})},[e]),s=T.useCallback(()=>{e.invalidateQueries({queryKey:zj}),e.invalidateQueries({queryKey:Gx}),i()},[i,e]),o=T.useCallback(()=>{e.invalidateQueries({queryKey:Gx}),i()},[i,e]),f=T.useCallback(g=>g==="local"?s():o(),[s,o]),d=T.useCallback(async(g,b,w)=>{const S={};$x(S,g,b),await Hx(w,S),f(w)},[f]),h=T.useCallback(async(g,b,w)=>{const S={};for(const{path:C,value:N}of g)$x(S,C,N);await Hx(b,S,w),f(b)},[f]),m=T.useCallback(async g=>{await Bj([g]),s()},[s]),v=T.useCallback(async g=>{const b=Wp(r.current??{},g),w={};$x(w,g,b),await Hx("project",w),await Bj([g]),s()},[s]),x=T.useCallback(g=>Wp(a.current??{},g)!==void 0,[]);return{effective:t.data,local:n.data??{},isLoading:t.isLoading||n.isLoading,isLocalOverride:x,setField:d,setFields:h,resetField:m,promoteField:v}}const T_=T.createContext(null),dF={compact:.85,normal:1,comfy:1.15},fF={default:{heading:"'Newsreader', Georgia, serif",ui:"'Inter', system-ui, sans-serif",data:"'JetBrains Mono', 'Fira Code', monospace"},"geist-mono":{heading:"'Geist Mono', 'SF Mono', 'Fira Code', monospace",ui:"'Geist Mono', 'SF Mono', 'Fira Code', monospace",data:"'Geist Mono', 'SF Mono', 'Fira Code', monospace"},system:{heading:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",ui:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",data:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace"},"sf-mono":{heading:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace",ui:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace",data:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace"},"fira-code":{heading:"'Fira Code', 'Fira Mono', ui-monospace, monospace",ui:"'Fira Code', 'Fira Mono', ui-monospace, monospace",data:"'Fira Code', 'Fira Mono', ui-monospace, monospace"},"jetbrains-mono":{heading:"'JetBrains Mono', ui-monospace, monospace",ui:"'JetBrains Mono', ui-monospace, monospace",data:"'JetBrains Mono', ui-monospace, monospace"}},hF={theme:"sage",mode:"dark",font:"default",density:"normal"},R_="(prefers-color-scheme: light)";function Ij(e){const t=document.documentElement;t.setAttribute("data-theme",e.theme);const n=e.mode==="system"?window.matchMedia(R_).matches?"light":"dark":e.mode;t.classList.toggle("light",n==="light");const r=fF[e.font];t.style.setProperty("--font-heading",r.heading),t.style.setProperty("--font-ui",r.ui),t.style.setProperty("--font-data",r.data);const a=dF[e.density];t.style.setProperty("--density",String(a)),t.style.fontSize=`calc(14px * ${a})`;const i=document.querySelector('link[rel="icon"]');if(i){const s=`/favicon-${e.theme}.svg`;i.href.endsWith(s)||(i.href=s)}}function mF({children:e}){const{effective:t,local:n,setField:r,resetField:a,promoteField:i}=Wa(),s=T.useMemo(()=>(t==null?void 0:t.appearance)??hF,[t==null?void 0:t.appearance]),o=T.useMemo(()=>n.appearance??{},[n.appearance]);T.useEffect(()=>{Ij(s)},[s]),T.useEffect(()=>{if(s.mode!=="system")return;const x=window.matchMedia(R_),g=()=>Ij(s);return x.addEventListener("change",g),()=>x.removeEventListener("change",g)},[s]);const f=T.useCallback((x,g,b)=>r(`appearance.${x}`,g,b),[r]),d=T.useCallback(x=>a(`appearance.${x}`),[a]),h=T.useCallback(()=>i("appearance"),[i]),m=T.useCallback(()=>a("appearance"),[a]),v=T.useMemo(()=>({effective:s,local:o,set:f,resetKey:d,saveAllAsProject:h,resetAll:m}),[s,o,f,d,h,m]);return u.jsx(T_.Provider,{value:v,children:e})}function pF(){const e=T.useContext(T_);if(!e)throw new Error("useAppearance must be used inside AppearanceProvider");return e}const vF="configSection",gF="configField",M1="tab",yF="config-field-",Za={appearance:"config-section-appearance",cortexInstructions:"config-section-cortex-instructions",cortexBuilder:"config-section-cortex-builder",cortexDigest:"config-section-cortex-digest",settingsAgent:"config-section-settings-agent",settingsEmbedding:"config-section-settings-embedding",settingsNotifications:"config-section-settings-notifications",settingsPlanCapture:"config-section-settings-plan-capture",settingsProject:"config-section-settings-project",agentOperations:"config-section-agent-operations",operationsMaintenance:"config-section-operations-maintenance",operationsBackup:"config-section-operations-backup"};function Dv(e){return`${yF}${e.replace(/[^a-zA-Z0-9]+/g,"-")}`}/**
60
+ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let h=Ea(),m;if(t){let S=typeof t=="string"?Uc(t):t;yn(f==="/"||((w=S.pathname)==null?void 0:w.startsWith(f)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${S.pathname}" was given in the \`location\` prop.`),m=S}else m=h;let v=m.pathname||"/",x=v;if(f!=="/"){let S=f.replace(/^\//,"").split("/");x="/"+v.replace(/^\//,"").split("/").slice(S.length).join("/")}let g=o_(e,{pathname:x});li(d||g!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),li(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let b=cI(g&&g.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Di([f,r.encodeLocation?r.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?f:Di([f,r.encodeLocation?r.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),a,n);return t&&b?T.createElement(uh.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},b):b}function sI(){let e=pI(),t=Hz(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:i},"ErrorBoundary")," or"," ",T.createElement("code",{style:i},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},t),n?T.createElement("pre",{style:a},n):null,s)}var lI=T.createElement(sI,null),b_=class extends T.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=Jz(e.digest);n&&(e=n)}let t=e!==void 0?T.createElement(hi.Provider,{value:this.props.routeContext},T.createElement(Uw.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?T.createElement(oI,{error:e},t):t}};b_.contextType=Kz;var qx=new WeakMap;function oI({children:e,error:t}){let{basename:n}=T.useContext(Xa);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=Zz(t.digest);if(r){let a=qx.get(t);if(a)throw a;let i=h_(r.location,n);if(f_&&!qx.get(t))if(i.isExternal||r.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:r.replace}));throw qx.set(t,s),s}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function uI({routeContext:e,match:t,children:n}){let r=T.useContext(qc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),T.createElement(hi.Provider,{value:e},n)}function cI(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,i=r==null?void 0:r.errors;if(i!=null){let h=a.findIndex(m=>m.route.id&&(i==null?void 0:i[m.route.id])!==void 0);yn(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,h+1))}let s=!1,o=-1;if(n&&r){s=r.renderFallback;for(let h=0;h<a.length;h++){let m=a[h];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(o=h),m.route.id){let{loaderData:v,errors:x}=r,g=m.route.loader&&!v.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||g){n.isStatic&&(s=!0),o>=0?a=a.slice(0,o+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,d=r&&f?(h,m)=>{var v,x;f(h,{location:r.location,params:((x=(v=r.matches)==null?void 0:v[0])==null?void 0:x.params)??{},unstable_pattern:$z(r.matches),errorInfo:m})}:void 0;return a.reduceRight((h,m,v)=>{let x,g=!1,b=null,w=null;r&&(x=i&&m.route.id?i[m.route.id]:void 0,b=m.route.errorElement||lI,s&&(o<0&&v===0?(w_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,w=null):o===v&&(g=!0,w=m.route.hydrateFallbackElement||null)));let S=t.concat(a.slice(0,v+1)),C=()=>{let N;return x?N=b:g?N=w:m.route.Component?N=T.createElement(m.route.Component,null):m.route.element?N=m.route.element:N=h,T.createElement(uI,{match:m,routeContext:{outlet:h,matches:S,isDataRoute:r!=null},children:N})};return r&&(m.route.ErrorBoundary||m.route.errorElement||v===0)?T.createElement(b_,{location:r.location,revalidation:r.revalidation,component:b,error:x,children:C(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:d}):C()},null)}function qw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function dI(e){let t=T.useContext(qc);return yn(t,qw(e)),t}function fI(e){let t=T.useContext(Rv);return yn(t,qw(e)),t}function hI(e){let t=T.useContext(hi);return yn(t,qw(e)),t}function Vw(e){let t=hI(e),n=t.matches[t.matches.length-1];return yn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function mI(){return Vw("useRouteId")}function pI(){var r;let e=T.useContext(Uw),t=fI("useRouteError"),n=Vw("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function vI(){let{router:e}=dI("useNavigate"),t=Vw("useNavigate"),n=T.useRef(!1);return y_(()=>{n.current=!0}),T.useCallback(async(a,i={})=>{li(n.current,g_),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var Aj={};function w_(e,t,n){!t&&!Aj[e]&&(Aj[e]=!0,li(!1,n))}T.memo(gI);function gI({routes:e,future:t,state:n,isStatic:r,onError:a}){return x_(e,void 0,{state:n,isStatic:r,onError:a})}function yI(e){return rI(e.context)}function ma(e){yn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function xI({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,unstable_useTransitions:s}){yn(!ch(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),f=T.useMemo(()=>({basename:o,navigator:a,static:i,unstable_useTransitions:s,future:{}}),[o,a,i,s]);typeof n=="string"&&(n=Uc(n));let{pathname:d="/",search:h="",hash:m="",state:v=null,key:x="default",unstable_mask:g}=n,b=T.useMemo(()=>{let w=ys(d,o);return w==null?null:{location:{pathname:w,search:h,hash:m,state:v,key:x,unstable_mask:g},navigationType:r}},[o,d,h,m,v,x,r,g]);return li(b!=null,`<Router basename="${o}"> is not able to match the URL "${d}${h}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:T.createElement(Xa.Provider,{value:f},T.createElement(uh.Provider,{children:t,value:b}))}function bI({children:e,location:t}){return iI(D1(e),t)}function D1(e,t=[]){let n=[];return T.Children.forEach(e,(r,a)=>{if(!T.isValidElement(r))return;let i=[...t,a];if(r.type===T.Fragment){n.push.apply(n,D1(r.props.children,i));return}yn(r.type===ma,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),yn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let s={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=D1(r.props.children,i)),n.push(s)}),n}var _p="get",Mp="application/x-www-form-urlencoded";function Av(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function wI(e){return Av(e)&&e.tagName.toLowerCase()==="button"}function SI(e){return Av(e)&&e.tagName.toLowerCase()==="form"}function NI(e){return Av(e)&&e.tagName.toLowerCase()==="input"}function CI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function EI(e,t){return e.button===0&&(!t||t==="_self")&&!CI(e)}function _1(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function jI(e,t){let n=_1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}var np=null;function kI(){if(np===null)try{new FormData(document.createElement("form"),0),np=!1}catch{np=!0}return np}var TI=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Vx(e){return e!=null&&!TI.has(e)?(li(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Mp}"`),null):e}function RI(e,t){let n,r,a,i,s;if(SI(e)){let o=e.getAttribute("action");r=o?ys(o,t):null,n=e.getAttribute("method")||_p,a=Vx(e.getAttribute("enctype"))||Mp,i=new FormData(e)}else if(wI(e)||NI(e)&&(e.type==="submit"||e.type==="image")){let o=e.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||o.getAttribute("action");if(r=f?ys(f,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||_p,a=Vx(e.getAttribute("formenctype"))||Vx(o.getAttribute("enctype"))||Mp,i=new FormData(o,e),!kI()){let{name:d,type:h,value:m}=e;if(h==="image"){let v=d?`${d}.`:"";i.append(`${v}x`,"0"),i.append(`${v}y`,"0")}else d&&i.append(d,m)}}else{if(Av(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=_p,r=null,a=Mp,s=e}return i&&a==="text/plain"&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Hw(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function AI(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&ys(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function DI(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function _I(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function MI(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let s=await DI(i,n);return s.links?s.links():[]}return[]}));return BI(r.flat(1).filter(_I).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Dj(e,t,n,r,a,i){let s=(f,d)=>n[d]?f.route.id!==n[d].route.id:!0,o=(f,d)=>{var h;return n[d].pathname!==f.pathname||((h=n[d].route.path)==null?void 0:h.endsWith("*"))&&n[d].params["*"]!==f.params["*"]};return i==="assets"?t.filter((f,d)=>s(f,d)||o(f,d)):i==="data"?t.filter((f,d)=>{var m;let h=r.routes[f.route.id];if(!h||!h.hasLoader)return!1;if(s(f,d)||o(f,d))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function LI(e,t,{includeHydrateFallback:n}={}){return OI(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function OI(e){return[...new Set(e)]}function PI(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function BI(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(PI(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function S_(){let e=T.useContext(qc);return Hw(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function zI(){let e=T.useContext(Rv);return Hw(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var $w=T.createContext(void 0);$w.displayName="FrameworkContext";function N_(){let e=T.useContext($w);return Hw(e,"You must render this element inside a <HydratedRouter> element"),e}function II(e,t){let n=T.useContext($w),[r,a]=T.useState(!1),[i,s]=T.useState(!1),{onFocus:o,onBlur:f,onMouseEnter:d,onMouseLeave:h,onTouchStart:m}=t,v=T.useRef(null);T.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let b=S=>{S.forEach(C=>{s(C.isIntersecting)})},w=new IntersectionObserver(b,{threshold:.5});return v.current&&w.observe(v.current),()=>{w.disconnect()}}},[e]),T.useEffect(()=>{if(r){let b=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(b)}}},[r]);let x=()=>{a(!0)},g=()=>{a(!1),s(!1)};return n?e!=="intent"?[i,v,{}]:[i,v,{onFocus:Wd(o,x),onBlur:Wd(f,g),onMouseEnter:Wd(d,x),onMouseLeave:Wd(h,g),onTouchStart:Wd(m,x)}]:[!1,v,{}]}function Wd(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function FI({page:e,...t}){let{router:n}=S_(),r=T.useMemo(()=>o_(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?T.createElement(qI,{page:e,matches:r,...t}):null}function UI(e){let{manifest:t,routeModules:n}=N_(),[r,a]=T.useState([]);return T.useEffect(()=>{let i=!1;return MI(e,t,n).then(s=>{i||a(s)}),()=>{i=!0}},[e,t,n]),r}function qI({page:e,matches:t,...n}){let r=Ea(),{future:a,manifest:i,routeModules:s}=N_(),{basename:o}=S_(),{loaderData:f,matches:d}=zI(),h=T.useMemo(()=>Dj(e,t,d,i,r,"data"),[e,t,d,i,r]),m=T.useMemo(()=>Dj(e,t,d,i,r,"assets"),[e,t,d,i,r]),v=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,w=!1;if(t.forEach(C=>{var k;let N=i.routes[C.route.id];!N||!N.hasLoader||(!h.some(D=>D.route.id===C.route.id)&&C.route.id in f&&((k=s[C.route.id])!=null&&k.shouldRevalidate)||N.hasClientLoader?w=!0:b.add(C.route.id))}),b.size===0)return[];let S=AI(e,o,a.unstable_trailingSlashAwareDataRequests,"data");return w&&b.size>0&&S.searchParams.set("_routes",t.filter(C=>b.has(C.route.id)).map(C=>C.route.id).join(",")),[S.pathname+S.search]},[o,a.unstable_trailingSlashAwareDataRequests,f,r,i,h,t,e,s]),x=T.useMemo(()=>LI(m,i),[m,i]),g=UI(m);return T.createElement(T.Fragment,null,v.map(b=>T.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),x.map(b=>T.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),g.map(({key:b,link:w})=>T.createElement("link",{key:b,nonce:n.nonce,...w,crossOrigin:w.crossOrigin??n.crossOrigin})))}function VI(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var HI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{HI&&(window.__reactRouterVersion="7.13.1")}catch{}function $I({basename:e,children:t,unstable_useTransitions:n,window:r}){let a=T.useRef();a.current==null&&(a.current=bz({window:r,v5Compat:!0}));let i=a.current,[s,o]=T.useState({action:i.action,location:i.location}),f=T.useCallback(d=>{n===!1?o(d):T.startTransition(()=>o(d))},[n]);return T.useLayoutEffect(()=>i.listen(f),[i,f]),T.createElement(xI,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:i,unstable_useTransitions:n})}var C_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ka=T.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:s,unstable_mask:o,state:f,target:d,to:h,preventScrollReset:m,viewTransition:v,unstable_defaultShouldRevalidate:x,...g},b){let{basename:w,navigator:S,unstable_useTransitions:C}=T.useContext(Xa),N=typeof h=="string"&&C_.test(h),k=h_(h,w);h=k.to;let D=eI(h,{relative:a}),R=Ea(),A=null;if(o){let H=Fw(o,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);w!=="/"&&(H.pathname=H.pathname==="/"?w:Di([w,H.pathname])),A=S.createHref(H)}let[M,z,_]=II(r,g),P=YI(h,{replace:s,unstable_mask:o,state:f,target:d,preventScrollReset:m,relative:a,viewTransition:v,unstable_defaultShouldRevalidate:x,unstable_useTransitions:C});function L(H){t&&t(H),H.defaultPrevented||P(H)}let F=!(k.isExternal||i),V=T.createElement("a",{...g,..._,href:(F?A:void 0)||k.absoluteURL||D,onClick:F?L:t,ref:VI(b,z),target:d,"data-discover":!N&&n==="render"?"true":void 0});return M&&!N?T.createElement(T.Fragment,null,V,T.createElement(FI,{page:D})):V});Ka.displayName="Link";var Gw=T.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:i,to:s,viewTransition:o,children:f,...d},h){let m=dh(s,{relative:d.relative}),v=Ea(),x=T.useContext(Rv),{navigator:g,basename:b}=T.useContext(Xa),w=x!=null&&eF(m)&&o===!0,S=g.encodeLocation?g.encodeLocation(m).pathname:m.pathname,C=v.pathname,N=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(C=C.toLowerCase(),N=N?N.toLowerCase():null,S=S.toLowerCase()),N&&b&&(N=ys(N,b)||N);const k=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let D=C===S||!a&&C.startsWith(S)&&C.charAt(k)==="/",R=N!=null&&(N===S||!a&&N.startsWith(S)&&N.charAt(S.length)==="/"),A={isActive:D,isPending:R,isTransitioning:w},M=D?t:void 0,z;typeof r=="function"?z=r(A):z=[r,D?"active":null,R?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let _=typeof i=="function"?i(A):i;return T.createElement(Ka,{...d,"aria-current":M,className:z,ref:h,style:_,to:s,viewTransition:o},typeof f=="function"?f(A):f)});Gw.displayName="NavLink";var GI=T.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:s=_p,action:o,onSubmit:f,relative:d,preventScrollReset:h,viewTransition:m,unstable_defaultShouldRevalidate:v,...x},g)=>{let{unstable_useTransitions:b}=T.useContext(Xa),w=ZI(),S=JI(o,{relative:d}),C=s.toLowerCase()==="get"?"get":"post",N=typeof o=="string"&&C_.test(o),k=D=>{if(f&&f(D),D.defaultPrevented)return;D.preventDefault();let R=D.nativeEvent.submitter,A=(R==null?void 0:R.getAttribute("formmethod"))||s,M=()=>w(R||D.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:a,state:i,relative:d,preventScrollReset:h,viewTransition:m,unstable_defaultShouldRevalidate:v});b&&n!==!1?T.startTransition(()=>M()):M()};return T.createElement("form",{ref:g,method:C,action:S,onSubmit:r?f:k,...x,"data-discover":!N&&e==="render"?"true":void 0})});GI.displayName="Form";function KI(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function E_(e){let t=T.useContext(qc);return yn(t,KI(e)),t}function YI(e,{target:t,replace:n,unstable_mask:r,state:a,preventScrollReset:i,relative:s,viewTransition:o,unstable_defaultShouldRevalidate:f,unstable_useTransitions:d}={}){let h=ja(),m=Ea(),v=dh(e,{relative:s});return T.useCallback(x=>{if(EI(x,t)){x.preventDefault();let g=n!==void 0?n:Pf(m)===Pf(v),b=()=>h(e,{replace:g,unstable_mask:r,state:a,preventScrollReset:i,relative:s,viewTransition:o,unstable_defaultShouldRevalidate:f});d?T.startTransition(()=>b()):b()}},[m,h,v,n,r,a,t,e,i,s,o,f,d])}function QI(e){li(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=T.useRef(_1(e)),n=T.useRef(!1),r=Ea(),a=T.useMemo(()=>jI(r.search,n.current?null:t.current),[r.search]),i=ja(),s=T.useCallback((o,f)=>{const d=_1(typeof o=="function"?o(new URLSearchParams(a)):o);n.current=!0,i("?"+d,f)},[i,a]);return[a,s]}var XI=0,WI=()=>`__${String(++XI)}__`;function ZI(){let{router:e}=E_("useSubmit"),{basename:t}=T.useContext(Xa),n=mI(),r=e.fetch,a=e.navigate;return T.useCallback(async(i,s={})=>{let{action:o,method:f,encType:d,formData:h,body:m}=RI(i,t);if(s.navigate===!1){let v=s.fetcherKey||WI();await r(v,n,s.action||o,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:h,body:m,formMethod:s.method||f,formEncType:s.encType||d,flushSync:s.flushSync})}else await a(s.action||o,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:h,body:m,formMethod:s.method||f,formEncType:s.encType||d,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[r,a,t,n])}function JI(e,{relative:t}={}){let{basename:n}=T.useContext(Xa),r=T.useContext(hi);yn(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...dh(e||".",{relative:t})},s=Ea();if(e==null){i.search=s.search;let o=new URLSearchParams(i.search),f=o.getAll("index");if(f.some(h=>h==="")){o.delete("index"),f.filter(m=>m).forEach(m=>o.append("index",m));let h=o.toString();i.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:Di([n,i.pathname])),Pf(i)}function eF(e,{relative:t}={}){let n=T.useContext(p_);yn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=E_("useViewTransitionState"),a=dh(e,{relative:t});if(!n.isTransitioning)return!1;let i=ys(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=ys(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Xp(a.pathname,s)!=null||Xp(a.pathname,i)!=null}var fh=HD();const tF=oh(fh),_j=6e4,nF=3e5,rF=200,Mj={active:1,idle:2,deep_sleep:5,hidden:10},Lj=["mousemove","mousedown","keydown","scroll","touchstart"],j_=T.createContext(void 0);function aF({children:e}){const[t,n]=T.useState("active"),r=T.useRef(null),a=T.useRef(null),i=T.useRef(Date.now()),s=T.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),a.current&&(clearTimeout(a.current),a.current=null)},[]),o=T.useCallback(()=>{s(),r.current=setTimeout(()=>{n("idle"),a.current=setTimeout(()=>{n("deep_sleep")},nF-_j)},_j)},[s]),f=T.useCallback(()=>{const h=Date.now();h-i.current<rF||(i.current=h,n("active"),o())},[o]),d=T.useCallback(()=>{document.hidden?(s(),n("hidden")):(n("active"),i.current=Date.now(),o())},[s,o]);return T.useEffect(()=>{o();for(const h of Lj)document.addEventListener(h,f,{passive:!0});return document.addEventListener("visibilitychange",d),()=>{s();for(const h of Lj)document.removeEventListener(h,f);document.removeEventListener("visibilitychange",d)}},[f,d,o,s]),u.jsx(j_.Provider,{value:{powerState:t},children:e})}function iF(){const e=T.useContext(j_);if(!e)throw new Error("usePowerState must be used within a PowerProvider");return e.powerState}const sF="/api",Oj="0.21.1";let Pj=!1;function lF(e){if(Pj)return;const t=e.headers.get("X-Myco-Api-Version");t&&t!==Oj&&(Pj=!0,console.warn(`[myco] UI version ${Oj} is talking to daemon ${t} — reload to pick up the new UI build.`))}async function it(e,t){var s;const n=(s=t==null?void 0:t.method)==null?void 0:s.toUpperCase(),a=n==="POST"||n==="PUT"?{"Content-Type":"application/json",...t==null?void 0:t.headers}:t==null?void 0:t.headers,i=await fetch(`${sF}${e}`,{...t,headers:a});if(lF(i),!i.ok){const o=await i.json().catch(()=>({}));throw new k_(i.status,o)}return i.json()}async function It(e,t){return it(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async function Jo(e,t){return it(e,{method:"PUT",body:JSON.stringify(t)})}async function hh(e){return it(e,{method:"DELETE"})}function oF(e){return it("/config/merged",{signal:e})}function uF(e){return it("/config/local",{signal:e})}function Hx(e,t,n){const r={scope:e,patch:t};return n&&n.length>0&&(r.clear=n),Jo("/config/scoped",r)}function Bj(e){return Jo("/config/scoped",{scope:"local",patch:{},clear:e})}class k_ extends Error{constructor(t,n){const r=typeof n=="object"&&n!==null&&"error"in n?String(n.error):null;super(r?`${r} (API ${t})`:`API error ${t}`),this.status=t,this.body=n}}function Wp(e,t){const n=t.split(".");let r=e;for(const a of n){if(r==null||typeof r!="object")return;r=r[a]}return r}function $x(e,t,n){const r=t.split("."),a=r[r.length-1];if(a===void 0)return;let i=e;for(let s=0;s<r.length-1;s+=1){const o=r[s];if(o===void 0)return;const f=i[o];(f==null||typeof f!="object"||Array.isArray(f))&&(i[o]={}),i=i[o]}i[a]=n}const Gx=["config","merged"],zj=["config","local"],cF=["notifications"];function Wa(){const e=Gt(),t=Lt({queryKey:Gx,queryFn:({signal:g})=>oF(g)}),n=Lt({queryKey:zj,queryFn:({signal:g})=>uF(g)}),r=T.useRef(t.data);r.current=t.data;const a=T.useRef(n.data);a.current=n.data;const i=T.useCallback(()=>{e.invalidateQueries({queryKey:cF})},[e]),s=T.useCallback(()=>{e.invalidateQueries({queryKey:zj}),e.invalidateQueries({queryKey:Gx}),i()},[i,e]),o=T.useCallback(()=>{e.invalidateQueries({queryKey:Gx}),i()},[i,e]),f=T.useCallback(g=>g==="local"?s():o(),[s,o]),d=T.useCallback(async(g,b,w)=>{const S={};$x(S,g,b),await Hx(w,S),f(w)},[f]),h=T.useCallback(async(g,b,w)=>{const S={};for(const{path:C,value:N}of g)$x(S,C,N);await Hx(b,S,w),f(b)},[f]),m=T.useCallback(async g=>{await Bj([g]),s()},[s]),v=T.useCallback(async g=>{const b=Wp(r.current??{},g),w={};$x(w,g,b),await Hx("project",w),await Bj([g]),s()},[s]),x=T.useCallback(g=>Wp(a.current??{},g)!==void 0,[]);return{effective:t.data,local:n.data??{},isLoading:t.isLoading||n.isLoading,isLocalOverride:x,setField:d,setFields:h,resetField:m,promoteField:v}}const T_=T.createContext(null),dF={compact:.85,normal:1,comfy:1.15},fF={default:{heading:"'Newsreader', Georgia, serif",ui:"'Inter', system-ui, sans-serif",data:"'JetBrains Mono', 'Fira Code', monospace"},"geist-mono":{heading:"'Geist Mono', 'SF Mono', 'Fira Code', monospace",ui:"'Geist Mono', 'SF Mono', 'Fira Code', monospace",data:"'Geist Mono', 'SF Mono', 'Fira Code', monospace"},system:{heading:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",ui:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",data:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace"},"sf-mono":{heading:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace",ui:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace",data:"'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace"},"fira-code":{heading:"'Fira Code', 'Fira Mono', ui-monospace, monospace",ui:"'Fira Code', 'Fira Mono', ui-monospace, monospace",data:"'Fira Code', 'Fira Mono', ui-monospace, monospace"},"jetbrains-mono":{heading:"'JetBrains Mono', ui-monospace, monospace",ui:"'JetBrains Mono', ui-monospace, monospace",data:"'JetBrains Mono', ui-monospace, monospace"}},hF={theme:"sage",mode:"dark",font:"default",density:"normal"},R_="(prefers-color-scheme: light)";function Ij(e){const t=document.documentElement;t.setAttribute("data-theme",e.theme);const n=e.mode==="system"?window.matchMedia(R_).matches?"light":"dark":e.mode;t.classList.toggle("light",n==="light");const r=fF[e.font];t.style.setProperty("--font-heading",r.heading),t.style.setProperty("--font-ui",r.ui),t.style.setProperty("--font-data",r.data);const a=dF[e.density];t.style.setProperty("--density",String(a)),t.style.fontSize=`calc(14px * ${a})`;const i=document.querySelector('link[rel="icon"]');if(i){const s=`/favicon-${e.theme}.svg`;i.href.endsWith(s)||(i.href=s)}}function mF({children:e}){const{effective:t,local:n,setField:r,resetField:a,promoteField:i}=Wa(),s=T.useMemo(()=>(t==null?void 0:t.appearance)??hF,[t==null?void 0:t.appearance]),o=T.useMemo(()=>n.appearance??{},[n.appearance]);T.useEffect(()=>{Ij(s)},[s]),T.useEffect(()=>{if(s.mode!=="system")return;const x=window.matchMedia(R_),g=()=>Ij(s);return x.addEventListener("change",g),()=>x.removeEventListener("change",g)},[s]);const f=T.useCallback((x,g,b)=>r(`appearance.${x}`,g,b),[r]),d=T.useCallback(x=>a(`appearance.${x}`),[a]),h=T.useCallback(()=>i("appearance"),[i]),m=T.useCallback(()=>a("appearance"),[a]),v=T.useMemo(()=>({effective:s,local:o,set:f,resetKey:d,saveAllAsProject:h,resetAll:m}),[s,o,f,d,h,m]);return u.jsx(T_.Provider,{value:v,children:e})}function pF(){const e=T.useContext(T_);if(!e)throw new Error("useAppearance must be used inside AppearanceProvider");return e}const vF="configSection",gF="configField",M1="tab",yF="config-field-",Za={appearance:"config-section-appearance",cortexInstructions:"config-section-cortex-instructions",cortexBuilder:"config-section-cortex-builder",cortexDigest:"config-section-cortex-digest",settingsAgent:"config-section-settings-agent",settingsEmbedding:"config-section-settings-embedding",settingsNotifications:"config-section-settings-notifications",settingsPlanCapture:"config-section-settings-plan-capture",settingsProject:"config-section-settings-project",agentOperations:"config-section-agent-operations",operationsMaintenance:"config-section-operations-maintenance",operationsBackup:"config-section-operations-backup"};function Dv(e){return`${yF}${e.replace(/[^a-zA-Z0-9]+/g,"-")}`}/**
61
61
  * @license lucide-react v0.460.0 - ISC
62
62
  *
63
63
  * This source code is licensed under the ISC license.
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Myco</title>
8
- <script type="module" crossorigin src="/assets/index-DGf1h-Ha.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-BUGor9dk.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-_OP4ifzH.css">
10
10
  </head>
11
11
  <body>
@@ -2,9 +2,9 @@ import { createRequire as __cr } from 'node:module'; const require = __cr(import
2
2
  import {
3
3
  VAULT_GITIGNORE,
4
4
  registerSymbionts
5
- } from "./chunk-JR54LTPP.js";
5
+ } from "./chunk-QDLVIW2O.js";
6
6
  import "./chunk-SAKJMNSR.js";
7
- import "./chunk-VHNRMM4O.js";
7
+ import "./chunk-OTQH5KZW.js";
8
8
  import "./chunk-X3IGT5RV.js";
9
9
  import {
10
10
  getEnabledSymbiontNames,
@@ -15,15 +15,15 @@ import "./chunk-POEPHBQK.js";
15
15
  import "./chunk-MYX5NCRH.js";
16
16
  import {
17
17
  resolveVaultDir
18
- } from "./chunk-CUDIZJY7.js";
19
- import "./chunk-P66DLD6G.js";
18
+ } from "./chunk-TSM6VESW.js";
19
+ import "./chunk-KTTSXYEK.js";
20
20
  import {
21
21
  getPluginVersion
22
- } from "./chunk-BUTL6IFS.js";
22
+ } from "./chunk-ENZR5NG7.js";
23
23
  import {
24
24
  loadManifests,
25
25
  resolvePackageRoot
26
- } from "./chunk-NGROSFOH.js";
26
+ } from "./chunk-Z66IT5KL.js";
27
27
  import "./chunk-LPUQPDC2.js";
28
28
  import {
29
29
  UPDATE_STAMP_FILENAME
@@ -100,4 +100,4 @@ async function run(args) {
100
100
  export {
101
101
  run
102
102
  };
103
- //# sourceMappingURL=update-3NBQTG32.js.map
103
+ //# sourceMappingURL=update-ZSHVXWSQ.js.map
@@ -9,18 +9,18 @@ import {
9
9
  import {
10
10
  normalizeHookInput,
11
11
  readStdin
12
- } from "./chunk-5ZG4RMUH.js";
12
+ } from "./chunk-N2DGFACQ.js";
13
13
  import "./chunk-ZXZPJJN3.js";
14
14
  import {
15
15
  resolveVaultDir
16
- } from "./chunk-CUDIZJY7.js";
16
+ } from "./chunk-TSM6VESW.js";
17
17
  import {
18
18
  DaemonClient
19
- } from "./chunk-P66DLD6G.js";
20
- import "./chunk-BUTL6IFS.js";
19
+ } from "./chunk-KTTSXYEK.js";
20
+ import "./chunk-ENZR5NG7.js";
21
21
  import {
22
22
  loadManifests
23
- } from "./chunk-NGROSFOH.js";
23
+ } from "./chunk-Z66IT5KL.js";
24
24
  import "./chunk-LPUQPDC2.js";
25
25
  import "./chunk-6C6QZ4PM.js";
26
26
  import "./chunk-UUHLLQXO.js";
@@ -88,4 +88,4 @@ ${sessionLine}` : sessionLine;
88
88
  export {
89
89
  main
90
90
  };
91
- //# sourceMappingURL=user-prompt-submit-ME2TBKOS.js.map
91
+ //# sourceMappingURL=user-prompt-submit-APMO6FVU.js.map
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
2
  import {
3
3
  getPluginVersion
4
- } from "./chunk-BUTL6IFS.js";
4
+ } from "./chunk-ENZR5NG7.js";
5
5
  import "./chunk-LPUQPDC2.js";
6
6
  import "./chunk-PZUWP5VK.js";
7
7
  export {
8
8
  getPluginVersion
9
9
  };
10
- //# sourceMappingURL=version-GQAFBBPX.js.map
10
+ //# sourceMappingURL=version-TXPPS3L5.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goondocks/myco",
3
- "version": "0.21.0",
3
+ "version": "0.21.1",
4
4
  "description": "Collective agent intelligence — Claude Code plugin",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: myco-rules
3
+ description: >-
4
+ Keep AGENTS.md minimal, durable, and canonical across agents. Use for
5
+ adding, trimming, or auditing project rules without turning the rules file
6
+ into a dump of dynamic context.
7
+ allowed-tools: Read, Edit, Write, Grep, Glob
8
+ user-invocable: true
9
+ ---
10
+
11
+ # Myco Rules — Minimal Durable Rules
12
+
13
+ Use this skill to keep `AGENTS.md` sharp, durable, and lightweight.
14
+
15
+ Do not duplicate changing project context in static rules files. Keep the rules surface small and stable.
16
+
17
+ ## Goals
18
+
19
+ - Keep `AGENTS.md` as the canonical rules file
20
+ - Keep agent-specific files as thin stubs that point back to `AGENTS.md`
21
+ - Add only rules that are durable enough to survive normal project change
22
+ - Remove vague, stale, duplicated, or over-detailed guidance
23
+
24
+ ## What Belongs in `AGENTS.md`
25
+
26
+ - Project identity and scope
27
+ - Non-goals and hard boundaries
28
+ - A small number of architecture invariants
29
+ - Quality gates and required verification commands
30
+ - Brief working-style guidance that is stable across branches
31
+
32
+ ## What Does Not Belong
33
+
34
+ - Detailed golden paths that drift with the codebase
35
+ - Current initiative notes, migration steps, or branch-specific instructions
36
+ - Long architecture tours or other context better delivered dynamically
37
+ - Decision rationale or recent history that belongs in project memory, not the rules file
38
+ - Workflow history or state better preserved by version control, issue trackers, or project memory
39
+ - Generic filler such as "follow best practices" or "keep things clean"
40
+
41
+ ## Placement Rules
42
+
43
+ - Default to editing `AGENTS.md`
44
+ - Treat `CLAUDE.md`, `GEMINI.md`, and `.github/copilot-instructions.md` as thin stubs unless the developer explicitly wants agent-specific behavior there
45
+ - If a project has important generic rules in `CLAUDE.md` but not `AGENTS.md`, suggest migrating them into `AGENTS.md`
46
+
47
+ ## Audit Checklist
48
+
49
+ When reviewing a rules file, look for:
50
+
51
+ - Vague language: "best practices", "when possible", "try to", "keep it clean"
52
+ - Stale anchors: files, commands, or paths that no longer exist
53
+ - Bloat: repeated guidance better delivered as dynamic context
54
+ - Duplication: the same rule spread across `AGENTS.md` and agent-specific stubs
55
+ - Missing hard boundaries: no non-goals, no quality gate, no canonical source of truth
56
+
57
+ Prefer deleting stale or weak rules over replacing them with more prose.
58
+
59
+ ## Choosing Rule Candidates
60
+
61
+ Promote only guidance that deserves to live in `AGENTS.md` for a long time.
62
+
63
+ Good candidates:
64
+
65
+ - Repeated gotchas with the same root cause
66
+ - Repeated bug fixes caused by violating an unwritten invariant
67
+ - Explicit decisions that imply a stable always/never rule
68
+
69
+ Do not promote:
70
+
71
+ - One-off issues
72
+ - Recent feature work that may still change
73
+ - Context that is already better delivered dynamically during the session
74
+
75
+ ## Editing Workflow
76
+
77
+ 1. Discover `AGENTS.md` and any agent-specific instruction files.
78
+ 2. Treat `AGENTS.md` as canonical by default.
79
+ 3. Identify rules to remove, simplify, or add.
80
+ 4. Propose the minimal diff that improves clarity.
81
+ 5. Apply approved edits.
82
+
83
+ ## Rule Writing Standard
84
+
85
+ - Be specific enough to violate
86
+ - Prefer direct language: `MUST`, `MUST NOT`, `SHOULD`
87
+ - Anchor claims to real files or commands when needed
88
+ - Keep the file short enough that an agent will actually read it
89
+ - Treat code comments with the same discipline: keep them brief, durable, and focused on helping someone understand non-obvious code
90
+
91
+ ## References
92
+
93
+ - `references/rules-good-example.md`
94
+ - `references/rules-bad-example.md`
@@ -1,6 +1,6 @@
1
1
  # Rules File — Bad Example
2
2
 
3
- This is an example of a poorly written CLAUDE.md. Every section contains anti-patterns that cause agents to freestyle, skip rules, or misinterpret intent. Each problem is annotated below.
3
+ This is an example of a poorly written `AGENTS.md`. Every section contains anti-patterns that cause agents to freestyle, skip rules, or misinterpret intent. Each problem is annotated below.
4
4
 
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Rules File — Good Example
2
2
 
3
- This is an example of a well-structured, enforceable CLAUDE.md. Use it as a reference when auditing or writing rules files.
3
+ This is an example of a well-structured, enforceable `AGENTS.md`. Use it as a reference when auditing or writing rules files.
4
4
 
5
5
  ---
6
6
 
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/error-message.ts","../src/agent/executor-state.ts","../src/agent/context-windows.ts","../src/agent/provider-runtime.ts","../src/agent/run-accounting.ts"],"sourcesContent":["/**\n * Extract a human-readable error message from an unknown thrown value.\n *\n * Handles Error instances, strings, and arbitrary objects. Never throws.\n */\nexport function errorMessage(err: unknown): string {\n if (err instanceof Error) return err.message || err.constructor.name || 'Error';\n if (typeof err === 'string') return err || 'Empty string error';\n try { return JSON.stringify(err); } catch { return 'Unserializable error'; }\n}\n","import { errorMessage as toErrorMessage } from '@myco/utils/error-message.js';\nimport type { CostResolution, CostSource } from './cost/types.js';\nimport type {\n EffectiveConfig,\n PhaseResult,\n ProviderConfig,\n ProviderType,\n RuntimeId,\n RuntimeTokenBudget,\n RuntimeUsage,\n} from './types.js';\n\n/** Error patterns that indicate an SDK/runtime session could not be resumed. */\nconst SESSION_RESUME_ERROR_PATTERNS = [\n /session/,\n /resume/,\n /previous[_ ]response/,\n /conversation/,\n];\n\nexport interface PhaseCheckpoint {\n name: string;\n status: 'pending' | 'running' | 'completed' | 'failed';\n summary?: string;\n turnsUsed?: number;\n tokensUsed?: number;\n costUsd?: number;\n costSource?: CostSource;\n costData?: CostResolution;\n sessionRef?: string;\n sessionData?: unknown;\n usage?: RuntimeUsage;\n updatedAt: number;\n}\n\nexport interface RunCheckpointState {\n runtime: RuntimeId;\n provider?: ProviderType;\n providerConfig?: ProviderConfig;\n model?: string;\n sessionRef?: string;\n sessionData?: unknown;\n phases: Record<string, PhaseCheckpoint>;\n}\n\nexport function abortReasonMessage(abortController?: AbortController): string | null {\n if (!abortController?.signal.aborted) return null;\n const reason = abortController.signal.reason;\n if (reason instanceof Error) return reason.message;\n if (typeof reason === 'string' && reason.length > 0) return reason;\n return 'Agent run aborted';\n}\n\nexport function isSessionResumeFailure(error: unknown): boolean {\n const message = toErrorMessage(error).toLowerCase();\n return SESSION_RESUME_ERROR_PATTERNS.some((pattern) => pattern.test(message));\n}\n\nexport function parseCheckpointState(raw: string | null | undefined): RunCheckpointState {\n if (!raw) {\n return { runtime: 'claude-sdk', phases: {} };\n }\n try {\n const parsed = JSON.parse(raw) as Partial<RunCheckpointState>;\n return {\n runtime: parsed.runtime ?? 'claude-sdk',\n provider: parsed.provider,\n providerConfig: parsed.providerConfig,\n model: parsed.model,\n sessionRef: parsed.sessionRef,\n sessionData: parsed.sessionData,\n phases: parsed.phases ?? {},\n };\n } catch {\n return { runtime: 'claude-sdk', phases: {} };\n }\n}\n\nexport function checkpointResultsForResume(\n config: EffectiveConfig,\n checkpointState: RunCheckpointState,\n): PhaseResult[] {\n if (!config.phases) return [];\n const order = new Map(config.phases.map((phase, index) => [phase.name, index]));\n return Object.values(checkpointState.phases)\n .filter((phase) => phase.status === 'completed')\n .sort((a, b) => (order.get(a.name) ?? 0) - (order.get(b.name) ?? 0))\n .map((phase) => buildPhaseResult({\n name: phase.name,\n status: 'completed',\n summary: phase.summary ?? '',\n turnsUsed: phase.turnsUsed,\n tokensUsed: phase.tokensUsed,\n costUsd: phase.costUsd,\n costSource: phase.costSource,\n costData: phase.costData,\n usage: phase.usage,\n sessionRef: phase.sessionRef,\n }));\n}\n\n/**\n * Construct a `PhaseResult` from whatever telemetry is available.\n *\n * Three callers hit this: (1) executePhase's success path has a full\n * `RuntimeUsage` + `CostResolution`; (2) executePhase's failure path has\n * partial telemetry attached to a `RuntimeExecutionError`; (3)\n * `checkpointResultsForResume` has pre-computed scalar fields from a\n * persisted checkpoint. Each caller passes what it has — the helper\n * derives `turnsUsed`/`tokensUsed`/`costUsd` from `usage` + `costData`\n * when available, and falls back to the direct scalar fields when not.\n */\nexport function buildPhaseResult(input: {\n name: string;\n status: PhaseResult['status'];\n summary: string;\n usage?: RuntimeUsage;\n costData?: CostResolution;\n turnsUsed?: number;\n tokensUsed?: number;\n costUsd?: number;\n costSource?: CostSource;\n sessionRef?: string;\n sessionData?: unknown;\n}): PhaseResult & { sessionData?: unknown } {\n const {\n name, status, summary, usage, costData,\n turnsUsed, tokensUsed, costUsd, costSource,\n sessionRef, sessionData,\n } = input;\n return {\n name,\n status,\n turnsUsed: turnsUsed ?? usage?.requests ?? 0,\n tokensUsed: tokensUsed ?? usage?.totalTokens ?? 0,\n costUsd: costUsd ?? costData?.costUsd ?? 0,\n ...(costData ? { costSource: costData.source, costData } : costSource ? { costSource } : {}),\n ...(usage ? { usage } : {}),\n ...(sessionRef ? { sessionRef } : {}),\n ...(sessionData !== undefined ? { sessionData } : {}),\n summary,\n };\n}\n\nexport function serializeCheckpointState(state: RunCheckpointState): string {\n return JSON.stringify(state);\n}\n\nexport function aggregateUsage(usages: Array<RuntimeUsage | undefined>): RuntimeUsage {\n const aggregate: RuntimeUsage = {\n requests: 0,\n inputTokens: 0,\n outputTokens: 0,\n totalTokens: 0,\n reasoningTokens: 0,\n cachedTokens: 0,\n durationMs: 0,\n };\n let sawCost = false;\n\n for (const usage of usages) {\n if (!usage) continue;\n aggregate.requests = (aggregate.requests ?? 0) + (usage.requests ?? 0);\n aggregate.inputTokens = (aggregate.inputTokens ?? 0) + (usage.inputTokens ?? 0);\n aggregate.outputTokens = (aggregate.outputTokens ?? 0) + (usage.outputTokens ?? 0);\n aggregate.totalTokens = (aggregate.totalTokens ?? 0) + (usage.totalTokens ?? 0);\n aggregate.reasoningTokens = (aggregate.reasoningTokens ?? 0) + (usage.reasoningTokens ?? 0);\n aggregate.cachedTokens = (aggregate.cachedTokens ?? 0) + (usage.cachedTokens ?? 0);\n aggregate.durationMs = (aggregate.durationMs ?? 0) + (usage.durationMs ?? 0);\n if (usage.costUsd !== undefined && usage.costUsd !== null) {\n aggregate.costUsd = (aggregate.costUsd ?? 0) + usage.costUsd;\n sawCost = true;\n }\n }\n\n if (!sawCost) {\n delete aggregate.costUsd;\n }\n\n return aggregate;\n}\n\nexport function buildUsageData(\n runUsage: RuntimeUsage,\n runCost?: CostResolution,\n phaseResults?: PhaseResult[],\n runBudget?: RuntimeTokenBudget,\n): string {\n return JSON.stringify({\n run: runUsage,\n runCost: runCost ?? null,\n runBudget: runBudget ?? null,\n phases: phaseResults?.map((phase) => ({\n name: phase.name,\n usage: phase.usage ?? null,\n turnsUsed: phase.turnsUsed,\n tokensUsed: phase.tokensUsed,\n costUsd: phase.costUsd,\n costSource: phase.costSource ?? null,\n costData: phase.costData ?? null,\n })) ?? [],\n });\n}\n\nexport function buildActionsTaken(\n runtime: RuntimeId,\n provider: ProviderConfig | undefined,\n model: string,\n phaseResults?: PhaseResult[],\n): string {\n return JSON.stringify({\n runtime,\n model,\n provider: provider?.type ?? 'anthropic',\n ...(provider?.baseUrl ? { baseUrl: provider.baseUrl } : {}),\n ...(phaseResults ? { phases: phaseResults } : {}),\n });\n}\n\nexport function resolveProviderForResume(\n currentProvider: ProviderConfig | undefined,\n resumedRun: {\n provider: ProviderType | null;\n } | null,\n checkpointState: RunCheckpointState,\n runtime: RuntimeId,\n model: string,\n): ProviderConfig | undefined {\n const persistedType = resumedRun?.provider ?? checkpointState.provider;\n const persistedProvider = checkpointState.providerConfig;\n if (!persistedType && !persistedProvider) return currentProvider;\n const matchingCurrentProvider = currentProvider?.type === persistedType ? currentProvider : undefined;\n\n return {\n ...(persistedProvider ?? {}),\n ...(matchingCurrentProvider ?? {}),\n runtime,\n type: persistedType ?? persistedProvider?.type ?? currentProvider?.type ?? 'anthropic',\n model,\n };\n}\n","/** Default context window Myco applies for local agent runs when no override is set. */\nexport const DEFAULT_LOCAL_AGENT_CONTEXT_WINDOW_TOKENS = 32_768;\n\n/** Inferred frontier-model context window when the provider does not expose one. */\nexport const DEFAULT_FRONTIER_CONTEXT_WINDOW_TOKENS = 200_000;\n\n/** Inferred OpenAI-compatible cloud context window when the provider does not expose one. */\nexport const DEFAULT_COMPATIBLE_CONTEXT_WINDOW_TOKENS = 128_000;\n","import type { ProviderType, RuntimeId } from './types.js';\nimport {\n DEFAULT_COMPATIBLE_CONTEXT_WINDOW_TOKENS,\n DEFAULT_FRONTIER_CONTEXT_WINDOW_TOKENS,\n DEFAULT_LOCAL_AGENT_CONTEXT_WINDOW_TOKENS,\n} from './context-windows.js';\n\ninterface ProviderMetadata {\n runtime: RuntimeId;\n defaultContextWindowTokens?: number;\n}\n\nconst PROVIDER_METADATA_BY_TYPE: Record<ProviderType, ProviderMetadata> = {\n anthropic: {\n runtime: 'claude-sdk',\n defaultContextWindowTokens: DEFAULT_FRONTIER_CONTEXT_WINDOW_TOKENS,\n },\n ollama: {\n runtime: 'claude-sdk',\n defaultContextWindowTokens: DEFAULT_LOCAL_AGENT_CONTEXT_WINDOW_TOKENS,\n },\n lmstudio: {\n runtime: 'claude-sdk',\n defaultContextWindowTokens: DEFAULT_LOCAL_AGENT_CONTEXT_WINDOW_TOKENS,\n },\n openai: {\n runtime: 'openai-agents',\n defaultContextWindowTokens: DEFAULT_FRONTIER_CONTEXT_WINDOW_TOKENS,\n },\n openrouter: {\n runtime: 'openai-agents',\n defaultContextWindowTokens: DEFAULT_FRONTIER_CONTEXT_WINDOW_TOKENS,\n },\n 'openai-compatible': {\n runtime: 'openai-agents',\n defaultContextWindowTokens: DEFAULT_COMPATIBLE_CONTEXT_WINDOW_TOKENS,\n },\n};\n\nexport function getProviderMetadata(providerType: ProviderType | undefined): ProviderMetadata | undefined {\n if (!providerType) return undefined;\n return PROVIDER_METADATA_BY_TYPE[providerType];\n}\n\nexport function inferRuntimeFromProviderType(providerType: ProviderType | undefined): RuntimeId | undefined {\n return getProviderMetadata(providerType)?.runtime;\n}\n\nexport function inferDefaultContextWindowFromProviderType(providerType: ProviderType | undefined): number | null {\n return getProviderMetadata(providerType)?.defaultContextWindowTokens ?? null;\n}\n","import type { RunUpdate } from '@myco/db/queries/runs.js';\nimport type { CostResolution } from './cost/types.js';\nimport {\n buildActionsTaken,\n buildUsageData,\n serializeCheckpointState,\n type RunCheckpointState,\n} from './executor-state.js';\nimport { inferDefaultContextWindowFromProviderType } from './provider-runtime.js';\nimport type { PhaseResult, ProviderConfig, RuntimeId, RuntimeTokenBudget, RuntimeUsage } from './types.js';\n\nconst TOKEN_BUDGET_WARNING_PERCENT = 75;\nconst TOKEN_BUDGET_CRITICAL_PERCENT = 90;\n\n/**\n * Compute the elapsed duration of a run in milliseconds. Returns `null`\n * unless both timestamps are populated. Started/completed timestamps on\n * `agent_runs` are stored in seconds; this helper converts to ms for UI\n * consumers that expect millisecond precision.\n */\nexport function runDurationMs(run: {\n started_at: number | null;\n completed_at: number | null;\n}): number | null {\n if (run.started_at === null || run.completed_at === null) return null;\n return (run.completed_at - run.started_at) * 1000;\n}\n\nfunction toRequestTokenNumber(\n entry: Record<string, unknown>,\n key: 'inputTokens' | 'outputTokens' | 'totalTokens',\n): number {\n const value = entry[key];\n return typeof value === 'number' ? value : 0;\n}\n\nfunction resolveContextWindow(\n provider: ProviderConfig | undefined,\n usage: RuntimeUsage,\n): { tokens: number | null; source?: RuntimeTokenBudget['contextWindowSource'] } {\n if (provider?.contextLength) {\n return { tokens: provider.contextLength, source: 'provider-config' };\n }\n const providerData = usage.providerData;\n if (providerData) {\n const candidates = [\n providerData.contextWindowTokens,\n providerData.context_window,\n providerData.maxContextTokens,\n providerData.max_context_tokens,\n ];\n for (const candidate of candidates) {\n if (typeof candidate === 'number' && candidate > 0) {\n return { tokens: candidate, source: 'provider-metadata' };\n }\n }\n }\n const providerDefault = inferDefaultContextWindowFromProviderType(provider?.type);\n if (providerDefault) {\n return { tokens: providerDefault, source: 'provider-default' };\n }\n return { tokens: null };\n}\n\nexport function analyzeRuntimeTokenBudget(\n usage: RuntimeUsage,\n provider?: ProviderConfig,\n): RuntimeTokenBudget {\n const requestEntries = usage.requestUsageEntries && usage.requestUsageEntries.length > 0\n ? usage.requestUsageEntries\n : [{\n inputTokens: usage.inputTokens ?? 0,\n outputTokens: usage.outputTokens ?? 0,\n totalTokens: usage.totalTokens ?? (\n (usage.inputTokens ?? 0) + (usage.outputTokens ?? 0)\n ),\n }];\n let peakRequestInputTokens = 0;\n let peakRequestOutputTokens = 0;\n let peakRequestTotalTokens = 0;\n for (const entry of requestEntries) {\n const input = toRequestTokenNumber(entry, 'inputTokens');\n const output = toRequestTokenNumber(entry, 'outputTokens');\n const total = toRequestTokenNumber(entry, 'totalTokens');\n if (input > peakRequestInputTokens) peakRequestInputTokens = input;\n if (output > peakRequestOutputTokens) peakRequestOutputTokens = output;\n if (total > peakRequestTotalTokens) peakRequestTotalTokens = total;\n }\n const { tokens: contextWindowTokens, source: contextWindowSource } = resolveContextWindow(provider, usage);\n\n if (!contextWindowTokens) {\n return {\n contextWindowTokens: null,\n peakRequestInputTokens: peakRequestInputTokens || null,\n peakRequestOutputTokens: peakRequestOutputTokens || null,\n peakRequestTotalTokens: peakRequestTotalTokens || null,\n utilizationPercent: null,\n headroomTokens: null,\n status: 'unknown',\n message: 'Context window unavailable for this provider/model.',\n };\n }\n\n const utilizationPercent = peakRequestTotalTokens > 0\n ? Math.round((peakRequestTotalTokens / contextWindowTokens) * 100)\n : 0;\n const headroomTokens = Math.max(0, contextWindowTokens - peakRequestTotalTokens);\n const status = utilizationPercent >= TOKEN_BUDGET_CRITICAL_PERCENT\n ? 'post_run_pressure'\n : utilizationPercent >= TOKEN_BUDGET_WARNING_PERCENT\n ? 'warning'\n : 'ok';\n const statusMessage = status === 'post_run_pressure'\n ? 'Run operated near the model context limit.'\n : status === 'warning'\n ? 'Run used a large share of the model context window.'\n : undefined;\n const isInferredWindow = contextWindowSource === 'provider-default';\n const message = isInferredWindow\n ? (statusMessage\n ? `${statusMessage} Using inferred provider default context window.`\n : 'Using inferred provider default context window.')\n : statusMessage;\n\n return {\n contextWindowTokens,\n ...(contextWindowSource ? { contextWindowSource } : {}),\n peakRequestInputTokens: peakRequestInputTokens || null,\n peakRequestOutputTokens: peakRequestOutputTokens || null,\n peakRequestTotalTokens: peakRequestTotalTokens || null,\n utilizationPercent,\n headroomTokens,\n status,\n ...(message ? { message } : {}),\n };\n}\n\nexport function serializeCostData(cost: CostResolution | undefined): string | null {\n return cost ? JSON.stringify(cost) : null;\n}\n\nexport function summarizePhaseCosts(phaseResults: PhaseResult[]): CostResolution {\n const costedPhases = phaseResults.filter(\n (phase): phase is PhaseResult & { costData: CostResolution } =>\n phase.costData !== undefined && phase.costData !== null && phase.costData.costUsd !== null,\n );\n if (costedPhases.length === 0) {\n return {\n source: 'unavailable',\n costUsd: null,\n actualCostUsd: null,\n estimatedCostUsd: null,\n breakdown: {\n inputTokens: 0,\n cachedInputTokens: 0,\n uncachedInputTokens: 0,\n outputTokens: 0,\n reasoningTokens: 0,\n requestCount: 0,\n },\n pricingVersion: null,\n message: 'No phase cost data available',\n };\n }\n\n const firstCost = costedPhases[0].costData;\n const aggregate = {\n costUsd: 0,\n actualCostUsd: 0,\n estimatedCostUsd: 0,\n breakdown: {\n inputTokens: 0,\n cachedInputTokens: 0,\n uncachedInputTokens: 0,\n outputTokens: 0,\n reasoningTokens: 0,\n requestCount: 0,\n inputCostUsd: 0,\n cachedInputCostUsd: 0,\n outputCostUsd: 0,\n reasoningCostUsd: 0,\n requestCostUsd: 0,\n cacheSavingsUsd: 0,\n totalCostUsd: 0,\n },\n };\n\n for (const phase of costedPhases) {\n const cost = phase.costData;\n const breakdown = cost.breakdown;\n aggregate.costUsd += cost.costUsd ?? 0;\n aggregate.actualCostUsd += cost.actualCostUsd ?? 0;\n aggregate.estimatedCostUsd += cost.estimatedCostUsd ?? 0;\n aggregate.breakdown.inputTokens += breakdown.inputTokens;\n aggregate.breakdown.cachedInputTokens += breakdown.cachedInputTokens;\n aggregate.breakdown.uncachedInputTokens += breakdown.uncachedInputTokens;\n aggregate.breakdown.outputTokens += breakdown.outputTokens;\n aggregate.breakdown.reasoningTokens += breakdown.reasoningTokens;\n aggregate.breakdown.requestCount += breakdown.requestCount;\n aggregate.breakdown.inputCostUsd += breakdown.inputCostUsd ?? 0;\n aggregate.breakdown.cachedInputCostUsd += breakdown.cachedInputCostUsd ?? 0;\n aggregate.breakdown.outputCostUsd += breakdown.outputCostUsd ?? 0;\n aggregate.breakdown.reasoningCostUsd += breakdown.reasoningCostUsd ?? 0;\n aggregate.breakdown.requestCostUsd += breakdown.requestCostUsd ?? 0;\n aggregate.breakdown.cacheSavingsUsd += breakdown.cacheSavingsUsd ?? 0;\n }\n aggregate.breakdown.totalCostUsd = aggregate.costUsd;\n\n const allActual = phaseResults.every((phase) => phase.costData?.source === 'actual');\n const hasUnavailable = phaseResults.some((phase) => phase.costData?.source === 'unavailable');\n return {\n source: allActual ? 'actual' : 'estimated',\n costUsd: aggregate.costUsd,\n actualCostUsd: allActual ? aggregate.actualCostUsd : null,\n estimatedCostUsd: allActual ? null : aggregate.costUsd,\n breakdown: aggregate.breakdown,\n pricingVersion: costedPhases.every((phase) => phase.costData?.pricingVersion === firstCost.pricingVersion)\n ? firstCost.pricingVersion ?? null\n : null,\n ...(hasUnavailable ? { message: 'Some phase costs were unavailable; total reflects known phase costs only' } : {}),\n };\n}\n\ninterface RunAccountingUpdateInput {\n runtime: RuntimeId;\n provider?: ProviderConfig;\n model: string;\n checkpointState: RunCheckpointState;\n usage: RuntimeUsage;\n costData: CostResolution;\n phaseResults?: PhaseResult[];\n sessionRef?: string | null;\n}\n\ninterface RunAccountingUpdateFields extends Pick<\n RunUpdate,\n | 'runtime'\n | 'provider'\n | 'model'\n | 'session_ref'\n | 'checkpoints'\n | 'usage_data'\n | 'cost_usd'\n | 'actual_cost_usd'\n | 'estimated_cost_usd'\n | 'cost_source'\n | 'cost_data'\n> {\n actions_taken: string;\n}\n\nexport function buildRunAccountingUpdate(input: RunAccountingUpdateInput): RunAccountingUpdateFields {\n const tokenBudget = analyzeRuntimeTokenBudget(input.usage, input.provider);\n return {\n runtime: input.runtime,\n provider: input.provider?.type ?? null,\n model: input.model,\n session_ref: input.sessionRef ?? input.checkpointState.sessionRef ?? null,\n checkpoints: serializeCheckpointState(input.checkpointState),\n usage_data: buildUsageData(input.usage, input.costData, input.phaseResults, tokenBudget),\n cost_usd: input.costData.costUsd ?? null,\n actual_cost_usd: input.costData.actualCostUsd,\n estimated_cost_usd: input.costData.estimatedCostUsd,\n cost_source: input.costData.source,\n cost_data: serializeCostData(input.costData),\n actions_taken: buildActionsTaken(input.runtime, input.provider, input.model, input.phaseResults),\n };\n}\n"],"mappings":";;;AAKO,SAAS,aAAa,KAAsB;AACjD,MAAI,eAAe,MAAO,QAAO,IAAI,WAAW,IAAI,YAAY,QAAQ;AACxE,MAAI,OAAO,QAAQ,SAAU,QAAO,OAAO;AAC3C,MAAI;AAAE,WAAO,KAAK,UAAU,GAAG;AAA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