codesesh 1.0.7 → 1.0.9

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 (66) hide show
  1. package/README.md +17 -1
  2. package/dist/{chunk-WIWK7BXS.js → chunk-5YY675UR.js} +25 -26
  3. package/dist/chunk-5YY675UR.js.map +1 -0
  4. package/dist/{chunk-VVCSQU5B.js → chunk-CIMPLUT6.js} +6 -6
  5. package/dist/chunk-CIMPLUT6.js.map +1 -0
  6. package/dist/{chunk-QHWSZFRM.js → chunk-MOZLVHCC.js} +23 -5
  7. package/dist/chunk-MOZLVHCC.js.map +1 -0
  8. package/dist/{chunk-DE6UJMOY.js → chunk-QFG33PKR.js} +3 -2
  9. package/dist/chunk-QFG33PKR.js.map +1 -0
  10. package/dist/{chunk-YEQTRALH.js → chunk-RDTQ2WPR.js} +3 -3
  11. package/dist/chunk-RDTQ2WPR.js.map +1 -0
  12. package/dist/{chunk-SII3M66U.js → chunk-ZDH2BKQK.js} +701 -9
  13. package/dist/chunk-ZDH2BKQK.js.map +1 -0
  14. package/dist/{chunk-EYZ73CYP.js → chunk-ZLU7ODBV.js} +2 -2
  15. package/dist/{discovery-4WAEYSTR.js → discovery-MS2ZSMZ5.js} +5 -5
  16. package/dist/index.js +10 -10
  17. package/dist/index.js.map +1 -1
  18. package/dist/project-identity-worker.js +4 -4
  19. package/dist/scan-refresh-worker.js +6 -6
  20. package/dist/search-index-worker.js +6 -6
  21. package/dist/session-detail-worker.js +6 -6
  22. package/dist/smart-tag-worker.js +3 -3
  23. package/dist/web/assets/CustomTimeWindowDialog-CGPvUFkc.js +1 -0
  24. package/dist/web/assets/DetailLanding-Dgb2Qg8H.js +1 -0
  25. package/dist/web/assets/DialogTitle-B8zPwJB8.js +1 -0
  26. package/dist/web/assets/InteractiveReceipt-SckXLiPB.js +1 -0
  27. package/dist/web/assets/OverviewScreen-D44AMeDu.js +1 -0
  28. package/dist/web/assets/PrismHighlighter-D7JLjKja.js +6 -0
  29. package/dist/web/assets/Projects-DVHOqH2Z.js +1 -0
  30. package/dist/web/assets/SearchResultsPanel-B1WEw9Q5.js +1 -0
  31. package/dist/web/assets/SessionDetail-J00I4QfE.js +53 -0
  32. package/dist/web/assets/SmartTagChips-BMP9pPRw.js +1 -0
  33. package/dist/web/assets/{api-ToidoNW6.js → api-CtZGdxlN.js} +1 -1
  34. package/dist/web/assets/index-BIpTq_7T.js +1423 -0
  35. package/dist/web/assets/index-BXhaumu7.css +1 -0
  36. package/dist/web/assets/jsx-runtime-D3jfb0Ew.js +1 -0
  37. package/dist/web/assets/panel-B-5dVddJ.js +1 -0
  38. package/dist/web/assets/session-indexes-3LjxBYNe.js +4 -0
  39. package/dist/web/assets/translate-CLoII3EO.js +2 -0
  40. package/dist/web/assets/utils-BuYa9y6l.js +1 -0
  41. package/dist/web/icon/agent/cherrystudio.svg +7 -0
  42. package/dist/web/icon/agent/deepchat.LICENSE.txt +206 -0
  43. package/dist/web/icon/agent/deepchat.svg +6 -0
  44. package/dist/web/index.html +10 -196
  45. package/package.json +3 -3
  46. package/dist/chunk-DE6UJMOY.js.map +0 -1
  47. package/dist/chunk-QHWSZFRM.js.map +0 -1
  48. package/dist/chunk-SII3M66U.js.map +0 -1
  49. package/dist/chunk-VVCSQU5B.js.map +0 -1
  50. package/dist/chunk-WIWK7BXS.js.map +0 -1
  51. package/dist/chunk-YEQTRALH.js.map +0 -1
  52. package/dist/web/assets/CustomTimeWindowDialog-CVURkiVO.js +0 -1
  53. package/dist/web/assets/InteractiveReceipt-DGC-xV7U.js +0 -1
  54. package/dist/web/assets/OverviewScreen-DoXrZ5qp.js +0 -1
  55. package/dist/web/assets/PrismHighlighter-02695Lmx.js +0 -6
  56. package/dist/web/assets/Projects-DZiYh6hp.js +0 -1
  57. package/dist/web/assets/SearchResultsPanel-CAQe8Di0.js +0 -1
  58. package/dist/web/assets/SessionDetail-Da8EBygt.js +0 -53
  59. package/dist/web/assets/index-Bl8pbRFj.js +0 -1423
  60. package/dist/web/assets/index-CRI1m3xN.css +0 -1
  61. package/dist/web/assets/jsx-runtime-B-hcVAMW.js +0 -1
  62. package/dist/web/assets/session-indexes-D5gps7K8.js +0 -4
  63. package/dist/web/assets/translate-BDFu3ZiK.js +0 -2
  64. package/dist/web/assets/utils-BIZi2up3.js +0 -1
  65. /package/dist/{chunk-EYZ73CYP.js.map → chunk-ZLU7ODBV.js.map} +0 -0
  66. /package/dist/{discovery-4WAEYSTR.js.map → discovery-MS2ZSMZ5.js.map} +0 -0
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-D3jfb0Ew.js";import{n as t,t as n}from"./translate-CLoII3EO.js";import"./api-CtZGdxlN.js";var r=[`bugfix`,`refactoring`,`feature-dev`,`testing`,`docs`,`git-ops`,`build-deploy`,`exploration`,`planning`],i=e(),a=Object.fromEntries(r.map(e=>[e,{text:`var(--tag-${e}-text)`,border:`var(--tag-${e}-border)`,background:`var(--tag-${e}-background)`,bar:`var(--tag-${e}-bar)`}]));function o(e){return a[e]}function s(e){let t=o(e);return{color:t.text,borderColor:t.border,backgroundColor:t.background}}function c({tags:e,limit:r=4,className:a=``}){if(t(),!e||e.length===0)return null;let o=e.slice(0,r),c=e.length-o.length;return(0,i.jsxs)(`div`,{className:`flex flex-wrap gap-1 ${a}`,children:[o.map(e=>(0,i.jsx)(`span`,{className:`console-mono rounded-sm border px-1.5 py-0.5 text-[10px] font-medium`,style:s(e),children:n(e)},n(e))),c>0?(0,i.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5 text-[10px] text-[var(--console-muted)]`,children:[`+`,c]}):null]})}export{r as n,c as t};
@@ -1 +1 @@
1
- import{j as e,s as t}from"./translate-BDFu3ZiK.js";var n=250,r=2,i=class extends Error{status;constructor(e,t){super(e),this.status=t}};function a(e,t){t?.from!=null&&e.set(`from`,new Date(t.from).toISOString()),t?.to!=null&&e.set(`to`,new Date(t.to).toISOString())}function o(o){async function s(e,t){let n=await fetch(e,o.authorize(t));if(!n.ok)throw new i(`${t?.method??`GET`} ${e} failed: ${n.status} ${n.statusText}`,n.status);return n.json()}async function c(e){return s(`/api/config`,e)}async function l(){return s(`/api/status`)}async function u(e,t){let n=new URLSearchParams;return a(n,e),s(`/api/agents?${n}`,t)}async function d(e,t){let n=new URLSearchParams;return a(n,e),n.set(`limit`,t?.project?`1`:`100`),t?.cursor&&n.set(`cursor`,t.cursor),t?.project&&(n.set(`projectKind`,t.project.kind),n.set(`projectKey`,t.project.key)),s(`/api/projects?${n}`,t?.signal?{signal:t.signal}:void 0)}async function f(e,t,n){return(await d(e,{...n,project:t})).projects[0]??null}async function p(e={},t,o){let c=new URLSearchParams;e.agent&&c.set(`agent`,e.agent),e.projectKind&&c.set(`projectKind`,e.projectKind),e.projectKey&&c.set(`projectKey`,e.projectKey),a(c,e);let l=0;for(;;)try{let e=[],r;do{let i=new URLSearchParams(c);i.set(`limit`,String(n)),r&&i.set(`cursor`,r);let a=await s(`/api/sessions?${i}`,t);e.push(...a.sessions),r||o?.onFirstPage?.([...e]),r=a.nextCursor}while(r);return{sessions:e}}catch(e){if(!(e instanceof i)||e.status!==409||l>=r)throw e;l+=1}}async function m(n,r,i){let a=`/api/sessions${e({agentName:n,sessionId:r})}`,o=i?{signal:i.signal,...i.operationId?{headers:{[t]:i.operationId}}:{}}:void 0;return i?.messageCursor?s(`${a}?${new URLSearchParams({messageCursor:i.messageCursor})}`,o):s(a,o)}async function h(e,t,n){let r=new URLSearchParams;e?.days===0?r.set(`days`,`0`):e?.from==null?(e?.to!=null&&r.set(`to`,String(e.to)),e?.days!=null&&r.set(`days`,String(e.days))):a(r,e),t.project&&(r.set(`projectKind`,t.project.kind),r.set(`projectKey`,t.project.key)),t.agent&&r.set(`agent`,t.agent),r.set(`timeZone`,t.timeZone??Intl.DateTimeFormat().resolvedOptions().timeZone);let i=r.toString();return s(i?`/api/dashboard?${i}`:`/api/dashboard`,n)}async function g(e,t={},n){let r=new URLSearchParams;return r.set(`q`,e),t.agent&&r.set(`agent`,t.agent),t.projectKind&&r.set(`projectKind`,t.projectKind),t.projectKey&&r.set(`projectKey`,t.projectKey),t.tag&&r.set(`tag`,t.tag),t.tool&&r.set(`tool`,t.tool),t.fileKind&&r.set(`fileActivity`,t.fileKind),t.costMin!=null&&r.set(`costMin`,String(t.costMin)),t.costMax!=null&&r.set(`costMax`,String(t.costMax)),a(r,t),s(`/api/search?${r}`,n)}async function _(e){return s(`/api/bookmarks`,e)}async function v(e){return s(`/api/bookmarks`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({reference:e})})}async function y(e){return s(`/api/bookmarks/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}async function b(t){await s(`/api/bookmarks${e(t)}`,{method:`DELETE`})}async function x(t,n,r){await s(`/api/session-aliases${e({agentName:t,sessionId:n})}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({alias:r})})}async function S(t,n){await s(`/api/session-aliases${e({agentName:t,sessionId:n})}`,{method:`DELETE`})}return Object.freeze({fetchConfig:c,fetchScanStatus:l,fetchAgents:u,fetchProjects:d,fetchProject:f,fetchSessions:p,fetchSessionData:m,fetchDashboard:h,fetchSearchResults:g,fetchBookmarks:_,upsertBookmark:v,importBookmarks:y,deleteBookmark:b,upsertSessionAlias:x,deleteSessionAlias:S})}function s(e){return Object.freeze({logClientEvent(t,n={}){try{let r=JSON.stringify({event:t,data:n});if(!e.hasCredentials&&typeof navigator<`u`&&navigator.sendBeacon){let e=new Blob([r],{type:`application/json`});if(navigator.sendBeacon(`/api/logs`,e))return}fetch(`/api/logs`,e.authorize({method:`POST`,headers:{"Content-Type":`application/json`},body:r,keepalive:!0})).catch(()=>{})}catch{}}})}var c=`access_token`,l=`codesesh:remote-access-token`;function u(e,t){return Object.freeze({hasCredentials:e!==null,authorize(t={}){if(!e)return t;let n=new Headers(t.headers);return n.set(`Authorization`,`Bearer ${e}`),{...t,headers:n}},eventUrl(n){if(!e)return n;let r=new URL(n,t);return r.searchParams.set(c,e),`${r.pathname}${r.search}`}})}function d(e=typeof window>`u`?void 0:window){if(!e)return u(null,`http://localhost`);let t=new URL(e.location.href),n=t.searchParams.get(c);if(n){try{e.sessionStorage.setItem(l,n)}catch{}return t.searchParams.delete(c),e.history.replaceState(e.history.state,``,`${t.pathname}${t.search}${t.hash}`),u(n,e.location.origin)}let r=null;try{r=e.sessionStorage.getItem(l)}catch{}return u(r,e.location.origin)}var f=1e3,p=3e4,m=5e3;function h(e){let t=e*.2;return e+(Math.random()*2-1)*t}function g(e){return function(t,n,r,i){let a=!1,o,s,c=f,l=!1,u=!1,d,g=()=>{s!==void 0&&(clearTimeout(s),s=void 0)},_=()=>{u||(u=!0,i?.())},v=()=>{let i=new EventSource(e.eventUrl(`/api/events`));d=i,i.addEventListener(`sessions-updated`,e=>{try{t(JSON.parse(e.data))}catch(e){console.error(`Failed to parse session update event:`,e)}}),i.addEventListener(`scan-status`,e=>{if(n)try{n(JSON.parse(e.data))}catch(e){console.error(`Failed to parse scan status event:`,e)}}),i.onopen=()=>{g(),c=f;let e=u;u=!1,(l||e)&&r?.(),l=!0},i.onerror=()=>{if(i.readyState!==EventSource.CLOSED){s??=setTimeout(()=>{s=void 0,!a&&d===i&&_()},m);return}if(g(),i.close(),a)return;_();let e=h(c);c=Math.min(c*2,p),o=setTimeout(v,e)}};return v(),()=>{a=!0,o!==void 0&&clearTimeout(o),g(),d?.close()}}}var _=d(),{fetchConfig:v,fetchScanStatus:y,fetchAgents:b,fetchProjects:x,fetchProject:S,fetchSessions:C,fetchSessionData:w,fetchDashboard:T,fetchSearchResults:E,fetchBookmarks:D,upsertBookmark:O,importBookmarks:k,deleteBookmark:A,upsertSessionAlias:j,deleteSessionAlias:M}=o(_),{logClientEvent:N}=s(_),P=g(_);export{j as _,v as a,x as c,w as d,C as f,O as g,P as h,D as i,y as l,N as m,M as n,T as o,k as p,b as r,S as s,A as t,E as u,i as v};
1
+ import{j as e,s as t}from"./translate-CLoII3EO.js";var n=250,r=2,i=class extends Error{status;constructor(e,t){super(e),this.status=t}};function a(e,t){t?.from!=null&&e.set(`from`,new Date(t.from).toISOString()),t?.to!=null&&e.set(`to`,new Date(t.to).toISOString())}function o(o){async function s(e,t){let n=await fetch(e,o.authorize(t));if(!n.ok)throw new i(`${t?.method??`GET`} ${e} failed: ${n.status} ${n.statusText}`,n.status);return n.json()}async function c(e){return s(`/api/config`,e)}async function l(){return s(`/api/status`)}async function u(e,t){let n=new URLSearchParams;return a(n,e),s(`/api/agents?${n}`,t)}async function d(e,t){let n=new URLSearchParams;return a(n,e),n.set(`limit`,t?.project?`1`:`100`),t?.cursor&&n.set(`cursor`,t.cursor),t?.project&&(n.set(`projectKind`,t.project.kind),n.set(`projectKey`,t.project.key)),s(`/api/projects?${n}`,t?.signal?{signal:t.signal}:void 0)}async function f(e,t,n){return(await d(e,{...n,project:t})).projects[0]??null}async function p(e={},t,o){let c=new URLSearchParams;e.agent&&c.set(`agent`,e.agent),e.projectKind&&c.set(`projectKind`,e.projectKind),e.projectKey&&c.set(`projectKey`,e.projectKey),a(c,e);let l=0;for(;;)try{let e=[],r;do{let i=new URLSearchParams(c);i.set(`limit`,String(n)),r&&i.set(`cursor`,r);let a=await s(`/api/sessions?${i}`,t);e.push(...a.sessions),r||o?.onFirstPage?.([...e]),r=a.nextCursor}while(r);return{sessions:e}}catch(e){if(!(e instanceof i)||e.status!==409||l>=r)throw e;l+=1}}async function m(n,r,i){let a=`/api/sessions${e({agentName:n,sessionId:r})}`,o=i?{signal:i.signal,...i.operationId?{headers:{[t]:i.operationId}}:{}}:void 0;return i?.messageCursor?s(`${a}?${new URLSearchParams({messageCursor:i.messageCursor})}`,o):s(a,o)}async function h(e,t,n){let r=new URLSearchParams;e?.days===0?r.set(`days`,`0`):e?.from==null?(e?.to!=null&&r.set(`to`,String(e.to)),e?.days!=null&&r.set(`days`,String(e.days))):a(r,e),t.project&&(r.set(`projectKind`,t.project.kind),r.set(`projectKey`,t.project.key)),t.agent&&r.set(`agent`,t.agent),r.set(`timeZone`,t.timeZone??Intl.DateTimeFormat().resolvedOptions().timeZone);let i=r.toString();return s(i?`/api/dashboard?${i}`:`/api/dashboard`,n)}async function g(e,t={},n){let r=new URLSearchParams;return r.set(`q`,e),t.agent&&r.set(`agent`,t.agent),t.projectKind&&r.set(`projectKind`,t.projectKind),t.projectKey&&r.set(`projectKey`,t.projectKey),t.tag&&r.set(`tag`,t.tag),t.tool&&r.set(`tool`,t.tool),t.fileKind&&r.set(`fileActivity`,t.fileKind),t.costMin!=null&&r.set(`costMin`,String(t.costMin)),t.costMax!=null&&r.set(`costMax`,String(t.costMax)),a(r,t),s(`/api/search?${r}`,n)}async function _(e){return s(`/api/bookmarks`,e)}async function v(e){return s(`/api/bookmarks`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({reference:e})})}async function y(e){return s(`/api/bookmarks/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}async function b(t){await s(`/api/bookmarks${e(t)}`,{method:`DELETE`})}async function x(t,n,r){await s(`/api/session-aliases${e({agentName:t,sessionId:n})}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({alias:r})})}async function S(t,n){await s(`/api/session-aliases${e({agentName:t,sessionId:n})}`,{method:`DELETE`})}return Object.freeze({fetchConfig:c,fetchScanStatus:l,fetchAgents:u,fetchProjects:d,fetchProject:f,fetchSessions:p,fetchSessionData:m,fetchDashboard:h,fetchSearchResults:g,fetchBookmarks:_,upsertBookmark:v,importBookmarks:y,deleteBookmark:b,upsertSessionAlias:x,deleteSessionAlias:S})}function s(e){return Object.freeze({logClientEvent(t,n={}){try{let r=JSON.stringify({event:t,data:n});if(!e.hasCredentials&&typeof navigator<`u`&&navigator.sendBeacon){let e=new Blob([r],{type:`application/json`});if(navigator.sendBeacon(`/api/logs`,e))return}fetch(`/api/logs`,e.authorize({method:`POST`,headers:{"Content-Type":`application/json`},body:r,keepalive:!0})).catch(()=>{})}catch{}}})}var c=`access_token`,l=`codesesh:remote-access-token`;function u(e,t){return Object.freeze({hasCredentials:e!==null,authorize(t={}){if(!e)return t;let n=new Headers(t.headers);return n.set(`Authorization`,`Bearer ${e}`),{...t,headers:n}},eventUrl(n){if(!e)return n;let r=new URL(n,t);return r.searchParams.set(c,e),`${r.pathname}${r.search}`}})}function d(e=typeof window>`u`?void 0:window){if(!e)return u(null,`http://localhost`);let t=new URL(e.location.href),n=t.searchParams.get(c);if(n){try{e.sessionStorage.setItem(l,n)}catch{}return t.searchParams.delete(c),e.history.replaceState(e.history.state,``,`${t.pathname}${t.search}${t.hash}`),u(n,e.location.origin)}let r=null;try{r=e.sessionStorage.getItem(l)}catch{}return u(r,e.location.origin)}var f=1e3,p=3e4,m=5e3;function h(e){let t=e*.2;return e+(Math.random()*2-1)*t}function g(e){return function(t,n,r,i){let a=!1,o,s,c=f,l=!1,u=!1,d,g=()=>{s!==void 0&&(clearTimeout(s),s=void 0)},_=()=>{u||(u=!0,i?.())},v=()=>{let i=new EventSource(e.eventUrl(`/api/events`));d=i,i.addEventListener(`sessions-updated`,e=>{try{t(JSON.parse(e.data))}catch(e){console.error(`Failed to parse session update event:`,e)}}),i.addEventListener(`scan-status`,e=>{if(n)try{n(JSON.parse(e.data))}catch(e){console.error(`Failed to parse scan status event:`,e)}}),i.onopen=()=>{g(),c=f;let e=u;u=!1,(l||e)&&r?.(),l=!0},i.onerror=()=>{if(i.readyState!==EventSource.CLOSED){s??=setTimeout(()=>{s=void 0,!a&&d===i&&_()},m);return}if(g(),i.close(),a)return;_();let e=h(c);c=Math.min(c*2,p),o=setTimeout(v,e)}};return v(),()=>{a=!0,o!==void 0&&clearTimeout(o),g(),d?.close()}}}var _=d(),{fetchConfig:v,fetchScanStatus:y,fetchAgents:b,fetchProjects:x,fetchProject:S,fetchSessions:C,fetchSessionData:w,fetchDashboard:T,fetchSearchResults:E,fetchBookmarks:D,upsertBookmark:O,importBookmarks:k,deleteBookmark:A,upsertSessionAlias:j,deleteSessionAlias:M}=o(_),{logClientEvent:N}=s(_),P=g(_);export{j as _,v as a,x as c,w as d,C as f,O as g,P as h,D as i,y as l,N as m,M as n,T as o,k as p,b as r,S as s,A as t,E as u,i as v};