@lensmcp/protocol-types 1.26.30 → 1.26.32

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/index.d.ts CHANGED
@@ -56,6 +56,7 @@ export * from './lib/hosts.js';
56
56
  export * from './lib/cluster-hosts.js';
57
57
  export * from './lib/dashboard-updates.js';
58
58
  export * from './lib/accounts.js';
59
+ export * from './lib/account-drain.js';
59
60
  export * from './lib/host-agents.js';
60
61
  export * from './lib/remote-instances.js';
61
62
  export * from './lib/team.js';
package/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";export*from"./lib/schema-version.js";export*from"./lib/source-location.js";export*from"./lib/context.js";export*from"./lib/event.js";export*from"./lib/node.js";export*from"./lib/edge.js";export*from"./lib/attributes.js";export*from"./lib/producer-health.js";export*from"./lib/resources.js";export*from"./lib/tokens.js";export*from"./lib/capture-demand.js";export*from"./lib/bounded-clone.js";export*from"./lib/bounded-map.js";export*from"./lib/flood-guard.js";export*from"./lib/dashboard.js";export*from"./lib/dashboard-path.js";export*from"./lib/lens-hosts.js";export*from"./lib/dashboard-lint.js";export*from"./lib/dashboard-typecheck.js";export*from"./lib/lint-coverage.js";export*from"./lib/lint-ignores.js";export*from"./lib/static-checks.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.js";export*from"./lib/expected-failure.js";export*from"./lib/error-verdict.js";export*from"./lib/finding-proof.js";export*from"./lib/error-cause.js";export*from"./lib/metrics-reset.js";export*from"./lib/ai-content.js";export*from"./lib/http-exchange.js";export*from"./lib/ai-call.js";export*from"./lib/ai-call-row.js";export*from"./lib/ai-call-groups.js";export*from"./lib/ai-context.js";export*from"./lib/ai-cache-facts.js";export*from"./lib/ai-cache.js";export*from"./lib/ai-cache-verdict.js";export*from"./lib/ai-together.js";export*from"./lib/ai-origins.js";export*from"./lib/ai-playground.js";export*from"./lib/ai-compare.js";export*from"./lib/pod-memory.js";export*from"./lib/perf-rules.js";export*from"./lib/sources.js";export*from"./lib/page-visit.js";export*from"./lib/replay.js";export*from"./lib/event-loop.js";export*from"./lib/workspace-actions.js";export*from"./lib/docker-jobs.js";export*from"./lib/docker-report.js";export*from"./lib/docker-runs.js";export*from"./lib/docker-errors.js";export*from"./lib/peers.js";export*from"./lib/hosts.js";export*from"./lib/cluster-hosts.js";export*from"./lib/dashboard-updates.js";export*from"./lib/accounts.js";export*from"./lib/host-agents.js";export*from"./lib/remote-instances.js";export*from"./lib/team.js";export*from"./lib/sessions.js";export*from"./lib/conversations.js";export*from"./lib/backlog.js";export*from"./lib/team-review-changes.js";export*from"./lib/goal-outcome.js";export*from"./lib/role-fidelity.js";export*from"./lib/goal-retro.js";export*from"./lib/follow-ups.js";export*from"./lib/changes.js";export*from"./lib/main-mirror.js";export*from"./lib/team-design.js";export*from"./lib/team-library.js";export*from"./lib/team-skills.js";export*from"./lib/system-report.js";export*from"./lib/overseer-findings.js";export*from"./lib/overseer-rounds.js";export*from"./lib/goal-design.js";export*from"./lib/overseer-messages.js";export*from"./lib/team-roadmap.js";export*from"./lib/team-prompts.js";export{PROOF_ACTIONS,NOT_RUN_KINDS}from"./lib/team-delivery.js";export*from"./lib/canvas.js";export*from"./lib/canvas-catalog.js";export*from"./lib/canvas-frame-policy.js";export*from"./lib/canvas-attachments.js";export*from"./lib/canvas-editing.js";export*from"./lib/canvas-chat.js";export*from"./lib/canvas-hub.js";
1
+ "use strict";export*from"./lib/schema-version.js";export*from"./lib/source-location.js";export*from"./lib/context.js";export*from"./lib/event.js";export*from"./lib/node.js";export*from"./lib/edge.js";export*from"./lib/attributes.js";export*from"./lib/producer-health.js";export*from"./lib/resources.js";export*from"./lib/tokens.js";export*from"./lib/capture-demand.js";export*from"./lib/bounded-clone.js";export*from"./lib/bounded-map.js";export*from"./lib/flood-guard.js";export*from"./lib/dashboard.js";export*from"./lib/dashboard-path.js";export*from"./lib/lens-hosts.js";export*from"./lib/dashboard-lint.js";export*from"./lib/dashboard-typecheck.js";export*from"./lib/lint-coverage.js";export*from"./lib/lint-ignores.js";export*from"./lib/static-checks.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.js";export*from"./lib/expected-failure.js";export*from"./lib/error-verdict.js";export*from"./lib/finding-proof.js";export*from"./lib/error-cause.js";export*from"./lib/metrics-reset.js";export*from"./lib/ai-content.js";export*from"./lib/http-exchange.js";export*from"./lib/ai-call.js";export*from"./lib/ai-call-row.js";export*from"./lib/ai-call-groups.js";export*from"./lib/ai-context.js";export*from"./lib/ai-cache-facts.js";export*from"./lib/ai-cache.js";export*from"./lib/ai-cache-verdict.js";export*from"./lib/ai-together.js";export*from"./lib/ai-origins.js";export*from"./lib/ai-playground.js";export*from"./lib/ai-compare.js";export*from"./lib/pod-memory.js";export*from"./lib/perf-rules.js";export*from"./lib/sources.js";export*from"./lib/page-visit.js";export*from"./lib/replay.js";export*from"./lib/event-loop.js";export*from"./lib/workspace-actions.js";export*from"./lib/docker-jobs.js";export*from"./lib/docker-report.js";export*from"./lib/docker-runs.js";export*from"./lib/docker-errors.js";export*from"./lib/peers.js";export*from"./lib/hosts.js";export*from"./lib/cluster-hosts.js";export*from"./lib/dashboard-updates.js";export*from"./lib/accounts.js";export*from"./lib/account-drain.js";export*from"./lib/host-agents.js";export*from"./lib/remote-instances.js";export*from"./lib/team.js";export*from"./lib/sessions.js";export*from"./lib/conversations.js";export*from"./lib/backlog.js";export*from"./lib/team-review-changes.js";export*from"./lib/goal-outcome.js";export*from"./lib/role-fidelity.js";export*from"./lib/goal-retro.js";export*from"./lib/follow-ups.js";export*from"./lib/changes.js";export*from"./lib/main-mirror.js";export*from"./lib/team-design.js";export*from"./lib/team-library.js";export*from"./lib/team-skills.js";export*from"./lib/system-report.js";export*from"./lib/overseer-findings.js";export*from"./lib/overseer-rounds.js";export*from"./lib/goal-design.js";export*from"./lib/overseer-messages.js";export*from"./lib/team-roadmap.js";export*from"./lib/team-prompts.js";export{PROOF_ACTIONS,NOT_RUN_KINDS}from"./lib/team-delivery.js";export*from"./lib/canvas.js";export*from"./lib/canvas-catalog.js";export*from"./lib/canvas-frame-policy.js";export*from"./lib/canvas-attachments.js";export*from"./lib/canvas-editing.js";export*from"./lib/canvas-chat.js";export*from"./lib/canvas-hub.js";
@@ -0,0 +1,82 @@
1
+ /**
2
+ * The drain plan (Accounts › Overview; owner, 2026-11-20: «which one we should drain in order to consume as much as
3
+ * possible»): which open sign-in of a client to use first, so the most quota is spent before each reset. One order,
4
+ * read by the page (dashboard-ui overview-model.ts `drainPlans`) and by every launch that picks a sign-in by itself
5
+ * (storage sign-in-choice.ts, issues/closed/overseer-119) — so «Drain first» is where a launch goes when nothing runs.
6
+ *
7
+ * Quota left at a reset is lost, so the sign-in that loses the most per hour unless it is used — its percent left ÷ the
8
+ * hours to its reset, the pace that spends it in full — goes first. Pure.
9
+ */
10
+ /** A 5-hour window with this little left (percent) holds its sign-in back: little can run on it before that window resets. */
11
+ export declare const FIVE_TIGHT_LEFT = 10;
12
+ /**
13
+ * - `open`: usable now, with a reset ahead to pace it by.
14
+ * - `no-pace`: usable now, but no reset time is read for the window it is paced by — so no pace, and no deadline.
15
+ * - `tight`: its 5-hour window is all but used ({@link FIVE_TIGHT_LEFT}) — its turn comes when that window resets.
16
+ */
17
+ export type DrainNow = 'open' | 'no-pace' | 'tight';
18
+ /** One quota window as the drain plan reads it: a window past its reset reads 0 % used, with no reset ahead. */
19
+ export interface DrainWindow {
20
+ /** `5-hour`, `weekly`, `weekly Fable` — as the client names it. */
21
+ name: string;
22
+ /** Percent left, 0–100. */
23
+ left: number;
24
+ resetsAt?: number;
25
+ /** Its span is a week: `weekly`, a model's weekly. */
26
+ week?: boolean;
27
+ /** A 5-hour window. */
28
+ five?: boolean;
29
+ }
30
+ /** Where a sign-in stands in the drain plan: the window it is paced by, its pace, its 5-hour window when that is another. */
31
+ export interface DrainStand<W extends DrainWindow = DrainWindow> {
32
+ /** The window it is paced by: its weekly window (every model's), else a weekly one, else the tightest it has. */
33
+ budget: W;
34
+ /** Percent left in `budget`. */
35
+ left: number;
36
+ resetsAt?: number;
37
+ /** Hours to that reset — at least a minute's worth. */
38
+ hours?: number;
39
+ /** Percent an hour that spends what is left by its reset: the plan's key. */
40
+ pace?: number;
41
+ /** Its 5-hour window, when it is paced by another one. */
42
+ five?: {
43
+ window: W;
44
+ tight: boolean;
45
+ };
46
+ now: DrainNow;
47
+ }
48
+ /** Where a sign-in stands, from its windows tightest first; none read: undefined (the plan lists it apart). */
49
+ export declare function drainStand<W extends DrainWindow>(windows: readonly W[], now: number): DrainStand<W> | undefined;
50
+ /** The open ones first, then those with no reset time read, then those whose 5-hour window is all but used. */
51
+ export declare const DRAIN_GROUP: Readonly<Record<DrainNow, number>>;
52
+ /** A pace as the order compares it: paces equal to a hundredth of a percent an hour are a tie; none, last. */
53
+ export declare const drainPaceKey: (pace: number | undefined) => number;
54
+ /** What the order compares. */
55
+ export interface DrainRanked {
56
+ now: DrainNow;
57
+ pace?: number;
58
+ resetsAt?: number;
59
+ left: number;
60
+ nick: string;
61
+ }
62
+ /**
63
+ * The drain plan's order: the open ones by pace, highest first — it grows as a reset nears, so a little left that resets
64
+ * tonight outranks a lot left that resets next week — then those with no reset time read, then the tight ones. Ties:
65
+ * the sooner reset, then the more left, then by name.
66
+ */
67
+ export declare function drainOrder(a: DrainRanked, b: DrainRanked): number;
68
+ /** A quota window as a client's usage read names it (storage `UsageWindow`, the page's `DashAccountWindow`). */
69
+ export interface DrainWindowRead {
70
+ name: string;
71
+ usedPercent: number;
72
+ resetsAt?: number;
73
+ minutes?: number;
74
+ /** The lens said it reset since the reading. */
75
+ reset?: boolean;
76
+ }
77
+ /**
78
+ * A usage read's windows as the drain plan reads them — the windows that can lock a sign-in (5-hour, weekly, a model's
79
+ * weekly, any other span read; never extra usage or a spend limit), each past its reset read 0 % — tightest first.
80
+ * What the page's lock watch reads off a row (dashboard-ui accounts-page-model.ts `lockWindows`, `windowWatch`).
81
+ */
82
+ export declare function drainWindows(windows: readonly DrainWindowRead[], now: number): DrainWindow[];
@@ -0,0 +1 @@
1
+ "use strict";var m=Object.defineProperty;var d=(t,n)=>m(t,"name",{value:n,configurable:!0});var l=Object.defineProperty,c=d((t,n)=>l(t,"name",{value:n,configurable:!0}),"o");export const FIVE_TIGHT_LEFT=10;const A=36e5;export function drainStand(t,n){const e=t.find(a=>a.name==="weekly")??t.find(a=>a.week)??t[0];if(!e)return;const r=e.five?void 0:t.find(a=>a.five),s=r?{window:r,tight:r.left<=10}:void 0,i=e.resetsAt,o=i!==void 0?Math.max(1/60,(i-n)/36e5):void 0,f=o!==void 0?e.left/o:void 0,v=s?.tight?"tight":f===void 0?"no-pace":"open";return{budget:e,left:e.left,...i!==void 0?{resetsAt:i}:{},...o!==void 0&&f!==void 0?{hours:o,pace:f}:{},...s?{five:s}:{},now:v}}d(drainStand,"drainStand"),c(drainStand,"drainStand");export const DRAIN_GROUP={open:0,"no-pace":1,tight:2},drainPaceKey=c(t=>t===void 0?-1:Math.round(t*100),"drainPaceKey");export function drainOrder(t,n){return DRAIN_GROUP[t.now]-DRAIN_GROUP[n.now]||drainPaceKey(n.pace)-drainPaceKey(t.pace)||(t.resetsAt??1/0)-(n.resetsAt??1/0)||n.left-t.left||t.nick.localeCompare(n.nick)}d(drainOrder,"drainOrder"),c(drainOrder,"drainOrder");const p=/spend|extra/i,u=/^weekly\s+(\S.*)$/i;export function drainWindows(t,n){return t.filter(e=>!p.test(e.name)&&(e.name==="5-hour"||e.name==="weekly"||u.test(e.name)||e.minutes!==void 0)).map(e=>{const r=!!e.reset||e.resetsAt!==void 0&&e.resetsAt<=n,s=Math.max(0,Math.min(100,r?0:e.usedPercent)),i=e.name==="5-hour"||e.minutes===300,o=!i&&(e.name==="weekly"||u.test(e.name)||(e.minutes??0)>=10080);return{name:e.name,left:100-s,...!r&&e.resetsAt!==void 0?{resetsAt:e.resetsAt}:{},...o?{week:!0}:{},...i?{five:!0}:{}}}).sort((e,r)=>e.left-r.left||(e.resetsAt??1/0)-(r.resetsAt??1/0)||0)}d(drainWindows,"drainWindows"),c(drainWindows,"drainWindows");
package/lib/team.d.ts CHANGED
@@ -1536,6 +1536,35 @@ export interface DashTeamLaunchesAnswer {
1536
1536
  /** Each client with a stop: its sign-ins as team launches see them — whether any is free, and the one they run on. */
1537
1537
  signIns?: DashTeamClientSignIns[];
1538
1538
  }
1539
+ /** One sign-in as Team › Start a manager offers it (the owner, 2026-11-25: «select account or auto pick»). */
1540
+ export interface DashTeamSignInChoice {
1541
+ /** The account's id — `null`, the client's own sign-in. */
1542
+ account: string | null;
1543
+ nick: string;
1544
+ /** No quota stop or full window holds it, and it can run a launch. */
1545
+ ready: boolean;
1546
+ /** Why not, or «ready»: «is out of quota until 02:30 (its 5-hour window is full)». */
1547
+ words: string;
1548
+ /** The agents LensMCP runs on it now. */
1549
+ running: number;
1550
+ /** The client's default (its selected account). */
1551
+ isDefault: boolean;
1552
+ }
1553
+ /** `GET /api/team/launch/manager/sign-ins?goalId=`: what Start a manager offers — each client's sign-ins, and Auto's pick. */
1554
+ export interface DashTeamManagerSignIns {
1555
+ /** The client the manager runs on unless one is picked: the goal's, else the manager role's. */
1556
+ client?: DashTeamLaunchClient;
1557
+ /** The goal's own account (`lensmcp agent task <goal> --account`): Auto takes it, and it alone. */
1558
+ goalAccount?: string;
1559
+ clients: Array<{
1560
+ client: DashTeamLaunchClient;
1561
+ /** The sign-in Auto takes now — its account id, `null` its own sign-in; absent: none is ready. */
1562
+ auto?: string | null;
1563
+ autoNick?: string;
1564
+ /** Ready ones first, best first (storage sign-in-choice.ts), then the rest. */
1565
+ choices: DashTeamSignInChoice[];
1566
+ }>;
1567
+ }
1539
1568
  /** A sign-in stopped on its quota, as Team › Agents shows it (overseer-27). */
1540
1569
  export interface DashTeamClientStop {
1541
1570
  client: DashTeamLaunchClient;
@@ -1564,7 +1593,10 @@ export interface DashTeamClientSignIns {
1564
1593
  total: number;
1565
1594
  /** Of them, the ones no quota stop holds now — none: the client is out. */
1566
1595
  free: number;
1567
- /** The one new launches run on: the client's selected account (its id and nickname) — absent, its own sign-in. */
1596
+ /**
1597
+ * The one new launches run on (its id and nickname): the sign-in a launch that names none takes now — the best ready one
1598
+ * (storage sign-in-choice.ts, issues/closed/overseer-119) — absent, its own sign-in, or none ready (`free` 0).
1599
+ */
1568
1600
  selected?: string;
1569
1601
  selectedNick?: string;
1570
1602
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/protocol-types",
3
- "version": "1.26.30",
3
+ "version": "1.26.32",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",