forge-openclaw-plugin 0.2.59 → 0.2.60
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/assets/{board-BAxNp060.js → board-B1V3M__K.js} +1 -2
- package/dist/assets/index-BwKAPo98.css +1 -0
- package/dist/assets/{index-NZwTuYPs.js → index-Dy7c-dRY.js} +50 -51
- package/dist/assets/knowledge-graph-layout.worker-DRvzPxhP.js +0 -1
- package/dist/assets/{motion-B9BeeSmV.js → motion-CltSTItx.js} +1 -2
- package/dist/assets/{table-kY1tUKX5.js → table-B-VrSFx8.js} +1 -2
- package/dist/assets/{ui-FaWfAb5Q.js → ui-DUqM4jkt.js} +1 -2
- package/dist/assets/{vendor-CUxVKN94.js → vendor-C0otBhgu.js} +1 -2
- package/dist/gamification-previews/dark-fantasy-mascot.webp +0 -0
- package/dist/gamification-previews/dramatic-smithie-mascot.webp +0 -0
- package/dist/gamification-previews/mind-locksmith-mascot.webp +0 -0
- package/dist/index.html +7 -7
- package/dist/server/server/migrations/058_gamification_theme_preference.sql +1 -1
- package/dist/server/server/src/app.js +27 -0
- package/dist/server/server/src/repositories/settings.js +1 -1
- package/dist/server/server/src/services/gamification-assets.js +231 -0
- package/dist/server/server/src/types.js +1 -1
- package/dist/server/server/src/web.js +7 -104
- package/dist/server/src/lib/api.js +9 -0
- package/dist/server/src/lib/schemas.js +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/server/migrations/058_gamification_theme_preference.sql +1 -1
- package/dist/assets/board-BAxNp060.js.map +0 -1
- package/dist/assets/index-B5Yt4i07.css +0 -1
- package/dist/assets/index-NZwTuYPs.js.map +0 -1
- package/dist/assets/knowledge-graph-layout.worker-DRvzPxhP.js.map +0 -1
- package/dist/assets/motion-B9BeeSmV.js.map +0 -1
- package/dist/assets/table-kY1tUKX5.js.map +0 -1
- package/dist/assets/ui-FaWfAb5Q.js.map +0 -1
- package/dist/assets/vendor-CUxVKN94.js.map +0 -1
- package/dist/gamification/sprites.zip +0 -0
|
@@ -1,2 +1 @@
|
|
|
1
1
|
(function(){"use strict";const E=[1,.65,.35,.18,.08],$=6,Y=600,P=900,j=.001,J=.52,Z=6,q=5,G=.92,oo=5,so=.15,to=2.4,no=2,eo=.8,io=3,p={focusRepulsion:2.25,focusDiffusion:1.95,focusSpringReductionMax:.34,focusSpringReductionDiffusion:1.85,edgeSpringStrength:1,gravityStrength:1,focusShellSpacing:1};function x(o,s,t){return Math.min(Math.max(o,s),t)}function D(o){return{focusRepulsion:x((o==null?void 0:o.focusRepulsion)??p.focusRepulsion,.6,Z),focusDiffusion:x((o==null?void 0:o.focusDiffusion)??p.focusDiffusion,.6,q),focusSpringReductionMax:x((o==null?void 0:o.focusSpringReductionMax)??p.focusSpringReductionMax,0,G),focusSpringReductionDiffusion:x((o==null?void 0:o.focusSpringReductionDiffusion)??p.focusSpringReductionDiffusion,.6,oo),edgeSpringStrength:x((o==null?void 0:o.edgeSpringStrength)??p.edgeSpringStrength,so,to),gravityStrength:x((o==null?void 0:o.gravityStrength)??p.gravityStrength,0,no),focusShellSpacing:x((o==null?void 0:o.focusShellSpacing)??p.focusShellSpacing,eo,io)}}function ao(o){return Math.round(Y+o.focusDiffusion*420)}function fo(o){return Math.round(P+o.focusDiffusion*620)}function co(o){return x(J+(o.focusDiffusion-1)*.16,.28,.72)}function L(o,s=1){if(o<0)return 0;if(o>=E.length){const e=E[E.length-1]??0;return o===0?1:Math.pow(e,1/Math.max(s,.1))}const t=E[o]??0;return o===0?t:Math.pow(t,1/Math.max(s,.1))}function ho({hopLevel:o,maxReduction:s,diffusion:t}){return o<0||s<=0?0:x(s*L(o,t),0,G)}function w({sources:o,nodeIndexById:s,focusNodeId:t,hopLevels:e,nowMs:f,maxSources:c=$}){const i=o.map(a=>({...a,targetStrength:0}));if(t){const a=s.get(t);if(a!==void 0){const d=i.findIndex(l=>l.nodeId===t),h=new Int16Array(e.map(l=>Math.max(-1,Math.trunc(l))));if(d>=0){const l=i.splice(d,1)[0];i.unshift({...l,index:a,targetStrength:1,enteredAt:f,lastUpdatedAt:f,hopLevels:h})}else i.unshift({nodeId:t,index:a,strength:0,targetStrength:1,enteredAt:f,lastUpdatedAt:f,hopLevels:h})}}return i.slice(0,c)}function lo({sources:o,nowMs:s,enterDurationMs:t=Y,exitDurationMs:e=P,removalEpsilon:f=j}){return o.map(i=>{const a=Math.max(0,s-i.lastUpdatedAt),d=i.targetStrength>i.strength?t:e,h=d<=0?1:a/d,l=i.targetStrength>i.strength?Math.min(i.targetStrength,i.strength+h):Math.max(i.targetStrength,i.strength-h);return{...i,strength:x(l,0,1),lastUpdatedAt:s}}).filter(i=>i.targetStrength>0||i.strength>f)}function T({nodeCount:o,sources:s,settings:t=p}){const e=new Float32Array(o),f=co(t);return s.forEach((c,i)=>{const a=i===0?c.strength:c.strength*f;if(!(a<=0))for(let d=0;d<o;d+=1){const h=L(c.hopLevels[d]??-1,t.focusDiffusion);h<=0||(e[d]=x(e[d]+h*a,0,1.25))}}),e}function xo(o){return o.map(s=>({nodeId:s.nodeId,strength:Number(s.strength.toFixed(4)),targetStrength:s.targetStrength,state:s.targetStrength>s.strength?"entering":s.targetStrength<s.strength?"exiting":"active"}))}function O({x:o,y:s,mass:t}){let e=0,f=0,c=0;for(let i=0;i<o.length;i+=1){const a=(t==null?void 0:t[i])??1;e+=a,f+=o[i]*a,c+=s[i]*a}return e<=0?{x:0,y:0}:{x:f/e,y:c/e}}const go=.55,y=1/120,U=3,po=8,uo=34,yo=.35,H=10,Io=1,So=12,ro=.16,mo=1.4,Ao=1.15,_o=5.6,Mo=3.8;let n=null,v=null;function N(){v!==null&&(clearTimeout(v),v=null)}function C(){N(),v=self.setTimeout(Uo,16)}function Eo(o,s,t){return Math.min(Math.max(o,s),t)}function vo(o){let s=(o+1)*2654435761;return s^=s>>>16,s=Math.imul(s,2246822519),s^=s>>>13,s=Math.imul(s,3266489917),s^=s>>>16,s>>>0}function To({x:o,y:s,vx:t,vy:e,targetX:f,targetY:c,stiffness:i,damping:a}){return{fx:-i*(o-f)-a*t,fy:-i*(s-c)-a*e}}function M(o,s,t,e){return{minX:o,minY:s,maxX:t,maxY:e,mass:0,massX:0,massY:0,point:-1,children:null}}function K(o,s,t){const e=(o.minX+o.maxX)/2,f=(o.minY+o.maxY)/2,c=s>=e?1:0;return(t>=f?1:0)*2+c}function No(o){if(o.children)return o.children;const s=(o.minX+o.maxX)/2,t=(o.minY+o.maxY)/2;return o.children=[M(o.minX,o.minY,s,t),M(s,o.minY,o.maxX,t),M(o.minX,t,s,o.maxY),M(s,t,o.maxX,o.maxY)],o.children}function F(o,s,t){const e=o.x[t],f=o.y[t];if(s.point===-1&&!s.children){s.point=t;return}const c=No(s);if(s.point!==-1){const a=s.point;s.point=-1;const d=K(s,o.x[a],o.y[a]);F(o,c[d],a)}const i=K(s,e,f);F(o,c[i],t)}function W(o,s){if(!s.children){if(s.point===-1)return s.mass=0,s.massX=0,s.massY=0,{mass:0,x:0,y:0};const c=s.point,i=o.mass[c]*(1+o.focusPressure[c]*o.physics.focusRepulsion*.35),a=o.x[c],d=o.y[c];return s.mass=i,s.massX=a,s.massY=d,{mass:i,x:a,y:d}}let t=0,e=0,f=0;for(const c of s.children){if(!c)continue;const i=W(o,c);t+=i.mass,e+=i.x*i.mass,f+=i.y*i.mass}return s.mass=t,s.massX=t>0?e/t:0,s.massY=t>0?f/t:0,{mass:t,x:s.massX,y:s.massY}}function Fo(o){let s=Number.POSITIVE_INFINITY,t=Number.NEGATIVE_INFINITY,e=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY;for(let d=0;d<o.x.length;d+=1)s=Math.min(s,o.x[d]),t=Math.max(t,o.x[d]),e=Math.min(e,o.y[d]),f=Math.max(f,o.y[d]);const i=Math.max(t-s,f-e,1)*.1+1,a=M(s-i,e-i,t+i,f+i);for(let d=0;d<o.x.length;d+=1)F(o,a,d);return W(o,a),a}function b(o,s,t){if(s.mass===0||!s.children&&s.point===t)return;const e=o.x[t]-s.massX,f=o.y[t]-s.massY,c=e*e+f*f+.01,i=Math.sqrt(c),a=Math.max(s.maxX-s.minX,s.maxY-s.minY);if(!s.children||a/i<go){const d=1+o.focusPressure[t]*o.physics.focusRepulsion,h=uo*d*o.mass[t]*s.mass/c;o.fx[t]+=e/i*h,o.fy[t]+=f/i*h;return}for(const d of s.children)d&&b(o,d,t)}function Ro(o){const s=o.focusSources[0],t=(s==null?void 0:s.strength)??0,e=s==null?void 0:s.hopLevels;for(let f=0;f<o.edgeSource.length;f+=1){const c=o.edgeSource[f],i=o.edgeTarget[f],a=o.x[i]-o.x[c],d=o.y[i]-o.y[c],h=Math.max(1e-4,Math.hypot(a,d)),l=a/h,g=d/h,A=(o.vx[c]-o.vx[i])*l+(o.vy[c]-o.vy[i])*g,S=(o.focusPressure[c]+o.focusPressure[i])*.5,u=(e==null?void 0:e[c])??-1,I=(e==null?void 0:e[i])??-1,_=u<0?I:I<0?u:Math.min(u,I),r=o.edgeRestLength0[f]*(1+S*(yo+(o.physics.focusRepulsion-1)*.16)),m=h-r,Vo=t>0?ho({hopLevel:_,maxReduction:o.physics.focusSpringReductionMax*t,diffusion:o.physics.focusSpringReductionDiffusion}):0,zo=po*o.physics.edgeSpringStrength*(1-Vo)*o.edgeWeight[f]*m,Qo=-1.4*A,V=zo+Qo,z=l*V,Q=g*V;o.fx[c]+=z,o.fy[c]+=Q,o.fx[i]-=z,o.fy[i]-=Q}}function Xo(o){for(let s=0;s<o.x.length;s+=1)o.fx[s]+=-.18*o.physics.gravityStrength*o.mass[s]*o.x[s],o.fy[s]+=-.18*o.physics.gravityStrength*o.mass[s]*o.y[s]}function Yo(o){const s=O({x:o.x,y:o.y,mass:o.mass});for(let t=0;t<o.x.length;t+=1)o.fx[t]+=-.09*o.physics.gravityStrength*o.mass[t]*s.x,o.fy[t]+=-.09*o.physics.gravityStrength*o.mass[t]*s.y}function Po(o){o.dragIndex>=0&&(o.fx[o.dragIndex]=0,o.fy[o.dragIndex]=0)}function Go(o,s){const t=o.focusSources[0];if(o.focusIndex<0||!t||s<=0)return;const e=o.x[o.focusIndex],f=o.y[o.focusIndex],c=t.hopLevels;for(let i=0;i<o.x.length;i+=1){if(i===o.focusIndex)continue;const a=c[i]??-1;if(a<1)continue;let d=o.x[i]-e,h=o.y[i]-f,l=Math.hypot(d,h);if(l<.001){const m=vo(i)%4096/4096*Math.PI*2;d=Math.cos(m),h=Math.sin(m),l=1}const g=d/l,A=h/l,S=mo*o.physics.focusShellSpacing+(Math.min(a,6)-1)*(Ao*o.physics.focusShellSpacing*(.92+o.physics.focusDiffusion*.24))+o.focusPressure[i]*(.42+o.physics.focusRepulsion*.12),u=e+g*S,I=f+A*S,_=_o*(.92+o.physics.focusDiffusion*.18)/Math.max(1,a)*s,r=To({x:o.x[i],y:o.y[i],vx:o.vx[i],vy:o.vy[i],targetX:u,targetY:I,stiffness:_,damping:Mo});o.fx[i]+=r.fx,o.fy[i]+=r.fy}}function Do(o){const s=new Map,t=1.2;for(let e=0;e<o.x.length;e+=1){const f=Math.floor(o.x[e]/t),c=Math.floor(o.y[e]/t),i=`${f}:${c}`,a=s.get(i)??[];a.push(e),s.set(i,a)}for(const[e,f]of s){const[c,i]=e.split(":").map(Number);for(let a=-1;a<=1;a+=1)for(let d=-1;d<=1;d+=1){const h=s.get(`${c+a}:${i+d}`);if(h)for(const l of f)for(const g of h){if(l>=g)continue;const A=o.x[g]-o.x[l],S=o.y[g]-o.y[l],u=Math.max(.001,Math.hypot(A,S)),I=o.radius[l]+o.radius[g]+ro;if(u>=I)continue;const _=(I-u)/u*.18,r=A*_,m=S*_;o.fx[l]-=r,o.fy[l]-=m,o.fx[g]+=r,o.fy[g]+=m}}}}function Lo(o){const s=Math.exp(-7.2*y);for(let t=0;t<o.x.length;t+=1){if(t===o.dragIndex){o.x[t]=o.dragTargetX,o.y[t]=o.dragTargetY,o.vx[t]=0,o.vy[t]=0;continue}o.vx[t]=(o.vx[t]+o.fx[t]/o.mass[t]*y)*s,o.vy[t]=(o.vy[t]+o.fy[t]/o.mass[t]*y)*s;const e=Math.hypot(o.vx[t],o.vy[t]);if(e>H){const f=H/e;o.vx[t]*=f,o.vy[t]*=f}o.x[t]+=o.vx[t]*y,o.y[t]+=o.vy[t]*y}o.focusIndex>=0&&o.dragIndex!==o.focusIndex&&(o.x[o.focusIndex]=o.focusAnchorX,o.y[o.focusIndex]=o.focusAnchorY,o.vx[o.focusIndex]=0,o.vy[o.focusIndex]=0)}function k(o){o.dragIndex<0||(o.x[o.dragIndex]=o.dragTargetX,o.y[o.dragIndex]=o.dragTargetY,o.vx[o.dragIndex]=0,o.vy[o.dragIndex]=0,o.fx[o.dragIndex]=0,o.fy[o.dragIndex]=0,o.focusIndex===o.dragIndex&&(o.focusAnchorX=o.dragTargetX,o.focusAnchorY=o.dragTargetY))}function wo(o,s){var t;if(o.dragIndex>=0){o.phase="dragging";return}if(o.focusIndex>=0||o.focusSources.length>0){const e=((t=o.focusSources[0])==null?void 0:t.strength)??0;if(o.focusIndex>=0&&e<.999){o.phase="focus-enter";return}if(o.focusIndex>=0){o.phase="focused";return}o.phase="focus-exit";return}o.phase="global"}function Oo(o,s){var e;k(o),o.focusSources=lo({sources:o.focusSources,nowMs:s,enterDurationMs:ao(o.physics),exitDurationMs:fo(o.physics)}),o.focusPressure=T({nodeCount:o.x.length,sources:o.focusSources,settings:o.physics}),o.fx.fill(0),o.fy.fill(0);const t=Fo(o);for(let f=0;f<o.x.length;f+=1)b(o,t,f);Ro(o),Xo(o),Yo(o),Po(o),Go(o,((e=o.focusSources[0])==null?void 0:e.strength)??0),Do(o),k(o),Lo(o),wo(o),o.tick+=1}function R(o){const s=o.x.slice(),t=o.y.slice(),e={type:"positions",x:s,y:t,tick:o.tick};self.postMessage(e)}function X(o){const s={type:"stats",tick:o.tick,phase:o.phase,primaryFocusedNodeId:o.focusIndex>=0?o.nodeIds[o.focusIndex]??null:null,focusSources:xo(o.focusSources),focusPressure:o.focusPressure.slice(),centroid:O({x:o.x,y:o.y,mass:o.mass})};self.postMessage(s)}function Uo(){if(!n){N();return}const o=performance.now(),s=Eo((o-n.lastFrameTimeMs)/1e3,0,y*U);n.lastFrameTimeMs=o,n.accumulatorSeconds+=s;let t=0;for(;n.accumulatorSeconds>=y&&t<U;)Oo(n,o),n.accumulatorSeconds-=y,t+=1;t>0&&n.tick%Io===0&&R(n),t>0&&n.tick%So===0&&X(n),C()}function Ho(o,s){const t=new Uint32Array(s);for(const a of o)t[a.source]+=1,t[a.target]+=1;const e=new Uint32Array(s+1);for(let a=0;a<s;a+=1)e[a+1]=e[a]+t[a];const f=new Uint32Array(e[s]),c=new Float32Array(e[s]),i=new Uint32Array(e);for(const a of o){let d=i[a.source];f[d]=a.target,c[d]=a.weight,i[a.source]+=1,d=i[a.target],f[d]=a.source,c[d]=a.weight,i[a.target]+=1}return{rowPtr:e,colIdx:f,colWeight:c}}function Co(o){const s=o.nodes.map(e=>e.id),t=Ho(o.edges,o.nodes.length);n={nodeIds:s,nodeIndexById:new Map(s.map((e,f)=>[e,f])),x:new Float32Array(o.nodes.map(e=>e.x)),y:new Float32Array(o.nodes.map(e=>e.y)),vx:new Float32Array(o.nodes.length),vy:new Float32Array(o.nodes.length),fx:new Float32Array(o.nodes.length),fy:new Float32Array(o.nodes.length),mass:new Float32Array(o.nodes.map(e=>Math.max(1,e.mass))),radius:new Float32Array(o.nodes.map(e=>Math.max(.35,e.size*.12))),importance:new Float32Array(o.nodes.map(e=>e.importance)),focusPressure:new Float32Array(o.nodes.length),rowPtr:t.rowPtr,colIdx:t.colIdx,colWeight:t.colWeight,edgeSource:new Uint32Array(o.edges.map(e=>e.source)),edgeTarget:new Uint32Array(o.edges.map(e=>e.target)),edgeWeight:new Float32Array(o.edges.map(e=>e.weight)),edgeRestLength0:new Float32Array(o.edges.map(e=>{const f=Math.max(.35,o.nodes[e.source].size*.12),c=Math.max(.35,o.nodes[e.target].size*.12);return .8+f+c})),physics:D(o.physics??p),focusIndex:o.focusNodeId?s.findIndex(e=>e===o.focusNodeId):-1,focusAnchorX:0,focusAnchorY:0,focusSources:[],dragIndex:-1,dragTargetX:0,dragTargetY:0,phase:o.focusNodeId?"focus-enter":"global",tick:0,accumulatorSeconds:0,lastFrameTimeMs:performance.now()},n.focusIndex>=0&&(n.focusAnchorX=n.x[n.focusIndex],n.focusAnchorY=n.y[n.focusIndex],n.vx[n.focusIndex]=0,n.vy[n.focusIndex]=0),n.focusSources=w({sources:[],nodeIndexById:n.nodeIndexById,focusNodeId:o.focusNodeId,hopLevels:o.hopLevels,nowMs:performance.now()}),n.focusPressure=T({nodeCount:n.x.length,sources:n.focusSources,settings:n.physics}),R(n),X(n),C()}function Ko(o){n&&(n.focusIndex=o.focusNodeId?n.nodeIndexById.get(o.focusNodeId)??-1:-1,n.focusSources=w({sources:n.focusSources,nodeIndexById:n.nodeIndexById,focusNodeId:o.focusNodeId,hopLevels:o.hopLevels,nowMs:performance.now()}),n.focusIndex>=0?(n.focusAnchorX=n.x[n.focusIndex],n.focusAnchorY=n.y[n.focusIndex],n.vx[n.focusIndex]=0,n.vy[n.focusIndex]=0,n.phase="focus-enter"):n.phase="focus-exit")}function Wo(o){n&&(n.physics=D(o.physics),n.focusPressure=T({nodeCount:n.x.length,sources:n.focusSources,settings:n.physics}))}function bo(o){if(!n)return;const s=n.nodeIndexById.get(o.nodeId);s!==void 0&&(n.dragIndex=s,n.dragTargetX=n.x[s],n.dragTargetY=n.y[s],n.x[s]=n.dragTargetX,n.y[s]=n.dragTargetY,n.vx[s]=0,n.vy[s]=0,n.phase="dragging")}function B(o){if(!n)return;const s=n.nodeIndexById.get(o.nodeId);s!==void 0&&(n.dragTargetX=o.x,n.dragTargetY=o.y,n.x[s]=o.x,n.y[s]=o.y,n.vx[s]=0,n.vy[s]=0,o.type==="nudge-node"&&(n.fx[s]=0,n.fy[s]=0),s===n.focusIndex&&(n.focusAnchorX=o.x,n.focusAnchorY=o.y))}function ko(o){if(!n)return;const s=n.nodeIndexById.get(o.nodeId);s===void 0||n.dragIndex!==s||(n.dragIndex=-1,n.phase=n.focusIndex>=0?"focus-enter":"global")}function Bo(o){if(n&&!(o.offsetX===0&&o.offsetY===0)){for(let s=0;s<n.x.length;s+=1)n.x[s]-=o.offsetX,n.y[s]-=o.offsetY;n.dragIndex>=0&&(n.dragTargetX-=o.offsetX,n.dragTargetY-=o.offsetY),n.focusIndex>=0&&(n.focusAnchorX-=o.offsetX,n.focusAnchorY-=o.offsetY),R(n),X(n)}}self.onmessage=o=>{const s=o.data;switch(s.type){case"init-graph":Co(s);return;case"set-focus":Ko(s);return;case"update-physics":Wo(s);return;case"drag-start":bo(s);return;case"drag-move":B(s);return;case"nudge-node":B(s);return;case"recenter-graph":Bo(s);return;case"drag-end":ko(s);return;case"dispose":N(),n=null;return}}})();
|
|
2
|
-
//# sourceMappingURL=knowledge-graph-layout.worker-DRvzPxhP.js.map
|