@miradorlabs/web-grpc 3.33.0 → 3.35.0

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.
Files changed (33) hide show
  1. package/google/api/field_behavior.ts +1 -1
  2. package/google/protobuf/descriptor.ts +1 -1
  3. package/google/protobuf/duration.ts +1 -1
  4. package/google/protobuf/timestamp.ts +32 -10
  5. package/package.json +1 -1
  6. package/proto/gateway/common/v1/attribute_value.ts +1 -1
  7. package/proto/gateway/common/v1/status.ts +1 -1
  8. package/proto/gateway/common/v1/types.ts +1 -1
  9. package/proto/gateway/web/v1/account_gateway.ts +1 -1
  10. package/proto/gateway/web/v1/admin_gateway.ts +1773 -132
  11. package/proto/gateway/web/v1/admin_gateway_grpc_pb.js +146 -0
  12. package/proto/gateway/web/v1/admin_gateway_pb.js +2865 -0
  13. package/proto/gateway/web/v1/ai_gateway.ts +1016 -186
  14. package/proto/gateway/web/v1/ai_gateway_grpc_pb.js +36 -0
  15. package/proto/gateway/web/v1/ai_gateway_pb.js +1593 -118
  16. package/proto/gateway/web/v1/attribute_value.ts +1 -1
  17. package/proto/gateway/web/v1/beta_gateway.ts +1 -1
  18. package/proto/gateway/web/v1/chain_gateway.ts +1 -1
  19. package/proto/gateway/web/v1/common.ts +1 -1
  20. package/proto/gateway/web/v1/derived_metric_gateway.ts +1 -1
  21. package/proto/gateway/web/v1/github_connector.ts +1 -1
  22. package/proto/gateway/web/v1/integration_gateway.ts +1 -1
  23. package/proto/gateway/web/v1/log_gateway.ts +1 -1
  24. package/proto/gateway/web/v1/market_gateway.ts +1 -1
  25. package/proto/gateway/web/v1/metric_gateway.ts +1 -1
  26. package/proto/gateway/web/v1/oauth_gateway.ts +1 -1
  27. package/proto/gateway/web/v1/plan_gateway.ts +1 -1
  28. package/proto/gateway/web/v1/policy_gateway.ts +1 -1
  29. package/proto/gateway/web/v1/reference_gateway.ts +1 -1
  30. package/proto/gateway/web/v1/rule_gateway.ts +1 -1
  31. package/proto/gateway/web/v1/slo_gateway.ts +1 -1
  32. package/proto/gateway/web/v1/trace_gateway.ts +1 -1
  33. package/proto/gateway/web/v1/trace_measure_gateway.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.15.0
3
+ // protoc-gen-ts_proto v2.15.3
4
4
  // protoc v3.21.12
5
5
  // source: proto/gateway/web/v1/ai_gateway.proto
6
6
 
@@ -878,6 +878,42 @@ export function aIEntitlementRoleToJSON(object: AIEntitlementRole): string {
878
878
  }
879
879
  }
880
880
 
881
+ /** RelayHeartbeatSort mirrors telemetry.api.v1.RelayHeartbeatSort. Unspecified is LAST_SEEN_DESC. */
882
+ export enum RelayHeartbeatSort {
883
+ /** RELAY_HEARTBEAT_SORT_UNSPECIFIED - = LAST_SEEN_DESC */
884
+ RELAY_HEARTBEAT_SORT_UNSPECIFIED = 0,
885
+ /** RELAY_HEARTBEAT_SORT_LAST_SEEN_DESC - last_seen desc, then (organization_id, project_id, account_user_id, host_name) asc */
886
+ RELAY_HEARTBEAT_SORT_LAST_SEEN_DESC = 1,
887
+ UNRECOGNIZED = -1,
888
+ }
889
+
890
+ export function relayHeartbeatSortFromJSON(object: any): RelayHeartbeatSort {
891
+ switch (object) {
892
+ case 0:
893
+ case "RELAY_HEARTBEAT_SORT_UNSPECIFIED":
894
+ return RelayHeartbeatSort.RELAY_HEARTBEAT_SORT_UNSPECIFIED;
895
+ case 1:
896
+ case "RELAY_HEARTBEAT_SORT_LAST_SEEN_DESC":
897
+ return RelayHeartbeatSort.RELAY_HEARTBEAT_SORT_LAST_SEEN_DESC;
898
+ case -1:
899
+ case "UNRECOGNIZED":
900
+ default:
901
+ return RelayHeartbeatSort.UNRECOGNIZED;
902
+ }
903
+ }
904
+
905
+ export function relayHeartbeatSortToJSON(object: RelayHeartbeatSort): string {
906
+ switch (object) {
907
+ case RelayHeartbeatSort.RELAY_HEARTBEAT_SORT_UNSPECIFIED:
908
+ return "RELAY_HEARTBEAT_SORT_UNSPECIFIED";
909
+ case RelayHeartbeatSort.RELAY_HEARTBEAT_SORT_LAST_SEEN_DESC:
910
+ return "RELAY_HEARTBEAT_SORT_LAST_SEEN_DESC";
911
+ case RelayHeartbeatSort.UNRECOGNIZED:
912
+ default:
913
+ return "UNRECOGNIZED";
914
+ }
915
+ }
916
+
881
917
  export interface ListSessionsRequest {
882
918
  organizationId: string;
883
919
  projectId: string;
@@ -2336,6 +2372,86 @@ export interface EntitlementWindow {
2336
2372
  windowSeconds?: number | undefined;
2337
2373
  }
2338
2374
 
2375
+ export interface ListRelayHeartbeatsRequest {
2376
+ organizationId: string;
2377
+ projectId: string;
2378
+ /** organization_ids / project_ids AND with organization_id / project_id, so they can only narrow the team. */
2379
+ filter:
2380
+ | RelayHeartbeatFilter
2381
+ | undefined;
2382
+ /** Unspecified is RELAY_HEARTBEAT_SORT_LAST_SEEN_DESC; an unknown value is a validation error. */
2383
+ sort: RelayHeartbeatSort;
2384
+ /** The server default (100) when 0, coerced to 1000 above it; negative is a validation error. */
2385
+ pageSize: number;
2386
+ /**
2387
+ * Opaque keyset cursor from a prior response's next_page_token; empty starts at the most recently seen
2388
+ * relay. Valid only with the scope, sort and filter that produced it (the page size may change); any other token
2389
+ * is a validation error. Weakly consistent: the order key (last_seen) moves forward as
2390
+ * heartbeats arrive, so a relay that beats while the caller pages moves ahead of the cursor and is missed until
2391
+ * a refresh.
2392
+ */
2393
+ pageToken: string;
2394
+ }
2395
+
2396
+ export interface ListRelayHeartbeatsResponse {
2397
+ status: ResponseStatus | undefined;
2398
+ relayHeartbeats: RelayHeartbeat[];
2399
+ /** Empty once the last page has been returned. */
2400
+ nextPageToken: string;
2401
+ }
2402
+
2403
+ /**
2404
+ * RelayHeartbeat mirrors telemetry.api.v1.RelayHeartbeat. One relay machine for its team: who, where, which
2405
+ * version and how fresh. The gateway stamps the organization, project, first and last seen and key id; the user id,
2406
+ * host name and version are what the relay reported, for display only. Staff read the latest heartbeat in full as
2407
+ * AdminRelayHeartbeat.
2408
+ */
2409
+ export interface RelayHeartbeat {
2410
+ organizationId: string;
2411
+ projectId: string;
2412
+ /** terma.user.id as the relay reported it; "" = signed out or an older relay. Client-claimed: display only. */
2413
+ accountUserId: string;
2414
+ hostName: string;
2415
+ /** first heartbeat the gateway received */
2416
+ firstSeen:
2417
+ | Date
2418
+ | undefined;
2419
+ /** latest heartbeat the gateway received */
2420
+ lastSeen:
2421
+ | Date
2422
+ | undefined;
2423
+ /** of the latest heartbeat (by received time) */
2424
+ termaVersion: string;
2425
+ /** the key that signed the latest heartbeat */
2426
+ miradorApiKeyId: string;
2427
+ }
2428
+
2429
+ /**
2430
+ * RelayHeartbeatFilter mirrors telemetry.api.v1.RelayHeartbeatFilter. Fields AND; a repeated field matches any of
2431
+ * its values; an unset or empty field does not filter.
2432
+ */
2433
+ export interface RelayHeartbeatFilter {
2434
+ /** UUIDs; a malformed one is a validation error. */
2435
+ organizationIds: string[];
2436
+ /** UUIDs; a malformed one is a validation error. */
2437
+ projectIds: string[];
2438
+ /** UUIDs; a malformed one is a validation error, so a signed-out relay ("") cannot be selected by user. */
2439
+ accountUserIds: string[];
2440
+ /** Exact host names. */
2441
+ hostNames: string[];
2442
+ /** Exact versions of the latest heartbeat, not any version the relay ever reported. */
2443
+ termaVersions: string[];
2444
+ /**
2445
+ * A set bound applies whatever its value and must lie within 1900-01-01 to 2262-04-11; last_seen_after must be
2446
+ * before last_seen_before when both are set.
2447
+ */
2448
+ lastSeenAfter:
2449
+ | Date
2450
+ | undefined;
2451
+ /** exclusive */
2452
+ lastSeenBefore: Date | undefined;
2453
+ }
2454
+
2339
2455
  function createBaseListSessionsRequest(): ListSessionsRequest {
2340
2456
  return { organizationId: "", projectId: "", filter: undefined, sort: 0, page: 0, perPage: 0 };
2341
2457
  }
@@ -21676,194 +21792,902 @@ export const EntitlementWindow: MessageFns<EntitlementWindow> = {
21676
21792
  },
21677
21793
  };
21678
21794
 
21679
- /**
21680
- * AIGatewayService is the frontend-facing proxy over telemetry.api.v1.AIService.
21681
- * It stamps the authorized organization/project and forwards telemetry-api-shaped messages.
21682
- */
21683
- export interface AIGatewayService {
21684
- /**
21685
- * One numbered page of the conversation catalog (sessions folded to
21686
- * one rollup by source_system + session_id), ranked by sort. Weakly consistent
21687
- * (latest-state, no frozen snapshot).
21688
- */
21689
- ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse>;
21690
- /**
21691
- * Keeps the first conversation page live: the whole top-N page re-derived each tick
21692
- * as one SessionsSnapshot, replacing client state wholesale (not a delta feed).
21693
- */
21694
- StreamSessions(request: StreamSessionsRequest, metadata?: Metadata): Observable<SessionsSnapshot>;
21695
- /** Live sidebar rollup (session_id + source_system): re-derived and re-emitted whole each tick. */
21696
- StreamSessionSummary(request: GetSessionSummaryRequest, metadata?: Metadata): Observable<AISessionSummary>;
21697
- ListSessionEvents(request: ListSessionEventsRequest, metadata?: Metadata): Promise<ListSessionEventsResponse>;
21698
- StreamSessionEvents(request: StreamSessionEventsRequest, metadata?: Metadata): Observable<AISessionEventEnvelope>;
21699
- /**
21700
- * Live, backend-computed, per-event token series for one session (replacement snapshots):
21701
- * one content-free point per logical event + whole-session totals; point count is capped.
21702
- */
21703
- StreamSessionTokenTimeline(
21704
- request: SessionTokenTimelineRequest,
21705
- metadata?: Metadata,
21706
- ): Observable<SessionTokenTimeline>;
21707
- /** Live "Files changed" card: per file the latest-observed git change-type + exact --numstat churn. */
21708
- StreamSessionFileChanges(request: SessionFileChangesRequest, metadata?: Metadata): Observable<SessionFileChanges>;
21709
- /** Filtered, keyset-paginated drill-down feed of git/GitHub actions (newest first). */
21710
- ListGitActivities(request: ListGitActivitiesRequest, metadata?: Metadata): Promise<ListGitActivitiesResponse>;
21711
- /**
21712
- * Live stream of the filtered git/GitHub feed (UPSERT per activity keyed by
21713
- * activity_id, a nonterminal GitActivitiesSnapshotCompleted, then open until cancel).
21714
- */
21715
- StreamGitActivities(request: StreamGitActivitiesRequest, metadata?: Metadata): Observable<GitActivityFrame>;
21716
- /**
21717
- * Live stream of the git dashboard's overview: a full windowed, dimension-sliced rollup of the filtered
21718
- * git activities (whole-window totals ride each frame), re-derived each tick.
21719
- */
21720
- StreamGitActivitySummary(request: GitActivitySummaryRequest, metadata?: Metadata): Observable<GitActivitySummary>;
21721
- /**
21722
- * Live token burn calendar: a windowed, dimension-sliced token/cost trend series
21723
- * plus whole-window totals.
21724
- */
21725
- StreamTokenActivitySummary(
21726
- request: TokenActivitySummaryRequest,
21727
- metadata?: Metadata,
21728
- ): Observable<TokenActivitySummary>;
21729
- /**
21730
- * Live "burn rate now" gauge: the trailing-60s cost/hr + tokens/min (total plus a per-dimension
21731
- * breakdown) and a fixed 60-minute one-minute rolling sparkline of that rate. Fixed horizon, fast
21732
- * refresh; first frame is a full snapshot.
21733
- */
21734
- StreamBurnRate(request: BurnRateRequest, metadata?: Metadata): Observable<BurnRate>;
21735
- /**
21736
- * Live token-burn calendar over an inclusive UTC [start_date, end_date] range: one complete row per
21737
- * covered day off the precomputed daily rollup. Covered empty days are zero; uncomputed history is
21738
- * omitted; today is provisional.
21739
- */
21740
- StreamDailyActivity(request: DailyActivityRequest, metadata?: Metadata): Observable<DailyActivity>;
21741
- /**
21742
- * Live current-UTC-month spend forecast: month-to-date cost and the projected month-end total (a band from
21743
- * replaying recent weeks), for the project and per model, provider, source system, user and api key, off the
21744
- * same daily rollup as StreamDailyActivity; filter.funding_modes forecasts the cost on the listed funding modes. Mirrors
21745
- * telemetry.api.v1.
21746
- */
21747
- StreamSpendForecast(request: SpendForecastRequest, metadata?: Metadata): Observable<SpendForecast>;
21748
- /**
21749
- * Live weekly activity rhythm: a sparse (weekday, hour) heatmap over a bounded sliding window in an
21750
- * explicit IANA time zone. Every latest logical event counts; settled model calls add token/cost.
21751
- */
21752
- StreamActivityRhythm(request: ActivityRhythmRequest, metadata?: Metadata): Observable<ActivityRhythm>;
21753
- /**
21754
- * Live stream of one project's dashboard bundle: headline totals, model/provider/source mix,
21755
- * and top sessions by cost.
21756
- */
21757
- StreamProjectOverview(request: ProjectOverviewRequest, metadata?: Metadata): Observable<ProjectOverview>;
21758
- /**
21759
- * Live organization home cards: one summary per requested project (zeros when it has no AI activity) —
21760
- * conversations last active in the window, their principals and git counts, and the window's burn by model.
21761
- */
21762
- StreamProjectSummaries(request: ProjectSummariesRequest, metadata?: Metadata): Observable<ProjectSummaries>;
21763
- /**
21764
- * Per-file working-state feed (keyset-paginated) behind the unlanded-work funnel: one row per
21765
- * (repository_key, ref, path) the AI edited (with filter.sessions or filter.paths, one they name), its
21766
- * most-edited checkout copy among those the filter keeps. Mirrors telemetry.api.v1.
21767
- */
21768
- ListFiles(request: ListFilesRequest, metadata?: Metadata): Promise<ListFilesResponse>;
21769
- /**
21770
- * ListFiles' files rolled up by directory, one row per (repository_key, directory), every matching directory in
21771
- * one response (unpaged). Mirrors telemetry.api.v1.
21772
- */
21773
- ListFileDirectories(request: ListFileDirectoriesRequest, metadata?: Metadata): Promise<ListFileDirectoriesResponse>;
21774
- /**
21775
- * Live stream of the unlanded-work funnel: aging tiers + discarded (git-invisible churn), a complete
21776
- * snapshot re-derived each tick. Counts every checkout copy, edited or not.
21777
- */
21778
- StreamFilesSummary(request: FilesSummaryRequest, metadata?: Metadata): Observable<FilesSummary>;
21779
- /** Latest observed list price per catalog listing from the global catalog, under stored names. */
21780
- ListModelPrices(request: ListModelPricesRequest, metadata?: Metadata): Promise<ListModelPricesResponse>;
21781
- /**
21782
- * Every stored observation for the filtered models over a time range, oldest first —
21783
- * the rows ListModelPrices collapses. filter.model_raws is required.
21784
- */
21785
- ListModelPriceHistory(
21786
- request: ListModelPriceHistoryRequest,
21787
- metadata?: Metadata,
21788
- ): Promise<ListModelPriceHistoryResponse>;
21789
- /**
21790
- * Top-N most-used resources of one kind (skills / tools / files / URLs / bash commands) over a
21791
- * sliding window, each with the prior equal-length window's count for a trend delta and distinct
21792
- * sessions. Mirrors telemetry.api.v1.
21793
- */
21794
- ListResourceRankings(request: ResourceRankingsRequest, metadata?: Metadata): Promise<ResourceRankingsResponse>;
21795
- /**
21796
- * Every model of a project over a time range: usage, the tool calls, compactions and subagent runs
21797
- * attributed to each, and who called it. Groups fold stored spellings; an ungrouped name is its own row,
21798
- * costliest first. Mirrors telemetry.api.v1.
21799
- */
21800
- ListModelActivity(request: ModelActivityRequest, metadata?: Metadata): Promise<ModelActivityResponse>;
21801
- /**
21802
- * One session's model calls and git activity on one epoch-aligned time grid: per bucket, each model's
21803
- * calls, tokens and cost, and each git action's count. Mirrors telemetry.api.v1.
21804
- */
21805
- GetSessionUsageTrend(request: SessionUsageTrendRequest, metadata?: Metadata): Promise<SessionUsageTrendResponse>;
21806
- /**
21807
- * Per-seat entitlement usage board: every entitlement owner's latest observed funding facility and
21808
- * per-harness usage % windows. Stream-first (first frame = full snapshot), seat-scoped. Mirrors
21809
- * telemetry.api.v1.
21810
- */
21811
- StreamEntitlements(request: StreamEntitlementsRequest, metadata?: Metadata): Observable<EntitlementsSnapshot>;
21795
+ function createBaseListRelayHeartbeatsRequest(): ListRelayHeartbeatsRequest {
21796
+ return { organizationId: "", projectId: "", filter: undefined, sort: 0, pageSize: 0, pageToken: "" };
21812
21797
  }
21813
21798
 
21814
- export const AIGatewayServiceServiceName = "gateway.web.v1.AIGatewayService";
21815
- export class AIGatewayServiceClientImpl implements AIGatewayService {
21816
- private readonly rpc: Rpc;
21817
- private readonly service: string;
21818
- constructor(rpc: Rpc, opts?: { service?: string }) {
21819
- this.service = opts?.service || AIGatewayServiceServiceName;
21820
- this.rpc = rpc;
21821
- this.ListSessions = this.ListSessions.bind(this);
21822
- this.StreamSessions = this.StreamSessions.bind(this);
21823
- this.StreamSessionSummary = this.StreamSessionSummary.bind(this);
21824
- this.ListSessionEvents = this.ListSessionEvents.bind(this);
21825
- this.StreamSessionEvents = this.StreamSessionEvents.bind(this);
21826
- this.StreamSessionTokenTimeline = this.StreamSessionTokenTimeline.bind(this);
21827
- this.StreamSessionFileChanges = this.StreamSessionFileChanges.bind(this);
21828
- this.ListGitActivities = this.ListGitActivities.bind(this);
21829
- this.StreamGitActivities = this.StreamGitActivities.bind(this);
21830
- this.StreamGitActivitySummary = this.StreamGitActivitySummary.bind(this);
21831
- this.StreamTokenActivitySummary = this.StreamTokenActivitySummary.bind(this);
21832
- this.StreamBurnRate = this.StreamBurnRate.bind(this);
21833
- this.StreamDailyActivity = this.StreamDailyActivity.bind(this);
21834
- this.StreamSpendForecast = this.StreamSpendForecast.bind(this);
21835
- this.StreamActivityRhythm = this.StreamActivityRhythm.bind(this);
21836
- this.StreamProjectOverview = this.StreamProjectOverview.bind(this);
21837
- this.StreamProjectSummaries = this.StreamProjectSummaries.bind(this);
21838
- this.ListFiles = this.ListFiles.bind(this);
21839
- this.ListFileDirectories = this.ListFileDirectories.bind(this);
21840
- this.StreamFilesSummary = this.StreamFilesSummary.bind(this);
21841
- this.ListModelPrices = this.ListModelPrices.bind(this);
21842
- this.ListModelPriceHistory = this.ListModelPriceHistory.bind(this);
21843
- this.ListResourceRankings = this.ListResourceRankings.bind(this);
21844
- this.ListModelActivity = this.ListModelActivity.bind(this);
21845
- this.GetSessionUsageTrend = this.GetSessionUsageTrend.bind(this);
21846
- this.StreamEntitlements = this.StreamEntitlements.bind(this);
21847
- }
21848
- ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse> {
21849
- const data = ListSessionsRequest.encode(request).finish();
21850
- const promise = this.rpc.request(this.service, "ListSessions", data, metadata);
21851
- return promise.then((data) => ListSessionsResponse.decode(new BinaryReader(data)));
21852
- }
21853
-
21854
- StreamSessions(request: StreamSessionsRequest, metadata?: Metadata): Observable<SessionsSnapshot> {
21855
- const data = StreamSessionsRequest.encode(request).finish();
21856
- const result = this.rpc.serverStreamingRequest(this.service, "StreamSessions", data, metadata);
21857
- return result.pipe(map((data) => SessionsSnapshot.decode(new BinaryReader(data))));
21858
- }
21859
-
21860
- StreamSessionSummary(request: GetSessionSummaryRequest, metadata?: Metadata): Observable<AISessionSummary> {
21861
- const data = GetSessionSummaryRequest.encode(request).finish();
21862
- const result = this.rpc.serverStreamingRequest(this.service, "StreamSessionSummary", data, metadata);
21863
- return result.pipe(map((data) => AISessionSummary.decode(new BinaryReader(data))));
21864
- }
21799
+ export const ListRelayHeartbeatsRequest: MessageFns<ListRelayHeartbeatsRequest> = {
21800
+ encode(message: ListRelayHeartbeatsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
21801
+ if (message.organizationId !== "") {
21802
+ writer.uint32(10).string(message.organizationId);
21803
+ }
21804
+ if (message.projectId !== "") {
21805
+ writer.uint32(18).string(message.projectId);
21806
+ }
21807
+ if (message.filter !== undefined) {
21808
+ RelayHeartbeatFilter.encode(message.filter, writer.uint32(26).fork()).join();
21809
+ }
21810
+ if (message.sort !== 0) {
21811
+ writer.uint32(32).int32(message.sort);
21812
+ }
21813
+ if (message.pageSize !== 0) {
21814
+ writer.uint32(40).int32(message.pageSize);
21815
+ }
21816
+ if (message.pageToken !== "") {
21817
+ writer.uint32(50).string(message.pageToken);
21818
+ }
21819
+ return writer;
21820
+ },
21865
21821
 
21866
- ListSessionEvents(request: ListSessionEventsRequest, metadata?: Metadata): Promise<ListSessionEventsResponse> {
21822
+ decode(input: BinaryReader | Uint8Array, length?: number): ListRelayHeartbeatsRequest {
21823
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
21824
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
21825
+ if (previousRecursionDepth >= 100) {
21826
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
21827
+ }
21828
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
21829
+ try {
21830
+ const end = length === undefined ? reader.len : reader.pos + length;
21831
+ const message = createBaseListRelayHeartbeatsRequest();
21832
+ while (reader.pos < end) {
21833
+ const tag = reader.uint32();
21834
+ switch (tag >>> 3) {
21835
+ case 1: {
21836
+ if (tag !== 10) {
21837
+ break;
21838
+ }
21839
+
21840
+ message.organizationId = reader.string();
21841
+ continue;
21842
+ }
21843
+ case 2: {
21844
+ if (tag !== 18) {
21845
+ break;
21846
+ }
21847
+
21848
+ message.projectId = reader.string();
21849
+ continue;
21850
+ }
21851
+ case 3: {
21852
+ if (tag !== 26) {
21853
+ break;
21854
+ }
21855
+
21856
+ message.filter = RelayHeartbeatFilter.decode(reader, reader.uint32());
21857
+ continue;
21858
+ }
21859
+ case 4: {
21860
+ if (tag !== 32) {
21861
+ break;
21862
+ }
21863
+
21864
+ message.sort = reader.int32() as any;
21865
+ continue;
21866
+ }
21867
+ case 5: {
21868
+ if (tag !== 40) {
21869
+ break;
21870
+ }
21871
+
21872
+ message.pageSize = reader.int32();
21873
+ continue;
21874
+ }
21875
+ case 6: {
21876
+ if (tag !== 50) {
21877
+ break;
21878
+ }
21879
+
21880
+ message.pageToken = reader.string();
21881
+ continue;
21882
+ }
21883
+ }
21884
+ if ((tag & 7) === 4 || tag === 0) {
21885
+ break;
21886
+ }
21887
+ reader.skip(tag & 7);
21888
+ }
21889
+ return message;
21890
+ } finally {
21891
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
21892
+ }
21893
+ },
21894
+
21895
+ fromJSON(object: any): ListRelayHeartbeatsRequest {
21896
+ return {
21897
+ organizationId: isSet(object.organizationId)
21898
+ ? globalThis.String(object.organizationId)
21899
+ : isSet(object.organization_id)
21900
+ ? globalThis.String(object.organization_id)
21901
+ : "",
21902
+ projectId: isSet(object.projectId)
21903
+ ? globalThis.String(object.projectId)
21904
+ : isSet(object.project_id)
21905
+ ? globalThis.String(object.project_id)
21906
+ : "",
21907
+ filter: isSet(object.filter) ? RelayHeartbeatFilter.fromJSON(object.filter) : undefined,
21908
+ sort: isSet(object.sort) ? relayHeartbeatSortFromJSON(object.sort) : 0,
21909
+ pageSize: isSet(object.pageSize)
21910
+ ? globalThis.Number(object.pageSize)
21911
+ : isSet(object.page_size)
21912
+ ? globalThis.Number(object.page_size)
21913
+ : 0,
21914
+ pageToken: isSet(object.pageToken)
21915
+ ? globalThis.String(object.pageToken)
21916
+ : isSet(object.page_token)
21917
+ ? globalThis.String(object.page_token)
21918
+ : "",
21919
+ };
21920
+ },
21921
+
21922
+ toJSON(message: ListRelayHeartbeatsRequest): unknown {
21923
+ const obj: any = {};
21924
+ if (message.organizationId !== "") {
21925
+ obj.organizationId = message.organizationId;
21926
+ }
21927
+ if (message.projectId !== "") {
21928
+ obj.projectId = message.projectId;
21929
+ }
21930
+ if (message.filter !== undefined) {
21931
+ obj.filter = RelayHeartbeatFilter.toJSON(message.filter);
21932
+ }
21933
+ if (message.sort !== 0) {
21934
+ obj.sort = relayHeartbeatSortToJSON(message.sort);
21935
+ }
21936
+ if (message.pageSize !== 0) {
21937
+ obj.pageSize = Math.round(message.pageSize);
21938
+ }
21939
+ if (message.pageToken !== "") {
21940
+ obj.pageToken = message.pageToken;
21941
+ }
21942
+ return obj;
21943
+ },
21944
+
21945
+ create<I extends Exact<DeepPartial<ListRelayHeartbeatsRequest>, I>>(base?: I): ListRelayHeartbeatsRequest {
21946
+ return ListRelayHeartbeatsRequest.fromPartial(base ?? ({} as any));
21947
+ },
21948
+ fromPartial<I extends Exact<DeepPartial<ListRelayHeartbeatsRequest>, I>>(object: I): ListRelayHeartbeatsRequest {
21949
+ const message = createBaseListRelayHeartbeatsRequest();
21950
+ message.organizationId = object.organizationId ?? "";
21951
+ message.projectId = object.projectId ?? "";
21952
+ message.filter = (object.filter !== undefined && object.filter !== null)
21953
+ ? RelayHeartbeatFilter.fromPartial(object.filter)
21954
+ : undefined;
21955
+ message.sort = object.sort ?? 0;
21956
+ message.pageSize = object.pageSize ?? 0;
21957
+ message.pageToken = object.pageToken ?? "";
21958
+ return message;
21959
+ },
21960
+ };
21961
+
21962
+ function createBaseListRelayHeartbeatsResponse(): ListRelayHeartbeatsResponse {
21963
+ return { status: undefined, relayHeartbeats: [], nextPageToken: "" };
21964
+ }
21965
+
21966
+ export const ListRelayHeartbeatsResponse: MessageFns<ListRelayHeartbeatsResponse> = {
21967
+ encode(message: ListRelayHeartbeatsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
21968
+ if (message.status !== undefined) {
21969
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
21970
+ }
21971
+ for (const v of message.relayHeartbeats) {
21972
+ RelayHeartbeat.encode(v!, writer.uint32(18).fork()).join();
21973
+ }
21974
+ if (message.nextPageToken !== "") {
21975
+ writer.uint32(26).string(message.nextPageToken);
21976
+ }
21977
+ return writer;
21978
+ },
21979
+
21980
+ decode(input: BinaryReader | Uint8Array, length?: number): ListRelayHeartbeatsResponse {
21981
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
21982
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
21983
+ if (previousRecursionDepth >= 100) {
21984
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
21985
+ }
21986
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
21987
+ try {
21988
+ const end = length === undefined ? reader.len : reader.pos + length;
21989
+ const message = createBaseListRelayHeartbeatsResponse();
21990
+ while (reader.pos < end) {
21991
+ const tag = reader.uint32();
21992
+ switch (tag >>> 3) {
21993
+ case 1: {
21994
+ if (tag !== 10) {
21995
+ break;
21996
+ }
21997
+
21998
+ message.status = ResponseStatus.decode(reader, reader.uint32());
21999
+ continue;
22000
+ }
22001
+ case 2: {
22002
+ if (tag !== 18) {
22003
+ break;
22004
+ }
22005
+
22006
+ message.relayHeartbeats.push(RelayHeartbeat.decode(reader, reader.uint32()));
22007
+ continue;
22008
+ }
22009
+ case 3: {
22010
+ if (tag !== 26) {
22011
+ break;
22012
+ }
22013
+
22014
+ message.nextPageToken = reader.string();
22015
+ continue;
22016
+ }
22017
+ }
22018
+ if ((tag & 7) === 4 || tag === 0) {
22019
+ break;
22020
+ }
22021
+ reader.skip(tag & 7);
22022
+ }
22023
+ return message;
22024
+ } finally {
22025
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
22026
+ }
22027
+ },
22028
+
22029
+ fromJSON(object: any): ListRelayHeartbeatsResponse {
22030
+ return {
22031
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
22032
+ relayHeartbeats: globalThis.Array.isArray(object?.relayHeartbeats)
22033
+ ? object.relayHeartbeats.map((e: any) => RelayHeartbeat.fromJSON(e))
22034
+ : globalThis.Array.isArray(object?.relay_heartbeats)
22035
+ ? object.relay_heartbeats.map((e: any) => RelayHeartbeat.fromJSON(e))
22036
+ : [],
22037
+ nextPageToken: isSet(object.nextPageToken)
22038
+ ? globalThis.String(object.nextPageToken)
22039
+ : isSet(object.next_page_token)
22040
+ ? globalThis.String(object.next_page_token)
22041
+ : "",
22042
+ };
22043
+ },
22044
+
22045
+ toJSON(message: ListRelayHeartbeatsResponse): unknown {
22046
+ const obj: any = {};
22047
+ if (message.status !== undefined) {
22048
+ obj.status = ResponseStatus.toJSON(message.status);
22049
+ }
22050
+ if (message.relayHeartbeats?.length) {
22051
+ obj.relayHeartbeats = message.relayHeartbeats.map((e) => RelayHeartbeat.toJSON(e));
22052
+ }
22053
+ if (message.nextPageToken !== "") {
22054
+ obj.nextPageToken = message.nextPageToken;
22055
+ }
22056
+ return obj;
22057
+ },
22058
+
22059
+ create<I extends Exact<DeepPartial<ListRelayHeartbeatsResponse>, I>>(base?: I): ListRelayHeartbeatsResponse {
22060
+ return ListRelayHeartbeatsResponse.fromPartial(base ?? ({} as any));
22061
+ },
22062
+ fromPartial<I extends Exact<DeepPartial<ListRelayHeartbeatsResponse>, I>>(object: I): ListRelayHeartbeatsResponse {
22063
+ const message = createBaseListRelayHeartbeatsResponse();
22064
+ message.status = (object.status !== undefined && object.status !== null)
22065
+ ? ResponseStatus.fromPartial(object.status)
22066
+ : undefined;
22067
+ message.relayHeartbeats = object.relayHeartbeats?.map((e) => RelayHeartbeat.fromPartial(e)) || [];
22068
+ message.nextPageToken = object.nextPageToken ?? "";
22069
+ return message;
22070
+ },
22071
+ };
22072
+
22073
+ function createBaseRelayHeartbeat(): RelayHeartbeat {
22074
+ return {
22075
+ organizationId: "",
22076
+ projectId: "",
22077
+ accountUserId: "",
22078
+ hostName: "",
22079
+ firstSeen: undefined,
22080
+ lastSeen: undefined,
22081
+ termaVersion: "",
22082
+ miradorApiKeyId: "",
22083
+ };
22084
+ }
22085
+
22086
+ export const RelayHeartbeat: MessageFns<RelayHeartbeat> = {
22087
+ encode(message: RelayHeartbeat, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
22088
+ if (message.organizationId !== "") {
22089
+ writer.uint32(10).string(message.organizationId);
22090
+ }
22091
+ if (message.projectId !== "") {
22092
+ writer.uint32(18).string(message.projectId);
22093
+ }
22094
+ if (message.accountUserId !== "") {
22095
+ writer.uint32(26).string(message.accountUserId);
22096
+ }
22097
+ if (message.hostName !== "") {
22098
+ writer.uint32(34).string(message.hostName);
22099
+ }
22100
+ if (message.firstSeen !== undefined) {
22101
+ Timestamp.encode(toTimestamp(message.firstSeen), writer.uint32(42).fork()).join();
22102
+ }
22103
+ if (message.lastSeen !== undefined) {
22104
+ Timestamp.encode(toTimestamp(message.lastSeen), writer.uint32(50).fork()).join();
22105
+ }
22106
+ if (message.termaVersion !== "") {
22107
+ writer.uint32(58).string(message.termaVersion);
22108
+ }
22109
+ if (message.miradorApiKeyId !== "") {
22110
+ writer.uint32(66).string(message.miradorApiKeyId);
22111
+ }
22112
+ return writer;
22113
+ },
22114
+
22115
+ decode(input: BinaryReader | Uint8Array, length?: number): RelayHeartbeat {
22116
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
22117
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
22118
+ if (previousRecursionDepth >= 100) {
22119
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
22120
+ }
22121
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
22122
+ try {
22123
+ const end = length === undefined ? reader.len : reader.pos + length;
22124
+ const message = createBaseRelayHeartbeat();
22125
+ while (reader.pos < end) {
22126
+ const tag = reader.uint32();
22127
+ switch (tag >>> 3) {
22128
+ case 1: {
22129
+ if (tag !== 10) {
22130
+ break;
22131
+ }
22132
+
22133
+ message.organizationId = reader.string();
22134
+ continue;
22135
+ }
22136
+ case 2: {
22137
+ if (tag !== 18) {
22138
+ break;
22139
+ }
22140
+
22141
+ message.projectId = reader.string();
22142
+ continue;
22143
+ }
22144
+ case 3: {
22145
+ if (tag !== 26) {
22146
+ break;
22147
+ }
22148
+
22149
+ message.accountUserId = reader.string();
22150
+ continue;
22151
+ }
22152
+ case 4: {
22153
+ if (tag !== 34) {
22154
+ break;
22155
+ }
22156
+
22157
+ message.hostName = reader.string();
22158
+ continue;
22159
+ }
22160
+ case 5: {
22161
+ if (tag !== 42) {
22162
+ break;
22163
+ }
22164
+
22165
+ message.firstSeen = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
22166
+ continue;
22167
+ }
22168
+ case 6: {
22169
+ if (tag !== 50) {
22170
+ break;
22171
+ }
22172
+
22173
+ message.lastSeen = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
22174
+ continue;
22175
+ }
22176
+ case 7: {
22177
+ if (tag !== 58) {
22178
+ break;
22179
+ }
22180
+
22181
+ message.termaVersion = reader.string();
22182
+ continue;
22183
+ }
22184
+ case 8: {
22185
+ if (tag !== 66) {
22186
+ break;
22187
+ }
22188
+
22189
+ message.miradorApiKeyId = reader.string();
22190
+ continue;
22191
+ }
22192
+ }
22193
+ if ((tag & 7) === 4 || tag === 0) {
22194
+ break;
22195
+ }
22196
+ reader.skip(tag & 7);
22197
+ }
22198
+ return message;
22199
+ } finally {
22200
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
22201
+ }
22202
+ },
22203
+
22204
+ fromJSON(object: any): RelayHeartbeat {
22205
+ return {
22206
+ organizationId: isSet(object.organizationId)
22207
+ ? globalThis.String(object.organizationId)
22208
+ : isSet(object.organization_id)
22209
+ ? globalThis.String(object.organization_id)
22210
+ : "",
22211
+ projectId: isSet(object.projectId)
22212
+ ? globalThis.String(object.projectId)
22213
+ : isSet(object.project_id)
22214
+ ? globalThis.String(object.project_id)
22215
+ : "",
22216
+ accountUserId: isSet(object.accountUserId)
22217
+ ? globalThis.String(object.accountUserId)
22218
+ : isSet(object.account_user_id)
22219
+ ? globalThis.String(object.account_user_id)
22220
+ : "",
22221
+ hostName: isSet(object.hostName)
22222
+ ? globalThis.String(object.hostName)
22223
+ : isSet(object.host_name)
22224
+ ? globalThis.String(object.host_name)
22225
+ : "",
22226
+ firstSeen: isSet(object.firstSeen)
22227
+ ? fromJsonTimestamp(object.firstSeen)
22228
+ : isSet(object.first_seen)
22229
+ ? fromJsonTimestamp(object.first_seen)
22230
+ : undefined,
22231
+ lastSeen: isSet(object.lastSeen)
22232
+ ? fromJsonTimestamp(object.lastSeen)
22233
+ : isSet(object.last_seen)
22234
+ ? fromJsonTimestamp(object.last_seen)
22235
+ : undefined,
22236
+ termaVersion: isSet(object.termaVersion)
22237
+ ? globalThis.String(object.termaVersion)
22238
+ : isSet(object.terma_version)
22239
+ ? globalThis.String(object.terma_version)
22240
+ : "",
22241
+ miradorApiKeyId: isSet(object.miradorApiKeyId)
22242
+ ? globalThis.String(object.miradorApiKeyId)
22243
+ : isSet(object.mirador_api_key_id)
22244
+ ? globalThis.String(object.mirador_api_key_id)
22245
+ : "",
22246
+ };
22247
+ },
22248
+
22249
+ toJSON(message: RelayHeartbeat): unknown {
22250
+ const obj: any = {};
22251
+ if (message.organizationId !== "") {
22252
+ obj.organizationId = message.organizationId;
22253
+ }
22254
+ if (message.projectId !== "") {
22255
+ obj.projectId = message.projectId;
22256
+ }
22257
+ if (message.accountUserId !== "") {
22258
+ obj.accountUserId = message.accountUserId;
22259
+ }
22260
+ if (message.hostName !== "") {
22261
+ obj.hostName = message.hostName;
22262
+ }
22263
+ if (message.firstSeen !== undefined) {
22264
+ obj.firstSeen = message.firstSeen.toISOString();
22265
+ }
22266
+ if (message.lastSeen !== undefined) {
22267
+ obj.lastSeen = message.lastSeen.toISOString();
22268
+ }
22269
+ if (message.termaVersion !== "") {
22270
+ obj.termaVersion = message.termaVersion;
22271
+ }
22272
+ if (message.miradorApiKeyId !== "") {
22273
+ obj.miradorApiKeyId = message.miradorApiKeyId;
22274
+ }
22275
+ return obj;
22276
+ },
22277
+
22278
+ create<I extends Exact<DeepPartial<RelayHeartbeat>, I>>(base?: I): RelayHeartbeat {
22279
+ return RelayHeartbeat.fromPartial(base ?? ({} as any));
22280
+ },
22281
+ fromPartial<I extends Exact<DeepPartial<RelayHeartbeat>, I>>(object: I): RelayHeartbeat {
22282
+ const message = createBaseRelayHeartbeat();
22283
+ message.organizationId = object.organizationId ?? "";
22284
+ message.projectId = object.projectId ?? "";
22285
+ message.accountUserId = object.accountUserId ?? "";
22286
+ message.hostName = object.hostName ?? "";
22287
+ message.firstSeen = object.firstSeen ?? undefined;
22288
+ message.lastSeen = object.lastSeen ?? undefined;
22289
+ message.termaVersion = object.termaVersion ?? "";
22290
+ message.miradorApiKeyId = object.miradorApiKeyId ?? "";
22291
+ return message;
22292
+ },
22293
+ };
22294
+
22295
+ function createBaseRelayHeartbeatFilter(): RelayHeartbeatFilter {
22296
+ return {
22297
+ organizationIds: [],
22298
+ projectIds: [],
22299
+ accountUserIds: [],
22300
+ hostNames: [],
22301
+ termaVersions: [],
22302
+ lastSeenAfter: undefined,
22303
+ lastSeenBefore: undefined,
22304
+ };
22305
+ }
22306
+
22307
+ export const RelayHeartbeatFilter: MessageFns<RelayHeartbeatFilter> = {
22308
+ encode(message: RelayHeartbeatFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
22309
+ for (const v of message.organizationIds) {
22310
+ writer.uint32(10).string(v!);
22311
+ }
22312
+ for (const v of message.projectIds) {
22313
+ writer.uint32(18).string(v!);
22314
+ }
22315
+ for (const v of message.accountUserIds) {
22316
+ writer.uint32(26).string(v!);
22317
+ }
22318
+ for (const v of message.hostNames) {
22319
+ writer.uint32(34).string(v!);
22320
+ }
22321
+ for (const v of message.termaVersions) {
22322
+ writer.uint32(42).string(v!);
22323
+ }
22324
+ if (message.lastSeenAfter !== undefined) {
22325
+ Timestamp.encode(toTimestamp(message.lastSeenAfter), writer.uint32(50).fork()).join();
22326
+ }
22327
+ if (message.lastSeenBefore !== undefined) {
22328
+ Timestamp.encode(toTimestamp(message.lastSeenBefore), writer.uint32(58).fork()).join();
22329
+ }
22330
+ return writer;
22331
+ },
22332
+
22333
+ decode(input: BinaryReader | Uint8Array, length?: number): RelayHeartbeatFilter {
22334
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
22335
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
22336
+ if (previousRecursionDepth >= 100) {
22337
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
22338
+ }
22339
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
22340
+ try {
22341
+ const end = length === undefined ? reader.len : reader.pos + length;
22342
+ const message = createBaseRelayHeartbeatFilter();
22343
+ while (reader.pos < end) {
22344
+ const tag = reader.uint32();
22345
+ switch (tag >>> 3) {
22346
+ case 1: {
22347
+ if (tag !== 10) {
22348
+ break;
22349
+ }
22350
+
22351
+ message.organizationIds.push(reader.string());
22352
+ continue;
22353
+ }
22354
+ case 2: {
22355
+ if (tag !== 18) {
22356
+ break;
22357
+ }
22358
+
22359
+ message.projectIds.push(reader.string());
22360
+ continue;
22361
+ }
22362
+ case 3: {
22363
+ if (tag !== 26) {
22364
+ break;
22365
+ }
22366
+
22367
+ message.accountUserIds.push(reader.string());
22368
+ continue;
22369
+ }
22370
+ case 4: {
22371
+ if (tag !== 34) {
22372
+ break;
22373
+ }
22374
+
22375
+ message.hostNames.push(reader.string());
22376
+ continue;
22377
+ }
22378
+ case 5: {
22379
+ if (tag !== 42) {
22380
+ break;
22381
+ }
22382
+
22383
+ message.termaVersions.push(reader.string());
22384
+ continue;
22385
+ }
22386
+ case 6: {
22387
+ if (tag !== 50) {
22388
+ break;
22389
+ }
22390
+
22391
+ message.lastSeenAfter = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
22392
+ continue;
22393
+ }
22394
+ case 7: {
22395
+ if (tag !== 58) {
22396
+ break;
22397
+ }
22398
+
22399
+ message.lastSeenBefore = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
22400
+ continue;
22401
+ }
22402
+ }
22403
+ if ((tag & 7) === 4 || tag === 0) {
22404
+ break;
22405
+ }
22406
+ reader.skip(tag & 7);
22407
+ }
22408
+ return message;
22409
+ } finally {
22410
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
22411
+ }
22412
+ },
22413
+
22414
+ fromJSON(object: any): RelayHeartbeatFilter {
22415
+ return {
22416
+ organizationIds: globalThis.Array.isArray(object?.organizationIds)
22417
+ ? object.organizationIds.map((e: any) => globalThis.String(e))
22418
+ : globalThis.Array.isArray(object?.organization_ids)
22419
+ ? object.organization_ids.map((e: any) => globalThis.String(e))
22420
+ : [],
22421
+ projectIds: globalThis.Array.isArray(object?.projectIds)
22422
+ ? object.projectIds.map((e: any) => globalThis.String(e))
22423
+ : globalThis.Array.isArray(object?.project_ids)
22424
+ ? object.project_ids.map((e: any) => globalThis.String(e))
22425
+ : [],
22426
+ accountUserIds: globalThis.Array.isArray(object?.accountUserIds)
22427
+ ? object.accountUserIds.map((e: any) => globalThis.String(e))
22428
+ : globalThis.Array.isArray(object?.account_user_ids)
22429
+ ? object.account_user_ids.map((e: any) => globalThis.String(e))
22430
+ : [],
22431
+ hostNames: globalThis.Array.isArray(object?.hostNames)
22432
+ ? object.hostNames.map((e: any) => globalThis.String(e))
22433
+ : globalThis.Array.isArray(object?.host_names)
22434
+ ? object.host_names.map((e: any) => globalThis.String(e))
22435
+ : [],
22436
+ termaVersions: globalThis.Array.isArray(object?.termaVersions)
22437
+ ? object.termaVersions.map((e: any) => globalThis.String(e))
22438
+ : globalThis.Array.isArray(object?.terma_versions)
22439
+ ? object.terma_versions.map((e: any) => globalThis.String(e))
22440
+ : [],
22441
+ lastSeenAfter: isSet(object.lastSeenAfter)
22442
+ ? fromJsonTimestamp(object.lastSeenAfter)
22443
+ : isSet(object.last_seen_after)
22444
+ ? fromJsonTimestamp(object.last_seen_after)
22445
+ : undefined,
22446
+ lastSeenBefore: isSet(object.lastSeenBefore)
22447
+ ? fromJsonTimestamp(object.lastSeenBefore)
22448
+ : isSet(object.last_seen_before)
22449
+ ? fromJsonTimestamp(object.last_seen_before)
22450
+ : undefined,
22451
+ };
22452
+ },
22453
+
22454
+ toJSON(message: RelayHeartbeatFilter): unknown {
22455
+ const obj: any = {};
22456
+ if (message.organizationIds?.length) {
22457
+ obj.organizationIds = message.organizationIds;
22458
+ }
22459
+ if (message.projectIds?.length) {
22460
+ obj.projectIds = message.projectIds;
22461
+ }
22462
+ if (message.accountUserIds?.length) {
22463
+ obj.accountUserIds = message.accountUserIds;
22464
+ }
22465
+ if (message.hostNames?.length) {
22466
+ obj.hostNames = message.hostNames;
22467
+ }
22468
+ if (message.termaVersions?.length) {
22469
+ obj.termaVersions = message.termaVersions;
22470
+ }
22471
+ if (message.lastSeenAfter !== undefined) {
22472
+ obj.lastSeenAfter = message.lastSeenAfter.toISOString();
22473
+ }
22474
+ if (message.lastSeenBefore !== undefined) {
22475
+ obj.lastSeenBefore = message.lastSeenBefore.toISOString();
22476
+ }
22477
+ return obj;
22478
+ },
22479
+
22480
+ create<I extends Exact<DeepPartial<RelayHeartbeatFilter>, I>>(base?: I): RelayHeartbeatFilter {
22481
+ return RelayHeartbeatFilter.fromPartial(base ?? ({} as any));
22482
+ },
22483
+ fromPartial<I extends Exact<DeepPartial<RelayHeartbeatFilter>, I>>(object: I): RelayHeartbeatFilter {
22484
+ const message = createBaseRelayHeartbeatFilter();
22485
+ message.organizationIds = object.organizationIds?.map((e) => e) || [];
22486
+ message.projectIds = object.projectIds?.map((e) => e) || [];
22487
+ message.accountUserIds = object.accountUserIds?.map((e) => e) || [];
22488
+ message.hostNames = object.hostNames?.map((e) => e) || [];
22489
+ message.termaVersions = object.termaVersions?.map((e) => e) || [];
22490
+ message.lastSeenAfter = object.lastSeenAfter ?? undefined;
22491
+ message.lastSeenBefore = object.lastSeenBefore ?? undefined;
22492
+ return message;
22493
+ },
22494
+ };
22495
+
22496
+ /**
22497
+ * AIGatewayService is the frontend-facing proxy over telemetry.api.v1.AIService.
22498
+ * It stamps the authorized organization/project and forwards telemetry-api-shaped messages.
22499
+ */
22500
+ export interface AIGatewayService {
22501
+ /**
22502
+ * One numbered page of the conversation catalog (sessions folded to
22503
+ * one rollup by source_system + session_id), ranked by sort. Weakly consistent
22504
+ * (latest-state, no frozen snapshot).
22505
+ */
22506
+ ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse>;
22507
+ /**
22508
+ * Keeps the first conversation page live: the whole top-N page re-derived each tick
22509
+ * as one SessionsSnapshot, replacing client state wholesale (not a delta feed).
22510
+ */
22511
+ StreamSessions(request: StreamSessionsRequest, metadata?: Metadata): Observable<SessionsSnapshot>;
22512
+ /** Live sidebar rollup (session_id + source_system): re-derived and re-emitted whole each tick. */
22513
+ StreamSessionSummary(request: GetSessionSummaryRequest, metadata?: Metadata): Observable<AISessionSummary>;
22514
+ ListSessionEvents(request: ListSessionEventsRequest, metadata?: Metadata): Promise<ListSessionEventsResponse>;
22515
+ StreamSessionEvents(request: StreamSessionEventsRequest, metadata?: Metadata): Observable<AISessionEventEnvelope>;
22516
+ /**
22517
+ * Live, backend-computed, per-event token series for one session (replacement snapshots):
22518
+ * one content-free point per logical event + whole-session totals; point count is capped.
22519
+ */
22520
+ StreamSessionTokenTimeline(
22521
+ request: SessionTokenTimelineRequest,
22522
+ metadata?: Metadata,
22523
+ ): Observable<SessionTokenTimeline>;
22524
+ /** Live "Files changed" card: per file the latest-observed git change-type + exact --numstat churn. */
22525
+ StreamSessionFileChanges(request: SessionFileChangesRequest, metadata?: Metadata): Observable<SessionFileChanges>;
22526
+ /** Filtered, keyset-paginated drill-down feed of git/GitHub actions (newest first). */
22527
+ ListGitActivities(request: ListGitActivitiesRequest, metadata?: Metadata): Promise<ListGitActivitiesResponse>;
22528
+ /**
22529
+ * Live stream of the filtered git/GitHub feed (UPSERT per activity keyed by
22530
+ * activity_id, a nonterminal GitActivitiesSnapshotCompleted, then open until cancel).
22531
+ */
22532
+ StreamGitActivities(request: StreamGitActivitiesRequest, metadata?: Metadata): Observable<GitActivityFrame>;
22533
+ /**
22534
+ * Live stream of the git dashboard's overview: a full windowed, dimension-sliced rollup of the filtered
22535
+ * git activities (whole-window totals ride each frame), re-derived each tick.
22536
+ */
22537
+ StreamGitActivitySummary(request: GitActivitySummaryRequest, metadata?: Metadata): Observable<GitActivitySummary>;
22538
+ /**
22539
+ * Live token burn calendar: a windowed, dimension-sliced token/cost trend series
22540
+ * plus whole-window totals.
22541
+ */
22542
+ StreamTokenActivitySummary(
22543
+ request: TokenActivitySummaryRequest,
22544
+ metadata?: Metadata,
22545
+ ): Observable<TokenActivitySummary>;
22546
+ /**
22547
+ * Live "burn rate now" gauge: the trailing-60s cost/hr + tokens/min (total plus a per-dimension
22548
+ * breakdown) and a fixed 60-minute one-minute rolling sparkline of that rate. Fixed horizon, fast
22549
+ * refresh; first frame is a full snapshot.
22550
+ */
22551
+ StreamBurnRate(request: BurnRateRequest, metadata?: Metadata): Observable<BurnRate>;
22552
+ /**
22553
+ * Live token-burn calendar over an inclusive UTC [start_date, end_date] range: one complete row per
22554
+ * covered day off the precomputed daily rollup. Covered empty days are zero; uncomputed history is
22555
+ * omitted; today is provisional.
22556
+ */
22557
+ StreamDailyActivity(request: DailyActivityRequest, metadata?: Metadata): Observable<DailyActivity>;
22558
+ /**
22559
+ * Live current-UTC-month spend forecast: month-to-date cost and the projected month-end total (a band from
22560
+ * replaying recent weeks), for the project and per model, provider, source system, user and api key, off the
22561
+ * same daily rollup as StreamDailyActivity; filter.funding_modes forecasts the cost on the listed funding modes. Mirrors
22562
+ * telemetry.api.v1.
22563
+ */
22564
+ StreamSpendForecast(request: SpendForecastRequest, metadata?: Metadata): Observable<SpendForecast>;
22565
+ /**
22566
+ * Live weekly activity rhythm: a sparse (weekday, hour) heatmap over a bounded sliding window in an
22567
+ * explicit IANA time zone. Every latest logical event counts; settled model calls add token/cost.
22568
+ */
22569
+ StreamActivityRhythm(request: ActivityRhythmRequest, metadata?: Metadata): Observable<ActivityRhythm>;
22570
+ /**
22571
+ * Live stream of one project's dashboard bundle: headline totals, model/provider/source mix,
22572
+ * and top sessions by cost.
22573
+ */
22574
+ StreamProjectOverview(request: ProjectOverviewRequest, metadata?: Metadata): Observable<ProjectOverview>;
22575
+ /**
22576
+ * Live organization home cards: one summary per requested project (zeros when it has no AI activity) —
22577
+ * conversations last active in the window, their principals and git counts, and the window's burn by model.
22578
+ */
22579
+ StreamProjectSummaries(request: ProjectSummariesRequest, metadata?: Metadata): Observable<ProjectSummaries>;
22580
+ /**
22581
+ * Per-file working-state feed (keyset-paginated) behind the unlanded-work funnel: one row per
22582
+ * (repository_key, ref, path) the AI edited (with filter.sessions or filter.paths, one they name), its
22583
+ * most-edited checkout copy among those the filter keeps. Mirrors telemetry.api.v1.
22584
+ */
22585
+ ListFiles(request: ListFilesRequest, metadata?: Metadata): Promise<ListFilesResponse>;
22586
+ /**
22587
+ * ListFiles' files rolled up by directory, one row per (repository_key, directory), every matching directory in
22588
+ * one response (unpaged). Mirrors telemetry.api.v1.
22589
+ */
22590
+ ListFileDirectories(request: ListFileDirectoriesRequest, metadata?: Metadata): Promise<ListFileDirectoriesResponse>;
22591
+ /**
22592
+ * Live stream of the unlanded-work funnel: aging tiers + discarded (git-invisible churn), a complete
22593
+ * snapshot re-derived each tick. Counts every checkout copy, edited or not.
22594
+ */
22595
+ StreamFilesSummary(request: FilesSummaryRequest, metadata?: Metadata): Observable<FilesSummary>;
22596
+ /** Latest observed list price per catalog listing from the global catalog, under stored names. */
22597
+ ListModelPrices(request: ListModelPricesRequest, metadata?: Metadata): Promise<ListModelPricesResponse>;
22598
+ /**
22599
+ * Every stored observation for the filtered models over a time range, oldest first —
22600
+ * the rows ListModelPrices collapses. filter.model_raws is required.
22601
+ */
22602
+ ListModelPriceHistory(
22603
+ request: ListModelPriceHistoryRequest,
22604
+ metadata?: Metadata,
22605
+ ): Promise<ListModelPriceHistoryResponse>;
22606
+ /**
22607
+ * Top-N most-used resources of one kind (skills / tools / files / URLs / bash commands) over a
22608
+ * sliding window, each with the prior equal-length window's count for a trend delta and distinct
22609
+ * sessions. Mirrors telemetry.api.v1.
22610
+ */
22611
+ ListResourceRankings(request: ResourceRankingsRequest, metadata?: Metadata): Promise<ResourceRankingsResponse>;
22612
+ /**
22613
+ * Every model of a project over a time range: usage, the tool calls, compactions and subagent runs
22614
+ * attributed to each, and who called it. Groups fold stored spellings; an ungrouped name is its own row,
22615
+ * costliest first. Mirrors telemetry.api.v1.
22616
+ */
22617
+ ListModelActivity(request: ModelActivityRequest, metadata?: Metadata): Promise<ModelActivityResponse>;
22618
+ /**
22619
+ * One session's model calls and git activity on one epoch-aligned time grid: per bucket, each model's
22620
+ * calls, tokens and cost, and each git action's count. Mirrors telemetry.api.v1.
22621
+ */
22622
+ GetSessionUsageTrend(request: SessionUsageTrendRequest, metadata?: Metadata): Promise<SessionUsageTrendResponse>;
22623
+ /**
22624
+ * Per-seat entitlement usage board: every entitlement owner's latest observed funding facility and
22625
+ * per-harness usage % windows. Stream-first (first frame = full snapshot), seat-scoped. Mirrors
22626
+ * telemetry.api.v1.
22627
+ */
22628
+ StreamEntitlements(request: StreamEntitlementsRequest, metadata?: Metadata): Observable<EntitlementsSnapshot>;
22629
+ /**
22630
+ * The team's Terma relays: one row per (organization, project, user, host) with the first and last heartbeat
22631
+ * received and the latest heartbeat's version, most recently seen first (keyset-paginated).
22632
+ * Mirrors telemetry.api.v1.
22633
+ */
22634
+ ListRelayHeartbeats(request: ListRelayHeartbeatsRequest, metadata?: Metadata): Promise<ListRelayHeartbeatsResponse>;
22635
+ }
22636
+
22637
+ export const AIGatewayServiceServiceName = "gateway.web.v1.AIGatewayService";
22638
+ export class AIGatewayServiceClientImpl implements AIGatewayService {
22639
+ private readonly rpc: Rpc;
22640
+ private readonly service: string;
22641
+ constructor(rpc: Rpc, opts?: { service?: string }) {
22642
+ this.service = opts?.service || AIGatewayServiceServiceName;
22643
+ this.rpc = rpc;
22644
+ this.ListSessions = this.ListSessions.bind(this);
22645
+ this.StreamSessions = this.StreamSessions.bind(this);
22646
+ this.StreamSessionSummary = this.StreamSessionSummary.bind(this);
22647
+ this.ListSessionEvents = this.ListSessionEvents.bind(this);
22648
+ this.StreamSessionEvents = this.StreamSessionEvents.bind(this);
22649
+ this.StreamSessionTokenTimeline = this.StreamSessionTokenTimeline.bind(this);
22650
+ this.StreamSessionFileChanges = this.StreamSessionFileChanges.bind(this);
22651
+ this.ListGitActivities = this.ListGitActivities.bind(this);
22652
+ this.StreamGitActivities = this.StreamGitActivities.bind(this);
22653
+ this.StreamGitActivitySummary = this.StreamGitActivitySummary.bind(this);
22654
+ this.StreamTokenActivitySummary = this.StreamTokenActivitySummary.bind(this);
22655
+ this.StreamBurnRate = this.StreamBurnRate.bind(this);
22656
+ this.StreamDailyActivity = this.StreamDailyActivity.bind(this);
22657
+ this.StreamSpendForecast = this.StreamSpendForecast.bind(this);
22658
+ this.StreamActivityRhythm = this.StreamActivityRhythm.bind(this);
22659
+ this.StreamProjectOverview = this.StreamProjectOverview.bind(this);
22660
+ this.StreamProjectSummaries = this.StreamProjectSummaries.bind(this);
22661
+ this.ListFiles = this.ListFiles.bind(this);
22662
+ this.ListFileDirectories = this.ListFileDirectories.bind(this);
22663
+ this.StreamFilesSummary = this.StreamFilesSummary.bind(this);
22664
+ this.ListModelPrices = this.ListModelPrices.bind(this);
22665
+ this.ListModelPriceHistory = this.ListModelPriceHistory.bind(this);
22666
+ this.ListResourceRankings = this.ListResourceRankings.bind(this);
22667
+ this.ListModelActivity = this.ListModelActivity.bind(this);
22668
+ this.GetSessionUsageTrend = this.GetSessionUsageTrend.bind(this);
22669
+ this.StreamEntitlements = this.StreamEntitlements.bind(this);
22670
+ this.ListRelayHeartbeats = this.ListRelayHeartbeats.bind(this);
22671
+ }
22672
+ ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse> {
22673
+ const data = ListSessionsRequest.encode(request).finish();
22674
+ const promise = this.rpc.request(this.service, "ListSessions", data, metadata);
22675
+ return promise.then((data) => ListSessionsResponse.decode(new BinaryReader(data)));
22676
+ }
22677
+
22678
+ StreamSessions(request: StreamSessionsRequest, metadata?: Metadata): Observable<SessionsSnapshot> {
22679
+ const data = StreamSessionsRequest.encode(request).finish();
22680
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamSessions", data, metadata);
22681
+ return result.pipe(map((data) => SessionsSnapshot.decode(new BinaryReader(data))));
22682
+ }
22683
+
22684
+ StreamSessionSummary(request: GetSessionSummaryRequest, metadata?: Metadata): Observable<AISessionSummary> {
22685
+ const data = GetSessionSummaryRequest.encode(request).finish();
22686
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamSessionSummary", data, metadata);
22687
+ return result.pipe(map((data) => AISessionSummary.decode(new BinaryReader(data))));
22688
+ }
22689
+
22690
+ ListSessionEvents(request: ListSessionEventsRequest, metadata?: Metadata): Promise<ListSessionEventsResponse> {
21867
22691
  const data = ListSessionEventsRequest.encode(request).finish();
21868
22692
  const promise = this.rpc.request(this.service, "ListSessionEvents", data, metadata);
21869
22693
  return promise.then((data) => ListSessionEventsResponse.decode(new BinaryReader(data)));
@@ -22009,6 +22833,12 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
22009
22833
  const result = this.rpc.serverStreamingRequest(this.service, "StreamEntitlements", data, metadata);
22010
22834
  return result.pipe(map((data) => EntitlementsSnapshot.decode(new BinaryReader(data))));
22011
22835
  }
22836
+
22837
+ ListRelayHeartbeats(request: ListRelayHeartbeatsRequest, metadata?: Metadata): Promise<ListRelayHeartbeatsResponse> {
22838
+ const data = ListRelayHeartbeatsRequest.encode(request).finish();
22839
+ const promise = this.rpc.request(this.service, "ListRelayHeartbeats", data, metadata);
22840
+ return promise.then((data) => ListRelayHeartbeatsResponse.decode(new BinaryReader(data)));
22841
+ }
22012
22842
  }
22013
22843
 
22014
22844
  interface Rpc {