agenttwin 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.js
CHANGED
|
@@ -1147,7 +1147,7 @@ async function startGateway(opts) {
|
|
|
1147
1147
|
return;
|
|
1148
1148
|
}
|
|
1149
1149
|
if (path === "/v1/runs" && req.method === "GET") {
|
|
1150
|
-
send(res, 200, { jobs: store.jobs.filter((j) => j.accountId === account.id).
|
|
1150
|
+
send(res, 200, { jobs: store.jobs.filter((j) => j.accountId === account.id).sort((a, b) => Date.parse(b.createdAt) - Date.parse(a.createdAt)).slice(0, 100).map(({ id, status, createdAt }) => ({ id, status, createdAt })) });
|
|
1151
1151
|
return;
|
|
1152
1152
|
}
|
|
1153
1153
|
if (path === "/v1/runs" && req.method === "POST") {
|
|
@@ -48,7 +48,7 @@ function renderReceipts(){
|
|
|
48
48
|
$('#receipts-count').textContent=failed.length||'';
|
|
49
49
|
$('#receipts-spin').hidden=!liveJobs().length;
|
|
50
50
|
if(runsLoadError&&!runs.length){$('#receipts-body').innerHTML=receiptError();return;}
|
|
51
|
-
const row=r=>`<button type="button" class="review-row" data-open-receipt="${esc(r.runId)}"><span class="r-ico">${statusIco(r.status)}</span><strong>${esc(title(r))}</strong><span class="ref" title="${esc(window.agentTwinDashboard?.getReceiptSource(r.runId))}">${esc(
|
|
51
|
+
const row=r=>`<button type="button" class="review-row" data-open-receipt="${esc(r.runId)}"><span class="r-ico">${statusIco(r.status)}</span><strong>${esc(title(r))}</strong><span class="ref" title="${esc(window.agentTwinDashboard?.getReceiptSource(r.runId))}">${r.runtime==='local'?'CLI':r.runtime==='e2b'?'Cloud':'Imported'} · ${r.git?.head?esc(r.git.head.slice(0,8))+(r.git.dirty?' + changes':''):esc(String(r.runId).slice(0,8))}</span><span class="r-status ${esc(r.status)}">${esc(r.status)}</span><span class="r-time">${esc(rel(r.createdAt))}</span></button>`;
|
|
52
52
|
let html='';
|
|
53
53
|
if(failed.length)html+=`<p class="group-label warn">Needs review · <b>${failed.length}</b> failed receipt${failed.length===1?'':'s'}</p>${failed.slice(0,2).map(row).join('')}`;
|
|
54
54
|
if(rest.length)html+=`<p class="group-label">Passed · <b>${rest.length}</b></p>${rest.slice(0,4).map(row).join('')}`;
|
|
@@ -70,7 +70,7 @@ function renderGit(){
|
|
|
70
70
|
const days=Array.from({length:14},(_,i)=>{const day=new Date(Date.now()-(13-i)*86400000).toISOString().slice(0,10);return {day,count:g.commits.filter(c=>c.date.slice(0,10)===day).length};});
|
|
71
71
|
const max=Math.max(1,...days.map(d=>d.count));
|
|
72
72
|
const changes=(d.workflows??[]).filter(w=>g.changedFiles.includes((w.entrypoint??'').split('#')[0]));
|
|
73
|
-
$('#git-body').innerHTML=`<div class="git-total"><strong>${g.commits.length}${g.commits.length===100?'+':''}</strong><span>commits · last 14 days</span></div><div class="git-bars" aria-label="Commit activity over 14 days">${days.map(d=>`<span style="--bar:${Math.max(5,d.count/max*100)}%" title="${esc(d.day)}: ${d.count} commits"></span>`).join('')}</div><div class="git-foot"><span>${g.totalCommits} commits in repository</span><code>${esc(g.head.slice(0,8))}${g.dirty?' + changes':''}</code></div><p class="w-empty">${changes.length?changes.length+' workflow entrypoints changed since the previous sync. Retest to record new outcomes.':'No workflow entrypoint changes detected since the previous sync.'}</p>`;
|
|
73
|
+
$('#git-body').innerHTML=`<div class="git-total"><strong>${g.commits.length}${g.commits.length===100?'+':''}</strong><span>commits · last 14 days</span></div><div class="git-bars" aria-label="Commit activity over 14 days">${days.map(d=>`<span style="--bar:${Math.max(5,d.count/max*100)}%" title="${esc(d.day)}: ${d.count} commits"></span>`).join('')}</div><div class="git-foot"><span>${g.totalCommits} commits in repository</span><code>${esc(g.head.slice(0,8))}${g.dirty?' + changes':''}</code></div><p class="w-empty">${!g.previousHead?'First Git snapshot. Change comparisons begin with the next sync.':changes.length?changes.length+' workflow entrypoints changed since the previous sync. Retest to record new outcomes.':'No workflow entrypoint changes detected since the previous sync.'}</p>`;
|
|
74
74
|
}
|
|
75
75
|
function renderServices(){
|
|
76
76
|
const events=runs.flatMap(r=>(r.events??[]).map(e=>({r,e}))).slice(0,5);
|
|
@@ -250,7 +250,7 @@ function onHostedJobs(){
|
|
|
250
250
|
renderAll();
|
|
251
251
|
}
|
|
252
252
|
if($('#home-view')){
|
|
253
|
-
|
|
253
|
+
|
|
254
254
|
|
|
255
255
|
composerInit();
|
|
256
256
|
topbarInit();
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="icon" href="assets/logo/favicon.svg"><link rel="stylesheet" href="assets/brand.css"><link rel="stylesheet" href="assets/dashboard/dashboard.css"><link rel="stylesheet" href="assets/dashboard/workspace.css?v=0.10.0"><link rel="stylesheet" href="assets/dashboard/agent-home.css?v=0.10.0">
|
|
9
9
|
<script src="assets/dashboard/dashboard.js?v=0.10.0" type="module"></script><script src="assets/vendor/marked.js" defer></script>
|
|
10
10
|
<script src="assets/vendor/purify.min.js" defer></script>
|
|
11
|
-
<script src="assets/dashboard/agent-home.js?v=0.10.
|
|
11
|
+
<script src="assets/dashboard/agent-home.js?v=0.10.1" type="module"></script><script src="assets/dashboard/hosted.js?v=0.4.0" defer></script><script src="assets/dashboard/workflows.js?v=0.2.0" type="module"></script>
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<a class="skip" href="#main">Skip to content</a>
|
package/dist/gateway.js
CHANGED
|
@@ -1147,7 +1147,7 @@ async function startGateway(opts) {
|
|
|
1147
1147
|
return;
|
|
1148
1148
|
}
|
|
1149
1149
|
if (path === "/v1/runs" && req.method === "GET") {
|
|
1150
|
-
send(res, 200, { jobs: store.jobs.filter((j) => j.accountId === account.id).
|
|
1150
|
+
send(res, 200, { jobs: store.jobs.filter((j) => j.accountId === account.id).sort((a, b) => Date.parse(b.createdAt) - Date.parse(a.createdAt)).slice(0, 100).map(({ id, status, createdAt }) => ({ id, status, createdAt })) });
|
|
1151
1151
|
return;
|
|
1152
1152
|
}
|
|
1153
1153
|
if (path === "/v1/runs" && req.method === "POST") {
|