@checksum-ai/runtime 4.13.0 → 4.13.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/.env CHANGED
@@ -1 +1 @@
1
- CHECKSUM_RUNTIME_BUILD_TIME=2026-08-01T03:38:32.695Z
1
+ CHECKSUM_RUNTIME_BUILD_TIME=2026-08-04T15:22:46.740Z
@@ -1,4 +1,4 @@
1
- "use strict";var g=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var i=(e,t)=>g(e,"name",{value:t,configurable:!0});var I=(e,t)=>{for(var r in t)g(e,r,{get:t[r],enumerable:!0})},C=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of w(t))!F.call(e,o)&&o!==r&&g(e,o,{get:()=>t[o],enumerable:!(n=M(t,o))||n.enumerable});return e};var W=e=>C(g({},"__esModule",{value:!0}),e);var Q={};I(Q,{default:()=>f});module.exports=W(Q);var P=require("path");var b=i(e=>{if(e.error!=null)return"ERROR";let t=e.status_code;if(typeof t=="number"&&t>=500)return"ERROR";let r=e.exit_code;return typeof r=="number"&&r!==0?"ERROR":"INFO"},"severityFor");var y=require("fs");var E="\x1B[31m",_="\x1B[33m",D="\x1B[32m",O="\x1B[36m",H="\x1B[2m",L="\x1B[1m",m="\x1B[0m",B=i(()=>{let e=process.env.WIDE_EVENT_PRETTY;return e==="true"||e==="1"?!0:e==="false"||e==="0"?!1:process.stdout.isTTY?!0:process.env.APP_ENV==="local"},"shouldPretty"),U=new Set(["severity","message","kind","timestamp","_startedAtMs"]),N=i(e=>{let t=new WeakSet;return JSON.stringify(e,(r,n)=>{if(typeof n=="bigint")return n.toString();if(typeof n=="object"&&n!==null){if(t.has(n))return"[Circular]";t.add(n)}return n})},"safeStringify"),$=i(e=>e==="ERROR"||e==="CRITICAL"?E:e==="WARNING"?_:D,"colorForSeverity"),j=i(e=>{let t=String(e.severity??"INFO"),r=`${$(t)}${t.padEnd(5)}${m}`,n=e.kind?`${O}${e.kind}${m}`:"",o=String(e.message??""),a=e.error&&typeof e.error=="object"?(()=>{let d=e.error;return` ${E}${d.type??"Error"}: ${d.message??""}${m}`})():"",p=["outcome","test_suite_run_id","status"],s=Object.entries(e).filter(([d,c])=>!U.has(d)&&c!=null&&d!=="error"&&typeof c!="object"),l=i(d=>{let c=p.indexOf(d);return c===-1?p.length:c},"rank"),u=s.sort(([d],[c])=>l(d)-l(c)).slice(0,8).map(([d,c])=>`${H}${d}=${m}${c}`).join(" ");return[r,L+n+m,o,u,a].filter(d=>d&&d.trim()!=="").join(" ")},"formatPretty"),G=i(e=>{let t=e.trace_id;if(typeof t!="string"||t==="")return e;let r=process.env.GCP_PROJECT_ID||process.env.GOOGLE_CLOUD_PROJECT;return r?{...e,"logging.googleapis.com/trace":`projects/${r}/traces/${t}`}:e},"withGcpTraceField"),x=i(e=>{let t=B()?j(e):N(G(e));(0,y.writeSync)(1,t+`
1
+ "use strict";var g=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var i=(e,t)=>g(e,"name",{value:t,configurable:!0});var I=(e,t)=>{for(var r in t)g(e,r,{get:t[r],enumerable:!0})},C=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of w(t))!F.call(e,o)&&o!==r&&g(e,o,{get:()=>t[o],enumerable:!(n=M(t,o))||n.enumerable});return e};var W=e=>C(g({},"__esModule",{value:!0}),e);var Q={};I(Q,{default:()=>f});module.exports=W(Q);var P=require("path");var b=i(e=>{if(e.error!=null)return"ERROR";let t=e.status_code;if(typeof t=="number"&&t>=500)return"ERROR";let r=e.exit_code;return typeof r=="number"&&r!==0?"ERROR":"INFO"},"severityFor");var y=require("fs");var E="\x1B[31m",_="\x1B[33m",D="\x1B[32m",O="\x1B[36m",H="\x1B[2m",L="\x1B[1m",m="\x1B[0m",B=i(()=>{let e=process.env.WIDE_EVENT_PRETTY;return e==="true"||e==="1"?!0:e==="false"||e==="0"?!1:process.stdout.isTTY?!0:process.env.APP_ENV==="local"},"shouldPretty"),U=new Set(["severity","message","kind","timestamp","_startedAtMs"]),N=i(e=>{let t=new WeakSet;return JSON.stringify(e,(r,n)=>{if(typeof n=="bigint")return n.toString();if(typeof n=="object"&&n!==null){if(t.has(n))return"[Circular]";t.add(n)}return n})},"safeStringify"),$=i(e=>e==="ERROR"||e==="CRITICAL"?E:e==="WARNING"?_:D,"colorForSeverity"),j=i(e=>{let t=String(e.severity??"INFO"),r=`${$(t)}${t.padEnd(5)}${m}`,n=e.kind?`${O}${e.kind}${m}`:"",o=String(e.message??""),a=e.error&&typeof e.error=="object"?(()=>{let p=e.error;return` ${E}${p.type??"Error"}: ${p.message??""}${m}`})():"",l=["outcome","test_suite_run_id","status"],s=Object.entries(e).filter(([p,c])=>!U.has(p)&&c!=null&&p!=="error"&&typeof c!="object"),d=i(p=>{let c=l.indexOf(p);return c===-1?l.length:c},"rank"),u=s.sort(([p],[c])=>d(p)-d(c)).slice(0,8).map(([p,c])=>`${H}${p}=${m}${c}`).join(" ");return[r,L+n+m,o,u,a].filter(p=>p&&p.trim()!=="").join(" ")},"formatPretty"),G=i(e=>{let t=e.trace_id;if(typeof t!="string"||t==="")return e;let r=process.env.GCP_PROJECT_ID||process.env.GOOGLE_CLOUD_PROJECT;return r?{...e,"logging.googleapis.com/trace":`projects/${r}/traces/${t}`}:e},"withGcpTraceField"),x=i(e=>{let t=B()?j(e):N(G(e));(0,y.writeSync)(1,t+`
2
2
  `)},"emitEvent");var S=i(e=>{(0,y.writeSync)(2,e.endsWith(`
3
3
  `)?e:`${e}
4
- `)},"writeStderrLine");var V=i(e=>{let t=e.kind??"event",r=e.outcome?` ${e.outcome}`:"",n=typeof e.duration_ms=="number"?` ${e.duration_ms}ms`:"";return`${t}${r}${n}`.trim()},"defaultMessage"),Y=i((e,t,r)=>{let n=Date.now(),o={timestamp:new Date().toISOString(),kind:e,...t},a=!1,p={set(s){return Object.assign(o,s),p},emit(s){a||(a=!0,s&&Object.assign(o,s),o.duration_ms===void 0&&(o.duration_ms=Date.now()-n),r(o))}};return p},"startHandle"),K=i((e={})=>{let t=e.decide??(()=>!0),r=e.deriveMessage??V,n=e.label??"[wide-event]",o=e.sink??(s=>x(s)),a=i(s=>{if(!t(s))return;let l={severity:b(s),message:s.message??r(s),...s};try{o(l)}catch(u){try{S(`${n} emit failed: ${String(u)}`)}catch{}}},"emit");return{emit:a,emitWideEvent:i((s,l={})=>{a({timestamp:new Date().toISOString(),kind:s,...l})},"emitWideEvent"),wideEvent:i((s,l={})=>Y(s,l,a),"wideEvent"),configureSink:i(s=>{o=s},"configureSink")}},"createWideEvents"),v=i(e=>e==="true"||e==="1","truthy"),A=i(()=>v(process.env.CHECKSUM_WIDE_EVENTS)||v(process.env.WIDE_EVENT_PRETTY),"wideEventsEnabled"),k=K({decide:i(()=>A(),"decide")}),J=k.configureSink;var h=i((e,t={})=>{k.emitWideEvent(e,t)},"emitWideEvent");var R=2e3;function z(e){switch(e){case"passed":return"passed";case"timedOut":return"timedOut";case"skipped":return"skipped";case"interrupted":return"interrupted";default:return"failed"}}i(z,"toProgressStatus");var T=class T{constructor(){this.monitorPort=process.env.CHECKSUM_UPLOAD_AGENT_PORT;this.startedAt=Date.now();this.rootDir=process.cwd();this.testsById=new Map;this.lastFlushAt=0;this.sendChain=Promise.resolve()}printsToStdio(){return!1}onBegin(t,r){this.guard(()=>{var n;t!=null&&t.rootDir&&(this.rootDir=t.rootDir);for(let o of((n=r==null?void 0:r.allTests)==null?void 0:n.call(r))??[])this.register(o);this.flush(!0)})}onTestBegin(t,r){this.guard(()=>{var o;let n=this.itemFor(t);n.status="running",n.startedAt=((o=r==null?void 0:r.startTime)==null?void 0:o.getTime())??Date.now(),n.endedAt=null,n.durationMs=null,n.retry=(r==null?void 0:r.retry)??0,this.flush()})}onTestEnd(t,r){this.guard(()=>{var a;let n=this.itemFor(t);n.status=z(r==null?void 0:r.status),n.endedAt=Date.now(),n.durationMs=(r==null?void 0:r.duration)??null,n.retry=(r==null?void 0:r.retry)??n.retry,n.startedAt??(n.startedAt=((a=r==null?void 0:r.startTime)==null?void 0:a.getTime())??null),this.flush();let o=n.status==="passed"||n.status==="skipped";h("test_result",{test_suite_run_id:process.env.CHECKSUM_TEST_SUITE_ID,outcome:o?"success":"error",test_id:n.id,status:n.status,retry:n.retry,duration_ms:n.durationMs??void 0,title:n.title,file:n.file,project:n.project||void 0})})}async onEnd(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0),await this.send()}itemFor(t){return this.testsById.get(t.id)??this.register(t)}register(t){var a,p,s,l,u;let r="";try{r=((s=(p=(a=t.parent)==null?void 0:a.project)==null?void 0:p.call(a))==null?void 0:s.name)??""}catch{}let n=((l=t.location)==null?void 0:l.file)??"";try{n&&(n=(0,P.relative)(this.rootDir,n))}catch{}let o={id:t.id,title:t.title??"",titlePath:this.titlePathOf(t),file:n,line:((u=t.location)==null?void 0:u.line)??0,project:r,status:"pending",startedAt:null,endedAt:null,durationMs:null,retry:0};return this.testsById.set(o.id,o),o}titlePathOf(t){var r;try{return(((r=t.titlePath)==null?void 0:r.call(t))??[]).filter(n=>!!n)}catch{return t.title?[t.title]:[]}}snapshot(){return{schemaVersion:1,source:"playwright",startedAt:this.startedAt,updatedAt:Date.now(),tests:[...this.testsById.values()]}}flush(t=!1){if(!this.monitorPort)return;let r=Date.now()-this.lastFlushAt;if(t||r>=R){this.lastFlushAt=Date.now(),this.send();return}this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flushTimer=void 0,this.lastFlushAt=Date.now(),this.send()},R-r))}send(){return this.monitorPort?(this.sendChain=this.sendChain.then(()=>this.postSnapshot()),this.sendChain):Promise.resolve()}async postSnapshot(){try{await fetch(`http://127.0.0.1:${this.monitorPort}/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"runProgress",payload:this.snapshot()})})}catch{}}guard(t){try{t()}catch{}}};i(T,"ChecksumProgressReporter");var f=T;
4
+ `)},"writeStderrLine");var V=i(e=>{let t=e.kind??"event",r=e.outcome?` ${e.outcome}`:"",n=typeof e.duration_ms=="number"?` ${e.duration_ms}ms`:"";return`${t}${r}${n}`.trim()},"defaultMessage"),Y=i((e,t,r)=>{let n=Date.now(),o={timestamp:new Date().toISOString(),kind:e,...t},a=!1,l={set(s){return Object.assign(o,s),l},emit(s){a||(a=!0,s&&Object.assign(o,s),o.duration_ms===void 0&&(o.duration_ms=Date.now()-n),r(o))}};return l},"startHandle"),K=i((e={})=>{let t=e.decide??(()=>!0),r=e.deriveMessage??V,n=e.label??"[wide-event]",o=e.sink??(s=>x(s)),a=i(s=>{if(!t(s))return;let d={severity:b(s),message:s.message??r(s),...s};try{o(d)}catch(u){try{S(`${n} emit failed: ${String(u)}`)}catch{}}},"emit");return{emit:a,emitWideEvent:i((s,d={})=>{a({timestamp:new Date().toISOString(),kind:s,...d})},"emitWideEvent"),wideEvent:i((s,d={})=>Y(s,d,a),"wideEvent"),configureSink:i(s=>{o=s},"configureSink")}},"createWideEvents"),v=i(e=>e==="true"||e==="1","truthy"),A=i(()=>v(process.env.CHECKSUM_WIDE_EVENTS)||v(process.env.WIDE_EVENT_PRETTY),"wideEventsEnabled"),k=K({decide:i(()=>A(),"decide")}),J=k.configureSink;var h=i((e,t={})=>{k.emitWideEvent(e,t)},"emitWideEvent");var R=2e3;function z(e){switch(e){case"passed":return"passed";case"timedOut":return"timedOut";case"skipped":return"skipped";case"interrupted":return"interrupted";default:return"failed"}}i(z,"toProgressStatus");var T=class T{constructor(){this.monitorPort=process.env.CHECKSUM_UPLOAD_AGENT_PORT;this.startedAt=Date.now();this.rootDir=process.cwd();this.testsById=new Map;this.lastFlushAt=0;this.sendChain=Promise.resolve()}printsToStdio(){return!1}onBegin(t,r){this.guard(()=>{var n;t!=null&&t.rootDir&&(this.rootDir=t.rootDir);for(let o of((n=r==null?void 0:r.allTests)==null?void 0:n.call(r))??[])this.register(o);this.flush(!0)})}onTestBegin(t,r){this.guard(()=>{var o;let n=this.itemFor(t);n.status="running",n.startedAt=((o=r==null?void 0:r.startTime)==null?void 0:o.getTime())??Date.now(),n.endedAt=null,n.durationMs=null,n.retry=(r==null?void 0:r.retry)??0,this.flush()})}onTestEnd(t,r){this.guard(()=>{var a;let n=this.itemFor(t);n.status=z(r==null?void 0:r.status),n.endedAt=Date.now(),n.durationMs=(r==null?void 0:r.duration)??null,n.retry=(r==null?void 0:r.retry)??n.retry,n.startedAt??(n.startedAt=((a=r==null?void 0:r.startTime)==null?void 0:a.getTime())??null),this.flush();let o=n.status==="passed"||n.status==="skipped";h("test_result",{test_suite_run_id:process.env.CHECKSUM_TEST_SUITE_ID,outcome:o?"success":"error",test_id:n.id,status:n.status,retry:n.retry,duration_ms:n.durationMs??void 0,title:n.title,file:n.file,project:n.project||void 0})})}async onEnd(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0),await this.send()}itemFor(t){return this.testsById.get(t.id)??this.register(t)}register(t){var a,l,s,d,u;let r="";try{r=((s=(l=(a=t.parent)==null?void 0:a.project)==null?void 0:l.call(a))==null?void 0:s.name)??""}catch{}let n=((d=t.location)==null?void 0:d.file)??"";try{n&&(n=(0,P.relative)(this.rootDir,n))}catch{}let o={id:t.id,title:t.title??"",titlePath:this.titlePathOf(t),file:n,line:((u=t.location)==null?void 0:u.line)??0,project:r,status:"pending",startedAt:null,endedAt:null,durationMs:null,retry:0};return this.testsById.set(o.id,o),o}titlePathOf(t){var r;try{return(((r=t.titlePath)==null?void 0:r.call(t))??[]).filter(n=>!!n)}catch{return t.title?[t.title]:[]}}snapshot(){return{schemaVersion:1,source:"playwright",startedAt:this.startedAt,updatedAt:Date.now(),tests:[...this.testsById.values()]}}flush(t=!1){if(!this.monitorPort)return;let r=Date.now()-this.lastFlushAt;if(t||r>=R){this.lastFlushAt=Date.now(),this.send();return}this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flushTimer=void 0,this.lastFlushAt=Date.now(),this.send()},R-r))}send(){return this.monitorPort?(this.sendChain=this.sendChain.then(()=>this.postSnapshot()),this.sendChain):Promise.resolve()}async postSnapshot(){try{await fetch(`http://127.0.0.1:${this.monitorPort}/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"runProgress",payload:this.snapshot()})})}catch{}}guard(t){try{t()}catch{}}};i(T,"ChecksumProgressReporter");var f=T;
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "baseUrl": "./",
4
3
  "paths": {
5
4
  "@checksum/*": ["./*"]
6
5
  }