even-keel 0.3.2 → 0.3.3

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 (39) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/src/claude/adapter.js +1 -0
  3. package/dist/src/service/chain.js +12 -2
  4. package/dist/src/service/hosting.js +5 -1
  5. package/dist/src/sessions/keepwarm.js +11 -1
  6. package/dist/src/sessions/monitor.js +1 -0
  7. package/dist/web/assets/BadgeDialog-B3VcoEuQ.js +1 -0
  8. package/dist/web/assets/{DescriptionEditor-CpRmzCRQ.js → DescriptionEditor-CPfdoDlm.js} +4 -4
  9. package/dist/web/assets/ProjectPackages-BO4rIO5w.js +1 -0
  10. package/dist/web/assets/{Select-BkfVMQn9.js → Select-BYWAe5Fn.js} +1 -1
  11. package/dist/web/assets/TaskCard-DvrNOwWg.js +2 -0
  12. package/dist/web/assets/TranscriptWindow-BiO9Wnwu.js +4 -0
  13. package/dist/web/assets/accountParts-DSHr6oHI.js +3 -0
  14. package/dist/web/assets/blocks-C9HVGHBz.js +12 -0
  15. package/dist/web/assets/{cardDrafts-BfmbAV1M.js → cardDrafts-4S62wAyr.js} +2 -2
  16. package/dist/web/assets/{cardSide-D2KI5tvT.js → cardSide-B4pcPyyP.js} +2 -2
  17. package/dist/web/assets/{feedLine-Ba2zSS8M.js → feedLine-Bw0m9J2B.js} +1 -1
  18. package/dist/web/assets/{hooks-JRdbz0x_.js → hooks-DkC_CVfs.js} +1 -1
  19. package/dist/web/assets/index-9wCKwZBT.js +25 -0
  20. package/dist/web/assets/{index-gsaRwWJo.css → index-CZNlGIGI.css} +1 -1
  21. package/dist/web/assets/{lib-BWXVCBDM.js → lib-DqcU8Atw.js} +1 -1
  22. package/dist/web/assets/overview-CAfIOCOy.js +7 -0
  23. package/dist/web/assets/{packageGroups-Bp5E3IBW.js → packageGroups-BQRZ8Kq6.js} +1 -1
  24. package/dist/web/assets/{react-dom-BrsVbrva.js → react-dom-ntoTaxXv.js} +1 -1
  25. package/dist/web/assets/{rules-LK65q0Fp.js → rules-D-jNBQYg.js} +1 -1
  26. package/dist/web/assets/{useFileDrop-uBrD_n1G.js → useFileDrop-B3fsWqOP.js} +1 -1
  27. package/dist/web/assets/{useHeightGlide-DUlst5w-.js → useHeightGlide-75qzC7AC.js} +2 -2
  28. package/dist/web/assets/useRowFocus-DnfnHKTV.js +1 -0
  29. package/dist/web/index.html +15 -15
  30. package/package.json +1 -1
  31. package/dist/web/assets/BadgeDialog-DTnQXw9H.js +0 -1
  32. package/dist/web/assets/ProjectPackages-BILdF91o.js +0 -1
  33. package/dist/web/assets/TaskCard-BdMTPm5U.js +0 -2
  34. package/dist/web/assets/TranscriptWindow-DWmiEsux.js +0 -4
  35. package/dist/web/assets/accountParts-BgNHNRlI.js +0 -3
  36. package/dist/web/assets/blocks-CrABcaPz.js +0 -12
  37. package/dist/web/assets/index-CLtOpp9i.js +0 -25
  38. package/dist/web/assets/overview-D3YlvCUL.js +0 -7
  39. package/dist/web/assets/useRowFocus-B25YUpUj.js +0 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,22 @@ All notable changes to Even Keel are documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.3.3] - 2026-11-18
8
+
9
+ A patch of 0.3: keep-warm through a long tool call, and a cache clock that knows about keep-warm.
10
+
11
+ ### Changed
12
+
13
+ - **Keep-warm also keeps the cache of a session whose turn waits on a long tool call**, such as a build or a test run that lasts longer than the cache. Before, only a session waiting for you was pinged: on a five-minute cache a six-minute test run let the cache go cold, and the next request wrote the whole context again. Codex sessions still wait for the turn to end.
14
+
15
+ ### Fixed
16
+
17
+ - **The cache clock counts from the last keep-warm ping that read the cache.** The same goes for its colour, the ring on the chain row and the dialog before a reply to a cold session; before, they called a cache that keep-warm kept warm cold. The tip of the session's **Cache** shows how many times keep-warm renewed the cache since the session's last answer, and when it did so last.
18
+ - No tip opens with the browser's own tooltip over it:
19
+ - The session's **Cache** starts its tip with when the cache stays warm until or when it went cold.
20
+ - The cache ring on a chain row names the task's priority in its own tip, instead of "Priority: …" over it.
21
+ - On `/stats`, a session's name in the task's timeline is a tip of its own, apart from the price estimate.
22
+
7
23
  ## [0.3.2] - 2026-11-17
8
24
 
9
25
  A patch of 0.3: a permission question that no longer vanishes, and the README badge during a fix of the main branch or a release carry.
@@ -175,6 +175,7 @@ export const claude = {
175
175
  const { cwd, prompt, model, settings, mcp, plugins, effort } = start;
176
176
  return cli.warm(home, sessionId, cwd, prompt, model, { settings, mcp, plugins, effort, instructions: agentsFallback(cwd) });
177
177
  },
178
+ warmsOnTool: true,
178
179
  // The lifetime the transcript last wrote (`cacheTtl`, a subscription's overage); before any write an hour on a subscription, five minutes on a key.
179
180
  warmMs: (cache, apiKey) => warmCacheMs(cache?.ttl ?? (apiKey ? null : '1h')),
180
181
  liveRecords,
@@ -122,8 +122,17 @@ export function wireKeepWarm(ctx) {
122
122
  const view = ctx.warmable(each);
123
123
  if (view === undefined)
124
124
  return [];
125
- const busy = ctx.agentStatus(view.task) === 'busy' || ctx.monitor.holds.held(view.sessionId);
126
- return [{ task: view.task, sessionId: view.sessionId, busy, limited: view.lamp === 'limit', cache: view.cache }];
125
+ const session = ctx.monitor.handoff(view.task);
126
+ const onTool = view.onTool === true && session !== undefined && ctx.agentOf(ctx.homeOf(session.account)).warmsOnTool === true;
127
+ return [{
128
+ task: view.task,
129
+ sessionId: view.sessionId,
130
+ busy: ctx.agentStatus(view.task) === 'busy',
131
+ onTool,
132
+ held: ctx.monitor.holds.held(view.sessionId),
133
+ limited: view.lamp === 'limit',
134
+ cache: view.cache,
135
+ }];
127
136
  }),
128
137
  ping: async ({ task, sessionId }) => {
129
138
  const view = ctx.warmable({ task, sessionId });
@@ -134,6 +143,7 @@ export function wireKeepWarm(ctx) {
134
143
  const start = { name: task, cwd: session.cwd, prompt: KEEP_WARM_PROMPT, model: view.model, settings: await ctx.settingsFor(task), ...ctx.agentExtras(home, ctx.projectOf(task), task) };
135
144
  return ctx.agentOf(home).warm(home, session, start);
136
145
  },
146
+ onWarm: () => ctx.hub.broadcastSoon('state', ctx.getState),
137
147
  now: () => new Date(),
138
148
  log: (line) => console.log(line),
139
149
  });
@@ -100,7 +100,11 @@ export function wireGetState(ctx) {
100
100
  })),
101
101
  // A finished session's feed is read from its record, and the page shows no action of it (`showsAction`); the one the
102
102
  // chain waits on keeps both: delivering an answer stops it for a while, and the page shows it working (BTN-695).
103
- sessions: ctx.sessions.map((view) => view.lamp === 'finished' && !ctx.dispatcher.state.active.some((chain) => chain.current?.sessionId === view.sessionId) ? { ...view, feed: [], action: null } : view),
103
+ sessions: ctx.sessions.map((view) => {
104
+ const shown = view.lamp === 'finished' && !ctx.dispatcher.state.active.some((chain) => chain.current?.sessionId === view.sessionId) ? { ...view, feed: [], action: null } : view;
105
+ const warm = ctx.keepWarm.kept(view.sessionId, view.cache);
106
+ return warm === null ? shown : { ...shown, warm };
107
+ }),
104
108
  limits: ctx.limits.limits(ctx.activeAccount()),
105
109
  usage: ctx.limits.usage(ctx.activeAccount()),
106
110
  account: {
@@ -16,7 +16,7 @@ export const KEEP_WARM_PROMPT = 'Reply with the single word ok.';
16
16
  /** Whether to ping the session now: only a warm cache about to go cold, within the idle ceiling and the break-even. */
17
17
  export function warmStep(facts, memory, now, maxIdleMs) {
18
18
  const { cache } = facts;
19
- if (facts.busy || facts.limited || cache === null)
19
+ if ((facts.busy && !facts.onTool) || facts.held || facts.limited || cache === null)
20
20
  return 'wait';
21
21
  const ttlMs = TTL_MS[cache.ttl];
22
22
  const stretch = Date.parse(cache.until) - ttlMs;
@@ -77,6 +77,15 @@ export class KeepWarm {
77
77
  warmedAt(sessionId) {
78
78
  return this.memory.get(sessionId)?.warmedAt ?? null;
79
79
  }
80
+ /** The pings of the stretch of idleness `cache` names, for the page; `null` — none, or only those of an earlier one. */
81
+ kept(sessionId, cache) {
82
+ const memory = this.memory.get(sessionId);
83
+ if (memory?.warmedAt == null || cache === null)
84
+ return null;
85
+ if (Date.parse(memory.stretch) !== Date.parse(cache.until) - TTL_MS[cache.ttl])
86
+ return null;
87
+ return { at: memory.warmedAt, pings: memory.pings };
88
+ }
80
89
  async ping(facts, now) {
81
90
  const { task, sessionId, cache } = facts;
82
91
  const stretch = new Date(Date.parse(cache.until) - TTL_MS[cache.ttl]).toISOString();
@@ -94,6 +103,7 @@ export class KeepWarm {
94
103
  const pings = before?.stretch === stretch ? before.pings + 1 : 1;
95
104
  this.memory.set(sessionId, { stretch, pings, warmedAt: now.toISOString() });
96
105
  this.deps.log(`keepwarm: ${task}: the ping ${pings} kept the cache of ${sessionId} warm (${read})`);
106
+ this.deps.onWarm?.();
97
107
  }
98
108
  catch (error) {
99
109
  if (isTransientError(error.message)) {
@@ -251,6 +251,7 @@ function toView(task, { agent, runsOn, present, transcript, bridge }, remoteOf,
251
251
  tokens: summary.tokens,
252
252
  stage: summary.stage,
253
253
  action: summary.action,
254
+ ...(present && summary.turn?.tool != null && { onTool: true }),
254
255
  feed: summary.feed,
255
256
  ...(summary.badgeStatus === undefined ? {} : { badgeStatus: summary.badgeStatus }),
256
257
  remoteUrl: remote.url,
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,Ai as n,D as r,Di as i,Fr as a,M as o,Nn as s,Rr as c,Si as l,Xt as u,i as d,mi as f,t as p,ut as m,v as h,y as g,zr as _}from"./blocks-C9HVGHBz.js";import{t as v}from"./react-dom-ntoTaxXv.js";import{t as y}from"./secret-CmK85pY6.js";/* empty css */var b=e(n(),1),x=e(v(),1),S=[`title`,`agent`,`model`,`time`,`action`,`context`,`chain`,`milestone`,`sessions`,`medianCost`,`medianMinutes`],C=`EVEN_KEEL_BADGE_SECRET`,w=[{id:`tasks`,fields:[`agent`,`model`,`time`,`action`]},{id:`context`,fields:[`context`]},{id:`chain`,fields:[`chain`]},{id:`milestone`,fields:[`milestone`]},{id:`sessions`,fields:[`sessions`]},{id:`medianCost`,fields:[`medianCost`]},{id:`medianMinutes`,fields:[`medianMinutes`]},{id:`title`,fields:[`title`]}],T=(e,t)=>t.fields.every(t=>e.includes(t));function E(e,t,n){return S.filter(r=>t.fields.includes(r)?n:e.includes(r))}function D(e){let t=e.toLowerCase().replace(/[^a-z0-9-]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,64);return t===``?`project`:t}function O(e,t){return e??{on:!1,url:``,slug:D(t),fields:[...S]}}var k=/^[a-z0-9-]+(?:\.[a-z0-9-]+)+(?::\d+)?\//;function A(e){let t=e.filter(e=>k.test(e.id)),n=t.find(e=>e.id.startsWith(`github.com/`))??t.find(e=>e.id.startsWith(`gitlab.`))??t[0];return n===void 0?null:`https://${n.id}${n.id.startsWith(`gitlab.`)?`/-/releases`:`/releases`}`}var j=e=>e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`);function M(e){let t=`${e.url.trim().replace(/\/+$/,``)}/${e.slug}.svg`,n=`<picture><source media="(prefers-color-scheme: light)" srcset="${j(`${t}?theme=light`)}"><img alt="${j(`${e.name}: what the chain is building now`)}" src="${j(`${t}?theme=dark`)}"></picture>`,r=e.releases.trim();return r===``?n:`<a href="${j(r)}">${n}</a>`}function N(e,t,n){let r=e=>String(e).padStart(2,`0`);return`${e}-badge-${n.getFullYear()}-${r(n.getMonth()+1)}-${r(n.getDate())}-${r(n.getHours())}${r(n.getMinutes())}-${t}.png`}var P=2;async function F(e){let t=await fetch(e);if(!t.ok)throw Error(`badge: the picture answered ${t.status}`);let n=URL.createObjectURL(new Blob([await t.text()],{type:`image/svg+xml`}));try{let e=new Image;e.src=n,await e.decode();let t=document.createElement(`canvas`);t.width=e.naturalWidth*P,t.height=e.naturalHeight*P;let r=t.getContext(`2d`);if(r===null)throw Error(`badge: no 2D canvas`);return r.drawImage(e,0,0,t.width,t.height),await new Promise((e,n)=>t.toBlob(t=>t===null?n(Error(`badge: the canvas gave no PNG`)):e(t),`image/png`))}finally{URL.revokeObjectURL(n)}}function I(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),setTimeout(()=>URL.revokeObjectURL(n),0)}var L=_(),R=`https://github.com/NamerekT/even-keel/blob/main/deploy/badge/README.md`,z=5e3;function B({state:e,project:n,onClose:r}){let i=(0,b.useRef)(null),c=h(i,r),u=(0,b.useId)();(0,b.useEffect)(()=>{i.current?.open===!1&&i.current.showModal()},[]);let d=e.projectKeys[n]??n,m=e.config.projects[n],g=O(m?.badge,d),_=s(e,n),v=a(),y=e=>v.send(`project/badge`,{project:n,badge:e});return(0,x.createPortal)((0,L.jsx)(`dialog`,{ref:i,className:`add-package add-package--wide badge-dialog`,"aria-labelledby":u,onCancel:e=>{e.preventDefault(),r()},...c,children:(0,L.jsxs)(`div`,{className:`add-package__frame`,children:[(0,L.jsxs)(`header`,{className:`add-package__head`,children:[(0,L.jsx)(`h2`,{id:u,className:`add-package__title`,children:l.badge.title(_)}),(0,L.jsx)(`button`,{type:`button`,className:`panel__close`,"aria-label":l.badge.close,onClick:r,children:`×`})]}),(0,L.jsxs)(`div`,{className:`add-package__body badge-dialog__body`,children:[v.failure!==null&&(0,L.jsx)(p,{tone:`error`,children:f(v.failure)}),(0,L.jsx)(V,{project:n,badge:g,state:e,disabled:v.sending,onSave:y}),(0,L.jsx)(t,{title:l.badge.show,hint:l.badge.showHint,children:w.map(e=>(0,L.jsx)(o,{className:`badge-dialog__field`,label:l.badge.groups[e.id],hint:l.badge.groupHints[e.id],checked:T(g.fields,e),disabled:v.sending,onChange:t=>void y({...g,fields:E(g.fields,e,t)})},e.id))}),(0,L.jsx)(G,{project:n,label:_,fields:g.fields.join(),slug:g.slug===``?D(d):g.slug}),(0,L.jsx)(K,{state:e,project:n,badge:g,name:m?.name??d})]}),(0,L.jsxs)(`footer`,{className:`add-package__foot`,children:[(0,L.jsx)(`span`,{className:`add-package__spacer`}),(0,L.jsx)(`button`,{type:`button`,className:`button button--primary`,onClick:r,children:l.badge.done})]})]})}),document.body)}function V({project:e,badge:n,state:r,disabled:a,onSave:s}){let{query:d}=c(),[h,g]=(0,b.useState)(!1),[_,v]=(0,b.useState)(null),y=H(n.url,e=>({...n,url:e}),e),x=H(n.slug,e=>({...n,slug:e}),e),S=y.value.trim()!==``&&x.value.trim()!==``,C=async()=>{g(!0),v(null);try{v(await d(`project/badge/check`,{project:e,url:y.value,slug:x.value}))}catch(e){v({ok:!1,notice:i(e)})}finally{g(!1)}},w=(0,L.jsxs)(`a`,{className:`badge-dialog__deploy`,href:R,target:`_blank`,rel:`noreferrer`,children:[l.badge.deploy,(0,L.jsx)(m,{})]});return(0,L.jsxs)(t,{title:l.badge.where,hint:l.badge.whereHint,aside:w,children:[(0,L.jsx)(o,{className:`badge-dialog__field`,label:l.badge.on,hint:l.badge.onHint,checked:n.on,disabled:a,onChange:e=>void s({...n,on:e})}),(0,L.jsx)(U,{wide:!0,label:l.badge.url,hint:l.badge.urlHint,field:y,placeholder:`https://even-keel-badge.example.workers.dev`}),(0,L.jsx)(U,{label:l.badge.slug,hint:l.badge.slugHint,field:x,placeholder:`project`}),(0,L.jsx)(W,{state:r}),(0,L.jsxs)(`div`,{className:`badge-dialog__check`,children:[(0,L.jsx)(u,{tip:S?l.badge.checkTip:l.badge.checkNeeds,inline:!0,children:(0,L.jsx)(`button`,{type:`button`,className:`button`,"aria-disabled":!S||h,onClick:()=>S&&!h&&void C(),children:l.badge.check})}),_!==null&&(0,L.jsx)(p,{tone:_.ok?`note`:`error`,className:`badge-dialog__result`,children:f(_.notice)})]})]})}function H(e,t,n){let r=(0,b.useId)(),[i,o]=(0,b.useState)(e),[s,c]=(0,b.useState)(!1),{send:l,failure:u}=a();return(0,b.useEffect)(()=>{s||o(e)},[e,s]),{id:r,value:i,error:u,edit:e=>{c(!0),o(e)},commit:()=>{c(!1),i.trim()!==e&&l(`project/badge`,{project:n,badge:t(i.trim())})}}}function U({label:e,hint:t,field:n,placeholder:i,wide:a=!1}){return(0,L.jsx)(r,{className:`badge-dialog__field badge-dialog__field--${a?`wide`:`text`}`,label:e,hint:t,htmlFor:n.id,error:n.error,control:(0,L.jsx)(`input`,{id:n.id,className:`settings__text settings__text--mono`,autoComplete:`off`,spellCheck:!1,value:n.value,placeholder:i,"aria-invalid":n.error!==null,onChange:e=>n.edit(e.target.value),onBlur:n.commit,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),n.commit())}})})}function W({state:e}){let t=(0,b.useId)(),{send:n,sending:i,failure:o}=a(),[s,c]=(0,b.useState)(``),u=e.secrets.variables.find(e=>e.name===C),d=u?.set===!0,f=u?.outer===!0,p=async e=>{e.preventDefault(),s!==``&&await n(`secrets/set`,{name:`EVEN_KEEL_BADGE_SECRET`,value:s})&&c(``)};return(0,L.jsx)(r,{className:`badge-dialog__field badge-dialog__field--text`,label:l.badge.secret,hint:f?`${l.badge.secretHint}. ${l.badge.secretOuter}`:l.badge.secretHint,htmlFor:t,mark:!d&&(0,L.jsx)(`span`,{className:`chip packages__unset`,children:l.badge.secretUnset}),control:(0,L.jsx)(g,{error:o,children:(0,L.jsxs)(`form`,{className:`badge-dialog__secret`,onSubmit:e=>void p(e),children:[(0,L.jsx)(`input`,{id:t,className:`settings__text`,...y(),value:s,disabled:f,placeholder:d?l.badge.secretSaved:void 0,"aria-label":l.badge.secretValue,onChange:e=>c(e.target.value)}),(0,L.jsx)(`button`,{type:`submit`,className:`button button--small`,disabled:i||s===``||f,children:l.badge.save})]})})})}function G({project:e,label:n,fields:r,slug:i}){let{badgeUrl:a,state:o}=c(),[s,d]=(0,b.useState)(`dark`),[f,m]=(0,b.useState)(!1),[h,g]=(0,b.useState)(!1),_=async()=>{m(!0),g(!1);try{I(await F(a(e,s,!0)),N(i,s,new Date))}catch{g(!0)}finally{m(!1)}},[v,y]=(0,b.useState)(()=>Date.now()),x=(0,b.useRef)(v);(0,b.useEffect)(()=>{let e=Date.now();e-x.current<z||(x.current=e,y(e))},[o]),(0,b.useEffect)(()=>{x.current=Date.now(),y(x.current)},[r]);let S=a(e,s),C=S.startsWith(`data:`)?S:`${S}&at=${v}`,w=(0,L.jsx)(`div`,{className:`segmented`,role:`group`,"aria-label":l.badge.preview,children:[`dark`,`light`].map(e=>(0,L.jsx)(`button`,{type:`button`,className:s===e?`segmented__item segmented__item--on`:`segmented__item`,"aria-pressed":s===e,onClick:()=>d(e),children:l.badge[e]},e))});return(0,L.jsxs)(t,{title:l.badge.preview,hint:l.badge.previewHint,aside:w,children:[(0,L.jsx)(`div`,{className:`badge-dialog__preview badge-dialog__preview--${s}`,children:(0,L.jsx)(`img`,{src:C,alt:l.badge.previewAlt(n)})}),(0,L.jsxs)(`div`,{className:`badge-dialog__check`,children:[(0,L.jsx)(u,{tip:l.badge.pngTip,inline:!0,children:(0,L.jsx)(`button`,{type:`button`,className:`button`,"aria-disabled":f,onClick:()=>!f&&void _(),children:l.badge.png})}),h&&(0,L.jsx)(p,{tone:`error`,className:`badge-dialog__result`,children:l.badge.pngFailed})]})]})}function K({state:e,project:n,badge:i,name:a}){let o=(0,b.useId)(),s=A(e.remotes[n]??[]),[c,u]=(0,b.useState)(null),f=c??s??``,p=i.url!==``&&i.slug!==``;return(0,L.jsxs)(t,{title:l.badge.markdown,hint:l.badge.markdownHint,children:[(0,L.jsx)(r,{className:`badge-dialog__field badge-dialog__field--wide`,label:l.badge.releases,hint:l.badge.releasesHint,htmlFor:o,control:(0,L.jsx)(`input`,{id:o,className:`settings__text settings__text--mono`,autoComplete:`off`,spellCheck:!1,value:f,placeholder:`https://github.com/owner/repo/releases`,onChange:e=>u(e.target.value)})}),p?(0,L.jsx)(d,{className:`badge-dialog__markdown`,command:M({url:i.url,slug:i.slug,name:a,releases:f})}):(0,L.jsx)(`p`,{className:`badge-dialog__needs`,children:l.badge.markdownNeeds})]})}export{B as BadgeDialog};