sliccy 6.80.1 → 6.82.0

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 (82) hide show
  1. package/README.md +1 -1
  2. package/dist/ui/.vite/manifest.json +128 -128
  3. package/dist/ui/assets/{account-store-5SFKxhvW.js → account-store-C8KOXduU.js} +1 -1
  4. package/dist/ui/assets/{account-store-DC2iZ0ac.js → account-store-m32kHS8B.js} +1 -1
  5. package/dist/ui/assets/{adobe-B_bzS3_d.js → adobe-BaaEkvjt.js} +1 -1
  6. package/dist/ui/assets/{adobe-De0QbyB3.js → adobe-CXHNbcRO.js} +1 -1
  7. package/dist/ui/assets/{apply-layout-Ce4b_F7N.js → apply-layout-BeEg4b7P.js} +1 -1
  8. package/dist/ui/assets/{apps-CibOoUWb.js → apps-gkNWlat2.js} +1 -1
  9. package/dist/ui/assets/{azure-openai-CffFXHwl.js → azure-openai-BygXnOa1.js} +1 -1
  10. package/dist/ui/assets/{azure-openai-B-G2MZ_t.js → azure-openai-Cz7Klb5t.js} +1 -1
  11. package/dist/ui/assets/{cerebras-BsljGjBO.js → cerebras-CDKwhJI7.js} +1 -1
  12. package/dist/ui/assets/{cerebras-BDKLpbQJ.js → cerebras-DwL2vvJs.js} +1 -1
  13. package/dist/ui/assets/{connect-surface-DsdJVEUG.js → connect-surface-rwNbSGDM.js} +1 -1
  14. package/dist/ui/assets/{fs-CiP09Kup.js → fs-BUaP-MrG.js} +2 -2
  15. package/dist/ui/assets/{fs-CdmMpR3c.js → fs-DxiChUtF.js} +1 -1
  16. package/dist/ui/assets/{github-Cr2HUpaq.js → github-CGBai_Gf.js} +2 -2
  17. package/dist/ui/assets/{github-CyzhXaRO.js → github-DcD7nDMH.js} +1 -1
  18. package/dist/ui/assets/{github-copilot-B6_40aQ8.js → github-copilot-CI_1pSHB.js} +1 -1
  19. package/dist/ui/assets/{github-copilot-fVIGfd_Y.js → github-copilot-CmG62TJL.js} +1 -1
  20. package/dist/ui/assets/{github-install-DTSPyhDm.js → github-install-BOjCifUB.js} +1 -1
  21. package/dist/ui/assets/{github-zip-eNBC5Yx_.js → github-zip-CRrpP6te.js} +1 -1
  22. package/dist/ui/assets/{js-realm-worker-CWE82gbj.js → js-realm-worker-DUfmY_Iy.js} +1 -1
  23. package/dist/ui/assets/{kernel-worker-4RFuciaX.js → kernel-worker-SyM4a819.js} +634 -633
  24. package/dist/ui/assets/{local-llm-DCFGRDjL.js → local-llm-cBqUBlOH.js} +1 -1
  25. package/dist/ui/assets/{local-llm-DHKGaXiq.js → local-llm-xQvKM_Uh.js} +1 -1
  26. package/dist/ui/assets/{main-B-Dx8oRt.js → main-DoycVdgy.js} +3 -3
  27. package/dist/ui/assets/{mount-BqMHpKtx.js → mount-CYUypzuB.js} +2 -2
  28. package/dist/ui/assets/{mount-BJ7M2SYz.js → mount-CwbIwQ94.js} +1 -1
  29. package/dist/ui/assets/{mount-recovery-DyLhiQ_q.js → mount-recovery-HY6iQCUm.js} +1 -1
  30. package/dist/ui/assets/{new-session-Cd_k-DSJ.js → new-session--6u554iS.js} +2 -2
  31. package/dist/ui/assets/{oauth-bootstrap-BSJGXC5i.js → oauth-bootstrap-CihpARsA.js} +2 -2
  32. package/dist/ui/assets/{onboarding-orchestrator-Cobbbzux.js → onboarding-orchestrator-Do5uYmyg.js} +1 -1
  33. package/dist/ui/assets/{openai-codex-1Ex-CmgQ.js → openai-codex-QrGQU5TP.js} +1 -1
  34. package/dist/ui/assets/{openai-codex-Bp-ZqAMG.js → openai-codex-nRXOsaw1.js} +1 -1
  35. package/dist/ui/assets/{openrouter-awa5FOHF.js → openrouter-CORuhvSC.js} +1 -1
  36. package/dist/ui/assets/{openrouter-3C6IFihS.js → openrouter-CyiXDBWN.js} +1 -1
  37. package/dist/ui/assets/{openrouter-oauth-CXQXmJBM.js → openrouter-oauth-CF90J_tn.js} +1 -1
  38. package/dist/ui/assets/{openrouter-oauth-Cu3YyU2Q.js → openrouter-oauth-ycQNF-gS.js} +1 -1
  39. package/dist/ui/assets/{panel-rpc-handlers-Dqyty3YK.js → panel-rpc-handlers-BOP7jU8U.js} +2 -2
  40. package/dist/ui/assets/{provider-DNp78cMA.js → provider--nVd6O4D.js} +1 -1
  41. package/dist/ui/assets/{provider-KuHT0pij.js → provider-Dl7S0Qei.js} +2 -2
  42. package/dist/ui/assets/{provider-settings-DRYz7gQ-.js → provider-settings-D47RycU7.js} +1 -1
  43. package/dist/ui/assets/{provider-settings-CJE9u8a7.js → provider-settings-klhyvple.js} +1 -1
  44. package/dist/ui/assets/provider-store-access-BCv4JpWU.js +1 -0
  45. package/dist/ui/assets/{provider-store-access-BxMC4qMf.js → provider-store-access-CvNJ2ri1.js} +2 -2
  46. package/dist/ui/assets/{providers-C-U6H8FP.js → providers-BPKW51CE.js} +1 -1
  47. package/dist/ui/assets/{providers-CupV88p_.js → providers-BlKC-KJo.js} +2 -2
  48. package/dist/ui/assets/{quick-llm-C8XbkYyA.js → quick-llm-CgDSj0W6.js} +1 -1
  49. package/dist/ui/assets/record-QvM9I_bh.js +1 -0
  50. package/dist/ui/assets/{recovery-screen-Cqld9j9L.js → recovery-screen-zGyjQFU9.js} +1 -1
  51. package/dist/ui/assets/{redirect-uri-C0evqpRE.js → redirect-uri-fwVh39Uk.js} +1 -1
  52. package/dist/ui/assets/session-freezer-CfKmr-th.js +160 -0
  53. package/dist/ui/assets/{setup-feature-flags-remote-DqW0fX9b.js → setup-feature-flags-remote-DCwot2tn.js} +1 -1
  54. package/dist/ui/assets/{setup-standalone-prelude-51g10DFK.js → setup-standalone-prelude-Dpu4rjGg.js} +1 -1
  55. package/dist/ui/assets/{setup-sudo-C9GBILbj.js → setup-sudo-BwZD3_1T.js} +2 -2
  56. package/dist/ui/assets/{skills-CiXo4YBM.js → skills-Bgsqxf94.js} +1 -1
  57. package/dist/ui/assets/slicc-version-DOiAgHwH.js +1 -0
  58. package/dist/ui/assets/{store-CGweiMa0.js → store-CGRs1TJT.js} +1 -1
  59. package/dist/ui/assets/{store-DR0b0bYW.js → store-CNmYj3tr.js} +1 -1
  60. package/dist/ui/assets/{sudo-CU0Wxy6o.js → sudo-Bnr_I0xk.js} +1 -1
  61. package/dist/ui/assets/{upgrade-detection-Bm998S-a.js → upgrade-detection-JEDVQeXN.js} +1 -1
  62. package/dist/ui/assets/{wc-extension-BSo-wnX-.js → wc-extension-sMUOOTet.js} +2 -2
  63. package/dist/ui/assets/{wc-follower-DwL_gt-R.js → wc-follower-Dk4JtuiZ.js} +3 -3
  64. package/dist/ui/assets/wc-live-BXomFQ_z.js +8 -0
  65. package/dist/ui/assets/{wc-nav-C8PeiLgl.js → wc-nav-CKGs9urx.js} +2 -2
  66. package/dist/ui/assets/{wc-onboarding-DIUeolfS.js → wc-onboarding-5ueClM9f.js} +2 -2
  67. package/dist/ui/assets/{wc-placeholder-ztYKxD_5.js → wc-placeholder-CkhOKTOQ.js} +2 -2
  68. package/dist/ui/assets/{wc-settings-DaNQ6DWW.js → wc-settings-Cv0DAZT-.js} +2 -2
  69. package/dist/ui/assets/{wc-shell-DUJLsmJN.js → wc-shell-BkuFvEur.js} +2 -2
  70. package/dist/ui/assets/{wc-sprinkles-DOq7Uo2c.js → wc-sprinkles-CaMxMG9z.js} +2 -2
  71. package/dist/ui/assets/{wc-tray-D9MUYNK3.js → wc-tray-DQt1oOUV.js} +2 -2
  72. package/dist/ui/assets/{welcome-detection-Cj3q8TTP.js → welcome-detection-C_XqnX4Z.js} +1 -1
  73. package/dist/ui/assets/{xai-grok-C6gRm-Yz.js → xai-grok-BcmRONGx.js} +1 -1
  74. package/dist/ui/assets/{xai-grok-qjlHu4Y3.js → xai-grok-D7QWIBON.js} +1 -1
  75. package/dist/ui/index.html +6 -6
  76. package/dist/ui/packages/webapp/index.html +6 -6
  77. package/package.json +1 -1
  78. package/dist/ui/assets/provider-store-access-KTmV7DbM.js +0 -1
  79. package/dist/ui/assets/record-BkEi3dzS.js +0 -1
  80. package/dist/ui/assets/session-freezer-DBQdO4j2.js +0 -160
  81. package/dist/ui/assets/slicc-version-CKiDBTM_.js +0 -1
  82. package/dist/ui/assets/wc-live-PLJSFibt.js +0 -8
@@ -1 +1 @@
1
- import{H as e,d as t}from"./account-store-5SFKxhvW.js";import{a as n}from"./diagnostics-DN_idNHx.js";import{d as r,p as i}from"./bedrock-camp-qpZqnqLa.js";import{c as a,i as o,r as s,s as c}from"./legacy-api-aliases-CsTVszvY.js";import"./provider-settings-DRYz7gQ-.js";import{n as l,r as u,t as d}from"./pkce-hGf_TEnP.js";import{XaiErrorCode as f,XaiOAuthError as p}from"./xai-grok-errors-bnlIBeu-.js";var m=`xai-grok`,h=`https://auth.x.ai`,g=`${h}/oauth2/authorize`,_=`${h}/oauth2/token`,v=`b1a00492-073a-47ea-816f-4c329264a828`,y=`openid profile email offline_access grok-cli:access api:access`,b=`http://127.0.0.1:56121/callback`,x=`http://127.0.0.1:56121/*`,S=`https://api.x.ai/v1`,C=`grok-4.5`,w=`${m}-openai`;function T(){return r(`xai`)}function E(e){return{id:e.id,name:e.name,api:`openai`,reasoning:e.reasoning,input:e.input,context_window:e.contextWindow,max_tokens:e.maxTokens,compat:e.compat,thinkingLevelMap:e.thinkingLevelMap}}function D(e){let t=T(),n=t.find(t=>t.id===e.id);if(!n&&(console.warn(`xAI model "${e.id}" is no longer in the pi-ai catalog; falling back to default "${C}"`),n=t.find(e=>e.id===C),!n))throw Error(`xAI default model "${C}" is not registered by pi-ai`);if(n.api!==`openai-responses`&&n.api!==`openai-completions`)throw Error(`Unsupported pi-ai API "${n.api}" for xAI model "${e.id}"`);return{...e,...n,baseUrl:S}}async function O(e,t){let n=new URLSearchParams({grant_type:`authorization_code`,code:e,redirect_uri:b,client_id:v,code_verifier:t}),r=await fetch(_,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:n});if(!r.ok)throw new p(`xAI token exchange failed: ${r.status} ${await r.text()}`,f.TOKEN_EXCHANGE_FAILED);let i=await r.json();if(!i.access_token)throw new p(`xAI token exchange did not return access_token.`,f.TOKEN_EXCHANGE_INVALID);return i}async function k(e){try{let t=new URLSearchParams({grant_type:`refresh_token`,refresh_token:e,client_id:v}),n=await fetch(_,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:t});return n.ok?await n.json():(console.error(`[xai-grok] refresh failed:`,n.status,await n.text()),null)}catch(e){return console.error(`[xai-grok] refresh error:`,e instanceof Error?e.message:String(e)),null}}function A(){return t().find(e=>e.providerId===m)}async function j(){let t=A();if(!t?.accessToken)throw new p("Not signed in to xAI Grok — run /login or `oauth-token xai-grok`",f.AUTH_MISSING,!0);let n=t.tokenExpiresAt??0;if(n&&Date.now()+6e4<n)return t.accessToken;if(t.refreshToken){let n=await k(t.refreshToken);if(n?.access_token)return await e({providerId:m,accessToken:n.access_token,refreshToken:n.refresh_token??t.refreshToken,tokenExpiresAt:Date.now()+(n.expires_in??21600)*1e3,scopes:n.scope??t.scopes}),n.access_token}return t.accessToken}function M(e,t){return{type:`error`,reason:`error`,error:{role:`assistant`,content:[],api:w,provider:m,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`error`,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}}function N(e,t){return t?{...e??{},"x-grok-conv-id":t}:e}var P=(e,t,r={})=>{let i=n();return(async()=>{try{let n=await j(),a=r.sessionId,c=D(e),l={...r,apiKey:n,headers:N(r.headers,a)},u=c.api===`openai-responses`?o(c,t,l):s(c,t,l);for await(let e of u)i.push(e);i.end()}catch(t){console.error(`[xai-grok] Stream error:`,t instanceof Error?t.message:String(t)),i.push(M(e,t)),i.end()}})(),i},F=(e,t,r)=>{let i=n();return(async()=>{try{let n=await j(),o=r?.sessionId,s=D(e),l={...r,apiKey:n,headers:N(r?.headers,o)},u=s.api===`openai-responses`?a(s,t,l):c(s,t,l);for await(let e of u)i.push(e);i.end()}catch(t){console.error(`[xai-grok] Stream error:`,t instanceof Error?t.message:String(t)),i.push(M(e,t)),i.end()}})(),i},I={id:m,name:`xAI Grok (SuperGrok OAuth)`,description:`Grok via xAI OAuth — uses your SuperGrok subscription, no API key needed. Default model is Grok 4.5.`,requiresApiKey:!1,requiresBaseUrl:!1,isOAuth:!0,defaultModelId:C,oauthTokenDomains:[`api.x.ai`,`*.x.ai`,`auth.x.ai`,`accounts.x.ai`],getModelIds:()=>T().map(E),onOAuthLoginIntercepted:async(t,n,r)=>{let i=l(),a=await d(i),o=u(),s=u(),c=new URL(g);c.searchParams.set(`response_type`,`code`),c.searchParams.set(`client_id`,v),c.searchParams.set(`redirect_uri`,b),c.searchParams.set(`scope`,r?.scopes??y),c.searchParams.set(`code_challenge`,a),c.searchParams.set(`code_challenge_method`,`S256`),c.searchParams.set(`state`,o),c.searchParams.set(`nonce`,s),c.searchParams.set(`plan`,`generic`),c.searchParams.set(`referrer`,`slicc`);let h=await t({authorizeUrl:c.toString(),redirectUriPattern:x,onCapture:`close`});if(!h)throw new p(`xAI OAuth login was cancelled or timed out`,f.CALLBACK_TIMEOUT);let _=new URL(h),C=_.searchParams.get(`code`),w=_.searchParams.get(`state`);if(!C)throw new p(`xAI OAuth redirect did not include a code`,f.CODE_MISSING);if(w!==o)throw new p(`xAI OAuth state mismatch — possible CSRF, aborting`,f.STATE_MISMATCH);let T=await O(C,i);await e({providerId:m,accessToken:T.access_token,refreshToken:T.refresh_token,tokenExpiresAt:Date.now()+(T.expires_in??21600)*1e3,baseUrl:S,scopes:T.scope}),n()},onOAuthLogout:async()=>{await e({providerId:m,accessToken:``})},onSilentRenew:async()=>{let t=A();if(!t?.refreshToken)return null;let n=await k(t.refreshToken);return n?.access_token?(await e({providerId:m,accessToken:n.access_token,refreshToken:n.refresh_token??t.refreshToken,tokenExpiresAt:Date.now()+(n.expires_in??21600)*1e3,scopes:n.scope??t.scopes}),n.access_token):null}};function L(){i({api:w,stream:P,streamSimple:F})}export{f as XaiErrorCode,p as XaiOAuthError,I as config,L as register};
1
+ import{H as e,d as t}from"./account-store-C8KOXduU.js";import{a as n}from"./diagnostics-DN_idNHx.js";import{d as r,p as i}from"./bedrock-camp-qpZqnqLa.js";import{c as a,i as o,r as s,s as c}from"./legacy-api-aliases-CsTVszvY.js";import"./provider-settings-D47RycU7.js";import{n as l,r as u,t as d}from"./pkce-hGf_TEnP.js";import{XaiErrorCode as f,XaiOAuthError as p}from"./xai-grok-errors-bnlIBeu-.js";var m=`xai-grok`,h=`https://auth.x.ai`,g=`${h}/oauth2/authorize`,_=`${h}/oauth2/token`,v=`b1a00492-073a-47ea-816f-4c329264a828`,y=`openid profile email offline_access grok-cli:access api:access`,b=`http://127.0.0.1:56121/callback`,x=`http://127.0.0.1:56121/*`,S=`https://api.x.ai/v1`,C=`grok-4.5`,w=`${m}-openai`;function T(){return r(`xai`)}function E(e){return{id:e.id,name:e.name,api:`openai`,reasoning:e.reasoning,input:e.input,context_window:e.contextWindow,max_tokens:e.maxTokens,compat:e.compat,thinkingLevelMap:e.thinkingLevelMap}}function D(e){let t=T(),n=t.find(t=>t.id===e.id);if(!n&&(console.warn(`xAI model "${e.id}" is no longer in the pi-ai catalog; falling back to default "${C}"`),n=t.find(e=>e.id===C),!n))throw Error(`xAI default model "${C}" is not registered by pi-ai`);if(n.api!==`openai-responses`&&n.api!==`openai-completions`)throw Error(`Unsupported pi-ai API "${n.api}" for xAI model "${e.id}"`);return{...e,...n,baseUrl:S}}async function O(e,t){let n=new URLSearchParams({grant_type:`authorization_code`,code:e,redirect_uri:b,client_id:v,code_verifier:t}),r=await fetch(_,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:n});if(!r.ok)throw new p(`xAI token exchange failed: ${r.status} ${await r.text()}`,f.TOKEN_EXCHANGE_FAILED);let i=await r.json();if(!i.access_token)throw new p(`xAI token exchange did not return access_token.`,f.TOKEN_EXCHANGE_INVALID);return i}async function k(e){try{let t=new URLSearchParams({grant_type:`refresh_token`,refresh_token:e,client_id:v}),n=await fetch(_,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:t});return n.ok?await n.json():(console.error(`[xai-grok] refresh failed:`,n.status,await n.text()),null)}catch(e){return console.error(`[xai-grok] refresh error:`,e instanceof Error?e.message:String(e)),null}}function A(){return t().find(e=>e.providerId===m)}async function j(){let t=A();if(!t?.accessToken)throw new p("Not signed in to xAI Grok — run /login or `oauth-token xai-grok`",f.AUTH_MISSING,!0);let n=t.tokenExpiresAt??0;if(n&&Date.now()+6e4<n)return t.accessToken;if(t.refreshToken){let n=await k(t.refreshToken);if(n?.access_token)return await e({providerId:m,accessToken:n.access_token,refreshToken:n.refresh_token??t.refreshToken,tokenExpiresAt:Date.now()+(n.expires_in??21600)*1e3,scopes:n.scope??t.scopes}),n.access_token}return t.accessToken}function M(e,t){return{type:`error`,reason:`error`,error:{role:`assistant`,content:[],api:w,provider:m,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`error`,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}}function N(e,t){return t?{...e??{},"x-grok-conv-id":t}:e}var P=(e,t,r={})=>{let i=n();return(async()=>{try{let n=await j(),a=r.sessionId,c=D(e),l={...r,apiKey:n,headers:N(r.headers,a)},u=c.api===`openai-responses`?o(c,t,l):s(c,t,l);for await(let e of u)i.push(e);i.end()}catch(t){console.error(`[xai-grok] Stream error:`,t instanceof Error?t.message:String(t)),i.push(M(e,t)),i.end()}})(),i},F=(e,t,r)=>{let i=n();return(async()=>{try{let n=await j(),o=r?.sessionId,s=D(e),l={...r,apiKey:n,headers:N(r?.headers,o)},u=s.api===`openai-responses`?a(s,t,l):c(s,t,l);for await(let e of u)i.push(e);i.end()}catch(t){console.error(`[xai-grok] Stream error:`,t instanceof Error?t.message:String(t)),i.push(M(e,t)),i.end()}})(),i},I={id:m,name:`xAI Grok (SuperGrok OAuth)`,description:`Grok via xAI OAuth — uses your SuperGrok subscription, no API key needed. Default model is Grok 4.5.`,requiresApiKey:!1,requiresBaseUrl:!1,isOAuth:!0,defaultModelId:C,oauthTokenDomains:[`api.x.ai`,`*.x.ai`,`auth.x.ai`,`accounts.x.ai`],getModelIds:()=>T().map(E),onOAuthLoginIntercepted:async(t,n,r)=>{let i=l(),a=await d(i),o=u(),s=u(),c=new URL(g);c.searchParams.set(`response_type`,`code`),c.searchParams.set(`client_id`,v),c.searchParams.set(`redirect_uri`,b),c.searchParams.set(`scope`,r?.scopes??y),c.searchParams.set(`code_challenge`,a),c.searchParams.set(`code_challenge_method`,`S256`),c.searchParams.set(`state`,o),c.searchParams.set(`nonce`,s),c.searchParams.set(`plan`,`generic`),c.searchParams.set(`referrer`,`slicc`);let h=await t({authorizeUrl:c.toString(),redirectUriPattern:x,onCapture:`close`});if(!h)throw new p(`xAI OAuth login was cancelled or timed out`,f.CALLBACK_TIMEOUT);let _=new URL(h),C=_.searchParams.get(`code`),w=_.searchParams.get(`state`);if(!C)throw new p(`xAI OAuth redirect did not include a code`,f.CODE_MISSING);if(w!==o)throw new p(`xAI OAuth state mismatch — possible CSRF, aborting`,f.STATE_MISMATCH);let T=await O(C,i);await e({providerId:m,accessToken:T.access_token,refreshToken:T.refresh_token,tokenExpiresAt:Date.now()+(T.expires_in??21600)*1e3,baseUrl:S,scopes:T.scope}),n()},onOAuthLogout:async()=>{await e({providerId:m,accessToken:``})},onSilentRenew:async()=>{let t=A();if(!t?.refreshToken)return null;let n=await k(t.refreshToken);return n?.access_token?(await e({providerId:m,accessToken:n.access_token,refreshToken:n.refresh_token??t.refreshToken,tokenExpiresAt:Date.now()+(n.expires_in??21600)*1e3,scopes:n.scope??t.scopes}),n.access_token):null}};function L(){i({api:w,stream:P,streamSimple:F})}export{f as XaiErrorCode,p as XaiOAuthError,I as config,L as register};
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>slicc</title>
7
7
  <link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
8
- <script type="module" crossorigin src="/assets/main-B-Dx8oRt.js"></script>
8
+ <script type="module" crossorigin src="/assets/main-DoycVdgy.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
10
10
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
11
11
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
@@ -29,21 +29,21 @@
29
29
  <link rel="modulepreload" crossorigin href="/assets/secrets-bridge-client-cWDAnFqs.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/image-markers-BXtVm4og.js">
31
31
  <link rel="modulepreload" crossorigin href="/assets/tool-ui-DfXu6quJ.js">
32
- <link rel="modulepreload" crossorigin href="/assets/providers-CupV88p_.js">
32
+ <link rel="modulepreload" crossorigin href="/assets/providers-BlKC-KJo.js">
33
33
  <link rel="modulepreload" crossorigin href="/assets/panel-rpc-B3MSVImO.js">
34
- <link rel="modulepreload" crossorigin href="/assets/account-store-5SFKxhvW.js">
34
+ <link rel="modulepreload" crossorigin href="/assets/account-store-C8KOXduU.js">
35
35
  <link rel="modulepreload" crossorigin href="/assets/bridge-launch-params-zrpWWxT3.js">
36
36
  <link rel="modulepreload" crossorigin href="/assets/runtime-env-CgsZ7LTp.js">
37
37
  <link rel="modulepreload" crossorigin href="/assets/telemetry-BVzuNdvW.js">
38
38
  <link rel="modulepreload" crossorigin href="/assets/feature-flags-ByMXaIc4.js">
39
39
  <link rel="modulepreload" crossorigin href="/assets/messages-BD4p8GuF.js">
40
40
  <link rel="modulepreload" crossorigin href="/assets/tray-runtime-config-CRGwg9SK.js">
41
- <link rel="modulepreload" crossorigin href="/assets/setup-sudo-C9GBILbj.js">
42
- <link rel="modulepreload" crossorigin href="/assets/setup-standalone-prelude-51g10DFK.js">
41
+ <link rel="modulepreload" crossorigin href="/assets/setup-sudo-BwZD3_1T.js">
42
+ <link rel="modulepreload" crossorigin href="/assets/setup-standalone-prelude-Dpu4rjGg.js">
43
43
  <link rel="modulepreload" crossorigin href="/assets/tray-follower-status-BAjnN7Ar.js">
44
44
  <link rel="modulepreload" crossorigin href="/assets/clipboard-eqmn97SP.js">
45
45
  <link rel="modulepreload" crossorigin href="/assets/tray-join-url-BIvzbiFR.js">
46
- <link rel="modulepreload" crossorigin href="/assets/provider-settings-DRYz7gQ-.js">
46
+ <link rel="modulepreload" crossorigin href="/assets/provider-settings-D47RycU7.js">
47
47
  </head>
48
48
  <body>
49
49
  <div id="app"></div>
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>slicc</title>
7
7
  <link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
8
- <script type="module" crossorigin src="/assets/main-B-Dx8oRt.js"></script>
8
+ <script type="module" crossorigin src="/assets/main-DoycVdgy.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
10
10
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
11
11
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
@@ -29,21 +29,21 @@
29
29
  <link rel="modulepreload" crossorigin href="/assets/secrets-bridge-client-cWDAnFqs.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/image-markers-BXtVm4og.js">
31
31
  <link rel="modulepreload" crossorigin href="/assets/tool-ui-DfXu6quJ.js">
32
- <link rel="modulepreload" crossorigin href="/assets/providers-CupV88p_.js">
32
+ <link rel="modulepreload" crossorigin href="/assets/providers-BlKC-KJo.js">
33
33
  <link rel="modulepreload" crossorigin href="/assets/panel-rpc-B3MSVImO.js">
34
- <link rel="modulepreload" crossorigin href="/assets/account-store-5SFKxhvW.js">
34
+ <link rel="modulepreload" crossorigin href="/assets/account-store-C8KOXduU.js">
35
35
  <link rel="modulepreload" crossorigin href="/assets/bridge-launch-params-zrpWWxT3.js">
36
36
  <link rel="modulepreload" crossorigin href="/assets/runtime-env-CgsZ7LTp.js">
37
37
  <link rel="modulepreload" crossorigin href="/assets/telemetry-BVzuNdvW.js">
38
38
  <link rel="modulepreload" crossorigin href="/assets/feature-flags-ByMXaIc4.js">
39
39
  <link rel="modulepreload" crossorigin href="/assets/messages-BD4p8GuF.js">
40
40
  <link rel="modulepreload" crossorigin href="/assets/tray-runtime-config-CRGwg9SK.js">
41
- <link rel="modulepreload" crossorigin href="/assets/setup-sudo-C9GBILbj.js">
42
- <link rel="modulepreload" crossorigin href="/assets/setup-standalone-prelude-51g10DFK.js">
41
+ <link rel="modulepreload" crossorigin href="/assets/setup-sudo-BwZD3_1T.js">
42
+ <link rel="modulepreload" crossorigin href="/assets/setup-standalone-prelude-Dpu4rjGg.js">
43
43
  <link rel="modulepreload" crossorigin href="/assets/tray-follower-status-BAjnN7Ar.js">
44
44
  <link rel="modulepreload" crossorigin href="/assets/clipboard-eqmn97SP.js">
45
45
  <link rel="modulepreload" crossorigin href="/assets/tray-join-url-BIvzbiFR.js">
46
- <link rel="modulepreload" crossorigin href="/assets/provider-settings-DRYz7gQ-.js">
46
+ <link rel="modulepreload" crossorigin href="/assets/provider-settings-D47RycU7.js">
47
47
  </head>
48
48
  <body>
49
49
  <div id="app"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sliccy",
3
- "version": "6.80.1",
3
+ "version": "6.82.0",
4
4
  "description": "Browser-based coding agent with thin CLI server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- import{t as e}from"./store-DR0b0bYW.js";export{e as readMcpAuthEntries};
@@ -1 +0,0 @@
1
- function e(e){return e.parentJid===null}function t(e){let t=[];for(let n of e)n.parentJid===null&&t.push(n);return t.sort((e,t)=>e.addedAt.localeCompare(t.addedAt)||e.jid.localeCompare(t.jid))}var n=`cone`;function r(e){return`session-${e.folder}`}function i(t){return e(t)&&t.folder===`cone`}export{t as a,e as i,r as n,i as r,n as t};
@@ -1,160 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/quick-llm-C8XbkYyA.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/account-store-5SFKxhvW.js","assets/preload-helper-Czpn1I53.js","assets/bedrock-camp-qpZqnqLa.js","assets/diagnostics-DN_idNHx.js","assets/transform-messages-N_eMsP2M.js","assets/provider-env-CTOcDKrQ.js","assets/__vite-browser-external-5eBdwsFd.js","assets/openrouter.models-gbjkpjE_.js","assets/libesm-BI4UHVqp.js","assets/logger-DDBAeTLF.js","assets/src-CAWTvdAa.js","assets/proxied-fetch-B4g-4VbQ.js","assets/base64-DpPqYZJF.js","assets/runtime-env-Dlaokqg1.js","assets/fetch-body-D2PwksUW.js","assets/float-topology-BgioAcOd.js","assets/runtime-env-E-i2SW1s.js","assets/secret-topology-xLmXoozo.js","assets/secrets-bridge-client-cWDAnFqs.js","assets/port-bridge-client-BbVs1yhx.js","assets/image-markers-BXtVm4og.js","assets/tool-ui-DfXu6quJ.js","assets/providers-CupV88p_.js","assets/panel-rpc-B3MSVImO.js","assets/llm-session-id-bZQs6gBN.js","assets/icons-ZLR7gmJ4.js"])))=>i.map(i=>d[i]);
2
- import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{Q as t,X as n,Z as r}from"./account-store-5SFKxhvW.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{l as a}from"./bedrock-camp-qpZqnqLa.js";import{t as o}from"./logger-DDBAeTLF.js";import{t as s}from"./attachments-CByeG2Ru.js";import{t as c}from"./types-idfTVsM8.js";import{t as l}from"./icons-ZLR7gmJ4.js";import{n as u}from"./record-BkEi3dzS.js";import{a as d}from"./dictation-priming-CNllGgNq.js";import"./agent-message-to-chat-_cvF5A5g.js";var f=`---
3
- writablePaths:
4
- - /workspace/CLAUDE.md
5
- visiblePaths:
6
- - /sessions/
7
- - /shared/
8
- - /workspace/
9
- allowedCommands:
10
- - awk
11
- - cat
12
- - cp
13
- - cut
14
- - echo
15
- - file
16
- - find
17
- - grep
18
- - head
19
- - jq # structured reads of JSON stores such as /shared/loose-ends.json
20
- - ls
21
- - mkdir
22
- - mv
23
- - od # read-only byte inspection of corrupted stores
24
- - printf
25
- - rg # recursive, .gitignore-aware search; what the curator actually uses over find|xargs grep
26
- - sed
27
- - sort
28
- - tail
29
- - tr
30
- - uniq
31
- - upskill
32
- - wc
33
- timeoutSeconds: 1200
34
- thinkingLevel: medium
35
- ---
36
-
37
- # Memory curator
38
-
39
- Curate the durable memory for session {{SESSION_COUNT}}. Today's date is {{TODAY}}.
40
-
41
- **Work fast: a full pass should finish in well under 10 minutes.** The run is hard-stopped at 20 minutes, and a kill mid-write can corrupt the memory file or leave it over budget — so mine the three signals, rewrite the file, compact it in the same pass, and stop, rather than exploring the archive exhaustively.
42
-
43
- Read the entire current memory at {{MEMORY_PATH}} if it exists. Then mine the archived session at {{SESSION_ARCHIVE_PATH}} using the reading recipes below. Rewrite the entire {{MEMORY_PATH}} file with the durable information worth carrying into future sessions. Every part of the file is editable and counts toward the budget.
44
-
45
- ## What to look for
46
-
47
- Three things carry across sessions, and each has its own place in the archive:
48
-
49
- | Look for | Where it lives |
50
- | --------------- | ---------------------------------------------------------------------- |
51
- | **Preferences** | the user's own messages — how they want things done, and what to avoid |
52
- | **Projects** | tool-call arguments — the paths, repos and files actually worked on |
53
- | **Pitfalls** | failed tool calls — what broke, and the error that proves it |
54
-
55
- Pitfalls are the highest-value and most-often-lost category: a failure that cost half an hour is worth one line next time. Keep the error text that identifies it, not the stack trace.
56
-
57
- ## Reading the session archive
58
-
59
- **Never \`cat\` the archive and never \`head\` it.** Archives reach several megabytes, and the machine-readable \`<!-- slicc:session-data ... -->\` block is a _single line_ holding the whole session as JSON — roughly half the file. Reading it costs a fortune and tells you nothing the prose below it does not. Whole \`### Tool\` result bodies are the other half and are equally not worth reading.
60
-
61
- Check the size first, then pull the three signals separately. Together they run about 1% of the archive, so these work on a 2.5 MB file as happily as on a small one.
62
-
63
- \`\`\`bash
64
- wc -c {{SESSION_ARCHIVE_PATH}}
65
-
66
- # Preferences — what the user asked for, in their words.
67
- sed '/^<!-- slicc:session-data$/,/^-->$/d' {{SESSION_ARCHIVE_PATH}} \\
68
- | awk '/^## User/{p=1;next} /^## (Assistant|Summary)/{p=0} /^### Tool/{p=0} p'
69
-
70
- # Projects — the paths touched most, which name the work.
71
- sed '/^<!-- slicc:session-data$/,/^-->$/d' {{SESSION_ARCHIVE_PATH}} \\
72
- | grep -o '/[A-Za-z0-9_][A-Za-z0-9_./-]\\{3,\\}' \\
73
- | sort | uniq -c | sort -rn | head -40
74
-
75
- # Pitfalls — failed calls with the input that caused them.
76
- sed '/^<!-- slicc:session-data$/,/^-->$/d' {{SESSION_ARCHIVE_PATH}} \\
77
- | grep -B6 '^Result:.*\\(rror\\|not found\\|failed\\|denied\\|ENOENT\\|fatal\\)' \\
78
- | cut -c1-200
79
- \`\`\`
80
-
81
- Only if something is still missing, reach into one specific block with \`grep -n\` plus a bounded \`sed -n 'START,ENDp'\`. Never widen these to the whole file.
82
-
83
- ## Suggesting a skill
84
-
85
- A recurring pitfall is often a missing skill. Once you know what broke and what the work was, spend **one** lookup on it — no more, and skip it entirely when the session had no failures:
86
-
87
- \`\`\`bash
88
- upskill search <a few words from the pitfall>
89
- upskill list # what is already installed — never suggest a duplicate
90
- \`\`\`
91
-
92
- \`upskill ai-ecoverse/skills\` and \`upskill adobe/skills\` list a repo's skills without installing anything. **Never install.** You have no write access to the skills tree, so an install attempt will fail or interrupt the user for approval; recommending is your job, deciding is theirs. Put any suggestion in your closing message, with the pitfall it addresses — that message is delivered to the main agent.
93
-
94
- ## Working within the budget
95
-
96
- Measure, decide, then write once. Do not converge on the budget by trial and error — each attempt re-reads your whole context and is billed accordingly.
97
-
98
- 1. \`wc -c {{MEMORY_PATH}}\` to get the current size, and subtract {{BUDGET_CHARS}} to get the exact surplus.
99
- 2. Decide up front which sections absorb that surplus, oldest-dated first, and roughly what each one costs. Budget the whole cut before editing anything.
100
- 3. Write the complete file once, already inside the budget. Never write a version you know to be over budget «to fix in the next step»: the pass can be killed at any moment, and the file you leave behind is the one the next session inherits.
101
- 4. \`wc -c {{MEMORY_PATH}}\` to confirm. If you are still over, cut a whole section rather than shaving a few characters at a time.
102
-
103
- Per-section costs come out of \`awk\`, not an interpreter: \`awk '/^## /{h=$0} {c[h]+=length($0)+1} END{for(k in c) printf "%7d %s\\n", c[k], k}' {{MEMORY_PATH}} | sort -rn\` tells you which sections pay for the surplus.
104
-
105
- To draft before committing, draft in \`/scoops/agent-memory-curator/\`. That is your own scratch folder: writable without a grant and without an approval prompt, private to this pass, and deleted when the pass ends. Reuse one filename such as \`/scoops/agent-memory-curator/draft.md\` rather than numbering drafts — you have no \`rm\`, so every extra draft survives until the folder goes.
106
-
107
- If the pass is running long, drop the oldest-dated section wholesale and write. An under-budget file missing one stale section is a good outcome; an over-budget file is a broken one.
108
-
109
- Rules:
110
-
111
- - Keep durable preferences, stable project facts, validated approaches, named resources, and the pitfalls worth not repeating.
112
- - Organize retained information into concise per-topic sections rather than one flat list. Let the topic lead the heading; preferences, projects and pitfalls are what to look for, not a required table of contents.
113
- - Never write next to the memory file. It is versioned, so backups and scratch copies beside it are noise; drafts belong in \`/scoops/agent-memory-curator/\`. Do not draft in \`/tmp/\` either: it is shared with every other scoop, which can read and overwrite what you leave there.
114
- - Shell tools only. Interpreters such as \`python3\` and \`node -e\` are not on your allow-list, so reaching for one costs an approval round-trip and may fail even when approved — \`awk\`, \`sed\`, \`wc\` and \`sort\` cover every measurement this pass needs.
115
- - End every \`##\` and \`###\` section heading with its last-verified date in \`YYYY-MM-DD\` form, for example \`## Deployment pipeline (2026-08-06)\`. Dates are UTC, matching the session archive timestamps, so a late-evening freeze west of UTC stamps the next day.
116
- - Stamp sections you write or confirm with today's date, {{TODAY}}.
117
- - Prioritize re-verifying the oldest-dated sections. Treat undated headings as maximally stale and date them on this pass.
118
- - Drop ephemera and duplicates. Delete or merge sections that are stale, superseded, or unverifiable.
119
- - Preserve concrete identifiers such as file paths, URLs, IDs, and names verbatim.
120
- - Keep the entire file at or below the hard budget of {{BUDGET_CHARS}} characters, with no exempt region. When over budget, compact or remove the oldest-dated sections first.
121
- - Write the result to {{MEMORY_PATH}}; do not merely return it in your response.
122
-
123
- <!-- How to customize
124
- Add curator instructions here, for example: also update the knowledge base at /path following its WIKI.md. Extend visiblePaths or writablePaths above to grant access to extra stores, and adjust timeoutSeconds when needed.
125
-
126
- writablePaths defaults to the memory file alone rather than /workspace/, because the curator can run upskill and a directory-wide grant would also let it install skills into /workspace/skills. Widen it only as far as a task genuinely needs; a single file is a valid entry, not just a directory.
127
-
128
- Scratch space needs no entry here. The curator spawns under the fixed name memory-curator, so the bridge grants it /scoops/agent-memory-curator/ — private to the run, writable without a prompt, and removed when the pass ends — and that is where the prompt sends drafts. /tmp/ is writable too, but it is shared with every other scoop and visible to the cone, so a full rewrite of durable memory does not belong there.
129
-
130
- thinkingLevel accepts off, minimal, low, medium, high, or xhigh. Curation is cheaper with reasoning than without: an unreasoned pass converges on the budget by trial and error, and because every turn re-reads the whole context, turn count is what the pass costs. Lower it to off only if you also shrink the prompt to a single mechanical instruction.
131
-
132
- MEMORY.md is user-edited only: the curator intentionally has read-only access to /shared/ and cannot rewrite its own instructions. A bare / is rejected in writablePaths.
133
-
134
- Frontmatter supports a strict YAML subset. Arrays may use the block form above (with optional # comment tails) or inline form such as [cat, grep]. \`allowedCommands\` is additive: listed commands extend the built-in base set without replacing it. Inline entries containing commas must be quoted, for example ["/knowledge/lars,rebecca/"].
135
- -->
136
- `,p=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function ee(e){return typeof e==`string`&&p.includes(e)}o(`agent-bridge`);var te=`agent: name already in use`,m=o(`cone-memory-budget`),ne=4e3,re=2e3,ie=1.25,h=`/workspace/CLAUDE.md`,ae=`/sessions/index.json`,oe=4096,se=/^## Auto-extracted/m,ce=`Consolidate the auto-extracted memory bullets below into a single tighter set of durable memories.
137
-
138
- Rules:
139
- - Output ONLY a single \`## Auto-extracted (consolidated)\` heading followed by markdown bullets.
140
- - One fact per bullet. Drop duplicates and superseded facts. Keep the most recent / specific phrasing.
141
- - Preserve concrete identifiers (file paths, URLs, IDs, names) verbatim.
142
- - Be terse. Aim well under the original size.
143
- - Do NOT add preamble, commentary, or any heading other than the single consolidated one.`;function g(e){return Math.round(ne+re*Math.log2((Number.isFinite(e)&&e>=0?e:0)+2))}function le(e){let t=se.exec(e);if(!t)return{header:e,autoExtracted:``};let n=t.index;return{header:e.slice(0,n),autoExtracted:e.slice(n)}}async function _(e){try{let t=await e.readFile(ae,{encoding:`utf-8`}),n=typeof t==`string`?t:new TextDecoder().decode(t),r=JSON.parse(n);return Array.isArray(r)?r.length:0}catch{return 0}}async function ue(e){let{header:t,autoExtracted:n}=le(e.currentContent);if(!n.trim())return e.currentContent;let r=`You are a memory consolidation assistant. You are given a markdown file's "auto-extracted" section — a list of memory bullets accumulated across sessions of an AI coding assistant. Your job is to rewrite that section as a tighter, deduplicated set of durable memories that fits well within ${e.budget} characters.
144
-
145
- <auto-extracted>
146
- ${n}
147
- </auto-extracted>`,i={role:`user`,content:[{type:`text`,text:ce}],timestamp:Date.now()},o=await a(e.model,{systemPrompt:r,messages:[i]},{apiKey:e.apiKey,maxTokens:oe,headers:e.headers,signal:e.signal});if(o.stopReason===`error`)throw Error(`Restructure call failed: ${o.errorMessage||`Unknown error`}`);let s=o.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
148
- `).trim();if(!s)throw Error(`Restructure call returned empty content`);return`${t}${t.length===0||t.endsWith(`
149
- `)?``:`
150
- `}${s}\n`}async function de(e){if(!e.model||!e.apiKey)return{restructured:!1,reason:`no-llm`};let t=``;try{let n=await e.vfs.readFile(h,{encoding:`utf-8`});t=typeof n==`string`?n:new TextDecoder().decode(n)}catch{return{restructured:!1,reason:`missing-file`}}let n=await _(e.vfs),r=g(n),i=r*ie;if(t.length<=i)return{restructured:!1,reason:`under-threshold`};m.info(`Cone memory over threshold — restructuring`,{size:t.length,budget:r,threshold:i,sessionCount:n});try{let n=await ue({currentContent:t,budget:r,model:e.model,apiKey:e.apiKey,headers:e.headers,signal:e.signal});return await e.vfs.writeFile(h,n),m.info(`Cone memory restructured`,{before:t.length,after:n.length}),{restructured:!0}}catch(e){return m.warn(`Cone memory restructure failed — leaving appended content in place`,{error:e instanceof Error?e.message:String(e)}),{restructured:!1,reason:`error`}}}var v=o(`agentic-memory`),fe=`/shared/MEMORY.md`,pe=1200,me=[h],he=[`/sessions/`,`/shared/`,`/workspace/`],ge=`/workspace`,_e=`awk.cat.cp.cut.date.diff.du.echo.file.find.grep.head.jq.ls.mkdir.mount.mv.nl.od.printf.readlink.sed.sort.stat.tail.touch.tr.uniq.upskill.wc.xxd`.split(`.`),ve=new Set([`writablePaths`,`visiblePaths`,`allowedCommands`]),ye=new Set([`model`,`timeoutSeconds`,`thinkingLevel`]),be=`medium`,y=3e4;async function xe(e){try{if(e.signal?.aborted)return{ok:!1,reason:`aborted`,legacyFallbackSafe:!1};let t=await Se(e.vfs),n=Ae(t,je(t.promptTemplate,{MEMORY_PATH:h,SESSION_ARCHIVE_PATH:e.sessionArchivePath,SESSION_COUNT:String(e.sessionCount),BUDGET_CHARS:String(g(e.sessionCount)),TODAY:e.today??new Date().toISOString().slice(0,10)}),e.sessionArchivePath);e.signal&&(n.signal=e.signal);let r=await Me(Promise.resolve().then(()=>e.spawn(n)),t.timeoutSeconds*1e3+y,e.signal);if(r.type===`timeout`)return v.warn(`Agentic memory wait timed out past the in-run bound + grace`,{timeoutSeconds:t.timeoutSeconds,graceMs:y}),{ok:!1,reason:`timeout`,legacyFallbackSafe:!1};if(r.type===`aborted`)return{ok:!1,reason:`aborted`,legacyFallbackSafe:!1};if(r.type===`error`)return{ok:!1,reason:T(r.error),legacyFallbackSafe:!0};if(r.result.exitCode!==0){let e=(r.result.finalText??``).startsWith(te);return{ok:!1,reason:r.result.finalText||`exit-${r.result.exitCode}`,legacyFallbackSafe:!e}}return{ok:!0,report:r.result.finalText}}catch(e){return v.warn(`Agentic memory pass failed`,{error:T(e)}),{ok:!1,reason:T(e),legacyFallbackSafe:!1}}}async function Se(e){try{let t=await e.readFile(fe,{encoding:`utf-8`});return b(typeof t==`string`?t:new TextDecoder().decode(t))}catch(e){return v.warn(`Could not load valid MEMORY.md; using built-in default`,{error:T(e)}),b(f)}}function b(e){let t=e.replace(/^\uFEFF/,``).replace(/\r\n?/g,`
151
- `).match(/^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/);if(!t?.[2].trim())throw Error(`MEMORY.md requires frontmatter and a prompt`);let n=we(t[1]),r=S(n,`writablePaths`,me);if(r.length===0)throw Error(`writablePaths must not be empty`);C(r,`writablePaths`);let i=S(n,`visiblePaths`,he);C(i,`visiblePaths`);let a=ke(n.timeoutSeconds),o=Oe(n.model,`model`);return{writablePaths:r,visiblePaths:i,allowedCommands:[...new Set([..._e,...S(n,`allowedCommands`,[])])],...o?{model:o}:{},thinkingLevel:Ce(n.thinkingLevel),timeoutSeconds:a,promptTemplate:t[2].trim()}}function Ce(e){if(e===void 0)return be;if(typeof e!=`string`||!ee(e))throw Error(`thinkingLevel must be one of ${p.join(`, `)}`);return e}function we(e){let t={},n=e.split(`
152
- `);for(let e=0;e<n.length;e+=1){let r=n[e];if(!r.trim()||r.trimStart().startsWith(`#`))continue;let i=r.match(/^([A-Za-z][A-Za-z0-9]*):\s*(.*)$/);if(!i)throw Error(`Invalid frontmatter line: ${r}`);let[,a,o]=i;if(ve.has(a)){let r=Te(n,e,o);t[a]=r.value,e=r.lastIndex}else if(ye.has(a)&&o.trim())t[a]=x(o);else throw Error(`Unsupported or empty frontmatter field: ${a}`)}return t}function Te(e,t,n){if(n.trim()){let e=n.trim();if(!e.startsWith(`[`)||!e.endsWith(`]`))throw Error(`Expected an array`);let r=e.slice(1,-1).trim();return{value:r?Ee(r):[],lastIndex:t}}let r=[],i=t;for(let n=t+1;n<e.length;n+=1){let t=e[n].match(/^\s+-\s+(.+)$/);if(!t)break;r.push(x(De(t[1]))),i=n}return{value:r,lastIndex:i}}function Ee(e){let t=[],n=0,r;for(let i=0;i<e.length;i+=1){let a=e[i];a===`"`||a===`'`?r=r===a?void 0:r??a:a===`,`&&!r&&(t.push(x(e.slice(n,i))),n=i+1)}if(r)throw Error(`Unclosed quoted value`);return t.push(x(e.slice(n))),t}function De(e){let t;for(let n=0;n<e.length;n+=1){let r=e[n];if(r===`"`||r===`'`)t=t===r?void 0:t??r;else if(r===`#`&&!t&&(n===0||/\s/.test(e[n-1])))return e.slice(0,n).trimEnd()}return e}function x(e){let t=e.trim();if(!t)throw Error(`Empty frontmatter value`);let n=t[0];if((n===`"`||n===`'`)&&t.at(-1)===n)return t.slice(1,-1);if(n===`"`||n===`'`)throw Error(`Unclosed quoted value`);return t}function S(e,t,n){let r=e[t];if(r===void 0)return[...n];if(!Array.isArray(r)||r.some(e=>!e))throw Error(`${t} is invalid`);return[...r]}function Oe(e,t){if(e!==void 0){if(typeof e!=`string`||!e)throw Error(`${t} is invalid`);return e}}function ke(e){if(e===void 0)return 600;if(typeof e!=`string`)throw Error(`timeoutSeconds is invalid`);let t=Number(e);if(!Number.isFinite(t)||t<=0)throw Error(`timeoutSeconds must be positive`);return Math.min(t,pe)}function C(e,t){if(e.some(e=>!e.startsWith(`/`)||e.includes(`\0`)||t===`writablePaths`&&e===`/`))throw Error(`${t} must contain absolute VFS paths`)}function w(e){return`/sessions/.curated/${e.slice(e.lastIndexOf(`/`)+1)}`}function Ae(e,t,n){let r=e.model===`parent`||e.model===`cone`;return{cwd:ge,writablePaths:e.writablePaths,visiblePaths:e.visiblePaths,allowedCommands:e.allowedCommands,prompt:t,thinkingLevel:e.thinkingLevel,persistSession:!0,name:`memory-curator`,notifyOnComplete:!0,successReceiptPath:w(n),maxWallClockMs:e.timeoutSeconds*1e3,...!r&&e.model?{modelId:e.model}:{}}}function je(e,t){let n=e;for(let[e,r]of Object.entries(t))n=n.replaceAll(`{{${e}}}`,r);return n}function Me(e,t,n){return new Promise(r=>{let i=!1,a=e=>{i||(i=!0,clearTimeout(s),n?.removeEventListener(`abort`,o),r(e))},o=()=>a({type:`aborted`}),s=setTimeout(()=>a({type:`timeout`}),t);n?.addEventListener(`abort`,o,{once:!0}),e.then(e=>a({type:`result`,result:e}),e=>a({type:`error`,error:e}))})}function T(e){return e instanceof Error?e.message:String(e)}var E=`/sessions`,D=`/sessions/index.json`;async function O(e){try{let t=await e.readFile(D,{encoding:`utf-8`}),n=typeof t==`string`?t:new TextDecoder().decode(t),r=JSON.parse(n);return Array.isArray(r)?r:[]}catch{return[]}}function k(e){return`${E}/${e.filename}`}function A(e){let t=e,n=`Untitled`,r={},i=t.match(/^---\n([\s\S]*?)\n---\n+/);if(i){t=t.slice(i[0].length);let e=M(i[1],`cost`),a=M(i[1],`models`);e&&(r.cost=e),a&&(r.models=a);let o=i[1].match(/^cone:\s*(.+?)\s*$/m)?.[1];o&&(r.cone=o);let s=i[1].match(/^coneLabel:\s*(.+?)\s*$/m)?.[1];s&&(r.coneLabel=j(s)),/^memorySkipped:\s*true\s*$/m.test(i[1])&&(r.memorySkipped=!0);let c=i[1].match(/^title:\s*(.+?)\s*$/m);c&&(n=j(c[1]))}let a=t.match(/<!-- slicc:session-data\n([\s\S]*?)\n-->\n*/);if(a){try{let e=a[1].replace(/-- >/g,`-->`),t=JSON.parse(e);if(Array.isArray(t))return{title:n,messages:t,...r}}catch{}t=t.replace(/<!-- slicc:session-data\n[\s\S]*?\n-->\n*/,``)}return t=t.replace(/^#\s+[^\n]*\n+/,``),{title:n,messages:Ne(t),...r}}function j(e){let t=e.trim();if(!t.startsWith(`"`))return t;try{let e=JSON.parse(t);if(typeof e==`string`)return e}catch{}return t.replace(/^"|"$/g,``)}function M(e,t){let n=RegExp(`^${t}:\\s*(.+?)\\s*$`,`m`).exec(e)?.[1];if(n)try{return JSON.parse(n)}catch{return}}function Ne(e){let t=[],n=/^## (User|Assistant)\s*\n/gm,r=[],i;for(;(i=n.exec(e))!==null;)r.push({role:i[1]===`User`?`user`:`assistant`,start:i.index,bodyStart:i.index+i[0].length});for(let n=0;n<r.length;n++){let i=n+1<r.length?r[n+1].start:e.length,a=e.slice(r[n].bodyStart,i).trim();t.push({id:`frozen-${n}`,role:r[n].role,content:a,timestamp:0})}return t}function N(e){let t=``;for(let n of e){let e=n.role===`user`?`User`:`Assistant`,r=n.role===`user`?d(n.content):n.content;if(t+=`## ${e}\n${r}\n\n`,n.attachments?.length&&(t+=`Attachments:\n${n.attachments.map(e=>`- ${s(e)}`).join(`
153
- `)}\n\n`),n.toolCalls)for(let e of n.toolCalls)t+=`### Tool: ${e.name}\nInput: ${JSON.stringify(e.input,null,2)}\nResult: ${e.result??``}\n\n`}return t}var Pe=e({PENDING_SESSION_ATTEMPT_LIMIT:()=>3,SESSIONS_INDEX_PATH:()=>D,curateFrozenSessionMemories:()=>R,enrichPendingSession:()=>Z,freezeConeSession:()=>L,listPendingEnrichments:()=>Y,markSnapshotUnavailable:()=>$,processPendingSessions:()=>X,readSessionsIndex:()=>O}),P=o(`session-freezer`),Fe=4,F=2048,I=40,Ie=`${E}/attachments`;async function L(e){let t=await qe(e.sessionStore,U(e));if(!t||t.messages.length<Fe)return P.info(`Skipping freeze: session below threshold or missing`,{messageCount:t?.messages.length??0}),null;let n=W(t.messages),r=e.mode??`full`,i=r===`full`&&!!(e.apiKey&&e.model);!e.agenticMemorySpawn&&e.memory!==`skip`&&await B(e,n,i);let a=await Re(e,n,i)||Qe(t.messages);return await ze(e,t,a,r,i?await Le(e,a):void 0,!!e.agenticMemorySpawn&&e.memory!==`skip`)}async function R(e,t){let n=W(t.archive.messages),r;try{r=await xe({spawn:e.agenticMemorySpawn,vfs:e.vfs,sessionArchivePath:k(t),sessionCount:await _(e.vfs)})}catch(e){r={ok:!1,reason:e instanceof Error?e.message:String(e),legacyFallbackSafe:!1}}if(r.ok){let n=await pt(e.vfs,t.filename);return await it(e.vfs,t.filename),n?(delete t.memoryPending,P.info(`Agentic memory pass completed`,{filename:t.filename}),n):(P.info(`Agentic memory pass completed; index entry already gone`,{filename:t.filename}),null)}return r.legacyFallbackSafe?(P.warn(`Agentic memory pass failed after finishing — falling back to legacy extraction`,{filename:t.filename,reason:r.reason}),await B(e,n,!0),null):(P.warn(`Agentic memory pass unfinished — entry stays pending for boot catch-up`,{filename:t.filename,reason:r.reason,attemptLimit:3}),null)}async function Le(e,t){try{return z(await(e.pickIcon??(await i(async()=>{let{pickLucideIcon:e}=await import(`./quick-llm-C8XbkYyA.js`).then(e=>e.n);return{pickLucideIcon:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]))).pickLucideIcon)({subject:`"${t}" — an archived chat session`})??void 0)}catch(e){P.warn(`Icon pick failed (freeze still proceeds)`,{error:e instanceof Error?e.message:String(e)});return}}function z(e){if(e)return l(e)?e:void 0}async function B(e,r,i){if(!i){P.info(`LLM unavailable — skipping memory extraction; freezing anyway`);return}let a=``;try{a=await t({messages:r,instruction:n,model:e.model,apiKey:e.apiKey,maxTokens:F,headers:e.headers})}catch(e){P.warn(`Memory extraction call failed (freeze still proceeds)`,{error:e instanceof Error?e.message:String(e)});return}if(!a.trim()||a.trim()===`NONE`){P.info(`Memory extraction returned no durable memories`);return}try{await J(e.vfs,a.trim(),`new-session`,{model:e.model,apiKey:e.apiKey,headers:e.headers}),P.info(`Memory extracted and appended on new-session`)}catch(e){P.warn(`Memory append failed`,{error:e instanceof Error?e.message:String(e)})}}async function Re(e,n,i){if(!i)return``;try{return G(await t({messages:n,instruction:r,model:e.model,apiKey:e.apiKey,maxTokens:I,headers:e.headers}))}catch(e){return P.warn(`Title generation call failed (using heuristic)`,{error:e instanceof Error?e.message:String(e)}),``}}async function ze(e,t,n,r,i,a=!1){let o=new Date().toISOString(),s=crypto.randomUUID(),c=r===`quick`?`pending-${$e()}.md`:`${o.replace(/[:.]/g,`-`)}-${K(n)}.md`,l=Be(t.messages),u=U(e),d={cone:u,...u!==`cone`&&e.cone?.label?{coneLabel:e.cone.label}:{}},f={filename:c,sessionId:s,title:n,frozenAt:o,messageCount:t.messages.length,...l??{},...d,...i?{icon:i}:{},...r===`quick`?{pendingEnrichment:!0}:{},...a?{memoryPending:!0}:{},...e.memory===`skip`?{memorySkipped:!0}:{}};try{await q(e.vfs,E);let r=await He(e.vfs,t.messages,c.replace(/\.md$/,``)),i={id:t.id,title:n,frozenAt:o,createdAt:t.createdAt,updatedAt:t.updatedAt,messageCount:t.messages.length,messages:r,...l??{},...d,...e.memory===`skip`?{memorySkipped:!0}:{}},a=Ze(i);return await e.vfs.writeFile(`${E}/${c}`,a),await tt(e.vfs,f),await e.vfs.flush(),P.info(`Cone session frozen`,{filename:c,title:n,cone:u,messageCount:t.messages.length}),{...f,archive:i}}catch(e){return P.warn(`Failed to write frozen session to VFS`,{error:e instanceof Error?e.message:String(e)}),null}}function Be(e){let t={total:0,input:0,output:0,cacheRead:0,cacheWrite:0},n=new Map,r=!1;for(let i of e){if(i.role!==`assistant`)continue;let{model:e,usage:a}=i;if(!e||!a||!Ve(a))return null;let o=a.cost;r=!0,t.total+=o.total,t.input+=o.input,t.output+=o.output,t.cacheRead+=o.cacheRead,t.cacheWrite+=o.cacheWrite;let s=n.get(e)??{model:e,cost:0,turns:0,tokens:0};s.cost+=o.total,s.turns+=1,s.tokens+=a.input+a.output+a.cacheRead+a.cacheWrite,n.set(e,s)}return r?{cost:t,models:[...n.values()].sort((e,t)=>t.cost-e.cost)}:null}function V(e){return typeof e==`number`&&Number.isFinite(e)}function Ve(e){let{cost:t}=e;return[e.input,e.output,e.cacheRead,e.cacheWrite].every(V)&&[t.input,t.output,t.cacheRead,t.cacheWrite,t.total].every(V)}async function He(e,t,n){let r={vfs:e,archiveDir:`${Ie}/${n}`,copiedPaths:new Map,fileIndex:0},i=[];for(let e of t){if(!e.attachments?.some(H)){i.push(e);continue}let t=[];for(let n of e.attachments)t.push(await Ue(r,n));i.push({...e,attachments:t})}return i}async function Ue(e,t){if(!H(t))return t;let n=e.copiedPaths.get(t.path);if(n)return{...t,path:n};let r=await We(e.vfs,t.path);if(!r)return Ke(t);let i=t.name.replace(/[^A-Za-z0-9._-]+/g,`_`)||`attachment`,a=`${e.archiveDir}/${e.fileIndex++}-${i}`;return await q(e.vfs,e.archiveDir),await e.vfs.writeFile(a,r),e.copiedPaths.set(t.path,a),{...t,path:a}}async function We(e,t){try{if(!await Ge(e,t))return null;let n=await e.readFile(t,{encoding:`binary`});if(!(n instanceof Uint8Array))throw Error(`Expected binary attachment content at ${t}`);return n}catch{return null}}function H(e){return typeof e.path==`string`&&e.path.startsWith(`/tmp/`)&&e.data===void 0&&e.text===void 0}async function Ge(e,t){let n=t.split(`/`).slice(1);if(n.length<2||n[0]!==`tmp`||n.some(e=>!e||e===`.`||e===`..`))return!1;let r=`/`;for(let t=0;t<n.length;t+=1){let i=(await e.readDir(r)).find(e=>e.name===n[t]);if(!i)return!1;if(t===n.length-1)return i.type===`file`;if(i.type!==`directory`)return!1;r=r===`/`?`/${n[t]}`:`${r}/${n[t]}`}return!1}function Ke(e){let{path:t,...n}=e;return{...n,error:e.error??`Archived attachment file is missing or unsafe to preserve.`}}function U(e){return e.cone?.folder||`cone`}async function qe(e,t){let n=u({folder:t});try{return await e.load(n)}catch(e){return P.warn(`Failed to load cone chat session`,{sessionId:n,error:e instanceof Error?e.message:String(e)}),null}}function W(e){return e.map(e=>({role:e.role,content:[{type:`text`,text:e.content}],timestamp:e.timestamp}))}var Je=`<!-- slicc:session-data
154
- `,Ye=`
155
- -->`;function Xe(e){return e.map(e=>{let t={id:e.id,role:e.role,content:e.content,timestamp:e.timestamp};return e.attachments?.length&&(t.attachments=e.attachments),e.toolCalls?.length&&(t.toolCalls=e.toolCalls.map(e=>({id:e.id,name:e.name,input:e.input,...e.result===void 0?{}:{result:e.result},...e.isError?{isError:e.isError}:{}}))),e.source&&(t.source=e.source),e.channel&&(t.channel=e.channel),t})}function Ze(e){let t=(e.cost?`cost: ${JSON.stringify(e.cost)}\n`:``)+(e.models?`models: ${JSON.stringify(e.models)}\n`:``),n=(e.cone?`cone: ${e.cone}\n`:``)+(e.coneLabel?`coneLabel: ${JSON.stringify(e.coneLabel)}\n`:``)+(e.memorySkipped?`memorySkipped: true
156
- `:``),r=`---\nid: ${e.id}\ntitle: ${JSON.stringify(e.title)}\nfrozenAt: ${e.frozenAt}\ncreatedAt: ${e.createdAt}\nupdatedAt: ${e.updatedAt}\nmessageCount: ${e.messageCount}\n`+t+n+`---
157
-
158
- `,i=`${Je}${JSON.stringify(Xe(e.messages)).replace(/-->/g,`-- >`)}${Ye}\n\n`,a=`# ${e.title}\n\n`;return r+i+a+N(e.messages)}function G(e){let t=e.trim();return t=t.replace(/^["'`]+|["'`]+$/g,``).trim(),t=t.replace(/\s+/g,` `),t.length>80&&(t=t.slice(0,80).trimEnd()),t}function Qe(e){let t=e.find(e=>e.role===`user`);if(!t?.content)return`untitled-session`;let n=t.content.trim().replace(/\s+/g,` `);return n.length>60?`${n.slice(0,60)}…`:n||`untitled-session`}function K(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,48)||`session`}function $e(){return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`}function et(e){return e.startsWith(`pending-`)}async function q(e,t){try{await e.mkdir(t,{recursive:!0})}catch{}}async function J(e,t,n,r){let i=`/workspace/CLAUDE.md`,a=``;try{let t=await e.readFile(i,{encoding:`utf-8`});a=typeof t==`string`?t:new TextDecoder().decode(t)}catch(t){if(!(t instanceof c)||t.code!==`ENOENT`)throw t;await q(e,`/workspace`)}let o=`## Auto-extracted (${new Date().toISOString().slice(0,10)}, ${n})`,s=`${a.length===0||a.endsWith(`
159
- `)?``:`
160
- `}\n${o}\n\n${t}\n`;await e.writeFile(i,a+s);try{await de({vfs:e,model:r?.model,apiKey:r?.apiKey,headers:r?.headers,signal:r?.signal})}catch(e){P.warn(`Cone memory budget step threw (append already committed)`,{error:e instanceof Error?e.message:String(e)})}}async function tt(e,t){let n=[];try{let t=await e.readFile(D,{encoding:`utf-8`}),r=typeof t==`string`?t:new TextDecoder().decode(t),i=JSON.parse(r);Array.isArray(i)&&(n=i)}catch(e){if(!(e instanceof c)||e.code!==`ENOENT`)throw e}let r=[t,...n.filter(e=>e.filename!==t.filename)];await e.writeFile(D,JSON.stringify(r,null,2))}async function Y(e){return(await O(e)).filter(e=>(e.pendingEnrichment===!0||e.memoryPending===!0)&&nt(e)<3)}async function X(e){let t={attempted:0,completed:0};if(!e.model||!e.apiKey)return t;try{let n=await Y(e.vfs);for(let r of n)try{let n=await mt(e.vfs,r.filename);if(!n)continue;t.attempted+=1,await Z(e.vfs,n,{model:e.model,apiKey:e.apiKey,headers:e.headers})&&(t.completed+=1)}catch(e){P.warn(`Pending session catch-up attempt failed`,{filename:r.filename,error:e instanceof Error?e.message:String(e)})}}catch(e){P.warn(`Pending session catch-up failed`,{error:e instanceof Error?e.message:String(e)})}return t}function nt(e){let t=e.pendingAttemptCount;return typeof t==`number`&&Number.isInteger(t)&&t>0?t:0}async function Z(e,t,n){if(!t.pendingEnrichment&&!t.memoryPending)return null;let r=await ot(e,t);if(r===null)return null;let i=st(t,r);if(i===null)return null;let a=t.memoryPending===!0&&n.skipMemory!==!0&&await rt(e,t),o=a||t.memorySkipped===!0?{...n,skipMemory:!0}:n,s=await ct(t,i,o);if(s===null)return null;let c=await at(o,s.newTitle);await lt(e,t,s.bullets,o);let l=await dt(e,t,r,s.newTitle,c,n.skipMemory===!0);return l&&a&&await it(e,t.filename),l}async function rt(e,t){try{return await e.stat(w(`/sessions/${t.filename}`)),!0}catch{return!1}}async function it(e,t){try{await e.rm(w(`/sessions/${t}`))}catch{}}async function at(e,t){if(e.pickIcon)try{return await z(await e.pickIcon({subject:`"${t}" — an archived chat session`})??void 0)}catch(e){P.warn(`Enrichment icon pick failed (continuing without icon)`,{error:e instanceof Error?e.message:String(e)});return}}async function ot(e,t){try{let n=await e.readFile(k(t),{encoding:`utf-8`});return typeof n==`string`?n:new TextDecoder().decode(n)}catch(e){return e?.code===`ENOENT`?P.info(`Pending archive missing — treating as already enriched`,{filename:t.filename}):P.warn(`Failed to read pending archive (entry stays pending)`,{filename:t.filename,error:e instanceof Error?e.message:String(e)}),null}}function st(e,t){let n;try{n=A(t).messages}catch(t){return P.warn(`Failed to parse pending archive — leaving entry intact`,{filename:e.filename,error:t instanceof Error?t.message:String(t)}),null}return n.length===0?(P.info(`Pending archive has no messages — skipping enrichment`,{filename:e.filename}),null):W(n)}async function ct(e,i,a){let o=``;if(!a.skipMemory)try{o=await t({messages:i,instruction:n,model:a.model,apiKey:a.apiKey,maxTokens:F,headers:a.headers})}catch(t){return P.warn(`Enrichment memory call failed (entry stays pending)`,{filename:e.filename,error:t instanceof Error?t.message:String(t)}),null}let s=``;try{s=G(await t({messages:i,instruction:r,model:a.model,apiKey:a.apiKey,maxTokens:I,headers:a.headers}))}catch(t){return P.warn(`Enrichment title call failed (entry stays pending)`,{filename:e.filename,error:t instanceof Error?t.message:String(t)}),null}return s?{bullets:o,newTitle:s}:(P.info(`Enrichment title call returned empty — entry stays pending`,{filename:e.filename}),null)}async function lt(e,t,n,r){let i=n.trim();if(!(!i||i===`NONE`))try{await J(e,i,`pending-enrichment`,{model:r.model,apiKey:r.apiKey,headers:r.headers})}catch(e){P.warn(`Enrichment memory append failed (continuing with title rewrite)`,{filename:t.filename,error:e instanceof Error?e.message:String(e)})}}function ut(e,t,n,r,i){let a=r??e.icon;return{filename:t,title:n,frozenAt:e.frozenAt,messageCount:e.messageCount,...e.cost?{cost:e.cost}:{},...e.models?{models:e.models}:{},...e.cone?{cone:e.cone}:{},...e.coneLabel?{coneLabel:e.coneLabel}:{},...e.sessionId?{sessionId:e.sessionId}:{},...a?{icon:a}:{},...e.completeSnapshotUnavailable?{completeSnapshotUnavailable:!0}:{},...i&&e.memoryPending?{memoryPending:!0}:{},...e.memorySkipped?{memorySkipped:!0}:{}}}async function dt(e,t,n,r,i,a=!1){let o=k(t),s=et(t.filename),c=s?r:t.title,l=s?`${t.frozenAt.replace(/[:.]/g,`-`)}-${K(r)}.md`:t.filename,u=`${E}/${l}`;if(s)try{await q(e,E),await e.writeFile(u,ft(n,c))}catch(e){return P.warn(`Enrichment write failed (entry stays pending)`,{filename:t.filename,error:e instanceof Error?e.message:String(e)}),null}let d=ut(t,l,c,i,a);try{await ht(e,t.filename,d)}catch(e){return P.warn(`Enrichment index update failed (entry may stay pending)`,{filename:t.filename,error:e instanceof Error?e.message:String(e)}),null}if(u!==o)try{await e.rm(o)}catch(e){P.info(`Stale pending archive cleanup failed (harmless)`,{oldPath:o,error:e instanceof Error?e.message:String(e)})}try{await e.flush()}catch{}return P.info(`Pending session enriched`,{oldFilename:t.filename,newFilename:l,title:c}),d}function ft(e,t){let n=e.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);if(!n)return e;let r=n[1].replace(/^title:\s*.+$/m,`title: ${JSON.stringify(t)}`),i=n[2];return i=i.replace(/^#\s+[^\n]*$/m,`# ${t}`),`---\n${r}\n---\n${i}`}var Q=Promise.resolve();async function pt(e,t){let n=null,r=async()=>{let r=await O(e),i=r.findIndex(e=>e.filename===t);if(i===-1)return;let{memoryPending:a,pendingEnrichment:o,pendingAttemptCount:s,...c}=r[i],l=r.slice();l[i]=c,await e.writeFile(D,JSON.stringify(l,null,2)),await e.flush(),n=c},i=Q.then(r,r);Q=i.then(()=>void 0,()=>void 0);try{await i}catch(e){P.warn(`Failed to clear agentic memory pending marker`,{filename:t,error:e instanceof Error?e.message:String(e)})}return n}async function mt(e,t){let n=null,r=async()=>{let r=await O(e),i=r.findIndex(e=>e.filename===t);if(i===-1)return;let a=r[i];if(!a.pendingEnrichment&&!a.memoryPending)return;let o=nt(a);if(o>=3)return;n={...a,pendingAttemptCount:o+1};let s=r.slice();s[i]=n,await e.writeFile(D,JSON.stringify(s,null,2)),await e.flush()},i=Q.then(r,r);return Q=i.then(()=>void 0,()=>void 0),await i,n}async function ht(e,t,n){let r=async()=>{let r=[];try{let t=await e.readFile(D,{encoding:`utf-8`}),n=typeof t==`string`?t:new TextDecoder().decode(t),i=JSON.parse(n);Array.isArray(i)&&(r=i)}catch(e){if(!(e instanceof c)||e.code!==`ENOENT`)throw e}let i=r.findIndex(e=>e.filename===t),a;i===-1?a=[n,...r.filter(e=>e.filename!==n.filename)]:(a=r.slice(),a[i]=n,a=a.filter((e,t)=>t===i||e.filename!==n.filename)),await e.writeFile(D,JSON.stringify(a,null,2))},i=Q.then(r,r);return Q=i.then(()=>void 0,()=>void 0),i}async function $(e,t){let n=async()=>{let n=[];try{let t=await e.readFile(D,{encoding:`utf-8`}),r=typeof t==`string`?t:new TextDecoder().decode(t),i=JSON.parse(r);Array.isArray(i)&&(n=i)}catch(e){if(!(e instanceof c)||e.code!==`ENOENT`)throw e;return}if(!n.find(e=>e.filename===t))return;let r=n.map(e=>e.filename===t?{...e,completeSnapshotUnavailable:!0}:e);await e.writeFile(D,JSON.stringify(r,null,2))},r=Q.then(n,n);return Q=r.then(()=>void 0,()=>void 0),r}export{X as a,D as c,O as d,$ as i,k as l,Z as n,Pe as o,L as r,N as s,R as t,A as u};
@@ -1 +0,0 @@
1
- function e(){return{version:`6.80.1`,releasedAt:`2026-08-22T16:40:02Z`,buildId:`6.80.1-mt4ltd8k`}}let t=null;function n(e){t=e}function r(){return t}export{e as n,n as r,r as t};