sliccy 6.240.0 → 6.240.2

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 (151) hide show
  1. package/dist/ui/.vite/manifest.json +215 -213
  2. package/dist/ui/assets/{account-store-Dcuv1CAr.js → account-store-BZBj_ntG.js} +1 -1
  3. package/dist/ui/assets/{account-store-Co7p6uLK.js → account-store-DkttH-BP.js} +1 -1
  4. package/dist/ui/assets/{adobe-DScuixZ8.js → adobe-ByBtC69J.js} +1 -1
  5. package/dist/ui/assets/{adobe-C8D8r5Fe.js → adobe-CVqQJ2x-.js} +1 -1
  6. package/dist/ui/assets/{agent-panels-O5YJfC1_.js → agent-panels-BVpX6zQ5.js} +1 -1
  7. package/dist/ui/assets/{almost-bash-shell-headless-C4AVF2S6.js → almost-bash-shell-headless-HOeKQtgA.js} +499 -499
  8. package/dist/ui/assets/{apply-layout-BZ9iuS4D.js → apply-layout-C_O6ndKr.js} +1 -1
  9. package/dist/ui/assets/{azure-openai-jPUEdFGb.js → azure-openai-DiqKGUYo.js} +1 -1
  10. package/dist/ui/assets/{azure-openai-DGNroO-7.js → azure-openai-Z4aqtv7E.js} +1 -1
  11. package/dist/ui/assets/{cdp-DfHqMmOw.js → cdp-D0OuKYd5.js} +1 -1
  12. package/dist/ui/assets/{cerebras-DJsSEczS.js → cerebras-6-gk1Jha.js} +1 -1
  13. package/dist/ui/assets/{cerebras--GK0UhYQ.js → cerebras-UwtUgOV6.js} +1 -1
  14. package/dist/ui/assets/{composer-speech-Bdzozil9.js → composer-speech-QgsQ1IqW.js} +1 -1
  15. package/dist/ui/assets/{connect-surface-BQ_yaiI0.js → connect-surface-COrO1h1v.js} +1 -1
  16. package/dist/ui/assets/context-compaction-BCsq-2e6.js +58 -0
  17. package/dist/ui/assets/core-BFRZk2b-.js +62 -0
  18. package/dist/ui/assets/{core-C1m4D34S.js → core-EGZ5TU35.js} +1 -1
  19. package/dist/ui/assets/{directed-approval-CM6zsUB_.js → directed-approval-iMn6w3M8.js} +1 -1
  20. package/dist/ui/assets/{emscripten-vfs-hook-BykczwZL.js → emscripten-vfs-hook-_WoXADPd.js} +1 -1
  21. package/dist/ui/assets/{frozen-archive-writer-DHqVNK3z.js → frozen-archive-writer-BhgsVjoX.js} +1 -1
  22. package/dist/ui/assets/{frozen-archive-writer-BoBWoTrh.js → frozen-archive-writer-CBS7YWrT.js} +1 -1
  23. package/dist/ui/assets/{frozen-session-delete-CmVE8uz7.js → frozen-session-delete-B1-ipujg.js} +1 -1
  24. package/dist/ui/assets/{frozen-session-identity-ChrV93y5.js → frozen-session-identity-CTAIleP4.js} +1 -1
  25. package/dist/ui/assets/{frozen-session-identity-CRTDWmSN.js → frozen-session-identity-EbIVZuRz.js} +1 -1
  26. package/dist/ui/assets/{gelatiere-unit-Dnug4wB5.js → gelatiere-unit-BE-OCtHt.js} +1 -1
  27. package/dist/ui/assets/{github-DBHS2Dqt.js → github-C1OAynaV.js} +1 -1
  28. package/dist/ui/assets/{github-B2Jmtl5T.js → github-Dhh_Kein.js} +1 -1
  29. package/dist/ui/assets/{github-copilot-Cb-AGqlO.js → github-copilot-BECMsi8_.js} +1 -1
  30. package/dist/ui/assets/{github-copilot-jU2_bitu.js → github-copilot-Hlw3Z0TU.js} +1 -1
  31. package/dist/ui/assets/{guest-tool-gate-CXdRgkkb.js → guest-tool-gate-83ZVVYjM.js} +1 -1
  32. package/dist/ui/assets/{hear-C8rKY1FP.js → hear-B0sL5R-Z.js} +1 -1
  33. package/dist/ui/assets/{idle-compaction-pwltoPDa.js → idle-compaction-DGln8tkz.js} +1 -1
  34. package/dist/ui/assets/{interrupted-work-recovery-DSX617ic.js → interrupted-work-recovery-CWSaMQsO.js} +1 -1
  35. package/dist/ui/assets/{js-realm-worker-kX5NT2rg.js → js-realm-worker-lw4jlVws.js} +2 -2
  36. package/dist/ui/assets/{jsh-executor-BVRmWOcY.js → jsh-executor-DZkflzRL.js} +2 -2
  37. package/dist/ui/assets/{kernel-worker-B8dQ6oD2.js → kernel-worker-yDR9ykP9.js} +78 -78
  38. package/dist/ui/assets/{lick-ws-bridge-xmS7PfYb.js → lick-ws-bridge-D_7Sju9n.js} +1 -1
  39. package/dist/ui/assets/{lick-ws-bridge-B55KMh7y.js → lick-ws-bridge-awVQ4bod.js} +1 -1
  40. package/dist/ui/assets/{live-session-curation-BNMM5Cko.js → live-session-curation-KCnMJq1h.js} +1 -1
  41. package/dist/ui/assets/live-session-curation-XtShh6w8.js +186 -0
  42. package/dist/ui/assets/{live-session-snapshot-BW_iWuYO.js → live-session-snapshot-Cl5CEBKO.js} +1 -1
  43. package/dist/ui/assets/{local-llm-BTE5kJfp.js → local-llm-BuO74RMi.js} +1 -1
  44. package/dist/ui/assets/{local-llm-CJUTJaEr.js → local-llm-gJaQCXGv.js} +1 -1
  45. package/dist/ui/assets/main-CvCAlghs.js +22 -0
  46. package/dist/ui/assets/{main-cherry-Oc5q4aB-.js → main-cherry-C829SF3P.js} +1 -1
  47. package/dist/ui/assets/{mcp-command-CwuwVp6r.js → mcp-command-DMHz7PmL.js} +9 -9
  48. package/dist/ui/assets/{memory-curation-seam-BMeMHKkg.js → memory-curation-seam-epGReJuG.js} +1 -1
  49. package/dist/ui/assets/{memory-health-Bvv6LYKB.js → memory-health-BYR_Y-0X.js} +1 -1
  50. package/dist/ui/assets/{memory-write-execute-CPixKZV3.js → memory-write-execute-DT_htd19.js} +1 -1
  51. package/dist/ui/assets/{merge-folded-cost-into-frozen-hv0-jK2p.js → merge-folded-cost-into-frozen-DimTAP8-.js} +1 -1
  52. package/dist/ui/assets/{new-session-DspiDGrn.js → new-session-D3NIubwl.js} +2 -2
  53. package/dist/ui/assets/oauth-bootstrap-dt8ZYlvi.js +2 -0
  54. package/dist/ui/assets/{onboarding-orchestrator-DkOtMT6l.js → onboarding-orchestrator-DB4uV5QM.js} +1 -1
  55. package/dist/ui/assets/{openai-codex-DPx8bB-I.js → openai-codex-CR-4SKAR.js} +1 -1
  56. package/dist/ui/assets/{openai-codex-DqI-LV1p.js → openai-codex-Cl-z58Kf.js} +1 -1
  57. package/dist/ui/assets/{openrouter-Bm5NKbSA.js → openrouter-BNdMnkix.js} +1 -1
  58. package/dist/ui/assets/{openrouter-CX8Bzh4-.js → openrouter-D79_Vd4c.js} +1 -1
  59. package/dist/ui/assets/{openrouter-free-Dio8R8YY.js → openrouter-free-C1-Bj_Xx.js} +1 -1
  60. package/dist/ui/assets/{openrouter-free-BtMhJjpj.js → openrouter-free-CQa1CoO4.js} +1 -1
  61. package/dist/ui/assets/{openrouter-oauth-CYyzK9z-.js → openrouter-oauth-DOazjMTa.js} +1 -1
  62. package/dist/ui/assets/{openrouter-oauth-DTvqvfHg.js → openrouter-oauth-D_I7eEtl.js} +1 -1
  63. package/dist/ui/assets/panel-rpc-handlers-BzU1tjGq.js +2 -0
  64. package/dist/ui/assets/{panelize-shell-BF3KcP4C.js → panelize-shell-B0pTufSe.js} +1 -1
  65. package/dist/ui/assets/{pi-edit-execution-2UPU8l9Z.js → pi-edit-execution-CvC4g6ge.js} +1 -1
  66. package/dist/ui/assets/{provider-BVH2DJ2j.js → provider-BVtwgFuj.js} +1 -1
  67. package/dist/ui/assets/{provider-C8H2Tzfg.js → provider-D5HnoEAQ.js} +1 -1
  68. package/dist/ui/assets/{provider-settings-SY82ESoD.js → provider-settings-Eedtvqyh.js} +1 -1
  69. package/dist/ui/assets/provider-store-access-Cb_QGFws.js +1 -0
  70. package/dist/ui/assets/provider-store-access-DpnMfiJL.js +1 -0
  71. package/dist/ui/assets/providers-CR6zPkBA.js +2 -0
  72. package/dist/ui/assets/{providers-CefzTaF8.js → providers-CxXqdsb8.js} +1 -1
  73. package/dist/ui/assets/{quick-llm-DiEAuzzI.js → quick-llm-OcogX5yH.js} +1 -1
  74. package/dist/ui/assets/{realm-inprocess-Cc3228-9.js → realm-inprocess-D4P5wFOE.js} +2 -2
  75. package/dist/ui/assets/{realm-unhandled-rejections-BcZm-Y2j.js → realm-unhandled-rejections-BcTVMNp-.js} +1 -1
  76. package/dist/ui/assets/{realm-unhandled-rejections-TLpLRRgO.js → realm-unhandled-rejections-CKtowxzG.js} +1 -1
  77. package/dist/ui/assets/{recovery-screen-Cl89ahLT.js → recovery-screen-BGirKYu_.js} +1 -1
  78. package/dist/ui/assets/{remote-terminal-view-D82qMvNy.js → remote-terminal-view-qc6RzQpT.js} +2 -2
  79. package/dist/ui/assets/{restore-yq1C_osw.js → restore-BRsw6f-s.js} +1 -1
  80. package/dist/ui/assets/{run-DZrK_oOt.js → run-BpasEHV5.js} +2 -2
  81. package/dist/ui/assets/{run-Cu8PtYCw.js → run-CjVzDP7D.js} +2 -2
  82. package/dist/ui/assets/{run-tc2VFBej.js → run-Co30Tf9M.js} +1 -1
  83. package/dist/ui/assets/{run-BPeIvqOM.js → run-D4C2w6Ix.js} +1 -1
  84. package/dist/ui/assets/{session-command-memory-CDOmbg5g.js → session-command-memory-XnFNRIFA.js} +2 -2
  85. package/dist/ui/assets/{session-jsonl-D_UZgGp5.js → session-jsonl-CrcMW8fx.js} +1 -1
  86. package/dist/ui/assets/{session-jsonl-C4593KNn.js → session-jsonl-DO6bKeXA.js} +1 -1
  87. package/dist/ui/assets/{session-search-index-CUPFfLvv.js → session-search-index-CeQkxdD7.js} +1 -1
  88. package/dist/ui/assets/{setup-feature-flags-remote-cYu5aVbG.js → setup-feature-flags-remote-BSbLoDdK.js} +1 -1
  89. package/dist/ui/assets/{setup-model-catalog-CR19K3-A.js → setup-model-catalog-DKaFLDA2.js} +1 -1
  90. package/dist/ui/assets/{silent-renew-backoff-Bvrf2Hhh.js → silent-renew-backoff-JpXc1wkl.js} +1 -1
  91. package/dist/ui/assets/slicc-version-BfDpFkW3.js +1 -0
  92. package/dist/ui/assets/{soundscape-DxIHlkzy.js → soundscape-CD-xcN6Z.js} +1 -1
  93. package/dist/ui/assets/{speak-DkUF9yAq.js → speak-DgoChm2i.js} +1 -1
  94. package/dist/ui/assets/{sprinkle-manager-UTFA1mfr.js → sprinkle-manager-CDJc_08W.js} +1 -1
  95. package/dist/ui/assets/{sprinkle-renderer-Cr1UxyZz.js → sprinkle-renderer-Dur1ZNnK.js} +1 -1
  96. package/dist/ui/assets/{sudo-SwaFp2JP.js → sudo-DO4cHGWe.js} +1 -1
  97. package/dist/ui/assets/{supervisor-DvFfdQZG.js → supervisor-DsxjOzXp.js} +1 -1
  98. package/dist/ui/assets/{sync-dialog-89X_eADs.js → sync-dialog-Ca6pboEO.js} +1 -1
  99. package/dist/ui/assets/{transformers-env-C6jpYwFE.js → transformers-env-lnsOWAhF.js} +1 -1
  100. package/dist/ui/assets/{tray-leader-2nVEUays.js → tray-leader-IzNrTl6C.js} +1 -1
  101. package/dist/ui/assets/{tray-leave-runtime-Bn1GC9Cf.js → tray-leave-runtime-C1DwCeQz.js} +1 -1
  102. package/dist/ui/assets/{tray-sidecar-DmR9wMCP.js → tray-sidecar-DyqniZfp.js} +1 -1
  103. package/dist/ui/assets/{turn-journal-EgGBqAjY.js → turn-journal-CVQtwHPx.js} +1 -1
  104. package/dist/ui/assets/{upgrade-detection-CHMH6iyk.js → upgrade-detection-GSR1EuFa.js} +1 -1
  105. package/dist/ui/assets/utf16-clip-Dcxt-q1C.js +1 -0
  106. package/dist/ui/assets/{voice-reply-BSouYhfc.js → voice-reply-BaAuLq60.js} +1 -1
  107. package/dist/ui/assets/wc-attach-sJ3NMqHQ.js +13 -0
  108. package/dist/ui/assets/{wc-browser-_YDya6R4.js → wc-browser-u5uzxk-d.js} +1 -1
  109. package/dist/ui/assets/{wc-computers-DsTSGd08.js → wc-computers-BX1yCXPi.js} +1 -1
  110. package/dist/ui/assets/{wc-detached-Cnh8X5Wm.js → wc-detached-U-XIb2f6.js} +1 -1
  111. package/dist/ui/assets/wc-extension-BgC75srq.js +2 -0
  112. package/dist/ui/assets/wc-follower-C6KuLED-.js +17 -0
  113. package/dist/ui/assets/{wc-follower-oauth-D8E_ti39.js → wc-follower-oauth-DsNONUfK.js} +1 -1
  114. package/dist/ui/assets/{wc-gelatiere-BCuLQnrY.js → wc-gelatiere-C1LMmmP-.js} +1 -1
  115. package/dist/ui/assets/wc-live-BvTlZWIq.js +248 -0
  116. package/dist/ui/assets/wc-nav-DAZqGqhf.js +2 -0
  117. package/dist/ui/assets/{wc-onboarding-myCW-Onf.js → wc-onboarding-Cf7ATuAZ.js} +2 -2
  118. package/dist/ui/assets/{wc-permissions-Baf4WNdK.js → wc-permissions-BfNzwBXu.js} +2 -2
  119. package/dist/ui/assets/{wc-placeholder-C0mKH-Yt.js → wc-placeholder-73ZpUgXT.js} +3 -3
  120. package/dist/ui/assets/{wc-secret-request-DLrIa256.js → wc-secret-request-BztOdnag.js} +1 -1
  121. package/dist/ui/assets/{wc-settings-C14VLbGh.js → wc-settings-ClXzlz1S.js} +3 -3
  122. package/dist/ui/assets/{wc-shell-BTfKKBgo.js → wc-shell-BBeNiS8R.js} +4 -4
  123. package/dist/ui/assets/{wc-shortcut-config-BvDHKCy0.js → wc-shortcut-config-DNDBw_BA.js} +1 -1
  124. package/dist/ui/assets/wc-sprinkles-ClXMSwxA.js +2 -0
  125. package/dist/ui/assets/{wc-transcript-export-CyRiKnwi.js → wc-transcript-export-APmcHVyY.js} +2 -2
  126. package/dist/ui/assets/{wc-tray-jeohKKcJ.js → wc-tray-B9Wksuuv.js} +4 -4
  127. package/dist/ui/assets/welcome-detection-CjuV_cig.js +1 -0
  128. package/dist/ui/assets/whisper-session-Bd6DyWgL.js +2 -0
  129. package/dist/ui/assets/{xai-grok-CpBrt9ak.js → xai-grok-CKLvBVjv.js} +1 -1
  130. package/dist/ui/assets/{xai-grok-BFykbO4p.js → xai-grok-ummZtHNw.js} +1 -1
  131. package/dist/ui/index.html +5 -4
  132. package/dist/ui/packages/webapp/index.html +5 -4
  133. package/package.json +1 -1
  134. package/dist/ui/assets/context-compaction-B8b3xc1C.js +0 -58
  135. package/dist/ui/assets/core-Cx9N3lmn.js +0 -62
  136. package/dist/ui/assets/live-session-curation-C8WI_jMh.js +0 -186
  137. package/dist/ui/assets/main-Cxb1a5Uz.js +0 -22
  138. package/dist/ui/assets/oauth-bootstrap-Dya1IvMk.js +0 -2
  139. package/dist/ui/assets/panel-rpc-handlers-DfSkY8OF.js +0 -2
  140. package/dist/ui/assets/provider-store-access-Cd8AQEiQ.js +0 -1
  141. package/dist/ui/assets/provider-store-access-DbDmDCT_.js +0 -1
  142. package/dist/ui/assets/providers-DollmArp.js +0 -2
  143. package/dist/ui/assets/slicc-version-BxghrDTL.js +0 -1
  144. package/dist/ui/assets/wc-attach-4HlzE8yC.js +0 -13
  145. package/dist/ui/assets/wc-extension-CTg_a4Zu.js +0 -2
  146. package/dist/ui/assets/wc-follower-CpxmTt8d.js +0 -17
  147. package/dist/ui/assets/wc-live-1-EV8_qk.js +0 -248
  148. package/dist/ui/assets/wc-nav-BJ5I51NK.js +0 -2
  149. package/dist/ui/assets/wc-sprinkles-ZL0xE_Cs.js +0 -2
  150. package/dist/ui/assets/welcome-detection-CuDKZAa8.js +0 -1
  151. package/dist/ui/assets/whisper-session-Ch8cDNVc.js +0 -2
@@ -1 +1 @@
1
- import{t as e}from"./logger-LESFN7Hj.js";import{n as t,t as n}from"./tray-leader-status-CpkFr6n7.js";import{n as r,r as i,t as a}from"./lick-urls-CgPiVwD-.js";import"./kernel-worker-B8dQ6oD2.js";const o=e(`lick-ws-bridge`);function s(e){if(e.stopped)return;let t;try{t=e.wsFactory(e.wsUrl)}catch(t){o.error(`Failed to construct lick WebSocket`,{url:e.wsUrl,error:t instanceof Error?t.message:String(t)}),c(e,`construct-threw`);return}e.socket=t,t.onopen=()=>{e.consecutiveFailures>0?o.info(`Lick WebSocket recovered`,{attempts:e.consecutiveFailures}):o.info(`Lick WebSocket connected`),e.consecutiveFailures=0,e.unrecoverableSignalled=!1},t.onmessage=n=>{u(e,t,n.data).catch(e=>{let t=typeof n.data==`string`?n.data.slice(0,200):`[non-string payload]`;o.error(`Failed to process lick message`,{error:e instanceof Error?e.message:String(e),preview:t})})},t.onclose=n=>{if(e.socket===t&&(e.socket=null),e.stopped)return;let r=n.reason?` reason=${JSON.stringify(n.reason)}`:``;c(e,`disconnected code=${n.code}${r}`)},t.onerror=t=>{let n=t.target;o.error(`Lick WebSocket error`,{url:e.wsUrl,readyState:n?.readyState,eventType:t.type})}}function c(e,t){if(e.reconnectHandle!=null){o.debug(`Lick WS failure during pending reconnect — keeping existing timer`,{cause:t});return}e.consecutiveFailures++;let n=Math.min(e.baseDelay*2**(e.consecutiveFailures-1),6e4),r={url:e.wsUrl,attempt:e.consecutiveFailures,cause:t,retryInMs:n};if(e.consecutiveFailures>=3?o.error(`Lick WebSocket still down`,r):o.warn(`Lick WebSocket down`,r),e.consecutiveFailures===20&&!e.unrecoverableSignalled){e.unrecoverableSignalled=!0;try{e.lickManager.emitEvent({type:`session-reload`,targetScoop:void 0,timestamp:new Date().toISOString(),body:{reason:`lick-ws-bridge-down`,url:e.wsUrl,attempts:e.consecutiveFailures}})}catch(e){o.error(`Failed to emit lick-ws-bridge-down signal`,{error:e instanceof Error?e.message:String(e)})}}l(e,n)}function l(e,t){e.stopped||e.reconnectHandle!=null||(e.reconnectHandle=e.setTimer(()=>{e.reconnectHandle=null,s(e)},t))}async function u(e,t,n){let r=JSON.parse(typeof n==`string`?n:String(n));if(r.requestId){let n=r.requestId,i=await g(e,r,n);if(e.stopped||e.socket!==t||t.readyState!==1){o.warn(`Lick reply dropped — socket changed/closed mid-request`,{type:r.type,requestId:n});return}try{t.send(JSON.stringify(i))}catch(e){o.error(`ws.send() failed delivering lick reply`,{type:r.type,requestId:n,error:e instanceof Error?e.message:String(e)})}return}if(r.type===`webhook_event`){d(e.lickManager,r);return}if(r.type===`navigate_event`){p(e.lickManager,r);return}r.type===`hostfs_invalidate`&&h(e,r)}function d(e,t){let n=typeof t.webhookId==`string`?t.webhookId:null;if(!n)return o.error(`Malformed webhook_event from lick-ws`,{receivedKeys:Object.keys(t)}),`malformed`;let r=t.headers&&typeof t.headers==`object`?t.headers:{};try{return e.handleWebhookEvent(n,r,t.body)}catch(e){return o.error(`Webhook event dispatch failed`,{webhookId:n,error:e instanceof Error?e.message:String(e)}),`failed`}}function f(e){let t=typeof e.verb==`string`?e.verb:null,n=typeof e.target==`string`?e.target:null,r=typeof e.url==`string`&&e.url.length>0?e.url:null;if(t!==`handoff`&&t!==`upskill`||!n||!r)return null;let i={url:r,verb:t,target:n};return typeof e.instruction==`string`&&(i.instruction=e.instruction),typeof e.branch==`string`&&(i.branch=e.branch),typeof e.path==`string`&&(i.path=e.path),typeof e.title==`string`&&(i.title=e.title),{type:`navigate`,navigateUrl:r,targetScoop:void 0,timestamp:typeof e.timestamp==`string`?e.timestamp:new Date().toISOString(),body:i}}function p(e,t){let n=f(t);if(!n){o.debug(`navigate_event dropped — invalid payload`,{hasVerb:typeof t.verb==`string`,hasTarget:typeof t.target==`string`,hasUrl:typeof t.url==`string`&&t.url.length>0});return}e.emitEvent(n)}function m(e){if(typeof e.mount!=`string`||e.mount.length===0)return null;let t=e.paths,n=[];if(Array.isArray(t))for(let e of t)typeof e==`string`&&n.push(e);return{type:`hostfs_invalidate`,mount:e.mount,paths:n,timestamp:typeof e.timestamp==`string`?e.timestamp:void 0}}function h(e,t){let n=m(t);if(!n){o.debug(`hostfs_invalidate dropped — invalid payload`,{hasMount:typeof t.mount==`string`&&t.mount.length>0,pathsIsArray:Array.isArray(t.paths)});return}try{e.options.onHostfsInvalidate?.(n)}catch(e){o.warn(`hostfs_invalidate handler threw`,{mount:n.mount,error:e instanceof Error?e.message:String(e)})}}async function g(e,t,r){let{lickManager:i}=e;try{switch(t.type){case`list_webhooks`:return{type:`response`,requestId:r,data:i.listWebhooks().map(t=>({...t,url:_(e,t.id)}))};case`create_webhook`:{let n=await i.createWebhook(t.name||`default`,t.scoop,t.filter);return{type:`response`,requestId:r,data:{...n,url:_(e,n.id)}}}case`webhook_event`:return{type:`response`,requestId:r,data:{disposition:d(i,t)}};case`delete_webhook`:return await i.deleteWebhook(t.id)?{type:`response`,requestId:r,data:{ok:!0}}:{type:`response`,requestId:r,data:{error:`Webhook not found`}};case`list_crontasks`:return{type:`response`,requestId:r,data:i.listCronTasks()};case`create_crontask`:if(!t.name)throw Error(`name is required`);if(!t.cron)throw Error(`cron is required`);return{type:`response`,requestId:r,data:await i.createCronTask(t.name,t.cron,t.scoop,t.filter)};case`delete_crontask`:return await i.deleteCronTask(t.id)?{type:`response`,requestId:r,data:{ok:!0}}:{type:`response`,requestId:r,data:{error:`Cron task not found`}};case`tray_status`:{let e=n();return{type:`response`,requestId:r,data:{state:e.state,joinUrl:e.session?.joinUrl??null,workerBaseUrl:e.session?.workerBaseUrl??null,trayId:e.session?.trayId??null}}}default:return{type:`response`,requestId:r,error:`Unknown request type: ${t.type}`}}}catch(e){return{type:`response`,requestId:r,error:e instanceof Error?e.message:String(e)}}}function _(e,n){let a=t().session;return a?.webhookUrl?r(a.webhookUrl,n):e.webhookOriginOverride?`${e.webhookOriginOverride}/webhooks/${n}`:i(e.options.locationHref,n)}function v(e){if(e.stopped)return;e.stopped=!0,e.reconnectHandle!=null&&(e.clearTimer(e.reconnectHandle),e.reconnectHandle=null);let t=e.socket;if(e.socket=null,t)try{t.close()}catch(e){t.readyState!==3&&t.readyState!==2&&o.warn(`Lick socket close() threw before terminal state`,{readyState:t.readyState,error:e instanceof Error?e.message:String(e)})}}function y(e,t){try{new URL(t.locationHref)}catch(e){throw Error(`startLickWsBridge: invalid locationHref ${JSON.stringify(t.locationHref)}: ${e instanceof Error?e.message:String(e)}`)}let n=typeof t.lickWsUrl==`string`&&t.lickWsUrl.length>0?t.lickWsUrl:a(t.locationHref),r=null;if(typeof t.lickWsUrl==`string`&&t.lickWsUrl.length>0)try{let e=new URL(t.lickWsUrl);r=`${e.protocol===`wss:`?`https:`:`http:`}//${e.host}`}catch{r=null}let i={lickManager:e,options:t,wsUrl:n,webhookOriginOverride:r,baseDelay:t.reconnectDelayMs??3e3,wsFactory:t.webSocketFactory??(e=>new WebSocket(e)),setTimer:t.setTimeoutFn??setTimeout.bind(globalThis),clearTimer:t.clearTimeoutFn??clearTimeout.bind(globalThis),stopped:!1,socket:null,reconnectHandle:null,consecutiveFailures:0,unrecoverableSignalled:!1};return s(i),{stop(){v(i)}}}export{y as startLickWsBridge};
1
+ import{t as e}from"./logger-LESFN7Hj.js";import{n as t,t as n}from"./tray-leader-status-CpkFr6n7.js";import{n as r,r as i,t as a}from"./lick-urls-CgPiVwD-.js";import"./kernel-worker-yDR9ykP9.js";const o=e(`lick-ws-bridge`);function s(e){if(e.stopped)return;let t;try{t=e.wsFactory(e.wsUrl)}catch(t){o.error(`Failed to construct lick WebSocket`,{url:e.wsUrl,error:t instanceof Error?t.message:String(t)}),c(e,`construct-threw`);return}e.socket=t,t.onopen=()=>{e.consecutiveFailures>0?o.info(`Lick WebSocket recovered`,{attempts:e.consecutiveFailures}):o.info(`Lick WebSocket connected`),e.consecutiveFailures=0,e.unrecoverableSignalled=!1},t.onmessage=n=>{u(e,t,n.data).catch(e=>{let t=typeof n.data==`string`?n.data.slice(0,200):`[non-string payload]`;o.error(`Failed to process lick message`,{error:e instanceof Error?e.message:String(e),preview:t})})},t.onclose=n=>{if(e.socket===t&&(e.socket=null),e.stopped)return;let r=n.reason?` reason=${JSON.stringify(n.reason)}`:``;c(e,`disconnected code=${n.code}${r}`)},t.onerror=t=>{let n=t.target;o.error(`Lick WebSocket error`,{url:e.wsUrl,readyState:n?.readyState,eventType:t.type})}}function c(e,t){if(e.reconnectHandle!=null){o.debug(`Lick WS failure during pending reconnect — keeping existing timer`,{cause:t});return}e.consecutiveFailures++;let n=Math.min(e.baseDelay*2**(e.consecutiveFailures-1),6e4),r={url:e.wsUrl,attempt:e.consecutiveFailures,cause:t,retryInMs:n};if(e.consecutiveFailures>=3?o.error(`Lick WebSocket still down`,r):o.warn(`Lick WebSocket down`,r),e.consecutiveFailures===20&&!e.unrecoverableSignalled){e.unrecoverableSignalled=!0;try{e.lickManager.emitEvent({type:`session-reload`,targetScoop:void 0,timestamp:new Date().toISOString(),body:{reason:`lick-ws-bridge-down`,url:e.wsUrl,attempts:e.consecutiveFailures}})}catch(e){o.error(`Failed to emit lick-ws-bridge-down signal`,{error:e instanceof Error?e.message:String(e)})}}l(e,n)}function l(e,t){e.stopped||e.reconnectHandle!=null||(e.reconnectHandle=e.setTimer(()=>{e.reconnectHandle=null,s(e)},t))}async function u(e,t,n){let r=JSON.parse(typeof n==`string`?n:String(n));if(r.requestId){let n=r.requestId,i=await g(e,r,n);if(e.stopped||e.socket!==t||t.readyState!==1){o.warn(`Lick reply dropped — socket changed/closed mid-request`,{type:r.type,requestId:n});return}try{t.send(JSON.stringify(i))}catch(e){o.error(`ws.send() failed delivering lick reply`,{type:r.type,requestId:n,error:e instanceof Error?e.message:String(e)})}return}if(r.type===`webhook_event`){d(e.lickManager,r);return}if(r.type===`navigate_event`){p(e.lickManager,r);return}r.type===`hostfs_invalidate`&&h(e,r)}function d(e,t){let n=typeof t.webhookId==`string`?t.webhookId:null;if(!n)return o.error(`Malformed webhook_event from lick-ws`,{receivedKeys:Object.keys(t)}),`malformed`;let r=t.headers&&typeof t.headers==`object`?t.headers:{};try{return e.handleWebhookEvent(n,r,t.body)}catch(e){return o.error(`Webhook event dispatch failed`,{webhookId:n,error:e instanceof Error?e.message:String(e)}),`failed`}}function f(e){let t=typeof e.verb==`string`?e.verb:null,n=typeof e.target==`string`?e.target:null,r=typeof e.url==`string`&&e.url.length>0?e.url:null;if(t!==`handoff`&&t!==`upskill`||!n||!r)return null;let i={url:r,verb:t,target:n};return typeof e.instruction==`string`&&(i.instruction=e.instruction),typeof e.branch==`string`&&(i.branch=e.branch),typeof e.path==`string`&&(i.path=e.path),typeof e.title==`string`&&(i.title=e.title),{type:`navigate`,navigateUrl:r,targetScoop:void 0,timestamp:typeof e.timestamp==`string`?e.timestamp:new Date().toISOString(),body:i}}function p(e,t){let n=f(t);if(!n){o.debug(`navigate_event dropped — invalid payload`,{hasVerb:typeof t.verb==`string`,hasTarget:typeof t.target==`string`,hasUrl:typeof t.url==`string`&&t.url.length>0});return}e.emitEvent(n)}function m(e){if(typeof e.mount!=`string`||e.mount.length===0)return null;let t=e.paths,n=[];if(Array.isArray(t))for(let e of t)typeof e==`string`&&n.push(e);return{type:`hostfs_invalidate`,mount:e.mount,paths:n,timestamp:typeof e.timestamp==`string`?e.timestamp:void 0}}function h(e,t){let n=m(t);if(!n){o.debug(`hostfs_invalidate dropped — invalid payload`,{hasMount:typeof t.mount==`string`&&t.mount.length>0,pathsIsArray:Array.isArray(t.paths)});return}try{e.options.onHostfsInvalidate?.(n)}catch(e){o.warn(`hostfs_invalidate handler threw`,{mount:n.mount,error:e instanceof Error?e.message:String(e)})}}async function g(e,t,r){let{lickManager:i}=e;try{switch(t.type){case`list_webhooks`:return{type:`response`,requestId:r,data:i.listWebhooks().map(t=>({...t,url:_(e,t.id)}))};case`create_webhook`:{let n=await i.createWebhook(t.name||`default`,t.scoop,t.filter);return{type:`response`,requestId:r,data:{...n,url:_(e,n.id)}}}case`webhook_event`:return{type:`response`,requestId:r,data:{disposition:d(i,t)}};case`delete_webhook`:return await i.deleteWebhook(t.id)?{type:`response`,requestId:r,data:{ok:!0}}:{type:`response`,requestId:r,data:{error:`Webhook not found`}};case`list_crontasks`:return{type:`response`,requestId:r,data:i.listCronTasks()};case`create_crontask`:if(!t.name)throw Error(`name is required`);if(!t.cron)throw Error(`cron is required`);return{type:`response`,requestId:r,data:await i.createCronTask(t.name,t.cron,t.scoop,t.filter)};case`delete_crontask`:return await i.deleteCronTask(t.id)?{type:`response`,requestId:r,data:{ok:!0}}:{type:`response`,requestId:r,data:{error:`Cron task not found`}};case`tray_status`:{let e=n();return{type:`response`,requestId:r,data:{state:e.state,joinUrl:e.session?.joinUrl??null,workerBaseUrl:e.session?.workerBaseUrl??null,trayId:e.session?.trayId??null}}}default:return{type:`response`,requestId:r,error:`Unknown request type: ${t.type}`}}}catch(e){return{type:`response`,requestId:r,error:e instanceof Error?e.message:String(e)}}}function _(e,n){let a=t().session;return a?.webhookUrl?r(a.webhookUrl,n):e.webhookOriginOverride?`${e.webhookOriginOverride}/webhooks/${n}`:i(e.options.locationHref,n)}function v(e){if(e.stopped)return;e.stopped=!0,e.reconnectHandle!=null&&(e.clearTimer(e.reconnectHandle),e.reconnectHandle=null);let t=e.socket;if(e.socket=null,t)try{t.close()}catch(e){t.readyState!==3&&t.readyState!==2&&o.warn(`Lick socket close() threw before terminal state`,{readyState:t.readyState,error:e instanceof Error?e.message:String(e)})}}function y(e,t){try{new URL(t.locationHref)}catch(e){throw Error(`startLickWsBridge: invalid locationHref ${JSON.stringify(t.locationHref)}: ${e instanceof Error?e.message:String(e)}`)}let n=typeof t.lickWsUrl==`string`&&t.lickWsUrl.length>0?t.lickWsUrl:a(t.locationHref),r=null;if(typeof t.lickWsUrl==`string`&&t.lickWsUrl.length>0)try{let e=new URL(t.lickWsUrl);r=`${e.protocol===`wss:`?`https:`:`http:`}//${e.host}`}catch{r=null}let i={lickManager:e,options:t,wsUrl:n,webhookOriginOverride:r,baseDelay:t.reconnectDelayMs??3e3,wsFactory:t.webSocketFactory??(e=>new WebSocket(e)),setTimer:t.setTimeoutFn??setTimeout.bind(globalThis),clearTimer:t.clearTimeoutFn??clearTimeout.bind(globalThis),stopped:!1,socket:null,reconnectHandle:null,consecutiveFailures:0,unrecoverableSignalled:!1};return s(i),{stop(){v(i)}}}export{y as startLickWsBridge};
@@ -1 +1 @@
1
- import{t as e}from"./logger-DDBAeTLF.js";import"./tray-leader-2nVEUays.js";import"./logger-BoSvu4mW.js";e(`lick-ws-bridge`);function t(e){let t=typeof e.verb==`string`?e.verb:null,n=typeof e.target==`string`?e.target:null,r=typeof e.url==`string`&&e.url.length>0?e.url:null;if(t!==`handoff`&&t!==`upskill`||!n||!r)return null;let i={url:r,verb:t,target:n};return typeof e.instruction==`string`&&(i.instruction=e.instruction),typeof e.branch==`string`&&(i.branch=e.branch),typeof e.path==`string`&&(i.path=e.path),typeof e.title==`string`&&(i.title=e.title),{type:`navigate`,navigateUrl:r,targetScoop:void 0,timestamp:typeof e.timestamp==`string`?e.timestamp:new Date().toISOString(),body:i}}function n(e){let t=typeof e.discoveryOrigin==`string`?e.discoveryOrigin:null,n=e.discoveryKind===`ai-catalog`||e.discoveryKind===`llms-txt`?e.discoveryKind:null,r=typeof e.discoveryUrl==`string`&&e.discoveryUrl.length>0?e.discoveryUrl:null;if(!t||!n||!r)return null;let i=typeof e.url==`string`?e.url:void 0;return{type:`discovery`,discoveryOrigin:t,discoveryKind:n,discoveryUrl:r,discoverySource:`live-navigation`,targetScoop:void 0,timestamp:typeof e.timestamp==`string`?e.timestamp:new Date().toISOString(),body:{origin:t,kind:n,url:r,...i?{pageUrl:i}:{}}}}export{n as mapDiscoveryPayloadToLickEvent,t as mapNavigatePayloadToLickEvent};
1
+ import{t as e}from"./logger-DDBAeTLF.js";import"./tray-leader-IzNrTl6C.js";import"./logger-BoSvu4mW.js";e(`lick-ws-bridge`);function t(e){let t=typeof e.verb==`string`?e.verb:null,n=typeof e.target==`string`?e.target:null,r=typeof e.url==`string`&&e.url.length>0?e.url:null;if(t!==`handoff`&&t!==`upskill`||!n||!r)return null;let i={url:r,verb:t,target:n};return typeof e.instruction==`string`&&(i.instruction=e.instruction),typeof e.branch==`string`&&(i.branch=e.branch),typeof e.path==`string`&&(i.path=e.path),typeof e.title==`string`&&(i.title=e.title),{type:`navigate`,navigateUrl:r,targetScoop:void 0,timestamp:typeof e.timestamp==`string`?e.timestamp:new Date().toISOString(),body:i}}function n(e){let t=typeof e.discoveryOrigin==`string`?e.discoveryOrigin:null,n=e.discoveryKind===`ai-catalog`||e.discoveryKind===`llms-txt`?e.discoveryKind:null,r=typeof e.discoveryUrl==`string`&&e.discoveryUrl.length>0?e.discoveryUrl:null;if(!t||!n||!r)return null;let i=typeof e.url==`string`?e.url:void 0;return{type:`discovery`,discoveryOrigin:t,discoveryKind:n,discoveryUrl:r,discoverySource:`live-navigation`,targetScoop:void 0,timestamp:typeof e.timestamp==`string`?e.timestamp:new Date().toISOString(),body:{origin:t,kind:n,url:r,...i?{pageUrl:i}:{}}}}export{n as mapDiscoveryPayloadToLickEvent,t as mapNavigatePayloadToLickEvent};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./logger-LESFN7Hj.js";import{i as n}from"./feature-flags-QlgHaQc1.js";import{t as r}from"./record-COQlaFL1.js";import{n as i,o as a,r as o,u as s}from"./descriptor-CKLcFFX3.js";import{n as c,t as l}from"./thinking-level-5x0UAu9N.js";import{t as u}from"./types-D8gIX-W-.js";import{a as d,r as f}from"./memory-budget-CFfevxz_.js";import{f as ee,i as p,o as te}from"./kernel-worker-B8dQ6oD2.js";import{t as m}from"./MEMORY-B9cGngY_.js";import{a as ne,i as re,n as h,o as g,r as _,t as ie}from"./instruction-frontmatter-B48EsYtA.js";import{l as v,n as ae,p as y,r as oe,u as se}from"./frozen-archive-writer-BoBWoTrh.js";function b(e){let t=0;for(let n of e)n.timestamp>t&&(t=n.timestamp);return t}function x(e,t){return t>0?e.filter(e=>e.timestamp>t):[...e]}const S=t(`agentic-memory`),ce=e=>[e.memoryPath],le=e=>[`/sessions/`,`/shared/`,...a(e)],ue=`awk.cat.cp.cut.date.diff.du.echo.file.find.grep.head.jq.ls.mkdir.mount.mv.nl.od.printf.readlink.rg.sed.sort.stat.tail.touch.tr.uniq.uname.upskill.wc.xxd`.split(`.`),de={arrayKeys:new Set([`writablePaths`,`visiblePaths`,`allowedCommands`]),scalarKeys:new Set([`model`,`timeoutSeconds`,`dreamTimeoutSeconds`,`thinkingLevel`])},C=3e4;function w(e){return e===`cone`?`memory-curator`:`memory-curator-${e}`}const T={kind:`curate`,nameFor:w,rivalsFor:e=>[D(e)]},E=`{{TASK}}`;function fe(e,t,n){return e.kind===`dream`?`**Consolidation pass** (the nightly dreaming): there is NO new session to mine — skip "Mining the session archive" entirely. Your whole job is to make the existing memory better: consolidated, current, and inside its budget. If the file is missing or empty, reply with one line saying so and stop; never invent memories. The run is hard-stopped after ${n} minutes; a run stopped at that bound lands whatever the memory file holds at that moment (every memory_write leaves a whole, budget-checked file), so consolidate section by section, writing as you go, and finish cleanly when you can.`:`**Curation pass**: mine the archived session at ${t} for what is worth carrying into future sessions, fold it into the memory, and consolidate the whole file in the same pass. Work fast: a pass should finish in well under 10 minutes and is hard-stopped after ${n} minutes — mine the three signals, write, and stop, rather than exploring the archive exhaustively.`}async function pe(e){try{await e.stat(f);return}catch{}try{await e.mkdir(`/etc`,{recursive:!0}),await e.writeFile(f,m),S.info(`Seeded default ${f}`)}catch(e){S.warn(`Failed to seed ${f}`,{error:I(e)})}}function D(e){return e===`cone`?`memory-dreamer`:`memory-dreamer-${e}`}function O(e,t){let n=e.nameFor(t);return k.test(n)?n:e.nameFor(r)}function me(e,t){let n=k.test(e.nameFor(t))?t:r;return e.rivalsFor?.(n)??[]}const k=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;function A(e,t){return`/scoops/agent-${O(e,t)}`}function he(e){return A(T,e)}const j=he(r);function ge(e){return s({parentJid:null,folder:e?.folder??`cone`})}function _e(e,t){if(t.root===i.root)return e;if(e===i.memoryPath)return t.memoryPath;if(e===`/workspace/skills`||e.startsWith(`/workspace/skills/`))return e;let n=`${i.root}/`;return e===i.root?t.root:e.startsWith(n)?`${t.root}/${e.slice(n.length)}`:e}function ve(e,t){let n=`${o}/`,r=e=>e.some(e=>n.startsWith(e.endsWith(`/`)?e:`${e}/`)),i=e.map(e=>_e(e,t));return r(e)&&!r(i)&&i.push(n),i}async function ye(e){try{if(e.signal?.aborted)return{ok:!1,reason:`aborted`,legacyFallbackSafe:!1};let t=e.instructions??T,n=ge(e.cone),r=A(t,e.cone?.folder??`cone`),i=await be(e.vfs,n),a=t.kind===`dream`?i.dreamTimeoutSeconds:i.timeoutSeconds,o=F(e.sessionArchivePath);try{await we(e.vfs,n.memoryPath,e.sessionArchivePath)}catch(e){return{ok:!1,reason:`snapshot: ${I(e)}`,legacyFallbackSafe:!0}}let s=t.kind===`dream`?`(no session archive this pass)`:e.sessionArchivePath,c=Math.max(1,Math.round(a/60)),l=fe(t,s,c),u=Ee(i,a,De(Oe(i.promptTemplate.includes(E)?i.promptTemplate:`${i.promptTemplate.trimEnd()}\n\n${E}`,{MEMORY_PATH:o,SESSION_ARCHIVE_PATH:s,SESSION_COUNT:String(e.sessionCount),BUDGET_CHARS:String(d(e.sessionCount)),SCRATCH_DIR:r,VISIBLE_PATHS:i.visiblePaths.join(`, `),TODAY:e.today??new Date().toISOString().slice(0,10),TIMEOUT_MINUTES:String(c),TASK:l}),r),e.sessionArchivePath,n,e.cone,t);e.signal&&(u.signal=e.signal);let f=await ke(Promise.resolve().then(()=>e.spawn(u)),a*1e3+C,e.signal);if(f.type===`timeout`)return S.warn(`Agentic memory wait timed out past the in-run bound + grace`,{timeoutSeconds:a,graceMs:C}),{ok:!1,reason:`timeout`,legacyFallbackSafe:!1};if(f.type===`aborted`)return{ok:!1,reason:`aborted`,legacyFallbackSafe:!1};if(f.type===`error`)return{ok:!1,reason:I(f.error),legacyFallbackSafe:!0};if(f.result.exitCode!==0){let e=(f.result.finalText??``).startsWith(ee);return{ok:!1,reason:f.result.finalText||`exit-${f.result.exitCode}`,legacyFallbackSafe:!e}}return{ok:!0,report:f.result.finalText}}catch(e){return S.warn(`Agentic memory pass failed`,{error:I(e)}),{ok:!1,reason:I(e),legacyFallbackSafe:!1}}}async function be(e,t=i){try{let n=await e.readFile(f,{encoding:`utf-8`});return xe(typeof n==`string`?n:new TextDecoder().decode(n),t)}catch(e){return S.warn(`Could not load valid ${f}; using built-in default`,{error:I(e)}),xe(m,t)}}function xe(e,t=i){let n=ne(e,`MEMORY.md`),r=ie(n.frontmatter,de),a=h(r,`writablePaths`,ce(t));if(a.length===0)throw Error(`writablePaths must not be empty`);g(a,`writablePaths`);let o=h(r,`visiblePaths`,le(t));g(o,`visiblePaths`);let s=_(r.timeoutSeconds,600,1200),c=_(r.dreamTimeoutSeconds,3600,7200,`dreamTimeoutSeconds`),l=re(r.model,`model`);return{writablePaths:a.map(e=>_e(e,t)),visiblePaths:ve(o,t),allowedCommands:[...new Set([...ue,...h(r,`allowedCommands`,[])])],...l?{model:l}:{},thinkingLevel:Se(r.thinkingLevel),timeoutSeconds:s,dreamTimeoutSeconds:c,promptTemplate:n.body}}function Se(e){if(e===void 0)return`medium`;if(typeof e!=`string`||!c(e))throw Error(`thinkingLevel must be one of ${l.join(`, `)}`);return e}function M(e){return`/sessions/.curated/${e.slice(e.lastIndexOf(`/`)+1)}`}function N(e){return`/sessions/.curation/${e.slice(e.lastIndexOf(`/`)+1)}`}function P(e){return`${N(e)}/base.md`}function F(e){return`${N(e)}/draft.md`}function Ce(e){return`${N(e)}/status.json`}async function we(e,t,n){let r=``;try{let n=await e.readFile(t,{encoding:`utf-8`});r=typeof n==`string`?n:new TextDecoder().decode(n)}catch{}await e.mkdir(N(n),{recursive:!0}),await e.writeFile(P(n),r),await e.writeFile(F(n),r)}function Te(e,t,n){let r=e.map(e=>e===t?n:e);return r.includes(n)?r:[...r,n]}function Ee(e,t,n,r,i,a,o){let s=e.model===`parent`||e.model===`cone`,c=P(r),l=F(r);return{cwd:i.root,writablePaths:Te(e.writablePaths,i.memoryPath,l),visiblePaths:[...e.visiblePaths,`${N(r)}/`],allowedCommands:e.allowedCommands,prompt:n,thinkingLevel:e.thinkingLevel,persistSession:!0,name:O(o,a?.folder??`cone`),exclusiveWith:me(o,a?.folder??`cone`),...a?.jid?{parentJid:a.jid}:{},notifyOnComplete:!0,successReceiptPath:M(r),mergeOnSuccess:{targetPath:i.memoryPath,basePath:c,draftPath:l},outcomeReceiptPath:Ce(r),maxWallClockMs:t*1e3,...!s&&e.model?{modelId:e.model}:{}}}function De(e,t){if(t===j)return e;let n=`\0SCRATCH\0`;return e.replaceAll(t,n).replaceAll(j,t).replaceAll(n,t)}function Oe(e,t){let n=e;for(let[e,r]of Object.entries(t))n=n.replaceAll(`{{${e}}}`,r);return n}function ke(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 I(e){return e instanceof Error?e.message:String(e)}var Ae=e({DEFAULT_DELTA_LIMITS:()=>B,LIVE_DELTA_DIR:()=>z,LIVE_DELTA_MAX_CHARS:()=>R,LIVE_DELTA_MAX_MESSAGES:()=>200,advanceCuratedThrough:()=>q,curateLiveSessionDelta:()=>K,liveDeltaArchivePath:()=>W,liveDeltaCurationEnabled:()=>U,scheduleLiveDeltaCuration:()=>je,takeDeltaSlice:()=>G});const L=t(`live-session-curation`),R=8e4,z=`/sessions/.live-deltas`,B={maxMessages:200,maxChars:R},V=new Map,H=new Map;function U(){return n(`memory-v2`)&&n(`agentic-memory`)}function W(e,t,n){return`${z}/${e}-${t}-${n}.md`}function G(e,t=B){if(e.length===0)return[];let n=[],r=0;for(let i of e){let e=Ve(i);if(n.length>=t.maxMessages||n.length>0&&r+e>t.maxChars)break;n.push(i),r+=e}n.length===0&&n.push(e[0]);let i=n[n.length-1].timestamp,a=n.length;for(;a<e.length&&e[a].timestamp===i;)n.push(e[a]),a+=1;return n}function je(e){if(!U())return Promise.resolve({status:`skipped`,reason:`flag-off`});let t=e.cone.folder||`cone`,n={...e.cone,folder:t},r=Be();if(!r)return L.info(`Live delta curation skipped: agent bridge not published`,{cone:t}),Promise.resolve({status:`skipped`,reason:`no-bridge`});let i={...e,cone:n},a=V.get(t);return a==null?J(i,r):(H.set(t,i),a)}function K(e){let t=e.cone.folder||`cone`,n={...e.cone,folder:t},r={...e,cone:n};if(e.hold===`held`)return Me(r);let i=V.get(t);return i==null?Y(t,Me(r)):i.then(()=>K(r))}async function q(e,t,n){n>0&&await se(async()=>{let r=await v(Z(e)),i=r.findIndex(e=>e.filename===t);if(i===-1||n<=(r[i].curatedThrough??0))return;let{memoryFailed:a,...o}=r[i],s=r.slice();s[i]={...o,curatedThrough:n},await y(Z(e),s),await Ie(e,`${p}/${t}`,n),await e.flush?.()})}function J(e,t){return Y(e.cone.folder||`cone`,K({vfs:e.vfs,cone:e.cone,spawn:e=>t.spawn(e),enabled:!0,hold:`held`,...e.limits?{limits:e.limits}:{}}))}function Y(e,t){return V.set(e,t),t.then(()=>X(e,t),()=>X(e,t)),t}function X(e,t){if(V.get(e)!==t)return;V.delete(e);let n=H.get(e);if(H.delete(e),!n||!U())return;let r=Be();r&&J(n,r).catch(t=>{L.warn(`Follow-up live delta curation failed to start`,{cone:e,error:Q(t)})})}async function Me(e){if(!(e.enabled??U()))return{status:`skipped`,reason:`flag-off`};let t=e.cone.folder||`cone`,n=e.limits??B,r;try{r=await v(Z(e.vfs))}catch(e){return L.warn(`Live delta curation skipped: sessions index unreadable`,{cone:t,error:Q(e)}),{status:`skipped`,reason:`index-unreadable`}}let i=ae(r,t);if(!i?.sessionId)return{status:`skipped`,reason:`no-archive`};let a=await Le(e.vfs,`${p}/${i.filename}`);if(!a)return{status:`skipped`,reason:`no-archive`};let o=await Ne(e.vfs,i.sessionId,i.filename,a,i.curatedThrough??0,n),s=x(a,o);if(s.length===0)return{status:`skipped`,reason:`caught-up`};let c=G(s,n),l=b(c);if(l<=o)return{status:`skipped`,reason:`caught-up`};let u=W(i.sessionId,o,l);await Pe(e.vfs,{sessionId:i.sessionId,filename:i.filename,title:i.title,frozenAt:i.frozenAt,cone:i.cone,coneLabel:i.coneLabel},c,u);let d=await ye({spawn:e.spawn,vfs:e.vfs,sessionArchivePath:u,sessionCount:r.length,...t!==`cone`||e.cone.jid?{cone:e.cone}:{},...e.signal?{signal:e.signal}:{}});return d.ok?(await q(e.vfs,i.filename,l),L.info(`Live delta curated`,{cone:t,filename:i.filename,through:l}),{status:`curated`,curatedThrough:l,filename:i.filename}):(d.reason.startsWith(`agent: name already in use`)||await Fe(e.vfs,i.filename,d.reason),L.warn(`Live delta curation failed`,{cone:t,filename:i.filename,reason:d.reason}),{status:`failed`,reason:d.reason,filename:i.filename})}async function Ne(e,t,n,r,i,a){let o=i;for(let n=0;n<50;n+=1){let n=x(r,o);if(n.length===0)break;let i=b(G(n,a??B));if(i<=o||!await Re(e,W(t,o,i)))break;o=i}return o>i&&await q(e,n,o),o}async function Pe(e,t,n,r){let i={id:t.sessionId,sessionId:t.sessionId,title:t.title,frozenAt:t.frozenAt,createdAt:n[0]?.timestamp??0,updatedAt:b(n),messageCount:n.length,messages:[...n],...t.cone?{cone:t.cone}:{},...t.coneLabel?{coneLabel:t.coneLabel}:{}};await e.mkdir(z,{recursive:!0}),await e.writeFile(r,oe(i))}async function Fe(e,t,n){try{await se(async()=>{let r=await v(Z(e)),i=r.findIndex(e=>e.filename===t);if(i===-1)return;let a=r.slice();a[i]={...r[i],memoryFailed:n.slice(0,300)},await y(Z(e),a),await e.flush?.()})}catch(e){L.warn(`Failed to record live curation failure`,{filename:t,error:Q(e)})}}async function Ie(e,t,n){let r;try{r=await ze(e,t)}catch(e){if($(e))return;throw e}let i=r.match(/^---\n([\s\S]*?)\n---\n/);if(!i)return;let a=`curatedThrough: ${n}`,o=/^curatedThrough:\s*\d+\s*$/m.test(i[1])?i[1].replace(/^curatedThrough:\s*\d+\s*$/m,a):`${i[1]}\n${a}`;o!==i[1]&&await e.writeFile(t,`---\n${o}\n---\n${r.slice(i[0].length)}`)}async function Le(e,t){try{return te(await ze(e,t)).messages}catch(e){if($(e))return null;throw e}}async function Re(e,t){try{return await e.readFile(M(t),{encoding:`utf-8`}),!0}catch(e){if($(e))return!1;throw e}}async function ze(e,t){let n=await e.readFile(t,{encoding:`utf-8`});return typeof n==`string`?n:new TextDecoder().decode(n)}function Be(){return globalThis.__slicc_agent}function Ve(e){let t=e.toolCalls?JSON.stringify(e.toolCalls).length:0;return e.content.length+t}function Z(e){return e}function Q(e){return e instanceof Error?e.message:String(e)}function $(e){return e instanceof u?e.code===`ENOENT`:typeof e!=`object`||!e||!(`code`in e)?!1:e.code===`ENOENT`}export{D as a,w as i,U as n,ye as o,Ae as r,pe as s,K as t};
1
+ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./logger-LESFN7Hj.js";import{i as n}from"./feature-flags-QlgHaQc1.js";import{t as r}from"./record-COQlaFL1.js";import{n as i,o as a,r as o,u as s}from"./descriptor-CKLcFFX3.js";import{n as c,t as l}from"./thinking-level-5x0UAu9N.js";import{t as u}from"./types-D8gIX-W-.js";import{a as d,r as f}from"./memory-budget-CFfevxz_.js";import{f as ee,i as p,o as te}from"./kernel-worker-yDR9ykP9.js";import{t as m}from"./MEMORY-B9cGngY_.js";import{a as ne,i as re,n as h,o as g,r as _,t as ie}from"./instruction-frontmatter-B48EsYtA.js";import{l as v,n as ae,p as y,r as oe,u as se}from"./frozen-archive-writer-CBS7YWrT.js";function b(e){let t=0;for(let n of e)n.timestamp>t&&(t=n.timestamp);return t}function x(e,t){return t>0?e.filter(e=>e.timestamp>t):[...e]}const S=t(`agentic-memory`),ce=e=>[e.memoryPath],le=e=>[`/sessions/`,`/shared/`,...a(e)],ue=`awk.cat.cp.cut.date.diff.du.echo.file.find.grep.head.jq.ls.mkdir.mount.mv.nl.od.printf.readlink.rg.sed.sort.stat.tail.touch.tr.uniq.uname.upskill.wc.xxd`.split(`.`),de={arrayKeys:new Set([`writablePaths`,`visiblePaths`,`allowedCommands`]),scalarKeys:new Set([`model`,`timeoutSeconds`,`dreamTimeoutSeconds`,`thinkingLevel`])},C=3e4;function w(e){return e===`cone`?`memory-curator`:`memory-curator-${e}`}const T={kind:`curate`,nameFor:w,rivalsFor:e=>[D(e)]},E=`{{TASK}}`;function fe(e,t,n){return e.kind===`dream`?`**Consolidation pass** (the nightly dreaming): there is NO new session to mine — skip "Mining the session archive" entirely. Your whole job is to make the existing memory better: consolidated, current, and inside its budget. If the file is missing or empty, reply with one line saying so and stop; never invent memories. The run is hard-stopped after ${n} minutes; a run stopped at that bound lands whatever the memory file holds at that moment (every memory_write leaves a whole, budget-checked file), so consolidate section by section, writing as you go, and finish cleanly when you can.`:`**Curation pass**: mine the archived session at ${t} for what is worth carrying into future sessions, fold it into the memory, and consolidate the whole file in the same pass. Work fast: a pass should finish in well under 10 minutes and is hard-stopped after ${n} minutes — mine the three signals, write, and stop, rather than exploring the archive exhaustively.`}async function pe(e){try{await e.stat(f);return}catch{}try{await e.mkdir(`/etc`,{recursive:!0}),await e.writeFile(f,m),S.info(`Seeded default ${f}`)}catch(e){S.warn(`Failed to seed ${f}`,{error:I(e)})}}function D(e){return e===`cone`?`memory-dreamer`:`memory-dreamer-${e}`}function O(e,t){let n=e.nameFor(t);return k.test(n)?n:e.nameFor(r)}function me(e,t){let n=k.test(e.nameFor(t))?t:r;return e.rivalsFor?.(n)??[]}const k=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;function A(e,t){return`/scoops/agent-${O(e,t)}`}function he(e){return A(T,e)}const j=he(r);function ge(e){return s({parentJid:null,folder:e?.folder??`cone`})}function _e(e,t){if(t.root===i.root)return e;if(e===i.memoryPath)return t.memoryPath;if(e===`/workspace/skills`||e.startsWith(`/workspace/skills/`))return e;let n=`${i.root}/`;return e===i.root?t.root:e.startsWith(n)?`${t.root}/${e.slice(n.length)}`:e}function ve(e,t){let n=`${o}/`,r=e=>e.some(e=>n.startsWith(e.endsWith(`/`)?e:`${e}/`)),i=e.map(e=>_e(e,t));return r(e)&&!r(i)&&i.push(n),i}async function ye(e){try{if(e.signal?.aborted)return{ok:!1,reason:`aborted`,legacyFallbackSafe:!1};let t=e.instructions??T,n=ge(e.cone),r=A(t,e.cone?.folder??`cone`),i=await be(e.vfs,n),a=t.kind===`dream`?i.dreamTimeoutSeconds:i.timeoutSeconds,o=F(e.sessionArchivePath);try{await we(e.vfs,n.memoryPath,e.sessionArchivePath)}catch(e){return{ok:!1,reason:`snapshot: ${I(e)}`,legacyFallbackSafe:!0}}let s=t.kind===`dream`?`(no session archive this pass)`:e.sessionArchivePath,c=Math.max(1,Math.round(a/60)),l=fe(t,s,c),u=Ee(i,a,De(Oe(i.promptTemplate.includes(E)?i.promptTemplate:`${i.promptTemplate.trimEnd()}\n\n${E}`,{MEMORY_PATH:o,SESSION_ARCHIVE_PATH:s,SESSION_COUNT:String(e.sessionCount),BUDGET_CHARS:String(d(e.sessionCount)),SCRATCH_DIR:r,VISIBLE_PATHS:i.visiblePaths.join(`, `),TODAY:e.today??new Date().toISOString().slice(0,10),TIMEOUT_MINUTES:String(c),TASK:l}),r),e.sessionArchivePath,n,e.cone,t);e.signal&&(u.signal=e.signal);let f=await ke(Promise.resolve().then(()=>e.spawn(u)),a*1e3+C,e.signal);if(f.type===`timeout`)return S.warn(`Agentic memory wait timed out past the in-run bound + grace`,{timeoutSeconds:a,graceMs:C}),{ok:!1,reason:`timeout`,legacyFallbackSafe:!1};if(f.type===`aborted`)return{ok:!1,reason:`aborted`,legacyFallbackSafe:!1};if(f.type===`error`)return{ok:!1,reason:I(f.error),legacyFallbackSafe:!0};if(f.result.exitCode!==0){let e=(f.result.finalText??``).startsWith(ee);return{ok:!1,reason:f.result.finalText||`exit-${f.result.exitCode}`,legacyFallbackSafe:!e}}return{ok:!0,report:f.result.finalText}}catch(e){return S.warn(`Agentic memory pass failed`,{error:I(e)}),{ok:!1,reason:I(e),legacyFallbackSafe:!1}}}async function be(e,t=i){try{let n=await e.readFile(f,{encoding:`utf-8`});return xe(typeof n==`string`?n:new TextDecoder().decode(n),t)}catch(e){return S.warn(`Could not load valid ${f}; using built-in default`,{error:I(e)}),xe(m,t)}}function xe(e,t=i){let n=ne(e,`MEMORY.md`),r=ie(n.frontmatter,de),a=h(r,`writablePaths`,ce(t));if(a.length===0)throw Error(`writablePaths must not be empty`);g(a,`writablePaths`);let o=h(r,`visiblePaths`,le(t));g(o,`visiblePaths`);let s=_(r.timeoutSeconds,600,1200),c=_(r.dreamTimeoutSeconds,3600,7200,`dreamTimeoutSeconds`),l=re(r.model,`model`);return{writablePaths:a.map(e=>_e(e,t)),visiblePaths:ve(o,t),allowedCommands:[...new Set([...ue,...h(r,`allowedCommands`,[])])],...l?{model:l}:{},thinkingLevel:Se(r.thinkingLevel),timeoutSeconds:s,dreamTimeoutSeconds:c,promptTemplate:n.body}}function Se(e){if(e===void 0)return`medium`;if(typeof e!=`string`||!c(e))throw Error(`thinkingLevel must be one of ${l.join(`, `)}`);return e}function M(e){return`/sessions/.curated/${e.slice(e.lastIndexOf(`/`)+1)}`}function N(e){return`/sessions/.curation/${e.slice(e.lastIndexOf(`/`)+1)}`}function P(e){return`${N(e)}/base.md`}function F(e){return`${N(e)}/draft.md`}function Ce(e){return`${N(e)}/status.json`}async function we(e,t,n){let r=``;try{let n=await e.readFile(t,{encoding:`utf-8`});r=typeof n==`string`?n:new TextDecoder().decode(n)}catch{}await e.mkdir(N(n),{recursive:!0}),await e.writeFile(P(n),r),await e.writeFile(F(n),r)}function Te(e,t,n){let r=e.map(e=>e===t?n:e);return r.includes(n)?r:[...r,n]}function Ee(e,t,n,r,i,a,o){let s=e.model===`parent`||e.model===`cone`,c=P(r),l=F(r);return{cwd:i.root,writablePaths:Te(e.writablePaths,i.memoryPath,l),visiblePaths:[...e.visiblePaths,`${N(r)}/`],allowedCommands:e.allowedCommands,prompt:n,thinkingLevel:e.thinkingLevel,persistSession:!0,name:O(o,a?.folder??`cone`),exclusiveWith:me(o,a?.folder??`cone`),...a?.jid?{parentJid:a.jid}:{},notifyOnComplete:!0,successReceiptPath:M(r),mergeOnSuccess:{targetPath:i.memoryPath,basePath:c,draftPath:l},outcomeReceiptPath:Ce(r),maxWallClockMs:t*1e3,...!s&&e.model?{modelId:e.model}:{}}}function De(e,t){if(t===j)return e;let n=`\0SCRATCH\0`;return e.replaceAll(t,n).replaceAll(j,t).replaceAll(n,t)}function Oe(e,t){let n=e;for(let[e,r]of Object.entries(t))n=n.replaceAll(`{{${e}}}`,r);return n}function ke(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 I(e){return e instanceof Error?e.message:String(e)}var Ae=e({DEFAULT_DELTA_LIMITS:()=>B,LIVE_DELTA_DIR:()=>z,LIVE_DELTA_MAX_CHARS:()=>R,LIVE_DELTA_MAX_MESSAGES:()=>200,advanceCuratedThrough:()=>q,curateLiveSessionDelta:()=>K,liveDeltaArchivePath:()=>W,liveDeltaCurationEnabled:()=>U,scheduleLiveDeltaCuration:()=>je,takeDeltaSlice:()=>G});const L=t(`live-session-curation`),R=8e4,z=`/sessions/.live-deltas`,B={maxMessages:200,maxChars:R},V=new Map,H=new Map;function U(){return n(`memory-v2`)&&n(`agentic-memory`)}function W(e,t,n){return`${z}/${e}-${t}-${n}.md`}function G(e,t=B){if(e.length===0)return[];let n=[],r=0;for(let i of e){let e=Ve(i);if(n.length>=t.maxMessages||n.length>0&&r+e>t.maxChars)break;n.push(i),r+=e}n.length===0&&n.push(e[0]);let i=n[n.length-1].timestamp,a=n.length;for(;a<e.length&&e[a].timestamp===i;)n.push(e[a]),a+=1;return n}function je(e){if(!U())return Promise.resolve({status:`skipped`,reason:`flag-off`});let t=e.cone.folder||`cone`,n={...e.cone,folder:t},r=Be();if(!r)return L.info(`Live delta curation skipped: agent bridge not published`,{cone:t}),Promise.resolve({status:`skipped`,reason:`no-bridge`});let i={...e,cone:n},a=V.get(t);return a==null?J(i,r):(H.set(t,i),a)}function K(e){let t=e.cone.folder||`cone`,n={...e.cone,folder:t},r={...e,cone:n};if(e.hold===`held`)return Me(r);let i=V.get(t);return i==null?Y(t,Me(r)):i.then(()=>K(r))}async function q(e,t,n){n>0&&await se(async()=>{let r=await v(Z(e)),i=r.findIndex(e=>e.filename===t);if(i===-1||n<=(r[i].curatedThrough??0))return;let{memoryFailed:a,...o}=r[i],s=r.slice();s[i]={...o,curatedThrough:n},await y(Z(e),s),await Ie(e,`${p}/${t}`,n),await e.flush?.()})}function J(e,t){return Y(e.cone.folder||`cone`,K({vfs:e.vfs,cone:e.cone,spawn:e=>t.spawn(e),enabled:!0,hold:`held`,...e.limits?{limits:e.limits}:{}}))}function Y(e,t){return V.set(e,t),t.then(()=>X(e,t),()=>X(e,t)),t}function X(e,t){if(V.get(e)!==t)return;V.delete(e);let n=H.get(e);if(H.delete(e),!n||!U())return;let r=Be();r&&J(n,r).catch(t=>{L.warn(`Follow-up live delta curation failed to start`,{cone:e,error:Q(t)})})}async function Me(e){if(!(e.enabled??U()))return{status:`skipped`,reason:`flag-off`};let t=e.cone.folder||`cone`,n=e.limits??B,r;try{r=await v(Z(e.vfs))}catch(e){return L.warn(`Live delta curation skipped: sessions index unreadable`,{cone:t,error:Q(e)}),{status:`skipped`,reason:`index-unreadable`}}let i=ae(r,t);if(!i?.sessionId)return{status:`skipped`,reason:`no-archive`};let a=await Le(e.vfs,`${p}/${i.filename}`);if(!a)return{status:`skipped`,reason:`no-archive`};let o=await Ne(e.vfs,i.sessionId,i.filename,a,i.curatedThrough??0,n),s=x(a,o);if(s.length===0)return{status:`skipped`,reason:`caught-up`};let c=G(s,n),l=b(c);if(l<=o)return{status:`skipped`,reason:`caught-up`};let u=W(i.sessionId,o,l);await Pe(e.vfs,{sessionId:i.sessionId,filename:i.filename,title:i.title,frozenAt:i.frozenAt,cone:i.cone,coneLabel:i.coneLabel},c,u);let d=await ye({spawn:e.spawn,vfs:e.vfs,sessionArchivePath:u,sessionCount:r.length,...t!==`cone`||e.cone.jid?{cone:e.cone}:{},...e.signal?{signal:e.signal}:{}});return d.ok?(await q(e.vfs,i.filename,l),L.info(`Live delta curated`,{cone:t,filename:i.filename,through:l}),{status:`curated`,curatedThrough:l,filename:i.filename}):(d.reason.startsWith(`agent: name already in use`)||await Fe(e.vfs,i.filename,d.reason),L.warn(`Live delta curation failed`,{cone:t,filename:i.filename,reason:d.reason}),{status:`failed`,reason:d.reason,filename:i.filename})}async function Ne(e,t,n,r,i,a){let o=i;for(let n=0;n<50;n+=1){let n=x(r,o);if(n.length===0)break;let i=b(G(n,a??B));if(i<=o||!await Re(e,W(t,o,i)))break;o=i}return o>i&&await q(e,n,o),o}async function Pe(e,t,n,r){let i={id:t.sessionId,sessionId:t.sessionId,title:t.title,frozenAt:t.frozenAt,createdAt:n[0]?.timestamp??0,updatedAt:b(n),messageCount:n.length,messages:[...n],...t.cone?{cone:t.cone}:{},...t.coneLabel?{coneLabel:t.coneLabel}:{}};await e.mkdir(z,{recursive:!0}),await e.writeFile(r,oe(i))}async function Fe(e,t,n){try{await se(async()=>{let r=await v(Z(e)),i=r.findIndex(e=>e.filename===t);if(i===-1)return;let a=r.slice();a[i]={...r[i],memoryFailed:n.slice(0,300)},await y(Z(e),a),await e.flush?.()})}catch(e){L.warn(`Failed to record live curation failure`,{filename:t,error:Q(e)})}}async function Ie(e,t,n){let r;try{r=await ze(e,t)}catch(e){if($(e))return;throw e}let i=r.match(/^---\n([\s\S]*?)\n---\n/);if(!i)return;let a=`curatedThrough: ${n}`,o=/^curatedThrough:\s*\d+\s*$/m.test(i[1])?i[1].replace(/^curatedThrough:\s*\d+\s*$/m,a):`${i[1]}\n${a}`;o!==i[1]&&await e.writeFile(t,`---\n${o}\n---\n${r.slice(i[0].length)}`)}async function Le(e,t){try{return te(await ze(e,t)).messages}catch(e){if($(e))return null;throw e}}async function Re(e,t){try{return await e.readFile(M(t),{encoding:`utf-8`}),!0}catch(e){if($(e))return!1;throw e}}async function ze(e,t){let n=await e.readFile(t,{encoding:`utf-8`});return typeof n==`string`?n:new TextDecoder().decode(n)}function Be(){return globalThis.__slicc_agent}function Ve(e){let t=e.toolCalls?JSON.stringify(e.toolCalls).length:0;return e.content.length+t}function Z(e){return e}function Q(e){return e instanceof Error?e.message:String(e)}function $(e){return e instanceof u?e.code===`ENOENT`:typeof e!=`object`||!e||!(`code`in e)?!1:e.code===`ENOENT`}export{D as a,w as i,U as n,ye as o,Ae as r,pe as s,K as t};
@@ -0,0 +1,186 @@
1
+ import{t as e}from"./compat-BAGLwgqY.js";import{t}from"./logger-DDBAeTLF.js";import{Ct as n,Et as r,St as i,Tt as a,wt as o,xt as s}from"./wc-shell-BBeNiS8R.js";import{n as c}from"./utf16-clip-CGL7omVm.js";import"./feature-flags-DvsApnS-.js";import"./account-store-BZBj_ntG.js";import{c as l,m as u,n as d,o as f,p}from"./frozen-archive-writer-BhgsVjoX.js";import{t as m}from"./types-D8gIX-W-.js";import{t as h}from"./record-CBv8rWFt.js";import{i as ee,n as g,s as te,t as _}from"./descriptor-CuhPBdq8.js";import{n as ne,t as re}from"./thinking-level-DCJktR5U.js";var v=`---
2
+ writablePaths:
3
+ - /workspace/CLAUDE.md
4
+ - /shared/wiki/
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 and /sessions/index.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 pass actually uses over find|xargs grep. Exit 1 = no match (\`-c\` prints nothing, not \`0\`); exit 2 = searchable-byte limit (stderr names the budget). Later commands still run.
26
+ - sed
27
+ - sort
28
+ - tail
29
+ - tr
30
+ - uniq
31
+ - uname # \`uname -r\` prints the running SLICC version; pin runtime claims to it rather than to a version named in the (possibly stale) snapshot
32
+ - upskill
33
+ - wc
34
+ timeoutSeconds: 1200
35
+ dreamTimeoutSeconds: 3600
36
+ thinkingLevel: medium
37
+ ---
38
+
39
+ # Memory pass
40
+
41
+ You maintain one cone's durable memory: the file at {{MEMORY_PATH}}. Today's date is {{TODAY}}; {{SESSION_COUNT}} sessions are archived. The whole file has a hard budget of {{BUDGET_CHARS}} characters, with no exempt region.
42
+
43
+ ## This pass
44
+
45
+ {{TASK}}
46
+
47
+ Read the entire current memory at {{MEMORY_PATH}} first. Every part of the file is editable and counts toward the budget.
48
+
49
+ You can read only {{VISIBLE_PATHS}} (plus your scratch folder). Everything else — \`/etc/\`, \`/cones/\`, another unit's folder — is **outside your visiblePaths**: a read there answers \`No such file or directory\` or a listing with the entry missing, and either answer means _unknown_, never _absent_. The runtime appends a \`[not visible from this pass]\` note to any command that probed such a path. Never record an invisible path, or what it holds, as missing, changed or wrong, and never refute a stored claim on that basis — \`memory_write\` refuses the line. Leave the claim standing and name the pair in your closing report.
50
+
51
+ ## Mining the session archive (curation passes only)
52
+
53
+ Three things carry across sessions, and each has its own place in the archive:
54
+
55
+ | Look for | Where it lives |
56
+ | --------------- | ---------------------------------------------------------------------- |
57
+ | **Preferences** | the user's own messages — how they want things done, and what to avoid |
58
+ | **Projects** | tool-call arguments — the paths, repos and files actually worked on |
59
+ | **Pitfalls** | failed tool calls — what broke, and the error that proves it |
60
+
61
+ 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.
62
+
63
+ **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.
64
+
65
+ 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.
66
+
67
+ \`\`\`bash
68
+ wc -c {{SESSION_ARCHIVE_PATH}}
69
+
70
+ # Preferences — what the user asked for, in their words.
71
+ sed '/^<!-- slicc:session-data$/,/^-->$/d' {{SESSION_ARCHIVE_PATH}} \\
72
+ | awk '/^## User/{p=1;next} /^## (Assistant|Summary)/{p=0} /^### Tool/{p=0} p'
73
+
74
+ # Projects — the paths touched most, which name the work.
75
+ sed '/^<!-- slicc:session-data$/,/^-->$/d' {{SESSION_ARCHIVE_PATH}} \\
76
+ | grep -o '/[A-Za-z0-9_][A-Za-z0-9_./-]\\{3,\\}' \\
77
+ | sort | uniq -c | sort -rn | head -40
78
+
79
+ # Pitfalls — failed calls with the input that caused them.
80
+ sed '/^<!-- slicc:session-data$/,/^-->$/d' {{SESSION_ARCHIVE_PATH}} \\
81
+ | grep -B6 '^Result:.*\\(rror\\|not found\\|failed\\|denied\\|ENOENT\\|fatal\\)' \\
82
+ | cut -c1-200
83
+ \`\`\`
84
+
85
+ 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.
86
+
87
+ ### Suggesting a skill
88
+
89
+ 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:
90
+
91
+ \`\`\`bash
92
+ upskill search <a few words from the pitfall>
93
+ upskill list # what is already installed — never suggest a duplicate
94
+ \`\`\`
95
+
96
+ \`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.
97
+
98
+ ## Consolidating (every pass)
99
+
100
+ The file accumulates under time pressure; every pass leaves it better than it found it:
101
+
102
+ 1. **Merge duplicates.** Across weeks the same preference or project fact accumulates near-identical phrasings. Keep one — the most recent, most specific version.
103
+ 2. **Supersede contradictions.** When two lines contradict, the newer-dated one wins; rewrite in place so only one version stands — a claim and its correction must never survive together as prose. Resolve only with evidence you can actually read: a path outside your visiblePaths is evidence for neither side, and settling toward the copy you happen to see is exactly the error this rule exists to prevent. When the refuted claim is a trap worth remembering, record it under a \`## Not true\` section as \`- not: <refuted claim> — why: <evidence> — instead: <correction> (YYYY-MM-DD)\`. A fact contradicted by the session titles in the index (a project renamed, a tool replaced) goes too. Count contradictory claim pairs before and after the rewrite and put both numbers in the closing report; if the pass could not reduce the count, say so.
104
+ 3. **Retire stale ephemera.** An entry whose \`stale_after: YYYY-MM-DD\` date has passed is unverified — re-verify it against the index or drop it. Sections whose last-verified date is old AND whose subject no longer appears in recent session titles are candidates for deletion — check before deleting:
105
+
106
+ \`\`\`bash
107
+ # Recent activity, to test whether an old section still matters.
108
+ jq -r '.[] | "\\(.frozenAt[0:10]) \\(.cone // "cone") \\(.title)"' /sessions/index.json | tail -40
109
+ \`\`\`
110
+
111
+ 4. **Reorganize.** Fold orphan bullets into the per-topic section they belong to; split a section that has become two topics; order sections so the most-used topics lead. Every \`##\` and \`###\` heading keeps (or gains) its last-verified date in \`YYYY-MM-DD\` form.
112
+ 5. **Move knowledge to the wiki.** When the file is over budget and a section is reference knowledge — facts about a domain, a system, a person — rather than working preferences or pitfalls, move it to a page under \`/shared/wiki/\` following \`/shared/wiki/WIKI.md\` (update \`index.md\`, append an \`ingest\` entry to \`log.md\`), and replace the section with one line naming the page. Move at most a couple of sections per pass; the memory file must keep working standalone.
113
+ 6. **Land under budget.** The hard budget is {{BUDGET_CHARS}} characters for the whole file, no exempt region. When over budget, compact or remove the oldest-dated sections first.
114
+
115
+ A pass never adds facts that are not in the session archive, the file or the wiki, never installs anything, and never touches any file other than {{MEMORY_PATH}} and the wiki.
116
+
117
+ ## Entry grammar: provenance and supersession
118
+
119
+ Facts age. Write every entry so a later pass can tell whether it still holds:
120
+
121
+ - Prefix entries with their actor: \`human:\` for what the user said, \`process:\` for what you inferred from tool output. Example: \`- human: prefers rebase over merge (2026-09-11)\`.
122
+ - Version-pin claims that can rot: name the version, commit, or file the claim was verified against, e.g. \`- process: coverage floor is 83% (coverage-thresholds.json @ 6.146.2)\`. Runtime version comes from \`uname -r\`, not from a version named in this file. Never record a confidence score — what ages is the pin, not a probability.
123
+ - A claim with a known expiry carries \`stale_after: YYYY-MM-DD\`, an absolute date, never a duration. Past that date the claim counts as unverified.
124
+ - **Supersede, never append.** When a session proves a stored claim wrong, rewrite the claim in place — a claim and its correction must never both stand as prose (see step 2 above for the \`## Not true\` form).
125
+
126
+ ## Working within the budget
127
+
128
+ Measure, decide, then write. Do not converge on the budget by trial and error — each attempt re-reads your whole context and is billed accordingly.
129
+
130
+ 1. \`wc -c {{MEMORY_PATH}}\` to get the current size, and subtract {{BUDGET_CHARS}} to get the exact surplus. Per-section costs come out of \`awk\`: \`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.
131
+ 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.
132
+ 3. Write with the \`memory_write\` tool (\`path: {{MEMORY_PATH}}\`). It is the only tool that can write the memory file — \`write_file\`, \`edit\`, \`cp\` and \`cat >\` are refused on it — and it refuses any write that would leave the file over budget without shrinking it. Prefer \`edits\` (exact replacements, one section at a time): every write leaves a whole, budget-checked file, and a run stopped at its bound lands whatever the file holds at that moment, so finished sections are never lost; use \`content\` for a whole-file rewrite at most once, already inside the budget, and never draft the whole file elsewhere first — emitting it twice is what runs a pass out of time. 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.
133
+ 4. Read the size and the remaining room from the tool's result — it reports both, so do not spend a turn on \`wc -c\` afterwards. If it says you are still over, cut a whole section rather than shaving a few characters at a time.
134
+
135
+ Scratch for notes (not for drafting the whole file) is \`{{SCRATCH_DIR}}/\`: your own folder, writable without a grant and without an approval prompt, private to this pass, and deleted when the pass ends.
136
+
137
+ 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.
138
+
139
+ ## Rules
140
+
141
+ - Keep durable preferences, stable project facts, validated approaches, named resources, and the pitfalls worth not repeating.
142
+ - 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.
143
+ - Never write next to the memory file: backups and scratch copies beside it are noise. Do not draft in the shared \`/tmp/\` root either — every other unit can read and overwrite what you leave there.
144
+ - 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.
145
+ - 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.
146
+ - Re-stamp a heading with {{TODAY}} only when you wrote or actually re-verified its content this pass; otherwise keep its existing date. Treat undated headings as maximally stale and date them on this pass.
147
+ - Prioritize re-verifying the oldest-dated sections. Drop ephemera and duplicates; delete or merge sections that are stale, superseded, or unverifiable.
148
+ - Preserve concrete identifiers such as file paths, URLs, IDs, and names verbatim.
149
+ - A path outside your visiblePaths is unknown, not absent (see "This pass" above): never write it off as missing, never refute a claim about it, and report the unverifiable pair instead.
150
+ - Write the result to {{MEMORY_PATH}}; do not merely return it in your response.
151
+ - Close with a two-or-three-line report of what you kept, merged and dropped (plus any skill worth suggesting, and the contradiction-pair counts before and after) — that report is delivered to the cone.
152
+
153
+ <!-- How to customize
154
+ Add instructions here, for example: never drop sections mentioning a named project, or also consolidate a knowledge base at /path (extend visiblePaths or writablePaths above to grant access to extra stores). One document drives both passes: the per-session curation pass the freezer runs after a chat ends, and the nightly consolidation ("dreaming") pass the gelatiere starts with \`memory dream --all\` (\`memory dream\` runs one by hand). The runtime fills {{TASK}} with which pass this is; everything else in the document applies to both.
155
+
156
+ timeoutSeconds bounds a curation pass and dreamTimeoutSeconds a consolidation pass — the run is hard-stopped at the bound, and a rewrite only lands through the merge below, which is why the budget section asks for section-wise edits. The nightly has no time pressure, so its bound is generous; the curation pass runs while the user waits for memory to settle.
157
+
158
+ {{MEMORY_PATH}} resolves to a staged draft under /sessions/.curation/, not the live memory file: the pass snapshots the live file when it spawns, rewrites the draft, and on a successful exit the runtime three-way-merges the rewrite back onto the live file. Edits the cone or the user makes to the live memory while the pass runs survive; where both sides changed the same lines the pass's version wins. An entry in writablePaths naming the memory file is substituted with the draft automatically, so this file keeps working unchanged. A run stopped at its wall-clock bound has its draft merged as a truncated success (\`memory_write\` never leaves it half-written); any other failure leaves the live memory untouched. Either outcome is recorded at /sessions/.curation/<key>/status.json, and the cone's scoop-notify waits for that receipt so a non-zero exit is reported as failed (with the reason and status.json path) rather than completed. Writes under /shared/wiki/ are NOT staged — a wiki page lands immediately — which is safe because wiki moves are additive; the pointer line replacing the moved section only lands if the pass completes.
159
+
160
+ writablePaths defaults to the memory file plus the wiki rather than /workspace/, because the pass 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.
161
+
162
+ visiblePaths is the pass's whole world: a read outside it answers like a missing file (the shell's commands print "No such file or directory" for every error), so the runtime keeps a ledger of those blind reads, names them in a note on the command's result, and has memory_write refuse a line that records one as absent or refuted (slicc#3459). Add a root here — /etc/ for the policy files, say — when a task must verify facts there; that is the only way a pass can know what such a path holds.
163
+
164
+ Scratch space needs no entry here. Each pass spawns under a fixed per-cone name (memory-curator / memory-dreamer for the primary cone, -<folder> suffixed for extra cones), so the bridge grants it {{SCRATCH_DIR}} — private to the run, writable without a prompt, and removed when the pass ends. Parallel passes over DIFFERENT memory files never collide; two passes over the SAME file serialize. $TMPDIR is writable too and is this unit's own directory, but it outlives the run and stays readable by the cone, so durable memory does not belong there.
165
+
166
+ 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.
167
+
168
+ This file is user-edited only: the pass intentionally cannot rewrite its own instructions. A bare / is rejected in writablePaths. It is seeded only when absent, so edits survive later boots; \`upgrade\` three-way-merges a changed bundled version onto your edits.
169
+
170
+ 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/"].
171
+ -->
172
+ `,y=`/etc/MEMORY.md`,b=4e3,ie=2e3;function x(e){return Math.round(b+ie*Math.log2((Number.isFinite(e)&&e>=0?e:0)+2))}var ae=`abject.abortive.abrasive.absolute.abstruse.abundant.abyssal.accessible.acerbic.acrid.adamant.adept.adlerian.adornian.adroit.adventurous.aeolian.aerated.aesthetic.affable.aged.ageless.agile.airborne.airlocked.airy.akkadian.alabaster.alacritous.alert.alien.alloyed.allusive.aloof.alpha.alpine.alternate.altruistic.amaranthine.amber.ambidextrous.ambivalent.ambrosial.amiable.amorphous.ample.analog.analytical.ancestral.ancient.angelic.animated.animist.anomalous.antediluvian.antic.antlered.apollinairian.apollonian.apt.aquatic.arbitrary.arcadian.arcane.archaic.archimedean.ardent.arduous.arendtian.argent.argentine.argive.aristotelian.armstrongian.aromatic.arresting.artful.arthurian.articulate.artificial.artisanal.artless.ascetic.ashen.ashy.asimovian.aspiring.assiduous.assyrian.asteroidal.astral.astute.asynchronous.athenian.atlantean.atomic.attentive.attic.audacious.audenesque.augmented.august.augustan.aureate.auric.auroral.austenian.austere.austral.authentic.autonomous.autumnal.avalonian.avid.avuncular.aztec.azure.babbagean.babylonian.bacchic.bachian.bactrian.ballardian.ballistic.balmy.banksian.barefoot.barreled.barthesian.bartokian.bashy.baudelairean.bayesian.beatific.beckettesque.beckettian.beethovenian.beguiling.bellicose.bemused.benevolent.benign.benjaminian.bergmanesque.beta.bewitched.binary.bionic.bismarckian.bitter.bitwise.blackened.blakean.blameless.bland.blazar.blazing.blended.blessed.blissful.blistered.blithe.blooming.blunt.blustery.boeotian.boggy.bohrian.boingy.boisterous.bold.bolted.bombastic.bonny.boolean.boreal.borgesian.borgian.bosky.botticellian.bottled.bouncy.boundless.bountiful.bourbon.bradburyan.brahmsian.braised.brambly.brash.brave.brazen.bready.breathless.brechtian.breezy.briared.briery.bright.brilliant.brined.briny.brisk.bristling.briton.brittenesque.broadband.brontean.bronzed.brooding.browned.browningesque.brucknerian.brumal.brusque.bubbling.bubbly.bucolic.budding.bunuelian.buoyant.burnished.burnt.buttered.buttery.bygone.byronic.bytewise.byzantine.cacophonous.caesarean.callow.calm.candescent.candid.candied.canny.cantorian.capable.capricious.caramelized.caravaggesque.carbon.carefree.carolingian.cartesian.carved.casked.cast.cavafian.cavalier.celebrated.celestial.celtic.ceramic.cerebral.ceremonious.cerulean.cervantine.cezannesque.chagallian.chalky.chaplinesque.charcoal.charismatic.charmed.charming.charred.chaucerian.cheeky.cheerful.chekhovian.cherished.cherubic.chewy.chilled.chilly.chimerical.chipper.chirpy.chivalrous.chopinesque.chromospheric.chronal.chthonic.chubby.chunky.churchillian.cimmerian.cindered.circumspect.circumstellar.citrusy.civil.clandestine.clangy.clarified.clarkean.classic.clement.clever.cloaked.clockwork.clompy.cloned.cloudlike.cloudy.clunky.clustered.coastal.cobalt.cognitive.coherent.coleridgean.colossal.coltranesque.comely.cometary.compiled.complacent.composite.concurrent.conradian.constablean.convivial.copernican.copious.coplandesque.cordial.corinthian.corked.cornelian.coronal.cortical.cosmic.coy.cozy.cracked.crackling.crafty.cranky.crashy.creamy.credible.crepuscular.cretan.crimson.crisp.crispy.crowned.crumbly.crunchy.crushed.cryo.cryofrozen.cryogenic.cryonic.cryptic.crystalline.cuddly.cumulative.cunning.cupric.cured.curious.cursed.cursory.cushy.cybernetic.cyberpunk.cynical.cyprian.daliesque.dancy.dandy.dantean.dantesque.dapper.dappled.daring.dark.darwinian.dashing.dashy.dauntless.davisian.dawning.dazzling.deathless.debonair.deboned.debussyan.decanted.decompiled.decorous.decrypted.deep.deferential.deft.degasian.delectable.deleuzian.delian.deliberate.delicate.delirious.delphic.delta.demure.depressurized.derridean.destined.devout.dewy.dexterous.diaphanous.diced.dickensian.dickian.dickinsonian.didactic.dieselpunk.diffident.digital.dignified.diligent.dimensional.dinky.dionysian.discerning.discreet.disheveled.disparate.distant.distinct.distributed.diurnal.divine.dizzy.docile.docked.dogged.doomed.dorian.dormant.dostoevskian.dotty.doughty.doughy.downy.dozy.draconic.dreamful.dreamy.drifting.dripping.drizzly.droll.drowsy.druidic.dulcet.dun.dunky.durkheimian.dusky.dwarven.dynamic.dystopian.eager.earnest.earthy.eastward.easygoing.ebony.ebullient.eclectic.eclipsed.ecstatic.edenic.edwardian.effervescent.effulgent.effusive.einsteinian.elamite.elastic.elated.eldritch.electric.electronic.elegant.elegiac.elgarian.eliotian.eliotic.elizabethan.ellingtonian.eloquent.elusive.elven.elvish.elysian.embered.emergent.eminent.emphatic.emulsified.enchanted.encoded.encrypted.endearing.endless.endogenous.energetic.enhanced.enigmatic.enthralling.ephemeral.epic.epicurean.equanimous.errant.erudite.escherian.esoteric.esteemed.eternal.ethereal.ethiopian.etruscan.euclidean.eulerian.euphonious.euphoric.evanescent.evening.eventide.everlasting.evocative.exacting.exalted.exemplary.exo.exogenous.expansive.expressive.exquisite.extraterrestrial.extruded.exuberant.fabled.fabulous.facetious.faithful.fallow.fanciful.fantastic.faradayic.faraway.farmhouse.fastidious.fated.fateful.fathomless.faulknerian.faunal.fearless.feathered.feathery.fecund.federated.feisty.felicitous.felliniesque.fenny.fermented.ferny.ferrous.fervent.fervid.festive.fetching.fey.fickle.fierce.fiery.filleted.filtered.fitzgeraldian.fizzy.flaky.flamboyant.flamed.flashy.flawless.fleecy.fleet.fleeting.flexible.flickering.flinty.floral.florid.flouncy.flourishing.flowering.fluent.fluffy.fluid.fluvial.foamy.folded.fond.foraged.forged.formidable.forthright.fortuitous.forward.foucauldian.fourier.fractal.fragrant.frank.frankish.freckled.free.fresh.freudian.friedmanite.frisky.frizzy.frolicsome.frosted.frosty.frothy.frozen.frugal.fruiting.fruity.funky.furred.furtive.futuristic.fuzzy.gaelic.galactic.galbraithian.galilean.gallant.gallic.galvanic.gamesome.gamma.gandhian.garlanded.garrulous.gauguinesque.gaussian.gauzy.generous.genetic.genial.genomic.genteel.gentle.geomagnetic.georgian.gershwinesque.ghostly.giant.gibsonian.giddy.gifted.giga.giggly.gilded.giottesque.glacial.glad.glazed.gleaming.gleeful.glimmering.glistening.glorious.glossy.glowing.gnomish.godardian.godelian.goethean.goethesque.gogolian.golden.gooey.goofy.gorgeous.gorsy.gossamer.gothic.gowned.goyaesque.graceful.gracious.grainy.grand.grassy.grated.gravitic.gregarious.grilled.groovy.ground.grounded.guileless.gushy.gusty.habermasian.habsburg.hadrianic.halcyon.hale.hallowed.haloed.halved.hamiltonian.han.handelian.handmade.handsome.hanoverian.hapless.happy.hardy.hardyesque.harmonious.hashed.haunted.haydnesque.hayekian.hazy.heady.heaneyesque.hearthside.hearty.heathen.heathered.heavenly.hegelian.heideggerian.heinesque.heinleinian.heirloom.heisenbergian.heliacal.hellenic.hellish.hemingwayesque.herbal.herbertian.herculean.hermetic.heroic.hexed.hibernal.hilbertian.histrionic.hitchcockian.hittite.hoar.hoary.hobbesian.hobbitish.hogarthian.holderlinian.holo.holographic.holy.homerian.homeric.homeward.honest.honeyed.honky.hooded.hooved.hopeful.hopkinsian.hopperesque.hoppy.horatian.horned.hospitable.hot.housemade.huggy.humble.humean.humming.humorous.hunky.hunnish.hurrian.hushed.hydraulic.hyper.hyperborean.hypersonic.hyperspatial.hypnotic.iberian.ibsenite.iced.icy.ideal.idyllic.igneous.illustrious.imaginative.immaculate.immense.immortal.impassioned.impeccable.impetuous.impish.impressive.incan.incandescent.incisive.incorrigible.indefatigable.indelible.indigo.indolent.indomitable.industrious.ineffable.inexorable.infernal.infinite.infra.infrared.infused.ingenious.ingenuous.inimitable.innocuous.inquisitive.insatiable.inspired.intense.intergalactic.interstellar.intragalactic.intrepid.intricate.intrinsic.intuitive.inventive.inveterate.invincible.inward.ionian.ionic.ionospheric.irenic.iridescent.irrepressible.ithacan.itinerant.ivory.jacobean.jammy.jangly.jaunty.jazzy.jeffersonian.jiggly.jingly.jocular.jocund.johnsonian.jolly.jouncy.jovial.jovian.joycean.joyful.joyous.jubilant.judicious.juiced.juicy.jumped.jumpy.jungian.junky.justinianic.jute.kafkaesque.kandinskian.kantian.keatonesque.keatsian.keen.keplerian.keynesian.kierkegaardian.kindly.kindred.kinetic.kiplingesque.klimtian.knowing.kooky.kubrickian.kurosawan.lacanian.laconic.lacquered.lacustrine.lacy.lamarckian.lambda.lambent.laminated.landed.languid.lanky.laplacian.larkinesque.laser.latent.lathed.latin.lattice.laudable.launched.laureled.lavish.layered.leaden.leafy.lean.learned.legendary.leguinian.leibnizian.lemian.lemurian.lenient.leonardesque.liberal.libyan.lidar.light.lighthearted.likable.lilac.lilting.liminal.limpid.lincolnesque.lingering.linnaean.lissome.lisztian.literate.lithe.littoral.lively.loamy.local.lockean.lofty.logical.loopy.loose.loquacious.lorcaesque.lorcan.lossless.lossy.lovecraftian.lovelacean.loyal.lucent.lucid.lucky.ludic.lukewarm.luminal.luminous.lunar.luscious.lush.lushy.lusitanian.lustrous.lydian.lynchian.lyotardian.lyric.lyrical.macerated.machiavellian.macro.magical.magnanimous.magnetar.magnetic.magnetospheric.magnificent.magrittean.mahlerian.majestic.mallarmean.malleable.malthusian.malty.mandelan.manetesque.manifold.marbled.marshy.martial.martian.marvelous.marxian.maser.masked.masterful.matchless.matin.matissean.mature.matutinal.mauve.maverick.mawkish.maxwellian.mayan.meandering.mechanical.median.medicean.mega.mellifluous.mellow.melodic.mendelian.merciful.mercurial.merovingian.merry.meshed.meta.metamorphic.meteoric.meticulous.metternichian.mettlesome.michelangelesque.micro.microwave.midnight.mighty.mild.milled.miltonian.miltonic.minced.mindful.mineral.ming.mingusian.minoan.minty.miraculous.mired.miroesque.mirthful.mischievous.misty.mobile.modest.modular.molecular.molieresque.momentous.mondrianesque.monetian.monkish.mono.montane.moonless.moonlit.mordant.morning.mossy.motley.mottled.mouthwatering.mozartian.mughal.multiversal.munificent.murmuring.mushy.musical.mutable.mutant.mycenaean.mysterious.mystical.mythic.nabokovian.nameless.nano.nanoscale.napoleonic.narrowband.nascent.natty.neat.nebular.nebulous.nefarious.neptunian.nerudian.networked.neural.neutron.neutronic.newtonian.nietzschean.nifty.nimble.noble.nocturnal.nonchalant.nonpareil.noontide.norse.northward.nostalgic.notable.novel.nozickian.nuanced.nubian.nuclear.numinous.nutty.oaky.obdurate.oblique.observant.obstinate.obtuse.oceanic.ochre.odyssean.olden.olympian.omega.omni.onward.opaline.opportune.optical.optimistic.opulent.oracular.orbital.orbiting.orderly.original.ornate.orphic.orwellian.osirian.ostentatious.otherworldly.otiose.ottoman.outgoing.outspoken.outward.overcast.overclocked.ovidian.pacific.pagan.painstaking.palatial.pale.pallid.palpable.paradisal.paradoxical.parallel.paramount.parkerish.parsonian.parthian.passionate.pastoral.patched.pathless.patient.pavlovian.peaceable.peaceful.peachy.pearly.peaty.pebbly.peeled.peered.peerless.pelagic.pellucid.penetrating.pensive.peppered.peppery.peppy.perceptive.perennial.perfect.perfumed.perky.persian.persistent.perspicacious.persuasive.pert.pervasive.pessoan.petaled.petrarchan.phantom.pharaonic.phased.philosophical.phlegmatic.phoenician.photonic.photospheric.phrygian.picassoesque.pickled.pictish.picturesque.pillowy.pindaric.pinteresque.piping.piquant.pirandellian.pithy.pivotal.pixelated.placid.planckian.planetary.planetoid.plangent.plasmic.plathian.platinum.platonic.playful.pleasant.plentiful.pliant.plinky.plonky.plucky.plumed.plummy.plush.plushy.plutonian.plutonic.pneumatic.poached.poesque.poetic.poignant.poised.polished.polite.pollockian.poly.polygonal.polymer.polynesian.popean.popped.popular.portly.posh.positronic.posthuman.potent.pouncy.powdery.powerful.pragmatic.prancy.precise.precocious.precognitive.preeminent.premier.prescient.pressed.pressurized.prestigious.pretty.primeval.primordial.princely.printed.pristine.private.prized.prodigious.profane.proficient.profound.profuse.prokofievian.prolific.promethean.prompt.proper.prophetic.prosaic.prosperous.protean.proto.protostellar.proud.proustian.providential.prudent.psionic.puccinian.puckish.pudgy.puffed.pulled.pulsar.punctilious.punctual.pungent.punic.pure.purposeful.pushkinian.pynchonesque.pythagorean.quaint.quantum.quartered.quasar.questing.quick.quiescent.quiet.quintessential.quirky.quixotic.rabelaisian.racinian.radar.radiant.radio.rainwashed.rainy.rakish.rambunctious.raphaelesque.rapid.rapturous.rare.rational.ravelian.rawlsian.raytraced.ready.reasonable.rebooted.receptive.recondite.recursive.redolent.reduced.reedy.refined.reflective.refulgent.regal.relativistic.relaxed.reliable.remarkable.rembrandtesque.remote.rendered.renoiresque.renowned.replete.replicated.resilient.resinous.resolute.resourceful.respectful.resplendent.responsive.restful.restive.restless.reticent.retro.reverent.rhapsodic.rhodian.rhythmic.ricardian.rich.richelieuvian.riemannian.rigorous.rilkean.rimbaudian.rimed.ringed.ripe.ripening.rippling.risible.riverine.riveted.roaming.roaring.roasted.robed.robotic.robust.rolled.roly.roman.romanov.romantic.rompy.rooseveltian.roseate.rosy.rothkoesque.rousing.rousseauian.rowdy.royal.rubenesque.ruddy.runic.rushy.russet.rustic.sabine.sable.sacred.sagacious.sage.saintly.salient.saline.salingeresque.salted.salty.salubrious.samian.sandaled.sandy.sanguine.sapid.sapient.sapphic.sardonic.sarmatian.sartrean.sassy.satiny.saturnian.saturnine.saucy.savory.savvy.saxon.scalding.scarlet.schielesque.schillerian.schoenbergian.scholarly.schubertian.schumannesque.schumpeterian.scintillating.scorched.scorsesean.scrappy.scruffy.scrupulous.scythian.seaborne.seamless.seared.seasonal.seaward.secure.sedate.sedgy.sedimentary.sedulous.seemly.seismic.selenic.selfless.sensible.sensitive.sentient.sentimental.seraphic.sere.serene.seuratian.shaded.shadowed.shadowy.shaggy.shaken.shakespearean.shamanic.shannonian.sharded.sharp.shaved.shavian.shelleyan.shielded.shimmering.shiny.shoreless.shostakovian.shrewd.shucked.sibelian.sibilant.sibylline.sicilian.sidereal.sienna.sifted.sigma.silicon.silken.silky.silly.silty.silver.silvered.simmering.simulated.sincere.singed.singing.singular.sinuous.sisyphean.sizzling.skeptical.skillful.skinnerian.skittish.skyward.sleek.sleepless.sleepy.slender.sliced.slick.slipstreamed.slow.sly.smart.smashy.smithian.smoked.smoky.smoldering.smooth.snappy.snazzy.snoozy.snowy.snug.snuggly.soaring.sociable.socratic.sodden.soft.sogdian.solar.solarpunk.solemn.solid.somnolent.sonar.song.sonic.sonorous.sooty.soporific.soulful.sound.soundless.sour.southward.sovereign.spaceborne.spacefaring.spacious.sparkling.sparkly.spartan.special.speckled.spectacular.spectral.speedy.spellbound.spiced.spicy.spielbergian.spiffy.spinozan.spirited.splashy.splendid.split.sploshy.spontaneous.spooky.sporty.spotless.spotted.sprightly.sproingy.spry.spun.spunky.squally.squashy.squelchy.squiggly.squishy.staid.stainless.stalwart.starborn.starfaring.starless.starlit.stasisbound.stately.steadfast.steady.steaming.steampunk.steely.steeped.steinbeckian.stellar.stellarborn.sticky.stirred.stirring.stoic.stoical.stolid.stompy.stoppardian.storied.stormy.stout.strained.stratospheric.straussian.stravinskian.streaky.stretched.striking.strindbergian.striped.strong.stuart.stubby.studious.stunning.sturdy.stygian.suave.subatomic.sublime.suborbital.subsonic.substantial.subtle.succinct.succulent.sudsy.sugared.sugary.sumerian.summery.sunless.sunlit.sunny.sunward.superb.supergalactic.superlative.superluminal.supersonic.supple.supreme.sure.surreptitious.svelte.swanky.sweeping.sweet.swift.swiftian.swirled.swooshy.sylvan.sympathetic.synaptic.synchronous.synthetic.syrupy.tableside.tachyonic.taciturn.talented.talleyrandian.tame.tang.tangy.tarantinoesque.tarkovskian.tart.tasteful.tattered.taut.tawny.tectonic.telekinetic.telepathic.temperate.tempered.temporal.tenacious.tender.tennysonian.tenuous.tepid.tera.terran.terrific.terse.textured.thackerayan.thankful.thawed.theban.thessalian.theta.thorny.thorough.thoughtful.thracian.threadbare.thriving.thundery.tidal.tidy.timeless.timely.timeworn.tinkly.tiny.tipsy.tireless.titanesque.titanian.titanic.titanium.titianesque.toasted.toasty.tocharian.tokenized.tolerant.tolkienesque.tolstoyan.tonic.tonky.toothsome.torched.totemic.tough.towering.trackless.tranquil.transcendent.transhuman.treacly.treasured.tremendous.tremulous.trenchant.tricky.trim.triumphant.trojan.trollopian.truculent.true.truffautian.truffled.trusty.truthful.tudor.turbo.turingian.turneresque.twangy.twilight.twilit.twinkling.twinkly.ubiquitous.ultra.ultrasonic.ultraviolet.umami.umber.unassuming.unbounded.uncanny.uncorked.unctuous.undaunted.underworldly.undocked.undying.unearthly.unerring.unflappable.unique.unknown.unruffled.upbeat.upgraded.upright.upstanding.upward.uranian.urbane.utopian.vacuous.valeryan.valiant.valorous.vandal.vangoghian.vast.veblenian.vectorized.vedic.vehement.veiled.velazquezian.velvet.velvety.venerable.venturous.venusian.veracious.verbose.verdant.verdian.verdurous.verlainian.vermeerian.vermilion.vernal.verneian.versatile.vesper.vespertine.vibrant.victorian.vigilant.vigorous.vintage.violet.virgilian.virtual.virtuous.visceral.vital.vivacious.vivid.vocal.voidborn.voidward.volcanic.voltairean.voluble.vonnegutian.voracious.voxel.vroomy.wacky.wagnerian.wakeful.waking.wan.wandering.warholian.warm.warped.wary.washingtonian.wayward.wealthy.weathered.weberian.welcome.welded.wellesian.wellsian.westward.whacky.whimsical.whimsy.whipped.whisked.whispering.whistlerian.whitmanesque.whole.wholesome.whooshy.wide.wiggly.wild.wildean.willowy.wilsonian.wily.windswept.windy.winged.winning.winsome.wintry.wired.wireframe.wireless.wise.wishful.wispy.wistful.wittgensteinian.witty.wobbly.wodehousian.wondrous.wonky.wooded.woody.woolly.woozy.wordless.wordsworthian.wormholed.worthy.wraithlike.wreathed.wriggly.wry.xenial.xeno.yanky.yearning.yeasty.yeatsian.young.youthful.yuletide.yummy.zany.zappy.zealous.zested.zestful.zesty.zeta.zingy.zippy.zodiacal.zonked.zonky.zoomy.zoroastrian`.split(`.`),oe=`abalone.absinthe.absyrtus.accelerator.achilles.acorn.acquerello.actuator.adobo.adonis.aeetes.aegis.aello.aeneas.aengus.aether.affogato.afterburner.agartha.agate.agni.agnolotti.aioli.airlock.ajax.aji.albatross.alder.ale.alecto.aleppo.alfheim.allegory.alliteration.almond.amaranth.amaretto.amaterasu.ambrosia.americano.amphiaraus.anago.anapest.ancho.anchovy.android.andromeda.anise.annal.annwn.ansible.antaeus.antenna.anthem.antigone.antimony.antistrophe.anubis.aoidos.aperol.aphelion.aphrodite.apogee.apollo.apple.apricot.aquamarine.aquavit.aqueduct.arabica.arachne.arawn.arbor.arborio.arc.arcadia.arch.archipelago.ares.argo.argon.argonaut.aria.ariadne.ark.arke.armagnac.array.arrow.artemis.arthur.artichoke.artifact.arugula.asgard.asgardia.ash.asparagus.aspen.assam.assonance.asteroid.astronaut.atalanta.athena.atlantis.atlas.atoll.atom.atropos.aubergine.augean.aura.aurora.avalon.avalonia.avocado.awning.axion.axle.azurite.bacchus.bagna.baharat.balder.ballad.balladeer.banana.banshee.baozi.bard.barge.barium.barley.barn.basalt.basil.basilisk.basmati.bastet.bastion.bay.bayleaf.beacon.beam.bean.bearing.beech.beetroot.behemoth.bellini.beowulf.bergamot.berth.beryl.beryllium.bifrost.biodome.birch.biscotti.bismuth.bisque.bit.bittern.blackberry.blast.blaster.blini.block.blodeuwedd.bloodstone.blossom.bluebell.blueberry.bolt.bomba.bonito.boom.borage.boson.botargo.bottarga.bouillon.boundary.bow.bower.bragi.bramble.bran.branch.brandy.branwen.breeze.brew.bridge.brigid.brioche.broccoli.brook.brulee.brunhild.brush.bucatini.buckler.buckwheat.buffer.bulkhead.bunting.burrata.burst.bus.busiris.butte.butter.buttercup.butterscotch.byte.cabbage.cabin.cacao.cachaca.cache.cacus.cadence.caesura.calamarata.calamari.calcite.caldera.calliope.calvados.calypso.cam.camellia.camelot.camembert.campari.canal.cannelloni.cannoli.canopy.cantaloupe.cantata.canticle.canvas.canyon.canzone.capacitor.capellini.caper.capon.cappelletti.cappuccino.capsule.caramel.cardamom.cardoon.carillon.carnaroli.carnation.carol.carrier.carrot.cascade.cashew.cassandra.cassis.castle.castor.cavatelli.caviar.cayenne.cedar.celaeno.celeriac.cell.centaur.cerberi.cerberus.cernunnos.ceryneian.cesium.ceto.ceylon.chaff.chaffinch.chai.chain.chalk.chamomile.champagne.chandra.channel.chanson.chanterelle.chard.charon.chartreuse.cheddar.cherry.chert.chervil.chestnut.chickweed.chicory.chili.chime.chimera.chimichurri.chimney.chip.chipotle.chirashi.chiron.chive.chocolate.chorale.chorizo.chorus.chronicle.chrysanthemum.chrysaor.chrysomallus.chutney.ciabatta.cibola.cider.cilantro.cinder.cinnamon.cipher.circe.circlet.circuit.cirque.cistern.citadel.citrine.citron.clementine.cliff.clio.clipper.cloak.clotho.cloud.clove.clover.cluster.coal.cobbler.cockaigne.cockpit.cocoa.coconut.codex.coffee.cog.cognac.coif.coil.col.colchis.collider.colony.combe.comet.compote.concerto.conchiglie.conduit.confit.console.consomme.consonance.continuum.contour.cookies.coordinate.core.coriander.cormorant.corona.coronet.cortado.corvette.cosmos.cottage.couplet.course.couscous.cove.cowl.cowslip.crab.craft.crag.cranberry.crane.crayon.cream.creme.crepe.cress.crocus.croissant.crosne.crown.cruiser.crumble.cryopod.cryosleep.crystal.cuchulainn.cuckoo.cucumber.cuirass.cumin.cupid.curlew.currant.current.curry.custard.cyborg.cycle.cyclops.cyclotron.cylinder.dactyl.daedalus.daemon.daffodil.dagda.dahlia.daiquiri.dais.daisy.dale.dam.dandelion.danu.daphne.darjeeling.dart.dashi.date.dawn.daydream.deck.deirdre.demeter.destroyer.dew.diadem.diary.dill.dimension.diode.diomedean.dionysus.ditalini.ditch.djinn.dock.doenjang.domain.donburi.donjon.door.doppio.dove.downlink.dreadnought.dream.drift.droid.dryad.dukkah.dulce.dumpling.dune.durga.dusk.dust.dyke.eagle.earlgrey.easel.echidna.echo.eclair.eclipse.ecliptic.edamame.eddy.edelweiss.edge.egret.einsteinium.elderflower.eldorado.electra.elegy.elm.elysium.ember.endive.enigma.enjambment.enkidu.envoi.eos.epigram.epistle.epode.erato.erinyes.eros.erymanthian.escargot.espresso.estuary.eumenides.euryale.eurybia.eurydice.eurytion.excalibur.exoplanet.fable.fafnir.falcon.fancy.farfalle.fate.feather.feldspar.fell.fence.fennel.fenrir.fenugreek.fermion.fern.fettuccine.fiddlehead.field.fig.finch.finn.fionn.firebird.firefly.fission.fizz.fjord.flake.flame.flare.flash.flicker.flint.flue.fluorite.flux.flywheel.focaccia.fog.folio.fondant.forge.fortress.foxglove.fragment.fraise.frame.frangipane.frappe.freesia.fregola.freighter.freya.frigate.frigg.frost.fudge.fugue.fumarole.furies.fusilli.fusion.gaia.galahad.galangal.galatea.galaxy.galette.galleon.gallium.ganache.ganesh.gannet.gantry.ganymede.garam.gardenia.garlic.garuda.gateway.gauntlet.gawain.gazebo.gear.gelato.gemelli.genmaicha.genoise.geranium.germ.germanium.geryon.geyser.ghazal.ghee.ghost.gilgamesh.ginger.gingko.ginnungagap.girder.glacier.glade.glaze.gleam.gleeman.glen.glimmer.glint.glitter.gloss.glow.gluon.gnocchi.gochujang.goldfinch.golem.goose.gooseberry.gorgon.gouda.governor.gradient.graeae.granary.granite.grapefruit.grappa.gratin.graviton.greave.grebe.gremolata.grenadine.grendel.grid.griffin.gruyere.guajillo.guava.gudrun.guinevere.gunkan.gwydion.gyoza.gyroscope.habanero.habitat.hades.hadron.haiku.hall.halloumi.halo.halva.hamachi.hangar.hanuman.harissa.harpies.harpy.harvest.hatch.hauberk.hawthorn.haze.hazel.hazelnut.heading.headland.heap.heart.hearth.heather.hecate.hedge.heimdall.hel.helheim.helios.helium.helix.helle.hellebore.helm.hemistich.hephaestus.hera.hermes.heron.hesperides.hestia.hibiscus.hippogriff.hirame.hive.hoisin.hojicha.hollandaise.hollow.holly.hologram.honey.honeycomb.honeysuckle.hood.hoopoe.horizon.horseradish.horus.hrothgar.hub.huckleberry.hue.huginn.hull.husk.hut.hyacinth.hydra.hydras.hylas.hymn.hyperborea.hypercube.hyperdrive.hyperion.hyperspace.hyssop.iamb.ibis.icarus.idas.idunn.idyll.igniter.igraine.ikura.indium.indra.inductor.infusion.injector.ink.inlet.inspiration.ion.iridium.iris.ishtar.isis.isolde.isotope.ivy.iwashi.izanagi.jackdaw.jackfruit.jalapeno.janus.jasmine.jason.jasper.javelin.jay.jet.jiaozi.jongleur.jonquil.jormungandr.jotunheim.journal.julep.jumpgate.juniper.juno.jupiter.kaffir.kale.kali.kampachi.karaage.karasumi.katsu.keel.keep.kefir.kelpie.kenning.kernel.kestrel.khinkali.kiln.kimchi.kingfisher.kinmedai.kirsch.kite.kitsune.kiwi.koan.kohlrabi.kombucha.koshihikari.kraken.krypton.kumquat.kvass.lachesis.lacquer.ladon.ladons.laertes.lager.lagoon.lake.lakshmi.lambic.lament.lance.lancelot.lander.lane.langoustine.lantern.lapis.lark.larkspur.lasagna.latte.laureate.laurel.lava.lavender.leaf.leda.leek.legend.lemon.lemonbalm.lemongrass.lemuria.lens.lentil.lepton.lernaean.lethe.letter.levee.lever.leviathan.lightyear.lily.lime.limerick.limoncello.linden.linguine.link.linnet.lir.lithium.lityerses.lobster.loch.lock.lodge.loki.loop.loquat.lotus.lovage.lugh.lullaby.lungo.luster.lychee.lynceus.lyonesse.lyricist.macadamia.macaron.macchiato.madai.madeleine.madrigal.magma.magnolia.magpie.mail.mainframe.maki.makrut.malachite.manannan.mango.manicotti.manor.manti.manticore.mantle.mantou.manuscript.maple.marble.marduk.margarita.marigold.marjoram.marquee.marrow.martini.marvel.marzipan.masago.masala.mascarpone.mast.matcha.matrix.mead.meadow.mech.medea.medusa.megaera.meleager.memoir.mentaiko.mercury.meringue.merlin.merlot.mesa.mesh.metaphor.meteor.meter.mezcal.mezzaluna.mica.midas.midgard.mill.mimir.mimosa.minerva.minotaur.minstrel.mint.minuet.miracle.mirin.mirror.miso.missive.mist.mjolnir.mocha.module.moira.mojito.molasses.mole.momo.monolith.moonbase.moonbeam.moonstone.moor.mopsus.mordred.morel.morgana.morpheus.morrigan.moss.mote.motet.mousse.mu.mulberry.muninn.muon.muse.muspelheim.mustard.myrtle.mystery.myth.nadir.naga.naiad.nanite.nanobot.narcissus.neapolitan.nebula.nectarine.needle.negroni.nemean.nemesis.neon.neptune.neptunium.nereid.nereus.nessus.nest.nestor.net.nettle.neutrino.nexus.niamh.nib.nibble.nibiru.niflheim.nightingale.nigiri.nike.niobe.njord.nocturne.node.nog.nori.norn.note.nougat.nova.nozzle.nuada.nutmeg.nyx.oak.oasis.oat.obelisk.oberon.obsidian.oceanid.oceanus.octave.octavo.ocypete.ode.odin.odysseus.oisin.okonomiyaki.olive.olympus.oni.onigiri.oolong.oracle.orange.orb.orbit.orbiter.orchard.orchid.oreads.orecchiette.oregano.orion.orpheus.orthros.orthrus.orzo.oscillator.osiris.osmium.osprey.ouroboros.outline.outpost.ouzo.oven.overture.owl.oyster.paccheri.packet.padron.page.palace.palette.palladium.palm.pan.pandan.pandora.panettone.pansotti.pansy.pantoum.papaya.pappardelle.paprika.papyrus.parable.paradox.parcae.parchment.parfait.parmesan.parsec.parsley.parsnip.particle.partridge.parvati.pasilla.passionfruit.pastel.pastis.patina.pavilion.pavlova.peach.peak.pear.pebble.pecan.pegasi.pegasus.pekoe.peleus.pelican.pelmeni.pen.pencil.penelope.penne.peony.pepper.peppermint.percival.peregrine.pergola.peridot.perigee.perihelion.perry.persephone.perseus.persillade.persimmon.pesto.petal.petrel.phase.pheasant.phoenix.pholus.phorcys.photon.phrixus.pickle.pierogi.pigment.pimento.pine.pineapple.ping.pinot.pipe.pipit.piquillo.pisco.pistachio.piston.pith.plane.plasma.plate.plover.plum.plume.pluto.plutonium.poblano.pod.podarge.poet.polenta.pollux.polyphemus.pomegranate.pomelo.pond.pontus.ponzu.pooka.pool.poplar.poppy.porcini.port.portal.porter.porthole.poseidon.positron.prairie.praline.prelude.primrose.prism.probe.profile.prometheus.prosciutto.prosecco.proteus.protocol.psalm.psyche.pudding.puffin.pulse.pumice.pumpkin.purslane.pwyll.pylon.pyrrhic.quadrant.quail.quark.quarto.quartz.quatrain.qubit.quetzalcoatl.queue.quill.quince.quinoa.quiver.radish.radium.radon.ragnarok.rain.rama.ramen.ramp.rampart.ramson.raspberry.ratatoskr.raven.ravioli.ray.reactor.realm.reaper.reed.reef.refrain.region.register.relay.relic.remnant.requiem.reservoir.residue.resistor.resonator.reverie.rhapsode.rhapsody.rhea.rhiannon.rhodium.rhododendron.rhubarb.rhyme.ricotta.riddle.ridge.riesling.rigatoni.rim.ring.risotto.ristretto.river.roast.robin.robusta.roc.rocket.rod.romesco.rondeau.rooibos.rook.root.rose.rosemary.rosewater.roundel.rover.rowan.rubidium.rum.rune.saba.saffron.saga.saison.sake.salmoriglio.salsa.salsify.sambal.sambuca.samphire.sancerre.sandpiper.sangria.sanma.sansho.saraswati.sashimi.sasquatch.satellite.satyr.sauternes.savanna.sawara.sazerac.scaffold.scalar.scallop.scansion.scepter.schnapps.schooner.scop.scorzonera.scotchbonnet.scroll.sector.seed.sekhmet.selene.selenite.selenium.selkie.sencha.sensor.sequoia.serenade.serrano.servo.sesame.sestina.sextet.shack.shade.shadow.shaft.shale.shallot.shambhala.shard.shed.sheen.sherbet.sherry.shield.shimmer.ship.shishito.shiso.shiva.shoyu.shrub.shumai.shuttle.sibyl.sif.signal.sigurd.silhouette.silo.simile.simurgh.singularity.siren.sita.skadi.skald.skiff.skuld.skylark.slant.slate.sleipnir.sling.slipstream.sliver.sloop.sluice.smithy.smoke.snowdrop.socket.sofrito.sonata.sonnet.soot.sorbet.sorrel.souffle.soul.soy.spaceport.spaghetti.spark.sparkle.sparrow.spear.speck.specter.speculoos.spelt.sphere.sphinx.sphinxes.spindle.spinel.spiral.spire.spirit.splinter.spoke.spondee.spore.spring.spritz.spruce.sriracha.ssamjang.stack.stanza.starbase.starlight.starling.starport.starship.stasis.station.steam.stellarator.steppe.stheno.stork.stracciatella.strawberry.stream.strontium.strophe.strozzapreti.strut.stylus.stymphalian.styx.subspace.sumac.summit.sunbeam.sunstone.supernova.surge.surya.susanoo.sushi.svartalfheim.swallow.swan.swarm.sycamore.syleus.synchrotron.tabard.tachyon.tagliatelle.tahini.takoyaki.taliesin.tamari.tamarind.tangerine.tanka.tanker.tapenade.tapioca.tarako.taranis.tare.tarn.tarragon.tartarus.telamon.telemetry.teleporter.tellurium.temaki.tempura.tengu.tensor.tent.tequila.tercet.teriyaki.terminal.tern.terraform.tesseract.tethys.thalassa.thalia.thallium.thaumas.themis.theseus.thistle.thor.thorium.thoth.threshold.throne.throttle.thrush.thruster.thule.thunderbird.thyme.tiamat.tiara.tide.tint.tintagel.tiphys.tiramisu.tirnanog.tisane.tisiphone.titan.tobiko.toccata.toddy.toffee.tofu.tokamak.tomatillo.tomato.tome.tone.tonka.tonkatsu.tor.tortellini.torus.tourmaline.tower.trace.track.transducer.transistor.treacle.trellis.triolet.tristan.triton.trochee.trofie.trope.troubadour.trouvere.truffle.trunk.truss.tug.tulip.tundra.tungsten.turbine.turmeric.turquoise.turret.twinkle.typhon.tyr.udon.ulysses.unagi.uni.unicorn.uplink.uramaki.urania.uranium.urd.urfa.uther.vale.valhalla.valkyrie.valve.vanadium.vanaheim.vanilla.vapor.vareniki.varnish.varuna.vector.veil.vellum.vent.venus.verbena.verdandi.verge.verjus.vermouth.verse.vessel.vesta.vestige.vialone.viewport.villanelle.vishnu.vodka.volcano.volta.volume.vortex.vulcan.wall.walnut.waltz.warbler.warpgate.wasabi.wash.watercress.watermelon.wave.waypoint.web.weir.well.wendigo.wheat.whisky.whisper.wiglaf.willow.wimple.window.wisteria.wonder.wonton.woodcock.woodpecker.word.wormhole.wraith.wren.wyrm.wyvern.xenon.yacht.yakitori.yama.yarrow.yeti.yew.yggdrasil.yokai.yuzu.zaatar.zabaglione.zenith.zephyr.zeus.zinnia.zircon.zirconium.ziti.zone.zucchini`.split(`.`);ae.length*oe.length,t(`agent-bridge`);var se=`agent: name already in use`,S=t(`cone-memory-budget`),ce=1.25,le=_.memoryPath,ue=`/sessions/index.json`,de=4096,fe=/^## Auto-extracted/m,pe=`Consolidate the auto-extracted memory bullets below into a single tighter set of durable memories.
173
+
174
+ Rules:
175
+ - Output ONLY a single \`## Auto-extracted (consolidated)\` heading followed by markdown bullets.
176
+ - One fact per bullet. Drop duplicates and superseded facts. Keep the most recent / specific phrasing.
177
+ - Preserve concrete identifiers (file paths, URLs, IDs, names) verbatim.
178
+ - Be terse. Aim well under the original size.
179
+ - Do NOT add preamble, commentary, or any heading other than the single consolidated one.`;function me(e){let t=fe.exec(e);if(!t)return{header:e,autoExtracted:``};let n=t.index;return{header:e.slice(0,n),autoExtracted:e.slice(n)}}async function C(e){try{let t=await e.readFile(ue,{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 he(t){let{header:n,autoExtracted:r}=me(t.currentContent);if(!r.trim())return t.currentContent;let i=c(`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 ${t.budget} characters.
180
+
181
+ <auto-extracted>
182
+ ${r}
183
+ </auto-extracted>`),a={role:`user`,content:[{type:`text`,text:c(pe)}],timestamp:Date.now()},o=await e(t.model,{systemPrompt:i,messages:[a]},{apiKey:t.apiKey,maxTokens:de,headers:t.headers,signal:t.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(`
184
+ `).trim();if(!s)throw Error(`Restructure call returned empty content`);return`${n}${n.length===0||n.endsWith(`
185
+ `)?``:`
186
+ `}${s}\n`}async function ge(e){if(!e.model||!e.apiKey)return{restructured:!1,reason:`no-llm`};let t=e.memoryPath??le,n=``;try{let r=await e.vfs.readFile(t,{encoding:`utf-8`});n=typeof r==`string`?r:new TextDecoder().decode(r)}catch{return{restructured:!1,reason:`missing-file`}}let r=await C(e.vfs),i=x(r),a=i*ce;if(n.length<=a)return{restructured:!1,reason:`under-threshold`};S.info(`Cone memory over threshold — restructuring`,{size:n.length,budget:i,threshold:a,sessionCount:r});try{let r=await he({currentContent:n,budget:i,model:e.model,apiKey:e.apiKey,headers:e.headers,signal:e.signal});return await e.vfs.writeFile(t,r),S.info(`Cone memory restructured`,{before:n.length,after:r.length}),{restructured:!0}}catch(e){return S.warn(`Cone memory restructure failed — leaving appended content in place`,{error:e instanceof Error?e.message:String(e)}),{restructured:!1,reason:`error`}}}var w=t(`agentic-memory`),_e=1200,ve=3600,ye=7200,be=e=>[e.memoryPath],xe=e=>[`/sessions/`,`/shared/`,...ee(e)],Se=`awk.cat.cp.cut.date.diff.du.echo.file.find.grep.head.jq.ls.mkdir.mount.mv.nl.od.printf.readlink.rg.sed.sort.stat.tail.touch.tr.uniq.uname.upskill.wc.xxd`.split(`.`),T={arrayKeys:new Set([`writablePaths`,`visiblePaths`,`allowedCommands`]),scalarKeys:new Set([`model`,`timeoutSeconds`,`dreamTimeoutSeconds`,`thinkingLevel`])},E=`medium`,D=3e4;function O(e){return e===`cone`?`memory-curator`:`memory-curator-${e}`}var k={kind:`curate`,nameFor:O,rivalsFor:e=>[we(e)]},A=`{{TASK}}`,j=`(no session archive this pass)`;function Ce(e,t,n){return e.kind===`dream`?`**Consolidation pass** (the nightly dreaming): there is NO new session to mine — skip "Mining the session archive" entirely. Your whole job is to make the existing memory better: consolidated, current, and inside its budget. If the file is missing or empty, reply with one line saying so and stop; never invent memories. The run is hard-stopped after ${n} minutes; a run stopped at that bound lands whatever the memory file holds at that moment (every memory_write leaves a whole, budget-checked file), so consolidate section by section, writing as you go, and finish cleanly when you can.`:`**Curation pass**: mine the archived session at ${t} for what is worth carrying into future sessions, fold it into the memory, and consolidate the whole file in the same pass. Work fast: a pass should finish in well under 10 minutes and is hard-stopped after ${n} minutes — mine the three signals, write, and stop, rather than exploring the archive exhaustively.`}function we(e){return e===`cone`?`memory-dreamer`:`memory-dreamer-${e}`}function M(e,t){let n=e.nameFor(t);return N.test(n)?n:e.nameFor(h)}function Te(e,t){let n=N.test(e.nameFor(t))?t:h;return e.rivalsFor?.(n)??[]}var N=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;function P(e,t){return`/scoops/agent-${M(e,t)}`}function Ee(e){return P(k,e)}var F=Ee(h);function De(e){return te({parentJid:null,folder:e?.folder??`cone`})}function I(e,t){if(t.root===_.root)return e;if(e===_.memoryPath)return t.memoryPath;if(e===`/workspace/skills`||e.startsWith(`/workspace/skills/`))return e;let n=`${_.root}/`;return e===_.root?t.root:e.startsWith(n)?`${t.root}/${e.slice(n.length)}`:e}function Oe(e,t){let n=`${g}/`,r=e=>e.some(e=>n.startsWith(e.endsWith(`/`)?e:`${e}/`)),i=e.map(e=>I(e,t));return r(e)&&!r(i)&&i.push(n),i}async function ke(e){try{if(e.signal?.aborted)return{ok:!1,reason:`aborted`,legacyFallbackSafe:!1};let t=e.instructions??k,n=De(e.cone),r=P(t,e.cone?.folder??`cone`),i=await Ae(e.vfs,n),a=t.kind===`dream`?i.dreamTimeoutSeconds:i.timeoutSeconds,o=V(e.sessionArchivePath);try{await Ne(e.vfs,n.memoryPath,e.sessionArchivePath)}catch(e){return{ok:!1,reason:`snapshot: ${H(e)}`,legacyFallbackSafe:!0}}let s=t.kind===`dream`?j:e.sessionArchivePath,c=Math.max(1,Math.round(a/60)),l=Ce(t,s,c),u=Fe(i,a,Ie(Le(i.promptTemplate.includes(A)?i.promptTemplate:`${i.promptTemplate.trimEnd()}\n\n${A}`,{MEMORY_PATH:o,SESSION_ARCHIVE_PATH:s,SESSION_COUNT:String(e.sessionCount),BUDGET_CHARS:String(x(e.sessionCount)),SCRATCH_DIR:r,VISIBLE_PATHS:i.visiblePaths.join(`, `),TODAY:e.today??new Date().toISOString().slice(0,10),TIMEOUT_MINUTES:String(c),TASK:l}),r),e.sessionArchivePath,n,e.cone,t);e.signal&&(u.signal=e.signal);let d=await Re(Promise.resolve().then(()=>e.spawn(u)),a*1e3+D,e.signal);if(d.type===`timeout`)return w.warn(`Agentic memory wait timed out past the in-run bound + grace`,{timeoutSeconds:a,graceMs:D}),{ok:!1,reason:`timeout`,legacyFallbackSafe:!1};if(d.type===`aborted`)return{ok:!1,reason:`aborted`,legacyFallbackSafe:!1};if(d.type===`error`)return{ok:!1,reason:H(d.error),legacyFallbackSafe:!0};if(d.result.exitCode!==0){let e=(d.result.finalText??``).startsWith(se);return{ok:!1,reason:d.result.finalText||`exit-${d.result.exitCode}`,legacyFallbackSafe:!e}}return{ok:!0,report:d.result.finalText}}catch(e){return w.warn(`Agentic memory pass failed`,{error:H(e)}),{ok:!1,reason:H(e),legacyFallbackSafe:!1}}}async function Ae(e,t=_){try{let n=await e.readFile(y,{encoding:`utf-8`});return L(typeof n==`string`?n:new TextDecoder().decode(n),t)}catch(e){return w.warn(`Could not load valid ${y}; using built-in default`,{error:H(e)}),L(v,t)}}function L(e,t=_){let c=a(e,`MEMORY.md`),l=s(c.frontmatter,T),u=i(l,`writablePaths`,be(t));if(u.length===0)throw Error(`writablePaths must not be empty`);r(u,`writablePaths`);let d=i(l,`visiblePaths`,xe(t));r(d,`visiblePaths`);let f=n(l.timeoutSeconds,600,_e),p=n(l.dreamTimeoutSeconds,ve,ye,`dreamTimeoutSeconds`),m=o(l.model,`model`);return{writablePaths:u.map(e=>I(e,t)),visiblePaths:Oe(d,t),allowedCommands:[...new Set([...Se,...i(l,`allowedCommands`,[])])],...m?{model:m}:{},thinkingLevel:je(l.thinkingLevel),timeoutSeconds:f,dreamTimeoutSeconds:p,promptTemplate:c.body}}function je(e){if(e===void 0)return E;if(typeof e!=`string`||!ne(e))throw Error(`thinkingLevel must be one of ${re.join(`, `)}`);return e}function R(e){return`/sessions/.curated/${e.slice(e.lastIndexOf(`/`)+1)}`}function z(e){return`/sessions/.curation/${e.slice(e.lastIndexOf(`/`)+1)}`}function B(e){return`${z(e)}/base.md`}function V(e){return`${z(e)}/draft.md`}function Me(e){return`${z(e)}/status.json`}async function Ne(e,t,n){let r=``;try{let n=await e.readFile(t,{encoding:`utf-8`});r=typeof n==`string`?n:new TextDecoder().decode(n)}catch{}await e.mkdir(z(n),{recursive:!0}),await e.writeFile(B(n),r),await e.writeFile(V(n),r)}function Pe(e,t,n){let r=e.map(e=>e===t?n:e);return r.includes(n)?r:[...r,n]}function Fe(e,t,n,r,i,a,o){let s=e.model===`parent`||e.model===`cone`,c=B(r),l=V(r);return{cwd:i.root,writablePaths:Pe(e.writablePaths,i.memoryPath,l),visiblePaths:[...e.visiblePaths,`${z(r)}/`],allowedCommands:e.allowedCommands,prompt:n,thinkingLevel:e.thinkingLevel,persistSession:!0,name:M(o,a?.folder??`cone`),exclusiveWith:Te(o,a?.folder??`cone`),...a?.jid?{parentJid:a.jid}:{},notifyOnComplete:!0,successReceiptPath:R(r),mergeOnSuccess:{targetPath:i.memoryPath,basePath:c,draftPath:l},outcomeReceiptPath:Me(r),maxWallClockMs:t*1e3,...!s&&e.model?{modelId:e.model}:{}}}function Ie(e,t){if(t===F)return e;let n=`\0SCRATCH\0`;return e.replaceAll(t,n).replaceAll(F,t).replaceAll(n,t)}function Le(e,t){let n=e;for(let[e,r]of Object.entries(t))n=n.replaceAll(`{{${e}}}`,r);return n}function Re(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 H(e){return e instanceof Error?e.message:String(e)}function U(e){let t=0;for(let n of e)n.timestamp>t&&(t=n.timestamp);return t}function W(e,t){return t>0?e.filter(e=>e.timestamp>t):[...e]}t(`live-session-curation`);var ze=8e4,G=`/sessions/.live-deltas`,K={maxMessages:200,maxChars:ze};function q(e,t,n){return`${G}/${e}-${t}-${n}.md`}function J(e,t=K){if(e.length===0)return[];let n=[],r=0;for(let i of e){let e=Ge(i);if(n.length>=t.maxMessages||n.length>0&&r+e>t.maxChars)break;n.push(i),r+=e}n.length===0&&n.push(e[0]);let i=n[n.length-1].timestamp,a=n.length;for(;a<e.length&&e[a].timestamp===i;)n.push(e[a]),a+=1;return n}async function Be(e,t,n,r){let i=t.curatedThrough??0,a=t.sessionId?await X(e,t.sessionId,t.filename,n,i,r):i;return{through:a,caughtUp:a>0&&W(n,a).length===0}}async function Ve(e,t){let n=(t.curatedThrough??0)>0,r=await X(e,t.sessionId,t.filename,t.messages,t.curatedThrough??0),i=W(t.messages,r);if(i.length===0)return{kind:`covered`,through:r};if(!n&&r===0)return{kind:`full`};let a=U(i),o=q(t.sessionId,r,a);return await Z(e,o)?(await Y(e,t.filename,a),{kind:`covered`,through:a}):(await He(e,t,i,o),{kind:`delta`,path:o,through:a,messages:[...i]})}async function Y(e,t,n){n>0&&await l(async()=>{let r=await f(Q(e)),i=r.findIndex(e=>e.filename===t);if(i===-1||n<=(r[i].curatedThrough??0))return;let{memoryFailed:a,...o}=r[i],s=r.slice();s[i]={...o,curatedThrough:n},await p(Q(e),s),await Ue(e,`${u}/${t}`,n),await e.flush?.()})}async function X(e,t,n,r,i,a){let o=i;for(let n=0;n<50;n+=1){let n=W(r,o);if(n.length===0)break;let i=U(J(n,a??K));if(i<=o||!await Z(e,q(t,o,i)))break;o=i}return o>i&&await Y(e,n,o),o}async function He(e,t,n,r){let i={id:t.sessionId,sessionId:t.sessionId,title:t.title,frozenAt:t.frozenAt,createdAt:n[0]?.timestamp??0,updatedAt:U(n),messageCount:n.length,messages:[...n],...t.cone?{cone:t.cone}:{},...t.coneLabel?{coneLabel:t.coneLabel}:{}};await e.mkdir(G,{recursive:!0}),await e.writeFile(r,d(i))}async function Ue(e,t,n){let r;try{r=await We(e,t)}catch(e){if($(e))return;throw e}let i=r.match(/^---\n([\s\S]*?)\n---\n/);if(!i)return;let a=`curatedThrough: ${n}`,o=/^curatedThrough:\s*\d+\s*$/m.test(i[1])?i[1].replace(/^curatedThrough:\s*\d+\s*$/m,a):`${i[1]}\n${a}`;o!==i[1]&&await e.writeFile(t,`---\n${o}\n---\n${r.slice(i[0].length)}`)}async function Z(e,t){try{return await e.readFile(R(t),{encoding:`utf-8`}),!0}catch(e){if($(e))return!1;throw e}}async function We(e,t){let n=await e.readFile(t,{encoding:`utf-8`});return typeof n==`string`?n:new TextDecoder().decode(n)}function Ge(e){let t=e.toolCalls?JSON.stringify(e.toolCalls).length:0;return e.content.length+t}function Q(e){return e}function $(e){return e instanceof m?e.code===`ENOENT`:typeof e!=`object`||!e||!(`code`in e)?!1:e.code===`ENOENT`}export{B as a,R as c,C as d,Be as i,ke as l,Y as n,z as o,Ve as r,V as s,G as t,ge as u};
@@ -1 +1 @@
1
- import{t as e}from"./logger-LESFN7Hj.js";import{n as t}from"./record-COQlaFL1.js";import{t as n}from"./types-D8gIX-W-.js";import{i as r,o as i,p as a}from"./kernel-worker-B8dQ6oD2.js";import{a as o,c as s,d as c,f as l,l as u,n as d,p as f,r as p,s as m,t as h,u as g}from"./frozen-archive-writer-BoBWoTrh.js";const _=e(`live-session-snapshot`);function v(e,t){return`/scoops/${e}/sessions/${t}`}function y(e){let t=e.cone.folder||`cone`,n=e.sessionsDir??`/sessions`,r=a(e.messages,{source:e.cone.label??t,uncapped:!0});return g(async()=>e.stillValid&&!e.stillValid()?(_.info(`Live session snapshot skipped: session gone before the write`,{cone:t,sessionsDir:n,trigger:e.trigger}),null):b(e,t,n,r),c(n))}async function b(e,n,r,i){let a=e.now??Date.now,c=await u(e.vfs,r),f=d(c,n),g=f?await T(e.vfs,r,f):null,v=g===null?0:f?.liveThrough??w(g),y=C(i,g??[],v),b=[...g??[],...y],x=Math.max(v,w(i)),S=f?.filename??s(n),E=f?.frozenAt??new Date(a()).toISOString(),D=o(b),O=f?.title&&!m(f.title)?f.title:D,k=(f?.compactions??0)+1,A={cone:n,...n!==`cone`&&e.cone.label?{coneLabel:e.cone.label}:{}},j=f?.sessionId??crypto.randomUUID(),M={id:t({folder:n}),sessionId:j,title:O,frozenAt:E,createdAt:b[0]?.timestamp||a(),updatedAt:a(),messageCount:b.length,messages:b,...A,live:!0,liveThrough:x,compactions:k,...f?.curatedThrough?{curatedThrough:f.curatedThrough}:{}},N={filename:S,sessionId:j,title:O,frozenAt:E,messageCount:b.length,...A,...f?.icon?{icon:f.icon}:{},live:!0,liveThrough:x,compactions:k,...f?.curatedThrough?{curatedThrough:f.curatedThrough}:{},...f?.memoryFailed?{memoryFailed:f.memoryFailed}:{}};await h(e.vfs,r);let P=`${r}/${S}`;return await e.vfs.writeFile(P,p(M)),await l(e.vfs,N,r),await e.vfs.flush(),_.info(`Live session snapshot written`,{cone:n,sessionsDir:r,filename:S,trigger:e.trigger,appended:y.length,total:b.length,compactions:k}),{transcriptPath:P,entry:N,appended:y.length}}function x(e,t){let n=t||`cone`;return g(async()=>{let t=await u(e),i=d(t,n);if(!i)return!1;let{live:a,liveThrough:o,...s}=i,c={...s,pendingEnrichment:!0};return await f(e,t.map(e=>e===i?c:e)),await E(e,`${r}/${i.filename}`),await e.flush(),_.info(`Live session snapshot finalized`,{cone:n,filename:i.filename}),!0})}function S(e,t){let i=t||`cone`;return g(async()=>{let t=await u(e),a=t.filter(e=>e.live===!0&&(e.cone??`cone`)===i);if(a.length===0)return 0;await f(e,t.filter(e=>!a.includes(e)));for(let t of a){try{await e.rm(`${r}/${t.filename}`)}catch(e){if(!(e instanceof n)||e.code!==`ENOENT`)throw e}let{removeSessionJsonl:i}=await import(`./session-jsonl-C4593KNn.js`);await i(e,t.filename)}let{invalidateSessionSearchIndex:o}=await import(`./session-search-index-CUPFfLvv.js`);return await o(e),await e.flush(),_.info(`Live session snapshot discarded`,{cone:i,removed:a.length}),a.length})}function C(e,t,n){if(t.length===0)return e;let r=t.filter(e=>e.timestamp===n);return e.filter(e=>e.timestamp>n?!0:e.timestamp<n?!1:!r.some(t=>t.role===e.role&&t.content===e.content))}function w(e){let t=0;for(let n of e)n.timestamp>t&&(t=n.timestamp);return t}async function T(e,t,r){try{let n=await e.readFile(`${t}/${r.filename}`,{encoding:`utf-8`}),a=typeof n==`string`?n:new TextDecoder().decode(n);return i(a).messages}catch(e){if(!(e instanceof n)||e.code!==`ENOENT`)throw e;return _.warn(`Live snapshot archive missing; rewriting from the agent history`,{sessionsDir:t,filename:r.filename}),null}}async function E(e,t){try{let n=await e.readFile(t,{encoding:`utf-8`}),r=typeof n==`string`?n:new TextDecoder().decode(n),i=r.match(/^---\n([\s\S]*?)\n---\n/);if(!i)return;let a=i[1].replace(/^(live: true|liveThrough: \d+)\n?/gm,``);if(a===i[1])return;await e.writeFile(t,`---\n${a}\n---\n${r.slice(i[0].length)}`)}catch(e){if(e instanceof n&&e.code===`ENOENT`)return;throw e}}export{S as discardLiveSnapshot,x as finalizeLiveSnapshot,v as scoopSessionsDir,y as snapshotLiveSession};
1
+ import{t as e}from"./logger-LESFN7Hj.js";import{n as t}from"./record-COQlaFL1.js";import{t as n}from"./types-D8gIX-W-.js";import{i as r,o as i,p as a}from"./kernel-worker-yDR9ykP9.js";import{a as o,c as s,d as c,f as l,l as u,n as d,p as f,r as p,s as m,t as h,u as g}from"./frozen-archive-writer-CBS7YWrT.js";const _=e(`live-session-snapshot`);function v(e,t){return`/scoops/${e}/sessions/${t}`}function y(e){let t=e.cone.folder||`cone`,n=e.sessionsDir??`/sessions`,r=a(e.messages,{source:e.cone.label??t,uncapped:!0});return g(async()=>e.stillValid&&!e.stillValid()?(_.info(`Live session snapshot skipped: session gone before the write`,{cone:t,sessionsDir:n,trigger:e.trigger}),null):b(e,t,n,r),c(n))}async function b(e,n,r,i){let a=e.now??Date.now,c=await u(e.vfs,r),f=d(c,n),g=f?await T(e.vfs,r,f):null,v=g===null?0:f?.liveThrough??w(g),y=C(i,g??[],v),b=[...g??[],...y],x=Math.max(v,w(i)),S=f?.filename??s(n),E=f?.frozenAt??new Date(a()).toISOString(),D=o(b),O=f?.title&&!m(f.title)?f.title:D,k=(f?.compactions??0)+1,A={cone:n,...n!==`cone`&&e.cone.label?{coneLabel:e.cone.label}:{}},j=f?.sessionId??crypto.randomUUID(),M={id:t({folder:n}),sessionId:j,title:O,frozenAt:E,createdAt:b[0]?.timestamp||a(),updatedAt:a(),messageCount:b.length,messages:b,...A,live:!0,liveThrough:x,compactions:k,...f?.curatedThrough?{curatedThrough:f.curatedThrough}:{}},N={filename:S,sessionId:j,title:O,frozenAt:E,messageCount:b.length,...A,...f?.icon?{icon:f.icon}:{},live:!0,liveThrough:x,compactions:k,...f?.curatedThrough?{curatedThrough:f.curatedThrough}:{},...f?.memoryFailed?{memoryFailed:f.memoryFailed}:{}};await h(e.vfs,r);let P=`${r}/${S}`;return await e.vfs.writeFile(P,p(M)),await l(e.vfs,N,r),await e.vfs.flush(),_.info(`Live session snapshot written`,{cone:n,sessionsDir:r,filename:S,trigger:e.trigger,appended:y.length,total:b.length,compactions:k}),{transcriptPath:P,entry:N,appended:y.length}}function x(e,t){let n=t||`cone`;return g(async()=>{let t=await u(e),i=d(t,n);if(!i)return!1;let{live:a,liveThrough:o,...s}=i,c={...s,pendingEnrichment:!0};return await f(e,t.map(e=>e===i?c:e)),await E(e,`${r}/${i.filename}`),await e.flush(),_.info(`Live session snapshot finalized`,{cone:n,filename:i.filename}),!0})}function S(e,t){let i=t||`cone`;return g(async()=>{let t=await u(e),a=t.filter(e=>e.live===!0&&(e.cone??`cone`)===i);if(a.length===0)return 0;await f(e,t.filter(e=>!a.includes(e)));for(let t of a){try{await e.rm(`${r}/${t.filename}`)}catch(e){if(!(e instanceof n)||e.code!==`ENOENT`)throw e}let{removeSessionJsonl:i}=await import(`./session-jsonl-DO6bKeXA.js`);await i(e,t.filename)}let{invalidateSessionSearchIndex:o}=await import(`./session-search-index-CeQkxdD7.js`);return await o(e),await e.flush(),_.info(`Live session snapshot discarded`,{cone:i,removed:a.length}),a.length})}function C(e,t,n){if(t.length===0)return e;let r=t.filter(e=>e.timestamp===n);return e.filter(e=>e.timestamp>n?!0:e.timestamp<n?!1:!r.some(t=>t.role===e.role&&t.content===e.content))}function w(e){let t=0;for(let n of e)n.timestamp>t&&(t=n.timestamp);return t}async function T(e,t,r){try{let n=await e.readFile(`${t}/${r.filename}`,{encoding:`utf-8`}),a=typeof n==`string`?n:new TextDecoder().decode(n);return i(a).messages}catch(e){if(!(e instanceof n)||e.code!==`ENOENT`)throw e;return _.warn(`Live snapshot archive missing; rewriting from the agent history`,{sessionsDir:t,filename:r.filename}),null}}async function E(e,t){try{let n=await e.readFile(t,{encoding:`utf-8`}),r=typeof n==`string`?n:new TextDecoder().decode(n),i=r.match(/^---\n([\s\S]*?)\n---\n/);if(!i)return;let a=i[1].replace(/^(live: true|liveThrough: \d+)\n?/gm,``);if(a===i[1])return;await e.writeFile(t,`---\n${a}\n---\n${r.slice(i[0].length)}`)}catch(e){if(e instanceof n&&e.code===`ENOENT`)return;throw e}}export{S as discardLiveSnapshot,x as finalizeLiveSnapshot,v as scoopSessionsDir,y as snapshotLiveSession};
@@ -1,2 +1,2 @@
1
- import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./logger-LESFN7Hj.js";import{c as n}from"./account-store-Co7p6uLK.js";import{a as r}from"./diagnostics-Cag7MsZI.js";import{a as i}from"./compat-nGhSz-U1.js";import{r as a,s as o}from"./legacy-api-aliases--xyLjPgC.js";import{n as s}from"./pi-transcript-context-4pjVPiVC.js";var c=e({config:()=>f,detectRuntime:()=>E,discoverModels:()=>T,originOf:()=>C,register:()=>b,verifyConnection:()=>k});const l=t(`local-llm`),u=`local-llm`,d=`${u}-unconfigured`,f={id:u,name:`Local LLM (OpenAI-compatible)`,description:[`Connect to any OpenAI-compatible local model server.`,``,`Common base URLs:`,` • Ollama http://localhost:11434/v1`,` • LM Studio http://localhost:1234/v1`,` • llama.cpp http://localhost:8080/v1`,` • vLLM http://localhost:8000/v1`,` • mlx_lm http://localhost:8080/v1`,` • Jan http://localhost:1337/v1`,``,`Ollama needs OLLAMA_ORIGINS=* (or chrome-extension://*) so the`,`browser can reach it. macOS: launchctl setenv OLLAMA_ORIGINS "*".`].join(`
1
+ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./logger-LESFN7Hj.js";import{c as n}from"./account-store-DkttH-BP.js";import{a as r}from"./diagnostics-Cag7MsZI.js";import{a as i}from"./compat-nGhSz-U1.js";import{r as a,s as o}from"./legacy-api-aliases--xyLjPgC.js";import{n as s}from"./pi-transcript-context-4pjVPiVC.js";var c=e({config:()=>f,detectRuntime:()=>E,discoverModels:()=>T,originOf:()=>C,register:()=>b,verifyConnection:()=>k});const l=t(`local-llm`),u=`local-llm`,d=`${u}-unconfigured`,f={id:u,name:`Local LLM (OpenAI-compatible)`,description:[`Connect to any OpenAI-compatible local model server.`,``,`Common base URLs:`,` • Ollama http://localhost:11434/v1`,` • LM Studio http://localhost:1234/v1`,` • llama.cpp http://localhost:8080/v1`,` • vLLM http://localhost:8000/v1`,` • mlx_lm http://localhost:8080/v1`,` • Jan http://localhost:1337/v1`,``,`Ollama needs OLLAMA_ORIGINS=* (or chrome-extension://*) so the`,`browser can reach it. macOS: launchctl setenv OLLAMA_ORIGINS "*".`].join(`
2
2
  `),requiresApiKey:!1,optionalApiKey:!0,apiKeyPlaceholder:`Leave empty for local servers, or paste a key for hosted endpoints`,apiKeyEnvVar:`LOCAL_LLM_API_KEY`,requiresBaseUrl:!0,baseUrlPlaceholder:`http://localhost:11434/v1`,baseUrlDescription:`Ollama: 11434 • LM Studio: 1234 • llama.cpp/mlx: 8080 • vLLM: 8000 • Jan: 1337. Trailing /v1 required.`,requiresDeployment:!0,deploymentPlaceholder:`llama3.1:8b, qwen2.5-coder:14b`,deploymentDescription:`Comma-separated model IDs from your server. List them with: curl <baseUrl>/models | jq -r .data[].id`,getModelIds:()=>{let e=p(n(u));return e.length===0?[{id:d,name:`Local LLM (set base URL + model IDs in Settings)`,api:`openai`}]:e.map(e=>({id:e,name:e,api:`openai`,input:[`text`],context_window:32e3,max_tokens:4096}))}};function p(e){return e?e.split(`,`).map(e=>e.trim()).filter(Boolean):[]}const m=`${u}-openai`;function h(e){return{...e,api:`openai-completions`}}function g(e){let t=e??{};return!t.apiKey||t.apiKey.length===0?{...t,apiKey:`local`}:t}const _=(e,t,n={})=>e.id===d?y(e,`Local LLM is not configured. Set base URL and model IDs in Settings.`):e.baseUrl?a(h(e),s(t),g(n)):y(e,`Local LLM base URL is required (e.g. http://localhost:11434/v1).`),v=(e,t,n)=>e.id===d?y(e,`Local LLM is not configured. Set base URL and model IDs in Settings.`):e.baseUrl?o(h(e),s(t),g(n)):y(e,`Local LLM base URL is required (e.g. http://localhost:11434/v1).`);function y(e,t){let n=r(),i={role:`assistant`,content:[],api:e.api,provider:e.provider,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,timestamp:Date.now()};return queueMicrotask(()=>{n.push({type:`error`,reason:`error`,error:i}),n.end()}),n}function b(){i({api:m,stream:_,streamSimple:v})}function x(e){return typeof e==`object`&&!!e&&`object`in e&&e.object===`list`}function S(e){return typeof e==`object`&&!!e&&`build_info`in e}function C(e){try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return e.replace(/\/v1\/?$/,``).replace(/\/+$/,``)}}function w(e){let t=e.replace(/\/+$/,``);try{let e=new URL(t);if(e.pathname===``||e.pathname===`/`)return`${t}/v1`}catch{}return t}async function T(e,t,n){let r=`${w(e)}/models`,i={Accept:`application/json`};t&&t.length>0&&(i.Authorization=`Bearer ${t}`);let a=await fetch(r,{method:`GET`,headers:i,signal:n});if(!a.ok)throw Error(`GET ${r} -> ${a.status} ${a.statusText}`);let o=await a.json();return Array.isArray(o.data)?o.data.map(e=>e.id??``).filter(e=>e.length>0):[]}async function E(e,t){let n=C(e),r=await O(`${n}/api/version`,t);if(r&&typeof r.version==`string`)return{kind:`ollama`,version:r.version};if(x(await O(`${n}/api/v0/models`,t)))return{kind:`lmstudio`};let i=await O(`${n}/props`,t);if(S(i))return{kind:`llamacpp`,version:i.build_info?.version};let a=D(e);return a===`11434`?{kind:`ollama`}:a===`1234`?{kind:`lmstudio`}:a===`8000`?{kind:`vllm`}:a===`1337`?{kind:`jan`}:{kind:`unknown`}}function D(e){try{return new URL(e).port||null}catch{return null}}async function O(e,t){try{let n=await fetch(e,{method:`GET`,signal:t});return n.ok?await n.json():null}catch{return null}}async function k(e,t,n){let r={kind:`unknown`};try{r=await E(e,n)}catch{}try{let i=await T(e,t,n);return{ok:!0,runtime:r,models:i}}catch(t){let n=t instanceof Error?t.message:String(t),i=A(n,r.kind);return l.warn(`verifyConnection failed`,{baseUrl:e,runtime:r.kind,message:n}),{ok:!1,runtime:r,models:[],error:i}}}function A(e,t){let n=e.toLowerCase();return n.includes(`failed to fetch`)||n.includes(`networkerror`)?t===`ollama`?{kind:`cors`,message:e,hint:'Ollama rejects requests from non-localhost origins by default. Set OLLAMA_ORIGINS=* (or chrome-extension://*) and restart Ollama. macOS: `launchctl setenv OLLAMA_ORIGINS "*"` then quit and relaunch the Ollama app.'}:{kind:`connection`,message:e,hint:`Server unreachable. Check the URL and that the server is running.`}:n.includes(` 401`)||n.includes(` 403`)?{kind:`auth`,message:e,hint:`Server returned an auth error. If your endpoint requires a key, set it in Settings.`}:/-> \d{3} /.test(e)?{kind:`http`,message:e}:{kind:`unknown`,message:e}}export{c as n,f as t};
@@ -1,2 +1,2 @@
1
- import{a as e}from"./diagnostics-Cag7MsZI.js";import{a as t}from"./compat-BAGLwgqY.js";import{r as n,s as r}from"./legacy-api-aliases-BjgG1CsY.js";import{t as i}from"./logger-DDBAeTLF.js";import{b as a}from"./account-store-Dcuv1CAr.js";import{n as o}from"./pi-transcript-context-miZCMig3.js";var s=i(`local-llm`),c=`local-llm`,l=`local`,u=`${c}-unconfigured`,d={id:c,name:`Local LLM (OpenAI-compatible)`,description:[`Connect to any OpenAI-compatible local model server.`,``,`Common base URLs:`,` • Ollama http://localhost:11434/v1`,` • LM Studio http://localhost:1234/v1`,` • llama.cpp http://localhost:8080/v1`,` • vLLM http://localhost:8000/v1`,` • mlx_lm http://localhost:8080/v1`,` • Jan http://localhost:1337/v1`,``,`Ollama needs OLLAMA_ORIGINS=* (or chrome-extension://*) so the`,`browser can reach it. macOS: launchctl setenv OLLAMA_ORIGINS "*".`].join(`
1
+ import{a as e}from"./diagnostics-Cag7MsZI.js";import{a as t}from"./compat-BAGLwgqY.js";import{r as n,s as r}from"./legacy-api-aliases-BjgG1CsY.js";import{t as i}from"./logger-DDBAeTLF.js";import{b as a}from"./account-store-BZBj_ntG.js";import{n as o}from"./pi-transcript-context-miZCMig3.js";var s=i(`local-llm`),c=`local-llm`,l=`local`,u=`${c}-unconfigured`,d={id:c,name:`Local LLM (OpenAI-compatible)`,description:[`Connect to any OpenAI-compatible local model server.`,``,`Common base URLs:`,` • Ollama http://localhost:11434/v1`,` • LM Studio http://localhost:1234/v1`,` • llama.cpp http://localhost:8080/v1`,` • vLLM http://localhost:8000/v1`,` • mlx_lm http://localhost:8080/v1`,` • Jan http://localhost:1337/v1`,``,`Ollama needs OLLAMA_ORIGINS=* (or chrome-extension://*) so the`,`browser can reach it. macOS: launchctl setenv OLLAMA_ORIGINS "*".`].join(`
2
2
  `),requiresApiKey:!1,optionalApiKey:!0,apiKeyPlaceholder:`Leave empty for local servers, or paste a key for hosted endpoints`,apiKeyEnvVar:`LOCAL_LLM_API_KEY`,requiresBaseUrl:!0,baseUrlPlaceholder:`http://localhost:11434/v1`,baseUrlDescription:`Ollama: 11434 • LM Studio: 1234 • llama.cpp/mlx: 8080 • vLLM: 8000 • Jan: 1337. Trailing /v1 required.`,requiresDeployment:!0,deploymentPlaceholder:`llama3.1:8b, qwen2.5-coder:14b`,deploymentDescription:`Comma-separated model IDs from your server. List them with: curl <baseUrl>/models | jq -r .data[].id`,getModelIds:()=>{let e=f(a(c));return e.length===0?[{id:u,name:`Local LLM (set base URL + model IDs in Settings)`,api:`openai`}]:e.map(e=>({id:e,name:e,api:`openai`,input:[`text`],context_window:32e3,max_tokens:4096}))}};function f(e){return e?e.split(`,`).map(e=>e.trim()).filter(Boolean):[]}var p=`openai-completions`,m=`${c}-openai`;function h(e){return{...e,api:p}}function g(e){let t=e??{};return!t.apiKey||t.apiKey.length===0?{...t,apiKey:l}:t}var _=(e,t,r={})=>e.id===u?y(e,`Local LLM is not configured. Set base URL and model IDs in Settings.`):e.baseUrl?n(h(e),o(t),g(r)):y(e,`Local LLM base URL is required (e.g. http://localhost:11434/v1).`),v=(e,t,n)=>e.id===u?y(e,`Local LLM is not configured. Set base URL and model IDs in Settings.`):e.baseUrl?r(h(e),o(t),g(n)):y(e,`Local LLM base URL is required (e.g. http://localhost:11434/v1).`);function y(t,n){let r=e(),i={role:`assistant`,content:[],api:t.api,provider:t.provider,model:t.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:n,timestamp:Date.now()};return queueMicrotask(()=>{r.push({type:`error`,reason:`error`,error:i}),r.end()}),r}function b(){t({api:m,stream:_,streamSimple:v})}function x(e){return typeof e==`object`&&!!e&&`object`in e&&e.object===`list`}function S(e){return typeof e==`object`&&!!e&&`build_info`in e}function C(e){try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return e.replace(/\/v1\/?$/,``).replace(/\/+$/,``)}}function w(e){let t=e.replace(/\/+$/,``);try{let e=new URL(t);if(e.pathname===``||e.pathname===`/`)return`${t}/v1`}catch{}return t}async function T(e,t,n){let r=`${w(e)}/models`,i={Accept:`application/json`};t&&t.length>0&&(i.Authorization=`Bearer ${t}`);let a=await fetch(r,{method:`GET`,headers:i,signal:n});if(!a.ok)throw Error(`GET ${r} -> ${a.status} ${a.statusText}`);let o=await a.json();return Array.isArray(o.data)?o.data.map(e=>e.id??``).filter(e=>e.length>0):[]}async function E(e,t){let n=C(e),r=await O(`${n}/api/version`,t);if(r&&typeof r.version==`string`)return{kind:`ollama`,version:r.version};if(x(await O(`${n}/api/v0/models`,t)))return{kind:`lmstudio`};let i=await O(`${n}/props`,t);if(S(i))return{kind:`llamacpp`,version:i.build_info?.version};let a=D(e);return a===`11434`?{kind:`ollama`}:a===`1234`?{kind:`lmstudio`}:a===`8000`?{kind:`vllm`}:a===`1337`?{kind:`jan`}:{kind:`unknown`}}function D(e){try{return new URL(e).port||null}catch{return null}}async function O(e,t){try{let n=await fetch(e,{method:`GET`,signal:t});return n.ok?await n.json():null}catch{return null}}async function k(e,t,n){let r={kind:`unknown`};try{r=await E(e,n)}catch{}try{let i=await T(e,t,n);return{ok:!0,runtime:r,models:i}}catch(t){let n=t instanceof Error?t.message:String(t),i=A(n,r.kind);return s.warn(`verifyConnection failed`,{baseUrl:e,runtime:r.kind,message:n}),{ok:!1,runtime:r,models:[],error:i}}}function A(e,t){let n=e.toLowerCase();return n.includes(`failed to fetch`)||n.includes(`networkerror`)?t===`ollama`?{kind:`cors`,message:e,hint:'Ollama rejects requests from non-localhost origins by default. Set OLLAMA_ORIGINS=* (or chrome-extension://*) and restart Ollama. macOS: `launchctl setenv OLLAMA_ORIGINS "*"` then quit and relaunch the Ollama app.'}:{kind:`connection`,message:e,hint:`Server unreachable. Check the URL and that the server is running.`}:n.includes(` 401`)||n.includes(` 403`)?{kind:`auth`,message:e,hint:`Server returned an auth error. If your endpoint requires a key, set it in Settings.`}:/-> \d{3} /.test(e)?{kind:`http`,message:e}:{kind:`unknown`,message:e}}export{d as config,E as detectRuntime,T as discoverModels,C as originOf,b as register,k as verifyConnection};