@myagentroam/protocol 0.13.30 → 0.13.31

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/index.d.ts CHANGED
@@ -8777,27 +8777,90 @@ export declare const runEventSchema: z.ZodObject<{
8777
8777
  version?: number | undefined;
8778
8778
  }>;
8779
8779
  export type RunEvent = z.infer<typeof runEventSchema>;
8780
- /** Ephemeral metrics for the currently observed model request, never a history item. */
8780
+ /** One normalized request's reported usage, replaced atomically, never zero-filled. */
8781
+ export declare const runPerformanceUsageSchema: z.ZodEffects<z.ZodObject<{
8782
+ inputTokens: z.ZodOptional<z.ZodString>;
8783
+ outputTokens: z.ZodOptional<z.ZodString>;
8784
+ cacheReadTokens: z.ZodOptional<z.ZodString>;
8785
+ }, "strip", z.ZodTypeAny, {
8786
+ inputTokens?: string | undefined;
8787
+ outputTokens?: string | undefined;
8788
+ cacheReadTokens?: string | undefined;
8789
+ }, {
8790
+ inputTokens?: string | undefined;
8791
+ outputTokens?: string | undefined;
8792
+ cacheReadTokens?: string | undefined;
8793
+ }>, {
8794
+ inputTokens?: string | undefined;
8795
+ outputTokens?: string | undefined;
8796
+ cacheReadTokens?: string | undefined;
8797
+ }, {
8798
+ inputTokens?: string | undefined;
8799
+ outputTokens?: string | undefined;
8800
+ cacheReadTokens?: string | undefined;
8801
+ }>;
8802
+ /** Independent latest observations for the active Run, never a history item. */
8781
8803
  export declare const runPerformanceSchema: z.ZodEffects<z.ZodObject<{
8782
8804
  runId: z.ZodString;
8783
8805
  latencyMs: z.ZodOptional<z.ZodNumber>;
8784
8806
  tokensPerSecond: z.ZodOptional<z.ZodNumber>;
8807
+ usage: z.ZodOptional<z.ZodEffects<z.ZodObject<{
8808
+ inputTokens: z.ZodOptional<z.ZodString>;
8809
+ outputTokens: z.ZodOptional<z.ZodString>;
8810
+ cacheReadTokens: z.ZodOptional<z.ZodString>;
8811
+ }, "strip", z.ZodTypeAny, {
8812
+ inputTokens?: string | undefined;
8813
+ outputTokens?: string | undefined;
8814
+ cacheReadTokens?: string | undefined;
8815
+ }, {
8816
+ inputTokens?: string | undefined;
8817
+ outputTokens?: string | undefined;
8818
+ cacheReadTokens?: string | undefined;
8819
+ }>, {
8820
+ inputTokens?: string | undefined;
8821
+ outputTokens?: string | undefined;
8822
+ cacheReadTokens?: string | undefined;
8823
+ }, {
8824
+ inputTokens?: string | undefined;
8825
+ outputTokens?: string | undefined;
8826
+ cacheReadTokens?: string | undefined;
8827
+ }>>;
8785
8828
  }, "strip", z.ZodTypeAny, {
8786
8829
  runId: string;
8787
8830
  latencyMs?: number | undefined;
8788
8831
  tokensPerSecond?: number | undefined;
8832
+ usage?: {
8833
+ inputTokens?: string | undefined;
8834
+ outputTokens?: string | undefined;
8835
+ cacheReadTokens?: string | undefined;
8836
+ } | undefined;
8789
8837
  }, {
8790
8838
  runId: string;
8791
8839
  latencyMs?: number | undefined;
8792
8840
  tokensPerSecond?: number | undefined;
8841
+ usage?: {
8842
+ inputTokens?: string | undefined;
8843
+ outputTokens?: string | undefined;
8844
+ cacheReadTokens?: string | undefined;
8845
+ } | undefined;
8793
8846
  }>, {
8794
8847
  runId: string;
8795
8848
  latencyMs?: number | undefined;
8796
8849
  tokensPerSecond?: number | undefined;
8850
+ usage?: {
8851
+ inputTokens?: string | undefined;
8852
+ outputTokens?: string | undefined;
8853
+ cacheReadTokens?: string | undefined;
8854
+ } | undefined;
8797
8855
  }, {
8798
8856
  runId: string;
8799
8857
  latencyMs?: number | undefined;
8800
8858
  tokensPerSecond?: number | undefined;
8859
+ usage?: {
8860
+ inputTokens?: string | undefined;
8861
+ outputTokens?: string | undefined;
8862
+ cacheReadTokens?: string | undefined;
8863
+ } | undefined;
8801
8864
  }>;
8802
8865
  export type RunPerformance = z.infer<typeof runPerformanceSchema>;
8803
8866
  /**
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { modelUsageGrantSchema } from './model-usage.js';
1
+ import { modelUsageGrantSchema, usageCountSchema } from './model-usage.js';
2
2
  import { personalGitRuntimeSchema } from './git-identity.js';
3
3
  import { z } from 'zod';
4
4
  import { fileChangeDiffSchema } from './tool-result-resource.js';
@@ -1481,14 +1481,25 @@ export const runEventSchema = z.object({
1481
1481
  createdAt: z.number().int().nonnegative().optional(),
1482
1482
  version: z.number().int().nonnegative().optional()
1483
1483
  });
1484
- /** Ephemeral metrics for the currently observed model request, never a history item. */
1484
+ /** One normalized request's reported usage, replaced atomically, never zero-filled. */
1485
+ export const runPerformanceUsageSchema = z
1486
+ .object({
1487
+ inputTokens: usageCountSchema.optional(),
1488
+ outputTokens: usageCountSchema.optional(),
1489
+ cacheReadTokens: usageCountSchema.optional()
1490
+ })
1491
+ .refine((value) => Object.values(value).some((count) => count !== undefined));
1492
+ /** Independent latest observations for the active Run, never a history item. */
1485
1493
  export const runPerformanceSchema = z
1486
1494
  .object({
1487
1495
  runId: z.string().min(1).max(128),
1488
1496
  latencyMs: z.number().int().nonnegative().optional(),
1489
- tokensPerSecond: z.number().finite().nonnegative().optional()
1497
+ tokensPerSecond: z.number().finite().nonnegative().optional(),
1498
+ usage: runPerformanceUsageSchema.optional()
1490
1499
  })
1491
- .refine((value) => value.latencyMs !== undefined || value.tokensPerSecond !== undefined);
1500
+ .refine((value) => value.latencyMs !== undefined ||
1501
+ value.tokensPerSecond !== undefined ||
1502
+ value.usage !== undefined);
1492
1503
  /**
1493
1504
  * Node-to-Workbench asynchronous notifications. This is deliberately a
1494
1505
  * small envelope: business payloads remain owned by the Node and Server only
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/protocol",
3
- "version": "0.13.30",
3
+ "version": "0.13.31",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/myagentroam/mar.git",