repoburg 1.3.228 → 1.3.231
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/agent-pane/backend/dist/index.js +212 -123
- package/agent-pane/backend/dist/server.js +212 -123
- package/backend/dist/src/application-state/application-state.service.js +2 -2
- package/backend/dist/src/seeding/data/sub-agents/general-purpose.d.ts +8 -0
- package/backend/dist/src/seeding/data/sub-agents/general-purpose.js +28 -0
- package/backend/dist/src/seeding/data/sub-agents/general-purpose.js.map +1 -0
- package/backend/dist/src/seeding/data/system-prompts/default_native_tool_agent.d.ts +1 -1
- package/backend/dist/src/seeding/data/system-prompts/default_native_tool_agent.js +1 -0
- package/backend/dist/src/seeding/data/system-prompts/default_native_tool_agent.js.map +1 -1
- package/backend/dist/src/seeding/data/system-prompts/general-purpose-agent.d.ts +4 -0
- package/backend/dist/src/seeding/data/system-prompts/general-purpose-agent.js +71 -0
- package/backend/dist/src/seeding/data/system-prompts/general-purpose-agent.js.map +1 -0
- package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/daemon/dist/recorder/collector.js +6 -3
- package/daemon/dist/recorder/recorder.spec.js +2 -0
- package/package.json +1 -2
- package/recorder/dist/recorder.js +1 -1
|
@@ -39,10 +39,13 @@ function validateSid(sid) {
|
|
|
39
39
|
}
|
|
40
40
|
return sid;
|
|
41
41
|
}
|
|
42
|
-
/** Validate a batch body:
|
|
42
|
+
/** Validate a batch body: a non-empty array of flat event objects with known
|
|
43
|
+
* types. Empty batches are rejected — probes/healthchecks must not create
|
|
44
|
+
* empty session files in the data directory. */
|
|
43
45
|
function validateEvents(events) {
|
|
44
|
-
if (!Array.isArray(events))
|
|
45
|
-
throw new Error('events must be
|
|
46
|
+
if (!Array.isArray(events) || events.length === 0) {
|
|
47
|
+
throw new Error('events must be a non-empty array');
|
|
48
|
+
}
|
|
46
49
|
for (const ev of events) {
|
|
47
50
|
if (typeof ev !== 'object' || ev === null)
|
|
48
51
|
throw new Error('event must be an object');
|
|
@@ -30,6 +30,8 @@ describe('collector', () => {
|
|
|
30
30
|
expect(() => (0, collector_1.validateEvents)('nope')).toThrow();
|
|
31
31
|
expect(() => (0, collector_1.validateEvents)([{ type: 'bogus' }])).toThrow();
|
|
32
32
|
expect(() => (0, collector_1.validateEvents)([null])).toThrow();
|
|
33
|
+
// Empty batches would create empty session files (healthcheck noise).
|
|
34
|
+
expect(() => (0, collector_1.validateEvents)([])).toThrow();
|
|
33
35
|
});
|
|
34
36
|
it('appends events as JSONL lines in order', () => {
|
|
35
37
|
const events = [
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{function
|
|
1
|
+
"use strict";(()=>{function v(t,r){return(e,o={})=>{let i={ts:Date.now(),t:Date.now()-t.t0,sid:t.sid,type:e,...o};try{r.push(i)}catch{}}}function k(t){if(!(t instanceof Element))return"";if(t.id)return`#${t.id}`;let r=t.tagName.toLowerCase(),e=t.classList.length?"."+Array.from(t.classList).slice(0,2).join("."):"";return r+e}function y(t){let r=e=>{t("click",{target:k(e.target)})};return document.addEventListener("click",r,!0),()=>document.removeEventListener("click",r,!0)}function g(t,r=500){let e=0,o=null,i=new MutationObserver(n=>{e+=n.length,o===null&&(o=setTimeout(()=>{o=null;let s=e;e=0,s>0&&t("dom_update",{count:s})},r))});try{i.observe(document.documentElement,{childList:!0,subtree:!0})}catch{}return()=>{o!==null&&clearTimeout(o),i.disconnect()}}function E(t){let r=o=>{t("error",{message:o.message})},e=o=>{t("error",{message:String(o.reason?.message??o.reason)})};return window.addEventListener("error",r),window.addEventListener("unhandledrejection",e),()=>{window.removeEventListener("error",r),window.removeEventListener("unhandledrejection",e)}}var U=0,w=()=>`r${++U}`,R=t=>t.includes("/recorder/events");function x(t){return typeof t=="string"?t:t instanceof URL?t.href:t.url}function _(t){let r=[],e=window.fetch.bind(window);window.fetch=(n,s)=>{let c=x(n);if(R(c))return e(n,s);let u=(s?.method??"GET").toUpperCase(),f=w(),l=Date.now();return t("request_start",{reqId:f,method:u,url:c}),e(n,s).then(d=>(t("request_end",{reqId:f,method:u,url:c,status:d.status,dur:Date.now()-l}),d),d=>{throw t("request_fail",{reqId:f,method:u,url:c,message:String(d?.message??d),dur:Date.now()-l}),d})},r.push(()=>{window.fetch=e});let o=XMLHttpRequest.prototype.open,i=XMLHttpRequest.prototype.send;return XMLHttpRequest.prototype.open=function(n,s,...c){return this.__recMethod=String(n).toUpperCase(),this.__recUrl=String(s),o.apply(this,[n,s,...c])},XMLHttpRequest.prototype.send=function(...n){if(R(this.__recUrl??""))return i.apply(this,n);let s=w(),c=this.__recMethod??"GET",u=this.__recUrl??"",f=Date.now();return t("request_start",{reqId:s,method:c,url:u}),this.addEventListener("loadend",()=>{let l=Date.now()-f;this.status===0||this.status>=400?t("request_fail",{reqId:s,method:c,url:u,status:this.status,dur:l}):t("request_end",{reqId:s,method:c,url:u,status:this.status,dur:l})}),i.apply(this,n)},r.push(()=>{XMLHttpRequest.prototype.open=o,XMLHttpRequest.prototype.send=i}),()=>r.forEach(n=>n())}function S(t){let r=[],e=(i,n,s)=>{try{let c=new PerformanceObserver(u=>{for(let f of u.getEntries())n(f)});c.observe({type:i,buffered:!0,...s}),r.push(c)}catch{}};e("longtask",i=>t("long_task",{dur:Math.round(i.duration)})),e("largest-contentful-paint",i=>t("lcp",{value:Math.round(i.startTime)}));let o=new Set;return e("event",i=>{let n=i;n.duration<50||!n.interactionId||o.has(n.interactionId)||(o.size>=1e3&&o.clear(),o.add(n.interactionId),t("inp",{value:Math.round(n.duration)}))},{durationThreshold:16}),e("layout-shift",i=>{let n=i;n.hadRecentInput||t("cls",{value:Math.round(n.value*1e3)/1e3})}),()=>r.forEach(i=>{try{i.disconnect()}catch{}})}function b(t){let r=()=>t("route_change",{route:location.pathname}),e=history.pushState.bind(history),o=history.replaceState.bind(history),i=(...c)=>{let u=e(...c);return r(),u},n=(...c)=>{let u=o(...c);return r(),u};history.pushState=i,history.replaceState=n;let s=()=>r();return window.addEventListener("popstate",s),()=>{history.pushState=e,history.replaceState=o,window.removeEventListener("popstate",s)}}function L(t,r=1e3){let e=0,o=null,i=()=>{e=Date.now(),t("scroll",{y:Math.round(window.scrollY)})},n=()=>{if(Date.now()-e<r){o===null&&(o=setTimeout(()=>{o=null,i()},r));return}i()};return window.addEventListener("scroll",n,{passive:!0}),()=>{o!==null&&clearTimeout(o),window.removeEventListener("scroll",n)}}function D(){try{return crypto.randomUUID().replace(/-/g,"").slice(0,12)}catch{return Array.from({length:12},()=>Math.floor(Math.random()*36).toString(36)).join("")}}function I(){return{sid:D(),t0:Date.now()}}var T="/recorder/events";var m="__repoburgRecorder.pending";function M(t,r={}){let e=r.fetch??((...a)=>fetch(...a)),o=r.sendBeacon??((a,p)=>{try{return navigator.sendBeacon(a,p)}catch{return!1}}),i=r.onUnload??(a=>{document.addEventListener("pagehide",a),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&a()})}),n=r.storage===void 0?P():r.storage,s=q(),c=()=>{if(n)try{s.length===0?n.removeItem(m):n.setItem(m,JSON.stringify(s))}catch{}},u=a=>{s=s.concat(a),s.length>1e3&&(s=s.slice(s.length-1e3)),c()},f=(a,p)=>{if(a.length===0)return;let h=JSON.stringify({sid:t,events:a});try{if(p&&o(T,new Blob([h],{type:"application/json"}))){c();return}e(T,{method:"POST",headers:{"content-type":"application/json"},body:h,keepalive:!0}).then(()=>c()).catch(()=>u(a))}catch{u(a)}},l=[],d={push(a){l.push(a),l.length>=100&&d.flush()},flush(a=!1){let p=s.concat(l);s=[],l=[],f(p,a)}};return(r.setInterval??((a,p)=>setInterval(a,p)))(()=>d.flush(),2e3),i(()=>d.flush(!0)),d;function P(){try{return window.localStorage}catch{return null}}function q(){if(!n)return[];try{let a=n.getItem(m),p=a?JSON.parse(a):null;return Array.isArray(p)?p:[]}catch{return[]}}}(function(){let r=window;if(!r.__repoburgRecorder){r.__repoburgRecorder=!0;try{N()}catch{}}})();function N(){let t=I(),r=M(t.sid),e=v(t,r);e("session_start",{route:location.pathname}),b(e),y(e),L(e),g(e),_(e),E(e),S(e),document.addEventListener("pagehide",()=>{e("session_end"),r.flush(!0)})}})();
|