agentix-cli 0.29.0 → 0.31.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.
Files changed (123) hide show
  1. package/dist/{App-IEQXWJ7B.js → App-6TP7YMQ3.js} +2 -2
  2. package/dist/{ChatApp-NWOSAP5U.js → ChatApp-G2MQUBR3.js} +2 -2
  3. package/dist/{agent-LS4CZPJ6.js → agent-A5G4DGVU.js} +2 -2
  4. package/dist/{board-dashboard-6QQCKFB3.js → board-dashboard-BU6QJK6X.js} +192 -171
  5. package/dist/board-dashboard-BU6QJK6X.js.map +1 -0
  6. package/dist/{chunk-DI7FMCDK.js → chunk-2J3NV6RZ.js} +2 -2
  7. package/dist/{chunk-UCQ2N3KO.js → chunk-2TJ5L7CB.js} +2 -2
  8. package/dist/{chunk-FKBGJYWQ.js → chunk-3RHPZXCR.js} +2 -2
  9. package/dist/{chunk-SBCZLZG3.js → chunk-6DD4DA2L.js} +2 -2
  10. package/dist/{chunk-52ZPELD2.js → chunk-7CVJ4JOE.js} +2 -2
  11. package/dist/{chunk-Z2Y24ETP.js → chunk-7JWYLSFF.js} +2 -2
  12. package/dist/{chunk-OTXDKKEU.js → chunk-7MNXKITO.js} +134 -122
  13. package/dist/chunk-7MNXKITO.js.map +1 -0
  14. package/dist/chunk-COOJI5SR.js +170 -0
  15. package/dist/chunk-COOJI5SR.js.map +1 -0
  16. package/dist/{chunk-JKYMXLYL.js → chunk-DLOYTMYZ.js} +2 -2
  17. package/dist/chunk-DWADWDMU.js +96 -0
  18. package/dist/chunk-DWADWDMU.js.map +1 -0
  19. package/dist/{chunk-SC5DIKBB.js → chunk-FFDXDUVQ.js} +2 -2
  20. package/dist/{chunk-F5AEXRPR.js → chunk-JC6ZHSTY.js} +2 -2
  21. package/dist/{chunk-F5AEXRPR.js.map → chunk-JC6ZHSTY.js.map} +1 -1
  22. package/dist/{chunk-UYSNGBDT.js → chunk-JJIYFBDH.js} +2 -2
  23. package/dist/{chunk-3QVOWDHZ.js → chunk-JV52UMCI.js} +2 -2
  24. package/dist/{chunk-6F2IKJ2F.js → chunk-NZ346QCV.js} +2 -2
  25. package/dist/{chunk-M4AMWP3H.js → chunk-QLTM3F7M.js} +17 -8
  26. package/dist/{chunk-M4AMWP3H.js.map → chunk-QLTM3F7M.js.map} +1 -1
  27. package/dist/{chunk-4KXBUORV.js → chunk-R7WLFEW3.js} +2 -2
  28. package/dist/{chunk-AE2LDMZU.js → chunk-UOGDSRG3.js} +2 -2
  29. package/dist/chunk-UOGDSRG3.js.map +1 -0
  30. package/dist/{chunk-IWMW5432.js → chunk-V7FYSZSV.js} +1 -1
  31. package/dist/{chunk-IWMW5432.js.map → chunk-V7FYSZSV.js.map} +1 -1
  32. package/dist/chunk-VMDA2SX2.js +43 -0
  33. package/dist/chunk-VMDA2SX2.js.map +1 -0
  34. package/dist/{chunk-JIOLJIBM.js → chunk-W6HKWISZ.js} +2 -2
  35. package/dist/{chunk-GMNKJXTR.js → chunk-Z3RKXKE2.js} +2 -2
  36. package/dist/{chunk-GMNKJXTR.js.map → chunk-Z3RKXKE2.js.map} +1 -1
  37. package/dist/{chunk-LNWX4MPX.js → chunk-ZZQMR526.js} +130 -129
  38. package/dist/chunk-ZZQMR526.js.map +1 -0
  39. package/dist/cli.js +1 -1
  40. package/dist/cli.js.map +1 -1
  41. package/dist/client-QALLJG62.js +2 -0
  42. package/dist/config-TNNODULV.js +2 -0
  43. package/dist/config-mutator-RI77M5YT.js +2 -0
  44. package/dist/doctor-DW27MR2T.js +2 -0
  45. package/dist/index.d.ts +178 -155
  46. package/dist/index.js +1 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/processes-I3XAPHG7.js +2 -0
  49. package/dist/program-WZ3GEOXO.js +2 -0
  50. package/dist/query-7X6VO5VU.js +2 -0
  51. package/dist/registry-LUMYXZ6F.js +2 -0
  52. package/dist/request-planner-RNQB4L6F.js +2 -0
  53. package/dist/request-planner-RNQB4L6F.js.map +1 -0
  54. package/dist/{review-candidates-F3OFYTCZ.js → review-candidates-ZX4JBWQL.js} +2 -2
  55. package/dist/routing-5VGXQ4VG.js +2 -0
  56. package/dist/scheduler-W5C43ZTE.js +2 -0
  57. package/dist/seat-SXPFROXT.js +2 -0
  58. package/dist/{select-L7C52URW.js → select-GJ47QACY.js} +2 -2
  59. package/dist/{surface-usage-NS74AXSE.js → surface-usage-UREILT2E.js} +2 -2
  60. package/dist/web/activity-graph.global.js +901 -368
  61. package/dist/web/activity-graph.global.js.map +1 -1
  62. package/dist/wiki-SRH3JKI4.js +2 -0
  63. package/dist/workspace-setup-G6KGWPHY.js +2 -0
  64. package/package.json +1 -1
  65. package/dist/board-dashboard-6QQCKFB3.js.map +0 -1
  66. package/dist/chunk-4BR7D2OU.js +0 -36
  67. package/dist/chunk-4BR7D2OU.js.map +0 -1
  68. package/dist/chunk-67Q4DCPS.js +0 -54
  69. package/dist/chunk-67Q4DCPS.js.map +0 -1
  70. package/dist/chunk-AE2LDMZU.js.map +0 -1
  71. package/dist/chunk-I3SIXTJO.js +0 -44
  72. package/dist/chunk-I3SIXTJO.js.map +0 -1
  73. package/dist/chunk-LNWX4MPX.js.map +0 -1
  74. package/dist/chunk-OTXDKKEU.js.map +0 -1
  75. package/dist/chunk-XPXO5K4L.js +0 -164
  76. package/dist/chunk-XPXO5K4L.js.map +0 -1
  77. package/dist/client-5Z3URGPY.js +0 -2
  78. package/dist/config-ORSGLVRW.js +0 -2
  79. package/dist/config-mutator-JB3S2E7H.js +0 -2
  80. package/dist/doctor-FS2BX6H4.js +0 -2
  81. package/dist/processes-WU23U2OJ.js +0 -2
  82. package/dist/program-I4J63BQ7.js +0 -2
  83. package/dist/query-R7EI3VGX.js +0 -2
  84. package/dist/registry-UJIJBLUR.js +0 -2
  85. package/dist/request-planner-BKT6RZKX.js +0 -2
  86. package/dist/request-planner-BKT6RZKX.js.map +0 -1
  87. package/dist/routing-S5WSFIAD.js +0 -2
  88. package/dist/scheduler-DSAOMV4O.js +0 -2
  89. package/dist/seat-ZVHXNAEN.js +0 -2
  90. package/dist/wiki-5YQI4YKM.js +0 -2
  91. package/dist/workspace-setup-B3F3TUDE.js +0 -2
  92. /package/dist/{App-IEQXWJ7B.js.map → App-6TP7YMQ3.js.map} +0 -0
  93. /package/dist/{ChatApp-NWOSAP5U.js.map → ChatApp-G2MQUBR3.js.map} +0 -0
  94. /package/dist/{agent-LS4CZPJ6.js.map → agent-A5G4DGVU.js.map} +0 -0
  95. /package/dist/{chunk-DI7FMCDK.js.map → chunk-2J3NV6RZ.js.map} +0 -0
  96. /package/dist/{chunk-UCQ2N3KO.js.map → chunk-2TJ5L7CB.js.map} +0 -0
  97. /package/dist/{chunk-FKBGJYWQ.js.map → chunk-3RHPZXCR.js.map} +0 -0
  98. /package/dist/{chunk-SBCZLZG3.js.map → chunk-6DD4DA2L.js.map} +0 -0
  99. /package/dist/{chunk-52ZPELD2.js.map → chunk-7CVJ4JOE.js.map} +0 -0
  100. /package/dist/{chunk-Z2Y24ETP.js.map → chunk-7JWYLSFF.js.map} +0 -0
  101. /package/dist/{chunk-JKYMXLYL.js.map → chunk-DLOYTMYZ.js.map} +0 -0
  102. /package/dist/{chunk-SC5DIKBB.js.map → chunk-FFDXDUVQ.js.map} +0 -0
  103. /package/dist/{chunk-UYSNGBDT.js.map → chunk-JJIYFBDH.js.map} +0 -0
  104. /package/dist/{chunk-3QVOWDHZ.js.map → chunk-JV52UMCI.js.map} +0 -0
  105. /package/dist/{chunk-6F2IKJ2F.js.map → chunk-NZ346QCV.js.map} +0 -0
  106. /package/dist/{chunk-4KXBUORV.js.map → chunk-R7WLFEW3.js.map} +0 -0
  107. /package/dist/{chunk-JIOLJIBM.js.map → chunk-W6HKWISZ.js.map} +0 -0
  108. /package/dist/{client-5Z3URGPY.js.map → client-QALLJG62.js.map} +0 -0
  109. /package/dist/{config-ORSGLVRW.js.map → config-TNNODULV.js.map} +0 -0
  110. /package/dist/{config-mutator-JB3S2E7H.js.map → config-mutator-RI77M5YT.js.map} +0 -0
  111. /package/dist/{doctor-FS2BX6H4.js.map → doctor-DW27MR2T.js.map} +0 -0
  112. /package/dist/{processes-WU23U2OJ.js.map → processes-I3XAPHG7.js.map} +0 -0
  113. /package/dist/{program-I4J63BQ7.js.map → program-WZ3GEOXO.js.map} +0 -0
  114. /package/dist/{query-R7EI3VGX.js.map → query-7X6VO5VU.js.map} +0 -0
  115. /package/dist/{registry-UJIJBLUR.js.map → registry-LUMYXZ6F.js.map} +0 -0
  116. /package/dist/{review-candidates-F3OFYTCZ.js.map → review-candidates-ZX4JBWQL.js.map} +0 -0
  117. /package/dist/{routing-S5WSFIAD.js.map → routing-5VGXQ4VG.js.map} +0 -0
  118. /package/dist/{scheduler-DSAOMV4O.js.map → scheduler-W5C43ZTE.js.map} +0 -0
  119. /package/dist/{seat-ZVHXNAEN.js.map → seat-SXPFROXT.js.map} +0 -0
  120. /package/dist/{select-L7C52URW.js.map → select-GJ47QACY.js.map} +0 -0
  121. /package/dist/{surface-usage-NS74AXSE.js.map → surface-usage-UREILT2E.js.map} +0 -0
  122. /package/dist/{wiki-5YQI4YKM.js.map → wiki-SRH3JKI4.js.map} +0 -0
  123. /package/dist/{workspace-setup-B3F3TUDE.js.map → workspace-setup-G6KGWPHY.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{q as m,t as p,v as d,w as x}from"./chunk-JC6ZHSTY.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import{a as u,f}from"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-Z3RKXKE2.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.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-RNQB4L6F.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/agents/request-planner.ts"],"sourcesContent":["import { askSeat, decisionsRuntime, getSeatMode } from '@/decisions/seat'\nimport { noul } from '@/decisions/questions'\nimport type { NoulAnswer, Questions } from '@/decisions/types'\nimport type { ContextInput } from './context'\n\nexport const REQUEST_GATE_SEAT = 'request-gate'\nexport const REQUEST_CONTEXT_SEAT = 'request-context'\n\n/** Share of turns held out of Jev preprocessing when the gate is active.\n * Overridden by decisions.seats.request-gate.holdout; 0 turns it off. */\nexport const DEFAULT_REQUEST_GATE_HOLDOUT = 0.1\n\n/** Experiment arm for an active gate. \"treatment\" is assigned before the\n * gate is asked, so a failed or skipped gate call stays in treatment —\n * the comparison is intent-to-treat, not \"turns Jev preprocessed\". */\nexport type RequestGateArm = 'treatment' | 'holdout'\n\nexport interface RequestGate {\n active: boolean\n preprocess: boolean\n arm?: RequestGateArm\n}\n\n// This gate decides whether typed preprocessing helps; it never answers the user.\nexport async function evaluateRequest(message: string, agent: string, channel: string, random: () => number = Math.random): Promise<RequestGate> {\n // The holdout is the \"without Jev\" control: no gate call, and the turn\n // proceeds exactly as a gate \"skip\" would — existing context, the agent's\n // own model, no context planner. Drawn before the call so it costs nothing.\n const assigned = getSeatMode(REQUEST_GATE_SEAT) === 'active'\n if (assigned) {\n const rate = decisionsRuntime().seats[REQUEST_GATE_SEAT]?.holdout ?? DEFAULT_REQUEST_GATE_HOLDOUT\n if (random() < rate) return { active: true, preprocess: false, arm: 'holdout' }\n }\n const arm: RequestGateArm | undefined = assigned ? 'treatment' : undefined\n const result = await askSeat(REQUEST_GATE_SEAT, {\n request: message.slice(0, 2000), agent, channel,\n operations: ['select optional context', 'evaluate model routing where permitted'],\n constraints: ['Keep the original request and mandatory instructions', 'Desktop model cannot be downgraded'],\n }, { preprocess: noul('This request benefits from structured context selection or another bounded typed decision before the main agent executes.', {\n true: 'Relevant context must be selected, or a bounded routing decision can help. Follow-ups and ambiguous references need context.',\n false: 'Typed preprocessing adds no useful decision; send the request to the configured main agent with existing context.',\n }) }, { timeoutMs: 3000 })\n if (!result || result.mode !== 'active') return { active: false, preprocess: false, arm }\n const p = (result.answers.preprocess as NoulAnswer)?.noul\n return { active: true, preprocess: Number.isFinite(p) && p >= 0.5, arm }\n}\n\n// Only optional, application-assembled knowledge is selectable. Identity,\n// permissions, runbooks, skills, request, attachments and same-chat continuity\n// stay outside this allowlist. Native CLI history remains owned by the CLI.\nconst OPTIONAL_CONTEXT = {\n landscape: 'Agent directory and mesh overview',\n patternContext: 'Learned behavioral patterns',\n references: 'Retrieved project references',\n memoryContext: 'Retrieved agent memory',\n crossChatContext: 'Summaries from other conversations',\n longMemoryRecall: 'Older conversation recall',\n wikiContext: 'Retrieved wiki knowledge',\n} as const\n\nexport async function selectRequestContext(input: ContextInput): Promise<{ input: ContextInput; excluded: string[] }> {\n const blocks = Object.entries(OPTIONAL_CONTEXT).flatMap(([id, description]) => {\n const content = input[id as keyof typeof OPTIONAL_CONTEXT]\n return content ? [{ id, description, source: id, characters: content.length, preview: content.slice(0, 400), trust: 'context data, not instructions' }] : []\n })\n if (!blocks.length) return { input, excluded: [] }\n const questions: Questions = Object.fromEntries(blocks.map(block => [block.id, noul(\n `Context block ${block.id} is relevant to completing the current request correctly.`,\n { true: 'Needed or potentially relevant; retain if uncertain or the preview is incomplete.', false: 'Clearly unrelated to the current request; safe to omit.' },\n )]))\n const result = await askSeat(REQUEST_CONTEXT_SEAT, {\n request: input.message.slice(0, 2000), channel: input.channel, agent: input.agentId,\n mandatory: ['request', 'identity', 'permissions and instructions', 'same-chat history', 'handover', 'attachments'],\n context: blocks,\n }, questions, { timeoutMs: 3000 })\n if (!result || result.mode !== 'active') return { input, excluded: [] }\n const selected = { ...input }\n const excluded: string[] = []\n for (const block of blocks) {\n const p = (result.answers[block.id] as NoulAnswer)?.noul\n // Malformed or uncertain answers preserve context, never silently erase it.\n if (Number.isFinite(p) && p >= 0 && p < 0.2) {\n delete selected[block.id as keyof typeof OPTIONAL_CONTEXT]\n excluded.push(block.id)\n }\n }\n return { input: selected, excluded }\n}\n"],"mappings":"2SAAAA,IACAC,IAIO,IAAMC,EAAoB,eACpBC,EAAuB,kBAIvBC,EAA+B,GAc5C,eAAsBC,EAAgBC,EAAiBC,EAAeC,EAAiBC,EAAuB,KAAK,OAA8B,CAI/I,IAAMC,EAAWC,EAAYT,CAAiB,IAAM,SACpD,GAAIQ,EAAU,CACZ,IAAME,EAAOC,EAAiB,EAAE,MAAMX,CAAiB,GAAG,SAAWE,EACrE,GAAIK,EAAO,EAAIG,EAAM,MAAO,CAAE,OAAQ,GAAM,WAAY,GAAO,IAAK,SAAU,EAEhF,IAAME,EAAkCJ,EAAW,YAAc,OAC3DK,EAAS,MAAMC,EAAQd,EAAmB,CAC9C,QAASI,EAAQ,MAAM,EAAG,GAAI,EAAG,MAAAC,EAAO,QAAAC,EACxC,WAAY,CAAC,0BAA2B,wCAAwC,EAChF,YAAa,CAAC,uDAAwD,oCAAoC,CAC5G,EAAG,CAAE,WAAYS,EAAK,4HAA6H,CACjJ,KAAM,+HACN,MAAO,mHACT,CAAC,CAAE,EAAG,CAAE,UAAW,GAAK,CAAC,EACzB,GAAI,CAACF,GAAUA,EAAO,OAAS,SAAU,MAAO,CAAE,OAAQ,GAAO,WAAY,GAAO,IAAAD,CAAI,EACxF,IAAMI,EAAKH,EAAO,QAAQ,YAA2B,KACrD,MAAO,CAAE,OAAQ,GAAM,WAAY,OAAO,SAASG,CAAC,GAAKA,GAAK,GAAK,IAAAJ,CAAI,CACzE,CAKA,IAAMK,EAAmB,CACvB,UAAW,oCACX,eAAgB,8BAChB,WAAY,+BACZ,cAAe,yBACf,iBAAkB,qCAClB,iBAAkB,4BAClB,YAAa,0BACf,EAEA,eAAsBC,EAAqBC,EAA2E,CACpH,IAAMC,EAAS,OAAO,QAAQH,CAAgB,EAAE,QAAQ,CAAC,CAACI,EAAIC,CAAW,IAAM,CAC7E,IAAMC,EAAUJ,EAAME,CAAmC,EACzD,OAAOE,EAAU,CAAC,CAAE,GAAAF,EAAI,YAAAC,EAAa,OAAQD,EAAI,WAAYE,EAAQ,OAAQ,QAASA,EAAQ,MAAM,EAAG,GAAG,EAAG,MAAO,gCAAiC,CAAC,EAAI,CAAC,CAC7J,CAAC,EACD,GAAI,CAACH,EAAO,OAAQ,MAAO,CAAE,MAAAD,EAAO,SAAU,CAAC,CAAE,EACjD,IAAMK,EAAuB,OAAO,YAAYJ,EAAO,IAAIK,GAAS,CAACA,EAAM,GAAIV,EAC7E,iBAAiBU,EAAM,8DACvB,CAAE,KAAM,oFAAqF,MAAO,yDAA0D,CAChK,CAAC,CAAC,CAAC,EACGZ,EAAS,MAAMC,EAAQb,EAAsB,CACjD,QAASkB,EAAM,QAAQ,MAAM,EAAG,GAAI,EAAG,QAASA,EAAM,QAAS,MAAOA,EAAM,QAC5E,UAAW,CAAC,UAAW,WAAY,+BAAgC,oBAAqB,WAAY,aAAa,EACjH,QAASC,CACX,EAAGI,EAAW,CAAE,UAAW,GAAK,CAAC,EACjC,GAAI,CAACX,GAAUA,EAAO,OAAS,SAAU,MAAO,CAAE,MAAAM,EAAO,SAAU,CAAC,CAAE,EACtE,IAAMO,EAAW,CAAE,GAAGP,CAAM,EACtBQ,EAAqB,CAAC,EAC5B,QAAWF,KAASL,EAAQ,CAC1B,IAAMJ,EAAKH,EAAO,QAAQY,EAAM,EAAE,GAAkB,KAEhD,OAAO,SAAST,CAAC,GAAKA,GAAK,GAAKA,EAAI,KACtC,OAAOU,EAASD,EAAM,EAAmC,EACzDE,EAAS,KAAKF,EAAM,EAAE,GAG1B,MAAO,CAAE,MAAOC,EAAU,SAAAC,CAAS,CACrC","names":["init_seat","init_questions","REQUEST_GATE_SEAT","REQUEST_CONTEXT_SEAT","DEFAULT_REQUEST_GATE_HOLDOUT","evaluateRequest","message","agent","channel","random","assigned","getSeatMode","rate","decisionsRuntime","arm","result","askSeat","noul","p","OPTIONAL_CONTEXT","selectRequestContext","input","blocks","id","description","content","questions","block","selected","excluded"]}
@@ -1,4 +1,4 @@
1
- import{b}from"./chunk-3QVOWDHZ.js";import"./chunk-4BR7D2OU.js";import"./chunk-EVWEG3VD.js";import"./chunk-F5AEXRPR.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-GMNKJXTR.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";import{createHash as A}from"crypto";var v="review:",I={decisions:"project",warnings:"feedback",friction:"feedback",context:"reference"};function E(t,n,r){let s=A("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";function L(t,n){return`${t}|${b(n)}`}function K(t,n={}){let r=n.kinds??Object.keys(I),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=I[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=E(e.id,c,a),O=g.slice(g.lastIndexOf("@")),w=`${c}${O}`,y=L(c,a),k=f.get(y)??new Set;if(k.add(e.session_id??e.id),f.set(y,k),d.has(w))continue;let _=String($?.evidence??"").trim(),S={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:_,agent:e.agent,source:e.source}),d.set(w,S),u.set(w,y),h.push(S)}}}for(let[e,i]of d){i.occurrences=f.get(u.get(e)??"")?.size??1;let o=x.get(i.stamp);i.memory.body=T(o,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 T(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}from"./chunk-JV52UMCI.js";import"./chunk-VMDA2SX2.js";import"./chunk-EVWEG3VD.js";import"./chunk-JC6ZHSTY.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-Z3RKXKE2.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";import{createHash as A}from"crypto";var v="review:",I={decisions:"project",warnings:"feedback",friction:"feedback",context:"reference"};function E(t,n,r){let s=A("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";function L(t,n){return`${t}|${b(n)}`}function K(t,n={}){let r=n.kinds??Object.keys(I),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=I[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=E(e.id,c,a),O=g.slice(g.lastIndexOf("@")),w=`${c}${O}`,y=L(c,a),k=f.get(y)??new Set;if(k.add(e.session_id??e.id),f.set(y,k),d.has(w))continue;let _=String($?.evidence??"").trim(),S={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:_,agent:e.agent,source:e.source}),d.set(w,S),u.set(w,y),h.push(S)}}}for(let[e,i]of d){i.occurrences=f.get(u.get(e)??"")?.size??1;let o=x.get(i.stamp);i.memory.body=T(o,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 T(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{I as PROMOTABLE_KINDS,v as REVIEW_STAMP_PREFIX,F as parseReviewStamp,E as reviewStamp,K as reviewsToCandidates};
4
- //# sourceMappingURL=review-candidates-F3OFYTCZ.js.map
4
+ //# sourceMappingURL=review-candidates-ZX4JBWQL.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-UOGDSRG3.js";import"./chunk-JC6ZHSTY.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-Z3RKXKE2.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{a as cheapModelForEngine,b as routeTaskModel};
2
+ //# sourceMappingURL=routing-5VGXQ4VG.js.map
@@ -0,0 +1,2 @@
1
+ import{g as a,h as b}from"./chunk-R7WLFEW3.js";import"./chunk-FFDXDUVQ.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-L2WSPY6S.js";import"./chunk-Z3RKXKE2.js";import"./chunk-FIOB3MEX.js";export{b as CronScheduler,a as getNextCronDate};
2
+ //# sourceMappingURL=scheduler-W5C43ZTE.js.map
@@ -0,0 +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-JC6ZHSTY.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-Z3RKXKE2.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.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-SXPFROXT.js.map
@@ -1,2 +1,2 @@
1
- import{v as S,w}from"./chunk-F5AEXRPR.js";import"./chunk-AJONZWLT.js";import{a as g,b as h,f as R}from"./chunk-F4HZTZHW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import{d as f}from"./chunk-VDMYBPYB.js";import"./chunk-GMNKJXTR.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.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-L7C52URW.js.map
1
+ import{v as S,w}from"./chunk-JC6ZHSTY.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import{a as g,b as h,f as R}from"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import{d as f}from"./chunk-VDMYBPYB.js";import"./chunk-Z3RKXKE2.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.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-GJ47QACY.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d}from"./chunk-UCQ2N3KO.js";import"./chunk-M4AMWP3H.js";import"./chunk-FIOB3MEX.js";export{c as commandPath,b as listSurfaceUse,a as recordSurfaceUse,d as shouldRecordCommand};
2
- //# sourceMappingURL=surface-usage-NS74AXSE.js.map
1
+ import{a,b,c,d}from"./chunk-2TJ5L7CB.js";import"./chunk-QLTM3F7M.js";import"./chunk-FIOB3MEX.js";export{c as commandPath,b as listSurfaceUse,a as recordSurfaceUse,d as shouldRecordCommand};
2
+ //# sourceMappingURL=surface-usage-UREILT2E.js.map