instar 1.3.809 → 1.3.811
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/dashboard/glance.js +533 -0
- package/dashboard/index.html +111 -97
- package/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +9 -4
- package/dist/commands/server.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +6 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/ProactiveSwapMonitor.d.ts.map +1 -1
- package/dist/core/ProactiveSwapMonitor.js +5 -1
- package/dist/core/ProactiveSwapMonitor.js.map +1 -1
- package/dist/core/QuotaAwareScheduler.d.ts +6 -2
- package/dist/core/QuotaAwareScheduler.d.ts.map +1 -1
- package/dist/core/QuotaAwareScheduler.js +16 -3
- package/dist/core/QuotaAwareScheduler.js.map +1 -1
- package/dist/core/QuotaPoller.d.ts +9 -1
- package/dist/core/QuotaPoller.d.ts.map +1 -1
- package/dist/core/QuotaPoller.js +42 -4
- package/dist/core/QuotaPoller.js.map +1 -1
- package/dist/core/SubscriptionAccountMetaReplicatedStore.js +1 -1
- package/dist/core/SubscriptionAccountMetaReplicatedStore.js.map +1 -1
- package/dist/core/SubscriptionPool.d.ts +1 -1
- package/dist/core/SubscriptionPool.d.ts.map +1 -1
- package/dist/core/SwapAntiThrash.d.ts.map +1 -1
- package/dist/core/SwapAntiThrash.js +4 -1
- package/dist/core/SwapAntiThrash.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +1 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +19 -19
- package/src/scaffold/templates.ts +1 -0
- package/upgrades/1.3.810.md +22 -0
- package/upgrades/1.3.811.md +53 -0
- package/upgrades/eli16/codex-quota-framework-safe.md +20 -0
- package/upgrades/side-effects/codex-quota-framework-safe.md +81 -0
- package/upgrades/side-effects/glance-floors-f10-f11.md +225 -0
package/dashboard/index.html
CHANGED
|
@@ -593,6 +593,71 @@
|
|
|
593
593
|
max-width: 900px;
|
|
594
594
|
}
|
|
595
595
|
|
|
596
|
+
/* ── Glance component (Dashboard UX Standard F10/F11, topic 29836) ──
|
|
597
|
+
The shared three-layer template rendered by dashboard/glance.js: a
|
|
598
|
+
plain-English headline + ≤5 labeled tiles (Layer 1), each drilling into a
|
|
599
|
+
list (Layer 2) then a full record (Layer 3). Theme-consistent + mobile
|
|
600
|
+
responsive (tiles/records reflow; nothing scrolls the page sideways). */
|
|
601
|
+
.glance-root { display: flex; flex-direction: column; gap: 16px; }
|
|
602
|
+
.glance-layer { display: flex; flex-direction: column; gap: 16px; }
|
|
603
|
+
.glance-headline {
|
|
604
|
+
font-size: 20px; font-weight: 600; line-height: 1.4;
|
|
605
|
+
color: var(--text-bright); max-width: 900px;
|
|
606
|
+
}
|
|
607
|
+
.glance-tiles {
|
|
608
|
+
display: grid; gap: 12px;
|
|
609
|
+
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
|
610
|
+
}
|
|
611
|
+
.glance-tile {
|
|
612
|
+
display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
|
|
613
|
+
padding: 16px; border: 1px solid var(--border); border-radius: 10px;
|
|
614
|
+
background: var(--bg-panel); color: var(--text); cursor: pointer;
|
|
615
|
+
text-align: left; min-width: 0;
|
|
616
|
+
transition: background .15s, border-color .15s;
|
|
617
|
+
}
|
|
618
|
+
.glance-tile:hover { background: var(--bg-hover); border-color: var(--accent-dim); }
|
|
619
|
+
.glance-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
620
|
+
.glance-tile[aria-expanded="true"] { border-color: var(--accent); background: var(--bg-active); }
|
|
621
|
+
.glance-tile-value { font-size: 28px; font-weight: 700; color: var(--text-bright); }
|
|
622
|
+
.glance-tile-label { font-size: 13px; color: var(--text-dim); }
|
|
623
|
+
.glance-tile[data-tone="warn"] .glance-tile-value { color: var(--orange); }
|
|
624
|
+
.glance-tile[data-tone="muted"] .glance-tile-value { color: var(--text-dim); }
|
|
625
|
+
.glance-tile-degraded { justify-content: center; }
|
|
626
|
+
.glance-tile-degraded .glance-tile-label { color: var(--text); font-weight: 600; }
|
|
627
|
+
.glance-drilldown {
|
|
628
|
+
border: 1px solid var(--border); border-radius: 10px; background: var(--bg-panel);
|
|
629
|
+
padding: 16px; display: flex; flex-direction: column; gap: 12px;
|
|
630
|
+
}
|
|
631
|
+
.glance-drilldown[hidden] { display: none; }
|
|
632
|
+
.glance-drill-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
|
|
633
|
+
.glance-drill-title { font-weight: 600; color: var(--text-bright); }
|
|
634
|
+
.glance-drill-back {
|
|
635
|
+
padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px;
|
|
636
|
+
background: var(--bg-hover); color: var(--text); cursor: pointer; font-size: 12px;
|
|
637
|
+
}
|
|
638
|
+
.glance-drill-back:hover { border-color: var(--accent-dim); }
|
|
639
|
+
.glance-list { display: flex; flex-direction: column; gap: 8px; }
|
|
640
|
+
.glance-list-row {
|
|
641
|
+
text-align: left; padding: 12px 14px; border: 1px solid var(--border);
|
|
642
|
+
border-radius: 8px; background: var(--bg); color: var(--text); cursor: pointer;
|
|
643
|
+
line-height: 1.4; width: 100%;
|
|
644
|
+
}
|
|
645
|
+
.glance-list-row:hover { background: var(--bg-hover); border-color: var(--accent-dim); }
|
|
646
|
+
.glance-empty { padding: 24px; text-align: center; color: var(--text-dim); }
|
|
647
|
+
.glance-record { display: flex; flex-direction: column; gap: 10px; }
|
|
648
|
+
.glance-record-fields { display: flex; flex-direction: column; gap: 6px; }
|
|
649
|
+
.glance-record-row {
|
|
650
|
+
display: grid; grid-template-columns: minmax(80px, 140px) 1fr; gap: 10px; font-size: 13px;
|
|
651
|
+
}
|
|
652
|
+
.glance-record-key { color: var(--text-dim); }
|
|
653
|
+
.glance-record-val { color: var(--text); word-break: break-word; overflow-wrap: anywhere; }
|
|
654
|
+
.glance-record-action {
|
|
655
|
+
align-self: flex-start; margin-top: 8px; padding: 6px 12px;
|
|
656
|
+
border: 1px solid var(--border); border-radius: 6px; background: var(--bg-hover);
|
|
657
|
+
color: var(--text); cursor: pointer;
|
|
658
|
+
}
|
|
659
|
+
.glance-record-action:hover { border-color: var(--accent-dim); }
|
|
660
|
+
|
|
596
661
|
.terminal-header {
|
|
597
662
|
display: flex;
|
|
598
663
|
align-items: center;
|
|
@@ -3312,15 +3377,11 @@
|
|
|
3312
3377
|
<button onclick="loadCommitments()" style="padding:6px 12px">Refresh</button>
|
|
3313
3378
|
</div>
|
|
3314
3379
|
<div class="tab-purpose">
|
|
3315
|
-
|
|
3316
|
-
<span style="color:#4a9a4a">pending</span>,
|
|
3317
|
-
<span style="color:#e27d3b">atRisk</span>,
|
|
3318
|
-
<span style="color:#888">suppressed</span>.
|
|
3319
|
-
</div>
|
|
3320
|
-
<div id="commitmentsEmpty" style="padding:40px;text-align:center;color:var(--text-dim);display:none">
|
|
3321
|
-
No open promises.
|
|
3380
|
+
Your open promises at a glance — the headline says where things stand; tap a tile to see which promises, tap one for the full record.
|
|
3322
3381
|
</div>
|
|
3323
|
-
|
|
3382
|
+
<!-- Glance floors F10/F11 (topic 29836): the shared component renders the
|
|
3383
|
+
headline + tiles + drill-down here. Reference implementation. -->
|
|
3384
|
+
<div id="commitmentsGlance" class="glance-root"></div>
|
|
3324
3385
|
</div>
|
|
3325
3386
|
|
|
3326
3387
|
<!-- Tokens Tab — read-only token-usage observability -->
|
|
@@ -8757,119 +8818,72 @@
|
|
|
8757
8818
|
}
|
|
8758
8819
|
}
|
|
8759
8820
|
|
|
8760
|
-
// ── Commitments Tab
|
|
8761
|
-
//
|
|
8762
|
-
//
|
|
8763
|
-
//
|
|
8821
|
+
// ── Commitments Tab — glance floors F10/F11 (topic 29836) ────
|
|
8822
|
+
// The reference implementation of the shared glance component. Fetches
|
|
8823
|
+
// /commitments?status=active and renders a plain-English headline + ≤5 tiles
|
|
8824
|
+
// (Layer 1); each tile drills into the filtered open-promises list (Layer 2);
|
|
8825
|
+
// each row opens the full record with IDs/cadence/deadlines (Layer 3). All
|
|
8826
|
+
// content goes through the component's sanitizer + textContent (XSS-safe).
|
|
8827
|
+
let __glanceModule = null;
|
|
8828
|
+
async function loadGlanceModule() {
|
|
8829
|
+
if (!__glanceModule) {
|
|
8830
|
+
// Same try/catch dynamic-import guard the other tabs use — a missing/failed
|
|
8831
|
+
// glance.js degrades the tab gracefully instead of white-screening.
|
|
8832
|
+
try { __glanceModule = await import('/dashboard/glance.js'); }
|
|
8833
|
+
catch (e) { console.error('[glance] module load failed', e); return null; }
|
|
8834
|
+
}
|
|
8835
|
+
return __glanceModule;
|
|
8836
|
+
}
|
|
8837
|
+
|
|
8764
8838
|
async function loadCommitments() {
|
|
8765
|
-
const
|
|
8766
|
-
const empty = document.getElementById('commitmentsEmpty');
|
|
8839
|
+
const glanceRoot = document.getElementById('commitmentsGlance');
|
|
8767
8840
|
const countBadge = document.getElementById('tabCommitmentCount');
|
|
8768
|
-
|
|
8769
|
-
|
|
8841
|
+
if (!glanceRoot) return;
|
|
8842
|
+
|
|
8843
|
+
const glance = await loadGlanceModule();
|
|
8844
|
+
if (!glance) {
|
|
8845
|
+
// Graceful degrade: the component couldn't load. Show an honest note, no crash.
|
|
8846
|
+
glanceRoot.textContent = 'Loading the glance view failed — refresh to retry.';
|
|
8847
|
+
return;
|
|
8848
|
+
}
|
|
8770
8849
|
|
|
8771
8850
|
let res = null;
|
|
8772
8851
|
try {
|
|
8773
8852
|
res = await apiFetch('/commitments?status=active');
|
|
8774
|
-
} catch { /* fall through */ }
|
|
8853
|
+
} catch { /* fall through to the disabled/empty glance @silent-fallback-ok — network hiccup renders the honest empty state */ }
|
|
8775
8854
|
|
|
8776
8855
|
if (!res || !res.enabled) {
|
|
8777
|
-
|
|
8778
|
-
|
|
8856
|
+
glanceRoot.textContent = '';
|
|
8857
|
+
const note = document.createElement('div');
|
|
8858
|
+
note.className = 'glance-empty';
|
|
8859
|
+
note.textContent = res && res.enabled === false
|
|
8860
|
+
? 'Promise tracking is not set up on this agent yet.'
|
|
8861
|
+
: 'Could not load your promises right now — refresh to retry.';
|
|
8862
|
+
glanceRoot.appendChild(note);
|
|
8779
8863
|
if (countBadge) countBadge.textContent = '0';
|
|
8780
8864
|
return;
|
|
8781
8865
|
}
|
|
8866
|
+
|
|
8782
8867
|
const items = Array.isArray(res.commitments) ? res.commitments : [];
|
|
8783
|
-
// Show only beacon-watched pending + atRisk.
|
|
8784
8868
|
const open = items.filter(c => c.beaconEnabled && c.status === 'pending');
|
|
8785
8869
|
if (countBadge) countBadge.textContent = String(open.length);
|
|
8786
|
-
if (open.length === 0) {
|
|
8787
|
-
empty.style.display = 'block';
|
|
8788
|
-
empty.textContent = 'No open promises.';
|
|
8789
|
-
return;
|
|
8790
|
-
}
|
|
8791
|
-
|
|
8792
|
-
const fmtTs = (iso) => {
|
|
8793
|
-
if (!iso) return '—';
|
|
8794
|
-
try { return new Date(iso).toLocaleString(); } catch { return iso; }
|
|
8795
|
-
};
|
|
8796
|
-
|
|
8797
|
-
for (const c of open) {
|
|
8798
|
-
const card = document.createElement('div');
|
|
8799
|
-
card.style.cssText = 'padding:14px;border:1px solid var(--border);border-radius:6px;background:var(--bg-dim);display:flex;flex-direction:column;gap:8px';
|
|
8800
8870
|
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
summary.style.cssText = 'flex:1;font-weight:600;line-height:1.3';
|
|
8805
|
-
summary.textContent = (c.agentResponse || c.userRequest || '(no summary)').slice(0, 160);
|
|
8806
|
-
header.appendChild(summary);
|
|
8807
|
-
|
|
8808
|
-
// State badge.
|
|
8809
|
-
const badge = document.createElement('span');
|
|
8810
|
-
const atRisk = !!c.atRisk;
|
|
8811
|
-
const suppressed = !!c.beaconSuppressed;
|
|
8812
|
-
const [badgeText, badgeBg] = suppressed
|
|
8813
|
-
? [`suppressed: ${c.beaconSuppressionReason || '?'}`, '#555']
|
|
8814
|
-
: atRisk
|
|
8815
|
-
? ['atRisk', '#e27d3b']
|
|
8816
|
-
: ['pending', '#4a9a4a'];
|
|
8817
|
-
badge.textContent = badgeText;
|
|
8818
|
-
badge.style.cssText = `font-size:11px;padding:3px 8px;border-radius:4px;background:${badgeBg};color:#fff;white-space:nowrap`;
|
|
8819
|
-
header.appendChild(badge);
|
|
8820
|
-
card.appendChild(header);
|
|
8821
|
-
|
|
8822
|
-
const meta = document.createElement('div');
|
|
8823
|
-
meta.style.cssText = 'display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:6px;font-size:12px;color:var(--text-dim)';
|
|
8824
|
-
const rows = [
|
|
8825
|
-
['id', c.id],
|
|
8826
|
-
['topic', c.topicId != null ? String(c.topicId) : '—'],
|
|
8827
|
-
['cadence', c.cadenceMs ? `${Math.round(c.cadenceMs / 1000)}s` : '—'],
|
|
8828
|
-
['heartbeats', String(c.heartbeatCount ?? 0)],
|
|
8829
|
-
['lastHeartbeat', fmtTs(c.lastHeartbeatAt)],
|
|
8830
|
-
['nextUpdateDue', fmtTs(c.nextUpdateDueAt)],
|
|
8831
|
-
['softDeadline', fmtTs(c.softDeadlineAt)],
|
|
8832
|
-
['hardDeadline', fmtTs(c.hardDeadlineAt)],
|
|
8833
|
-
];
|
|
8834
|
-
for (const [k, v] of rows) {
|
|
8835
|
-
const cell = document.createElement('div');
|
|
8836
|
-
const kEl = document.createElement('span');
|
|
8837
|
-
kEl.textContent = `${k}: `;
|
|
8838
|
-
kEl.style.opacity = '0.7';
|
|
8839
|
-
const vEl = document.createElement('span');
|
|
8840
|
-
vEl.textContent = v;
|
|
8841
|
-
vEl.style.color = 'var(--text)';
|
|
8842
|
-
cell.appendChild(kEl);
|
|
8843
|
-
cell.appendChild(vEl);
|
|
8844
|
-
meta.appendChild(cell);
|
|
8845
|
-
}
|
|
8846
|
-
card.appendChild(meta);
|
|
8847
|
-
|
|
8848
|
-
// Actions.
|
|
8849
|
-
const actions = document.createElement('div');
|
|
8850
|
-
actions.style.cssText = 'display:flex;gap:8px;align-items:center';
|
|
8851
|
-
const deliverBtn = document.createElement('button');
|
|
8852
|
-
deliverBtn.textContent = 'Mark delivered';
|
|
8853
|
-
deliverBtn.style.cssText = 'padding:6px 10px;cursor:pointer';
|
|
8854
|
-
deliverBtn.addEventListener('click', async () => {
|
|
8855
|
-
deliverBtn.disabled = true;
|
|
8871
|
+
const spec = glance.commitmentsGlanceSpec(document, items, {
|
|
8872
|
+
now: Date.now(),
|
|
8873
|
+
onDeliver: async (id) => {
|
|
8856
8874
|
try {
|
|
8857
|
-
await apiFetch(`/commitments/${encodeURIComponent(
|
|
8875
|
+
await apiFetch(`/commitments/${encodeURIComponent(id)}/deliver`, {
|
|
8858
8876
|
method: 'POST',
|
|
8859
8877
|
headers: { 'Content-Type': 'application/json' },
|
|
8860
8878
|
body: JSON.stringify({}),
|
|
8861
8879
|
});
|
|
8862
8880
|
await loadCommitments();
|
|
8863
8881
|
} catch (err) {
|
|
8864
|
-
deliverBtn.disabled = false;
|
|
8865
8882
|
alert('Deliver failed: ' + (err && err.message ? err.message : String(err)));
|
|
8866
8883
|
}
|
|
8867
|
-
}
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
list.appendChild(card);
|
|
8872
|
-
}
|
|
8884
|
+
},
|
|
8885
|
+
});
|
|
8886
|
+
glance.renderGlance(document, glanceRoot, spec);
|
|
8873
8887
|
}
|
|
8874
8888
|
|
|
8875
8889
|
// ── Secrets Tab ──────────────────────────────────────────────
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwDH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAU3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAyBjG,OAAO,EAAE,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S,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,GACP,IAAI,CAonBN;AAgmBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA03mBtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
|
package/dist/commands/server.js
CHANGED
|
@@ -11683,7 +11683,10 @@ export async function startServer(options) {
|
|
|
11683
11683
|
// MOST-HEADROOM account (not the use-it-or-lose-it drain-first winner) — so
|
|
11684
11684
|
// non-critical work runs whenever ANY account has room, while placement still
|
|
11685
11685
|
// drains the soonest-to-reset account. Clamps + degraded signal are built in.
|
|
11686
|
-
quotaTracker.setPoolQuotaProvider(() => poolHeadroom(subscriptionPool.list(), {
|
|
11686
|
+
quotaTracker.setPoolQuotaProvider(() => poolHeadroom(subscriptionPool.list(), {
|
|
11687
|
+
nowMs: Date.now(),
|
|
11688
|
+
framework: config.sessions.framework ?? 'claude-code',
|
|
11689
|
+
}));
|
|
11687
11690
|
console.log(pc.green(' Pool-aware quota throttle: wired (placement-shared eligibility, most-headroom gating)'));
|
|
11688
11691
|
}
|
|
11689
11692
|
// ── Live credential re-pointing — census consumer re-routing (WS5.2 Step 6) ──
|
|
@@ -16255,14 +16258,16 @@ export async function startServer(options) {
|
|
|
16255
16258
|
return;
|
|
16256
16259
|
// Resolve which account this session is running under; only pool-managed
|
|
16257
16260
|
// sessions are swap-eligible (others fall back to the existing back-off).
|
|
16258
|
-
const
|
|
16259
|
-
.find(s => s.tmuxSession === sessionName)
|
|
16261
|
+
const session = state.listSessions({ status: 'running' })
|
|
16262
|
+
.find(s => s.tmuxSession === sessionName);
|
|
16263
|
+
const accountId = session?.subscriptionAccountId;
|
|
16260
16264
|
if (!accountId)
|
|
16261
16265
|
return;
|
|
16262
16266
|
void _quotaAwareScheduler?.onQuotaPressure({
|
|
16263
16267
|
sessionName,
|
|
16264
16268
|
exhaustedAccountId: accountId,
|
|
16265
16269
|
nowMs: Date.now(),
|
|
16270
|
+
framework: session?.framework ?? 'claude-code',
|
|
16266
16271
|
});
|
|
16267
16272
|
});
|
|
16268
16273
|
}
|
|
@@ -16275,7 +16280,7 @@ export async function startServer(options) {
|
|
|
16275
16280
|
if (config.subscriptionPool?.pinSessionsToPool) {
|
|
16276
16281
|
const { selectAccount } = await import('../core/QuotaAwareScheduler.js');
|
|
16277
16282
|
sessionManager.setSpawnAccountResolver(() => {
|
|
16278
|
-
const acct = selectAccount(subscriptionPool.list(), { nowMs: Date.now() });
|
|
16283
|
+
const acct = selectAccount(subscriptionPool.list(), { nowMs: Date.now(), framework: 'claude-code' });
|
|
16279
16284
|
return acct ? { configHome: acct.configHome, accountId: acct.id } : null;
|
|
16280
16285
|
});
|
|
16281
16286
|
console.log(pc.green(' Subscription-pool session pinning enabled'));
|