cctally 1.117.2 → 1.118.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +7 -3
- package/bin/_cctally_cache.py +2783 -175
- package/bin/_cctally_completion.py +106 -33
- package/bin/_cctally_core.py +69 -4
- package/bin/_cctally_dashboard.py +188 -13
- package/bin/_cctally_dashboard_conversation.py +5 -1
- package/bin/_cctally_dashboard_envelope.py +50 -19
- package/bin/_cctally_dashboard_sources.py +23 -1
- package/bin/_cctally_db.py +193 -153
- package/bin/_cctally_diagnosis_sources.py +63 -7
- package/bin/_cctally_doctor.py +865 -93
- package/bin/_cctally_five_hour.py +67 -50
- package/bin/_cctally_forecast.py +35 -13
- package/bin/_cctally_journal.py +186 -18
- package/bin/_cctally_milestone_history.py +859 -62
- package/bin/_cctally_oauth_samples.py +286 -15
- package/bin/_cctally_parser.py +2 -2
- package/bin/_cctally_quota.py +104 -12
- package/bin/_cctally_record.py +153 -29
- package/bin/_cctally_rederive.py +608 -68
- package/bin/_cctally_statusline.py +108 -81
- package/bin/_cctally_store.py +179 -38
- package/bin/_cctally_tui.py +892 -181
- package/bin/_cctally_update.py +32 -13
- package/bin/_lib_codex_conversation_query.py +52 -14
- package/bin/_lib_codex_drain_admission.py +224 -6
- package/bin/_lib_codex_metadata.py +39 -0
- package/bin/_lib_conversation_anon.py +15 -8
- package/bin/_lib_conversation_dispatch.py +7 -0
- package/bin/_lib_conversation_query.py +289 -70
- package/bin/_lib_dashboard_sources.py +37 -1
- package/bin/_lib_detector_access_registry.py +497 -26
- package/bin/_lib_doctor.py +85 -20
- package/bin/_lib_doctor_scan_index.py +321 -0
- package/bin/_lib_ingest_frontier.py +20 -1
- package/bin/_lib_oauth_samples.py +23 -7
- package/bin/_lib_pricing.py +146 -16
- package/bin/_lib_quota.py +19 -0
- package/bin/_lib_rederive.py +11 -6
- package/bin/_lib_retained_records.py +516 -0
- package/bin/_lib_snapshot_cache.py +10 -0
- package/bin/_lib_stale_proof.py +272 -43
- package/bin/_lib_stats_content_revision.py +831 -0
- package/bin/_lib_write_io.py +11 -4
- package/bin/cctally +4 -1
- package/dashboard/static/assets/ConversationsView-D4Iv4ku0.js +72 -0
- package/dashboard/static/assets/{DoctorModal-B0DnU9d9.js → DoctorModal-D4QSq6uz.js} +1 -1
- package/dashboard/static/assets/ModalRoot-C9F5dhZi.js +1 -0
- package/dashboard/static/assets/{ProjectsDrillPanel-DSxXQSa-.js → ProjectsDrillPanel-WxAdRDMt.js} +1 -1
- package/dashboard/static/assets/{SourceDetailModal-BleDpQqG.js → SourceDetailModal-NyyEfXmc.js} +1 -1
- package/dashboard/static/assets/{UpdateModal-CMqaAkSK.js → UpdateModal-CFLq9pT1.js} +1 -1
- package/dashboard/static/assets/{index-BjQV-0-D.js → index-BKTWH9JE.js} +2 -2
- package/dashboard/static/assets/{outlineNavigation-CO-VWBm7.js → outlineNavigation-BnGUwCS3.js} +3 -3
- package/dashboard/static/dashboard.html +1 -1
- package/package.json +4 -1
- package/dashboard/static/assets/ConversationsView-oqNsWzWV.js +0 -72
- package/dashboard/static/assets/ModalRoot-CYua2wP_.js +0 -1
package/dashboard/static/assets/{outlineNavigation-CO-VWBm7.js → outlineNavigation-BnGUwCS3.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{Ft as e,Rt as t,_t as n,ft as r,ht as i}from"./useKeymap-CUgEnnua.js";import{Ft as a}from"./index-BjQV-0-D.js";var o=t(e(),1),s=class extends Error{status;constructor(e){super(`HTTP ${e}`),this.status=e,this.name=`HttpError`}};function c(e){return e?.name===`AbortError`}async function l(e,t){let n=await fetch(e,t?{signal:t}:void 0);if(!n.ok)throw new s(n.status);return await n.json()}function u(e){let t=e?.data_version;return typeof t==`string`&&t!==``?t:e?.generated_at??``}var d={legacy_bridge_pending:{reason:`legacy_bridge_pending`,message:`Transcripts have not finished moving into the conversation store. Run cctally cache-sync to finish the import.`,retryable:!1},maintenance:{reason:`maintenance`,message:`The conversation store is busy with maintenance. Conversations return once it finishes.`,retryable:!0},schema_behind:{reason:`schema_behind`,message:`The conversation store is behind this version of cctally. Run cctally cache-sync to bring it up to date.`,retryable:!1},schema_ahead:{reason:`schema_ahead`,message:`The conversation store was written by a newer version of cctally. Update cctally to read it.`,retryable:!1}},f={reason:`unavailable`,message:`The conversation store is not available right now.`,retryable:!0};function p(e){if(typeof e!=`object`||!e)return null;let t=e;return t.status===`degraded`?typeof t.degraded_reason==`string`&&t.degraded_reason?t.degraded_reason:f.reason:null}function m(e){return d[e]??{...f,reason:e||f.reason}}function h(e,t,n){n!==void 0&&e.append(t,String(n))}function g(e,t={}){let n=new URLSearchParams;return n.append(`source`,e),h(n,`account`,t.accountKey),h(n,`project_key`,t.projectKey),h(n,`model`,t.model),h(n,`limit`,t.limit),h(n,`cursor`,t.cursor),h(n,`selected`,t.selected),`/api/conversations?${n.toString()}`}function _(e,t){let n=new URLSearchParams({source:e});return h(n,`account`,t),`/api/conversations/facets?${n.toString()}`}function v(e,t){let n=new URLSearchParams;return n.append(`source`,e),h(n,`account`,t.accountKey),n.append(`q`,t.query),h(n,`kind`,t.kind),h(n,`limit`,t.limit),h(n,`cursor`,t.cursor),`/api/conversation/search?${n.toString().replace(/\+/g,`%20`)}`}var y={detail:``,outline:`/outline`,find:`/find`,prompts:`/prompts`,payload:`/payload`,export:`/export`,"anon-map":`/anon-map`,events:`/events`,media:`/media`};function b(e,t,r){let i=n(e);if(i.source===`codex`&&!i.key.startsWith(`v1.`))throw Error(`Codex conversation keys must be qualified`);let a=new URLSearchParams;h(a,`account`,i.account_key);for(let[e,t]of Object.entries(r??{}))t!==void 0&&a.append(e,typeof t==`boolean`?t?`1`:`0`:String(t));let o=a.size?`?${a.toString().replace(/\+/g,`%20`)}`:``;return`/api/conversation/${encodeURIComponent(i.key)}${y[t]}${o}`}function x(e){let t=e.native_card;return t?.type===`session_ref`?t.scope===`shell`&&t.ref!=null?[t.ref]:[]:t?.type===`program`?t.invocations.flatMap(e=>e.kind===`session`&&e.scope===`shell`&&e.ref!=null?[e.ref]:[]):[]}function S(e,t){return t==null?``:e===`shell`?`session ${t}`:`cell ${t}`}function C(e,t){return t==null?``:e===`shell`?`s${t}`:`c${t}`}function w(e){return e===`write`?`wrote to`:`polled`}function T(e){return e===`write`?`wrote`:`poll`}var E=60;function D(e){let t=e.replace(/\s+/g,` `).trim();return t.length>E?`${t.slice(0,E)}…`:t}function O(e){let t=new Set(e.flatMap(e=>x(e)));return t.size===1?[...t][0]:null}function k(e,t,n,r){if(!e||t!==`shell`||n==null)return`silent`;let i=e.sessions[n];return i?.opener_block_key==null?e.truncated?`index_truncated`:`not_retained`:r!=null&&r===i.opener_block_key?`opener`:`silent`}function A(e){return new Set(e.map(e=>e.parent_uuid))}function j(e){let t=new Map;for(let n of e){let e=t.get(n.parent_uuid);e?e.push(n):t.set(n.parent_uuid,[n])}return t}function M(e){return e.kind===`reasoning`?e.landmark_key:e.block_key}var N={tool_error:`error`,plan:`plan`,reasoning:`heading`};function P(e,t){if(!t?.length)return[];let n=j(t),r=[];return e.forEach((e,t)=>{for(let i of n.get(e.uuid)??[])r.push({landmark:i,ownerTurnIndex:t})}),r}var F=class extends Error{constructor(){super(`Conversation indexing is still finishing.`)}},I=class extends Error{reason;constructor(e){let t=m(e);super(t.message),this.name=`ConversationDegraded`,this.reason=t.reason}};function L(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function ee(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function R(e){if(e)return e.source===`codex`||`cached_input`in e||`reasoning_output`in e?{source:`codex`,input:L(e.input),output:L(e.output),cache_creation:0,cache_read:0,cached_input:L(e.cached_input),reasoning_output:L(e.reasoning_output)}:{source:`claude`,input:L(e.input),output:L(e.output),cache_creation:L(e.cache_creation??e.cache_create),cache_read:L(e.cache_read)}}function te(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0||1}function z(e){if(typeof e!=`string`||e.trim()===``)return null;try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{value:t}}catch{return{raw:e}}}var ne=new Set([`create_branch`,`stage`,`commit`,`push`,`create_pr`]);function B(e){return typeof e==`string`&&e.trim()!==``?e.trim():void 0}function re(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let n of e){let e=V(n);if(!e||typeof e.key!=`string`||typeof e.text!=`string`)return;t.push({key:e.key,text:e.text})}return t}function ie(e){let t=V(e.detail?.reasoning);if(t?.schema_version===1){let n=B(t.title),r=B(t.summary),i=B(t.body);if(!n&&!r&&!i)return null;let a=re(t.headings);return{kind:`codex_reasoning`,source:B(t.source)??`codex`,title:n,summary:r,body:i,...a?{headings:a}:{},...e.block_key?{block_key:e.block_key}:{}}}let n=B(e.text);return n?{kind:`codex_reasoning`,source:`codex`,body:n,...e.block_key?{block_key:e.block_key}:{}}:null}function ae(e){if(!Array.isArray(e)||e.length===0)return null;let t=[];for(let n of e){let e=V(n);if(!e||e.schema_version!==1)return null;if(e.type===`git`&&typeof e.action==`string`&&ne.has(e.action)){t.push({type:`git`,action:e.action,...e.action===`create_pr`&&typeof e.draft==`boolean`?{draft:e.draft}:{}});continue}if(e.type===`memory_citation`&&Number.isSafeInteger(e.citation_count)&&Number(e.citation_count)>=0&&Number.isSafeInteger(e.rollout_count)&&Number(e.rollout_count)>=0){t.push({type:`memory_citation`,citation_count:Number(e.citation_count),rollout_count:Number(e.rollout_count)});continue}return null}return t}function oe(e){let t=V(e.detail?.lifecycle);return t?.schema_version!==1||t.event!==`task_started`&&t.event!==`task_complete`?null:{kind:`codex_lifecycle`,event:t.event,...B(t.message)?{message:B(t.message)}:{},...B(t.error)?{error:B(t.error)}:{},...typeof t.duration_ms==`number`&&Number.isFinite(t.duration_ms)?{duration_ms:t.duration_ms}:{},...e.block_key?{payload_key:e.block_key}:{}}}function V(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:null}function se(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){let e=V(n);if(!e)return null;let r={};for(let t of[`path`,`move_path`,`status`])typeof e[t]==`string`&&(r[t]=e[t]);t.push(r)}return t}function ce(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){let e=V(n);if(!e)return null;let r={};for(let t of[`path`,`move_path`,`status`,`unified_diff`,`raw`,`raw_extra`])typeof e[t]==`string`&&(r[t]=e[t]);typeof e.truncated==`boolean`&&(r.truncated=e.truncated),(e.diff_source===`retained`||e.diff_source===`derived`)&&(r.diff_source=e.diff_source),t.push(r)}return t}function H(e){let t=V(e);if(t?.schema_version!==1||t.type!==`terminal_output`||!Array.isArray(t.parts))return;let n=t.parts.map(e=>{let t=V(e);if(!t||t.type!==`text`&&t.type!==`raw`||typeof t.text!=`string`)return null;let n=t.stream===`stdout`||t.stream===`stderr`?t.stream:`output`;return{type:t.type,stream:n,text:t.text}});if(!n.some(e=>e==null))return{schema_version:1,type:`terminal_output`,status:typeof t.status==`string`?t.status:`unknown`,is_error:t.is_error===!0,parts:n,truncated:t.truncated===!0,...typeof t.exit_code==`number`||t.exit_code===null?{exit_code:t.exit_code}:{},...typeof t.wall_time_seconds==`number`||t.wall_time_seconds===null?{wall_time_seconds:t.wall_time_seconds}:{}}}var le=new Set([`completed`,`failed`,`error`,`running`,`unknown`]),U=new Set([`failed`,`error`]);function ue(e){if(e)return{status:le.has(e.status)?e.status:`unknown`,exit_code:typeof e.exit_code==`number`?e.exit_code:null,wall_time_seconds:typeof e.wall_time_seconds==`number`?e.wall_time_seconds:null}}function de(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let n of e){let e=V(n);if(!e)return;if(e.kind===`command`){if(typeof e.command!=`string`)return;t.push({kind:`command`,command:e.command,workdir:typeof e.workdir==`string`?e.workdir:null,metadata:V(e.metadata)??{}});continue}if(e.kind===`session`){if(e.scope!==`shell`&&e.scope!==`cell`||e.operation!==`write`&&e.operation!==`poll`)return;t.push({kind:`session`,scope:e.scope,operation:e.operation,ref:typeof e.ref==`string`?e.ref:null,chars:typeof e.chars==`string`?e.chars:null});continue}if(e.kind===`other`&&typeof e.name==`string`&&e.name!==``){t.push({kind:`other`,name:e.name});continue}return}return t}function fe(e){let t=de(e.invocations);if(!(!t||typeof e.complete!=`boolean`||typeof e.truncated!=`boolean`))return{schema_version:1,type:`program`,title:typeof e.title==`string`?e.title:null,complete:e.complete,invocations:t,truncated:e.truncated}}function pe(e){if(!(e.scope!==`shell`&&e.scope!==`cell`||e.operation!==`write`&&e.operation!==`poll`||typeof e.truncated!=`boolean`))return{schema_version:1,type:`session_ref`,scope:e.scope,operation:e.operation,ref:typeof e.ref==`string`?e.ref:null,chars:typeof e.chars==`string`?e.chars:null,truncated:e.truncated}}function me(e){if(typeof e.query==`string`)return{schema_version:1,type:`tool_search`,query:e.query,limit:typeof e.limit==`number`&&Number.isFinite(e.limit)?e.limit:null,...e.truncated===!0?{truncated:!0}:{}}}function he(e){let t=V(e),n=V(t?.sessions);if(!t||!n||typeof t.truncated!=`boolean`)return;let r=Object.create(null);for(let[e,t]of Object.entries(n)){let n=V(t);if(!n||!Number.isSafeInteger(n.ordinal)||n.opener_block_key!==null&&typeof n.opener_block_key!=`string`)return;r[e]={ordinal:n.ordinal,opener_block_key:n.opener_block_key}}return{sessions:r,truncated:t.truncated}}function ge(e){let t=V(e);if(t?.schema_version!==1||typeof t.name!=`string`||t.name===``||!(`input`in t)||typeof t.truncated!=`boolean`)return null;let n=t.span,r=Array.isArray(n)&&n.length===2&&Number.isSafeInteger(n[0])&&Number.isSafeInteger(n[1])&&n[0]>=0&&n[1]>=n[0]?[n[0],n[1]]:null;return{block:{kind:`external_call`,name:t.name,input:t.input,truncated:t.truncated},span:r}}function _e(e){let t=V(e);return!t||typeof t.status!=`string`||typeof t.truncated!=`boolean`||!(`value`in t)?null:{status:t.status,value:t.value,truncated:t.truncated}}function ve(e){if(e.source!==`update_plan`||typeof e.call_status!=`string`||!Array.isArray(e.items))return;let t=e.items.map(e=>{let t=V(e);return t&&typeof t.step==`string`&&typeof t.status==`string`?{step:t.step,status:t.status}:null}),n=e.result===void 0?void 0:_e(e.result);if(!(t.some(e=>e==null)||e.result!==void 0&&!n))return{schema_version:1,type:`plan`,source:`update_plan`,call_status:e.call_status,explanation:typeof e.explanation==`string`?e.explanation:null,items:t,...n?{result:n}:{}}}function ye(e){let t=V(e.completion);if(e.source!==`web_search_call`||typeof e.call_status!=`string`||typeof e.query!=`string`||!V(e.action)||!t||typeof t.status!=`string`||typeof t.query!=`string`||!V(t.action)||!Array.isArray(t.results))return;let n=t.results.map(e=>{let t=V(e);return!t||typeof t.title!=`string`||typeof t.url!=`string`?null:{title:t.title,url:t.url,...typeof t.domain==`string`?{domain:t.domain}:{},...typeof t.snippet==`string`?{snippet:t.snippet}:{},...typeof t.ref_id==`string`?{ref_id:t.ref_id}:{},...typeof t.type==`string`?{type:t.type}:{}}});if(!n.some(e=>e==null))return{schema_version:1,type:`web_search`,source:`web_search_call`,call_status:e.call_status,query:e.query,action:V(e.action),completion:{status:t.status,query:t.query,action:V(t.action),results:n,...typeof t.error==`string`?{error:t.error}:{},...typeof t.event_block_key==`string`?{event_block_key:t.event_block_key}:{}}}}function be(e){let t=V(e.completion),n=V(t?.duration);if(!(e.source!==`function_call`||typeof e.name!=`string`||typeof e.call_status!=`string`||!t||typeof t.status!=`string`||typeof t.server!=`string`||typeof t.tool!=`string`||!V(t.arguments)||!V(t.result)||!n||typeof n.secs!=`number`||!Number.isFinite(n.secs)||typeof n.nanos!=`number`||!Number.isFinite(n.nanos)))return{schema_version:1,type:`mcp`,source:`function_call`,name:e.name,call_status:e.call_status,completion:{status:t.status,server:t.server,tool:t.tool,arguments:V(t.arguments),result:V(t.result),duration:{secs:n.secs,nanos:n.nanos},...typeof t.event_block_key==`string`?{event_block_key:t.event_block_key}:{}}}}var xe=new Set([`spawn_agent`,`wait_agent`,`send_message`,`list_agents`,`followup_task`,`interrupt_agent`]);function Se(e){let t=typeof e.operation==`string`&&xe.has(e.operation)?e.operation:null,n=V(e.arguments),r=e.result===void 0?void 0:_e(e.result),i=e.child_conversation==null?null:V(e.child_conversation);if(!(!t||typeof e.call_status!=`string`||!n||e.result!==void 0&&!r||e.child_conversation!=null&&!i)&&!(i&&typeof i.conversation_key!=`string`))return{schema_version:1,type:`agent`,operation:t,call_status:e.call_status,arguments:n,...r?{result:r}:{},...i?{child_conversation:{conversation_key:i.conversation_key,...typeof i.role==`string`?{role:i.role}:{},...typeof i.nickname==`string`?{nickname:i.nickname}:{}}}:{}}}function W(e){let t=V(e.detail?.card);if(t?.schema_version!==1)return;if(t.type===`terminal`){if(!Array.isArray(t.commands)||t.commands.length===0)return;let n=t.commands.map(e=>{let t=V(e);return!t||typeof t.command!=`string`?null:{command:t.command,workdir:typeof t.workdir==`string`?t.workdir:null,metadata:V(t.metadata)??{}}});return n.some(e=>e==null)?void 0:{schema_version:1,type:`terminal`,status:typeof t.status==`string`?t.status:`unknown`,commands:n,output:H(e.output?.detail?.card),truncated:t.truncated===!0||e.output?.detail?.card!=null&&V(e.output.detail.card)?.truncated===!0}}if(t.type===`plan`)return ve(t);if(t.type===`web_search`)return ye(t);if(t.type===`mcp`)return be(t);if(t.type===`agent`)return Se(t);if(t.type===`program`)return fe(t);if(t.type===`session_ref`)return pe(t);if(t.type===`tool_search`)return me(t);if(t.type!==`patch`)return;let n=se(t.files);if(n==null)return;let r=V(t.completion),i=r?.schema_version===1&&r.type===`patch`?r:t,a=ce(i.files);if(a!=null)return{schema_version:1,type:`patch`,source:typeof t.source==`string`?t.source:`patch_apply_end`,status:typeof i.status==`string`?i.status:`unknown`,files:a,request_files:r?n:void 0,patch:typeof t.patch==`string`?t.patch:void 0,success:typeof i.success==`boolean`?i.success:null,stdout:typeof i.stdout==`string`?i.stdout:null,stderr:typeof i.stderr==`string`?i.stderr:null,has_diff:typeof i.has_diff==`boolean`?i.has_diff:a.some(e=>typeof e.unified_diff==`string`),truncated:t.truncated===!0||i.truncated===!0,event_payload_key:typeof i.event_block_key==`string`?i.event_block_key:void 0}}function Ce(e){let t=e[0],n=t.kind===`command`?t.command:t.kind===`session`?[w(t.operation),S(t.scope,t.ref)].filter(Boolean).join(` `):t.name;return e.length>1?`${n} +${e.length-1} more`:n}function we(e){return[S(e.scope,e.ref),e.chars==null?``:D(e.chars)].filter(Boolean).join(` · `)||e.operation}function G(e){if(e)return e.replace(/^\[((?:\$)[^\]\r\n]+)\]\([^\)\r\n]*\/SKILL\.md\)[ \t]*/,(e,t,n,r)=>n+e.length<r.length?`${t} `:t)}function Te(e,t){let n=[];for(let r of e){if(r.kind===`assistant`||r.kind===`user`||r.kind===`text`){let e=r.kind===`assistant`?ge(r.detail?.external_call):null,t=e?.span!=null&&r.text!=null&&e.span[1]<=r.text.length?e.span:null,i=t?`${r.text.slice(0,t[0])}${r.text.slice(t[1])}`.replace(/[ \t]*\n+$/,``):r.text;i&&n.push({kind:`text`,text:i,...r.block_key?{block_key:r.block_key}:{}}),e&&t&&n.push({...e.block,...r.block_key?{block_key:r.block_key}:{}});let a=ae(r.detail?.markers);a&&n.push({kind:`system_actions`,actions:a,...r.block_key?{payload_key:r.block_key}:{}});continue}if(r.kind===`thinking`){r.text?.trim()&&n.push({kind:`thinking`,text:r.text});continue}if(r.kind===`reasoning`){if(t===`codex`){let e=ie(r);e&&n.push(e)}else r.text?.trim()&&n.push({kind:`thinking`,text:r.text});continue}if(r.kind===`tool_call`){let e=r;if(t===`claude`&&r.detail==null&&typeof e.input_summary==`string`&&typeof e.preview==`string`&&`result`in e){n.push(e);continue}let i=typeof r.detail?.name==`string`?r.detail.name:null,a=typeof r.detail?.args==`string`?r.detail.args:``,o=W(r),s=o?.type===`terminal`?o:null,c=o?.type===`patch`?o:null,l=o?.type===`plan`?o:null,u=o?.type===`web_search`?o:null,d=o?.type===`mcp`?o:null,f=o?.type===`agent`?o:null,p=o?.type===`program`?o:null,m=o?.type===`session_ref`?o:null,h=o?.type===`tool_search`?o:null,g=s?{command:s.commands[0].command,workdir:s.commands[0].workdir}:u?{query:u.query,action:u.action}:d?d.completion.arguments:f?f.arguments:z(a),_=t===`codex`?ue(H(r.output?.detail?.card)):void 0,v=s?.output?.is_error===!0||c?.success===!1||U.has(u?.completion.status??``)||U.has(d?.completion.status??``)||U.has(_?.status??``),y=B(l?.explanation)??B(u?.query)??(d?B(`${d.completion.tool} · ${d.completion.server}`):void 0)??(f?B(f.operation):void 0)??B(h?.query)??B(p?.title)??(p?B(Ce(p.invocations)):void 0)??(m?B(we(m)):void 0),b=l?.result?.value??u?.completion.error??d?.completion.result??f?.result?.value??null,x=typeof b==`string`?b:b==null?null:JSON.stringify(b,null,2);n.push({kind:`tool_call`,name:i,input_summary:s?JSON.stringify({commands:s.commands}):a||r.text||``,input:g,preview:s?.commands[0].command??c?.files.map(e=>e.move_path??e.path).filter(Boolean).join(`, `)??y??(r.text??a).split(`
|
|
1
|
+
import{Ft as e,Rt as t,_t as n,ft as r,ht as i}from"./useKeymap-CUgEnnua.js";import{Ft as a}from"./index-BKTWH9JE.js";var o=t(e(),1),s=class extends Error{status;constructor(e){super(`HTTP ${e}`),this.status=e,this.name=`HttpError`}};function c(e){return e?.name===`AbortError`}async function l(e,t){let n=await fetch(e,t?{signal:t}:void 0);if(!n.ok)throw new s(n.status);return await n.json()}function u(e){let t=e?.data_version;return typeof t==`string`&&t!==``?t:e?.generated_at??``}var d={legacy_bridge_pending:{reason:`legacy_bridge_pending`,message:`Transcripts have not finished moving into the conversation store. Run cctally cache-sync to finish the import.`,retryable:!1},maintenance:{reason:`maintenance`,message:`The conversation store is busy with maintenance. Conversations return once it finishes.`,retryable:!0},schema_behind:{reason:`schema_behind`,message:`The conversation store is behind this version of cctally. Run cctally cache-sync to bring it up to date.`,retryable:!1},schema_ahead:{reason:`schema_ahead`,message:`The conversation store was written by a newer version of cctally. Update cctally to read it.`,retryable:!1}},f={reason:`unavailable`,message:`The conversation store is not available right now.`,retryable:!0};function p(e){if(typeof e!=`object`||!e)return null;let t=e;return t.status===`degraded`?typeof t.degraded_reason==`string`&&t.degraded_reason?t.degraded_reason:f.reason:null}function m(e){return d[e]??{...f,reason:e||f.reason}}function h(e,t,n){n!==void 0&&e.append(t,String(n))}function g(e,t={}){let n=new URLSearchParams;return n.append(`source`,e),h(n,`account`,t.accountKey),h(n,`project_key`,t.projectKey),h(n,`model`,t.model),h(n,`limit`,t.limit),h(n,`cursor`,t.cursor),h(n,`selected`,t.selected),`/api/conversations?${n.toString()}`}function _(e,t){let n=new URLSearchParams({source:e});return h(n,`account`,t),`/api/conversations/facets?${n.toString()}`}function v(e,t){let n=new URLSearchParams;return n.append(`source`,e),h(n,`account`,t.accountKey),n.append(`q`,t.query),h(n,`kind`,t.kind),h(n,`limit`,t.limit),h(n,`cursor`,t.cursor),`/api/conversation/search?${n.toString().replace(/\+/g,`%20`)}`}var y={detail:``,outline:`/outline`,find:`/find`,prompts:`/prompts`,payload:`/payload`,export:`/export`,"anon-map":`/anon-map`,events:`/events`,media:`/media`};function b(e,t,r){let i=n(e);if(i.source===`codex`&&!i.key.startsWith(`v1.`))throw Error(`Codex conversation keys must be qualified`);let a=new URLSearchParams;h(a,`account`,i.account_key);for(let[e,t]of Object.entries(r??{}))t!==void 0&&a.append(e,typeof t==`boolean`?t?`1`:`0`:String(t));let o=a.size?`?${a.toString().replace(/\+/g,`%20`)}`:``;return`/api/conversation/${encodeURIComponent(i.key)}${y[t]}${o}`}function x(e){let t=e.native_card;return t?.type===`session_ref`?t.scope===`shell`&&t.ref!=null?[t.ref]:[]:t?.type===`program`?t.invocations.flatMap(e=>e.kind===`session`&&e.scope===`shell`&&e.ref!=null?[e.ref]:[]):[]}function S(e,t){return t==null?``:e===`shell`?`session ${t}`:`cell ${t}`}function C(e,t){return t==null?``:e===`shell`?`s${t}`:`c${t}`}function w(e){return e===`write`?`wrote to`:`polled`}function T(e){return e===`write`?`wrote`:`poll`}var E=60;function D(e){let t=e.replace(/\s+/g,` `).trim();return t.length>E?`${t.slice(0,E)}…`:t}function O(e){let t=new Set(e.flatMap(e=>x(e)));return t.size===1?[...t][0]:null}function k(e,t,n,r){if(!e||t!==`shell`||n==null)return`silent`;let i=e.sessions[n];return i?.opener_block_key==null?e.truncated?`index_truncated`:`not_retained`:r!=null&&r===i.opener_block_key?`opener`:`silent`}function A(e){return new Set(e.map(e=>e.parent_uuid))}function j(e){let t=new Map;for(let n of e){let e=t.get(n.parent_uuid);e?e.push(n):t.set(n.parent_uuid,[n])}return t}function M(e){return e.kind===`reasoning`?e.landmark_key:e.block_key}var N={tool_error:`error`,plan:`plan`,reasoning:`heading`};function P(e,t){if(!t?.length)return[];let n=j(t),r=[];return e.forEach((e,t)=>{for(let i of n.get(e.uuid)??[])r.push({landmark:i,ownerTurnIndex:t})}),r}var F=class extends Error{constructor(){super(`Conversation indexing is still finishing.`)}},I=class extends Error{reason;constructor(e){let t=m(e);super(t.message),this.name=`ConversationDegraded`,this.reason=t.reason}};function L(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function ee(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function R(e){if(e)return e.source===`codex`||`cached_input`in e||`reasoning_output`in e?{source:`codex`,input:L(e.input),output:L(e.output),cache_creation:0,cache_read:0,cached_input:L(e.cached_input),reasoning_output:L(e.reasoning_output)}:{source:`claude`,input:L(e.input),output:L(e.output),cache_creation:L(e.cache_creation??e.cache_create),cache_read:L(e.cache_read)}}function te(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0||1}function z(e){if(typeof e!=`string`||e.trim()===``)return null;try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{value:t}}catch{return{raw:e}}}var ne=new Set([`create_branch`,`stage`,`commit`,`push`,`create_pr`]);function B(e){return typeof e==`string`&&e.trim()!==``?e.trim():void 0}function re(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let n of e){let e=V(n);if(!e||typeof e.key!=`string`||typeof e.text!=`string`)return;t.push({key:e.key,text:e.text})}return t}function ie(e){let t=V(e.detail?.reasoning);if(t?.schema_version===1){let n=B(t.title),r=B(t.summary),i=B(t.body);if(!n&&!r&&!i)return null;let a=re(t.headings);return{kind:`codex_reasoning`,source:B(t.source)??`codex`,title:n,summary:r,body:i,...a?{headings:a}:{},...e.block_key?{block_key:e.block_key}:{}}}let n=B(e.text);return n?{kind:`codex_reasoning`,source:`codex`,body:n,...e.block_key?{block_key:e.block_key}:{}}:null}function ae(e){if(!Array.isArray(e)||e.length===0)return null;let t=[];for(let n of e){let e=V(n);if(!e||e.schema_version!==1)return null;if(e.type===`git`&&typeof e.action==`string`&&ne.has(e.action)){t.push({type:`git`,action:e.action,...e.action===`create_pr`&&typeof e.draft==`boolean`?{draft:e.draft}:{}});continue}if(e.type===`memory_citation`&&Number.isSafeInteger(e.citation_count)&&Number(e.citation_count)>=0&&Number.isSafeInteger(e.rollout_count)&&Number(e.rollout_count)>=0){t.push({type:`memory_citation`,citation_count:Number(e.citation_count),rollout_count:Number(e.rollout_count)});continue}return null}return t}function oe(e){let t=V(e.detail?.lifecycle);return t?.schema_version!==1||t.event!==`task_started`&&t.event!==`task_complete`?null:{kind:`codex_lifecycle`,event:t.event,...B(t.message)?{message:B(t.message)}:{},...B(t.error)?{error:B(t.error)}:{},...typeof t.duration_ms==`number`&&Number.isFinite(t.duration_ms)?{duration_ms:t.duration_ms}:{},...e.block_key?{payload_key:e.block_key}:{}}}function V(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:null}function se(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){let e=V(n);if(!e)return null;let r={};for(let t of[`path`,`move_path`,`status`])typeof e[t]==`string`&&(r[t]=e[t]);t.push(r)}return t}function ce(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){let e=V(n);if(!e)return null;let r={};for(let t of[`path`,`move_path`,`status`,`unified_diff`,`raw`,`raw_extra`])typeof e[t]==`string`&&(r[t]=e[t]);typeof e.truncated==`boolean`&&(r.truncated=e.truncated),(e.diff_source===`retained`||e.diff_source===`derived`)&&(r.diff_source=e.diff_source),t.push(r)}return t}function H(e){let t=V(e);if(t?.schema_version!==1||t.type!==`terminal_output`||!Array.isArray(t.parts))return;let n=t.parts.map(e=>{let t=V(e);if(!t||t.type!==`text`&&t.type!==`raw`||typeof t.text!=`string`)return null;let n=t.stream===`stdout`||t.stream===`stderr`?t.stream:`output`;return{type:t.type,stream:n,text:t.text}});if(!n.some(e=>e==null))return{schema_version:1,type:`terminal_output`,status:typeof t.status==`string`?t.status:`unknown`,is_error:t.is_error===!0,parts:n,truncated:t.truncated===!0,...typeof t.exit_code==`number`||t.exit_code===null?{exit_code:t.exit_code}:{},...typeof t.wall_time_seconds==`number`||t.wall_time_seconds===null?{wall_time_seconds:t.wall_time_seconds}:{}}}var le=new Set([`completed`,`failed`,`error`,`running`,`unknown`]),U=new Set([`failed`,`error`]);function ue(e){if(e)return{status:le.has(e.status)?e.status:`unknown`,exit_code:typeof e.exit_code==`number`?e.exit_code:null,wall_time_seconds:typeof e.wall_time_seconds==`number`?e.wall_time_seconds:null}}function de(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let n of e){let e=V(n);if(!e)return;if(e.kind===`command`){if(typeof e.command!=`string`)return;t.push({kind:`command`,command:e.command,workdir:typeof e.workdir==`string`?e.workdir:null,metadata:V(e.metadata)??{}});continue}if(e.kind===`session`){if(e.scope!==`shell`&&e.scope!==`cell`||e.operation!==`write`&&e.operation!==`poll`)return;t.push({kind:`session`,scope:e.scope,operation:e.operation,ref:typeof e.ref==`string`?e.ref:null,chars:typeof e.chars==`string`?e.chars:null});continue}if(e.kind===`other`&&typeof e.name==`string`&&e.name!==``){t.push({kind:`other`,name:e.name});continue}return}return t}function fe(e){let t=de(e.invocations);if(!(!t||typeof e.complete!=`boolean`||typeof e.truncated!=`boolean`))return{schema_version:1,type:`program`,title:typeof e.title==`string`?e.title:null,complete:e.complete,invocations:t,truncated:e.truncated}}function pe(e){if(!(e.scope!==`shell`&&e.scope!==`cell`||e.operation!==`write`&&e.operation!==`poll`||typeof e.truncated!=`boolean`))return{schema_version:1,type:`session_ref`,scope:e.scope,operation:e.operation,ref:typeof e.ref==`string`?e.ref:null,chars:typeof e.chars==`string`?e.chars:null,truncated:e.truncated}}function me(e){if(typeof e.query==`string`)return{schema_version:1,type:`tool_search`,query:e.query,limit:typeof e.limit==`number`&&Number.isFinite(e.limit)?e.limit:null,...e.truncated===!0?{truncated:!0}:{}}}function he(e){let t=V(e),n=V(t?.sessions);if(!t||!n||typeof t.truncated!=`boolean`)return;let r=Object.create(null);for(let[e,t]of Object.entries(n)){let n=V(t);if(!n||!Number.isSafeInteger(n.ordinal)||n.opener_block_key!==null&&typeof n.opener_block_key!=`string`)return;r[e]={ordinal:n.ordinal,opener_block_key:n.opener_block_key}}return{sessions:r,truncated:t.truncated}}function ge(e){let t=V(e);if(t?.schema_version!==1||typeof t.name!=`string`||t.name===``||!(`input`in t)||typeof t.truncated!=`boolean`)return null;let n=t.span,r=Array.isArray(n)&&n.length===2&&Number.isSafeInteger(n[0])&&Number.isSafeInteger(n[1])&&n[0]>=0&&n[1]>=n[0]?[n[0],n[1]]:null;return{block:{kind:`external_call`,name:t.name,input:t.input,truncated:t.truncated},span:r}}function _e(e){let t=V(e);return!t||typeof t.status!=`string`||typeof t.truncated!=`boolean`||!(`value`in t)?null:{status:t.status,value:t.value,truncated:t.truncated}}function ve(e){if(e.source!==`update_plan`||typeof e.call_status!=`string`||!Array.isArray(e.items))return;let t=e.items.map(e=>{let t=V(e);return t&&typeof t.step==`string`&&typeof t.status==`string`?{step:t.step,status:t.status}:null}),n=e.result===void 0?void 0:_e(e.result);if(!(t.some(e=>e==null)||e.result!==void 0&&!n))return{schema_version:1,type:`plan`,source:`update_plan`,call_status:e.call_status,explanation:typeof e.explanation==`string`?e.explanation:null,items:t,...n?{result:n}:{}}}function ye(e){let t=V(e.completion);if(e.source!==`web_search_call`||typeof e.call_status!=`string`||typeof e.query!=`string`||!V(e.action)||!t||typeof t.status!=`string`||typeof t.query!=`string`||!V(t.action)||!Array.isArray(t.results))return;let n=t.results.map(e=>{let t=V(e);return!t||typeof t.title!=`string`||typeof t.url!=`string`?null:{title:t.title,url:t.url,...typeof t.domain==`string`?{domain:t.domain}:{},...typeof t.snippet==`string`?{snippet:t.snippet}:{},...typeof t.ref_id==`string`?{ref_id:t.ref_id}:{},...typeof t.type==`string`?{type:t.type}:{}}});if(!n.some(e=>e==null))return{schema_version:1,type:`web_search`,source:`web_search_call`,call_status:e.call_status,query:e.query,action:V(e.action),completion:{status:t.status,query:t.query,action:V(t.action),results:n,...typeof t.error==`string`?{error:t.error}:{},...typeof t.event_block_key==`string`?{event_block_key:t.event_block_key}:{}}}}function be(e){let t=V(e.completion),n=V(t?.duration);if(!(e.source!==`function_call`||typeof e.name!=`string`||typeof e.call_status!=`string`||!t||typeof t.status!=`string`||typeof t.server!=`string`||typeof t.tool!=`string`||!V(t.arguments)||!V(t.result)||!n||typeof n.secs!=`number`||!Number.isFinite(n.secs)||typeof n.nanos!=`number`||!Number.isFinite(n.nanos)))return{schema_version:1,type:`mcp`,source:`function_call`,name:e.name,call_status:e.call_status,completion:{status:t.status,server:t.server,tool:t.tool,arguments:V(t.arguments),result:V(t.result),duration:{secs:n.secs,nanos:n.nanos},...typeof t.event_block_key==`string`?{event_block_key:t.event_block_key}:{}}}}var xe=new Set([`spawn_agent`,`wait_agent`,`send_message`,`list_agents`,`followup_task`,`interrupt_agent`]);function Se(e){let t=typeof e.operation==`string`&&xe.has(e.operation)?e.operation:null,n=V(e.arguments),r=e.result===void 0?void 0:_e(e.result),i=e.child_conversation==null?null:V(e.child_conversation);if(!(!t||typeof e.call_status!=`string`||!n||e.result!==void 0&&!r||e.child_conversation!=null&&!i)&&!(i&&typeof i.conversation_key!=`string`))return{schema_version:1,type:`agent`,operation:t,call_status:e.call_status,arguments:n,...r?{result:r}:{},...i?{child_conversation:{conversation_key:i.conversation_key,...typeof i.role==`string`?{role:i.role}:{},...typeof i.nickname==`string`?{nickname:i.nickname}:{}}}:{}}}function W(e){let t=V(e.detail?.card);if(t?.schema_version!==1)return;if(t.type===`terminal`){if(!Array.isArray(t.commands)||t.commands.length===0)return;let n=t.commands.map(e=>{let t=V(e);return!t||typeof t.command!=`string`?null:{command:t.command,workdir:typeof t.workdir==`string`?t.workdir:null,metadata:V(t.metadata)??{}}});return n.some(e=>e==null)?void 0:{schema_version:1,type:`terminal`,status:typeof t.status==`string`?t.status:`unknown`,commands:n,output:H(e.output?.detail?.card),truncated:t.truncated===!0||e.output?.detail?.card!=null&&V(e.output.detail.card)?.truncated===!0}}if(t.type===`plan`)return ve(t);if(t.type===`web_search`)return ye(t);if(t.type===`mcp`)return be(t);if(t.type===`agent`)return Se(t);if(t.type===`program`)return fe(t);if(t.type===`session_ref`)return pe(t);if(t.type===`tool_search`)return me(t);if(t.type!==`patch`)return;let n=se(t.files);if(n==null)return;let r=V(t.completion),i=r?.schema_version===1&&r.type===`patch`?r:t,a=ce(i.files);if(a!=null)return{schema_version:1,type:`patch`,source:typeof t.source==`string`?t.source:`patch_apply_end`,status:typeof i.status==`string`?i.status:`unknown`,files:a,request_files:r?n:void 0,patch:typeof t.patch==`string`?t.patch:void 0,success:typeof i.success==`boolean`?i.success:null,stdout:typeof i.stdout==`string`?i.stdout:null,stderr:typeof i.stderr==`string`?i.stderr:null,has_diff:typeof i.has_diff==`boolean`?i.has_diff:a.some(e=>typeof e.unified_diff==`string`),truncated:t.truncated===!0||i.truncated===!0,event_payload_key:typeof i.event_block_key==`string`?i.event_block_key:void 0}}function Ce(e){let t=e[0],n=t.kind===`command`?t.command:t.kind===`session`?[w(t.operation),S(t.scope,t.ref)].filter(Boolean).join(` `):t.name;return e.length>1?`${n} +${e.length-1} more`:n}function we(e){return[S(e.scope,e.ref),e.chars==null?``:D(e.chars)].filter(Boolean).join(` · `)||e.operation}function G(e){if(e)return e.replace(/^\[((?:\$)[^\]\r\n]+)\]\([^\)\r\n]*\/SKILL\.md\)[ \t]*/,(e,t,n,r)=>n+e.length<r.length?`${t} `:t)}function Te(e,t){let n=[];for(let r of e){if(r.kind===`assistant`||r.kind===`user`||r.kind===`text`){let e=r.kind===`assistant`?ge(r.detail?.external_call):null,t=e?.span!=null&&r.text!=null&&e.span[1]<=r.text.length?e.span:null,i=t?`${r.text.slice(0,t[0])}${r.text.slice(t[1])}`.replace(/[ \t]*\n+$/,``):r.text;i&&n.push({kind:`text`,text:i,...r.block_key?{block_key:r.block_key}:{}}),e&&t&&n.push({...e.block,...r.block_key?{block_key:r.block_key}:{}});let a=ae(r.detail?.markers);a&&n.push({kind:`system_actions`,actions:a,...r.block_key?{payload_key:r.block_key}:{}});continue}if(r.kind===`thinking`){r.text?.trim()&&n.push({kind:`thinking`,text:r.text});continue}if(r.kind===`reasoning`){if(t===`codex`){let e=ie(r);e&&n.push(e)}else r.text?.trim()&&n.push({kind:`thinking`,text:r.text});continue}if(r.kind===`tool_call`){let e=r;if(t===`claude`&&r.detail==null&&typeof e.input_summary==`string`&&typeof e.preview==`string`&&`result`in e){n.push(e);continue}let i=typeof r.detail?.name==`string`?r.detail.name:null,a=typeof r.detail?.args==`string`?r.detail.args:``,o=W(r),s=o?.type===`terminal`?o:null,c=o?.type===`patch`?o:null,l=o?.type===`plan`?o:null,u=o?.type===`web_search`?o:null,d=o?.type===`mcp`?o:null,f=o?.type===`agent`?o:null,p=o?.type===`program`?o:null,m=o?.type===`session_ref`?o:null,h=o?.type===`tool_search`?o:null,g=s?{command:s.commands[0].command,workdir:s.commands[0].workdir}:u?{query:u.query,action:u.action}:d?d.completion.arguments:f?f.arguments:z(a),_=t===`codex`?ue(H(r.output?.detail?.card)):void 0,v=s?.output?.is_error===!0||c?.success===!1||U.has(u?.completion.status??``)||U.has(d?.completion.status??``)||U.has(_?.status??``),y=B(l?.explanation)??B(u?.query)??(d?B(`${d.completion.tool} · ${d.completion.server}`):void 0)??(f?B(f.operation):void 0)??B(h?.query)??B(p?.title)??(p?B(Ce(p.invocations)):void 0)??(m?B(we(m)):void 0),b=l?.result?.value??u?.completion.error??d?.completion.result??f?.result?.value??null,x=typeof b==`string`?b:b==null?null:JSON.stringify(b,null,2);n.push({kind:`tool_call`,name:i,input_summary:s?JSON.stringify({commands:s.commands}):a||r.text||``,input:g,preview:s?.commands[0].command??c?.files.map(e=>e.move_path??e.path).filter(Boolean).join(`, `)??y??(r.text??a).split(`
|
|
2
2
|
`)[0]??``,tool_use_id:r.block_key??null,...r.block_key?{block_key:r.block_key}:{},payload_capable:r.block_key!=null,payload_kind:`call`,native_card:o,..._?{outcome:_}:{},web_search:u?{query:u.query,links:u.completion.results}:void 0,result:r.output||x!=null?{text:x??r.output?.text??``,truncated:s?.output?.truncated===!0||c?.truncated===!0||l?.result?.truncated===!0||f?.result?.truncated===!0,is_error:v}:null});continue}if(r.kind===`event`){let e=W(r);if(e?.type===`patch`){let t=[e.stdout,e.stderr].filter(e=>typeof e==`string`).join(``);n.push({kind:`tool_call`,name:`patch_apply_end`,input_summary:r.text??``,input:null,preview:e.files.map(e=>e.move_path??e.path).filter(Boolean).join(`, `)||`patch summary`,tool_use_id:r.block_key??null,...r.block_key?{block_key:r.block_key}:{},payload_capable:r.block_key!=null,payload_kind:`event`,native_card:e,result:{text:t,truncated:e.truncated===!0,is_error:e.success===!1||U.has(e.status)}});continue}let t=oe(r);if(t){n.push(t);continue}}if(r.kind===`tool_output`||r.kind===`tool_result`){let e=H(r.detail?.card);n.push({kind:`tool_result`,text:r.text??``,truncated:e?.truncated===!0,is_error:r.detail?.is_error===!0||e?.is_error===!0||U.has(e?.status??``),tool_use_id:r.call_id??r.block_key??null,...r.block_key?{block_key:r.block_key}:{}});continue}r.text?n.push({kind:`text`,text:r.text,...r.block_key?{block_key:r.block_key}:{}}):r.block_key&&n.push({kind:`text`,text:``,block_key:r.block_key})}return n}function Ee(e){let t=e.blocks.find(e=>e.kind===`event`),n=V(t?.detail?.lifecycle);return n?.event===`task_started`||n?.event===`task_complete`?`codex_${n.event}`:typeof t?.detail?.event==`string`?t.detail.event:t?.text?.split(`
|
|
3
3
|
`)[0]?.trim()||null}function De(e){let t=V(e);if(t?.schema_version!==1||typeof t.state!=`string`||!Array.isArray(t.events))return;let n=t.events.map(e=>{let t=V(e);return t&&typeof t.event==`string`&&t.payload_which===`event`&&typeof t.block_key==`string`?{event:t.event,payload_which:`event`,block_key:t.block_key}:null});if(!n.some(e=>e==null))return{schema_version:1,state:t.state,...V(t.started)?{started:V(t.started)}:{},...V(t.completed)?{completed:V(t.completed)}:{},events:n}}function Oe(e){let t=e.blocks.find(e=>e.kind===`meta`)?.detail,n=e.meta_kind??t?.meta_kind,r=e.meta_label??t?.meta_label,i=typeof r==`string`?r:Ee(e);return{meta_kind:n===`skill`||n===`command`||n===`context`||n===`compaction`||n===`notification`?n:i===`context_compacted`?`compaction`:e.kind===`event`?`notification`:`context`,meta_label:i,meta_sections:Array.isArray(e.meta_sections)?e.meta_sections.filter(e=>typeof e==`string`):void 0,skill_name:typeof e.skill_name==`string`?e.skill_name:null}}function ke(e,t){let n={session_id:e.key,uuid:t.item_key,id:te(t.item_key)},r=Te(t.blocks,e.source),i=t.blocks.filter(e=>e.kind===`user`||e.kind===`assistant`||e.kind===`text`).map(e=>e.text??``).filter(Boolean).join(`
|
|
4
4
|
|
|
5
5
|
`),a={anchor:n,member_uuids:[t.item_key,...t.member_item_keys??[]],ts:t.timestamp_utc??``,text:i,blocks:r,is_sidechain:t.is_sidechain??!1,subagent_key:t.subagent_key??null,parent_uuid:t.parent_item_key??null,...t.turn_item_key===void 0?{}:{turn_uuid:t.turn_item_key},...t.segment_ordinal===void 0?{}:{segment_ordinal:t.segment_ordinal}};if(t.kind===`assistant`||t.kind===`reasoning`||t.kind===`tool_call`||r.some(e=>e.kind===`tool_call`)){let e=De(t.lifecycle);return{...a,kind:`assistant`,model:t.model,cost_usd:ee(t.cost_usd),tokens:R(t.tokens),...e?{lifecycle:e}:{},...t.cache_failure?{cache_failure:t.cache_failure}:{}}}if(t.kind===`user`||t.kind===`human`)return{...a,kind:`human`,...t.command_name===void 0?{}:{command_name:t.command_name}};if(t.kind===`tool_output`||t.kind===`tool_result`)return{...a,kind:`tool_result`,text:``};let o=Oe(t);return{...a,kind:`meta`,...o,text:t.blocks.map(e=>e.text??``).filter(Boolean).join(`
|
|
6
6
|
|
|
7
|
-
`)}}function Ae(e,t){let n=p(t);if(n!=null)throw new I(n);if(t.status===`normalization_pending`)throw new F;if(t.status!==`ok`)throw Error(`Conversation not found.`);let r=(t.items??[]).map(t=>ke(e,t)),i=Array.from(new Set((t.items??[]).map(e=>e.model).filter(e=>!!e))),a=(t.items??[]).find(e=>e.timestamp_utc)?.timestamp_utc??``,o=[...t.items??[]].reverse().find(e=>e.timestamp_utc)?.timestamp_utc??a,s=t.page,c=he(t.session_index);return{session_id:e.key,title:G(t.title),project_label
|
|
7
|
+
`)}}var Ae=[`recorded`,`not_recorded`,`unreadable`];function je(e){return typeof e==`string`&&Ae.includes(e)?e:void 0}function Me(e,t){let n=p(t);if(n!=null)throw new I(n);if(t.status===`normalization_pending`)throw new F;if(t.status!==`ok`)throw Error(`Conversation not found.`);let r=(t.items??[]).map(t=>ke(e,t)),i=Array.from(new Set((t.items??[]).map(e=>e.model).filter(e=>!!e))),a=(t.items??[]).find(e=>e.timestamp_utc)?.timestamp_utc??``,o=[...t.items??[]].reverse().find(e=>e.timestamp_utc)?.timestamp_utc??a,s=t.page,c=he(t.session_index),l=je(t.git_branch_status);return{session_id:e.key,title:G(t.title),project_label:t.project_label||`—`,git_branch:t.git_branch??null,started_utc:a,last_activity_utc:o,cost_usd:L(t.total_cost_usd),models:i,items:r,page:{next_after:s?.has_after?s.after:null,has_more:s?.has_after??!1,prev_before:s?.has_before?s.before:null,has_prev:s?.has_before??!1},last_anchor:r.length?r[r.length-1].anchor:null,...t.subagent_meta?{subagent_meta:t.subagent_meta}:{},...c?{session_index:c}:{},provider_meta:{source:e.source,conversation_key:t.conversation_key,tokens:R(t.tokens),unattributed_cost_usd:L(t.unattributed_cost_usd),parent:t.parent??null,children:t.children??[],...l?{git_branch_status:l}:{}}}}function Ne(e,t,n){if(t.status===`normalization_pending`)return{rows:[],cursor:null,total:0,pending:!0};let r=t=>({conversation_ref:n?{source:e,key:t.conversation_key,account_key:n}:{source:e,key:t.conversation_key},session_id:t.conversation_key,title:G(t.title)||`Untitled conversation`,project_label:t.project_label||`—`,git_branch:t.parent?`child thread`:t.is_fork?`fork`:null,started_utc:t.started_utc||t.last_activity_utc||``,last_activity_utc:t.last_activity_utc||t.started_utc||``,msg_count:t.count,cost_usd:t.cost_usd,models:t.models});return{rows:t.rows.map(r),...t.selected?{selected:r(t.selected)}:{},cursor:t.page.cursor??null,total:t.page.total,pending:!1}}function Pe(e,t,n){if(t.status===`normalization_pending`)return{query:t.query,mode:t.mode,hits:[],total:0,search_depth:t.depth,cursor:null,pending:!0};let r=t.hits.map(t=>({conversation_ref:n?{source:e,key:t.conversation_key,account_key:n}:{source:e,key:t.conversation_key},session_id:t.conversation_key,uuid:t.item_key??``,project_label:t.project_label??`—`,title:G(t.title)??`Untitled conversation`,ts:t.last_activity_utc??``,snippet:t.snippet,...t.snippet_parts===void 0?{}:{snippet_parts:t.snippet_parts},cost_usd:0,match_kinds:t.badges.filter(e=>e===`tool`||e===`thinking`||e===`title`||e===`file`)}));return{query:t.query,mode:t.mode,hits:r,total:t.total,search_depth:t.depth,cursor:t.page?.cursor??null,pending:!1}}var Fe=new Set([`edit`,`multiedit`,`write`,`add`,`delete`,`update`,`modified`]),Ie=new Set([`reasoning`,`tool_error`,`plan`]);function K(e,t,n={},r){if(t.status===`normalization_pending`)throw new F;if(t.status!==`ok`)throw Error(`Conversation not found.`);let i=(t.landmarks??[]).filter(e=>Ie.has(e.kind)).map(e=>({landmark_key:e.landmark_key,block_key:e.block_key,uuid:e.item_key,parent_uuid:e.parent_item_key,kind:e.kind,label:e.label,ts:e.timestamp_utc})),a=A(i),o=(t.turns??[]).flatMap(e=>{let t=e.kind,n=(e.kinds.event??0)>0,i=r?.has(e.item_key)??!1,o=e.meta_kind===`compaction`||n&&e.label.includes(`context_compacted`),s=a.has(e.item_key);if(!t&&!s&&((e.kinds.meta??0)>0||n&&!o))return[];let c=t===`human`||i||(e.kinds.user??0)>0,l=t===`assistant`||(e.kinds.assistant??0)>0||!c&&!n&&(e.kinds.meta??0)===0;if(!t&&!c&&!l&&!o&&!s)return[];let u=R(e.tokens);return[{uuid:e.item_key,kind:t??(o?`meta`:c?`human`:`assistant`),ts:e.timestamp_utc,label:G(e.label)??e.label,member_uuids:[e.item_key,...e.member_item_keys??[]],...e.segment_item_keys?{segment_uuids:e.segment_item_keys}:{},subagent_key:e.subagent_key??null,parent_uuid:e.parent_item_key??null,is_sidechain:e.is_sidechain??!1,...e.tools?{tools:e.tools}:{},...e.tool_call_count==null?{}:{tool_call_count:e.tool_call_count},...e.first_failure_name===void 0?{}:{first_failure_name:e.first_failure_name},...e.thinking?{thinking:e.thinking}:{},...e.model?{model:e.model}:{},...u?{tokens:u}:{},...e.cache_failure?{cache_failure:e.cache_failure}:{},...e.meta_kind?{meta_kind:e.meta_kind}:o?{meta_kind:`compaction`}:{},...e.skill_name===void 0?{}:{skill_name:e.skill_name}}]}),s=[],c=[];for(let e of t.files??[]){if(!e.touches){c.push({path:e.file_path,tool:e.tool,count:e.count});continue}s.push({path:e.file_path,add:e.added??null,del:e.removed??null,touches:e.touches.map(e=>({uuid:e.item_key,tool_use_id:e.tool_use_id??null,op:e.op!=null&&Fe.has(e.op)?e.op:null,add:e.added??null,del:e.removed??null}))})}let l=R(n.tokens??t.stats?.tokens)??{source:e.source,input:0,output:0,cache_creation:0,cache_read:0,...e.source===`codex`?{cached_input:0,reasoning_output:0}:{}},u=o.filter(e=>e.kind===`human`).length,d=o.filter(e=>e.kind===`assistant`).length,f=o.filter(e=>e.kind===`tool_result`).length,p=o.filter(e=>e.kind===`meta`).length;return{session_id:e.key,stats:{turns:{total:o.length,human:u,assistant:d,tool_result:f,meta:p},tool_counts:t.stats?.tool_counts??{},error_count:typeof t.stats?.error_count==`number`?t.stats.error_count:null,models:t.stats?.models??{},duration_seconds:t.stats?.duration_seconds??null,tokens:l,cost_usd:L(n.total_cost_usd??t.stats?.cost_usd),cache_saved_usd:L(t.stats?.cache_saved_usd),...t.stats?.cache_failures?{cache_failures:t.stats.cache_failures}:{}},files:s,...c.length?{provider_files:c}:{},...t.subagent_meta?{subagent_meta:t.subagent_meta}:{},...t.subagent_costs?{subagent_costs:t.subagent_costs}:{},...t.task_completion===void 0?{}:{task_completion:t.task_completion},turns:o,...i.length?{landmarks:i}:{},positionByKey:Le(t.turns??[])}}function Le(e){let t=new Map,n=0;for(let r of e){let e=n;for(let e of r.segment_item_keys?.length?r.segment_item_keys:[r.item_key])t.has(e)||t.set(e,n),n+=1;t.set(r.item_key,e);for(let n of r.member_item_keys??[])t.has(n)||t.set(n,e)}return t}function Re(e){if(e.schema_version===2&&e.semantics===`occurrence`){let t=(e.page?.occurrences??[]).flatMap(e=>{if(typeof e.occurrence_id!=`string`||typeof e.item_key!=`string`||typeof e.block_key!=`string`||typeof e.container_block_key!=`string`||![`body`,`call`,`output`,`completion`].includes(e.surface??``))return[];let t=(e.fragments??[]).flatMap(e=>typeof e.leaf_key==`string`&&Number.isInteger(e.start)&&Number.isInteger(e.end)&&(e.start??-1)>=0&&(e.end??-1)>(e.start??-1)?[{leaf_key:e.leaf_key,start:e.start,end:e.end}]:[]);return[{occurrence_id:e.occurrence_id,item_key:e.item_key,uuid:e.item_key,block_key:e.block_key,container_block_key:e.container_block_key,surface:e.surface,match_kinds:(e.match_kinds??[]).filter(e=>e===`tool`||e===`thinking`),disclosure:(e.disclosure??[]).filter(e=>typeof e==`string`),fragments:t}]});return{schema_version:2,semantics:`occurrence`,status:e.status===`indexing`?`indexing`:`ready`,query_id:typeof e.query_id==`string`?e.query_id:``,...typeof e.total==`number`?{total:e.total}:{},selection_stale:e.selection_stale===!0,mode:e.mode===`regex`?`regex`:`literal`,kind:typeof e.kind==`string`?e.kind:`all`,search_depth:e.search_depth===`prose-only`?`prose-only`:`full`,page:{start_index:Number.isInteger(e.page?.start_index)?e.page.start_index:0,previous_cursor:typeof e.page?.previous_cursor==`string`?e.page.previous_cursor:null,next_cursor:typeof e.page?.next_cursor==`string`?e.page.next_cursor:null,occurrences:t}}}return{anchors:(e.anchors??[]).map(e=>({uuid:e.item_key,match_kinds:e.match_kinds.filter(e=>e===`tool`||e===`thinking`)})),total:e.total??0,anchors_truncated:e.anchors_truncated??!1,mode:e.mode===`fts`||e.mode===`regex`?e.mode:`like`,search_depth:e.search_depth??`full`}}function ze(e){return{prompts:(e.prompts??[]).map(e=>({uuid:e.item_key,text:e.text}))}}function Be(e,t,n){if(t===`input`)return{which:`input`,tool_use_id:e,input:z((n.content??``).split(`
|
|
8
8
|
`).slice(1).join(`
|
|
9
|
-
`))??{raw:n.content??``},full_length:(n.content??``).length,truncated:n.truncated===!0};if(t===`event`){let t=n.card?.type===`terminal_output`?void 0:n.card;return{which:`event`,tool_use_id:e,text:n.content??``,full_length:(n.content??``).length,truncated:n.truncated===!0,card:t}}let r=H(n.card);return{which:`result`,tool_use_id:e,text:n.content??``,full_length:(n.content??``).length,truncated:n.truncated===!0,is_error:r?.is_error===!0||U.has(r?.status??``)}}var
|
|
9
|
+
`))??{raw:n.content??``},full_length:(n.content??``).length,truncated:n.truncated===!0};if(t===`event`){let t=n.card?.type===`terminal_output`?void 0:n.card;return{which:`event`,tool_use_id:e,text:n.content??``,full_length:(n.content??``).length,truncated:n.truncated===!0,card:t}}let r=H(n.card);return{which:`result`,tool_use_id:e,text:n.content??``,full_length:(n.content??``).length,truncated:n.truncated===!0,is_error:r?.is_error===!0||U.has(r?.status??``)}}var Ve=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],He=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Ue=1024;function q(e,t){return e>>>t|e<<32-t}function We(e){return Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}function J(e){if(e?.aborted)throw e.reason??new DOMException(`Aborted`,`AbortError`)}function Ge(){return new Promise(e=>setTimeout(e,0))}async function Ke(e,t){J(t);let n=Math.ceil((e.byteLength+9)/64)*64,r=new Uint8Array(n);r.set(e),r[e.byteLength]=128;let i=new DataView(r.buffer),a=e.byteLength*8;i.setUint32(n-8,Math.floor(a/4294967296),!1),i.setUint32(n-4,a>>>0,!1);let o=He.slice(),s=new Uint32Array(64);for(let e=0;e<n;e+=64){J(t);for(let t=0;t<16;t+=1)s[t]=i.getUint32(e+t*4,!1);for(let e=16;e<64;e+=1){let t=s[e-15],n=s[e-2],r=q(t,7)^q(t,18)^t>>>3,i=q(n,17)^q(n,19)^n>>>10;s[e]=s[e-16]+r+s[e-7]+i>>>0}let[r,a,c,l,u,d,f,p]=o;for(let e=0;e<64;e+=1){let t=q(u,6)^q(u,11)^q(u,25),n=u&d^~u&f,i=p+t+n+Ve[e]+s[e]>>>0,o=(q(r,2)^q(r,13)^q(r,22))+(r&a^r&c^a&c)>>>0;p=f,f=d,d=u,u=l+i>>>0,l=c,c=a,a=r,r=i+o>>>0}o[0]=o[0]+r>>>0,o[1]=o[1]+a>>>0,o[2]=o[2]+c>>>0,o[3]=o[3]+l>>>0,o[4]=o[4]+u>>>0,o[5]=o[5]+d>>>0,o[6]=o[6]+f>>>0,o[7]=o[7]+p>>>0,(e/64+1)%Ue==0&&e+64<n&&(await Ge(),J(t))}return J(t),o.map(e=>e.toString(16).padStart(8,`0`)).join(``)}async function qe(e,t){J(t);let n=globalThis.crypto?.subtle;if(n){let r=new Uint8Array(e.byteLength);r.set(e);let i=await n.digest(`SHA-256`,r.buffer);return J(t),We(new Uint8Array(i))}return Ke(e,t)}var Y=class extends Error{reason;constructor(e){super(`Conversation outline store degraded`),this.reason=e}};function X(e){let t=p(e);if(t)throw new Y(t)}function Z(e){return typeof e==`object`&&!!e&&e.progressive===1}function Je(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)n[e]=t.charCodeAt(e);return n}function Q(e){if(e.aborted)throw e.reason??new DOMException(`Aborted`,`AbortError`)}async function Ye(e){try{await fetch(`/api/conversation/outline-transfer/${encodeURIComponent(e)}`,{method:`DELETE`,keepalive:!0})}catch{}}async function $(e,t){let n=[],r=0,i=e.total,a=e.sha256;try{for(;i===void 0||r<i;){Q(t);let o=await l(`/api/conversation/outline-transfer/${encodeURIComponent(e.token)}?offset=${r}`,t);if(Q(t),i===void 0&&(i=o.total),a===void 0&&(a=o.sha256),o.offset!==r||o.total!==i||o.sha256!==a||o.next_offset<=r)throw Error(`Invalid outline transfer`);let s=Je(o.chunk);if(r+s.length!==o.next_offset)throw Error(`Invalid outline chunk`);if(n.push(s),r=o.next_offset,o.done!==(r===i))throw Error(`Invalid outline completion`)}let o=new Uint8Array(r),s=0;for(let e of n)o.set(e,s),s+=e.length;if(a===void 0||!/^[0-9a-f]{64}$/.test(a)||await qe(o,t)!==a)throw Error(`Invalid outline digest`);return JSON.parse(new TextDecoder().decode(o))}catch(t){throw Ye(e.token),t}}function Xe(e,t){let d=e?n(e):null,f=d?r(d):null,p=t?.revalidateOnTick??!0,h=t?.growthNonce??0,g=t?.live??!1,[_,v]=(0,o.useState)(null),[y,x]=(0,o.useState)(!1),[S,C]=(0,o.useState)(null),[w,T]=(0,o.useState)(null),[E,D]=(0,o.useState)(!1),O=(0,o.useRef)(f),k=(0,o.useRef)(d),A=(0,o.useRef)(null),j=(0,o.useRef)(!1),M=(0,o.useRef)(!1),N=(0,o.useRef)(0),P=(0,o.useRef)(null),I=(0,o.useCallback)(async()=>{if(j.current){M.current=!0;return}let e=O.current,t=k.current;if(!e||!t)return;let n=N.current+1;N.current=n;let r=new AbortController;P.current=r;let a=()=>N.current===n&&O.current===e&&!r.signal.aborted;j.current=!0;try{let e=b(t,`outline`,{progressive:1});if(i(t)){let n=await l(e,r.signal);if(!a())return;X(n);let i=Z(n),o=i?n.summary:n,s;if(o!==void 0){if(s=K(t,o),!a())return;A.current=s,v(s),C(null),T(null),D(!1),x(!1)}let c=i?await $(n.transfer,r.signal):o;X(c);let u=t.source===`claude`?await l(b(t,`prompts`),r.signal):null;if(X(u),s=K(t,c,{},u?new Set((u.prompts??[]).map(e=>e.item_key)):void 0),!a())return;A.current=s,v(s),C(null),T(null),D(!1),x(!1)}else{let t=await l(e,r.signal);if(!a())return;if(X(t),`status`in t&&t.status===`not_found`){A.current=null,v(null),C(null),T(null),D(!0),x(!1);return}let n=Z(t),i;if(n){if(t.summary!==void 0){if(i=t.summary,!a())return;A.current=i,v(i),C(null),T(null),D(!1),x(!1)}i=await $(t.transfer,r.signal),X(i)}else i=t;if(!a())return;A.current=i,v(i),C(null),T(null),D(!1),x(!1)}}catch(e){if(c(e)||!a())return;if(e instanceof Y){A.current=null,v(null),C(null),T(m(e.reason)),D(!1),x(!1);return}if(!i(t)&&e instanceof s&&e.status===404){A.current=null,v(null),C(null),T(null),D(!0),x(!1);return}T(null),C(e instanceof F?`Conversation indexing is still finishing.`:`Couldn't load the outline.`),x(!1)}finally{N.current===n&&(P.current=null,j.current=!1,M.current&&(M.current=!1,I()))}},[]);return(0,o.useEffect)(()=>{if(P.current?.abort(),N.current+=1,O.current=f,k.current=d,A.current=null,j.current=!1,M.current=!1,v(null),C(null),T(null),D(!1),!d){x(!1);return}return x(!0),I(),()=>{P.current?.abort(),N.current+=1,j.current=!1,M.current=!1}},[f,I]),(0,o.useEffect)(()=>{p&&!g&&A.current&&I()},[u(a()),p,g]),(0,o.useEffect)(()=>{h!==0&&p&&A.current&&I()},[h]),{outline:_,loading:y,error:S,degraded:w,notFound:E}}var Ze=new Set([`edit`,`multiedit`,`write`,`apply_patch`,`patch_apply_end`]),Qe=new Set([`bash`,`exec`]);function $e(e,t){if(t===`all`)return!0;if(t.startsWith(`subagent:`))return e.subagent_key===t.slice(9);let n=t=>(e.tools??[]).some(e=>!!e.name&&t.has(e.name.toLowerCase()));if(t===`edits`)return n(Ze);if(t===`bash`)return n(Qe);let r=(e.tools??[]).some(e=>e.is_error);return e.is_sidechain?t===`errors`&&r:t===`prompts`?e.kind===`human`:t===`errors`?r:e.kind===`human`?!0:e.kind===`assistant`?e.label.trim()!==``||(e.thinking?.length??0)>0:!1}var et=new Set([`ExitPlanMode`,`AskUserQuestion`]);function tt(e,t,n){let r=[],i=[],a=[],o=[],s=[],c=[],l=[],u=new Map,d=new Map,f=new Map,p=new Set,m=!!n?.length;e.forEach((e,n)=>{u.set(e.uuid,n);for(let t of e.member_uuids?.length?e.member_uuids:[e.uuid])d.has(t)||d.set(t,n);for(let t of e.segment_uuids??[])f.has(t)||f.set(t,n);let h={anchorKey:e.uuid,ownerTurnIndex:n};!m&&e.tools?.some(e=>e.is_error)&&r.push(h),e.kind===`human`&&i.push(h),e.subagent_key!=null&&!p.has(e.subagent_key)&&(p.add(e.subagent_key),a.push(h)),!m&&e.tools?.some(e=>e.name!=null&&et.has(e.name))&&o.push(h),e.cache_failure&&s.push(h),e.kind===`meta`&&e.meta_kind===`compaction`&&c.push(h),t&&e.uuid in t&&l.push(h)});for(let{landmark:t,ownerTurnIndex:i}of P(e,n)){let e={anchorKey:t.uuid,ownerTurnIndex:i,innerAnchorKey:M(t)};t.kind===`tool_error`?r.push(e):t.kind===`plan`&&o.push(e)}return{error:r,prompt:i,subagent:a,plan:o,cache:s,compaction:c,bookmark:l,indexByUuid:u,memberIndex:d,segmentIndex:f}}function nt(e,t,n){let r=ot(e.map(e=>e.ownerTurnIndex),t,n);if(r==null)return null;let i=e.filter(e=>e.ownerTurnIndex===r);return(n===1?i[0]:i[i.length-1])??null}function rt(e){return new Set(e.map(e=>e.ownerTurnIndex)).size}function it(e,t){let n=e.indexByUuid.get(t);if(n!==void 0)return n;let r=e.memberIndex.get(t);return r===void 0?e.segmentIndex.get(t):r}function at(e,t){return t==null?-1:it(e,t)??-1}function ot(e,t,n){if(n===1){for(let n of e)if(n>t)return n;return null}for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n];return null}export{g as A,w as C,m as D,C as E,l as F,c as I,v as M,u as N,p as O,s as P,D as S,S as T,N as _,$e as a,k as b,I as c,Ne as d,Me as f,Pe as g,ze as h,nt as i,_ as j,b as k,F as l,Be as m,at as n,it as o,Re as p,rt as r,Xe as s,tt as t,U as u,M as v,T as w,O as x,j as y};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg" />
|
|
7
7
|
<title>cctally dashboard</title>
|
|
8
|
-
<script type="module" crossorigin src="/static/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/static/assets/index-BKTWH9JE.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/static/assets/useKeymap-CUgEnnua.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/static/assets/index-D34eYhAc.css">
|
|
11
11
|
</head>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cctally",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.118.0",
|
|
4
4
|
"description": "Claude Code usage tracker and local dashboard for Pro/Max subscription limits - weekly cost-per-percent trend, quota forecasts, threshold alerts. ccusage-compatible.",
|
|
5
5
|
"homepage": "https://github.com/omrikais/cctally",
|
|
6
6
|
"repository": {
|
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
"bin/_lib_diff_kernel.py",
|
|
128
128
|
"bin/_lib_display_tz.py",
|
|
129
129
|
"bin/_lib_doctor.py",
|
|
130
|
+
"bin/_lib_doctor_scan_index.py",
|
|
130
131
|
"bin/_lib_five_hour.py",
|
|
131
132
|
"bin/_lib_fmt.py",
|
|
132
133
|
"bin/_lib_forecast.py",
|
|
@@ -166,6 +167,7 @@
|
|
|
166
167
|
"bin/_lib_semver.py",
|
|
167
168
|
"bin/_lib_share.py",
|
|
168
169
|
"bin/_lib_share_templates.py",
|
|
170
|
+
"bin/_lib_retained_records.py",
|
|
169
171
|
"bin/_lib_retained_size.py",
|
|
170
172
|
"bin/_lib_snapshot_cache.py",
|
|
171
173
|
"bin/_lib_source_analytics.py",
|
|
@@ -173,6 +175,7 @@
|
|
|
173
175
|
"bin/_lib_source_retry.py",
|
|
174
176
|
"bin/_lib_sqlite_close.py",
|
|
175
177
|
"bin/_lib_stale_proof.py",
|
|
178
|
+
"bin/_lib_stats_content_revision.py",
|
|
176
179
|
"bin/_lib_stats_damage.py",
|
|
177
180
|
"bin/_lib_stats_publish.py",
|
|
178
181
|
"bin/_lib_stats_wal.py",
|