@gamaze/hicortex 0.29.1 → 0.29.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -814,6 +814,12 @@
814
814
  </dl>
815
815
  </div>
816
816
  </div>
817
+ <!-- AC-N4: memories by topic — top five live domains + the live count.
818
+ #651: moved here from Analytics — topics are corpus CONTENT (they
819
+ belong with the Brain quadrant), activity stays in Analytics. -->
820
+ <div class="panel-label" id="an-topics-label">Memories by topic</div>
821
+ <div class="stackbar" id="an-topics"></div>
822
+ <div class="legend" id="an-legend"></div>
817
823
  </div>
818
824
  </section>
819
825
 
@@ -845,10 +851,6 @@
845
851
  <span><i style="background:#14586a"></i>distill</span>
846
852
  <span><i style="background:#9cc3cd"></i>consolidation</span>
847
853
  </div>
848
- <!-- AC-N4: memories by topic — top five live domains + the live count. -->
849
- <div class="panel-label" id="an-topics-label">Memories by topic</div>
850
- <div class="stackbar" id="an-topics"></div>
851
- <div class="legend" id="an-legend"></div>
852
854
  <!-- Nightly budget (#648 item 9: moved from Brain — the spend story
853
855
  lives with the pipeline numbers it measures). LLM calls used/max
854
856
  (no row when the day's snapshot carries no budget fields), tokens
@@ -891,7 +893,10 @@
891
893
  <div class="zoomctl" id="map-zoom">
892
894
  <button type="button" id="map-zin" title="Zoom in (or scroll on the field)" aria-label="Zoom in">+</button>
893
895
  <button type="button" id="map-zout" title="Zoom out" aria-label="Zoom out">−</button>
894
- <button type="button" id="map-zfit" title="Fit the whole field in view" aria-label="Fit the whole field in view">⤢</button>
896
+ <!-- #651: fit carries the corner-brackets frame glyph — the header's
897
+ expand icon (diagonal arrows, open /viz) stays the ONLY
898
+ open-full-view affordance; two actions, two icons. -->
899
+ <button type="button" id="map-zfit" title="Fit the whole field in view" aria-label="Fit the whole field in view"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/></svg></button>
895
900
  </div>
896
901
  <div class="timeline" id="replay">
897
902
  <button type="button" id="rp-pause" title="pause the replay">❚❚</button>
@@ -2893,22 +2898,6 @@ function circlePill(agentId){
2893
2898
  if(n===null) return '';
2894
2899
  return '<span class="conf-pill" title="Confidential circle — this agent\'s captures are confidential, hidden from other agents\' recall · '+n+' confidential '+(n===1?'memory':'memories')+'">confidential</span>';
2895
2900
  }
2896
- /** Bundle-level pill (group headers) — the tooltip names every member agent
2897
- + its count; '' when none of the ids are members.
2898
- #642: fleet.spaces present → one chip per space covering any of the ids
2899
- (same typeof-D guard as circlePill). */
2900
- function circleBundlePill(ids){
2901
- if(!Array.isArray(ids)) return '';
2902
- const sb=(typeof D!=='undefined'&&D&&D.fleet)?D.fleet.spaces:null;
2903
- if(sb&&Array.isArray(sb.spaces)) return spaceBundleBadges(ids,sb);
2904
- const hits=[];
2905
- for(const id of ids){
2906
- const n=circleCount(id);
2907
- if(n!==null) hits.push(id+' ('+n+')');
2908
- }
2909
- if(!hits.length) return '';
2910
- return '<span class="conf-pill" role="img" aria-label="confidential bundle" title="Confidential circle agents in this bundle: '+esc(hits.join(', '))+'"><svg viewBox="0 0 12 12" aria-hidden="true"><rect x="2.2" y="5.2" width="7.6" height="5.6" rx="1.2"/><path d="M4 5.2V3.8a2 2 0 0 1 4 0v1.4"/></svg></span>';
2911
- }
2912
2901
  /** The header legend chip — null when no roster exists (nothing rendered,
2913
2902
  honest empty state); the tooltip carries the ROSTER itself plus the
2914
2903
  capturing members (the issue's presence rule: the roster is visible
@@ -2923,7 +2912,7 @@ function circleLegend(){
2923
2912
  /* ---------- #642: spaces — fleet.spaces rides the same /dashboard/data
2924
2913
  payload (ALWAYS present; spaces [] when nothing is configured). The
2925
2914
  per-agent chips REPLACE the single amber circle pill when the block is
2926
- there (circlePill/circleBundlePill delegate); the confidential chip keeps
2915
+ there (circlePill delegates); the confidential chip keeps
2927
2916
  the amber family. Agents in no space show nothing extra — the Spaces
2928
2917
  panel's Unassigned lane is where they surface. D.fleet.spaces ABSENT on a
2929
2918
  pre-#642 server → every helper here is never reached (the pill helpers
@@ -2966,19 +2955,6 @@ function spaceBadges(agentId,b){
2966
2955
  }
2967
2956
  return out;
2968
2957
  }
2969
- /** Bundle-level chips (group headers) — one chip per space covering ANY of
2970
- the bundle's ids; the tooltip names the member agents. */
2971
- function spaceBundleBadges(ids,b){
2972
- if(!Array.isArray(ids)||!b||!Array.isArray(b.spaces)) return '';
2973
- let out='';
2974
- for(const s of b.spaces){
2975
- if(!s||!Array.isArray(s.members)) continue;
2976
- const hits=ids.filter(id=>s.members.some(m=>spaceMemberMatch(id,m)));
2977
- if(!hits.length) continue;
2978
- out+='<span class="space-chip'+(s.id==='confidential'?' conf':'')+'" role="img" aria-label="'+esc(s.id)+' space" title="Space: '+esc(s.id)+' — agents in this bundle: '+esc(hits.join(', '))+'">'+esc(s.id)+'</span>';
2979
- }
2980
- return out;
2981
- }
2982
2958
  let spPickerAgent=null; // the unassigned agent whose inline assign picker is open
2983
2959
  async function spacesAssign(agent,space){
2984
2960
  try{
@@ -3176,9 +3152,10 @@ function agRender(){
3176
3152
  const pill=g.pillKind==='conf'?'<span class="pill conf">confidential</span>'
3177
3153
  :g.pillKind==='std'?'<span class="pill std">standard</span>'
3178
3154
  :g.pillKind==='shr'?'<span class="pill shr">needs a space</span>':'';
3179
- const ids=g.members.map(m=>m.id);
3180
3155
  const sums=g.sums?' <span class="n">'+fmt(g.sums.sessions)+' sess · '+mbFmt(g.sums.bytes)+'</span>':'';
3181
- const bundlePill=g.key.indexOf('space:')===0?'':circleBundlePill(ids);
3156
+ /* #651: no bundle badges here — the privacy pill IS the space-group
3157
+ key; machine/flat headers carry label · sums · count · toggle only
3158
+ (per-row Space cells show membership). */
3182
3159
  const n='<span class="n">'+g.members.length+' agent'+(g.members.length>1?'s':'')+'</span>';
3183
3160
  // #648 item 1: a collapsed group (only Pre-tracking carries the flag)
3184
3161
  // renders its members hidden until agPreOpen flips; the header carries
@@ -3188,7 +3165,7 @@ function agRender(){
3188
3165
  const hint=g.collapsed?' <span class="grp-hint">no machine stamp — captured before workspace stamping</span>':'';
3189
3166
  const head=g.collapsed?' data-collapsed title="agents with no machine stamp — sessions predate workspace stamping; they still distill, they only lack a machine label"':'';
3190
3167
  const trRow=r=>(g.collapsed&&!agPreOpen)?tr(r).replace('<tr>','<tr hidden>'):tr(r);
3191
- return '<tbody><tr><td colspan="5" style="padding:0"><div class="grp-h"'+head+'>'+(pill+bundlePill+' '+esc(g.label)+hint+sums+n+toggle).trim()+'</div></td></tr>'
3168
+ return '<tbody><tr><td colspan="5" style="padding:0"><div class="grp-h"'+head+'>'+(pill+' '+esc(g.label)+hint+sums+n+toggle).trim()+'</div></td></tr>'
3192
3169
  +g.members.map(trRow).join('')+'</tbody>';
3193
3170
  }).join('');
3194
3171
  html+='</table>';
@@ -3661,19 +3638,6 @@ function renderAnalytics(){
3661
3638
  const picks=[0,Math.floor((dates.length-1)/4),Math.floor((dates.length-1)/2),Math.floor(3*(dates.length-1)/4),dates.length-1];
3662
3639
  axisEl.innerHTML=[...new Set(picks)].map(i=>'<span>'+fmtDay(dates[i])+'</span>').join('');
3663
3640
  }else axisEl.innerHTML='<span>—</span>';
3664
- // memories by topic (AC-N4): top five live domains + the live count.
3665
- // #648 item 5: the swatches share the ONE DOMAIN_TONES family with the
3666
- // Brain map's legend (no second inline ramp on this page)
3667
- const byDomain=(D&&D.composition&&D.composition.by_domain)||{};
3668
- const top=Object.entries(byDomain).sort((a,b)=>b[1]-a[1]).slice(0,5);
3669
- const total=top.reduce((a,[,v])=>a+v,0)||1;
3670
- const live=(D&&D.headline&&D.headline.live_memories!=null)?D.headline.live_memories:(D&&D.headline?D.headline.total_memories:null);
3671
- el('an-topics-label').textContent='Memories by topic'+(live!=null?' · '+fmt(live)+' live':'');
3672
- el('an-topics').innerHTML=top.length
3673
- ?top.map(([k,v],i)=>'<i style="width:'+Math.max(1,Math.round(v/total*100))+'%;background:'+DOMAIN_TONES[i]+';cursor:help" title="'+esc(k)+' '+fmt(v)+'"></i>').join('')
3674
- :'<i style="width:100%;background:#eef2f3"></i>';
3675
- el('an-legend').innerHTML=top.map(([k,v],i)=>'<span><i style="background:'+DOMAIN_TONES[i]+'"></i><b>'+esc(k)+'</b> '+fmt(v)+'</span>').join('')
3676
- ||'<span style="color:var(--faint)">no domains yet</span>';
3677
3641
  // the status chip (AC-N5): queue staleness + stale capture bundles
3678
3642
  const staleCapture=(Array.isArray(D&&D.fleet&&D.fleet.last_seen)?D.fleet.last_seen:[])
3679
3643
  .filter(s=>{ const p=presenceOf(s); return p&&p.cls==='stale'; }).length;
@@ -3727,8 +3691,10 @@ function renderRecDiv(){
3727
3691
  +lines.map(l=>'· '+l.line+(typeof l.shown==='number'?' — '+fmt(l.shown)+' showings':'')).join('\n');
3728
3692
  }
3729
3693
 
3730
- /* ---------- Brain corpus kv (AC-B6; the nightly budget moved to
3731
- renderAnalytics — #648 item 9) ---------- */
3694
+ /* ---------- Brain corpus kv (AC-B6) + memories by topic (AC-N4; moved
3695
+ here from renderAnalytics — #651: topics are corpus content, the
3696
+ renderer follows the DOM like #648 item 9 did for the budget).
3697
+ The nightly budget itself stays in renderAnalytics (#648 item 9). ---------- */
3732
3698
  function renderBrain(){
3733
3699
  const h=D&&D.headline?D.headline:null;
3734
3700
  renderRecDiv();
@@ -3753,6 +3719,19 @@ function renderBrain(){
3753
3719
  el('cor-domains').textContent=domains!=null?fmt(domains):'—';
3754
3720
  renderModelCard();
3755
3721
  renderRecBand(h?h.uses_per_showing:null);
3722
+ // memories by topic (AC-N4): top five live domains + the live count.
3723
+ // #648 item 5: the swatches share the ONE DOMAIN_TONES family with the
3724
+ // Brain map's legend (no second inline ramp on this page)
3725
+ const byDomain=(D&&D.composition&&D.composition.by_domain)||{};
3726
+ const top=Object.entries(byDomain).sort((a,b)=>b[1]-a[1]).slice(0,5);
3727
+ const total=top.reduce((a,[,v])=>a+v,0)||1;
3728
+ const live=(D&&D.headline&&D.headline.live_memories!=null)?D.headline.live_memories:(D&&D.headline?D.headline.total_memories:null);
3729
+ el('an-topics-label').textContent='Memories by topic'+(live!=null?' · '+fmt(live)+' live':'');
3730
+ el('an-topics').innerHTML=top.length
3731
+ ?top.map(([k,v],i)=>'<i style="width:'+Math.max(1,Math.round(v/total*100))+'%;background:'+DOMAIN_TONES[i]+';cursor:help" title="'+esc(k)+' '+fmt(v)+'"></i>').join('')
3732
+ :'<i style="width:100%;background:#eef2f3"></i>';
3733
+ el('an-legend').innerHTML=top.map(([k,v],i)=>'<span><i style="background:'+DOMAIN_TONES[i]+'"></i><b>'+esc(k)+'</b> '+fmt(v)+'</span>').join('')
3734
+ ||'<span style="color:var(--faint)">no domains yet</span>';
3756
3735
  }
3757
3736
  /* ---------- Post-write refresh (AC-A7): assign, unassign and capture-pause
3758
3737
  re-fetch /dashboard/data (the fleet block is what changed) and re-render
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamaze/hicortex",
3
- "version": "0.29.1",
3
+ "version": "0.29.2",
4
4
  "description": "Persistent agent identity for AI agents \u2014 a hand-edited identity layer, nightly-distilled experience, and lessons injected every session, shared across your whole fleet. Works with Hermes, OpenClaw, Claude Code, Pi, and opencode.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/server.json CHANGED
@@ -3,12 +3,12 @@
3
3
  "name": "io.github.gamaze-labs/hicortex",
4
4
  "title": "Hicortex \u2014 AI Fleet Memory",
5
5
  "description": "Shared fleet memory for AI agents: nightly self-correction, recall every prompt (supported agents).",
6
- "version": "0.29.1",
6
+ "version": "0.29.2",
7
7
  "packages": [
8
8
  {
9
9
  "registryType": "npm",
10
10
  "identifier": "@gamaze/hicortex",
11
- "version": "0.29.1",
11
+ "version": "0.29.2",
12
12
  "transport": {
13
13
  "type": "stdio",
14
14
  "command": "npx",