agentix-cli 0.69.4 → 0.70.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.
- package/dist/{App-Z66ABY7H.js → App-LFQTOADB.js} +2 -2
- package/dist/{ChatApp-Z2LZ7IM3.js → ChatApp-RNMG2HWX.js} +2 -2
- package/dist/{agent-IDAWXA3K.js → agent-7IW6472I.js} +2 -2
- package/dist/{board-dashboard-MAP6A2N7.js → board-dashboard-MYWXVYU3.js} +4 -4
- package/dist/{chunk-K63IOY6A.js → chunk-2DWDXT7G.js} +9 -9
- package/dist/chunk-2DWDXT7G.js.map +1 -0
- package/dist/{chunk-P2RYUODK.js → chunk-3ZRFES25.js} +2 -2
- package/dist/{chunk-OHRTBD7U.js → chunk-4HCQEGXO.js} +167 -167
- package/dist/chunk-4HCQEGXO.js.map +1 -0
- package/dist/chunk-4J4YVJFH.js +105 -0
- package/dist/chunk-4J4YVJFH.js.map +1 -0
- package/dist/{chunk-FSYA4GNU.js → chunk-5FD7HE2J.js} +2 -2
- package/dist/{chunk-FUR3T3IN.js → chunk-7334DGUO.js} +2 -2
- package/dist/{chunk-YBF2QVZ7.js → chunk-7PWXCN22.js} +2 -2
- package/dist/{chunk-64P4QHSZ.js → chunk-CECHWYJ2.js} +1 -1
- package/dist/{chunk-64P4QHSZ.js.map → chunk-CECHWYJ2.js.map} +1 -1
- package/dist/{chunk-OVX6NRMD.js → chunk-D3RJMC37.js} +2 -2
- package/dist/chunk-DXAWW7ZQ.js +49 -0
- package/dist/chunk-DXAWW7ZQ.js.map +1 -0
- package/dist/{chunk-CKBAVCGU.js → chunk-E6CYC4HQ.js} +2 -2
- package/dist/{chunk-YL223TEU.js → chunk-FEQ4W4XA.js} +2 -2
- package/dist/{chunk-M6GPRMCQ.js → chunk-KTGPH77J.js} +2 -2
- package/dist/{chunk-KLHG5ZQH.js → chunk-KTNOY4LW.js} +2 -2
- package/dist/{chunk-2UYV24UD.js → chunk-LKA5UUGT.js} +2 -2
- package/dist/{chunk-DQQ3BCJW.js → chunk-MOUSATFW.js} +2 -2
- package/dist/{chunk-5ONI54E6.js → chunk-MTPCD4NV.js} +227 -226
- package/dist/chunk-MTPCD4NV.js.map +1 -0
- package/dist/{chunk-J7HA7ZTU.js → chunk-N4EIYNN4.js} +2 -2
- package/dist/{chunk-BBIWAJRX.js → chunk-O2QVQVOV.js} +2 -2
- package/dist/{chunk-IU6L4V3A.js → chunk-RKZGENSE.js} +2 -2
- package/dist/chunk-RN7G3D53.js +6 -0
- package/dist/chunk-RN7G3D53.js.map +1 -0
- package/dist/chunk-WPNRDEHW.js +2 -0
- package/dist/chunk-WPNRDEHW.js.map +1 -0
- package/dist/{chunk-DTX4I5LQ.js → chunk-XXBW7CFN.js} +2 -2
- package/dist/{chunk-DTX4I5LQ.js.map → chunk-XXBW7CFN.js.map} +1 -1
- package/dist/{chunk-OPUPVGYP.js → chunk-YFROK44Z.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/client-IQIBHXVS.js +2 -0
- package/dist/{config-FZ4D4EAV.js → config-7AK5TI2D.js} +2 -2
- package/dist/config-mutator-EI5JNMY4.js +2 -0
- package/dist/doctor-CTWQODQG.js +2 -0
- package/dist/index.d.ts +63 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{migrate-v2-KOMPDC6U.js → migrate-v2-W7RRFM24.js} +2 -2
- package/dist/program-ZKGWGTPV.js +2 -0
- package/dist/{promote-VZAUTV6E.js → promote-USGFU5NN.js} +2 -2
- package/dist/query-NLSKOIWJ.js +2 -0
- package/dist/registry-T7SCVP55.js +2 -0
- package/dist/{request-planner-NMOAOZIM.js → request-planner-VOWMXWRI.js} +2 -2
- package/dist/{review-candidates-FLY6HZEN.js → review-candidates-F6RLNHS2.js} +2 -2
- package/dist/{routing-SMIZ77CT.js → routing-2LAWEIUG.js} +2 -2
- package/dist/schedule-tool-GOQFT2XQ.js +2 -0
- package/dist/scheduler-GJVRJQ7K.js +2 -0
- package/dist/{seat-F3S2HG5G.js → seat-4LLK2XBM.js} +2 -2
- package/dist/{select-5GC7CTPQ.js → select-NJHTHKEQ.js} +2 -2
- package/dist/{set-enabled-53ZPZ5GR.js → set-enabled-HPR6VJCG.js} +2 -2
- package/dist/{tool-FRTZS4TT.js → tool-XQMGKZP5.js} +2 -2
- package/dist/types-NZOBHQGS.js +2 -0
- package/dist/wiki-RQ5P4WWJ.js +2 -0
- package/package.json +1 -1
- package/dist/chunk-4DRNEOOW.js +0 -2
- package/dist/chunk-4DRNEOOW.js.map +0 -1
- package/dist/chunk-535MLOSB.js +0 -109
- package/dist/chunk-535MLOSB.js.map +0 -1
- package/dist/chunk-5ONI54E6.js.map +0 -1
- package/dist/chunk-K63IOY6A.js.map +0 -1
- package/dist/chunk-OHRTBD7U.js.map +0 -1
- package/dist/chunk-TFVUOC2C.js +0 -2
- package/dist/chunk-TFVUOC2C.js.map +0 -1
- package/dist/chunk-V2TLFYKH.js +0 -45
- package/dist/chunk-V2TLFYKH.js.map +0 -1
- package/dist/client-GDTX6LFH.js +0 -2
- package/dist/config-mutator-ETG5V4C5.js +0 -2
- package/dist/doctor-JBIRBRLB.js +0 -2
- package/dist/program-T275Y2V6.js +0 -2
- package/dist/query-7QQZPMXM.js +0 -2
- package/dist/registry-WQ65MQEY.js +0 -2
- package/dist/schedule-tool-NJFROYKY.js +0 -2
- package/dist/scheduler-5N4FC2FQ.js +0 -2
- package/dist/types-S6NHM5C3.js +0 -2
- package/dist/wiki-J4MMCONT.js +0 -2
- /package/dist/{App-Z66ABY7H.js.map → App-LFQTOADB.js.map} +0 -0
- /package/dist/{ChatApp-Z2LZ7IM3.js.map → ChatApp-RNMG2HWX.js.map} +0 -0
- /package/dist/{agent-IDAWXA3K.js.map → agent-7IW6472I.js.map} +0 -0
- /package/dist/{board-dashboard-MAP6A2N7.js.map → board-dashboard-MYWXVYU3.js.map} +0 -0
- /package/dist/{chunk-P2RYUODK.js.map → chunk-3ZRFES25.js.map} +0 -0
- /package/dist/{chunk-FSYA4GNU.js.map → chunk-5FD7HE2J.js.map} +0 -0
- /package/dist/{chunk-FUR3T3IN.js.map → chunk-7334DGUO.js.map} +0 -0
- /package/dist/{chunk-YBF2QVZ7.js.map → chunk-7PWXCN22.js.map} +0 -0
- /package/dist/{chunk-OVX6NRMD.js.map → chunk-D3RJMC37.js.map} +0 -0
- /package/dist/{chunk-CKBAVCGU.js.map → chunk-E6CYC4HQ.js.map} +0 -0
- /package/dist/{chunk-YL223TEU.js.map → chunk-FEQ4W4XA.js.map} +0 -0
- /package/dist/{chunk-M6GPRMCQ.js.map → chunk-KTGPH77J.js.map} +0 -0
- /package/dist/{chunk-KLHG5ZQH.js.map → chunk-KTNOY4LW.js.map} +0 -0
- /package/dist/{chunk-2UYV24UD.js.map → chunk-LKA5UUGT.js.map} +0 -0
- /package/dist/{chunk-DQQ3BCJW.js.map → chunk-MOUSATFW.js.map} +0 -0
- /package/dist/{chunk-J7HA7ZTU.js.map → chunk-N4EIYNN4.js.map} +0 -0
- /package/dist/{chunk-BBIWAJRX.js.map → chunk-O2QVQVOV.js.map} +0 -0
- /package/dist/{chunk-IU6L4V3A.js.map → chunk-RKZGENSE.js.map} +0 -0
- /package/dist/{chunk-OPUPVGYP.js.map → chunk-YFROK44Z.js.map} +0 -0
- /package/dist/{client-GDTX6LFH.js.map → client-IQIBHXVS.js.map} +0 -0
- /package/dist/{config-FZ4D4EAV.js.map → config-7AK5TI2D.js.map} +0 -0
- /package/dist/{config-mutator-ETG5V4C5.js.map → config-mutator-EI5JNMY4.js.map} +0 -0
- /package/dist/{doctor-JBIRBRLB.js.map → doctor-CTWQODQG.js.map} +0 -0
- /package/dist/{migrate-v2-KOMPDC6U.js.map → migrate-v2-W7RRFM24.js.map} +0 -0
- /package/dist/{program-T275Y2V6.js.map → program-ZKGWGTPV.js.map} +0 -0
- /package/dist/{promote-VZAUTV6E.js.map → promote-USGFU5NN.js.map} +0 -0
- /package/dist/{query-7QQZPMXM.js.map → query-NLSKOIWJ.js.map} +0 -0
- /package/dist/{registry-WQ65MQEY.js.map → registry-T7SCVP55.js.map} +0 -0
- /package/dist/{request-planner-NMOAOZIM.js.map → request-planner-VOWMXWRI.js.map} +0 -0
- /package/dist/{review-candidates-FLY6HZEN.js.map → review-candidates-F6RLNHS2.js.map} +0 -0
- /package/dist/{routing-SMIZ77CT.js.map → routing-2LAWEIUG.js.map} +0 -0
- /package/dist/{schedule-tool-NJFROYKY.js.map → schedule-tool-GOQFT2XQ.js.map} +0 -0
- /package/dist/{scheduler-5N4FC2FQ.js.map → scheduler-GJVRJQ7K.js.map} +0 -0
- /package/dist/{seat-F3S2HG5G.js.map → seat-4LLK2XBM.js.map} +0 -0
- /package/dist/{select-5GC7CTPQ.js.map → select-NJHTHKEQ.js.map} +0 -0
- /package/dist/{set-enabled-53ZPZ5GR.js.map → set-enabled-HPR6VJCG.js.map} +0 -0
- /package/dist/{tool-FRTZS4TT.js.map → tool-XQMGKZP5.js.map} +0 -0
- /package/dist/{types-S6NHM5C3.js.map → types-NZOBHQGS.js.map} +0 -0
- /package/dist/{wiki-J4MMCONT.js.map → wiki-RQ5P4WWJ.js.map} +0 -0
package/dist/chunk-TFVUOC2C.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as c,b as d,f as u}from"./chunk-72SZI2UW.js";u();var f="wiki-rerank",k=30,p=900;function b(t){let r=t.excerptChars??p;return{query:t.query,candidates:t.candidates.map(e=>({id:e.id,title:e.title,tags:e.tags?.length?e.tags.join(", "):null,excerpt:l(e.excerpt,r)}))}}function w(t){let r={};for(let e of t)r[e.id]=e.title;return{best:d(r,"Which candidate answers the query?"),answerable:c("Do any of the candidates answer the query?")}}function x(t,r){let e=t.best,s={};for(let n of r)s[n.id]=e.probabilities[n.id]??0;let o=new Map(r.map((n,a)=>[n.id,a]));return{ranked:[...r.map(n=>n.id)].sort((n,a)=>{let i=s[a]-s[n];return i!==0?i:(o.get(n)??0)-(o.get(a)??0)}),scores:s,answerable:t.answerable.noul,confidence:e.confidence}}function l(t,r){let e=String(t??"").replace(/\s+/g," ").trim();return e.length>r?e.slice(0,r):e}export{f as a,k as b,b as c,w as d,x as e};
|
|
2
|
-
//# sourceMappingURL=chunk-TFVUOC2C.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/decisions/seats/wiki-rerank.ts"],"sourcesContent":["import { choice, noul } from \"../questions\"\nimport type { AnswersFor, ChoiceAnswer, NoulAnswer, StateValue } from \"../types\"\n\n// Re-ranking a BM25 shortlist.\n//\n// Measured on the operator's own wiki (11,656 articles, 12 queries):\n// BM25 alone gets R@1 33.3%, R@3 41.7%. Two thirds of queries do not put\n// the right article first. BM25 is a bag-of-words match, so it does well\n// on \"gitlab token expired\" and badly on \"the bot keeps repeating itself\n// what is wrong\" — the synonym cases score 33% / 33%.\n//\n// Shape follows TypeSafe's semantic_find cookbook rather than their\n// rerank one. Rerank scores each query-candidate pair separately, which\n// is N calls; semantic_find scores 218 line ids against one query with a\n// single Choice, and the per-option probabilities ARE the ranking. One\n// call for the whole shortlist, and the candidates are compared against\n// each other rather than each judged alone — which is what ranking means.\n//\n// The companion Noul is the part that keeps this honest. A Choice must\n// return something: asked which of 30 articles answers a question the\n// wiki has no answer to, it will still name one, with a confident-looking\n// probability. `answerable` is the question that can say no, and code\n// reads it first.\n\nexport const WIKI_RERANK_SEAT = \"wiki-rerank\"\n\n// Measured on the 12-query eval, sweeping candidate count against\n// excerpt length under a fixed state budget:\n//\n// k=120 x 150 chars R@1 25.0% (worse than BM25's 33.3%)\n// k=60 x 300 chars R@1 41.7%\n// k=30 x 600 chars R@1 41.7%\n// k=30 x 900 chars R@1 50.0% <- default\n// k=20 x 1100 chars R@1 50.0%\n//\n// Candidates and excerpt trade against one another, and excerpt wins.\n// More candidates raises the ceiling — what the shortlist could contain —\n// while starving the re-ranker of the text it needs to rank with. At 150\n// characters a candidate is barely more than its title, and the result is\n// worse than no re-ranking at all. Raise k only alongside the state\n// budget, never instead of the excerpt.\nexport const DEFAULT_SHORTLIST = 30\nexport const DEFAULT_EXCERPT_CHARS = 900\n\nexport interface RerankCandidate {\n id: string\n title: string\n tags?: string[]\n excerpt: string\n}\n\nexport interface RerankInput {\n query: string\n candidates: RerankCandidate[]\n /** Per-candidate excerpt budget. See DEFAULT_EXCERPT_CHARS — this is\n * the lever that actually moves accuracy. */\n excerptChars?: number\n}\n\nexport function rerankState(input: RerankInput): StateValue {\n const budget = input.excerptChars ?? DEFAULT_EXCERPT_CHARS\n return {\n query: input.query,\n candidates: input.candidates.map((c) => ({\n id: c.id,\n title: c.title,\n tags: c.tags?.length ? c.tags.join(\", \") : null,\n excerpt: clip(c.excerpt, budget),\n })),\n }\n}\n\n/** Built per call, because the option set IS the candidate set. */\nexport function rerankQuestions(candidates: RerankCandidate[]) {\n const criteria: Record<string, string> = {}\n for (const c of candidates) criteria[c.id] = c.title\n return {\n best: choice(criteria, \"Which candidate answers the query?\"),\n answerable: noul(\"Do any of the candidates answer the query?\"),\n }\n}\n\nexport type RerankAnswers = AnswersFor<ReturnType<typeof rerankQuestions>>\n\nexport interface RerankResult {\n /** Candidate ids, best first, by the Choice's per-option probability. */\n ranked: string[]\n scores: Record<string, number>\n /** P(the shortlist contains an answer at all). */\n answerable: number\n /** The Choice's own confidence — flat means it could not separate them. */\n confidence: number\n}\n\n/**\n * Turn one answer into a ranking.\n *\n * Ties keep the incoming order, so a Choice that genuinely cannot\n * separate the candidates degrades to BM25's ranking rather than to an\n * arbitrary one.\n */\nexport function toRanking(\n answers: RerankAnswers,\n candidates: RerankCandidate[],\n): RerankResult {\n const best = answers.best as ChoiceAnswer\n const scores: Record<string, number> = {}\n for (const c of candidates) scores[c.id] = best.probabilities[c.id] ?? 0\n\n const order = new Map(candidates.map((c, i) => [c.id, i]))\n const ranked = [...candidates.map((c) => c.id)].sort((a, b) => {\n const diff = scores[b] - scores[a]\n return diff !== 0 ? diff : (order.get(a) ?? 0) - (order.get(b) ?? 0)\n })\n\n return {\n ranked,\n scores,\n answerable: (answers.answerable as NoulAnswer).noul,\n confidence: best.confidence,\n }\n}\n\nfunction clip(text: string, max: number): string {\n const flat = String(text ?? \"\").replace(/\\s+/g, \" \").trim()\n return flat.length > max ? flat.slice(0, max) : flat\n}\n"],"mappings":"sDAAAA,IAwBO,IAAMC,EAAmB,cAiBnBC,EAAoB,GACpBC,EAAwB,IAiB9B,SAASC,EAAYC,EAAgC,CAC1D,IAAMC,EAASD,EAAM,cAAgBF,EACrC,MAAO,CACL,MAAOE,EAAM,MACb,WAAYA,EAAM,WAAW,IAAKE,IAAO,CACvC,GAAIA,EAAE,GACN,MAAOA,EAAE,MACT,KAAMA,EAAE,MAAM,OAASA,EAAE,KAAK,KAAK,IAAI,EAAI,KAC3C,QAASC,EAAKD,EAAE,QAASD,CAAM,CACjC,EAAE,CACJ,CACF,CAGO,SAASG,EAAgBC,EAA+B,CAC7D,IAAMC,EAAmC,CAAC,EAC1C,QAAWJ,KAAKG,EAAYC,EAASJ,EAAE,EAAE,EAAIA,EAAE,MAC/C,MAAO,CACL,KAAMK,EAAOD,EAAU,oCAAoC,EAC3D,WAAYE,EAAK,4CAA4C,CAC/D,CACF,CAqBO,SAASC,EACdC,EACAL,EACc,CACd,IAAMM,EAAOD,EAAQ,KACfE,EAAiC,CAAC,EACxC,QAAWV,KAAKG,EAAYO,EAAOV,EAAE,EAAE,EAAIS,EAAK,cAAcT,EAAE,EAAE,GAAK,EAEvE,IAAMW,EAAQ,IAAI,IAAIR,EAAW,IAAI,CAACH,EAAGY,IAAM,CAACZ,EAAE,GAAIY,CAAC,CAAC,CAAC,EAMzD,MAAO,CACL,OANa,CAAC,GAAGT,EAAW,IAAKH,GAAMA,EAAE,EAAE,CAAC,EAAE,KAAK,CAACa,EAAGC,IAAM,CAC7D,IAAMC,EAAOL,EAAOI,CAAC,EAAIJ,EAAOG,CAAC,EACjC,OAAOE,IAAS,EAAIA,GAAQJ,EAAM,IAAIE,CAAC,GAAK,IAAMF,EAAM,IAAIG,CAAC,GAAK,EACpE,CAAC,EAIC,OAAAJ,EACA,WAAaF,EAAQ,WAA0B,KAC/C,WAAYC,EAAK,UACnB,CACF,CAEA,SAASR,EAAKe,EAAcC,EAAqB,CAC/C,IAAMC,EAAO,OAAOF,GAAQ,EAAE,EAAE,QAAQ,OAAQ,GAAG,EAAE,KAAK,EAC1D,OAAOE,EAAK,OAASD,EAAMC,EAAK,MAAM,EAAGD,CAAG,EAAIC,CAClD","names":["init_questions","WIKI_RERANK_SEAT","DEFAULT_SHORTLIST","DEFAULT_EXCERPT_CHARS","rerankState","input","budget","c","clip","rerankQuestions","candidates","criteria","choice","noul","toRanking","answers","best","scores","order","i","a","b","diff","text","max","flat"]}
|
package/dist/chunk-V2TLFYKH.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import{a as R,b as j,c as O,d as W,e as D}from"./chunk-TFVUOC2C.js";import{b as C}from"./chunk-2GIDVZ4H.js";import{v,w as Q}from"./chunk-BBIWAJRX.js";import{b as $,c as M}from"./chunk-QOYAX2FT.js";import{readFileSync as T,existsSync as _}from"fs";Q();import{resolve as b}from"path";import{execSync as Y}from"child_process";async function V(n,i,s,e={}){let d=e.selectorModel??"haiku",a=e.synthModel??"sonnet",c=e.maxCandidates??3,l=e.maxHops??2,r=e.maxArticles??8,p=e.timeoutMs??6e4,u=e.log??console.error.bind(console,"[wiki-query]"),h=b(i.baseDir,"_index.md");if(!_(h))return w("no-catalog",n,"No _index.md found \u2014 run `agentx wiki status` to rebuild.");let k=T(h,"utf-8"),t=Date.now(),g=[],m="";try{let o=await B(n,i,s,c);o?(g=o,m=`[wiki-rerank seat] ${o.map(y=>y.title).join(" | ")}`):(m=await N(I(n,k,c),d,p),g=F(m))}catch(o){return u("selector failed:",o?.message),{...w("error",n,`Selector: ${o?.message||"unknown"}`),trace:{selectorMs:Date.now()-t,synthesisMs:0,selectorOutput:m}}}let A=Date.now()-t;if(g.length===0)return{...w("no-candidates",n,"Selector returned no candidates."),trace:{selectorMs:A,synthesisMs:0,selectorOutput:m}};let f=E(g,i,s,l,r);if(f.length===0)return{...w("no-candidates",n,"Candidates did not resolve to readable articles."),candidates:g,trace:{selectorMs:A,synthesisMs:0,selectorOutput:m}};let S=Date.now(),x="";try{x=await N(L(n,f),a,p*2)}catch(o){return u("synthesis failed:",o?.message),{...w("error",n,`Synthesis: ${o?.message||"unknown"}`),candidates:g,walked:f.map(y=>({title:y.meta.title,path:y.path,type:y.meta.type,hop:y.hop??0})),trace:{selectorMs:A,synthesisMs:Date.now()-S,selectorOutput:m}}}let P=Date.now()-S;return{answer:x.trim(),citations:f.map(o=>({title:o.meta.title,path:o.path,type:o.meta.type})),candidates:g,walked:f.map(o=>({title:o.meta.title,path:o.path,type:o.meta.type,hop:o.hop??0})),status:"ok",trace:{selectorMs:A,synthesisMs:P,selectorOutput:m}}}function w(n,i,s){return{answer:"",citations:[],candidates:[],walked:[],status:n,error:s}}function E(n,i,s,e,d){let a=new Map;for(let r of i.listArticles(s||""))a.set(r.meta.title.toLowerCase(),r.path);let c=new Map,l=[];for(let r of n)c.has(r.path)||l.push({path:r.path,hop:0});for(;l.length&&c.size<d;){let r=l.shift();if(c.has(r.path)||r.hop>e)continue;let p=s?i.readArticleAs(r.path,s):i.readArticle(r.path);if(p&&(c.set(r.path,{...p,hop:r.hop}),!(r.hop>=e)))for(let u of p.meta.related||[]){let h=a.get(u.toLowerCase());h&&!c.has(h)&&l.push({path:h,hop:r.hop+1})}}return Array.from(c.values())}async function B(n,i,s,e){try{let a=(i.rebuildIndex().articles??[]).filter(t=>t.path&&!t.path.includes("/_versions/"));if(a.length<2)return null;let c=a.map(t=>[t.title,(t.tags??[]).join(" "),(t.related??[]).join(" ")].join(" ")),l=M(n,$(c)).map(t=>t.docIndex);for(let t=0;t<a.length;t++)l.includes(t)||l.push(t);let p=l.slice(0,j).map(t=>({id:`k${t}`,title:a[t].title||a[t].path,tags:a[t].tags,excerpt:[a[t].type?`type: ${a[t].type}`:"",(a[t].related??[]).length?`related: ${(a[t].related??[]).join(", ")}`:""].filter(Boolean).join(" \xB7 ")})),u=await v(R,O({query:n,candidates:p,excerptChars:300}),W(p),{features:{agent:s??"unknown",stage:"catalog-selector"}});if(!u||u.mode!=="active")return null;let k=D(u.answers,p).ranked.slice(0,e).map(t=>a[Number(t.slice(1))]).filter(Boolean).map(t=>({title:t.title,path:t.path}));return k.length>0?k:null}catch{return null}}function I(n,i,s){return`You are picking candidate articles from a wiki catalog to answer a question. You do NOT answer the question. You pick which articles the answer is likely to come from.
|
|
2
|
-
|
|
3
|
-
## Question
|
|
4
|
-
|
|
5
|
-
${n}
|
|
6
|
-
|
|
7
|
-
## Catalog (_index.md \u2014 articles grouped by type, with wikilink previews)
|
|
8
|
-
|
|
9
|
-
${i}
|
|
10
|
-
|
|
11
|
-
## Your task
|
|
12
|
-
|
|
13
|
-
Pick up to ${s} articles from the catalog that are most likely to answer the question. Prefer:
|
|
14
|
-
- Articles whose title directly names a subject in the question.
|
|
15
|
-
- Articles of the right type (e.g. a "who owns X" question \u2192 person or project; a "what happened on DATE" \u2192 event).
|
|
16
|
-
- Articles whose wikilinks suggest they sit at the center of a relevant subgraph.
|
|
17
|
-
|
|
18
|
-
Return ONLY valid JSON, no markdown fencing, no prose:
|
|
19
|
-
|
|
20
|
-
[
|
|
21
|
-
{"title": "Exact Article Title", "path": "path/from/catalog.md"},
|
|
22
|
-
...
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
If none of the articles match, return [].`}function L(n,i){let s=i.map(e=>{let d=`### ${e.meta.title} \u2014 ${e.meta.type||"untyped"} (${e.path}) [hop ${e.hop}]`,a=e.meta.related?.length?`Related: ${e.meta.related.join(", ")}`:"";return[d,a,"",e.content].filter(Boolean).join(`
|
|
26
|
-
`)}).join(`
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
`);return`You are answering a question using a small subgraph of wiki articles. The articles were walked from the catalog; trust them over your prior knowledge.
|
|
31
|
-
|
|
32
|
-
## Question
|
|
33
|
-
|
|
34
|
-
${n}
|
|
35
|
-
|
|
36
|
-
## Articles (${i.length} walked from the catalog)
|
|
37
|
-
|
|
38
|
-
${s}
|
|
39
|
-
|
|
40
|
-
## Your task
|
|
41
|
-
|
|
42
|
-
Answer the question in 2\u20136 sentences. Cite articles by their title in square brackets like [Article Title]. If the articles do not answer the question, say so plainly (do not invent). Prefer concrete facts over hedging.
|
|
43
|
-
|
|
44
|
-
Output ONLY the answer \u2014 no preamble, no "here is my answer:", no markdown fencing.`}function F(n){let i=n.match(/\[[\s\S]*?\]/);if(!i)return[];try{let s=JSON.parse(i[0]);return Array.isArray(s)?s.filter(e=>e&&typeof e.title=="string"&&typeof e.path=="string").map(e=>({title:e.title,path:e.path})):[]}catch{return[]}}async function N(n,i,s){let{writeFileSync:e,mkdirSync:d,rmSync:a}=await import("fs"),{tmpdir:c}=await import("os"),l=b(c(),`agentx-wiki-query-${process.pid}`);d(l,{recursive:!0});let r=b(l,`prompt-${Date.now()}.txt`);e(r,n);try{let p=`cat '${r}' | claude -p - --output-format json --max-turns 1 --model ${i} --disallowedTools "Bash Read Write Edit Glob Grep Agent WebSearch WebFetch NotebookEdit"`,u=Y(p,{env:C({...process.env}),encoding:"utf-8",timeout:s,maxBuffer:4*1024*1024});try{let h=JSON.parse(u);return String(h.result||h.content||"")}catch{return u}}finally{try{a(r,{force:!0})}catch{}}}export{V as a};
|
|
45
|
-
//# sourceMappingURL=chunk-V2TLFYKH.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/wiki/query.ts"],"sourcesContent":["import { readFileSync, existsSync } from \"fs\"\nimport { buildIndex, scoreAll } from \"@/memory/bm25\"\nimport { askSeat } from \"@/decisions/seat\"\nimport {\n DEFAULT_SHORTLIST,\n WIKI_RERANK_SEAT,\n rerankQuestions,\n rerankState,\n toRanking,\n type RerankCandidate,\n} from \"@/decisions/seats/wiki-rerank\"\nimport { stripAnthropicApiKey } from \"@/utils/workspace-env\"\nimport { resolve } from \"path\"\nimport { execSync } from \"child_process\"\nimport type { WikiArticle } from \"./types\"\nimport type { WikiStore } from \"./store\"\n\n/**\n * Agentic wiki query — the \"Farzapedia-faithful\" retrieval path.\n *\n * Two LLM calls + a deterministic graph walk:\n * 1. Selector (cheap): read `_index.md` + question → pick up to `maxCandidates`\n * candidate articles by title + type.\n * 2. Walk (pure code): starting from candidates, follow `related` wikilinks\n * up to `maxHops`, capped at `maxArticles` total.\n * 3. Synthesis (main): answer the question from the walked subgraph.\n *\n * Returns an answer with citations and a trace of which articles were walked,\n * so callers can audit the retrieval path.\n */\n\nexport interface AgenticQueryOptions {\n /** Candidate-selection model (cheap). Defaults to \"haiku\". */\n selectorModel?: string\n /** Synthesis model (main). Defaults to \"sonnet\". */\n synthModel?: string\n /** Number of candidates the selector is asked to return. Default 3. */\n maxCandidates?: number\n /** Wikilink hops from candidates. Default 2. */\n maxHops?: number\n /** Hard cap on total articles walked. Default 8. */\n maxArticles?: number\n /** Timeout per LLM call, ms. Default 60_000. */\n timeoutMs?: number\n /** Logger — defaults to console.error. */\n log?: (...args: unknown[]) => void\n}\n\nexport interface AgenticQueryResult {\n answer: string\n citations: Array<{ title: string; path: string; type?: string }>\n /** Titles/paths the selector picked. */\n candidates: Array<{ title: string; path: string }>\n /** Full article subgraph the walk produced. */\n walked: Array<{ title: string; path: string; type?: string; hop: number }>\n /** \"no-catalog\" | \"no-candidates\" | \"ok\" */\n status: \"ok\" | \"no-catalog\" | \"no-candidates\" | \"error\"\n /** For operator debugging only. */\n trace?: {\n selectorMs: number\n synthesisMs: number\n selectorOutput?: string\n }\n error?: string\n}\n\n/**\n * Run an agentic query against a specific agent's WikiStore.\n *\n * `requesterId` is used for permission checks — only articles the requester\n * can read will be included in the synthesis input.\n */\nexport async function agenticQuery(\n question: string,\n store: WikiStore,\n requesterId: string | undefined,\n opts: AgenticQueryOptions = {},\n): Promise<AgenticQueryResult> {\n const selectorModel = opts.selectorModel ?? \"haiku\"\n const synthModel = opts.synthModel ?? \"sonnet\"\n const maxCandidates = opts.maxCandidates ?? 3\n const maxHops = opts.maxHops ?? 2\n const maxArticles = opts.maxArticles ?? 8\n const timeoutMs = opts.timeoutMs ?? 60_000\n const log = opts.log ?? console.error.bind(console, \"[wiki-query]\")\n\n // --- Step 1: Load the catalog ---\n const catalogPath = resolve(store.baseDir, \"_index.md\")\n if (!existsSync(catalogPath)) {\n return emptyResult(\"no-catalog\", question, \"No _index.md found — run `agentx wiki status` to rebuild.\")\n }\n const catalog = readFileSync(catalogPath, \"utf-8\")\n\n // --- Step 2: Selector — pick candidates ---\n const selectorStart = Date.now()\n let candidates: Array<{ title: string; path: string }> = []\n let selectorOutput = \"\"\n try {\n const viaSeat = await selectCandidatesViaSeat(question, store, requesterId, maxCandidates)\n if (viaSeat) {\n candidates = viaSeat\n selectorOutput = `[wiki-rerank seat] ${viaSeat.map((c) => c.title).join(\" | \")}`\n } else {\n selectorOutput = await runClaude(\n buildSelectorPrompt(question, catalog, maxCandidates),\n selectorModel,\n timeoutMs,\n )\n candidates = parseCandidates(selectorOutput)\n }\n } catch (e: any) {\n log(\"selector failed:\", e?.message)\n return { ...emptyResult(\"error\", question, `Selector: ${e?.message || \"unknown\"}`), trace: { selectorMs: Date.now() - selectorStart, synthesisMs: 0, selectorOutput } }\n }\n const selectorMs = Date.now() - selectorStart\n\n if (candidates.length === 0) {\n return { ...emptyResult(\"no-candidates\", question, \"Selector returned no candidates.\"), trace: { selectorMs, synthesisMs: 0, selectorOutput } }\n }\n\n // --- Step 3: Walk the subgraph via `related` wikilinks ---\n const walked = walkSubgraph(candidates, store, requesterId, maxHops, maxArticles)\n\n if (walked.length === 0) {\n return { ...emptyResult(\"no-candidates\", question, \"Candidates did not resolve to readable articles.\"), candidates, trace: { selectorMs, synthesisMs: 0, selectorOutput } }\n }\n\n // --- Step 4: Synthesize the answer ---\n const synthStart = Date.now()\n let answer = \"\"\n try {\n answer = await runClaude(\n buildSynthesisPrompt(question, walked),\n synthModel,\n timeoutMs * 2,\n )\n } catch (e: any) {\n log(\"synthesis failed:\", e?.message)\n return { ...emptyResult(\"error\", question, `Synthesis: ${e?.message || \"unknown\"}`), candidates, walked: walked.map(w => ({ title: w.meta.title, path: w.path, type: w.meta.type, hop: (w as any).hop ?? 0 })), trace: { selectorMs, synthesisMs: Date.now() - synthStart, selectorOutput } }\n }\n const synthesisMs = Date.now() - synthStart\n\n return {\n answer: answer.trim(),\n citations: walked.map(a => ({ title: a.meta.title, path: a.path, type: a.meta.type })),\n candidates,\n walked: walked.map(w => ({ title: w.meta.title, path: w.path, type: w.meta.type, hop: (w as any).hop ?? 0 })),\n status: \"ok\",\n trace: { selectorMs, synthesisMs, selectorOutput },\n }\n}\n\n// --- Helpers ---\n\nfunction emptyResult(\n status: AgenticQueryResult[\"status\"],\n _question: string,\n error?: string,\n): AgenticQueryResult {\n return {\n answer: \"\",\n citations: [],\n candidates: [],\n walked: [],\n status,\n error,\n }\n}\n\nfunction walkSubgraph(\n candidates: Array<{ title: string; path: string }>,\n store: WikiStore,\n requesterId: string | undefined,\n maxHops: number,\n maxArticles: number,\n): Array<WikiArticle & { hop: number }> {\n // Build a title → path index from the store so wikilinks resolve.\n const titleIndex = new Map<string, string>()\n for (const article of store.listArticles(requesterId || \"\")) {\n titleIndex.set(article.meta.title.toLowerCase(), article.path)\n }\n\n const opened = new Map<string, WikiArticle & { hop: number }>()\n let frontier: Array<{ path: string; hop: number }> = []\n\n for (const c of candidates) {\n if (!opened.has(c.path)) frontier.push({ path: c.path, hop: 0 })\n }\n\n while (frontier.length && opened.size < maxArticles) {\n const next = frontier.shift()!\n if (opened.has(next.path)) continue\n if (next.hop > maxHops) continue\n\n const article = requesterId\n ? store.readArticleAs(next.path, requesterId)\n : store.readArticle(next.path)\n if (!article) continue\n\n opened.set(next.path, { ...article, hop: next.hop })\n if (next.hop >= maxHops) continue\n\n for (const target of article.meta.related || []) {\n const path = titleIndex.get(target.toLowerCase())\n if (path && !opened.has(path)) {\n frontier.push({ path, hop: next.hop + 1 })\n }\n }\n }\n\n return Array.from(opened.values())\n}\n\n// --- Prompts ---\n\n/**\n * Pick candidates with the wiki-rerank seat instead of a Claude CLI call.\n *\n * The selector is 56% of a wiki query — 14.1s of a 25s total, measured —\n * and its whole job is \"pick 3 articles from this catalog\", which is a\n * Choice with per-option probabilities. Jev answers that in about a\n * second. Synthesis stays on Sonnet; it writes prose, which Jev cannot.\n *\n * BM25 shortlists first because the shared catalog carries 971 entries,\n * past the 255-option cap. Same two-stage shape as findRelevantReranked,\n * and it reuses that seat rather than introducing a second one.\n *\n * Returns null whenever the seat is off, errors, or has nothing to rank,\n * and the caller falls back to the CLI selector — so this is strictly an\n * accelerator, never a new way to fail.\n */\nasync function selectCandidatesViaSeat(\n question: string,\n store: WikiStore,\n requesterId: string | undefined,\n maxCandidates: number,\n): Promise<Array<{ title: string; path: string }> | null> {\n try {\n const index = store.rebuildIndex()\n const pool = (index.articles ?? []).filter((a) => a.path && !a.path.includes(\"/_versions/\"))\n if (pool.length < 2) return null\n\n const docs = pool.map((a) =>\n [a.title, (a.tags ?? []).join(\" \"), (a.related ?? []).join(\" \")].join(\" \"),\n )\n const scored = scoreAll(question, buildIndex(docs)).map((r) => r.docIndex)\n for (let i = 0; i < pool.length; i++) if (!scored.includes(i)) scored.push(i)\n const shortlist = scored.slice(0, DEFAULT_SHORTLIST)\n\n const candidates: RerankCandidate[] = shortlist.map((i) => ({\n id: `k${i}`,\n title: pool[i].title || pool[i].path,\n tags: pool[i].tags,\n // The catalog has no body — a title, its type and its wikilinks are\n // exactly what the CLI selector was given to choose on.\n excerpt: [\n pool[i].type ? `type: ${pool[i].type}` : \"\",\n (pool[i].related ?? []).length ? `related: ${(pool[i].related ?? []).join(\", \")}` : \"\",\n ].filter(Boolean).join(\" · \"),\n }))\n\n const result = await askSeat(\n WIKI_RERANK_SEAT,\n rerankState({ query: question, candidates, excerptChars: 300 }),\n rerankQuestions(candidates),\n { features: { agent: requesterId ?? \"unknown\", stage: \"catalog-selector\" } },\n )\n if (!result || result.mode !== \"active\") return null\n\n const ranking = toRanking(result.answers as never, candidates)\n const picked = ranking.ranked\n .slice(0, maxCandidates)\n .map((id) => pool[Number(id.slice(1))])\n .filter(Boolean)\n .map((a) => ({ title: a.title, path: a.path }))\n return picked.length > 0 ? picked : null\n } catch {\n return null\n }\n}\n\nfunction buildSelectorPrompt(question: string, catalog: string, maxCandidates: number): string {\n return `You are picking candidate articles from a wiki catalog to answer a question. You do NOT answer the question. You pick which articles the answer is likely to come from.\n\n## Question\n\n${question}\n\n## Catalog (_index.md — articles grouped by type, with wikilink previews)\n\n${catalog}\n\n## Your task\n\nPick up to ${maxCandidates} articles from the catalog that are most likely to answer the question. Prefer:\n- Articles whose title directly names a subject in the question.\n- Articles of the right type (e.g. a \"who owns X\" question → person or project; a \"what happened on DATE\" → event).\n- Articles whose wikilinks suggest they sit at the center of a relevant subgraph.\n\nReturn ONLY valid JSON, no markdown fencing, no prose:\n\n[\n {\"title\": \"Exact Article Title\", \"path\": \"path/from/catalog.md\"},\n ...\n]\n\nIf none of the articles match, return [].`\n}\n\nfunction buildSynthesisPrompt(\n question: string,\n articles: Array<WikiArticle & { hop: number }>,\n): string {\n const articlesBlock = articles\n .map(a => {\n const header = `### ${a.meta.title} — ${a.meta.type || \"untyped\"} (${a.path}) [hop ${a.hop}]`\n const related = a.meta.related?.length ? `Related: ${a.meta.related.join(\", \")}` : \"\"\n return [header, related, \"\", a.content].filter(Boolean).join(\"\\n\")\n })\n .join(\"\\n\\n---\\n\\n\")\n\n return `You are answering a question using a small subgraph of wiki articles. The articles were walked from the catalog; trust them over your prior knowledge.\n\n## Question\n\n${question}\n\n## Articles (${articles.length} walked from the catalog)\n\n${articlesBlock}\n\n## Your task\n\nAnswer the question in 2–6 sentences. Cite articles by their title in square brackets like [Article Title]. If the articles do not answer the question, say so plainly (do not invent). Prefer concrete facts over hedging.\n\nOutput ONLY the answer — no preamble, no \"here is my answer:\", no markdown fencing.`\n}\n\nfunction parseCandidates(raw: string): Array<{ title: string; path: string }> {\n const match = raw.match(/\\[[\\s\\S]*?\\]/)\n if (!match) return []\n try {\n const parsed = JSON.parse(match[0])\n if (!Array.isArray(parsed)) return []\n return parsed\n .filter((x: any) => x && typeof x.title === \"string\" && typeof x.path === \"string\")\n .map((x: any) => ({ title: x.title, path: x.path }))\n } catch {\n return []\n }\n}\n\nasync function runClaude(prompt: string, model: string, timeoutMs: number): Promise<string> {\n // Use stdin via a temp-file pipe to avoid shell-escaping a huge prompt.\n // Prompts can exceed the `-E` arg buffer on macOS, so we always pipe.\n const { writeFileSync, mkdirSync, rmSync } = await import(\"fs\")\n const { tmpdir } = await import(\"os\")\n const dir = resolve(tmpdir(), `agentx-wiki-query-${process.pid}`)\n mkdirSync(dir, { recursive: true })\n const promptPath = resolve(dir, `prompt-${Date.now()}.txt`)\n writeFileSync(promptPath, prompt)\n try {\n const cmd = `cat '${promptPath}' | claude -p - --output-format json --max-turns 1 --model ${model} --disallowedTools \"Bash Read Write Edit Glob Grep Agent WebSearch WebFetch NotebookEdit\"`\n const raw = execSync(cmd, { env: stripAnthropicApiKey({ ...process.env }), encoding: \"utf-8\", timeout: timeoutMs, maxBuffer: 4 * 1024 * 1024 })\n try {\n const envelope = JSON.parse(raw)\n return String(envelope.result || envelope.content || \"\")\n } catch {\n return raw\n }\n } finally {\n try { rmSync(promptPath, { force: true }) } catch {}\n }\n}\n"],"mappings":"qMAAA,OAAS,gBAAAA,EAAc,cAAAC,MAAkB,KAEzCC,IAUA,OAAS,WAAAC,MAAe,OACxB,OAAS,YAAAC,MAAgB,gBA2DzB,eAAsBC,EACpBC,EACAC,EACAC,EACAC,EAA4B,CAAC,EACA,CAC7B,IAAMC,EAAgBD,EAAK,eAAiB,QACtCE,EAAaF,EAAK,YAAc,SAChCG,EAAgBH,EAAK,eAAiB,EACtCI,EAAUJ,EAAK,SAAW,EAC1BK,EAAcL,EAAK,aAAe,EACl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9BC,EAAM9E,EAAQ6E,EAAO,EAAG,qBAAqB,QAAQ,KAAK,EAChEF,EAAUG,EAAK,CAAE,UAAW,EAAK,CAAC,EAClC,IAAMC,EAAa/E,EAAQ8E,EAAK,UAAU,KAAK,IAAI,OAAO,EAC1DJ,EAAcK,EAAYP,CAAM,EAChC,GAAI,CACF,IAAMQ,EAAM,QAAQD,+DAAwEN,6FACtFL,EAAMnE,EAAS+E,EAAK,CAAE,IAAKC,EAAqB,CAAE,GAAG,QAAQ,GAAI,CAAC,EAAG,SAAU,QAAS,QAASrE,EAAW,UAAW,EAAI,KAAO,IAAK,CAAC,EAC9I,GAAI,CACF,IAAMsE,EAAW,KAAK,MAAMd,CAAG,EAC/B,OAAO,OAAOc,EAAS,QAAUA,EAAS,SAAW,EAAE,CACzD,MAAE,CACA,OAAOd,CACT,CACF,QAAE,CACA,GAAI,CAAEQ,EAAOG,EAAY,CAAE,MAAO,EAAK,CAAC,CAAE,MAAE,CAAO,CACrD,CACF","names":["readFileSync","existsSync","init_seat","resolve","execSync","agenticQuery","question","store","requesterId","opts","selectorModel","synthModel","maxCandidates","maxHops","maxArticles","timeoutMs","log","catalogPath","existsSync","emptyResult","catalog","readFileSync","selectorStart","candidates","selectorOutput","viaSeat","selectCandidatesViaSeat","c","runClaude","buildSelectorPrompt","parseCandidates","e","selectorMs","walked","walkSubgraph","synthStart","answer","buildSynthesisPrompt","w","synthesisMs","a","status","_question","error","titleIndex","article","opened","frontier","next","target","path","pool","docs","scored","scoreAll","buildIndex","r","i","DEFAULT_SHORTLIST","result","askSeat","WIKI_RERANK_SEAT","rerankState","rerankQuestions","picked","toRanking","id","articles","articlesBlock","header","related","raw","match","parsed","x","prompt","model","writeFileSync","mkdirSync","rmSync","tmpdir","dir","promptPath","cmd","stripAnthropicApiKey","envelope"]}
|
package/dist/client-GDTX6LFH.js
DELETED
package/dist/doctor-JBIRBRLB.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e}from"./chunk-KLHG5ZQH.js";import"./chunk-BYJ3A55Y.js";import"./chunk-DTX4I5LQ.js";import"./chunk-QIJLFPWE.js";export{e as daemonVoiceCheck,b as doctor,a as runDoctorChecks,c as runNotificationChecks,d as runReminderChecks};
|
|
2
|
-
//# sourceMappingURL=doctor-JBIRBRLB.js.map
|
package/dist/program-T275Y2V6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-OHRTBD7U.js";import"./chunk-OVX6NRMD.js";import"./chunk-KLHG5ZQH.js";import"./chunk-M6GPRMCQ.js";import"./chunk-Z3IP66SL.js";import"./chunk-C4CDVE2E.js";import"./chunk-RKPAVWXF.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-5ONI54E6.js";import"./chunk-CKBAVCGU.js";import"./chunk-BYJ3A55Y.js";import"./chunk-NMFXY3QU.js";import"./chunk-YBF2QVZ7.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-DQQ3BCJW.js";import"./chunk-2D3RYIDU.js";import"./chunk-EKJG63EJ.js";import"./chunk-K63IOY6A.js";import"./chunk-IU6L4V3A.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import"./chunk-J7HA7ZTU.js";import"./chunk-SFQUP3BP.js";import"./chunk-FSYA4GNU.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-OPUPVGYP.js";import"./chunk-YL223TEU.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-P2RYUODK.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-VWTBHLMX.js";import"./chunk-2UYV24UD.js";import"./chunk-535MLOSB.js";import"./chunk-4DRNEOOW.js";import"./chunk-64P4QHSZ.js";import"./chunk-V2TLFYKH.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-JHCI6XCJ.js";import"./chunk-DSYKYZMT.js";import"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as buildProgram};
|
|
2
|
-
//# sourceMappingURL=program-T275Y2V6.js.map
|
package/dist/query-7QQZPMXM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-V2TLFYKH.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as agenticQuery};
|
|
2
|
-
//# sourceMappingURL=query-7QQZPMXM.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
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-K63IOY6A.js";import"./chunk-IU6L4V3A.js";import"./chunk-N6EWZGIX.js";import"./chunk-WP6KLXTP.js";import"./chunk-DP7RTNDM.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-OPUPVGYP.js";import"./chunk-YL223TEU.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-P2RYUODK.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-VWTBHLMX.js";import"./chunk-2UYV24UD.js";import"./chunk-535MLOSB.js";import"./chunk-4DRNEOOW.js";import"./chunk-64P4QHSZ.js";import"./chunk-V2TLFYKH.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-DSYKYZMT.js";import"./chunk-DTX4I5LQ.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-WQ65MQEY.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk-FUR3T3IN.js";import"./chunk-RKPAVWXF.js";import"./chunk-FSYA4GNU.js";import"./chunk-OPUPVGYP.js";import"./chunk-YL223TEU.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-DTX4I5LQ.js";import"./chunk-QIJLFPWE.js";export{b as resolveScheduleCaller,a as runScheduleTool};
|
|
2
|
-
//# sourceMappingURL=schedule-tool-NJFROYKY.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as a,o as b,p as c,q as d,r as e,s as f}from"./chunk-OPUPVGYP.js";import"./chunk-YL223TEU.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-DTX4I5LQ.js";import"./chunk-QIJLFPWE.js";export{a as AGENT_RUN_TIMEOUT_FLOOR,f as CronScheduler,b as agentRunTimeout,e as cronRunId,d as getNextCronDate,c as runLinkIds};
|
|
2
|
-
//# sourceMappingURL=scheduler-5N4FC2FQ.js.map
|
package/dist/types-S6NHM5C3.js
DELETED
package/dist/wiki-J4MMCONT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./chunk-VWTBHLMX.js";import{a as b}from"./chunk-2UYV24UD.js";import{e as a}from"./chunk-535MLOSB.js";import"./chunk-4DRNEOOW.js";import"./chunk-64P4QHSZ.js";import{a as c}from"./chunk-V2TLFYKH.js";import"./chunk-TFVUOC2C.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BBIWAJRX.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-DTX4I5LQ.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{b as WikiHub,a as WikiStore,c as agenticQuery};
|
|
2
|
-
//# sourceMappingURL=wiki-J4MMCONT.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|