@lensmcp/protocol-types 1.25.45 → 1.25.47

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.
@@ -187,13 +187,13 @@ export declare const RectSchema: z.ZodObject<{
187
187
  }, z.core.$strip>;
188
188
  export type Rect = z.infer<typeof RectSchema>;
189
189
  export declare const VisualFrameCauseSchema: z.ZodEnum<{
190
+ "hmr-update": "hmr-update";
190
191
  "page-load": "page-load";
192
+ "state-update": "state-update";
191
193
  "route-change": "route-change";
192
194
  "user-action": "user-action";
193
195
  "react-commit": "react-commit";
194
- "state-update": "state-update";
195
196
  "api-response": "api-response";
196
- "hmr-update": "hmr-update";
197
197
  "animation-tick": "animation-tick";
198
198
  }>;
199
199
  export type VisualFrameCause = z.infer<typeof VisualFrameCauseSchema>;
@@ -205,13 +205,13 @@ export declare const VisualChangeKindSchema: z.ZodEnum<{
205
205
  export type VisualChangeKind = z.infer<typeof VisualChangeKindSchema>;
206
206
  export declare const VisualFrameAttrsSchema: z.ZodObject<{
207
207
  causedBy: z.ZodEnum<{
208
+ "hmr-update": "hmr-update";
208
209
  "page-load": "page-load";
210
+ "state-update": "state-update";
209
211
  "route-change": "route-change";
210
212
  "user-action": "user-action";
211
213
  "react-commit": "react-commit";
212
- "state-update": "state-update";
213
214
  "api-response": "api-response";
214
- "hmr-update": "hmr-update";
215
215
  "animation-tick": "animation-tick";
216
216
  }>;
217
217
  viewport: z.ZodObject<{
package/lib/team.d.ts CHANGED
@@ -409,6 +409,46 @@ export interface DashTeamAgentBrief {
409
409
  export interface DashTeamAgentsAnswer {
410
410
  agents: DashTeamAgentBrief[];
411
411
  }
412
+ /**
413
+ * An agent's model usage in one meaning whatever its client (issues/closed/foodguard-157). The clients write it
414
+ * differently — Codex a running `total_token_usage` whose input counts cached input too, Claude Code each reply's own
415
+ * `usage` (input, cache read and cache write apart), repeated on every line of the reply — so neither is added up as it
416
+ * is written. Input is every token the requests sent: `inputCumulative = cachedInput + uncachedInput + cacheWrite`.
417
+ * Each request re-sends its whole context, so input grows as requests × context size.
418
+ */
419
+ export interface DashTeamAgentUsage {
420
+ /** Model requests: Codex `token_count` events that moved its total; Claude Code replies, once each (by `message.id`). */
421
+ requests: number;
422
+ inputCumulative: number;
423
+ /** Read from the provider's prompt cache — context re-sent (Codex `cached_input_tokens`, Claude `cache_read_input_tokens`). */
424
+ cachedInput: number;
425
+ /** Neither read from nor written to the cache (Claude `input_tokens`; Codex input − cached − cache write). */
426
+ uncachedInput: number;
427
+ /** Written to the cache (Claude `cache_creation_input_tokens`, Codex `cache_write_input_tokens`). */
428
+ cacheWrite: number;
429
+ output: number;
430
+ /** Of output, reasoning (Codex `reasoning_output_tokens`); Claude Code does not report it apart: 0. */
431
+ reasoning: number;
432
+ /** The largest context one request sent (Codex `last_token_usage.input_tokens`; Claude: a reply's whole input). */
433
+ maxContext: number;
434
+ }
435
+ /**
436
+ * Codex's usage limit — one account (`plan_type`) and one reset — as the run's agents' `token_count` events read it
437
+ * (`rate_limits.primary`). The account's, not the run's: every Codex session on that account moves it.
438
+ */
439
+ export interface DashTeamUsageLimit {
440
+ plan?: string;
441
+ /** When the limit resets (epoch ms) and its window in minutes (10080: weekly). */
442
+ resetsAt?: number;
443
+ windowMinutes?: number;
444
+ /** `used_percent` at the window's start (the last read before it, else its first) and at its end, and when each was read. */
445
+ from: number;
446
+ fromAt: number;
447
+ to: number;
448
+ toAt: number;
449
+ /** to − from: the points of the limit used in the window. */
450
+ used: number;
451
+ }
412
452
  /** `GET /api/team/agent?id=` — one agent whole. */
413
453
  export interface DashTeamAgentDetail extends DashTeamAgentBrief {
414
454
  /** Not found: why, and where it looked. */
@@ -441,11 +481,19 @@ export interface DashTeamAgentDetail extends DashTeamAgentBrief {
441
481
  /** Its client has OpenViking configured — absent: not known. */
442
482
  configured?: boolean;
443
483
  };
484
+ /**
485
+ * `input`: every input token its requests sent, cached included — Codex: its thread's `total_token_usage` now; Claude
486
+ * Code: each reply's input, cache reads and cache writes, summed once a reply (of what was read: `readFrom`). `total`:
487
+ * input + output. Before issues/closed/foodguard-157 a Claude Code agent's `input` was only its newest reply's context
488
+ * and its output was counted once a transcript LINE (about twice). `usage` says the same in more detail.
489
+ */
444
490
  tokens?: {
445
491
  input: number;
446
492
  output: number;
447
493
  total: number;
448
494
  };
495
+ /** Its model usage in one meaning for both clients, over what was read of its transcript (`readFrom`). */
496
+ usage?: DashTeamAgentUsage;
449
497
  /**
450
498
  * Agents it spawned (Codex subagents; Claude Code subagents), newest last — when (`at`), the task name it gave
451
499
  * (`task`) and the start of what it told the agent (`message`), when the transcript says.
@@ -516,6 +564,8 @@ export interface DashTeamReviewAgent {
516
564
  outcomes: Partial<Record<DashTeamOutcome, number>>;
517
565
  /** Its own transcript, folded — `tail` left out (the zip has its lines in the window). */
518
566
  transcript?: Omit<DashTeamAgentDetail, 'tail'>;
567
+ /** Its model usage in the run's window, from its own lines in it — `transcript.usage` is of its whole transcript. */
568
+ usage?: DashTeamAgentUsage;
519
569
  }
520
570
  /** One thing that happened, in time order. */
521
571
  export interface DashTeamReviewEvent {
@@ -552,7 +602,7 @@ export interface DashTeamReviewDelegation {
552
602
  }
553
603
  /** What the run says about the process — a hint for the person reviewing it, never a verdict. */
554
604
  export interface DashTeamReviewFlag {
555
- kind: 'self-review' | 'manager-did-work' | 'same-model' | 'role-model-mismatch' | 'unjoined-agent' | 'long-wait' | 'silent-claim' | 'rework' | 'no-evidence' | 'recovery' | 'open-under-closed' | 'serial' | 'idle-agent' | DashTeamConductKind;
605
+ kind: 'self-review' | 'manager-did-work' | 'same-model' | 'role-model-mismatch' | 'unjoined-agent' | 'long-wait' | 'silent-claim' | 'rework' | 'no-evidence' | 'recovery' | 'open-under-closed' | 'serial' | 'idle-agent' | 'host-slept' | DashTeamConductKind;
556
606
  severity: 'info' | 'warn';
557
607
  text: string;
558
608
  taskId?: string;
@@ -582,8 +632,29 @@ export interface DashTeamReviewMetrics {
582
632
  handoffs: number;
583
633
  messages: number;
584
634
  notes: number;
585
- /** Summed over the agents' whole transcripts (a transcript can span more than this run). */
635
+ /**
636
+ * The window's input (cached included) and output, summed over the run's transcripts — `usage.all.inputCumulative +
637
+ * usage.all.output`. Before issues/closed/foodguard-157 it added Codex's whole-thread cumulative input to Claude
638
+ * Code's newest context, over whole transcripts: not comparable to this.
639
+ */
586
640
  tokens?: number;
641
+ /** The run's model usage in its window, one meaning for both clients, each transcript counted once. */
642
+ usage?: DashTeamReviewUsage;
643
+ }
644
+ /** A run's model usage: per client, and both clients' normalized fields summed — never one client's meaning added to another's. */
645
+ export interface DashTeamReviewUsage {
646
+ codex?: DashTeamAgentUsage & {
647
+ agents: number;
648
+ };
649
+ claude?: DashTeamAgentUsage & {
650
+ agents: number;
651
+ };
652
+ /** Both clients' fields summed (`maxContext`: the largest). */
653
+ all: DashTeamAgentUsage & {
654
+ agents: number;
655
+ };
656
+ /** Codex's usage limits the window moved, per account and reset: the points the person feels. */
657
+ limits?: DashTeamUsageLimit[];
587
658
  }
588
659
  /** `GET /api/team/review?id=` — a task's run whole: the task, the tasks under it, its agents, the flow, messages and delegations. */
589
660
  export interface DashTeamReview {
@@ -899,7 +970,7 @@ export interface DashTeamQuestionOption {
899
970
  label: string;
900
971
  detail?: string;
901
972
  }
902
- /** Who answered: the manager it went to, the person (Team › Inbox, the CLI), or the person's delegate — their inbox session. */
973
+ /** Who answered: the manager it went to, the person (the dashboard's Inbox, the CLI), or the person's delegate — their inbox session. */
903
974
  export interface DashTeamQuestionAnswer {
904
975
  text: string;
905
976
  /** The option picked, 1-based. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/protocol-types",
3
- "version": "1.25.45",
3
+ "version": "1.25.47",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",