agentix-cli 0.31.0 → 0.33.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.
- package/dist/{App-6TP7YMQ3.js → App-2LAWZNMG.js} +2 -2
- package/dist/{ChatApp-G2MQUBR3.js → ChatApp-2KRDHMTV.js} +2 -2
- package/dist/{agent-A5G4DGVU.js → agent-ZRRIMLTX.js} +2 -2
- package/dist/{board-dashboard-BU6QJK6X.js → board-dashboard-XYB7M5BH.js} +35 -35
- package/dist/board-dashboard-XYB7M5BH.js.map +1 -0
- package/dist/{chunk-JC6ZHSTY.js → chunk-2DBGOCCW.js} +2 -2
- package/dist/chunk-2DMVKLLE.js +13 -0
- package/dist/chunk-2DMVKLLE.js.map +1 -0
- package/dist/chunk-2GIDVZ4H.js +3 -0
- package/dist/{chunk-EVWEG3VD.js.map → chunk-2GIDVZ4H.js.map} +1 -1
- package/dist/{chunk-2J3NV6RZ.js → chunk-4CR463C6.js} +2 -2
- package/dist/{chunk-7JWYLSFF.js → chunk-5FEQI22L.js} +2 -2
- package/dist/{chunk-COOJI5SR.js → chunk-6VQKHMEQ.js} +40 -40
- package/dist/chunk-6VQKHMEQ.js.map +1 -0
- package/dist/{chunk-R7WLFEW3.js → chunk-A4YR3PQY.js} +2 -2
- package/dist/{chunk-NZ346QCV.js → chunk-B2XTYYXV.js} +2 -2
- package/dist/{chunk-DLOYTMYZ.js → chunk-G5MFPNGJ.js} +2 -2
- package/dist/{chunk-JV52UMCI.js → chunk-GWQIMAJ7.js} +2 -2
- package/dist/{chunk-W6HKWISZ.js → chunk-JGJE5Y2J.js} +2 -2
- package/dist/{chunk-FFDXDUVQ.js → chunk-JWKIFAXA.js} +2 -2
- package/dist/{chunk-JJIYFBDH.js → chunk-K6E7WJ7O.js} +2 -2
- package/dist/{chunk-6DD4DA2L.js → chunk-MFVI5FOM.js} +2 -2
- package/dist/{chunk-7MNXKITO.js → chunk-UEP7IRBD.js} +120 -120
- package/dist/chunk-UEP7IRBD.js.map +1 -0
- package/dist/{chunk-UOGDSRG3.js → chunk-W3YGESNK.js} +2 -2
- package/dist/{chunk-ZZQMR526.js → chunk-WZD3OS7T.js} +96 -94
- package/dist/chunk-WZD3OS7T.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/client-IP643GRO.js +2 -0
- package/dist/config-IVDP46ZG.js +2 -0
- package/dist/config-mutator-UCGAV3SP.js +2 -0
- package/dist/doctor-MMT4SREV.js +2 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +1 -1
- package/dist/program-PK5R7GIC.js +2 -0
- package/dist/query-RHVR6QUZ.js +2 -0
- package/dist/{registry-LUMYXZ6F.js → registry-OB6S66XX.js} +2 -2
- package/dist/{request-planner-RNQB4L6F.js → request-planner-F5NVL2G7.js} +2 -2
- package/dist/{review-candidates-ZX4JBWQL.js → review-candidates-IRPKFWL2.js} +2 -2
- package/dist/{rotation-memo-7T75BLEX.js → rotation-memo-QEO3COFH.js} +3 -3
- package/dist/rotation-memo-QEO3COFH.js.map +1 -0
- package/dist/{routing-5VGXQ4VG.js → routing-OSPRKRAY.js} +2 -2
- package/dist/scheduler-JL6K5HHI.js +2 -0
- package/dist/{seat-SXPFROXT.js → seat-2MHKVMW2.js} +2 -2
- package/dist/{select-GJ47QACY.js → select-7LCHJVPK.js} +2 -2
- package/dist/web/activity-graph.global.js +11 -11
- package/dist/web/activity-graph.global.js.map +1 -1
- package/dist/wiki-MY32MON3.js +2 -0
- package/package.json +2 -1
- package/dist/board-dashboard-BU6QJK6X.js.map +0 -1
- package/dist/chunk-7MNXKITO.js.map +0 -1
- package/dist/chunk-COOJI5SR.js.map +0 -1
- package/dist/chunk-EVWEG3VD.js +0 -3
- package/dist/chunk-Z3RKXKE2.js +0 -13
- package/dist/chunk-Z3RKXKE2.js.map +0 -1
- package/dist/chunk-ZZQMR526.js.map +0 -1
- package/dist/client-QALLJG62.js +0 -2
- package/dist/config-TNNODULV.js +0 -2
- package/dist/config-mutator-RI77M5YT.js +0 -2
- package/dist/doctor-DW27MR2T.js +0 -2
- package/dist/program-WZ3GEOXO.js +0 -2
- package/dist/query-7X6VO5VU.js +0 -2
- package/dist/rotation-memo-7T75BLEX.js.map +0 -1
- package/dist/scheduler-W5C43ZTE.js +0 -2
- package/dist/wiki-SRH3JKI4.js +0 -2
- /package/dist/{App-6TP7YMQ3.js.map → App-2LAWZNMG.js.map} +0 -0
- /package/dist/{ChatApp-G2MQUBR3.js.map → ChatApp-2KRDHMTV.js.map} +0 -0
- /package/dist/{agent-A5G4DGVU.js.map → agent-ZRRIMLTX.js.map} +0 -0
- /package/dist/{chunk-JC6ZHSTY.js.map → chunk-2DBGOCCW.js.map} +0 -0
- /package/dist/{chunk-2J3NV6RZ.js.map → chunk-4CR463C6.js.map} +0 -0
- /package/dist/{chunk-7JWYLSFF.js.map → chunk-5FEQI22L.js.map} +0 -0
- /package/dist/{chunk-R7WLFEW3.js.map → chunk-A4YR3PQY.js.map} +0 -0
- /package/dist/{chunk-NZ346QCV.js.map → chunk-B2XTYYXV.js.map} +0 -0
- /package/dist/{chunk-DLOYTMYZ.js.map → chunk-G5MFPNGJ.js.map} +0 -0
- /package/dist/{chunk-JV52UMCI.js.map → chunk-GWQIMAJ7.js.map} +0 -0
- /package/dist/{chunk-W6HKWISZ.js.map → chunk-JGJE5Y2J.js.map} +0 -0
- /package/dist/{chunk-FFDXDUVQ.js.map → chunk-JWKIFAXA.js.map} +0 -0
- /package/dist/{chunk-JJIYFBDH.js.map → chunk-K6E7WJ7O.js.map} +0 -0
- /package/dist/{chunk-6DD4DA2L.js.map → chunk-MFVI5FOM.js.map} +0 -0
- /package/dist/{chunk-UOGDSRG3.js.map → chunk-W3YGESNK.js.map} +0 -0
- /package/dist/{client-QALLJG62.js.map → client-IP643GRO.js.map} +0 -0
- /package/dist/{config-TNNODULV.js.map → config-IVDP46ZG.js.map} +0 -0
- /package/dist/{config-mutator-RI77M5YT.js.map → config-mutator-UCGAV3SP.js.map} +0 -0
- /package/dist/{doctor-DW27MR2T.js.map → doctor-MMT4SREV.js.map} +0 -0
- /package/dist/{program-WZ3GEOXO.js.map → program-PK5R7GIC.js.map} +0 -0
- /package/dist/{query-7X6VO5VU.js.map → query-RHVR6QUZ.js.map} +0 -0
- /package/dist/{registry-LUMYXZ6F.js.map → registry-OB6S66XX.js.map} +0 -0
- /package/dist/{request-planner-RNQB4L6F.js.map → request-planner-F5NVL2G7.js.map} +0 -0
- /package/dist/{review-candidates-ZX4JBWQL.js.map → review-candidates-IRPKFWL2.js.map} +0 -0
- /package/dist/{routing-5VGXQ4VG.js.map → routing-OSPRKRAY.js.map} +0 -0
- /package/dist/{scheduler-W5C43ZTE.js.map → scheduler-JL6K5HHI.js.map} +0 -0
- /package/dist/{seat-SXPFROXT.js.map → seat-2MHKVMW2.js.map} +0 -0
- /package/dist/{select-GJ47QACY.js.map → select-7LCHJVPK.js.map} +0 -0
- /package/dist/{wiki-SRH3JKI4.js.map → wiki-MY32MON3.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as s}from"./chunk-
|
|
2
|
+
import{a as s}from"./chunk-WZD3OS7T.js";import"./chunk-4CR463C6.js";import"./chunk-G5MFPNGJ.js";import"./chunk-B2XTYYXV.js";import"./chunk-2TJ5L7CB.js";import"./chunk-7CVJ4JOE.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-UEP7IRBD.js";import"./chunk-F6CNF7V3.js";import"./chunk-GWQIMAJ7.js";import"./chunk-V7FYSZSV.js";import"./chunk-ZVP6GB4G.js";import"./chunk-6VQKHMEQ.js";import"./chunk-5FEQI22L.js";import"./chunk-VMDA2SX2.js";import"./chunk-QLTM3F7M.js";import"./chunk-A4YR3PQY.js";import"./chunk-K6E7WJ7O.js";import"./chunk-SFQUP3BP.js";import"./chunk-3SCPRYJB.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-JWKIFAXA.js";import"./chunk-W3YGESNK.js";import"./chunk-DWADWDMU.js";import"./chunk-77OV7346.js";import"./chunk-VWTBHLMX.js";import"./chunk-MFVI5FOM.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-JGJE5Y2J.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));async function o(){let r=await s();if(process.argv.slice(2).length===0){r.outputHelp();return}r.parse()}o();
|
|
3
3
|
//# sourceMappingURL=cli.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1562,6 +1562,12 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1562
1562
|
* agents that do long investigations or multi-file refactors. */
|
|
1563
1563
|
maxExecutionMinutes: z.ZodDefault<z.ZodNumber>;
|
|
1564
1564
|
permissionMode: z.ZodDefault<z.ZodString>;
|
|
1565
|
+
/** How this agent's `claude` CLI is billed (claude-code tier). Default
|
|
1566
|
+
* "subscription": the shared OAuth login, ANTHROPIC_API_KEY stripped.
|
|
1567
|
+
* "api": bill ANTHROPIC_API_KEY instead and drop the OAuth token, so
|
|
1568
|
+
* e.g. benchmark agents never draw on the fleet's subscription quota.
|
|
1569
|
+
* An "api" agent with no key fails its task rather than falling back. */
|
|
1570
|
+
billing: z.ZodDefault<z.ZodEnum<["subscription", "api"]>>;
|
|
1565
1571
|
/** Improvement plan #3 — tool-use-required preset. When set,
|
|
1566
1572
|
* AgentX inspects the stream-json events from each task and
|
|
1567
1573
|
* fails the response with `tool_required_not_called: <name>`
|
|
@@ -1713,6 +1719,7 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1713
1719
|
maxConcurrent: number;
|
|
1714
1720
|
maxExecutionMinutes: number;
|
|
1715
1721
|
permissionMode: string;
|
|
1722
|
+
billing: "api" | "subscription";
|
|
1716
1723
|
toolUseRequired: string[];
|
|
1717
1724
|
persistentProcess: boolean;
|
|
1718
1725
|
queueMode: "collect" | "followup" | "drop";
|
|
@@ -1781,6 +1788,7 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1781
1788
|
maxConcurrent?: number | undefined;
|
|
1782
1789
|
maxExecutionMinutes?: number | undefined;
|
|
1783
1790
|
permissionMode?: string | undefined;
|
|
1791
|
+
billing?: "api" | "subscription" | undefined;
|
|
1784
1792
|
toolUseRequired?: string[] | undefined;
|
|
1785
1793
|
gitlabAutoReply?: boolean | undefined;
|
|
1786
1794
|
persistentProcess?: boolean | undefined;
|
|
@@ -2061,6 +2069,12 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2061
2069
|
* agents that do long investigations or multi-file refactors. */
|
|
2062
2070
|
maxExecutionMinutes: z.ZodDefault<z.ZodNumber>;
|
|
2063
2071
|
permissionMode: z.ZodDefault<z.ZodString>;
|
|
2072
|
+
/** How this agent's `claude` CLI is billed (claude-code tier). Default
|
|
2073
|
+
* "subscription": the shared OAuth login, ANTHROPIC_API_KEY stripped.
|
|
2074
|
+
* "api": bill ANTHROPIC_API_KEY instead and drop the OAuth token, so
|
|
2075
|
+
* e.g. benchmark agents never draw on the fleet's subscription quota.
|
|
2076
|
+
* An "api" agent with no key fails its task rather than falling back. */
|
|
2077
|
+
billing: z.ZodDefault<z.ZodEnum<["subscription", "api"]>>;
|
|
2064
2078
|
/** Improvement plan #3 — tool-use-required preset. When set,
|
|
2065
2079
|
* AgentX inspects the stream-json events from each task and
|
|
2066
2080
|
* fails the response with `tool_required_not_called: <name>`
|
|
@@ -2212,6 +2226,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2212
2226
|
maxConcurrent: number;
|
|
2213
2227
|
maxExecutionMinutes: number;
|
|
2214
2228
|
permissionMode: string;
|
|
2229
|
+
billing: "api" | "subscription";
|
|
2215
2230
|
toolUseRequired: string[];
|
|
2216
2231
|
persistentProcess: boolean;
|
|
2217
2232
|
queueMode: "collect" | "followup" | "drop";
|
|
@@ -2280,6 +2295,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2280
2295
|
maxConcurrent?: number | undefined;
|
|
2281
2296
|
maxExecutionMinutes?: number | undefined;
|
|
2282
2297
|
permissionMode?: string | undefined;
|
|
2298
|
+
billing?: "api" | "subscription" | undefined;
|
|
2283
2299
|
toolUseRequired?: string[] | undefined;
|
|
2284
2300
|
gitlabAutoReply?: boolean | undefined;
|
|
2285
2301
|
persistentProcess?: boolean | undefined;
|
|
@@ -4719,6 +4735,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4719
4735
|
maxConcurrent: number;
|
|
4720
4736
|
maxExecutionMinutes: number;
|
|
4721
4737
|
permissionMode: string;
|
|
4738
|
+
billing: "api" | "subscription";
|
|
4722
4739
|
toolUseRequired: string[];
|
|
4723
4740
|
persistentProcess: boolean;
|
|
4724
4741
|
queueMode: "collect" | "followup" | "drop";
|
|
@@ -5239,6 +5256,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
5239
5256
|
maxConcurrent?: number | undefined;
|
|
5240
5257
|
maxExecutionMinutes?: number | undefined;
|
|
5241
5258
|
permissionMode?: string | undefined;
|
|
5259
|
+
billing?: "api" | "subscription" | undefined;
|
|
5242
5260
|
toolUseRequired?: string[] | undefined;
|
|
5243
5261
|
gitlabAutoReply?: boolean | undefined;
|
|
5244
5262
|
persistentProcess?: boolean | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as L}from"./chunk-W5C2GDNC.js";import{B as bt,C as Tt,D as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-W5C2GDNC.js";import{B as bt,C as Tt,D as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt}from"./chunk-UEP7IRBD.js";import"./chunk-F6CNF7V3.js";import"./chunk-GWQIMAJ7.js";import"./chunk-V7FYSZSV.js";import"./chunk-ZVP6GB4G.js";import{J as yt,h as lt,i as ct,j as dt,k as mt,l as pt}from"./chunk-6VQKHMEQ.js";import"./chunk-5FEQI22L.js";import"./chunk-VMDA2SX2.js";import"./chunk-QLTM3F7M.js";import{h as ut}from"./chunk-A4YR3PQY.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-K6E7WJ7O.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-3SCPRYJB.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-JWKIFAXA.js";import"./chunk-W3YGESNK.js";import"./chunk-DWADWDMU.js";import"./chunk-77OV7346.js";import"./chunk-VWTBHLMX.js";import{a as gt,b as ft,e as ht}from"./chunk-MFVI5FOM.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-JGJE5Y2J.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-LCIREYTD.js";import{a as m,b as G}from"./chunk-L2WSPY6S.js";import{a as Fe,b as Le,c as A,d as De}from"./chunk-VDMYBPYB.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{e as tt,g as st,h as ot,j as nt}from"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
|
|
2
2
|
`)}
|
|
3
3
|
|
|
4
4
|
${t}`}async function It(o){let{loadLocalSkills:e}=await import("./loader-BOKE5M5S.js");return e(o)}async function Ot(o,e,t,s,i){let a=[{role:"system",content:`You are a skill author for the Agent Skills ecosystem (skills.sh).
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-WZD3OS7T.js";import"./chunk-4CR463C6.js";import"./chunk-G5MFPNGJ.js";import"./chunk-B2XTYYXV.js";import"./chunk-2TJ5L7CB.js";import"./chunk-7CVJ4JOE.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-UEP7IRBD.js";import"./chunk-F6CNF7V3.js";import"./chunk-GWQIMAJ7.js";import"./chunk-V7FYSZSV.js";import"./chunk-ZVP6GB4G.js";import"./chunk-6VQKHMEQ.js";import"./chunk-5FEQI22L.js";import"./chunk-VMDA2SX2.js";import"./chunk-QLTM3F7M.js";import"./chunk-A4YR3PQY.js";import"./chunk-K6E7WJ7O.js";import"./chunk-SFQUP3BP.js";import"./chunk-3SCPRYJB.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-JWKIFAXA.js";import"./chunk-W3YGESNK.js";import"./chunk-DWADWDMU.js";import"./chunk-77OV7346.js";import"./chunk-VWTBHLMX.js";import"./chunk-MFVI5FOM.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-JGJE5Y2J.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{a as buildProgram};
|
|
2
|
+
//# sourceMappingURL=program-PK5R7GIC.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-JGJE5Y2J.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{a as agenticQuery};
|
|
2
|
+
//# sourceMappingURL=query-RHVR6QUZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A as a,B as b,C as c,D as d,E as e,F as f,G as g,H as h,I as i,J as j}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=registry-
|
|
1
|
+
import{A as a,B as b,C as c,D as d,E as e,F as f,G as g,H as h,I as i,J as j}from"./chunk-6VQKHMEQ.js";import"./chunk-5FEQI22L.js";import"./chunk-VMDA2SX2.js";import"./chunk-QLTM3F7M.js";import"./chunk-A4YR3PQY.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-JWKIFAXA.js";import"./chunk-W3YGESNK.js";import"./chunk-DWADWDMU.js";import"./chunk-77OV7346.js";import"./chunk-VWTBHLMX.js";import"./chunk-MFVI5FOM.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-JGJE5Y2J.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-DSYKYZMT.js";import"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{j as AgentRegistry,e as TRACE_STEP_SUMMARY_BYTES,c as buildEntryMeta,d as buildWikiContext,f as clipForTrace,i as emitTraceStepsFromStreamEvent,h as firstMissingRequiredTool,b as getGlobalRegistry,a as setGlobalRegistry,g as tallyToolUses};
|
|
2
|
+
//# sourceMappingURL=registry-OB6S66XX.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{q as m,t as p,v as d,w as x}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=request-planner-
|
|
1
|
+
import{q as m,t as p,v as d,w as x}from"./chunk-2DBGOCCW.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-2DMVKLLE.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-F5NVL2G7.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b}from"./chunk-
|
|
1
|
+
import{b}from"./chunk-GWQIMAJ7.js";import"./chunk-VMDA2SX2.js";import"./chunk-2GIDVZ4H.js";import"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-2DMVKLLE.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-
|
|
4
|
+
//# sourceMappingURL=review-candidates-IRPKFWL2.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as u,c as m}from"./chunk-2GIDVZ4H.js";import"./chunk-FIOB3MEX.js";import{execFile as h}from"child_process";var g=3e4,w="haiku",M=`You are about to lose this working session due to context-size rotation. Before that happens, write a compact memo of what you should carry forward to your next session on the same conversation.
|
|
2
2
|
|
|
3
3
|
Include only durable facts a future turn would otherwise have to rediscover:
|
|
4
4
|
- Names, handles, agent ids, telegram/whatsapp/gitlab usernames
|
|
@@ -9,5 +9,5 @@ Include only durable facts a future turn would otherwise have to rediscover:
|
|
|
9
9
|
|
|
10
10
|
Format: 3-12 short bullet points. Each \u2264120 chars. No prose, no preamble, no header. If the session was uninformative or just casual chat, reply with exactly the literal text "(no memo)".
|
|
11
11
|
|
|
12
|
-
Begin the memo now.`;async function
|
|
13
|
-
//# sourceMappingURL=rotation-memo-
|
|
12
|
+
Begin the memo now.`;async function E(n,r){let c=Date.now();if(!r)return{memo:null,reason:"no-resume",durationMs:0};let i=["-p",M,"--output-format","json","--resume",r,"--model",w];n.permissionMode==="bypassPermissions"&&i.push("--dangerously-skip-permissions");let p=m(u(n.workspace),n.billing);return new Promise(d=>{let a=!1,e=(t,s)=>{a||(a=!0,d({memo:t,reason:s,durationMs:Date.now()-c}))};h("claude",i,{cwd:n.workspace,env:p,timeout:g,maxBuffer:1024*1024},(t,s,b)=>{if(t)return t.killed?e(null,"timeout"):e(null,`error:${t.message.slice(0,80)}`);try{let l=JSON.parse(s||"{}"),o=typeof l.result=="string"?l.result.trim():"";if(!o||o==="(no memo)")return e(null,"empty");let f=o.length>4096?o.slice(0,4096)+"\u2026":o;return e(f,"ok")}catch{return e(null,"parse-error")}}).on("error",()=>e(null,"spawn-error"))})}export{E as extractRotationMemo};
|
|
13
|
+
//# sourceMappingURL=rotation-memo-QEO3COFH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/agents/rotation-memo.ts"],"sourcesContent":["import { execFile } from \"child_process\"\nimport type { AgentDef } from \"@/daemon/config\"\nimport { buildAgentEnv, claudeBillingEnv } from \"@/utils/workspace-env\"\n\n// --- Pre-rotation memo extraction ---\n//\n// Just before agentx clears `claudeSessionId` (tier-2 / max-turns / stale\n// rotation), we ask the dying Claude session to dump the facts and\n// decisions it should carry forward. The agent has full working-memory\n// of its tool-use history at this moment — the only chance to capture\n// it before --resume is dropped and the next turn starts with a blank\n// session.\n//\n// The memo persists into MemoryStore, where the existing findRelevant\n// path injects it into future turns naturally. No new wiring on the\n// read side; one-shot LLM call on the write side.\n//\n// Hard rule: never block rotation. Timeout, errors, empty memos all\n// mean \"skip this round of memo capture\". Memory continuity is a\n// best-effort enhancement, not a correctness requirement.\n\nconst MEMO_TIMEOUT_MS = 30_000\nconst MEMO_MODEL = \"haiku\" // cheapest fast model — memo is summarisation, not reasoning\n\nconst MEMO_PROMPT =\n \"You are about to lose this working session due to context-size rotation. \" +\n \"Before that happens, write a compact memo of what you should carry forward \" +\n \"to your next session on the same conversation.\\n\\n\" +\n \"Include only durable facts a future turn would otherwise have to rediscover:\\n\" +\n \"- Names, handles, agent ids, telegram/whatsapp/gitlab usernames\\n\" +\n \"- File paths, URLs, project namespaces, ssh hosts, ports\\n\" +\n \"- Decisions made and their reasoning\\n\" +\n \"- Open tasks or commitments to follow up on\\n\" +\n \"- Identifiers (issue numbers, PR numbers, ticket ids) the user referred to\\n\\n\" +\n \"Format: 3-12 short bullet points. Each ≤120 chars. No prose, no preamble, \" +\n \"no header. If the session was uninformative or just casual chat, reply with \" +\n \"exactly the literal text \\\"(no memo)\\\".\\n\\n\" +\n \"Begin the memo now.\"\n\nexport interface RotationMemoResult {\n /** The extracted memo text, or null when extraction failed/skipped. */\n memo: string | null\n /** Why we skipped or what happened — \"ok\", \"timeout\", \"error\", \"empty\", \"no-resume\". */\n reason: string\n /** Wall-clock time spent in the extractor. */\n durationMs: number\n}\n\n/** Ask the dying Claude session for a carry-forward memo. Spawns one\n * short claude CLI call with --resume on the about-to-be-dropped\n * session id, asks for a compact memo, returns the text. Never throws\n * — every failure mode resolves with `memo=null` so the caller can\n * proceed with the rotation regardless. */\nexport async function extractRotationMemo(\n agent: AgentDef,\n resumeSessionId: string | undefined,\n): Promise<RotationMemoResult> {\n const start = Date.now()\n if (!resumeSessionId) {\n return { memo: null, reason: \"no-resume\", durationMs: 0 }\n }\n\n const args: string[] = [\n \"-p\", MEMO_PROMPT,\n \"--output-format\", \"json\",\n \"--resume\", resumeSessionId,\n \"--model\", MEMO_MODEL,\n ]\n if (agent.permissionMode === \"bypassPermissions\") {\n args.push(\"--dangerously-skip-permissions\")\n }\n\n const env = claudeBillingEnv(buildAgentEnv(agent.workspace), agent.billing)\n\n return new Promise<RotationMemoResult>((resolve) => {\n let settled = false\n const finish = (memo: string | null, reason: string) => {\n if (settled) return\n settled = true\n resolve({ memo, reason, durationMs: Date.now() - start })\n }\n\n const child = execFile(\n \"claude\",\n args,\n {\n cwd: agent.workspace,\n env,\n timeout: MEMO_TIMEOUT_MS,\n maxBuffer: 1024 * 1024, // 1 MB; the memo itself is tiny\n },\n (err, stdout, _stderr) => {\n if (err) {\n // execFile signals timeout via signal SIGTERM + err.killed\n if ((err as NodeJS.ErrnoException & { killed?: boolean }).killed) {\n return finish(null, \"timeout\")\n }\n return finish(null, `error:${err.message.slice(0, 80)}`)\n }\n try {\n const data = JSON.parse(stdout || \"{}\")\n // claude -p --output-format json yields { result, ... }\n const text = typeof data.result === \"string\" ? data.result.trim() : \"\"\n if (!text || text === \"(no memo)\") return finish(null, \"empty\")\n // Defensive cap: memos > 4 KB are almost certainly the LLM\n // ignoring instructions and dumping prose. Truncate.\n const capped = text.length > 4096 ? text.slice(0, 4096) + \"…\" : text\n return finish(capped, \"ok\")\n } catch {\n return finish(null, \"parse-error\")\n }\n },\n )\n child.on(\"error\", () => finish(null, \"spawn-error\"))\n })\n}\n"],"mappings":"2EAAA,OAAS,YAAAA,MAAgB,gBAqBzB,IAAMC,EAAkB,IAClBC,EAAa,QAEbC,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBA4BF,eAAsBC,EACpBC,EACAC,EAC6B,CAC7B,IAAMC,EAAQ,KAAK,IAAI,EACvB,GAAI,CAACD,EACH,MAAO,CAAE,KAAM,KAAM,OAAQ,YAAa,WAAY,CAAE,EAG1D,IAAME,EAAiB,CACrB,KAAML,EACN,kBAAmB,OACnB,WAAYG,EACZ,UAAWJ,CACb,EACIG,EAAM,iBAAmB,qBAC3BG,EAAK,KAAK,gCAAgC,EAG5C,IAAMC,EAAMC,EAAiBC,EAAcN,EAAM,SAAS,EAAGA,EAAM,OAAO,EAE1E,OAAO,IAAI,QAA6BO,GAAY,CAClD,IAAIC,EAAU,GACRC,EAAS,CAACC,EAAqBC,IAAmB,CAClDH,IACJA,EAAU,GACVD,EAAQ,CAAE,KAAAG,EAAM,OAAAC,EAAQ,WAAY,KAAK,IAAI,EAAIT,CAAM,CAAC,EAC1D,EAEcU,EACZ,SACAT,EACA,CACE,IAAKH,EAAM,UACX,IAAAI,EACA,QAASR,EACT,UAAW,KAAO,IACpB,EACA,CAACiB,EAAKC,EAAQC,IAAY,CACxB,GAAIF,EAEF,OAAKA,EAAqD,OACjDJ,EAAO,KAAM,SAAS,EAExBA,EAAO,KAAM,SAASI,EAAI,QAAQ,MAAM,EAAG,EAAE,GAAG,EAEzD,GAAI,CACF,IAAMG,EAAO,KAAK,MAAMF,GAAU,IAAI,EAEhCG,EAAO,OAAOD,EAAK,QAAW,SAAWA,EAAK,OAAO,KAAK,EAAI,GACpE,GAAI,CAACC,GAAQA,IAAS,YAAa,OAAOR,EAAO,KAAM,OAAO,EAG9D,IAAMS,EAASD,EAAK,OAAS,KAAOA,EAAK,MAAM,EAAG,IAAI,EAAI,SAAMA,EAChE,OAAOR,EAAOS,EAAQ,IAAI,CAC5B,MAAE,CACA,OAAOT,EAAO,KAAM,aAAa,CACnC,CACF,CACF,EACM,GAAG,QAAS,IAAMA,EAAO,KAAM,aAAa,CAAC,CACrD,CAAC,CACH","names":["execFile","MEMO_TIMEOUT_MS","MEMO_MODEL","MEMO_PROMPT","extractRotationMemo","agent","resumeSessionId","start","args","env","claudeBillingEnv","buildAgentEnv","resolve","settled","finish","memo","reason","execFile","err","stdout","_stderr","data","text","capped"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=routing-
|
|
1
|
+
import{a,b}from"./chunk-W3YGESNK.js";import"./chunk-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-2DMVKLLE.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{a as cheapModelForEngine,b as routeTaskModel};
|
|
2
|
+
//# sourceMappingURL=routing-OSPRKRAY.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{g as a,h as b}from"./chunk-A4YR3PQY.js";import"./chunk-JWKIFAXA.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-L2WSPY6S.js";import"./chunk-2DMVKLLE.js";import"./chunk-FIOB3MEX.js";export{b as CronScheduler,a as getNextCronDate};
|
|
2
|
+
//# sourceMappingURL=scheduler-JL6K5HHI.js.map
|
|
@@ -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-
|
|
2
|
-
//# sourceMappingURL=seat-
|
|
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-2DBGOCCW.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-2DMVKLLE.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-2MHKVMW2.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{v as S,w}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=select-
|
|
1
|
+
import{v as S,w}from"./chunk-2DBGOCCW.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-2DMVKLLE.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-7LCHJVPK.js.map
|