@tea-agent/loop-agent 0.52.0-next.11 → 0.52.0-next.12
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/CHANGELOG.md +1 -1
- package/dist/build-stamp.json +3 -3
- package/dist/shared/pi-context-pressure/compaction-policy.js +14 -1
- package/dist/worker/console/chat/compaction-errors.js +14 -0
- package/dist/worker/console/chat/pi-runtime.js +13 -0
- package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-CT26sIgH.js → abnfDiagram-N423BO3Z-CR1jj_rz.js} +1 -1
- package/dist/worker/console/static/assets/{arc-CPwLqDB0.js → arc-CjxcQfEu.js} +1 -1
- package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-CzTSMPU_.js → architectureDiagram-T3A2C74G-D-3u2qFL.js} +1 -1
- package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-BfgbtJLH.js → blockDiagram-VBNYF7ZC-Bdr7gWVo.js} +1 -1
- package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-B9pTjB8U.js → c4Diagram-5PPSVZJV-hQHNe5T3.js} +1 -1
- package/dist/worker/console/static/assets/channel-CBlJfald.js +1 -0
- package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-xORV8QsC.js → chunk-2GRJ4B5K-BEg_su6q.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-BzpYWAHK.js → chunk-2Q5K7J3B-DZnV6VTC.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5RXB4S5H-D8zcRP6c.js → chunk-5RXB4S5H-Dg0LzAqO.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5VM5RSS4-DVEXxzQJ.js → chunk-5VM5RSS4-D2vqr52W.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-CKZOJU2z.js → chunk-6Q2QTUOP-D8We_g6R.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-GF5L2VYU-Cgx34Dj8.js → chunk-GF5L2VYU-DbEU8drD.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-JWPE2WC7-ehcSKOcx.js → chunk-JWPE2WC7-Boi8TJYN.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-KBJHAD2P-CiY9emCG.js → chunk-KBJHAD2P-CjJmKa9f.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-RYQCIY6F-Bk9X-ksQ.js → chunk-RYQCIY6F-C-KV-ag7.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-XXDRQBXY-DC0xXfHy.js → chunk-XXDRQBXY-DZlTonsZ.js} +1 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-mNUYCdDo.js +1 -0
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-mNUYCdDo.js +1 -0
- package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-C_EVg5l9.js → cose-bilkent-JH36ORCC-BIvFe3yn.js} +1 -1
- package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-DjtUYOlE.js → cynefinDiagram-MW4NZA55-BOBPfv8u.js} +1 -1
- package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-D2aN2V9t.js → dagre-VZM6K2ZE-BF54orLO.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-7IWD3JNH-D_twhmFi.js → diagram-7IWD3JNH-CxjAP2AP.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-ChzncqLV.js → diagram-B4RE2ZJO-BXYkuNGt.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-LBJQPF4R-B6LO-bF2.js → diagram-LBJQPF4R-DQTu-2Iy.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-Q27KOJAE-GrzM7AFc.js → diagram-Q27KOJAE-DNURuIYc.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-UB23O5K3-Bv-lntaq.js → diagram-UB23O5K3-D69uANY8.js} +1 -1
- package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-BvD2jkO_.js → ebnfDiagram-BXEA7PRR-C658EcrV.js} +1 -1
- package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-BirPCcmA.js → erDiagram-JOGREHBK-BRccYtAl.js} +1 -1
- package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-Chu1YnGQ.js → flowDiagram-UKHOOZJN-DnIR4sLs.js} +1 -1
- package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-Djn17xhB.js → ganttDiagram-PKOTCBZU-Bo3eWFVC.js} +1 -1
- package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-Bx1qbGHx.js → gitGraphDiagram-DS77QQ5N-EyWDCNU_.js} +1 -1
- package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-D-TLMqmb.js → infoDiagram-6WML65LV-B0Eld9u0.js} +1 -1
- package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-DbJoh-6T.js → ishikawaDiagram-WSZJBQD7-DsJQiJ27.js} +1 -1
- package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-DsyokZ6e.js → journeyDiagram-NVQOT4AX-fpE0yqjC.js} +1 -1
- package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-DlzXTxic.js → kanban-definition-27J2QSJJ-Dq9IrDdT.js} +1 -1
- package/dist/worker/console/static/assets/{linear-ClnZn3vw.js → linear-CFV4BDyf.js} +1 -1
- package/dist/worker/console/static/assets/{main-fc3P1HID.js → main-Dwhb3ZRq.js} +4 -4
- package/dist/worker/console/static/assets/{mermaid.core-DqSlcvbf.js → mermaid.core-BMMXqtrB.js} +4 -4
- package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-CSFbzpiX.js → mindmap-definition-FAOFIHXS-DurrK_Gi.js} +1 -1
- package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-DK80yQqe.js → pegDiagram-VL7TDLO6-CzZayNy2.js} +1 -1
- package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-DWX7SFGb.js → pieDiagram-7S7Q4E2Y-B1W7Y0cE.js} +1 -1
- package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-BEPPhtXs.js → quadrantDiagram-CIZ2JOQS-BdbL83CU.js} +1 -1
- package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-Ck_s6fQn.js → railroadDiagram-AXF67PYL-W-bQpd18.js} +1 -1
- package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-CYig27Rj.js → requirementDiagram-LRYGKXZP-C9bi4tQJ.js} +1 -1
- package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-u-0aSx5s.js → sankeyDiagram-W5VNT64P-D4kO56Wd.js} +1 -1
- package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-NsEJI9sM.js → sequenceDiagram-SI44F4Z6-CIbesK1e.js} +1 -1
- package/dist/worker/console/static/assets/{sheet-workbook-kZ_HK4Sg.js → sheet-workbook-kFN3yUBr.js} +1 -1
- package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-8vneVM5U.js → sizeCapture-X5ZJPWSS-Dk4XAK7C.js} +1 -1
- package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-CMIobUBh.js → stateDiagram-OKZ733FA-Bz9B6UZ7.js} +1 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-BBRlxIq8.js +1 -0
- package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-D4Qzt6ug.js → swimlanes-SLNWSIFB-qLEds93n.js} +2 -2
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-CRBvOMCQ.js +8 -0
- package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-DMb1LpED.js → timeline-definition-Z64GVDOM-C9rVFC0h.js} +1 -1
- package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-C_9eFOs3.js → vennDiagram-T6HMQDX7-CoKJ9hU0.js} +1 -1
- package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-DJYMe3uT.js → wardleyDiagram-T6FBY63Y-tHz_S7-L.js} +1 -1
- package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-Cv_1Mi3u.js → xychartDiagram-ELKLHX3M-DKzKYnvG.js} +1 -1
- package/dist/worker/console/static/index.html +1 -1
- package/package.json +3 -3
- package/dist/worker/console/static/assets/channel-DtYRMDck.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-DyesHbs5.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-DyesHbs5.js +0 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-Bd0pHHKP.js +0 -1
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-BzmSZnl_.js +0 -8
package/CHANGELOG.md
CHANGED
package/dist/build-stamp.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"version": "0.52.0-next.
|
|
4
|
-
"gitSha": "
|
|
5
|
-
"builtAt": "2026-10-
|
|
3
|
+
"version": "0.52.0-next.12",
|
|
4
|
+
"gitSha": "8d2a6f2731a594791b1fc4a83c4cfff2bb38cc52",
|
|
5
|
+
"builtAt": "2026-10-25T13:28:29.967Z"
|
|
6
6
|
}
|
|
@@ -17,7 +17,20 @@ export const PI_DEFAULT_RESERVE_TOKENS = 16_384;
|
|
|
17
17
|
export const DEFAULT_RESERVED_COMPLETION_TOKENS = 8_192;
|
|
18
18
|
/** DSH defaults, adopted verbatim. See `compaction-basic/src/config.ts`. */
|
|
19
19
|
export const DEFAULT_THRESHOLD_RATIO = 0.8;
|
|
20
|
-
|
|
20
|
+
/*
|
|
21
|
+
* 20,000 instead of DSH's 65,536.
|
|
22
|
+
*
|
|
23
|
+
* DSH's value is an absolute distance from the top, chosen for its large
|
|
24
|
+
* windows. On a 150k window it costs 43.7% of the budget, so the `min()` term
|
|
25
|
+
* that actually decides the trigger is the headroom, not `thresholdRatio`:
|
|
26
|
+
* the line landed on 50.8% and the configured 80% never applied. At 20,000 the
|
|
27
|
+
* ratio term wins again (trigger = 120,000 = 80.0%), which is what the ratio
|
|
28
|
+
* field promises.
|
|
29
|
+
*
|
|
30
|
+
* Still an absolute value on purpose: a deployment whose gateway rejects below
|
|
31
|
+
* the declared window raises this to pull the trigger under the real ceiling.
|
|
32
|
+
*/
|
|
33
|
+
export const DEFAULT_HEADROOM_TOKENS = 20_000;
|
|
21
34
|
export const DEFAULT_RETAIN_RATIO = 0.16;
|
|
22
35
|
export function parseCompactionPolicy(env = process.env) {
|
|
23
36
|
const diagnostics = [];
|
|
@@ -12,6 +12,20 @@ export function classifyChatCompactionFailure(error) {
|
|
|
12
12
|
raw,
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
+
if (raw === "COMPACTION_IN_PROGRESS") {
|
|
16
|
+
/*
|
|
17
|
+
* Distinct from a busy turn: a compaction is already running, and
|
|
18
|
+
* starting another would abort the one in flight (Pi's `compact()`
|
|
19
|
+
* begins with `await abort()`), which surfaces as 「上下文压缩已取消」
|
|
20
|
+
* for a compaction the reader never cancelled.
|
|
21
|
+
*/
|
|
22
|
+
return {
|
|
23
|
+
status: 409,
|
|
24
|
+
code: "COMPACTION_IN_PROGRESS",
|
|
25
|
+
message: "上下文正在压缩中,请等待本次压缩完成。",
|
|
26
|
+
raw,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
15
29
|
if (raw === "COMPACTION_UNSUPPORTED") {
|
|
16
30
|
return {
|
|
17
31
|
status: 501,
|
|
@@ -3619,6 +3619,19 @@ export class ConsolePiRuntime {
|
|
|
3619
3619
|
const session = this.sessions.get(sessionId);
|
|
3620
3620
|
if (!session)
|
|
3621
3621
|
throw new Error(`chat session not found: ${sessionId}`);
|
|
3622
|
+
/*
|
|
3623
|
+
* `isIdle` is false while compaction is running too, so this already
|
|
3624
|
+
* refuses a manual request that would collide with one.
|
|
3625
|
+
*
|
|
3626
|
+
* The reason it matters: Pi's `compact()` begins with `await abort()`,
|
|
3627
|
+
* which calls `abortCompaction()` and kills any automatic compaction
|
|
3628
|
+
* already in flight. The victim then throws "Compaction cancelled", and
|
|
3629
|
+
* the reader sees 「上下文压缩已取消」 for a compaction they never
|
|
3630
|
+
* started or cancelled. Refusing up front keeps the running one alive.
|
|
3631
|
+
*/
|
|
3632
|
+
if (session.isCompacting === true) {
|
|
3633
|
+
throw new Error("COMPACTION_IN_PROGRESS");
|
|
3634
|
+
}
|
|
3622
3635
|
if (session.isStreaming === true || session.isIdle === false)
|
|
3623
3636
|
throw new Error("CHAT_TURN_ACTIVE");
|
|
3624
3637
|
if (typeof session.compact !== "function")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,r as u,d as a}from"./chunk-6Q2QTUOP-
|
|
1
|
+
import{g as p,r as u,d as a}from"./chunk-6Q2QTUOP-D8We_g6R.js";import{p as f}from"./chunk-JWPE2WC7-Boi8TJYN.js";import{_ as n,l as o}from"./mermaid.core-BMMXqtrB.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-BIFL8KrA.js";import"./FilePreviewDocx-ybM3ZqSl.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as ln,$ as an,a0 as F,a1 as q,a2 as j,a3 as un,a4 as y,a5 as tn,a6 as J,a7 as _,a8 as rn,a9 as o,aa as on,ab as sn,ac as fn}from"./mermaid.core-
|
|
1
|
+
import{Y as ln,$ as an,a0 as F,a1 as q,a2 as j,a3 as un,a4 as y,a5 as tn,a6 as J,a7 as _,a8 as rn,a9 as o,aa as on,ab as sn,ac as fn}from"./mermaid.core-BMMXqtrB.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,z,a){var O=I-l,i=D-h,n=z-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function U(l,h,I,D,v,A,z){var a=l-I,O=h-D,i=(z?A:-A)/J(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,B=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*J(on(0,T*T*R-P*P)),Y=(P*g-m*S)/R,$=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=Y-B,e=$-t,r=w-B,C=p-t;return x*x+e*e>r*r+C*C&&(Y=w,$=p),{cx:Y,cy:$,x01:-n,y01:-d,x11:Y*(v/T-1),y11:$*(v/T-1)}}function hn(){var l=cn,h=yn,I=j(0),D=null,v=gn,A=dn,z=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,B=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(B>tn-y)a.moveTo(s*F(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*F(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=B,S=B,Y=z.apply(this,arguments)/2,$=Y>y&&(D?+D.apply(this,arguments):J(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if($>y){var C=sn($/u*q(Y)),K=sn($/s*q(Y));(P-=C*2)>y?(C*=t?1:-1,R+=C,T-=C):(P=0,R=T=(f+c)/2),(S-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(S=0,m=g=(f+c)/2)}var G=s*F(m),H=s*q(m),L=u*F(T),M=u*q(T);if(w>y){var N=s*F(g),Q=s*q(g),V=u*F(R),W=u*q(R),E;if(B<an)if(E=pn(G,H,V,W,N,Q,L,M)){var X=G-E[0],Z=H-E[1],b=N-E[0],k=Q-E[1],nn=1/q(fn((X*b+Z*k)/(J(X*X+Z*Z)*J(b*b+k*k)))/2),en=J(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=U(V,W,G,H,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(G,H),a.arc(0,0,s,m,g,!t)):a.moveTo(G,H),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(G,H,V,W,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[F(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:j(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:j(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:j(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:j(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:j(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:j(+n),i):A},i.padAngle=function(n){return arguments.length?(z=typeof n=="function"?n:j(+n),i):z},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|