Ignore coverage output and document Claude text mode

This commit is contained in:
Peter Steinberger
2025-11-25 01:38:43 +01:00
parent b4e5f20cd7
commit d0c9bff4ca
26 changed files with 39 additions and 11127 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@ node_modules
.env
dist
pnpm-lock.yaml
coverage

View File

@@ -47,12 +47,10 @@ You can also use a personal WhatsApp Web session (QR login) via `--provider web`
bodyPrefix: "You are a helpful assistant running on the user's Mac. User writes messages via WhatsApp and you respond. You want to be concise in your responses, at most 1000 characters.\n\n",
command: [
"claude",
"-p",
"--output-format",
"json",
"--dangerously-skip-permissions",
"{{BodyStripped}}"
],
claudeOutputFormat: "text", // forces --output-format text and adds -p/--print when missing
session: {
scope: "per-sender",
resetTriggers: ["/new"],
@@ -102,6 +100,7 @@ Notes:
| `inbound.reply.session.sessionArgNew` | `string[]` | `["--session-id","{{SessionId}}"]` | Args inserted for a new session run. |
| `inbound.reply.session.sessionArgResume` | `string[]` | `["--resume","{{SessionId}}"]` | Args inserted when resuming an existing session. |
| `inbound.reply.session.sessionArgBeforeBody` | `boolean` | `true` | Place session args before the final body argument. |
| `inbound.reply.claudeOutputFormat` | `"text" \| "json" \| "stream-json"` | — | When `command[0]` is `claude`, force this output format and auto-add `-p/--print` so Claude exits after emitting output. |
| `inbound.reply.timeoutSeconds` | `number` | 600 | Command timeout. |
## Dev Notes

View File

@@ -1,224 +0,0 @@
body, html {
margin:0; padding: 0;
height: 100%;
}
body {
font-family: Helvetica Neue, Helvetica, Arial;
font-size: 14px;
color:#333;
}
.small { font-size: 12px; }
*, *:after, *:before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
h1 { font-size: 20px; margin: 0;}
h2 { font-size: 14px; }
pre {
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
margin: 0;
padding: 0;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
a { color:#0074D9; text-decoration:none; }
a:hover { text-decoration:underline; }
.strong { font-weight: bold; }
.space-top1 { padding: 10px 0 0 0; }
.pad2y { padding: 20px 0; }
.pad1y { padding: 10px 0; }
.pad2x { padding: 0 20px; }
.pad2 { padding: 20px; }
.pad1 { padding: 10px; }
.space-left2 { padding-left:55px; }
.space-right2 { padding-right:20px; }
.center { text-align:center; }
.clearfix { display:block; }
.clearfix:after {
content:'';
display:block;
height:0;
clear:both;
visibility:hidden;
}
.fl { float: left; }
@media only screen and (max-width:640px) {
.col3 { width:100%; max-width:100%; }
.hide-mobile { display:none!important; }
}
.quiet {
color: #7f7f7f;
color: rgba(0,0,0,0.5);
}
.quiet a { opacity: 0.7; }
.fraction {
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
font-size: 10px;
color: #555;
background: #E8E8E8;
padding: 4px 5px;
border-radius: 3px;
vertical-align: middle;
}
div.path a:link, div.path a:visited { color: #333; }
table.coverage {
border-collapse: collapse;
margin: 10px 0 0 0;
padding: 0;
}
table.coverage td {
margin: 0;
padding: 0;
vertical-align: top;
}
table.coverage td.line-count {
text-align: right;
padding: 0 5px 0 20px;
}
table.coverage td.line-coverage {
text-align: right;
padding-right: 10px;
min-width:20px;
}
table.coverage td span.cline-any {
display: inline-block;
padding: 0 5px;
width: 100%;
}
.missing-if-branch {
display: inline-block;
margin-right: 5px;
border-radius: 3px;
position: relative;
padding: 0 4px;
background: #333;
color: yellow;
}
.skip-if-branch {
display: none;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: #ccc;
color: white;
}
.missing-if-branch .typ, .skip-if-branch .typ {
color: inherit !important;
}
.coverage-summary {
border-collapse: collapse;
width: 100%;
}
.coverage-summary tr { border-bottom: 1px solid #bbb; }
.keyline-all { border: 1px solid #ddd; }
.coverage-summary td, .coverage-summary th { padding: 10px; }
.coverage-summary tbody { border: 1px solid #bbb; }
.coverage-summary td { border-right: 1px solid #bbb; }
.coverage-summary td:last-child { border-right: none; }
.coverage-summary th {
text-align: left;
font-weight: normal;
white-space: nowrap;
}
.coverage-summary th.file { border-right: none !important; }
.coverage-summary th.pct { }
.coverage-summary th.pic,
.coverage-summary th.abs,
.coverage-summary td.pct,
.coverage-summary td.abs { text-align: right; }
.coverage-summary td.file { white-space: nowrap; }
.coverage-summary td.pic { min-width: 120px !important; }
.coverage-summary tfoot td { }
.coverage-summary .sorter {
height: 10px;
width: 7px;
display: inline-block;
margin-left: 0.5em;
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
}
.coverage-summary .sorted .sorter {
background-position: 0 -20px;
}
.coverage-summary .sorted-desc .sorter {
background-position: 0 -10px;
}
.status-line { height: 10px; }
/* yellow */
.cbranch-no { background: yellow !important; color: #111; }
/* dark red */
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
.low .chart { border:1px solid #C21F39 }
.highlighted,
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
background: #C21F39 !important;
}
/* medium red */
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
/* light red */
.low, .cline-no { background:#FCE1E5 }
/* light green */
.high, .cline-yes { background:rgb(230,245,208) }
/* medium green */
.cstat-yes { background:rgb(161,215,106) }
/* dark green */
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
.high .chart { border:1px solid rgb(77,146,33) }
/* dark yellow (gold) */
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
.medium .chart { border:1px solid #f9cd0b; }
/* light yellow */
.medium { background: #fff4c2; }
.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }
span.cline-neutral { background: #eaeaea; }
.coverage-summary td.empty {
opacity: .5;
padding-top: 4px;
padding-bottom: 4px;
line-height: 1;
color: #888;
}
.cover-fill, .cover-empty {
display:inline-block;
height: 12px;
}
.chart {
line-height: 0;
}
.cover-empty {
background: white;
}
.cover-full {
border-right: none !important;
}
pre.prettyprint {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.com { color: #999 !important; }
.ignore-none { color: #999; font-weight: normal; }
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -48px;
}
.footer, .push {
height: 48px;
}

View File

@@ -1,87 +0,0 @@
/* eslint-disable */
var jumpToCode = (function init() {
// Classes of code we would like to highlight in the file view
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
// Elements to highlight in the file listing view
var fileListingElements = ['td.pct.low'];
// We don't want to select elements that are direct descendants of another match
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
// Selector that finds elements on the page to which we can jump
var selector =
fileListingElements.join(', ') +
', ' +
notSelector +
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
// The NodeList of matching elements
var missingCoverageElements = document.querySelectorAll(selector);
var currentIndex;
function toggleClass(index) {
missingCoverageElements
.item(currentIndex)
.classList.remove('highlighted');
missingCoverageElements.item(index).classList.add('highlighted');
}
function makeCurrent(index) {
toggleClass(index);
currentIndex = index;
missingCoverageElements.item(index).scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'center'
});
}
function goToPrevious() {
var nextIndex = 0;
if (typeof currentIndex !== 'number' || currentIndex === 0) {
nextIndex = missingCoverageElements.length - 1;
} else if (missingCoverageElements.length > 1) {
nextIndex = currentIndex - 1;
}
makeCurrent(nextIndex);
}
function goToNext() {
var nextIndex = 0;
if (
typeof currentIndex === 'number' &&
currentIndex < missingCoverageElements.length - 1
) {
nextIndex = currentIndex + 1;
}
makeCurrent(nextIndex);
}
return function jump(event) {
if (
document.getElementById('fileSearch') === document.activeElement &&
document.activeElement != null
) {
// if we're currently focused on the search input, we don't want to navigate
return;
}
switch (event.which) {
case 78: // n
case 74: // j
goToNext();
break;
case 66: // b
case 75: // k
case 80: // p
goToPrevious();
break;
}
};
})();
window.addEventListener('keydown', jumpToCode);

View File

@@ -1,962 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1764024449709" clover="3.2.0">
<project timestamp="1764024449709" name="All files">
<metrics statements="917" coveredstatements="561" conditionals="709" coveredconditionals="341" methods="148" coveredmethods="104" elements="1774" coveredelements="1006" complexity="0" loc="917" ncloc="917" packages="3" files="10" classes="10"/>
<package name="src">
<metrics statements="839" coveredstatements="517" conditionals="667" coveredconditionals="322" methods="131" coveredmethods="94"/>
<file name="globals.ts" path="/Users/steipete/Projects/warelay/src/globals.ts">
<metrics statements="11" coveredstatements="11" conditionals="2" coveredconditionals="2" methods="5" coveredmethods="5"/>
<line num="3" count="5" type="stmt"/>
<line num="4" count="5" type="stmt"/>
<line num="7" count="4" type="stmt"/>
<line num="11" count="6" type="stmt"/>
<line num="15" count="19" type="cond" truecount="2" falsecount="0"/>
<line num="19" count="4" type="stmt"/>
<line num="23" count="2" type="stmt"/>
<line num="26" count="5" type="stmt"/>
<line num="27" count="5" type="stmt"/>
<line num="28" count="5" type="stmt"/>
<line num="29" count="5" type="stmt"/>
</file>
<file name="index.ts" path="/Users/steipete/Projects/warelay/src/index.ts">
<metrics statements="697" coveredstatements="408" conditionals="566" coveredconditionals="271" methods="101" coveredmethods="66"/>
<line num="49" count="3" type="stmt"/>
<line num="51" count="3" type="stmt"/>
<line num="79" count="3" type="stmt"/>
<line num="194" count="3" type="stmt"/>
<line num="198" count="1" type="stmt"/>
<line num="199" count="1" type="stmt"/>
<line num="203" count="3" type="stmt"/>
<line num="213" count="9" type="cond" truecount="3" falsecount="1"/>
<line num="214" count="0" type="stmt"/>
<line num="219" count="9" type="cond" truecount="3" falsecount="1"/>
<line num="220" count="0" type="stmt"/>
<line num="225" count="9" type="cond" truecount="2" falsecount="4"/>
<line num="226" count="0" type="stmt"/>
<line num="236" count="9" type="stmt"/>
<line num="237" count="9" type="cond" truecount="1" falsecount="1"/>
<line num="238" count="0" type="stmt"/>
<line num="239" count="0" type="stmt"/>
<line num="240" count="0" type="stmt"/>
<line num="250" count="9" type="stmt"/>
<line num="253" count="9" type="cond" truecount="4" falsecount="0"/>
<line num="257" count="9" type="stmt"/>
<line num="265" count="3" type="stmt"/>
<line num="277" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="278" count="0" type="stmt"/>
<line num="280" count="1" type="stmt"/>
<line num="281" count="1" type="stmt"/>
<line num="286" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="287" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="288" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="290" count="1" type="stmt"/>
<line num="292" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="293" count="0" type="stmt"/>
<line num="295" count="0" type="stmt"/>
<line num="312" count="2" type="stmt"/>
<line num="313" count="2" type="stmt"/>
<line num="316" count="2" type="stmt"/>
<line num="317" count="2" type="stmt"/>
<line num="318" count="2" type="stmt"/>
<line num="319" count="2" type="stmt"/>
<line num="320" count="1" type="stmt"/>
<line num="323" count="2" type="stmt"/>
<line num="324" count="1" type="stmt"/>
<line num="326" count="2" type="stmt"/>
<line num="327" count="0" type="stmt"/>
<line num="329" count="2" type="stmt"/>
<line num="330" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="331" count="0" type="stmt"/>
<line num="332" count="0" type="stmt"/>
<line num="333" count="0" type="stmt"/>
<line num="335" count="2" type="stmt"/>
<line num="336" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="337" count="2" type="stmt"/>
<line num="338" count="2" type="stmt"/>
<line num="339" count="2" type="stmt"/>
<line num="350" count="2" type="stmt"/>
<line num="351" count="2" type="stmt"/>
<line num="352" count="2" type="stmt"/>
<line num="353" count="2" type="stmt"/>
<line num="358" count="1" type="cond" truecount="3" falsecount="0"/>
<line num="363" count="1" type="stmt"/>
<line num="364" count="1" type="stmt"/>
<line num="370" count="1" type="stmt"/>
<line num="371" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="373" count="0" type="stmt"/>
<line num="375" count="0" type="stmt"/>
<line num="380" count="1" type="stmt"/>
<line num="381" count="1" type="stmt"/>
<line num="382" count="1" type="stmt"/>
<line num="384" count="1" type="stmt"/>
<line num="386" count="0" type="stmt"/>
<line num="391" count="1" type="cond" truecount="3" falsecount="1"/>
<line num="392" count="1" type="stmt"/>
<line num="393" count="1" type="stmt"/>
<line num="395" count="0" type="stmt"/>
<line num="405" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="410" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="413" count="0" type="stmt"/>
<line num="414" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="415" count="0" type="stmt"/>
<line num="416" count="0" type="stmt"/>
<line num="417" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="418" count="0" type="stmt"/>
<line num="425" count="1" type="stmt"/>
<line num="430" count="1" type="stmt"/>
<line num="432" count="0" type="stmt"/>
<line num="433" count="0" type="stmt"/>
<line num="442" count="0" type="stmt"/>
<line num="443" count="0" type="stmt"/>
<line num="444" count="0" type="stmt"/>
<line num="452" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="453" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="454" count="0" type="stmt"/>
<line num="455" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="456" count="0" type="stmt"/>
<line num="459" count="0" type="stmt"/>
<line num="460" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="461" count="0" type="stmt"/>
<line num="464" count="3" type="stmt"/>
<line num="497" count="2" type="stmt"/>
<line num="498" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="499" count="2" type="stmt"/>
<line num="500" count="2" type="stmt"/>
<line num="501" count="2" type="cond" truecount="3" falsecount="1"/>
<line num="502" count="2" type="stmt"/>
<line num="504" count="0" type="stmt"/>
<line num="505" count="0" type="stmt"/>
<line num="522" count="14" type="stmt"/>
<line num="523" count="6" type="stmt"/>
<line num="524" count="6" type="cond" truecount="1" falsecount="1"/>
<line num="536" count="3" type="stmt"/>
<line num="537" count="3" type="stmt"/>
<line num="538" count="3" type="stmt"/>
<line num="541" count="6" type="cond" truecount="2" falsecount="0"/>
<line num="542" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="543" count="2" type="stmt"/>
<line num="547" count="4" type="stmt"/>
<line num="548" count="4" type="stmt"/>
<line num="549" count="4" type="stmt"/>
<line num="550" count="4" type="cond" truecount="4" falsecount="0"/>
<line num="551" count="3" type="stmt"/>
<line num="556" count="1" type="stmt"/>
<line num="560" count="4" type="stmt"/>
<line num="561" count="4" type="stmt"/>
<line num="565" count="4" type="cond" truecount="1" falsecount="1"/>
<line num="566" count="4" type="cond" truecount="1" falsecount="1"/>
<line num="567" count="4" type="cond" truecount="1" falsecount="1"/>
<line num="577" count="6" type="cond" truecount="2" falsecount="0"/>
<line num="578" count="6" type="stmt"/>
<line num="579" count="6" type="cond" truecount="2" falsecount="0"/>
<line num="580" count="6" type="stmt"/>
<line num="581" count="6" type="stmt"/>
<line num="582" count="6" type="stmt"/>
<line num="583" count="4" type="cond" truecount="1" falsecount="1"/>
<line num="584" count="4" type="stmt"/>
<line num="585" count="4" type="stmt"/>
<line num="589" count="6" type="stmt"/>
<line num="591" count="6" type="cond" truecount="2" falsecount="0"/>
<line num="594" count="6" type="cond" truecount="2" falsecount="0"/>
<line num="595" count="6" type="cond" truecount="2" falsecount="0"/>
<line num="596" count="6" type="stmt"/>
<line num="599" count="6" type="stmt"/>
<line num="602" count="6" type="cond" truecount="2" falsecount="0"/>
<line num="603" count="4" type="cond" truecount="1" falsecount="1"/>
<line num="604" count="4" type="stmt"/>
<line num="605" count="4" type="cond" truecount="1" falsecount="1"/>
<line num="606" count="4" type="cond" truecount="1" falsecount="1"/>
<line num="607" count="0" type="stmt"/>
<line num="608" count="0" type="stmt"/>
<line num="609" count="0" type="stmt"/>
<line num="611" count="4" type="stmt"/>
<line num="612" count="4" type="cond" truecount="2" falsecount="0"/>
<line num="613" count="1" type="stmt"/>
<line num="614" count="1" type="stmt"/>
<line num="615" count="1" type="stmt"/>
<line num="619" count="4" type="stmt"/>
<line num="620" count="4" type="stmt"/>
<line num="621" count="4" type="stmt"/>
<line num="622" count="4" type="stmt"/>
<line num="623" count="4" type="cond" truecount="2" falsecount="0"/>
<line num="625" count="4" type="cond" truecount="4" falsecount="0"/>
<line num="626" count="3" type="stmt"/>
<line num="628" count="1" type="stmt"/>
<line num="629" count="1" type="stmt"/>
<line num="632" count="4" type="stmt"/>
<line num="633" count="4" type="stmt"/>
<line num="636" count="5" type="stmt"/>
<line num="644" count="6" type="cond" truecount="2" falsecount="0"/>
<line num="647" count="6" type="cond" truecount="2" falsecount="0"/>
<line num="650" count="6" type="stmt"/>
<line num="657" count="6" type="stmt"/>
<line num="658" count="6" type="cond" truecount="4" falsecount="0"/>
<line num="659" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="660" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="661" count="1" type="stmt"/>
<line num="664" count="1" type="stmt"/>
<line num="667" count="4" type="cond" truecount="1" falsecount="1"/>
<line num="668" count="0" type="stmt"/>
<line num="669" count="0" type="stmt"/>
<line num="672" count="4" type="cond" truecount="4" falsecount="0"/>
<line num="673" count="2" type="stmt"/>
<line num="674" count="2" type="stmt"/>
<line num="675" count="2" type="stmt"/>
<line num="678" count="2" type="cond" truecount="3" falsecount="1"/>
<line num="679" count="2" type="stmt"/>
<line num="680" count="4" type="stmt"/>
<line num="681" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="684" count="2" type="cond" truecount="3" falsecount="1"/>
<line num="685" count="2" type="stmt"/>
<line num="689" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="690" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="693" count="4" type="stmt"/>
<line num="694" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="695" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="696" count="2" type="cond" truecount="3" falsecount="1"/>
<line num="697" count="2" type="stmt"/>
<line num="704" count="2" type="stmt"/>
<line num="705" count="2" type="stmt"/>
<line num="706" count="2" type="stmt"/>
<line num="707" count="2" type="stmt"/>
<line num="709" count="2" type="stmt"/>
<line num="710" count="2" type="stmt"/>
<line num="711" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="712" count="0" type="stmt"/>
<line num="714" count="2" type="stmt"/>
<line num="717" count="2" type="stmt"/>
<line num="718" count="2" type="cond" truecount="2" falsecount="2"/>
<line num="719" count="0" type="stmt"/>
<line num="722" count="0" type="stmt"/>
<line num="724" count="2" type="cond" truecount="2" falsecount="2"/>
<line num="725" count="0" type="stmt"/>
<line num="728" count="0" type="stmt"/>
<line num="730" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="732" count="0" type="stmt"/>
<line num="733" count="0" type="stmt"/>
<line num="734" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="735" count="0" type="stmt"/>
<line num="739" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="740" count="0" type="stmt"/>
<line num="742" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="743" count="0" type="stmt"/>
<line num="747" count="0" type="stmt"/>
<line num="749" count="0" type="stmt"/>
<line num="753" count="0" type="stmt"/>
<line num="763" count="2" type="stmt"/>
<line num="770" count="2" type="stmt"/>
<line num="773" count="1" type="stmt"/>
<line num="777" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="779" count="1" type="stmt"/>
<line num="780" count="1" type="stmt"/>
<line num="781" count="1" type="cond" truecount="3" falsecount="1"/>
<line num="782" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="783" count="0" type="stmt"/>
<line num="787" count="0" type="stmt"/>
<line num="790" count="1" type="stmt"/>
<line num="794" count="1" type="stmt"/>
<line num="795" count="1" type="stmt"/>
<line num="800" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="801" count="0" type="stmt"/>
<line num="808" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="814" count="4" type="cond" truecount="2" falsecount="0"/>
<line num="815" count="2" type="stmt"/>
<line num="819" count="2" type="stmt"/>
<line num="830" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="831" count="1" type="stmt"/>
<line num="832" count="1" type="stmt"/>
<line num="834" count="2" type="stmt"/>
<line num="835" count="2" type="stmt"/>
<line num="836" count="2" type="stmt"/>
<line num="844" count="2" type="stmt"/>
<line num="846" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="847" count="0" type="stmt"/>
<line num="848" count="0" type="stmt"/>
<line num="859" count="2" type="stmt"/>
<line num="860" count="2" type="stmt"/>
<line num="861" count="2" type="stmt"/>
<line num="862" count="2" type="stmt"/>
<line num="864" count="2" type="stmt"/>
<line num="865" count="2" type="stmt"/>
<line num="871" count="2" type="stmt"/>
<line num="876" count="2" type="stmt"/>
<line num="878" count="0" type="stmt"/>
<line num="885" count="0" type="stmt"/>
<line num="887" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="890" count="0" type="stmt"/>
<line num="891" count="0" type="stmt"/>
<line num="894" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="896" count="0" type="stmt"/>
<line num="897" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="898" count="0" type="stmt"/>
<line num="900" count="0" type="stmt"/>
<line num="904" count="3" type="stmt"/>
<line num="905" count="3" type="stmt"/>
<line num="915" count="2" type="stmt"/>
<line num="916" count="2" type="stmt"/>
<line num="917" count="832" type="stmt"/>
<line num="918" count="832" type="cond" truecount="1" falsecount="1"/>
<line num="919" count="832" type="cond" truecount="2" falsecount="0"/>
<line num="920" count="1" type="stmt"/>
<line num="921" count="1" type="stmt"/>
<line num="923" count="831" type="cond" truecount="2" falsecount="0"/>
<line num="924" count="830" type="stmt"/>
<line num="929" count="830" type="stmt"/>
<line num="931" count="831" type="stmt"/>
<line num="933" count="1" type="stmt"/>
<line num="945" count="1" type="stmt"/>
<line num="947" count="1" type="stmt"/>
<line num="948" count="1" type="stmt"/>
<line num="951" count="1" type="stmt"/>
<line num="952" count="1" type="stmt"/>
<line num="953" count="1" type="stmt"/>
<line num="954" count="1" type="stmt"/>
<line num="957" count="1" type="stmt"/>
<line num="958" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="959" count="1" type="stmt"/>
<line num="964" count="1" type="cond" truecount="1" falsecount="3"/>
<line num="966" count="1" type="stmt"/>
<line num="967" count="1" type="stmt"/>
<line num="968" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="969" count="1" type="stmt"/>
<line num="977" count="0" type="stmt"/>
<line num="982" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="983" count="0" type="stmt"/>
<line num="984" count="0" type="stmt"/>
<line num="989" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="990" count="0" type="stmt"/>
<line num="993" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="998" count="1" type="stmt"/>
<line num="1001" count="1" type="stmt"/>
<line num="1002" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1003" count="0" type="stmt"/>
<line num="1006" count="1" type="stmt"/>
<line num="1007" count="1" type="stmt"/>
<line num="1009" count="1" type="stmt"/>
<line num="1010" count="1" type="stmt"/>
<line num="1011" count="1" type="stmt"/>
<line num="1014" count="1" type="stmt"/>
<line num="1017" count="1" type="stmt"/>
<line num="1018" count="0" type="stmt"/>
<line num="1019" count="0" type="stmt"/>
<line num="1022" count="1" type="stmt"/>
<line num="1023" count="1" type="stmt"/>
<line num="1024" count="1" type="stmt"/>
<line num="1027" count="1" type="stmt"/>
<line num="1028" count="1" type="stmt"/>
<line num="1034" count="0" type="stmt"/>
<line num="1035" count="0" type="stmt"/>
<line num="1036" count="0" type="stmt"/>
<line num="1043" count="2" type="stmt"/>
<line num="1044" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="1046" count="2" type="cond" truecount="3" falsecount="1"/>
<line num="1050" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="1051" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="1054" count="2" type="cond" truecount="4" falsecount="0"/>
<line num="1055" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1056" count="0" type="stmt"/>
<line num="1065" count="1" type="stmt"/>
<line num="1066" count="0" type="stmt"/>
<line num="1067" count="1" type="stmt"/>
<line num="1069" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1070" count="1" type="stmt"/>
<line num="1074" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1075" count="0" type="stmt"/>
<line num="1076" count="0" type="stmt"/>
<line num="1078" count="1" type="stmt"/>
<line num="1079" count="1" type="stmt"/>
<line num="1088" count="1" type="stmt"/>
<line num="1089" count="0" type="stmt"/>
<line num="1090" count="1" type="stmt"/>
<line num="1092" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1094" count="1" type="stmt"/>
<line num="1098" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1099" count="0" type="stmt"/>
<line num="1100" count="0" type="stmt"/>
<line num="1102" count="1" type="stmt"/>
<line num="1103" count="1" type="stmt"/>
<line num="1113" count="2" type="stmt"/>
<line num="1114" count="2" type="stmt"/>
<line num="1117" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1120" count="2" type="cond" truecount="3" falsecount="1"/>
<line num="1121" count="0" type="stmt"/>
<line num="1124" count="0" type="stmt"/>
<line num="1129" count="0" type="stmt"/>
<line num="1134" count="0" type="stmt"/>
<line num="1138" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1139" count="0" type="stmt"/>
<line num="1140" count="0" type="stmt"/>
<line num="1143" count="1" type="stmt"/>
<line num="1144" count="1" type="stmt"/>
<line num="1152" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1154" count="1" type="stmt"/>
<line num="1155" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1156" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1157" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1158" count="1" type="stmt"/>
<line num="1159" count="1" type="stmt"/>
<line num="1160" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1161" count="0" type="stmt"/>
<line num="1163" count="1" type="stmt"/>
<line num="1170" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1174" count="0" type="stmt"/>
<line num="1180" count="1" type="stmt"/>
<line num="1183" count="1" type="stmt"/>
<line num="1188" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1189" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1190" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1191" count="0" type="stmt"/>
<line num="1193" count="1" type="stmt"/>
<line num="1204" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="1205" count="1" type="stmt"/>
<line num="1206" count="1" type="stmt"/>
<line num="1208" count="1" type="stmt"/>
<line num="1211" count="1" type="stmt"/>
<line num="1212" count="1" type="stmt"/>
<line num="1216" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1217" count="0" type="stmt"/>
<line num="1219" count="1" type="stmt"/>
<line num="1221" count="1" type="cond" truecount="3" falsecount="1"/>
<line num="1226" count="1" type="cond" truecount="3" falsecount="1"/>
<line num="1227" count="0" type="stmt"/>
<line num="1231" count="1" type="stmt"/>
<line num="1233" count="0" type="stmt"/>
<line num="1234" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1235" count="0" type="stmt"/>
<line num="1237" count="0" type="stmt"/>
<line num="1242" count="0" type="stmt"/>
<line num="1250" count="1" type="stmt"/>
<line num="1251" count="1" type="stmt"/>
<line num="1252" count="1" type="stmt"/>
<line num="1253" count="1" type="stmt"/>
<line num="1257" count="1" type="cond" truecount="3" falsecount="1"/>
<line num="1258" count="1" type="cond" truecount="2" falsecount="2"/>
<line num="1259" count="0" type="stmt"/>
<line num="1263" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1265" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1266" count="0" type="stmt"/>
<line num="1275" count="2" type="stmt"/>
<line num="1276" count="2" type="stmt"/>
<line num="1277" count="2" type="stmt"/>
<line num="1278" count="2" type="stmt"/>
<line num="1283" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="1285" count="2" type="stmt"/>
<line num="1287" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1288" count="0" type="stmt"/>
<line num="1297" count="1" type="stmt"/>
<line num="1298" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1299" count="1" type="stmt"/>
<line num="1300" count="1" type="stmt"/>
<line num="1304" count="1" type="stmt"/>
<line num="1305" count="1" type="stmt"/>
<line num="1306" count="1" type="stmt"/>
<line num="1311" count="1" type="stmt"/>
<line num="1313" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1314" count="0" type="stmt"/>
<line num="1326" count="1" type="stmt"/>
<line num="1327" count="1" type="stmt"/>
<line num="1330" count="1" type="stmt"/>
<line num="1331" count="1" type="stmt"/>
<line num="1343" count="1" type="stmt"/>
<line num="1347" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1348" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1349" count="1" type="stmt"/>
<line num="1350" count="1" type="stmt"/>
<line num="1352" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1353" count="0" type="stmt"/>
<line num="1357" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1358" count="0" type="stmt"/>
<line num="1365" count="0" type="stmt"/>
<line num="1366" count="0" type="stmt"/>
<line num="1374" count="0" type="stmt"/>
<line num="1378" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1379" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1380" count="0" type="stmt"/>
<line num="1381" count="0" type="stmt"/>
<line num="1383" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1384" count="0" type="stmt"/>
<line num="1388" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1389" count="0" type="stmt"/>
<line num="1396" count="0" type="stmt"/>
<line num="1397" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1398" count="0" type="stmt"/>
<line num="1402" count="0" type="stmt"/>
<line num="1406" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1407" count="0" type="stmt"/>
<line num="1412" count="0" type="stmt"/>
<line num="1415" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1416" count="0" type="stmt"/>
<line num="1423" count="0" type="stmt"/>
<line num="1424" count="0" type="stmt"/>
<line num="1425" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1426" count="0" type="stmt"/>
<line num="1427" count="0" type="stmt"/>
<line num="1431" count="0" type="stmt"/>
<line num="1432" count="0" type="stmt"/>
<line num="1435" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1439" count="0" type="stmt"/>
<line num="1444" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1446" count="0" type="stmt"/>
<line num="1447" count="0" type="stmt"/>
<line num="1452" count="0" type="stmt"/>
<line num="1457" count="0" type="stmt"/>
<line num="1469" count="3" type="stmt"/>
<line num="1470" count="3" type="stmt"/>
<line num="1471" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="1472" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="1473" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="1474" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="1475" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="1483" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="1484" count="2" type="stmt"/>
<line num="1487" count="2" type="stmt"/>
<line num="1488" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="1489" count="1" type="stmt"/>
<line num="1500" count="1" type="stmt"/>
<line num="1501" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1502" count="1" type="stmt"/>
<line num="1504" count="1" type="stmt"/>
<line num="1505" count="1" type="stmt"/>
<line num="1507" count="1" type="stmt"/>
<line num="1511" count="1" type="stmt"/>
<line num="1512" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1513" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1514" count="0" type="stmt"/>
<line num="1518" count="1" type="stmt"/>
<line num="1519" count="1" type="stmt"/>
<line num="1520" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1521" count="0" type="stmt"/>
<line num="1522" count="0" type="stmt"/>
<line num="1525" count="1" type="stmt"/>
<line num="1526" count="1" type="cond" truecount="2" falsecount="0"/>
<line num="1527" count="1" type="stmt"/>
<line num="1528" count="1" type="stmt"/>
<line num="1534" count="1" type="stmt"/>
<line num="1535" count="1" type="stmt"/>
<line num="1537" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1538" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1539" count="0" type="stmt"/>
<line num="1542" count="1" type="stmt"/>
<line num="1543" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1544" count="1" type="stmt"/>
<line num="1545" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1546" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1547" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1548" count="1" type="stmt"/>
<line num="1549" count="1" type="stmt"/>
<line num="1552" count="0" type="stmt"/>
<line num="1555" count="1" type="stmt"/>
<line num="1556" count="1" type="stmt"/>
<line num="1567" count="1" type="stmt"/>
<line num="1570" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1573" count="1" type="stmt"/>
<line num="1575" count="1" type="stmt"/>
<line num="1586" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1587" count="1" type="stmt"/>
<line num="1588" count="1" type="stmt"/>
<line num="1589" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1590" count="0" type="stmt"/>
<line num="1593" count="0" type="stmt"/>
<line num="1600" count="1" type="stmt"/>
<line num="1605" count="1" type="stmt"/>
<line num="1606" count="0" type="stmt"/>
<line num="1607" count="0" type="stmt"/>
<line num="1608" count="0" type="stmt"/>
<line num="1612" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1613" count="0" type="stmt"/>
<line num="1629" count="0" type="stmt"/>
<line num="1630" count="0" type="stmt"/>
<line num="1631" count="0" type="stmt"/>
<line num="1633" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="1634" count="0" type="stmt"/>
<line num="1636" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="1637" count="0" type="stmt"/>
<line num="1640" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1641" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1642" count="0" type="stmt"/>
<line num="1644" count="0" type="stmt"/>
<line num="1645" count="0" type="stmt"/>
<line num="1648" count="0" type="stmt"/>
<line num="1649" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1650" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1651" count="0" type="stmt"/>
<line num="1665" count="0" type="stmt"/>
<line num="1666" count="0" type="stmt"/>
<line num="1667" count="0" type="cond" truecount="0" falsecount="5"/>
<line num="1668" count="0" type="stmt"/>
<line num="1670" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="1671" count="0" type="stmt"/>
<line num="1674" count="0" type="stmt"/>
<line num="1675" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1676" count="0" type="stmt"/>
<line num="1677" count="0" type="stmt"/>
<line num="1679" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="1680" count="0" type="stmt"/>
<line num="1681" count="0" type="stmt"/>
<line num="1683" count="0" type="stmt"/>
<line num="1684" count="0" type="stmt"/>
<line num="1699" count="0" type="stmt"/>
<line num="1700" count="0" type="cond" truecount="0" falsecount="5"/>
<line num="1701" count="0" type="stmt"/>
<line num="1703" count="0" type="stmt"/>
<line num="1705" count="0" type="stmt"/>
<line num="1711" count="0" type="stmt"/>
<line num="1725" count="0" type="stmt"/>
<line num="1726" count="0" type="cond" truecount="0" falsecount="5"/>
<line num="1727" count="0" type="stmt"/>
<line num="1730" count="0" type="stmt"/>
<line num="1733" count="0" type="stmt"/>
<line num="1734" count="0" type="stmt"/>
<line num="1737" count="0" type="stmt"/>
<line num="1738" count="0" type="stmt"/>
<line num="1739" count="0" type="stmt"/>
<line num="1740" count="0" type="stmt"/>
<line num="1743" count="0" type="stmt"/>
<line num="1751" count="0" type="stmt"/>
<line num="1752" count="0" type="stmt"/>
<line num="1757" count="0" type="stmt"/>
<line num="1759" count="0" type="stmt"/>
<line num="1762" count="0" type="stmt"/>
<line num="1778" count="3" type="stmt"/>
<line num="1779" count="3" type="stmt"/>
<line num="1780" count="3" type="stmt"/>
<line num="1781" count="7" type="cond" truecount="2" falsecount="0"/>
<line num="1782" count="6" type="stmt"/>
<line num="1783" count="6" type="stmt"/>
<line num="1785" count="3" type="stmt"/>
<line num="1789" count="3" type="stmt"/>
<line num="1790" count="3" type="cond" truecount="1" falsecount="1"/>
<line num="1791" count="3" type="cond" truecount="1" falsecount="1"/>
<line num="1792" count="3" type="stmt"/>
<line num="1797" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1799" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1804" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1806" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1809" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="1811" count="1" type="cond" truecount="2" falsecount="2"/>
<line num="1812" count="1" type="cond" truecount="2" falsecount="2"/>
<line num="1820" count="2" type="stmt"/>
<line num="1821" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="1822" count="2" type="stmt"/>
<line num="1823" count="2" type="stmt"/>
<line num="1826" count="2" type="stmt"/>
<line num="1827" count="2" type="stmt"/>
<line num="1832" count="2" type="stmt"/>
<line num="1838" count="2" type="stmt"/>
<line num="1839" count="4" type="stmt"/>
<line num="1852" count="2" type="stmt"/>
<line num="1855" count="3" type="stmt"/>
<line num="1860" count="3" type="stmt"/>
<line num="1865" count="0" type="stmt"/>
<line num="1866" count="0" type="stmt"/>
<line num="1867" count="0" type="stmt"/>
<line num="1869" count="0" type="stmt"/>
<line num="1870" count="0" type="stmt"/>
<line num="1874" count="3" type="stmt"/>
<line num="1894" count="2" type="stmt"/>
<line num="1895" count="2" type="stmt"/>
<line num="1896" count="2" type="stmt"/>
<line num="1898" count="0" type="stmt"/>
<line num="1899" count="0" type="stmt"/>
<line num="1903" count="3" type="stmt"/>
<line num="1916" count="0" type="stmt"/>
<line num="1917" count="0" type="stmt"/>
<line num="1919" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="1920" count="0" type="stmt"/>
<line num="1921" count="0" type="stmt"/>
<line num="1923" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="1924" count="0" type="stmt"/>
<line num="1925" count="0" type="stmt"/>
<line num="1928" count="0" type="stmt"/>
<line num="1931" count="3" type="stmt"/>
<line num="1944" count="0" type="stmt"/>
<line num="1945" count="0" type="stmt"/>
<line num="1948" count="3" type="stmt"/>
<line num="1963" count="0" type="stmt"/>
<line num="1964" count="0" type="stmt"/>
<line num="1965" count="0" type="stmt"/>
<line num="1967" count="0" type="stmt"/>
<line num="1968" count="0" type="stmt"/>
<line num="1972" count="3" type="stmt"/>
<line num="1986" count="0" type="stmt"/>
<line num="1987" count="0" type="stmt"/>
<line num="1988" count="0" type="stmt"/>
<line num="1990" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="1991" count="0" type="stmt"/>
<line num="1992" count="0" type="stmt"/>
<line num="1994" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="1995" count="0" type="stmt"/>
<line num="1996" count="0" type="stmt"/>
<line num="1999" count="0" type="stmt"/>
<line num="2002" count="3" type="stmt"/>
<line num="2026" count="0" type="stmt"/>
<line num="2027" count="0" type="stmt"/>
<line num="2028" count="0" type="stmt"/>
<line num="2029" count="0" type="stmt"/>
<line num="2030" count="0" type="stmt"/>
<line num="2031" count="0" type="stmt"/>
<line num="2032" count="0" type="stmt"/>
<line num="2033" count="0" type="stmt"/>
<line num="2034" count="0" type="stmt"/>
<line num="2037" count="0" type="stmt"/>
<line num="2039" count="0" type="stmt"/>
<line num="2040" count="0" type="stmt"/>
<line num="2044" count="3" type="stmt"/>
<line num="2055" count="0" type="stmt"/>
<line num="2056" count="0" type="stmt"/>
<line num="2057" count="0" type="stmt"/>
<line num="2058" count="0" type="stmt"/>
<line num="2059" count="0" type="stmt"/>
<line num="2060" count="0" type="stmt"/>
<line num="2061" count="0" type="stmt"/>
<line num="2062" count="0" type="stmt"/>
<line num="2063" count="0" type="stmt"/>
<line num="2066" count="0" type="stmt"/>
<line num="2068" count="0" type="stmt"/>
<line num="2069" count="0" type="stmt"/>
<line num="2126" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="2128" count="3" type="cond" truecount="1" falsecount="1"/>
<line num="2129" count="0" type="stmt"/>
</file>
<file name="provider-web.ts" path="/Users/steipete/Projects/warelay/src/provider-web.ts">
<metrics statements="112" coveredstatements="79" conditionals="87" coveredconditionals="38" methods="16" coveredmethods="14"/>
<line num="17" count="4" type="stmt"/>
<line num="20" count="4" type="stmt"/>
<line num="21" count="4" type="stmt"/>
<line num="22" count="4" type="stmt"/>
<line num="23" count="4" type="cond" truecount="1" falsecount="1"/>
<line num="24" count="4" type="stmt"/>
<line num="37" count="4" type="stmt"/>
<line num="38" count="4" type="stmt"/>
<line num="41" count="3" type="stmt"/>
<line num="42" count="3" type="cond" truecount="2" falsecount="2"/>
<line num="43" count="0" type="stmt"/>
<line num="44" count="0" type="stmt"/>
<line num="46" count="3" type="cond" truecount="1" falsecount="1"/>
<line num="47" count="0" type="stmt"/>
<line num="48" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="49" count="0" type="stmt"/>
<line num="54" count="3" type="cond" truecount="3" falsecount="1"/>
<line num="55" count="0" type="stmt"/>
<line num="60" count="4" type="stmt"/>
<line num="64" count="4" type="stmt"/>
<line num="68" count="4" type="stmt"/>
<line num="70" count="4" type="stmt"/>
<line num="71" count="4" type="cond" truecount="1" falsecount="1"/>
<line num="72" count="4" type="cond" truecount="2" falsecount="0"/>
<line num="73" count="3" type="stmt"/>
<line num="74" count="3" type="stmt"/>
<line num="76" count="4" type="cond" truecount="2" falsecount="0"/>
<line num="77" count="1" type="stmt"/>
<line num="78" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="82" count="4" type="stmt"/>
<line num="91" count="1" type="stmt"/>
<line num="92" count="1" type="stmt"/>
<line num="93" count="1" type="stmt"/>
<line num="94" count="1" type="stmt"/>
<line num="95" count="1" type="stmt"/>
<line num="96" count="1" type="stmt"/>
<line num="98" count="0" type="stmt"/>
<line num="100" count="1" type="stmt"/>
<line num="101" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="102" count="1" type="stmt"/>
<line num="104" count="1" type="stmt"/>
<line num="105" count="1" type="stmt"/>
<line num="107" count="0" type="stmt"/>
<line num="116" count="1" type="stmt"/>
<line num="117" count="1" type="stmt"/>
<line num="118" count="1" type="stmt"/>
<line num="119" count="1" type="stmt"/>
<line num="120" count="1" type="stmt"/>
<line num="123" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="126" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="127" count="0" type="stmt"/>
<line num="132" count="0" type="stmt"/>
<line num="134" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="135" count="0" type="stmt"/>
<line num="136" count="0" type="stmt"/>
<line num="141" count="0" type="stmt"/>
<line num="143" count="0" type="stmt"/>
<line num="144" count="0" type="stmt"/>
<line num="149" count="0" type="stmt"/>
<line num="151" count="1" type="stmt"/>
<line num="152" count="1" type="stmt"/>
<line num="153" count="1" type="stmt"/>
<line num="178" count="1" type="stmt"/>
<line num="179" count="1" type="stmt"/>
<line num="180" count="1" type="stmt"/>
<line num="181" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="182" count="1" type="stmt"/>
<line num="184" count="1" type="stmt"/>
<line num="185" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="186" count="1" type="stmt"/>
<line num="187" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="189" count="1" type="cond" truecount="3" falsecount="1"/>
<line num="190" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="191" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="192" count="1" type="stmt"/>
<line num="193" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="195" count="1" type="cond" truecount="3" falsecount="1"/>
<line num="196" count="0" type="stmt"/>
<line num="197" count="1" type="stmt"/>
<line num="198" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="199" count="1" type="stmt"/>
<line num="200" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="201" count="1" type="stmt"/>
<line num="202" count="1" type="stmt"/>
<line num="203" count="1" type="stmt"/>
<line num="204" count="1" type="stmt"/>
<line num="206" count="0" type="stmt"/>
<line num="209" count="1" type="stmt"/>
<line num="210" count="1" type="stmt"/>
<line num="212" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="215" count="1" type="stmt"/>
<line num="216" count="1" type="stmt"/>
<line num="227" count="0" type="stmt"/>
<line num="232" count="1" type="stmt"/>
<line num="234" count="1" type="stmt"/>
<line num="235" count="1" type="stmt"/>
<line num="237" count="0" type="stmt"/>
<line num="244" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="245" count="1" type="cond" truecount="3" falsecount="1"/>
<line num="246" count="1" type="stmt"/>
<line num="248" count="0" type="stmt"/>
<line num="249" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="250" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="251" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="252" count="0" type="stmt"/>
<line num="256" count="0" type="stmt"/>
<line num="263" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="264" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="265" count="0" type="stmt"/>
<line num="266" count="0" type="stmt"/>
<line num="267" count="0" type="cond" truecount="0" falsecount="8"/>
<line num="268" count="0" type="stmt"/>
</file>
<file name="utils.ts" path="/Users/steipete/Projects/warelay/src/utils.ts">
<metrics statements="19" coveredstatements="19" conditionals="12" coveredconditionals="11" methods="9" coveredmethods="9"/>
<line num="5" count="5" type="stmt"/>
<line num="11" count="6" type="cond" truecount="4" falsecount="0"/>
<line num="12" count="2" type="stmt"/>
<line num="17" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="18" count="2" type="stmt"/>
<line num="22" count="13" type="cond" truecount="2" falsecount="0"/>
<line num="26" count="10" type="stmt"/>
<line num="27" count="10" type="stmt"/>
<line num="28" count="10" type="cond" truecount="2" falsecount="0"/>
<line num="29" count="2" type="stmt"/>
<line num="33" count="3" type="stmt"/>
<line num="34" count="3" type="stmt"/>
<line num="35" count="3" type="stmt"/>
<line num="40" count="2" type="stmt"/>
<line num="41" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="42" count="2" type="stmt"/>
<line num="43" count="2" type="stmt"/>
<line num="47" count="833" type="stmt"/>
<line num="50" count="5" type="stmt"/>
</file>
</package>
<package name="src.commands">
<metrics statements="53" coveredstatements="20" conditionals="42" coveredconditionals="19" methods="4" coveredmethods="2"/>
<file name="send.ts" path="/Users/steipete/Projects/warelay/src/commands/send.ts">
<metrics statements="16" coveredstatements="12" conditionals="16" coveredconditionals="11" methods="1" coveredmethods="1"/>
<line num="15" count="2" type="stmt"/>
<line num="16" count="2" type="stmt"/>
<line num="17" count="2" type="stmt"/>
<line num="19" count="2" type="cond" truecount="3" falsecount="1"/>
<line num="20" count="0" type="stmt"/>
<line num="22" count="2" type="cond" truecount="3" falsecount="1"/>
<line num="23" count="0" type="stmt"/>
<line num="26" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="27" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="28" count="0" type="stmt"/>
<line num="30" count="1" type="stmt"/>
<line num="31" count="1" type="stmt"/>
<line num="34" count="1" type="stmt"/>
<line num="35" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="36" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="37" count="0" type="stmt"/>
</file>
<file name="status.ts" path="/Users/steipete/Projects/warelay/src/commands/status.ts">
<metrics statements="15" coveredstatements="8" conditionals="13" coveredconditionals="8" methods="1" coveredmethods="1"/>
<line num="9" count="1" type="stmt"/>
<line num="10" count="1" type="stmt"/>
<line num="11" count="1" type="cond" truecount="4" falsecount="1"/>
<line num="12" count="0" type="stmt"/>
<line num="14" count="1" type="cond" truecount="3" falsecount="1"/>
<line num="15" count="0" type="stmt"/>
<line num="18" count="1" type="stmt"/>
<line num="19" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="20" count="1" type="stmt"/>
<line num="21" count="1" type="stmt"/>
<line num="23" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="24" count="0" type="stmt"/>
<line num="25" count="0" type="stmt"/>
<line num="27" count="0" type="stmt"/>
<line num="28" count="0" type="stmt"/>
</file>
<file name="up.ts" path="/Users/steipete/Projects/warelay/src/commands/up.ts">
<metrics statements="16" coveredstatements="0" conditionals="8" coveredconditionals="0" methods="1" coveredmethods="0"/>
<line num="10" count="0" type="stmt"/>
<line num="11" count="0" type="cond" truecount="0" falsecount="5"/>
<line num="12" count="0" type="stmt"/>
<line num="15" count="0" type="stmt"/>
<line num="16" count="0" type="stmt"/>
<line num="17" count="0" type="stmt"/>
<line num="18" count="0" type="stmt"/>
<line num="19" count="0" type="stmt"/>
<line num="20" count="0" type="stmt"/>
<line num="21" count="0" type="stmt"/>
<line num="23" count="0" type="stmt"/>
<line num="31" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="32" count="0" type="stmt"/>
<line num="38" count="0" type="stmt"/>
<line num="46" count="0" type="stmt"/>
<line num="50" count="0" type="stmt"/>
</file>
<file name="webhook.ts" path="/Users/steipete/Projects/warelay/src/commands/webhook.ts">
<metrics statements="6" coveredstatements="0" conditionals="5" coveredconditionals="0" methods="1" coveredmethods="0"/>
<line num="8" count="0" type="stmt"/>
<line num="9" count="0" type="cond" truecount="0" falsecount="5"/>
<line num="10" count="0" type="stmt"/>
<line num="12" count="0" type="stmt"/>
<line num="13" count="0" type="stmt"/>
<line num="20" count="0" type="stmt"/>
</file>
</package>
<package name="test.mocks">
<metrics statements="25" coveredstatements="24" conditionals="0" coveredconditionals="0" methods="13" coveredmethods="8"/>
<file name="baileys.ts" path="/Users/steipete/Projects/warelay/test/mocks/baileys.ts">
<metrics statements="13" coveredstatements="12" conditionals="0" coveredconditionals="0" methods="7" coveredmethods="6"/>
<line num="22" count="7" type="stmt"/>
<line num="23" count="7" type="stmt"/>
<line num="24" count="3" type="stmt"/>
<line num="25" count="3" type="stmt"/>
<line num="32" count="3" type="stmt"/>
<line num="33" count="3" type="stmt"/>
<line num="34" count="3" type="stmt"/>
<line num="37" count="7" type="stmt"/>
<line num="40" count="4" type="stmt"/>
<line num="42" count="4" type="stmt"/>
<line num="46" count="0" type="stmt"/>
<line num="49" count="7" type="stmt"/>
<line num="51" count="3" type="stmt"/>
</file>
<file name="twilio.ts" path="/Users/steipete/Projects/warelay/test/mocks/twilio.ts">
<metrics statements="12" coveredstatements="12" conditionals="0" coveredconditionals="0" methods="6" coveredmethods="2"/>
<line num="18" count="1" type="stmt"/>
<line num="19" count="1" type="stmt"/>
<line num="20" count="1" type="stmt"/>
<line num="22" count="1" type="stmt"/>
<line num="26" count="1" type="stmt"/>
<line num="28" count="1" type="stmt"/>
<line num="30" count="1" type="stmt"/>
<line num="33" count="1" type="stmt"/>
<line num="35" count="1" type="stmt"/>
<line num="45" count="2" type="stmt"/>
<line num="46" count="1" type="stmt"/>
<line num="48" count="1" type="stmt"/>
</file>
</package>
</project>
</coverage>

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 445 B

View File

@@ -1,146 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for All files</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>All files</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">58.62% </span>
<span class="quiet">Statements</span>
<span class='fraction'>581/991</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">48.09% </span>
<span class="quiet">Branches</span>
<span class='fraction'>341/709</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">70.27% </span>
<span class="quiet">Functions</span>
<span class='fraction'>104/148</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">61.17% </span>
<span class="quiet">Lines</span>
<span class='fraction'>561/917</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="src"><a href="src/index.html">src</a></td>
<td data-value="59" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 59%"></div><div class="cover-empty" style="width: 41%"></div></div>
</td>
<td data-value="59" class="pct medium">59%</td>
<td data-value="905" class="abs medium">534/905</td>
<td data-value="48.27" class="pct low">48.27%</td>
<td data-value="667" class="abs low">322/667</td>
<td data-value="71.75" class="pct medium">71.75%</td>
<td data-value="131" class="abs medium">94/131</td>
<td data-value="61.62" class="pct medium">61.62%</td>
<td data-value="839" class="abs medium">517/839</td>
</tr>
<tr>
<td class="file low" data-value="src/commands"><a href="src/commands/index.html">src/commands</a></td>
<td data-value="38.18" class="pic low">
<div class="chart"><div class="cover-fill" style="width: 38%"></div><div class="cover-empty" style="width: 62%"></div></div>
</td>
<td data-value="38.18" class="pct low">38.18%</td>
<td data-value="55" class="abs low">21/55</td>
<td data-value="45.23" class="pct low">45.23%</td>
<td data-value="42" class="abs low">19/42</td>
<td data-value="50" class="pct medium">50%</td>
<td data-value="4" class="abs medium">2/4</td>
<td data-value="37.73" class="pct low">37.73%</td>
<td data-value="53" class="abs low">20/53</td>
</tr>
<tr>
<td class="file high" data-value="test/mocks"><a href="test/mocks/index.html">test/mocks</a></td>
<td data-value="83.87" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 83%"></div><div class="cover-empty" style="width: 17%"></div></div>
</td>
<td data-value="83.87" class="pct high">83.87%</td>
<td data-value="31" class="abs high">26/31</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="61.53" class="pct medium">61.53%</td>
<td data-value="13" class="abs medium">8/13</td>
<td data-value="96" class="pct high">96%</td>
<td data-value="25" class="abs high">24/25</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T22:47:29.691Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View File

@@ -1 +0,0 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

View File

@@ -1,210 +0,0 @@
/* eslint-disable */
var addSorting = (function() {
'use strict';
var cols,
currentSort = {
index: 0,
desc: false
};
// returns the summary table element
function getTable() {
return document.querySelector('.coverage-summary');
}
// returns the thead element of the summary table
function getTableHeader() {
return getTable().querySelector('thead tr');
}
// returns the tbody element of the summary table
function getTableBody() {
return getTable().querySelector('tbody');
}
// returns the th element for nth column
function getNthColumn(n) {
return getTableHeader().querySelectorAll('th')[n];
}
function onFilterInput() {
const searchValue = document.getElementById('fileSearch').value;
const rows = document.getElementsByTagName('tbody')[0].children;
// Try to create a RegExp from the searchValue. If it fails (invalid regex),
// it will be treated as a plain text search
let searchRegex;
try {
searchRegex = new RegExp(searchValue, 'i'); // 'i' for case-insensitive
} catch (error) {
searchRegex = null;
}
for (let i = 0; i < rows.length; i++) {
const row = rows[i];
let isMatch = false;
if (searchRegex) {
// If a valid regex was created, use it for matching
isMatch = searchRegex.test(row.textContent);
} else {
// Otherwise, fall back to the original plain text search
isMatch = row.textContent
.toLowerCase()
.includes(searchValue.toLowerCase());
}
row.style.display = isMatch ? '' : 'none';
}
}
// loads the search box
function addSearchBox() {
var template = document.getElementById('filterTemplate');
var templateClone = template.content.cloneNode(true);
templateClone.getElementById('fileSearch').oninput = onFilterInput;
template.parentElement.appendChild(templateClone);
}
// loads all columns
function loadColumns() {
var colNodes = getTableHeader().querySelectorAll('th'),
colNode,
cols = [],
col,
i;
for (i = 0; i < colNodes.length; i += 1) {
colNode = colNodes[i];
col = {
key: colNode.getAttribute('data-col'),
sortable: !colNode.getAttribute('data-nosort'),
type: colNode.getAttribute('data-type') || 'string'
};
cols.push(col);
if (col.sortable) {
col.defaultDescSort = col.type === 'number';
colNode.innerHTML =
colNode.innerHTML + '<span class="sorter"></span>';
}
}
return cols;
}
// attaches a data attribute to every tr element with an object
// of data values keyed by column name
function loadRowData(tableRow) {
var tableCols = tableRow.querySelectorAll('td'),
colNode,
col,
data = {},
i,
val;
for (i = 0; i < tableCols.length; i += 1) {
colNode = tableCols[i];
col = cols[i];
val = colNode.getAttribute('data-value');
if (col.type === 'number') {
val = Number(val);
}
data[col.key] = val;
}
return data;
}
// loads all row data
function loadData() {
var rows = getTableBody().querySelectorAll('tr'),
i;
for (i = 0; i < rows.length; i += 1) {
rows[i].data = loadRowData(rows[i]);
}
}
// sorts the table using the data for the ith column
function sortByIndex(index, desc) {
var key = cols[index].key,
sorter = function(a, b) {
a = a.data[key];
b = b.data[key];
return a < b ? -1 : a > b ? 1 : 0;
},
finalSorter = sorter,
tableBody = document.querySelector('.coverage-summary tbody'),
rowNodes = tableBody.querySelectorAll('tr'),
rows = [],
i;
if (desc) {
finalSorter = function(a, b) {
return -1 * sorter(a, b);
};
}
for (i = 0; i < rowNodes.length; i += 1) {
rows.push(rowNodes[i]);
tableBody.removeChild(rowNodes[i]);
}
rows.sort(finalSorter);
for (i = 0; i < rows.length; i += 1) {
tableBody.appendChild(rows[i]);
}
}
// removes sort indicators for current column being sorted
function removeSortIndicators() {
var col = getNthColumn(currentSort.index),
cls = col.className;
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
col.className = cls;
}
// adds sort indicators for current column being sorted
function addSortIndicators() {
getNthColumn(currentSort.index).className += currentSort.desc
? ' sorted-desc'
: ' sorted';
}
// adds event listeners for all sorter widgets
function enableUI() {
var i,
el,
ithSorter = function ithSorter(i) {
var col = cols[i];
return function() {
var desc = col.defaultDescSort;
if (currentSort.index === i) {
desc = !currentSort.desc;
}
sortByIndex(i, desc);
removeSortIndicators();
currentSort.index = i;
currentSort.desc = desc;
addSortIndicators();
};
};
for (i = 0; i < cols.length; i += 1) {
if (cols[i].sortable) {
// add the click event handler on the th so users
// dont have to click on those tiny arrows
el = getNthColumn(i).querySelector('.sorter').parentElement;
if (el.addEventListener) {
el.addEventListener('click', ithSorter(i));
} else {
el.attachEvent('onclick', ithSorter(i));
}
}
}
}
// adds sorting functionality to the UI
return function() {
if (!getTable()) {
return;
}
cols = loadColumns();
loadData();
addSearchBox();
addSortIndicators();
enableUI();
};
})();
window.addEventListener('load', addSorting);

View File

@@ -1,161 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/commands</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> src/commands</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">38.18% </span>
<span class="quiet">Statements</span>
<span class='fraction'>21/55</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">45.23% </span>
<span class="quiet">Branches</span>
<span class='fraction'>19/42</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">50% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">37.73% </span>
<span class="quiet">Lines</span>
<span class='fraction'>20/53</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line low'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="send.ts"><a href="send.ts.html">send.ts</a></td>
<td data-value="72.22" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 72%"></div><div class="cover-empty" style="width: 28%"></div></div>
</td>
<td data-value="72.22" class="pct medium">72.22%</td>
<td data-value="18" class="abs medium">13/18</td>
<td data-value="68.75" class="pct medium">68.75%</td>
<td data-value="16" class="abs medium">11/16</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="75" class="pct medium">75%</td>
<td data-value="16" class="abs medium">12/16</td>
</tr>
<tr>
<td class="file medium" data-value="status.ts"><a href="status.ts.html">status.ts</a></td>
<td data-value="53.33" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 53%"></div><div class="cover-empty" style="width: 47%"></div></div>
</td>
<td data-value="53.33" class="pct medium">53.33%</td>
<td data-value="15" class="abs medium">8/15</td>
<td data-value="61.53" class="pct medium">61.53%</td>
<td data-value="13" class="abs medium">8/13</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="53.33" class="pct medium">53.33%</td>
<td data-value="15" class="abs medium">8/15</td>
</tr>
<tr>
<td class="file low" data-value="up.ts"><a href="up.ts.html">up.ts</a></td>
<td data-value="0" class="pic low">
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="16" class="abs low">0/16</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="8" class="abs low">0/8</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="1" class="abs low">0/1</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="16" class="abs low">0/16</td>
</tr>
<tr>
<td class="file low" data-value="webhook.ts"><a href="webhook.ts.html">webhook.ts</a></td>
<td data-value="0" class="pic low">
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="6" class="abs low">0/6</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="5" class="abs low">0/5</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="1" class="abs low">0/1</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="6" class="abs low">0/6</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T22:47:29.691Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@@ -1,217 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/commands/send.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/commands</a> send.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">72.22% </span>
<span class="quiet">Statements</span>
<span class='fraction'>13/18</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">68.75% </span>
<span class="quiet">Branches</span>
<span class='fraction'>11/16</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">75% </span>
<span class="quiet">Lines</span>
<span class='fraction'>12/16</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { info } from "../globals.js";
import type { CliDeps, Provider, RuntimeEnv } from "../index.js";
&nbsp;
export async function sendCommand(
opts: {
to: string;
message: string;
wait: string;
poll: string;
provider: Provider;
},
deps: CliDeps,
runtime: RuntimeEnv,
) {
deps.assertProvider(opts.provider);
const waitSeconds = Number.parseInt(opts.wait, 10);
const pollSeconds = Number.parseInt(opts.poll, 10);
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (Number.isNaN(waitSeconds) || waitSeconds &lt; 0) {
<span class="cstat-no" title="statement not covered" > throw new Error("Wait must be &gt;= 0 seconds");</span>
}
<span class="missing-if-branch" title="if path not taken" >I</span>if (Number.isNaN(pollSeconds) || pollSeconds &lt;= 0) {
<span class="cstat-no" title="statement not covered" > throw new Error("Poll must be &gt; 0 seconds");</span>
}
&nbsp;
if (opts.provider === "web") {
<span class="missing-if-branch" title="if path not taken" >I</span>if (waitSeconds !== 0) {
<span class="cstat-no" title="statement not covered" > runtime.log(info("Wait/poll are Twilio-only; ignored for provider=web."));</span>
}
await deps.sendMessageWeb(opts.to, opts.message, { verbose: false });
return;
}
&nbsp;
const result = await deps.sendMessage(opts.to, opts.message, runtime);
<span class="missing-if-branch" title="if path not taken" >I</span>if (!result) <span class="cstat-no" title="statement not covered" >return;</span>
<span class="missing-if-branch" title="else path not taken" >E</span>if (waitSeconds === 0) return;
<span class="cstat-no" title="statement not covered" > await deps.waitForFinalStatus(</span>
result.client,
result.sid,
waitSeconds,
pollSeconds,
runtime,
);
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T22:47:29.691Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@@ -1,175 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/commands/status.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/commands</a> status.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">53.33% </span>
<span class="quiet">Statements</span>
<span class='fraction'>8/15</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">61.53% </span>
<span class="quiet">Branches</span>
<span class='fraction'>8/13</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">53.33% </span>
<span class="quiet">Lines</span>
<span class='fraction'>8/15</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { formatMessageLine } from "../index.js";
import type { CliDeps, RuntimeEnv } from "../index.js";
&nbsp;
export async function statusCommand(
opts: { limit: string; lookback: string; json?: boolean },
deps: CliDeps,
runtime: RuntimeEnv,
) {
const limit = Number.parseInt(opts.limit, 10);
const lookbackMinutes = Number.parseInt(opts.lookback, 10);
<span class="missing-if-branch" title="if path not taken" >I</span>if (Number.isNaN(limit) || limit &lt;= 0 || limit &gt; 200) {
<span class="cstat-no" title="statement not covered" > throw new Error("limit must be between 1 and 200");</span>
}
<span class="missing-if-branch" title="if path not taken" >I</span>if (Number.isNaN(lookbackMinutes) || lookbackMinutes &lt;= 0) {
<span class="cstat-no" title="statement not covered" > throw new Error("lookback must be &gt; 0 minutes");</span>
}
&nbsp;
const messages = await deps.listRecentMessages(lookbackMinutes, limit);
<span class="missing-if-branch" title="else path not taken" >E</span>if (opts.json) {
runtime.log(JSON.stringify(messages, null, 2));
return;
}
<span class="cstat-no" title="statement not covered" > if (messages.length === 0) {</span>
<span class="cstat-no" title="statement not covered" > runtime.log("No messages found in the requested window.");</span>
<span class="cstat-no" title="statement not covered" > return;</span>
}
<span class="cstat-no" title="statement not covered" > for (const m of messages) {</span>
<span class="cstat-no" title="statement not covered" > runtime.log(formatMessageLine(m));</span>
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T22:47:29.691Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@@ -1,238 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/commands/up.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/commands</a> up.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/16</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/16</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import type { CliDeps, RuntimeEnv } from "../index.js";
import { waitForever as defaultWaitForever } from "../index.js";
&nbsp;
export async function <span class="fstat-no" title="function not covered" >upCommand(</span>
opts: { port: string; path: string; verbose?: boolean; yes?: boolean },
deps: CliDeps,
runtime: RuntimeEnv,
waiter: typeof defaultWaitForever = <span class="branch-0 cbranch-no" title="branch not covered" >defaultWaitForever,</span>
) {
const port = <span class="cstat-no" title="statement not covered" >Number.parseInt(opts.port, 10);</span>
<span class="cstat-no" title="statement not covered" > if (Number.isNaN(port) || port &lt;= 0 || port &gt;= 65536) {</span>
<span class="cstat-no" title="statement not covered" > throw new Error("Port must be between 1 and 65535");</span>
}
&nbsp;
<span class="cstat-no" title="statement not covered" > await deps.ensurePortAvailable(port);</span>
const env = <span class="cstat-no" title="statement not covered" >deps.readEnv(runtime);</span>
<span class="cstat-no" title="statement not covered" > await deps.ensureBinary("tailscale", undefined, runtime);</span>
<span class="cstat-no" title="statement not covered" > await deps.ensureFunnel(port, undefined, runtime);</span>
const host = <span class="cstat-no" title="statement not covered" >await deps.getTailnetHostname();</span>
const publicUrl = <span class="cstat-no" title="statement not covered" >`https://${host}${opts.path}`;</span>
<span class="cstat-no" title="statement not covered" > runtime.log(`🌐 Public webhook URL (via Funnel): ${publicUrl}`);</span>
&nbsp;
const server = <span class="cstat-no" title="statement not covered" >await deps.startWebhook(</span>
port,
opts.path,
undefined,
Boolean(opts.verbose),
runtime,
);
&nbsp;
const twilioClient = <span class="cstat-no" title="statement not covered" >deps.createClient ? deps.createClient(env) : undefined;</span>
const senderSid = <span class="cstat-no" title="statement not covered" >await deps.findWhatsappSenderSid(</span>
twilioClient as any,
env.whatsappFrom,
env.whatsappSenderSid,
runtime,
);
<span class="cstat-no" title="statement not covered" > await deps.updateWebhook(</span>
twilioClient as any,
senderSid,
publicUrl,
"POST",
runtime,
);
&nbsp;
<span class="cstat-no" title="statement not covered" > runtime.log(</span>
"\nSetup complete. Leave this process running to keep the webhook online. Ctrl+C to stop.",
);
&nbsp;
<span class="cstat-no" title="statement not covered" > return { server, publicUrl, senderSid, waiter };</span>
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T22:47:29.691Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@@ -1,148 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/commands/webhook.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/commands</a> webhook.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/5</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/6</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import type { CliDeps, RuntimeEnv } from "../index.js";
&nbsp;
export async function <span class="fstat-no" title="function not covered" >webhookCommand(</span>
opts: { port: string; path: string; reply?: string; verbose?: boolean; yes?: boolean },
deps: CliDeps,
runtime: RuntimeEnv,
) {
const port = <span class="cstat-no" title="statement not covered" >Number.parseInt(opts.port, 10);</span>
<span class="cstat-no" title="statement not covered" > if (Number.isNaN(port) || port &lt;= 0 || port &gt;= 65536) {</span>
<span class="cstat-no" title="statement not covered" > throw new Error("Port must be between 1 and 65535");</span>
}
<span class="cstat-no" title="statement not covered" > await deps.ensurePortAvailable(port);</span>
const server = <span class="cstat-no" title="statement not covered" >await deps.startWebhook(</span>
port,
opts.path,
opts.reply,
Boolean(opts.verbose),
runtime,
);
<span class="cstat-no" title="statement not covered" > return server;</span>
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T22:47:29.691Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@@ -1,172 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/globals.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> globals.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>12/12</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>5/5</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>11/11</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import chalk from "chalk";
&nbsp;
let globalVerbose = false;
let globalYes = false;
&nbsp;
export function setVerbose(v: boolean) {
globalVerbose = v;
}
&nbsp;
export function isVerbose() {
return globalVerbose;
}
&nbsp;
export function logVerbose(message: string) {
if (globalVerbose) console.log(chalk.gray(message));
}
&nbsp;
export function setYes(v: boolean) {
globalYes = v;
}
&nbsp;
export function isYes() {
return globalYes;
}
&nbsp;
export const success = chalk.green;
export const warn = chalk.yellow;
export const info = chalk.cyan;
export const danger = chalk.red;
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T22:47:29.691Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View File

@@ -1,161 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> src</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">59% </span>
<span class="quiet">Statements</span>
<span class='fraction'>534/905</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">48.27% </span>
<span class="quiet">Branches</span>
<span class='fraction'>322/667</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">71.75% </span>
<span class="quiet">Functions</span>
<span class='fraction'>94/131</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">61.62% </span>
<span class="quiet">Lines</span>
<span class='fraction'>517/839</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="globals.ts"><a href="globals.ts.html">globals.ts</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="12" class="abs high">12/12</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="5" class="abs high">5/5</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="11" class="abs high">11/11</td>
</tr>
<tr>
<td class="file medium" data-value="index.ts"><a href="index.ts.html">index.ts</a></td>
<td data-value="56.37" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 56%"></div><div class="cover-empty" style="width: 44%"></div></div>
</td>
<td data-value="56.37" class="pct medium">56.37%</td>
<td data-value="745" class="abs medium">420/745</td>
<td data-value="47.87" class="pct low">47.87%</td>
<td data-value="566" class="abs low">271/566</td>
<td data-value="65.34" class="pct medium">65.34%</td>
<td data-value="101" class="abs medium">66/101</td>
<td data-value="58.53" class="pct medium">58.53%</td>
<td data-value="697" class="abs medium">408/697</td>
</tr>
<tr>
<td class="file medium" data-value="provider-web.ts"><a href="provider-web.ts.html">provider-web.ts</a></td>
<td data-value="64" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 64%"></div><div class="cover-empty" style="width: 36%"></div></div>
</td>
<td data-value="64" class="pct medium">64%</td>
<td data-value="125" class="abs medium">80/125</td>
<td data-value="43.67" class="pct low">43.67%</td>
<td data-value="87" class="abs low">38/87</td>
<td data-value="87.5" class="pct high">87.5%</td>
<td data-value="16" class="abs high">14/16</td>
<td data-value="70.53" class="pct medium">70.53%</td>
<td data-value="112" class="abs medium">79/112</td>
</tr>
<tr>
<td class="file high" data-value="utils.ts"><a href="utils.ts.html">utils.ts</a></td>
<td data-value="95.65" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 95%"></div><div class="cover-empty" style="width: 5%"></div></div>
</td>
<td data-value="95.65" class="pct high">95.65%</td>
<td data-value="23" class="abs high">22/23</td>
<td data-value="91.66" class="pct high">91.66%</td>
<td data-value="12" class="abs high">11/12</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="9" class="abs high">9/9</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="19" class="abs high">19/19</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T22:47:29.691Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,892 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/provider-web.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> provider-web.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">64% </span>
<span class="quiet">Statements</span>
<span class='fraction'>80/125</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">43.67% </span>
<span class="quiet">Branches</span>
<span class='fraction'>38/87</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">87.5% </span>
<span class="quiet">Functions</span>
<span class='fraction'>14/16</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">70.53% </span>
<span class="quiet">Lines</span>
<span class='fraction'>79/112</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</a>
<a name='L174'></a><a href='#L174'>174</a>
<a name='L175'></a><a href='#L175'>175</a>
<a name='L176'></a><a href='#L176'>176</a>
<a name='L177'></a><a href='#L177'>177</a>
<a name='L178'></a><a href='#L178'>178</a>
<a name='L179'></a><a href='#L179'>179</a>
<a name='L180'></a><a href='#L180'>180</a>
<a name='L181'></a><a href='#L181'>181</a>
<a name='L182'></a><a href='#L182'>182</a>
<a name='L183'></a><a href='#L183'>183</a>
<a name='L184'></a><a href='#L184'>184</a>
<a name='L185'></a><a href='#L185'>185</a>
<a name='L186'></a><a href='#L186'>186</a>
<a name='L187'></a><a href='#L187'>187</a>
<a name='L188'></a><a href='#L188'>188</a>
<a name='L189'></a><a href='#L189'>189</a>
<a name='L190'></a><a href='#L190'>190</a>
<a name='L191'></a><a href='#L191'>191</a>
<a name='L192'></a><a href='#L192'>192</a>
<a name='L193'></a><a href='#L193'>193</a>
<a name='L194'></a><a href='#L194'>194</a>
<a name='L195'></a><a href='#L195'>195</a>
<a name='L196'></a><a href='#L196'>196</a>
<a name='L197'></a><a href='#L197'>197</a>
<a name='L198'></a><a href='#L198'>198</a>
<a name='L199'></a><a href='#L199'>199</a>
<a name='L200'></a><a href='#L200'>200</a>
<a name='L201'></a><a href='#L201'>201</a>
<a name='L202'></a><a href='#L202'>202</a>
<a name='L203'></a><a href='#L203'>203</a>
<a name='L204'></a><a href='#L204'>204</a>
<a name='L205'></a><a href='#L205'>205</a>
<a name='L206'></a><a href='#L206'>206</a>
<a name='L207'></a><a href='#L207'>207</a>
<a name='L208'></a><a href='#L208'>208</a>
<a name='L209'></a><a href='#L209'>209</a>
<a name='L210'></a><a href='#L210'>210</a>
<a name='L211'></a><a href='#L211'>211</a>
<a name='L212'></a><a href='#L212'>212</a>
<a name='L213'></a><a href='#L213'>213</a>
<a name='L214'></a><a href='#L214'>214</a>
<a name='L215'></a><a href='#L215'>215</a>
<a name='L216'></a><a href='#L216'>216</a>
<a name='L217'></a><a href='#L217'>217</a>
<a name='L218'></a><a href='#L218'>218</a>
<a name='L219'></a><a href='#L219'>219</a>
<a name='L220'></a><a href='#L220'>220</a>
<a name='L221'></a><a href='#L221'>221</a>
<a name='L222'></a><a href='#L222'>222</a>
<a name='L223'></a><a href='#L223'>223</a>
<a name='L224'></a><a href='#L224'>224</a>
<a name='L225'></a><a href='#L225'>225</a>
<a name='L226'></a><a href='#L226'>226</a>
<a name='L227'></a><a href='#L227'>227</a>
<a name='L228'></a><a href='#L228'>228</a>
<a name='L229'></a><a href='#L229'>229</a>
<a name='L230'></a><a href='#L230'>230</a>
<a name='L231'></a><a href='#L231'>231</a>
<a name='L232'></a><a href='#L232'>232</a>
<a name='L233'></a><a href='#L233'>233</a>
<a name='L234'></a><a href='#L234'>234</a>
<a name='L235'></a><a href='#L235'>235</a>
<a name='L236'></a><a href='#L236'>236</a>
<a name='L237'></a><a href='#L237'>237</a>
<a name='L238'></a><a href='#L238'>238</a>
<a name='L239'></a><a href='#L239'>239</a>
<a name='L240'></a><a href='#L240'>240</a>
<a name='L241'></a><a href='#L241'>241</a>
<a name='L242'></a><a href='#L242'>242</a>
<a name='L243'></a><a href='#L243'>243</a>
<a name='L244'></a><a href='#L244'>244</a>
<a name='L245'></a><a href='#L245'>245</a>
<a name='L246'></a><a href='#L246'>246</a>
<a name='L247'></a><a href='#L247'>247</a>
<a name='L248'></a><a href='#L248'>248</a>
<a name='L249'></a><a href='#L249'>249</a>
<a name='L250'></a><a href='#L250'>250</a>
<a name='L251'></a><a href='#L251'>251</a>
<a name='L252'></a><a href='#L252'>252</a>
<a name='L253'></a><a href='#L253'>253</a>
<a name='L254'></a><a href='#L254'>254</a>
<a name='L255'></a><a href='#L255'>255</a>
<a name='L256'></a><a href='#L256'>256</a>
<a name='L257'></a><a href='#L257'>257</a>
<a name='L258'></a><a href='#L258'>258</a>
<a name='L259'></a><a href='#L259'>259</a>
<a name='L260'></a><a href='#L260'>260</a>
<a name='L261'></a><a href='#L261'>261</a>
<a name='L262'></a><a href='#L262'>262</a>
<a name='L263'></a><a href='#L263'>263</a>
<a name='L264'></a><a href='#L264'>264</a>
<a name='L265'></a><a href='#L265'>265</a>
<a name='L266'></a><a href='#L266'>266</a>
<a name='L267'></a><a href='#L267'>267</a>
<a name='L268'></a><a href='#L268'>268</a>
<a name='L269'></a><a href='#L269'>269</a>
<a name='L270'></a><a href='#L270'>270</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import {
DisconnectReason,
fetchLatestBaileysVersion,
makeCacheableSignalKeyStore,
makeWASocket,
useMultiFileAuthState,
} from "baileys";
import type { proto } from "baileys";
import pino from "pino";
import qrcode from "qrcode-terminal";
import { danger, info, logVerbose, success } from "./globals.js";
import { ensureDir, jidToE164, toWhatsappJid } from "./utils.js";
&nbsp;
const WA_WEB_AUTH_DIR = path.join(os.homedir(), ".warelay", "waweb");
&nbsp;
export async function createWaSocket(printQr: boolean, verbose: boolean) {
await ensureDir(WA_WEB_AUTH_DIR);
const { state, saveCreds } = await useMultiFileAuthState(WA_WEB_AUTH_DIR);
const { version } = await fetchLatestBaileysVersion();
const logger = pino({ level: verbose ? <span class="branch-0 cbranch-no" title="branch not covered" >"info" : "</span>silent" });
const sock = makeWASocket({
auth: {
creds: state.creds,
keys: makeCacheableSignalKeyStore(state.keys, logger),
},
version,
logger,
printQRInTerminal: false,
browser: ["Warelay", "CLI", "1.0.0"],
syncFullHistory: false,
markOnlineOnConnect: false,
});
&nbsp;
sock.ev.on("creds.update", saveCreds);
sock.ev.on(
"connection.update",
(update: Partial&lt;import("baileys").ConnectionState&gt;) =&gt; {
const { connection, lastDisconnect, qr } = update;
<span class="missing-if-branch" title="if path not taken" >I</span>if (qr &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >printQr) {</span>
<span class="cstat-no" title="statement not covered" > console.log("Scan this QR in WhatsApp (Linked Devices):");</span>
<span class="cstat-no" title="statement not covered" > qrcode.generate(qr, { small: true });</span>
}
<span class="missing-if-branch" title="if path not taken" >I</span>if (connection === "close") {
const status = <span class="cstat-no" title="statement not covered" >getStatusCode(lastDisconnect?.error);</span>
<span class="cstat-no" title="statement not covered" > if (status === DisconnectReason.loggedOut) {</span>
<span class="cstat-no" title="statement not covered" > console.error(</span>
danger("WhatsApp session logged out. Run: warelay web:login"),
);
}
}
<span class="missing-if-branch" title="if path not taken" >I</span>if (connection === "open" &amp;&amp; verbose) {
<span class="cstat-no" title="statement not covered" > console.log(success("WhatsApp Web connected."));</span>
}
},
);
&nbsp;
return sock;
}
&nbsp;
export async function waitForWaConnection(sock: ReturnType&lt;typeof makeWASocket&gt;) {
return new Promise&lt;void&gt;((resolve, reject) =&gt; {
type OffCapable = {
off?: (event: string, listener: (...args: unknown[]) =&gt; void) =&gt; void;
};
const evWithOff = sock.ev as unknown as OffCapable;
&nbsp;
const handler = (...args: unknown[]) =&gt; {
const update = (args[0] ?? <span class="branch-1 cbranch-no" title="branch not covered" >{}) as Partial&lt;import("baileys").ConnectionState&gt;;</span>
if (update.connection === "open") {
evWithOff.off?.("connection.update", handler);
resolve();
}
if (update.connection === "close") {
evWithOff.off?.("connection.update", handler);
reject(update.lastDisconnect ?? <span class="branch-1 cbranch-no" title="branch not covered" >new Error("Connection closed"))</span>;
}
};
&nbsp;
sock.ev.on("connection.update", handler);
});
}
&nbsp;
export async function sendMessageWeb(
to: string,
body: string,
options: { verbose: boolean },
) {
const sock = await createWaSocket(false, options.verbose);
try {
await waitForWaConnection(sock);
const jid = toWhatsappJid(to);
try {
await sock.sendPresenceUpdate("composing", jid);
} catch (err) {
<span class="cstat-no" title="statement not covered" > logVerbose(`Presence update skipped: ${String(err)}`);</span>
}
const result = await sock.sendMessage(jid, { text: body });
const messageId = result?.key?.id ?? <span class="branch-1 cbranch-no" title="branch not covered" >"unknown";</span>
console.log(success(`✅ Sent via web session. Message ID: ${messageId} -&gt; ${jid}`));
} finally {
try {
sock.ws?.close();
} catch (err) {
<span class="cstat-no" title="statement not covered" > logVerbose(`Socket close failed: ${String(err)}`);</span>
}
}
}
&nbsp;
export async function loginWeb(
verbose: boolean,
waitForConnection: typeof waitForWaConnection = waitForWaConnection,
) {
const sock = await createWaSocket(true, verbose);
console.log(info("Waiting for WhatsApp connection..."));
try {
await waitForConnection(sock);
console.log(success("✅ Linked! Credentials saved for future sends."));
} catch (err) {
const code =
(<span class="cstat-no" title="statement not covered" >err as { error?: { output?: { statusCode?: number } } })?.error?.output</span>
?.statusCode ??
(err as { output?: { statusCode?: number } })?.output?.statusCode;
<span class="cstat-no" title="statement not covered" > if (code === 515) {</span>
<span class="cstat-no" title="statement not covered" > console.log(</span>
info(
"WhatsApp asked for a restart after pairing (code 515); creds are saved. You can now send with provider=web.",
),
);
<span class="cstat-no" title="statement not covered" > return;</span>
}
<span class="cstat-no" title="statement not covered" > if (code === DisconnectReason.loggedOut) {</span>
<span class="cstat-no" title="statement not covered" > await fs.rm(WA_WEB_AUTH_DIR, { recursive: true, force: true });</span>
<span class="cstat-no" title="statement not covered" > console.error(</span>
danger(
"WhatsApp reported the session is logged out. Cleared cached web session; please rerun warelay web:login and scan the QR again.",
),
);
<span class="cstat-no" title="statement not covered" > throw new Error("Session logged out; cache cleared. Re-run web:login.");</span>
}
const formatted = <span class="cstat-no" title="statement not covered" >formatError(err);</span>
<span class="cstat-no" title="statement not covered" > console.error(</span>
danger(
`WhatsApp Web connection ended before fully opening. ${formatted}`,
),
);
<span class="cstat-no" title="statement not covered" > throw new Error(formatted);</span>
} finally {
setTimeout(() =&gt; {
try {
sock.ws?.close();
} catch {
// ignore
}
}, 500);
}
}
&nbsp;
export { WA_WEB_AUTH_DIR };
&nbsp;
export type WebInboundMessage = {
id?: string;
from: string;
to: string;
body: string;
pushName?: string;
timestamp?: number;
sendComposing: () =&gt; Promise&lt;void&gt;;
reply: (text: string) =&gt; Promise&lt;void&gt;;
};
&nbsp;
export async function monitorWebInbox(options: {
verbose: boolean;
onMessage: (msg: WebInboundMessage) =&gt; Promise&lt;void&gt;;
}) {
const sock = await createWaSocket(false, options.verbose);
await waitForWaConnection(sock);
const selfJid = sock.user?.id;
const selfE164 = selfJid ? jidToE164(selfJid) : <span class="branch-1 cbranch-no" title="branch not covered" >null;</span>
const seen = new Set&lt;string&gt;();
&nbsp;
sock.ev.on("messages.upsert", async (upsert) =&gt; {
<span class="missing-if-branch" title="if path not taken" >I</span>if (upsert.type !== "notify") <span class="cstat-no" title="statement not covered" >return;</span>
for (const msg of upsert.messages) {
const id = msg.key?.id ?? <span class="branch-1 cbranch-no" title="branch not covered" >undefined;</span>
// De-dupe on message id; Baileys can emit retries.
<span class="missing-if-branch" title="if path not taken" >I</span>if (id &amp;&amp; seen.has(id)) <span class="cstat-no" title="statement not covered" >continue;</span>
<span class="missing-if-branch" title="else path not taken" >E</span>if (id) seen.add(id);
<span class="missing-if-branch" title="if path not taken" >I</span>if (msg.key?.fromMe) <span class="cstat-no" title="statement not covered" >continue;</span>
const remoteJid = msg.key?.remoteJid;
<span class="missing-if-branch" title="if path not taken" >I</span>if (!remoteJid) <span class="cstat-no" title="statement not covered" >continue;</span>
// Ignore status/broadcast traffic; we only care about direct chats.
<span class="missing-if-branch" title="if path not taken" >I</span>if (remoteJid.endsWith("@status") || remoteJid.endsWith("@broadcast"))
<span class="cstat-no" title="statement not covered" > continue;</span>
const from = jidToE164(remoteJid);
<span class="missing-if-branch" title="if path not taken" >I</span>if (!from) <span class="cstat-no" title="statement not covered" >continue;</span>
const body = extractText(msg.message);
<span class="missing-if-branch" title="if path not taken" >I</span>if (!body) <span class="cstat-no" title="statement not covered" >continue;</span>
const chatJid = remoteJid;
const sendComposing = async () =&gt; {
try {
await sock.sendPresenceUpdate("composing", chatJid);
} catch (err) {
<span class="cstat-no" title="statement not covered" > logVerbose(`Presence update failed: ${String(err)}`);</span>
}
};
const reply = async (text: string) =&gt; {
await sock.sendMessage(chatJid, { text });
};
const timestamp = msg.messageTimestamp
? Number(msg.messageTimestamp) * 1000
: <span class="branch-1 cbranch-no" title="branch not covered" >undefined;</span>
try {
await options.onMessage({
id,
from,
to: selfE164 ?? <span class="branch-1 cbranch-no" title="branch not covered" >"me",</span>
body,
pushName: msg.pushName ?? <span class="branch-1 cbranch-no" title="branch not covered" >undefined,</span>
timestamp,
sendComposing,
reply,
});
} catch (err) {
<span class="cstat-no" title="statement not covered" > console.error(danger(`Failed handling inbound web message: ${String(err)}`));</span>
}
}
});
&nbsp;
return {
close: async () =&gt; {
try {
sock.ws?.close();
} catch (err) {
<span class="cstat-no" title="statement not covered" > logVerbose(`Socket close failed: ${String(err)}`);</span>
}
},
};
}
&nbsp;
function extractText(message: proto.IMessage | undefined): string | undefined {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!message) <span class="cstat-no" title="statement not covered" >return undefined;</span>
<span class="missing-if-branch" title="else path not taken" >E</span>if (typeof message.conversation === "string" &amp;&amp; message.conversation.trim()) {
return message.conversation.trim();
}
const extended = <span class="cstat-no" title="statement not covered" >message.extendedTextMessage?.text;</span>
<span class="missing-if-branch" title="if path not taken" >I</span>if (extended?.trim()) <span class="cstat-no" title="statement not covered" >return extended.trim();</span>
const caption = <span class="cstat-no" title="statement not covered" >message.imageMessage?.caption ?? message.videoMessage?.caption;</span>
<span class="missing-if-branch" title="if path not taken" >I</span>if (caption?.trim()) <span class="cstat-no" title="statement not covered" >return caption.trim();</span>
<span class="cstat-no" title="statement not covered" > return undefined;</span>
}
&nbsp;
function <span class="fstat-no" title="function not covered" >getStatusCode(e</span>rr: unknown) {
<span class="cstat-no" title="statement not covered" > return (</span>
(err as { output?: { statusCode?: number } })?.output?.statusCode ??
(err as { status?: number })?.status
);
}
&nbsp;
function <span class="fstat-no" title="function not covered" >formatError(e</span>rr: unknown): string {
<span class="cstat-no" title="statement not covered" > if (err instanceof Error) <span class="cstat-no" title="statement not covered" >return err.message;</span></span>
<span class="cstat-no" title="statement not covered" > if (typeof err === "string") <span class="cstat-no" title="statement not covered" >return err;</span></span>
const status = <span class="cstat-no" title="statement not covered" >getStatusCode(err);</span>
const code = (<span class="cstat-no" title="statement not covered" >err as { code?: unknown })?.code;</span>
<span class="cstat-no" title="statement not covered" > if (status || code) <span class="cstat-no" title="statement not covered" >return `status=${status ?? "unknown"} code=${code ?? "unknown"}`;</span></span>
<span class="cstat-no" title="statement not covered" > return String(err);</span>
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T22:47:29.691Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View File

@@ -1,235 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/utils.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> utils.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">95.65% </span>
<span class="quiet">Statements</span>
<span class='fraction'>22/23</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">91.66% </span>
<span class="quiet">Branches</span>
<span class='fraction'>11/12</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>9/9</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>19/19</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">833x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import fs from "node:fs";
import os from "node:os";
&nbsp;
export async function ensureDir(dir: string) {
await fs.promises.mkdir(dir, { recursive: true });
}
&nbsp;
export type Provider = "twilio" | "web";
&nbsp;
export function assertProvider(input: string): asserts input is Provider {
if (input !== "twilio" &amp;&amp; input !== "web") {
throw new Error("Provider must be 'twilio' or 'web'");
}
}
&nbsp;
export function normalizePath(p: string): string {
if (!p.startsWith("/")) return `/${p}`;
return p;
}
&nbsp;
export function withWhatsAppPrefix(number: string): string {
return number.startsWith("whatsapp:") ? number : `whatsapp:${number}`;
}
&nbsp;
export function normalizeE164(number: string): string {
const withoutPrefix = number.replace(/^whatsapp:/, "").trim();
const digits = withoutPrefix.replace(/[^\d+]/g, "");
if (digits.startsWith("+")) return `+${digits.slice(1)}`;
return `+${digits}`;
}
&nbsp;
export function toWhatsappJid(number: string): string {
const e164 = normalizeE164(number);
const digits = e164.replace(/\D/g, "");
return `${digits}@s.whatsapp.net`;
}
&nbsp;
export function jidToE164(jid: string): string | null {
// Convert a WhatsApp JID (with optional device suffix, e.g. 1234:1@s.whatsapp.net) back to +1234.
const match = jid.match(/^(\d+)(?::\d+)?@s\.whatsapp\.net$/);
<span class="missing-if-branch" title="if path not taken" >I</span>if (!match) <span class="cstat-no" title="statement not covered" >return null;</span>
const digits = match[1];
return `+${digits}`;
}
&nbsp;
export function sleep(ms: number) {
return new Promise((resolve) =&gt; setTimeout(resolve, ms));
}
&nbsp;
export const CONFIG_DIR = `${os.homedir()}/.warelay`;
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T22:47:29.691Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View File

@@ -1,244 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for test/mocks/baileys.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">test/mocks</a> baileys.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">92.85% </span>
<span class="quiet">Statements</span>
<span class='fraction'>13/14</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">85.71% </span>
<span class="quiet">Functions</span>
<span class='fraction'>6/7</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">92.3% </span>
<span class="quiet">Lines</span>
<span class='fraction'>12/13</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { vi } from "vitest";
&nbsp;
export type MockBaileysSocket = {
ev: import("events").EventEmitter;
ws: { close: ReturnType&lt;typeof vi.fn&gt; };
sendPresenceUpdate: ReturnType&lt;typeof vi.fn&gt;;
sendMessage: ReturnType&lt;typeof vi.fn&gt;;
user?: { id?: string };
};
&nbsp;
export type MockBaileysModule = {
DisconnectReason: { loggedOut: number };
fetchLatestBaileysVersion: ReturnType&lt;typeof vi.fn&gt;;
makeCacheableSignalKeyStore: ReturnType&lt;typeof vi.fn&gt;;
makeWASocket: ReturnType&lt;typeof vi.fn&gt;;
useMultiFileAuthState: ReturnType&lt;typeof vi.fn&gt;;
jidToE164?: (jid: string) =&gt; string | null;
proto?: unknown;
};
&nbsp;
export function createMockBaileys(): { mod: MockBaileysModule; lastSocket: () =&gt; MockBaileysSocket } {
const sockets: MockBaileysSocket[] = [];
const makeWASocket = vi.fn((opts: unknown) =&gt; {
const ev = new (require("events").EventEmitter)();
const sock: MockBaileysSocket = {
ev,
ws: { close: vi.fn() },
sendPresenceUpdate: vi.fn().mockResolvedValue(undefined),
sendMessage: vi.fn().mockResolvedValue({ key: { id: "msg123" } }),
user: { id: "123@s.whatsapp.net" },
};
setImmediate(() =&gt; ev.emit("connection.update", { connection: "open" }));
sockets.push(sock);
return sock;
});
&nbsp;
const mod: MockBaileysModule = {
DisconnectReason: { loggedOut: 401 },
fetchLatestBaileysVersion: vi.fn().mockResolvedValue({ version: [1, 2, 3] }),
makeCacheableSignalKeyStore: vi.fn((keys: unknown) =&gt; keys),
makeWASocket,
useMultiFileAuthState: vi.fn(async () =&gt; ({
state: { creds: {}, keys: {} },
saveCreds: vi.fn(),
})),
jidToE164: <span class="fstat-no" title="function not covered" >(j</span>id: string) =&gt; <span class="cstat-no" title="statement not covered" >jid.replace(/@.*$/, "").replace(/^/, "+"),</span>
};
&nbsp;
return {
mod,
lastSocket: () =&gt; sockets[sockets.length - 1]!,
};
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T22:47:29.691Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@@ -1,131 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for test/mocks</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> test/mocks</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">83.87% </span>
<span class="quiet">Statements</span>
<span class='fraction'>26/31</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">61.53% </span>
<span class="quiet">Functions</span>
<span class='fraction'>8/13</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">96% </span>
<span class="quiet">Lines</span>
<span class='fraction'>24/25</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="baileys.ts"><a href="baileys.ts.html">baileys.ts</a></td>
<td data-value="92.85" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 92%"></div><div class="cover-empty" style="width: 8%"></div></div>
</td>
<td data-value="92.85" class="pct high">92.85%</td>
<td data-value="14" class="abs high">13/14</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="85.71" class="pct high">85.71%</td>
<td data-value="7" class="abs high">6/7</td>
<td data-value="92.3" class="pct high">92.3%</td>
<td data-value="13" class="abs high">12/13</td>
</tr>
<tr>
<td class="file medium" data-value="twilio.ts"><a href="twilio.ts.html">twilio.ts</a></td>
<td data-value="76.47" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 76%"></div><div class="cover-empty" style="width: 24%"></div></div>
</td>
<td data-value="76.47" class="pct medium">76.47%</td>
<td data-value="17" class="abs medium">13/17</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="33.33" class="pct low">33.33%</td>
<td data-value="6" class="abs low">2/6</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="12" class="abs high">12/12</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T22:47:29.691Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@@ -1,232 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for test/mocks/twilio.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">test/mocks</a> twilio.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">76.47% </span>
<span class="quiet">Statements</span>
<span class='fraction'>13/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">33.33% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>12/12</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { vi } from "vitest";
&nbsp;
export type MockTwilioClient = {
messages: {
create: ReturnType&lt;typeof vi.fn&gt;;
list: ReturnType&lt;typeof vi.fn&gt;;
fetch?: ReturnType&lt;typeof vi.fn&gt;;
};
request?: ReturnType&lt;typeof vi.fn&gt;;
messaging?: {
v2: { channelsSenders: ReturnType&lt;typeof vi.fn&gt; };
v1: { services: ReturnType&lt;typeof vi.fn&gt; };
};
incomingPhoneNumbers?: ReturnType&lt;typeof vi.fn&gt;;
};
&nbsp;
export function createMockTwilio() {
const messages = vi.fn(<span class="fstat-no" title="function not covered" >(s</span>id?: string) =&gt; (<span class="cstat-no" title="statement not covered" >{ fetch: vi.fn() }))</span> as any;
messages.create = vi.fn();
messages.list = vi.fn();
&nbsp;
const channelsSenders = vi.fn(<span class="fstat-no" title="function not covered" >(s</span>id?: string) =&gt; (<span class="cstat-no" title="statement not covered" >{</span>
fetch: vi.fn(),
update: vi.fn(),
})) as any;
channelsSenders.list = vi.fn();
&nbsp;
const services = vi.fn(<span class="fstat-no" title="function not covered" >() =&gt; (<span class="cstat-no" title="statement not covered" >{</span> update: vi.fn(), fetch: vi.fn() }))</span>;
&nbsp;
const incomingPhoneNumbers = vi.fn(<span class="fstat-no" title="function not covered" >(s</span>id?: string) =&gt; (<span class="cstat-no" title="statement not covered" >{</span>
update: vi.fn(),
})) as any;
incomingPhoneNumbers.list = vi.fn();
&nbsp;
const client: MockTwilioClient = {
messages,
request: vi.fn(),
messaging: {
v2: { channelsSenders },
v1: { services },
},
incomingPhoneNumbers,
};
&nbsp;
const factory = vi.fn(() =&gt; client) as any;
(factory as any)._client = client;
&nbsp;
return { client, factory };
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2025-11-24T22:47:29.691Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@@ -143,6 +143,42 @@ describe("config and templating", () => {
const argvSecond = runSpy.mock.calls[1][0];
expect(argvSecond[2]).toBe("--resume");
});
it("injects Claude output format + print flag when configured", async () => {
const runSpy = vi.spyOn(index, "runCommandWithTimeout").mockResolvedValue({
stdout: "ok",
stderr: "",
code: 0,
signal: null,
killed: false,
});
const cfg = {
inbound: {
reply: {
mode: "command" as const,
command: ["claude", "{{Body}}"],
claudeOutputFormat: "text" as const,
},
},
};
await index.getReplyFromConfig(
{ Body: "hi", From: "+1555", To: "+1666" },
undefined,
cfg,
runSpy,
);
const argv = runSpy.mock.calls[0][0];
expect(argv[0]).toBe("claude");
expect(argv.at(-1)).toBe("hi");
expect(argv.includes("-p") || argv.includes("--print")).toBe(true);
const outputIdx = argv.findIndex(
(part) => part === "--output-format" || part.startsWith("--output-format="),
);
expect(outputIdx).toBeGreaterThan(-1);
expect(argv[outputIdx + 1]).toBe("text");
});
});
describe("twilio interactions", () => {