agentix-cli 0.68.1 → 0.69.1

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 (99) hide show
  1. package/dist/{agent-32KAOR6W.js → agent-K7EPLYCP.js} +2 -2
  2. package/dist/{board-dashboard-DJXGWM4G.js → board-dashboard-BWB2FLOA.js} +186 -186
  3. package/dist/board-dashboard-BWB2FLOA.js.map +1 -0
  4. package/dist/chunk-37P3DKSX.js +649 -0
  5. package/dist/chunk-37P3DKSX.js.map +1 -0
  6. package/dist/{chunk-XFI63BEM.js → chunk-3XEN24B7.js} +7 -7
  7. package/dist/chunk-3XEN24B7.js.map +1 -0
  8. package/dist/{chunk-RX5VVHT4.js → chunk-ART666G6.js} +2 -2
  9. package/dist/{chunk-FZSEHYYU.js → chunk-CUZWGTXT.js} +2 -2
  10. package/dist/{chunk-G5JUY265.js → chunk-F2DEKA2Q.js} +2 -2
  11. package/dist/chunk-GQ76J72O.js +3 -0
  12. package/dist/chunk-GQ76J72O.js.map +1 -0
  13. package/dist/{chunk-DXOLLHVZ.js → chunk-HEJOWP7O.js} +2 -2
  14. package/dist/chunk-ILEC3IAV.js +3 -0
  15. package/dist/chunk-ILEC3IAV.js.map +1 -0
  16. package/dist/chunk-KA2UIZXG.js +3 -0
  17. package/dist/chunk-KA2UIZXG.js.map +1 -0
  18. package/dist/{chunk-7R334NQ5.js → chunk-KSDVKLHN.js} +2 -2
  19. package/dist/{chunk-LP4DLIZ5.js → chunk-KSUCHOH2.js} +19 -18
  20. package/dist/chunk-KSUCHOH2.js.map +1 -0
  21. package/dist/chunk-KXR6GVL7.js +5 -0
  22. package/dist/chunk-KXR6GVL7.js.map +1 -0
  23. package/dist/chunk-NMFXY3QU.js +2 -0
  24. package/dist/chunk-NMFXY3QU.js.map +1 -0
  25. package/dist/{chunk-HMW5CVOT.js → chunk-PDGPHE35.js} +2 -2
  26. package/dist/{chunk-FGRD3JAX.js → chunk-Q2WW2HF4.js} +2 -2
  27. package/dist/chunk-S4ASFOJU.js +2 -0
  28. package/dist/chunk-S4ASFOJU.js.map +1 -0
  29. package/dist/{chunk-NRSXMPFM.js → chunk-USTQPX4Y.js} +205 -205
  30. package/dist/chunk-USTQPX4Y.js.map +1 -0
  31. package/dist/{chunk-TX7MWUC4.js → chunk-VOS2IW4V.js} +2 -2
  32. package/dist/{chunk-REFLUAXH.js → chunk-X5BWHPR7.js} +2 -2
  33. package/dist/cli.js +1 -1
  34. package/dist/cli.js.map +1 -1
  35. package/dist/fact-proposals-LZWS5KFO.js +2 -0
  36. package/dist/{facts-72AFTTDG.js → facts-X44PF73W.js} +2 -2
  37. package/dist/index.d.ts +40 -12
  38. package/dist/index.js +1 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/ledger-CH7R756S.js +2 -0
  41. package/dist/memory-migrate-ED37IBEL.js +2 -0
  42. package/dist/memory-migrate-ED37IBEL.js.map +1 -0
  43. package/dist/program-44FEGUCB.js +2 -0
  44. package/dist/{promote-FDEKCVAE.js → promote-XRKH73IB.js} +2 -2
  45. package/dist/query-6272PJPD.js +2 -0
  46. package/dist/questions-ZATLU5AW.js +2 -0
  47. package/dist/registry-HMVIS6QJ.js +2 -0
  48. package/dist/{request-planner-KQLWWR3U.js → request-planner-73Y5GI3D.js} +2 -2
  49. package/dist/{review-candidates-A6CLXAFS.js → review-candidates-VF5IWP5P.js} +2 -2
  50. package/dist/rotation-memo-store-A4YW6FSK.js +2 -0
  51. package/dist/rotation-memo-store-A4YW6FSK.js.map +1 -0
  52. package/dist/routing-T24BMMLM.js +2 -0
  53. package/dist/routing-T24BMMLM.js.map +1 -0
  54. package/dist/{seat-W3ZTOJUT.js → seat-XNA2O6EO.js} +2 -2
  55. package/dist/seat-XNA2O6EO.js.map +1 -0
  56. package/dist/{select-VPOWFRSN.js → select-WOUZIR3Y.js} +2 -2
  57. package/dist/web/activity-graph.global.js +75 -11
  58. package/dist/web/activity-graph.global.js.map +1 -1
  59. package/dist/wiki-W6WI6HL3.js +2 -0
  60. package/dist/wiki-W6WI6HL3.js.map +1 -0
  61. package/package.json +1 -1
  62. package/dist/board-dashboard-DJXGWM4G.js.map +0 -1
  63. package/dist/chunk-5V6HNNFY.js +0 -2
  64. package/dist/chunk-5V6HNNFY.js.map +0 -1
  65. package/dist/chunk-HNR6GLNV.js +0 -648
  66. package/dist/chunk-HNR6GLNV.js.map +0 -1
  67. package/dist/chunk-L52X3YGH.js +0 -2
  68. package/dist/chunk-L52X3YGH.js.map +0 -1
  69. package/dist/chunk-LP4DLIZ5.js.map +0 -1
  70. package/dist/chunk-NRSXMPFM.js.map +0 -1
  71. package/dist/chunk-XFI63BEM.js.map +0 -1
  72. package/dist/program-7QBU5CYO.js +0 -2
  73. package/dist/query-PJG52OHP.js +0 -2
  74. package/dist/questions-2V2VGIT4.js +0 -3
  75. package/dist/questions-2V2VGIT4.js.map +0 -1
  76. package/dist/registry-BVOLZUYL.js +0 -2
  77. package/dist/routing-5G22WTPR.js +0 -2
  78. package/dist/wiki-ZM6BEOFX.js +0 -2
  79. /package/dist/{agent-32KAOR6W.js.map → agent-K7EPLYCP.js.map} +0 -0
  80. /package/dist/{chunk-RX5VVHT4.js.map → chunk-ART666G6.js.map} +0 -0
  81. /package/dist/{chunk-FZSEHYYU.js.map → chunk-CUZWGTXT.js.map} +0 -0
  82. /package/dist/{chunk-G5JUY265.js.map → chunk-F2DEKA2Q.js.map} +0 -0
  83. /package/dist/{chunk-DXOLLHVZ.js.map → chunk-HEJOWP7O.js.map} +0 -0
  84. /package/dist/{chunk-7R334NQ5.js.map → chunk-KSDVKLHN.js.map} +0 -0
  85. /package/dist/{chunk-HMW5CVOT.js.map → chunk-PDGPHE35.js.map} +0 -0
  86. /package/dist/{chunk-FGRD3JAX.js.map → chunk-Q2WW2HF4.js.map} +0 -0
  87. /package/dist/{chunk-TX7MWUC4.js.map → chunk-VOS2IW4V.js.map} +0 -0
  88. /package/dist/{chunk-REFLUAXH.js.map → chunk-X5BWHPR7.js.map} +0 -0
  89. /package/dist/{program-7QBU5CYO.js.map → fact-proposals-LZWS5KFO.js.map} +0 -0
  90. /package/dist/{facts-72AFTTDG.js.map → facts-X44PF73W.js.map} +0 -0
  91. /package/dist/{promote-FDEKCVAE.js.map → ledger-CH7R756S.js.map} +0 -0
  92. /package/dist/{query-PJG52OHP.js.map → program-44FEGUCB.js.map} +0 -0
  93. /package/dist/{registry-BVOLZUYL.js.map → promote-XRKH73IB.js.map} +0 -0
  94. /package/dist/{routing-5G22WTPR.js.map → query-6272PJPD.js.map} +0 -0
  95. /package/dist/{seat-W3ZTOJUT.js.map → questions-ZATLU5AW.js.map} +0 -0
  96. /package/dist/{wiki-ZM6BEOFX.js.map → registry-HMVIS6QJ.js.map} +0 -0
  97. /package/dist/{request-planner-KQLWWR3U.js.map → request-planner-73Y5GI3D.js.map} +0 -0
  98. /package/dist/{review-candidates-A6CLXAFS.js.map → review-candidates-VF5IWP5P.js.map} +0 -0
  99. /package/dist/{select-VPOWFRSN.js.map → select-WOUZIR3Y.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t}from"./chunk-RX5VVHT4.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-DP7RTNDM.js";import"./chunk-FZSEHYYU.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-TFVUOC2C.js";import"./chunk-TX7MWUC4.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-FX3D7YON.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as DEFAULT_PROMOTE_TYPES,a as PROMOTER_OWNER,c as PROMOTION_LEDGER_FILE,j as appendPromotionLedger,s as approveProposal,n as callPromotionLlm,p as estimateTokens,r as evidenceFor,m as getUnpromotedMemories,k as groupCandidates,h as listAllAgentMemories,d as memoryKey,e as memoryStamp,g as mergeSources,f as parseMemoryStamp,l as parsePromotionResponse,i as readPromotionLedger,t as rejectProposal,o as runPromotion,q as sourceKind};
2
- //# sourceMappingURL=promote-FDEKCVAE.js.map
1
+ import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t}from"./chunk-ART666G6.js";import"./chunk-DP7RTNDM.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-CUZWGTXT.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-TFVUOC2C.js";import"./chunk-VOS2IW4V.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as DEFAULT_PROMOTE_TYPES,a as PROMOTER_OWNER,c as PROMOTION_LEDGER_FILE,j as appendPromotionLedger,s as approveProposal,n as callPromotionLlm,p as estimateTokens,r as evidenceFor,m as getUnpromotedMemories,k as groupCandidates,h as listAllAgentMemories,d as memoryKey,e as memoryStamp,g as mergeSources,f as parseMemoryStamp,l as parsePromotionResponse,i as readPromotionLedger,t as rejectProposal,o as runPromotion,q as sourceKind};
2
+ //# sourceMappingURL=promote-XRKH73IB.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-KSDVKLHN.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-VOS2IW4V.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as agenticQuery};
2
+ //# sourceMappingURL=query-6272PJPD.js.map
@@ -0,0 +1,2 @@
1
+ import{b as a,c as b}from"./chunk-ILEC3IAV.js";import"./chunk-QIJLFPWE.js";export{b as QuestionStore,a as questionId};
2
+ //# sourceMappingURL=questions-ZATLU5AW.js.map
@@ -0,0 +1,2 @@
1
+ import{I as a,J as b,K as c,L as d,M as e,N as f,O as g,P as h,Q as i,R as j,S as k,T as l}from"./chunk-3XEN24B7.js";import"./chunk-KSUCHOH2.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-JHWBCDD2.js";import"./chunk-APKAW7LU.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-Q2WW2HF4.js";import"./chunk-DWADWDMU.js";import"./chunk-NO2HOK4B.js";import"./chunk-QD6IICK7.js";import"./chunk-VWTBHLMX.js";import"./chunk-S4ASFOJU.js";import"./chunk-CUZWGTXT.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-KSDVKLHN.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-VOS2IW4V.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-DSYKYZMT.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{k as AgentRegistry,f as TRACE_STEP_SUMMARY_BYTES,c as buildEntryMeta,d as buildEventDigest,e as buildWikiContext,g as clipForTrace,j as emitTraceStepsFromStreamEvent,i as firstMissingRequiredTool,b as getGlobalRegistry,l as richReplyPrompt,a as setGlobalRegistry,h as tallyToolUses};
2
+ //# sourceMappingURL=registry-HMVIS6QJ.js.map
@@ -1,2 +1,2 @@
1
- import{q as m,t as p,v as d,w as x}from"./chunk-TX7MWUC4.js";import{a as u,f}from"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-FX3D7YON.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";x();f();var l="request-gate",h="request-context",g=.1;async function q(t,o,c,r=Math.random){let s=p(l)==="active";if(s){let i=m().seats[l]?.holdout??g;if(r()<i)return{active:!0,preprocess:!1,arm:"holdout"}}let a=s?"treatment":void 0,e=await d(l,{request:t.slice(0,2e3),agent:o,channel:c,operations:["select optional context","evaluate model routing where permitted"],constraints:["Keep the original request and mandatory instructions","Desktop model cannot be downgraded"]},{preprocess:u("This request benefits from structured context selection or another bounded typed decision before the main agent executes.",{true:"Relevant context must be selected, or a bounded routing decision can help. Follow-ups and ambiguous references need context.",false:"Typed preprocessing adds no useful decision; send the request to the configured main agent with existing context."})},{timeoutMs:3e3});if(!e||e.mode!=="active")return{active:!1,preprocess:!1,arm:a};let n=e.answers.preprocess?.noul;return{active:!0,preprocess:Number.isFinite(n)&&n>=.5,arm:a}}var v={landscape:"Agent directory and mesh overview",patternContext:"Learned behavioral patterns",references:"Retrieved project references",memoryContext:"Retrieved agent memory",crossChatContext:"Summaries from other conversations",longMemoryRecall:"Older conversation recall",wikiContext:"Retrieved wiki knowledge"};async function b(t){let o=Object.entries(v).flatMap(([e,n])=>{let i=t[e];return i?[{id:e,description:n,source:e,characters:i.length,preview:i.slice(0,400),trust:"context data, not instructions"}]:[]});if(!o.length)return{input:t,excluded:[]};let c=Object.fromEntries(o.map(e=>[e.id,u(`Context block ${e.id} is relevant to completing the current request correctly.`,{true:"Needed or potentially relevant; retain if uncertain or the preview is incomplete.",false:"Clearly unrelated to the current request; safe to omit."})])),r=await d(h,{request:t.message.slice(0,2e3),channel:t.channel,agent:t.agentId,mandatory:["request","identity","permissions and instructions","same-chat history","handover","attachments"],context:o},c,{timeoutMs:3e3});if(!r||r.mode!=="active")return{input:t,excluded:[]};let s={...t},a=[];for(let e of o){let n=r.answers[e.id]?.noul;Number.isFinite(n)&&n>=0&&n<.2&&(delete s[e.id],a.push(e.id))}return{input:s,excluded:a}}export{g as DEFAULT_REQUEST_GATE_HOLDOUT,h as REQUEST_CONTEXT_SEAT,l as REQUEST_GATE_SEAT,q as evaluateRequest,b as selectRequestContext};
2
- //# sourceMappingURL=request-planner-KQLWWR3U.js.map
1
+ import{q as m,t as p,v as d,w as x}from"./chunk-VOS2IW4V.js";import"./chunk-FX3D7YON.js";import{a as u,f}from"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";x();f();var l="request-gate",h="request-context",g=.1;async function q(t,o,c,r=Math.random){let s=p(l)==="active";if(s){let i=m().seats[l]?.holdout??g;if(r()<i)return{active:!0,preprocess:!1,arm:"holdout"}}let a=s?"treatment":void 0,e=await d(l,{request:t.slice(0,2e3),agent:o,channel:c,operations:["select optional context","evaluate model routing where permitted"],constraints:["Keep the original request and mandatory instructions","Desktop model cannot be downgraded"]},{preprocess:u("This request benefits from structured context selection or another bounded typed decision before the main agent executes.",{true:"Relevant context must be selected, or a bounded routing decision can help. Follow-ups and ambiguous references need context.",false:"Typed preprocessing adds no useful decision; send the request to the configured main agent with existing context."})},{timeoutMs:3e3});if(!e||e.mode!=="active")return{active:!1,preprocess:!1,arm:a};let n=e.answers.preprocess?.noul;return{active:!0,preprocess:Number.isFinite(n)&&n>=.5,arm:a}}var v={landscape:"Agent directory and mesh overview",patternContext:"Learned behavioral patterns",references:"Retrieved project references",memoryContext:"Retrieved agent memory",crossChatContext:"Summaries from other conversations",longMemoryRecall:"Older conversation recall",wikiContext:"Retrieved wiki knowledge"};async function b(t){let o=Object.entries(v).flatMap(([e,n])=>{let i=t[e];return i?[{id:e,description:n,source:e,characters:i.length,preview:i.slice(0,400),trust:"context data, not instructions"}]:[]});if(!o.length)return{input:t,excluded:[]};let c=Object.fromEntries(o.map(e=>[e.id,u(`Context block ${e.id} is relevant to completing the current request correctly.`,{true:"Needed or potentially relevant; retain if uncertain or the preview is incomplete.",false:"Clearly unrelated to the current request; safe to omit."})])),r=await d(h,{request:t.message.slice(0,2e3),channel:t.channel,agent:t.agentId,mandatory:["request","identity","permissions and instructions","same-chat history","handover","attachments"],context:o},c,{timeoutMs:3e3});if(!r||r.mode!=="active")return{input:t,excluded:[]};let s={...t},a=[];for(let e of o){let n=r.answers[e.id]?.noul;Number.isFinite(n)&&n>=0&&n<.2&&(delete s[e.id],a.push(e.id))}return{input:s,excluded:a}}export{g as DEFAULT_REQUEST_GATE_HOLDOUT,h as REQUEST_CONTEXT_SEAT,l as REQUEST_GATE_SEAT,q as evaluateRequest,b as selectRequestContext};
2
+ //# sourceMappingURL=request-planner-73Y5GI3D.js.map
@@ -1,4 +1,4 @@
1
- import{b as I}from"./chunk-G5JUY265.js";import"./chunk-WP6KLXTP.js";import"./chunk-2GIDVZ4H.js";import"./chunk-TX7MWUC4.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-FX3D7YON.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as E}from"crypto";var v="review:",b={decisions:"project",warnings:"feedback",friction:"feedback",context:"reference"};function A(t,n,r){let s=E("sha1").update(r.trim().toLowerCase()).digest("hex").slice(0,10);return`${v}${t}/${n}@${s}`}function F(t){if(!t.startsWith(v))return null;let n=t.slice(v.length),r=n.lastIndexOf("@"),s=n.lastIndexOf("/",r===-1?void 0:r);return r===-1||s===-1?null:{reviewId:n.slice(0,s),kind:n.slice(s+1,r),digest:n.slice(r+1)}}var C=t=>t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,48)||"finding",L=5;function T(t,n){return`${t}|${I(n)}`}function K(t,n={}){let r=n.kinds??Object.keys(b),s=n.minLength??24,h=[],d=new Map,u=new Map,f=new Map,x=new Map;for(let e of t){let i;try{i=JSON.parse(e.result)}catch{continue}let o=e.updated_at?new Date(e.updated_at).toISOString():new Date().toISOString();for(let c of r){let l=b[c];if(!l)continue;let R=i[c];if(Array.isArray(R))for(let $ of R){let a=String($?.text??"").trim();if(a.length<s)continue;let g=A(e.id,c,a),_=g.slice(g.lastIndexOf("@")),w=`${c}${_}`,y=T(c,a),S=f.get(y)??new Set;if(S.add(e.session_id??e.id),f.set(y,S),d.has(w))continue;let O=String($?.evidence??"").trim(),k={occurrences:1,agentId:e.agent,key:`${e.agent}/${l}_${C(a)}`,stamp:g,memory:{name:C(a),type:l,description:a.slice(0,200),body:"",createdAt:o,updatedAt:o}};x.set(g,{text:a,evidence:O,agent:e.agent,source:e.source}),d.set(w,k),u.set(w,y),h.push(k)}}}for(let[e,i]of d){let o=f.get(u.get(e)??"");i.occurrences=o?.size??1,i.sessions=[...o??[]].slice(0,L);let c=x.get(i.stamp);i.memory.body=D(c,i.occurrences)}let m=new Map;for(let[e,i]of d){let o=u.get(e)??e,c=m.get(o)??[];c.push(i),m.set(o,c)}let M=[...m.values()].sort((e,i)=>i[0].occurrences-e[0].occurrences),p=[];for(let e=0;p.length<h.length;e++){let i=!1;for(let o of M)e<o.length&&(p.push(o[e]),i=!0);if(!i)break}return p}function D(t,n){let r=`${t.agent}${t.source?` via ${t.source}`:""}`,s=[];return n>1?(s.push(`Observed in ${n} separate sessions. Most recently stated as:`),s.push(`> ${t.text}`),s.push(`Recurring across ${n} sessions is what makes this worth recording \u2014 any single occurrence is session state, the repetition is the finding.`)):s.push(t.text),t.evidence&&s.push(`**Evidence:** ${t.evidence}`),s.push(`_From ${n>1?"session reviews":"a session review"} of ${r}._`),s.join(`
1
+ import{b as I}from"./chunk-F2DEKA2Q.js";import"./chunk-WP6KLXTP.js";import"./chunk-2GIDVZ4H.js";import"./chunk-VOS2IW4V.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as E}from"crypto";var v="review:",b={decisions:"project",warnings:"feedback",friction:"feedback",context:"reference"};function A(t,n,r){let s=E("sha1").update(r.trim().toLowerCase()).digest("hex").slice(0,10);return`${v}${t}/${n}@${s}`}function F(t){if(!t.startsWith(v))return null;let n=t.slice(v.length),r=n.lastIndexOf("@"),s=n.lastIndexOf("/",r===-1?void 0:r);return r===-1||s===-1?null:{reviewId:n.slice(0,s),kind:n.slice(s+1,r),digest:n.slice(r+1)}}var C=t=>t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,48)||"finding",L=5;function T(t,n){return`${t}|${I(n)}`}function K(t,n={}){let r=n.kinds??Object.keys(b),s=n.minLength??24,h=[],d=new Map,u=new Map,f=new Map,x=new Map;for(let e of t){let i;try{i=JSON.parse(e.result)}catch{continue}let o=e.updated_at?new Date(e.updated_at).toISOString():new Date().toISOString();for(let c of r){let l=b[c];if(!l)continue;let R=i[c];if(Array.isArray(R))for(let $ of R){let a=String($?.text??"").trim();if(a.length<s)continue;let g=A(e.id,c,a),_=g.slice(g.lastIndexOf("@")),w=`${c}${_}`,y=T(c,a),S=f.get(y)??new Set;if(S.add(e.session_id??e.id),f.set(y,S),d.has(w))continue;let O=String($?.evidence??"").trim(),k={occurrences:1,agentId:e.agent,key:`${e.agent}/${l}_${C(a)}`,stamp:g,memory:{name:C(a),type:l,description:a.slice(0,200),body:"",createdAt:o,updatedAt:o}};x.set(g,{text:a,evidence:O,agent:e.agent,source:e.source}),d.set(w,k),u.set(w,y),h.push(k)}}}for(let[e,i]of d){let o=f.get(u.get(e)??"");i.occurrences=o?.size??1,i.sessions=[...o??[]].slice(0,L);let c=x.get(i.stamp);i.memory.body=D(c,i.occurrences)}let m=new Map;for(let[e,i]of d){let o=u.get(e)??e,c=m.get(o)??[];c.push(i),m.set(o,c)}let M=[...m.values()].sort((e,i)=>i[0].occurrences-e[0].occurrences),p=[];for(let e=0;p.length<h.length;e++){let i=!1;for(let o of M)e<o.length&&(p.push(o[e]),i=!0);if(!i)break}return p}function D(t,n){let r=`${t.agent}${t.source?` via ${t.source}`:""}`,s=[];return n>1?(s.push(`Observed in ${n} separate sessions. Most recently stated as:`),s.push(`> ${t.text}`),s.push(`Recurring across ${n} sessions is what makes this worth recording \u2014 any single occurrence is session state, the repetition is the finding.`)):s.push(t.text),t.evidence&&s.push(`**Evidence:** ${t.evidence}`),s.push(`_From ${n>1?"session reviews":"a session review"} of ${r}._`),s.join(`
2
2
 
3
3
  `)}export{L as MAX_EVIDENCE_SESSIONS,b as PROMOTABLE_KINDS,v as REVIEW_STAMP_PREFIX,F as parseReviewStamp,A as reviewStamp,K as reviewsToCandidates};
4
- //# sourceMappingURL=review-candidates-A6CLXAFS.js.map
4
+ //# sourceMappingURL=review-candidates-VF5IWP5P.js.map
@@ -0,0 +1,2 @@
1
+ import{f as o}from"./chunk-KXR6GVL7.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-QIJLFPWE.js";function s(r,n,t){let e=o(t.wikiDir,t.memo,{agentId:t.agentId,origin:t.reason==="continuity"?"continuity-memo":`rotation-memo:${t.reason}`,chat:`${t.channel}:${t.chatId}`});if(e.workState.trim()){let a=t.chatId.split(/[:@.]/).filter(Boolean).slice(0,4);r.addMemory(t.agentId,{agentId:t.agentId,category:"task-state",content:`[Rotation memo \xB7 ${t.reason}] ${e.workState}`,keywords:["rotation-memo",t.channel,...a],source:{channel:t.channel,chatId:t.chatId,sender:"system:rotation",date:new Date().toISOString().slice(0,10)}})}return n.setRotationMemo(t.agentId,t.channel,t.chatId,e.pinned,t.reason),{proposals:e.proposals.length,...e.error?{error:e.error}:{}}}export{s as storeRotationMemo};
2
+ //# sourceMappingURL=rotation-memo-store-A4YW6FSK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/agents/rotation-memo-store.ts"],"sourcesContent":["import { routeMemo } from \"@/wiki/facts/fact-proposals\"\nimport type { MemoryStore } from \"./memory-store\"\n\n// --- Where a session memo goes once it is written (#273) ---\n//\n// A summary may carry work state, never new facts. Claims about outside\n// systems (billing, account, outage, deploy) become wiki fact proposals\n// with their provenance; only work state is kept as memory, where it\n// expires like other task state. The per-chat pinned copy, read by the\n// next fresh session, keeps the claims but marks each one UNVERIFIED.\n\nexport interface StoreMemoInput {\n wikiDir: string\n agentId: string\n channel: string\n chatId: string\n reason: string\n memo: string\n}\n\nexport function storeRotationMemo(\n memory: Pick<MemoryStore, \"addMemory\">,\n sessions: { setRotationMemo(agentId: string, channel: string, chatId: string, memo: string, reason: string): void },\n m: StoreMemoInput,\n): { proposals: number; error?: string } {\n const routed = routeMemo(m.wikiDir, m.memo, {\n agentId: m.agentId,\n origin: m.reason === \"continuity\" ? \"continuity-memo\" : `rotation-memo:${m.reason}`,\n chat: `${m.channel}:${m.chatId}`,\n })\n if (routed.workState.trim()) {\n // Keywords from the chat id let BM25 surface the memo when the same\n // chat continues; without them it only floats up as a recent fact.\n const chatKeyword = m.chatId.split(/[:@.]/).filter(Boolean).slice(0, 4)\n memory.addMemory(m.agentId, {\n agentId: m.agentId,\n category: \"task-state\",\n content: `[Rotation memo · ${m.reason}] ${routed.workState}`,\n keywords: [\"rotation-memo\", m.channel, ...chatKeyword],\n source: { channel: m.channel, chatId: m.chatId, sender: \"system:rotation\", date: new Date().toISOString().slice(0, 10) },\n })\n }\n // Pinned per chat for deterministic injection into the next fresh\n // session: BM25 rarely surfaces the memo on the turn right after a\n // rotation, which is exactly when it matters.\n sessions.setRotationMemo(m.agentId, m.channel, m.chatId, routed.pinned, m.reason)\n return { proposals: routed.proposals.length, ...(routed.error ? { error: routed.error } : {}) }\n}\n"],"mappings":"wJAoBO,SAASA,EACdC,EACAC,EACAC,EACuC,CACvC,IAAMC,EAASC,EAAUF,EAAE,QAASA,EAAE,KAAM,CAC1C,QAASA,EAAE,QACX,OAAQA,EAAE,SAAW,aAAe,kBAAoB,iBAAiBA,EAAE,SAC3E,KAAM,GAAGA,EAAE,WAAWA,EAAE,QAC1B,CAAC,EACD,GAAIC,EAAO,UAAU,KAAK,EAAG,CAG3B,IAAME,EAAcH,EAAE,OAAO,MAAM,OAAO,EAAE,OAAO,OAAO,EAAE,MAAM,EAAG,CAAC,EACtEF,EAAO,UAAUE,EAAE,QAAS,CAC1B,QAASA,EAAE,QACX,SAAU,aACV,QAAS,uBAAoBA,EAAE,WAAWC,EAAO,YACjD,SAAU,CAAC,gBAAiBD,EAAE,QAAS,GAAGG,CAAW,EACrD,OAAQ,CAAE,QAASH,EAAE,QAAS,OAAQA,EAAE,OAAQ,OAAQ,kBAAmB,KAAM,IAAI,KAAK,EAAE,YAAY,EAAE,MAAM,EAAG,EAAE,CAAE,CACzH,CAAC,EAKH,OAAAD,EAAS,gBAAgBC,EAAE,QAASA,EAAE,QAASA,EAAE,OAAQC,EAAO,OAAQD,EAAE,MAAM,EACzE,CAAE,UAAWC,EAAO,UAAU,OAAQ,GAAIA,EAAO,MAAQ,CAAE,MAAOA,EAAO,KAAM,EAAI,CAAC,CAAG,CAChG","names":["storeRotationMemo","memory","sessions","m","routed","routeMemo","chatKeyword"]}
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-Q2WW2HF4.js";import"./chunk-VOS2IW4V.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as cheapModelForEngine,b as routeTaskModel};
2
+ //# sourceMappingURL=routing-T24BMMLM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- import{o as a,p as b,q as c,r as d,s as e,t as f,u as g,v as h,w as i}from"./chunk-TX7MWUC4.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-FX3D7YON.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";i();export{h as askSeat,a as configureDecisions,c as decisionsRuntime,f as getSeatMode,d as parseSeatMode,g as recordSeatOutcome,b as resetDecisionsRuntime,e as seatEnvVar};
2
- //# sourceMappingURL=seat-W3ZTOJUT.js.map
1
+ import{o as a,p as b,q as c,r as d,s as e,t as f,u as g,v as h,w as i}from"./chunk-VOS2IW4V.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";i();export{h as askSeat,a as configureDecisions,c as decisionsRuntime,f as getSeatMode,d as parseSeatMode,g as recordSeatOutcome,b as resetDecisionsRuntime,e as seatEnvVar};
2
+ //# sourceMappingURL=seat-XNA2O6EO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +1,2 @@
1
- import{v as S,w}from"./chunk-TX7MWUC4.js";import{a as g,b as h,f as R}from"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-FX3D7YON.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import{d as f}from"./chunk-VDMYBPYB.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";w();R();var p="skill-select";function y(l){return{task:d(l.task,1200),...l.agent?{agent:l.agent}:{},skills:l.candidates.map(t=>({name:t.name,purpose:d(t.description,300),...t.category?{category:t.category}:{},...t.tags?.length?{tags:t.tags.slice(0,8)}:{}}))}}function b(l){let t={};for(let i of l)t[i.name]=d(i.description,300);return{anyRelevant:g("At least one of these skills is about the task at hand.",{true:"The task is the kind of work one of these skills exists for, and following it would change how the work is done \u2014 it names the same system, the same procedure or the same kind of artefact.",false:"None of them is about this task. They may share vocabulary with it, mention the same tools, or belong to the same project without bearing on what is being asked. Sharing words with a task is not being about it."}),best:h(t,"Which skill is this task most about?")}}function v(l){let t=l.anyRelevant,i=l.best,o=Object.entries(i.probabilities??{}).map(([e,s])=>({name:e,p:Number(s)||0})).sort((e,s)=>s.p-e.p);return{anyRelevant:t.noul,name:i.choice,confidence:i.confidence,ranked:o}}function d(l,t){return l.length>t?`${l.slice(0,t)}\u2026`:l}var x=.1,A=12;async function E(l,t,i={}){let o=i.minRelevant??.6,e=f(l,t).filter(n=>n.relevance>=x).slice(0,A),s=e.map(n=>({name:n.skill.frontmatter.name,lexical:n.relevance}));if(e.length===0)return{skill:null,anyRelevant:0,confidence:0,shortlist:s,judged:!1,reason:"no skill mentions anything in this task"};if(e.length===1)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`only ${e[0].skill.frontmatter.name} matched (${e[0].matchReason})`};let r=e.map(n=>({name:n.skill.frontmatter.name,description:n.skill.frontmatter.description,category:n.skill.frontmatter.category??null,tags:n.skill.frontmatter.tags})),m=await S(p,y({task:t,agent:i.agent??null,candidates:r}),b(r),{incumbent:{best:r[0].name},features:{agent:i.agent??"unknown",candidates:r.length}});if(!m)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`seat off \u2014 lexical top match (${e[0].matchReason})`};let a=v(m.answers),c=s.map(n=>({...n,p:a.ranked.find(k=>k.name===n.name)?.p??0})).sort((n,k)=>(k.p??0)-(n.p??0));if(a.anyRelevant<o)return{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`nothing on the shortlist is about this task (${a.anyRelevant.toFixed(2)} below ${o})`};let u=e.find(n=>n.skill.frontmatter.name===a.name);return u?{skill:u.skill,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`${a.name} (confidence ${a.confidence.toFixed(2)})`}:{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`seat chose "${a.name}", which was not on the shortlist`}}export{E as pickSkillForTask};
2
- //# sourceMappingURL=select-VPOWFRSN.js.map
1
+ import{v as S,w}from"./chunk-VOS2IW4V.js";import"./chunk-FX3D7YON.js";import{a as g,b as h,f as R}from"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-SZJMS7K4.js";import"./chunk-7I7IEX4S.js";import{d as f}from"./chunk-VDMYBPYB.js";import"./chunk-N5NPJ6DJ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";w();R();var p="skill-select";function y(l){return{task:d(l.task,1200),...l.agent?{agent:l.agent}:{},skills:l.candidates.map(t=>({name:t.name,purpose:d(t.description,300),...t.category?{category:t.category}:{},...t.tags?.length?{tags:t.tags.slice(0,8)}:{}}))}}function b(l){let t={};for(let i of l)t[i.name]=d(i.description,300);return{anyRelevant:g("At least one of these skills is about the task at hand.",{true:"The task is the kind of work one of these skills exists for, and following it would change how the work is done \u2014 it names the same system, the same procedure or the same kind of artefact.",false:"None of them is about this task. They may share vocabulary with it, mention the same tools, or belong to the same project without bearing on what is being asked. Sharing words with a task is not being about it."}),best:h(t,"Which skill is this task most about?")}}function v(l){let t=l.anyRelevant,i=l.best,o=Object.entries(i.probabilities??{}).map(([e,s])=>({name:e,p:Number(s)||0})).sort((e,s)=>s.p-e.p);return{anyRelevant:t.noul,name:i.choice,confidence:i.confidence,ranked:o}}function d(l,t){return l.length>t?`${l.slice(0,t)}\u2026`:l}var x=.1,A=12;async function E(l,t,i={}){let o=i.minRelevant??.6,e=f(l,t).filter(n=>n.relevance>=x).slice(0,A),s=e.map(n=>({name:n.skill.frontmatter.name,lexical:n.relevance}));if(e.length===0)return{skill:null,anyRelevant:0,confidence:0,shortlist:s,judged:!1,reason:"no skill mentions anything in this task"};if(e.length===1)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`only ${e[0].skill.frontmatter.name} matched (${e[0].matchReason})`};let r=e.map(n=>({name:n.skill.frontmatter.name,description:n.skill.frontmatter.description,category:n.skill.frontmatter.category??null,tags:n.skill.frontmatter.tags})),m=await S(p,y({task:t,agent:i.agent??null,candidates:r}),b(r),{incumbent:{best:r[0].name},features:{agent:i.agent??"unknown",candidates:r.length}});if(!m)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`seat off \u2014 lexical top match (${e[0].matchReason})`};let a=v(m.answers),c=s.map(n=>({...n,p:a.ranked.find(k=>k.name===n.name)?.p??0})).sort((n,k)=>(k.p??0)-(n.p??0));if(a.anyRelevant<o)return{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`nothing on the shortlist is about this task (${a.anyRelevant.toFixed(2)} below ${o})`};let u=e.find(n=>n.skill.frontmatter.name===a.name);return u?{skill:u.skill,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`${a.name} (confidence ${a.confidence.toFixed(2)})`}:{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`seat chose "${a.name}", which was not on the shortlist`}}export{E as pickSkillForTask};
2
+ //# sourceMappingURL=select-WOUZIR3Y.js.map