@miradorlabs/web-grpc 4.1.0 → 4.3.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.
@@ -1824,6 +1824,316 @@ export function relayHeartbeatSortToJSON(object: RelayHeartbeatSort): string {
1824
1824
  }
1825
1825
  }
1826
1826
 
1827
+ /** Tracker mirrors ai.api.v1.Tracker. */
1828
+ export enum Tracker {
1829
+ TRACKER_UNSPECIFIED = 0,
1830
+ TRACKER_LINEAR = 1,
1831
+ UNRECOGNIZED = -1,
1832
+ }
1833
+
1834
+ export function trackerFromJSON(object: any): Tracker {
1835
+ switch (object) {
1836
+ case 0:
1837
+ case "TRACKER_UNSPECIFIED":
1838
+ return Tracker.TRACKER_UNSPECIFIED;
1839
+ case 1:
1840
+ case "TRACKER_LINEAR":
1841
+ return Tracker.TRACKER_LINEAR;
1842
+ case -1:
1843
+ case "UNRECOGNIZED":
1844
+ default:
1845
+ return Tracker.UNRECOGNIZED;
1846
+ }
1847
+ }
1848
+
1849
+ export function trackerToJSON(object: Tracker): string {
1850
+ switch (object) {
1851
+ case Tracker.TRACKER_UNSPECIFIED:
1852
+ return "TRACKER_UNSPECIFIED";
1853
+ case Tracker.TRACKER_LINEAR:
1854
+ return "TRACKER_LINEAR";
1855
+ case Tracker.UNRECOGNIZED:
1856
+ default:
1857
+ return "UNRECOGNIZED";
1858
+ }
1859
+ }
1860
+
1861
+ /** IssueCostGroupBy mirrors ai.api.v1.IssueCostGroupBy. */
1862
+ export enum IssueCostGroupBy {
1863
+ ISSUE_COST_GROUP_BY_UNSPECIFIED = 0,
1864
+ ISSUE_COST_GROUP_BY_ISSUE = 1,
1865
+ /** ISSUE_COST_GROUP_BY_PARENT - The issue's parent (a Linear project) as last synced, with a "none" group. */
1866
+ ISSUE_COST_GROUP_BY_PARENT = 2,
1867
+ /**
1868
+ * ISSUE_COST_GROUP_BY_ITERATION - The issue's iteration (a Linear cycle) as last synced, with a "none" group: an issue moved to the next cycle
1869
+ * takes its whole cost along.
1870
+ */
1871
+ ISSUE_COST_GROUP_BY_ITERATION = 3,
1872
+ UNRECOGNIZED = -1,
1873
+ }
1874
+
1875
+ export function issueCostGroupByFromJSON(object: any): IssueCostGroupBy {
1876
+ switch (object) {
1877
+ case 0:
1878
+ case "ISSUE_COST_GROUP_BY_UNSPECIFIED":
1879
+ return IssueCostGroupBy.ISSUE_COST_GROUP_BY_UNSPECIFIED;
1880
+ case 1:
1881
+ case "ISSUE_COST_GROUP_BY_ISSUE":
1882
+ return IssueCostGroupBy.ISSUE_COST_GROUP_BY_ISSUE;
1883
+ case 2:
1884
+ case "ISSUE_COST_GROUP_BY_PARENT":
1885
+ return IssueCostGroupBy.ISSUE_COST_GROUP_BY_PARENT;
1886
+ case 3:
1887
+ case "ISSUE_COST_GROUP_BY_ITERATION":
1888
+ return IssueCostGroupBy.ISSUE_COST_GROUP_BY_ITERATION;
1889
+ case -1:
1890
+ case "UNRECOGNIZED":
1891
+ default:
1892
+ return IssueCostGroupBy.UNRECOGNIZED;
1893
+ }
1894
+ }
1895
+
1896
+ export function issueCostGroupByToJSON(object: IssueCostGroupBy): string {
1897
+ switch (object) {
1898
+ case IssueCostGroupBy.ISSUE_COST_GROUP_BY_UNSPECIFIED:
1899
+ return "ISSUE_COST_GROUP_BY_UNSPECIFIED";
1900
+ case IssueCostGroupBy.ISSUE_COST_GROUP_BY_ISSUE:
1901
+ return "ISSUE_COST_GROUP_BY_ISSUE";
1902
+ case IssueCostGroupBy.ISSUE_COST_GROUP_BY_PARENT:
1903
+ return "ISSUE_COST_GROUP_BY_PARENT";
1904
+ case IssueCostGroupBy.ISSUE_COST_GROUP_BY_ITERATION:
1905
+ return "ISSUE_COST_GROUP_BY_ITERATION";
1906
+ case IssueCostGroupBy.UNRECOGNIZED:
1907
+ default:
1908
+ return "UNRECOGNIZED";
1909
+ }
1910
+ }
1911
+
1912
+ /** IssueCostSort mirrors ai.api.v1.IssueCostSort. Unspecified is COST_DESC. */
1913
+ export enum IssueCostSort {
1914
+ ISSUE_COST_SORT_UNSPECIFIED = 0,
1915
+ /** ISSUE_COST_SORT_COST_DESC - Highest cost first, ties by id ascending. */
1916
+ ISSUE_COST_SORT_COST_DESC = 1,
1917
+ UNRECOGNIZED = -1,
1918
+ }
1919
+
1920
+ export function issueCostSortFromJSON(object: any): IssueCostSort {
1921
+ switch (object) {
1922
+ case 0:
1923
+ case "ISSUE_COST_SORT_UNSPECIFIED":
1924
+ return IssueCostSort.ISSUE_COST_SORT_UNSPECIFIED;
1925
+ case 1:
1926
+ case "ISSUE_COST_SORT_COST_DESC":
1927
+ return IssueCostSort.ISSUE_COST_SORT_COST_DESC;
1928
+ case -1:
1929
+ case "UNRECOGNIZED":
1930
+ default:
1931
+ return IssueCostSort.UNRECOGNIZED;
1932
+ }
1933
+ }
1934
+
1935
+ export function issueCostSortToJSON(object: IssueCostSort): string {
1936
+ switch (object) {
1937
+ case IssueCostSort.ISSUE_COST_SORT_UNSPECIFIED:
1938
+ return "ISSUE_COST_SORT_UNSPECIFIED";
1939
+ case IssueCostSort.ISSUE_COST_SORT_COST_DESC:
1940
+ return "ISSUE_COST_SORT_COST_DESC";
1941
+ case IssueCostSort.UNRECOGNIZED:
1942
+ default:
1943
+ return "UNRECOGNIZED";
1944
+ }
1945
+ }
1946
+
1947
+ /**
1948
+ * IssueCostAttributionMethod mirrors ai.api.v1.IssueCostAttributionMethod: how ListIssueCosts splits a session's cost
1949
+ * across the issues its pull requests are attached to. Every method gives the issues and the unattributed buckets
1950
+ * exactly the session's cost. On ListIssueCostsRequest, unspecified is PER_PR.
1951
+ */
1952
+ export enum IssueCostAttributionMethod {
1953
+ ISSUE_COST_ATTRIBUTION_METHOD_UNSPECIFIED = 0,
1954
+ /**
1955
+ * ISSUE_COST_ATTRIBUTION_METHOD_PER_PR - Evenly across the session's pull requests, then each pull request's share evenly across its issues; a pull request
1956
+ * with no issue keeps its share unattributed. A remainder goes one nanodollar at a time to the first pull requests by
1957
+ * link id, then within a pull request to the first issues by id. The default.
1958
+ */
1959
+ ISSUE_COST_ATTRIBUTION_METHOD_PER_PR = 1,
1960
+ /**
1961
+ * ISSUE_COST_ATTRIBUTION_METHOD_PER_TICKET - Evenly across slots: one per distinct issue of all the session's pull requests, so an issue reached through two
1962
+ * pull requests counts once, and one per pull request attached to no served issue, whose share is unattributed
1963
+ * ($12 over PR A with MIR-1 and PR B with none: $6 and $6). A remainder goes one nanodollar at a time to the first
1964
+ * issues by id, then to the unattributed slots.
1965
+ */
1966
+ ISSUE_COST_ATTRIBUTION_METHOD_PER_TICKET = 2,
1967
+ UNRECOGNIZED = -1,
1968
+ }
1969
+
1970
+ export function issueCostAttributionMethodFromJSON(object: any): IssueCostAttributionMethod {
1971
+ switch (object) {
1972
+ case 0:
1973
+ case "ISSUE_COST_ATTRIBUTION_METHOD_UNSPECIFIED":
1974
+ return IssueCostAttributionMethod.ISSUE_COST_ATTRIBUTION_METHOD_UNSPECIFIED;
1975
+ case 1:
1976
+ case "ISSUE_COST_ATTRIBUTION_METHOD_PER_PR":
1977
+ return IssueCostAttributionMethod.ISSUE_COST_ATTRIBUTION_METHOD_PER_PR;
1978
+ case 2:
1979
+ case "ISSUE_COST_ATTRIBUTION_METHOD_PER_TICKET":
1980
+ return IssueCostAttributionMethod.ISSUE_COST_ATTRIBUTION_METHOD_PER_TICKET;
1981
+ case -1:
1982
+ case "UNRECOGNIZED":
1983
+ default:
1984
+ return IssueCostAttributionMethod.UNRECOGNIZED;
1985
+ }
1986
+ }
1987
+
1988
+ export function issueCostAttributionMethodToJSON(object: IssueCostAttributionMethod): string {
1989
+ switch (object) {
1990
+ case IssueCostAttributionMethod.ISSUE_COST_ATTRIBUTION_METHOD_UNSPECIFIED:
1991
+ return "ISSUE_COST_ATTRIBUTION_METHOD_UNSPECIFIED";
1992
+ case IssueCostAttributionMethod.ISSUE_COST_ATTRIBUTION_METHOD_PER_PR:
1993
+ return "ISSUE_COST_ATTRIBUTION_METHOD_PER_PR";
1994
+ case IssueCostAttributionMethod.ISSUE_COST_ATTRIBUTION_METHOD_PER_TICKET:
1995
+ return "ISSUE_COST_ATTRIBUTION_METHOD_PER_TICKET";
1996
+ case IssueCostAttributionMethod.UNRECOGNIZED:
1997
+ default:
1998
+ return "UNRECOGNIZED";
1999
+ }
2000
+ }
2001
+
2002
+ /** TrackerSyncState mirrors ai.api.v1.TrackerSyncState. */
2003
+ export enum TrackerSyncState {
2004
+ TRACKER_SYNC_STATE_UNSPECIFIED = 0,
2005
+ /** TRACKER_SYNC_STATE_NOT_CONNECTED - The organization has not connected the tracker: nothing is served. */
2006
+ TRACKER_SYNC_STATE_NOT_CONNECTED = 1,
2007
+ /**
2008
+ * TRACKER_SYNC_STATE_PENDING - Connected, but the first full sync of the connected workspace has not completed (just connected, or reconnected
2009
+ * to another workspace): nothing is served, never an earlier workspace's issues.
2010
+ */
2011
+ TRACKER_SYNC_STATE_PENDING = 2,
2012
+ /** TRACKER_SYNC_STATE_SYNCED - Served; a sync completed within the last 10 minutes. */
2013
+ TRACKER_SYNC_STATE_SYNCED = 3,
2014
+ /** TRACKER_SYNC_STATE_STALE - Served, but no sync has completed for 10 minutes (last_sync_error says why when the attempts fail). */
2015
+ TRACKER_SYNC_STATE_STALE = 4,
2016
+ UNRECOGNIZED = -1,
2017
+ }
2018
+
2019
+ export function trackerSyncStateFromJSON(object: any): TrackerSyncState {
2020
+ switch (object) {
2021
+ case 0:
2022
+ case "TRACKER_SYNC_STATE_UNSPECIFIED":
2023
+ return TrackerSyncState.TRACKER_SYNC_STATE_UNSPECIFIED;
2024
+ case 1:
2025
+ case "TRACKER_SYNC_STATE_NOT_CONNECTED":
2026
+ return TrackerSyncState.TRACKER_SYNC_STATE_NOT_CONNECTED;
2027
+ case 2:
2028
+ case "TRACKER_SYNC_STATE_PENDING":
2029
+ return TrackerSyncState.TRACKER_SYNC_STATE_PENDING;
2030
+ case 3:
2031
+ case "TRACKER_SYNC_STATE_SYNCED":
2032
+ return TrackerSyncState.TRACKER_SYNC_STATE_SYNCED;
2033
+ case 4:
2034
+ case "TRACKER_SYNC_STATE_STALE":
2035
+ return TrackerSyncState.TRACKER_SYNC_STATE_STALE;
2036
+ case -1:
2037
+ case "UNRECOGNIZED":
2038
+ default:
2039
+ return TrackerSyncState.UNRECOGNIZED;
2040
+ }
2041
+ }
2042
+
2043
+ export function trackerSyncStateToJSON(object: TrackerSyncState): string {
2044
+ switch (object) {
2045
+ case TrackerSyncState.TRACKER_SYNC_STATE_UNSPECIFIED:
2046
+ return "TRACKER_SYNC_STATE_UNSPECIFIED";
2047
+ case TrackerSyncState.TRACKER_SYNC_STATE_NOT_CONNECTED:
2048
+ return "TRACKER_SYNC_STATE_NOT_CONNECTED";
2049
+ case TrackerSyncState.TRACKER_SYNC_STATE_PENDING:
2050
+ return "TRACKER_SYNC_STATE_PENDING";
2051
+ case TrackerSyncState.TRACKER_SYNC_STATE_SYNCED:
2052
+ return "TRACKER_SYNC_STATE_SYNCED";
2053
+ case TrackerSyncState.TRACKER_SYNC_STATE_STALE:
2054
+ return "TRACKER_SYNC_STATE_STALE";
2055
+ case TrackerSyncState.UNRECOGNIZED:
2056
+ default:
2057
+ return "UNRECOGNIZED";
2058
+ }
2059
+ }
2060
+
2061
+ /** TrackerSyncError mirrors ai.api.v1.TrackerSyncError. */
2062
+ export enum TrackerSyncError {
2063
+ TRACKER_SYNC_ERROR_UNSPECIFIED = 0,
2064
+ /** TRACKER_SYNC_ERROR_UNAUTHORIZED - The tracker refused the token: revoked, or the app uninstalled. Reconnecting fixes it. */
2065
+ TRACKER_SYNC_ERROR_UNAUTHORIZED = 1,
2066
+ TRACKER_SYNC_ERROR_RATE_LIMITED = 2,
2067
+ /** TRACKER_SYNC_ERROR_UNAVAILABLE - The tracker was down or slow. */
2068
+ TRACKER_SYNC_ERROR_UNAVAILABLE = 3,
2069
+ /** TRACKER_SYNC_ERROR_REJECTED - The tracker refused a request. */
2070
+ TRACKER_SYNC_ERROR_REJECTED = 4,
2071
+ /** TRACKER_SYNC_ERROR_UNREADABLE - The tracker sent what Terma could not use. */
2072
+ TRACKER_SYNC_ERROR_UNREADABLE = 5,
2073
+ /** TRACKER_SYNC_ERROR_WORKSPACE_CHANGED - The token reads another workspace than the connection names: a reconnect is landing. */
2074
+ TRACKER_SYNC_ERROR_WORKSPACE_CHANGED = 6,
2075
+ /** TRACKER_SYNC_ERROR_INTERNAL - Terma's own failure. */
2076
+ TRACKER_SYNC_ERROR_INTERNAL = 7,
2077
+ UNRECOGNIZED = -1,
2078
+ }
2079
+
2080
+ export function trackerSyncErrorFromJSON(object: any): TrackerSyncError {
2081
+ switch (object) {
2082
+ case 0:
2083
+ case "TRACKER_SYNC_ERROR_UNSPECIFIED":
2084
+ return TrackerSyncError.TRACKER_SYNC_ERROR_UNSPECIFIED;
2085
+ case 1:
2086
+ case "TRACKER_SYNC_ERROR_UNAUTHORIZED":
2087
+ return TrackerSyncError.TRACKER_SYNC_ERROR_UNAUTHORIZED;
2088
+ case 2:
2089
+ case "TRACKER_SYNC_ERROR_RATE_LIMITED":
2090
+ return TrackerSyncError.TRACKER_SYNC_ERROR_RATE_LIMITED;
2091
+ case 3:
2092
+ case "TRACKER_SYNC_ERROR_UNAVAILABLE":
2093
+ return TrackerSyncError.TRACKER_SYNC_ERROR_UNAVAILABLE;
2094
+ case 4:
2095
+ case "TRACKER_SYNC_ERROR_REJECTED":
2096
+ return TrackerSyncError.TRACKER_SYNC_ERROR_REJECTED;
2097
+ case 5:
2098
+ case "TRACKER_SYNC_ERROR_UNREADABLE":
2099
+ return TrackerSyncError.TRACKER_SYNC_ERROR_UNREADABLE;
2100
+ case 6:
2101
+ case "TRACKER_SYNC_ERROR_WORKSPACE_CHANGED":
2102
+ return TrackerSyncError.TRACKER_SYNC_ERROR_WORKSPACE_CHANGED;
2103
+ case 7:
2104
+ case "TRACKER_SYNC_ERROR_INTERNAL":
2105
+ return TrackerSyncError.TRACKER_SYNC_ERROR_INTERNAL;
2106
+ case -1:
2107
+ case "UNRECOGNIZED":
2108
+ default:
2109
+ return TrackerSyncError.UNRECOGNIZED;
2110
+ }
2111
+ }
2112
+
2113
+ export function trackerSyncErrorToJSON(object: TrackerSyncError): string {
2114
+ switch (object) {
2115
+ case TrackerSyncError.TRACKER_SYNC_ERROR_UNSPECIFIED:
2116
+ return "TRACKER_SYNC_ERROR_UNSPECIFIED";
2117
+ case TrackerSyncError.TRACKER_SYNC_ERROR_UNAUTHORIZED:
2118
+ return "TRACKER_SYNC_ERROR_UNAUTHORIZED";
2119
+ case TrackerSyncError.TRACKER_SYNC_ERROR_RATE_LIMITED:
2120
+ return "TRACKER_SYNC_ERROR_RATE_LIMITED";
2121
+ case TrackerSyncError.TRACKER_SYNC_ERROR_UNAVAILABLE:
2122
+ return "TRACKER_SYNC_ERROR_UNAVAILABLE";
2123
+ case TrackerSyncError.TRACKER_SYNC_ERROR_REJECTED:
2124
+ return "TRACKER_SYNC_ERROR_REJECTED";
2125
+ case TrackerSyncError.TRACKER_SYNC_ERROR_UNREADABLE:
2126
+ return "TRACKER_SYNC_ERROR_UNREADABLE";
2127
+ case TrackerSyncError.TRACKER_SYNC_ERROR_WORKSPACE_CHANGED:
2128
+ return "TRACKER_SYNC_ERROR_WORKSPACE_CHANGED";
2129
+ case TrackerSyncError.TRACKER_SYNC_ERROR_INTERNAL:
2130
+ return "TRACKER_SYNC_ERROR_INTERNAL";
2131
+ case TrackerSyncError.UNRECOGNIZED:
2132
+ default:
2133
+ return "UNRECOGNIZED";
2134
+ }
2135
+ }
2136
+
1827
2137
  export interface ListSessionsRequest {
1828
2138
  organizationId: string;
1829
2139
  projectId: string;
@@ -3822,6 +4132,155 @@ export interface RelayHeartbeatFilter {
3822
4132
  lastSeenBefore: Date | undefined;
3823
4133
  }
3824
4134
 
4135
+ export interface ListIssueCostsRequest {
4136
+ organizationId: string;
4137
+ /**
4138
+ * The tracker whose issues receive the cost; with organization_id, the connected tracker the collection belongs to.
4139
+ * UNSPECIFIED is a validation error.
4140
+ */
4141
+ tracker: Tracker;
4142
+ /** What each row is; UNSPECIFIED is a validation error. */
4143
+ groupBy: IssueCostGroupBy;
4144
+ /**
4145
+ * How the cost is split. Unspecified is PER_PR; nothing is stored per organization, so a client that offers a choice
4146
+ * sends it on every call. A number the backend does not know is a validation error.
4147
+ */
4148
+ attributionMethod: IssueCostAttributionMethod;
4149
+ filter:
4150
+ | IssueCostFilter
4151
+ | undefined;
4152
+ /** Unspecified is ISSUE_COST_SORT_COST_DESC. */
4153
+ sort: IssueCostSort;
4154
+ /** 1-indexed page; 1 when 0. */
4155
+ page: number;
4156
+ /** 100 when 0, at most 1000. */
4157
+ perPage: number;
4158
+ }
4159
+
4160
+ /**
4161
+ * IssueCostFilter narrows ListIssueCosts. Fields AND; a repeated field matches any of its values; an unset or empty
4162
+ * field does not filter. The window picks the sessions whose cost is split, by each session's start; parent_ids and
4163
+ * iteration_ids pick the issues whose shares make the groups, by the issue's parent and iteration as last synced,
4164
+ * after the split, and change only filtered_cost_usd_nanos of the totals. More than 500 ids in either list is a
4165
+ * validation error.
4166
+ */
4167
+ export interface IssueCostFilter {
4168
+ /**
4169
+ * [start_time, end_time); an unset bound leaves that side open. end_time at or before start_time is a validation
4170
+ * error.
4171
+ */
4172
+ startTime: Date | undefined;
4173
+ endTime:
4174
+ | Date
4175
+ | undefined;
4176
+ /** The tracker's parent ids (Linear project ids); "" matches an issue with no parent. */
4177
+ parentIds: string[];
4178
+ /** The tracker's iteration ids (Linear cycle ids); "" matches an issue in no iteration. */
4179
+ iterationIds: string[];
4180
+ }
4181
+
4182
+ export interface ListIssueCostsResponse {
4183
+ status:
4184
+ | ResponseStatus
4185
+ | undefined;
4186
+ /** Whether the issues are served: groups are empty and pagination and totals absent unless it is SYNCED or STALE. */
4187
+ syncState: TrackerSyncState;
4188
+ /**
4189
+ * When a sync of the connected workspace last completed. Not a snapshot boundary: the issues served are the stored
4190
+ * ones, which can include pages a later sync wrote before failing, and deleted issues, detached pull requests and
4191
+ * teams made private leave only at the hourly full pass. Absent unless served.
4192
+ */
4193
+ lastSyncedAt:
4194
+ | Date
4195
+ | undefined;
4196
+ /**
4197
+ * Why the latest sync attempt of the connected workspace failed; unspecified when it succeeded or none was made. Set
4198
+ * while PENDING when the first sync fails, which then does not complete until the cause is fixed.
4199
+ */
4200
+ lastSyncError: TrackerSyncError;
4201
+ groups: IssueCostGroup[];
4202
+ pagination: IssueCostPagination | undefined;
4203
+ totals:
4204
+ | IssueCostTotals
4205
+ | undefined;
4206
+ /**
4207
+ * The method the split used: the request's, or PER_PR when the request left it unspecified. Never unspecified on
4208
+ * success, served or not.
4209
+ */
4210
+ attributionMethod: IssueCostAttributionMethod;
4211
+ }
4212
+
4213
+ /**
4214
+ * IssueCostGroup is one issue, parent or iteration with the cost its issues received. A group appears once a session
4215
+ * in the window gave it a share, $0 shares included.
4216
+ */
4217
+ export interface IssueCostGroup {
4218
+ /** The issue's, parent's or iteration's id; "" is the group of issues with no parent or in no iteration. */
4219
+ id: string;
4220
+ /**
4221
+ * The issue's title or the parent's or iteration's name, display only: of a parent or iteration, the name its most
4222
+ * recently synced issue carries. "" for the "none" group.
4223
+ */
4224
+ name: string;
4225
+ /** Attributed recorded cost in nanodollars. */
4226
+ costUsdNanos: string;
4227
+ /** The distinct sessions that gave the group a share. */
4228
+ sessionCount: number;
4229
+ /**
4230
+ * The distinct pull requests a share reached the group through: under PER_TICKET, every pull request of the session
4231
+ * the tracker attaches to the issue.
4232
+ */
4233
+ pullRequestCount: number;
4234
+ /** On ISSUE, the issue as the last sync read it; absent otherwise. */
4235
+ issue: TrackerIssue | undefined;
4236
+ }
4237
+
4238
+ /** TrackerIssue is an issue as the tracker reported it, display only apart from its ids. */
4239
+ export interface TrackerIssue {
4240
+ /** The tracker's key (MIR-298), which changes when the issue moves team; IssueCostGroup.id is stable. */
4241
+ key: string;
4242
+ /** The workflow state's name (In Review). */
4243
+ state: string;
4244
+ url: string;
4245
+ /** "" when it has none. */
4246
+ parentId: string;
4247
+ parentName: string;
4248
+ /** "" when it is in none. */
4249
+ iterationId: string;
4250
+ iterationName: string;
4251
+ /** Absent unless the issue is archived. */
4252
+ archivedAt: Date | undefined;
4253
+ }
4254
+
4255
+ export interface IssueCostPagination {
4256
+ page: number;
4257
+ perPage: number;
4258
+ /** Every group the filter keeps, across pages, computed on every call. */
4259
+ totalCount: number;
4260
+ totalPages: number;
4261
+ }
4262
+
4263
+ /**
4264
+ * IssueCostTotals is the cost of the sessions that started in the window, over the whole organization, in nanodollars.
4265
+ * recorded is exactly attributed + no_pull_request + unlinked_pull_request, whatever parent_ids and iteration_ids say;
4266
+ * filtered is the part of attributed the groups the filter keeps received.
4267
+ */
4268
+ export interface IssueCostTotals {
4269
+ /** The sessions' recorded cost. */
4270
+ recordedCostUsdNanos: string;
4271
+ /** The shares issues received. */
4272
+ attributedCostUsdNanos: string;
4273
+ /** Sessions that link to no pull request. */
4274
+ noPullRequestCostUsdNanos: string;
4275
+ /**
4276
+ * Shares of pull requests the tracker attaches to no served issue (a private team's issues are never served): under
4277
+ * PER_PR each such pull request's share, under PER_TICKET each such pull request's slot.
4278
+ */
4279
+ unlinkedPullRequestCostUsdNanos: string;
4280
+ /** Every group the filter keeps, across pages: attributed when parent_ids and iteration_ids are unset. */
4281
+ filteredCostUsdNanos: string;
4282
+ }
4283
+
3825
4284
  function createBaseListSessionsRequest(): ListSessionsRequest {
3826
4285
  return { organizationId: "", projectId: "", filter: undefined, sort: 0, page: 0, perPage: 0 };
3827
4286
  }
@@ -28118,74 +28577,1288 @@ export const RelayHeartbeatFilter: MessageFns<RelayHeartbeatFilter> = {
28118
28577
  },
28119
28578
  };
28120
28579
 
28121
- /**
28122
- * AIGatewayService is the frontend-facing proxy over telemetry.api.v1.AIService.
28123
- * It stamps the authorized organization/project and forwards telemetry-api-shaped messages.
28124
- */
28125
- export interface AIGatewayService {
28126
- /**
28127
- * One numbered page of the conversation catalog (sessions folded to
28128
- * one rollup by source_system + session_id), ranked by sort. Weakly consistent
28129
- * (latest-state, no frozen snapshot).
28130
- */
28131
- ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse>;
28132
- /**
28133
- * Keeps the first conversation page live: the whole top-N page re-derived each tick
28134
- * as one SessionsSnapshot, replacing client state wholesale (not a delta feed).
28135
- */
28136
- StreamSessions(request: StreamSessionsRequest, metadata?: Metadata): Observable<SessionsSnapshot>;
28137
- /** Live sidebar rollup (session_id + source_system): re-derived and re-emitted whole each tick. */
28138
- StreamSessionSummary(request: GetSessionSummaryRequest, metadata?: Metadata): Observable<AISessionSummary>;
28139
- ListSessionEvents(request: ListSessionEventsRequest, metadata?: Metadata): Promise<ListSessionEventsResponse>;
28140
- StreamSessionEvents(request: StreamSessionEventsRequest, metadata?: Metadata): Observable<AISessionEventEnvelope>;
28141
- /**
28142
- * Live, backend-computed, per-event token series for one session (replacement snapshots):
28143
- * one content-free point per logical event + whole-session totals; point count is capped.
28144
- */
28145
- StreamSessionTokenTimeline(
28146
- request: SessionTokenTimelineRequest,
28147
- metadata?: Metadata,
28148
- ): Observable<SessionTokenTimeline>;
28149
- /** Live "Files changed" card: per file the latest-observed git change-type + exact --numstat churn. */
28150
- StreamSessionFileChanges(request: SessionFileChangesRequest, metadata?: Metadata): Observable<SessionFileChanges>;
28151
- /** Filtered, keyset-paginated drill-down feed of git/GitHub actions (newest first). */
28152
- ListGitActivities(request: ListGitActivitiesRequest, metadata?: Metadata): Promise<ListGitActivitiesResponse>;
28153
- /**
28154
- * Live stream of the filtered git/GitHub feed (UPSERT per activity keyed by
28155
- * activity_id, a nonterminal GitActivitiesSnapshotCompleted, then open until cancel).
28156
- */
28157
- StreamGitActivities(request: StreamGitActivitiesRequest, metadata?: Metadata): Observable<GitActivityFrame>;
28158
- /**
28159
- * Live stream of the git dashboard's overview: a full windowed, dimension-sliced rollup of the filtered
28160
- * git activities (whole-window totals ride each frame), re-derived each tick.
28161
- */
28162
- StreamGitActivitySummary(request: GitActivitySummaryRequest, metadata?: Metadata): Observable<GitActivitySummary>;
28163
- /**
28164
- * Live token burn calendar: a windowed, dimension-sliced token/cost trend series
28165
- * plus whole-window totals.
28166
- */
28167
- StreamTokenActivitySummary(
28168
- request: TokenActivitySummaryRequest,
28169
- metadata?: Metadata,
28170
- ): Observable<TokenActivitySummary>;
28171
- /**
28172
- * Live "burn rate now" gauge: the trailing-60s cost/hr + tokens/min (total plus a per-dimension
28173
- * breakdown) and a fixed 60-minute one-minute rolling sparkline of that rate. Fixed horizon, fast
28174
- * refresh; first frame is a full snapshot.
28175
- */
28176
- StreamBurnRate(request: BurnRateRequest, metadata?: Metadata): Observable<BurnRate>;
28177
- /**
28178
- * Live token-burn calendar over an inclusive UTC [start_date, end_date] range: one complete row per
28179
- * covered day off the precomputed daily rollup. Covered empty days are zero; uncomputed history is
28180
- * omitted; today is provisional.
28181
- */
28182
- StreamDailyActivity(request: DailyActivityRequest, metadata?: Metadata): Observable<DailyActivity>;
28183
- /**
28184
- * Live current-UTC-month spend forecast: month-to-date cost and the projected month-end total (a band from
28185
- * replaying recent weeks), for the project, per model, provider and source system, and per principal, off the
28186
- * same daily rollup as StreamDailyActivity; the filter narrows it by funding mode, source system and principal.
28187
- * Mirrors telemetry.api.v1.
28188
- */
28580
+ function createBaseListIssueCostsRequest(): ListIssueCostsRequest {
28581
+ return {
28582
+ organizationId: "",
28583
+ tracker: 0,
28584
+ groupBy: 0,
28585
+ attributionMethod: 0,
28586
+ filter: undefined,
28587
+ sort: 0,
28588
+ page: 0,
28589
+ perPage: 0,
28590
+ };
28591
+ }
28592
+
28593
+ export const ListIssueCostsRequest: MessageFns<ListIssueCostsRequest> = {
28594
+ encode(message: ListIssueCostsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
28595
+ if (message.organizationId !== "") {
28596
+ writer.uint32(10).string(message.organizationId);
28597
+ }
28598
+ if (message.tracker !== 0) {
28599
+ writer.uint32(16).int32(message.tracker);
28600
+ }
28601
+ if (message.groupBy !== 0) {
28602
+ writer.uint32(24).int32(message.groupBy);
28603
+ }
28604
+ if (message.attributionMethod !== 0) {
28605
+ writer.uint32(64).int32(message.attributionMethod);
28606
+ }
28607
+ if (message.filter !== undefined) {
28608
+ IssueCostFilter.encode(message.filter, writer.uint32(34).fork()).join();
28609
+ }
28610
+ if (message.sort !== 0) {
28611
+ writer.uint32(40).int32(message.sort);
28612
+ }
28613
+ if (message.page !== 0) {
28614
+ writer.uint32(48).int32(message.page);
28615
+ }
28616
+ if (message.perPage !== 0) {
28617
+ writer.uint32(56).int32(message.perPage);
28618
+ }
28619
+ return writer;
28620
+ },
28621
+
28622
+ decode(input: BinaryReader | Uint8Array, length?: number): ListIssueCostsRequest {
28623
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
28624
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
28625
+ if (previousRecursionDepth >= 100) {
28626
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
28627
+ }
28628
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
28629
+ try {
28630
+ const end = length === undefined ? reader.len : reader.pos + length;
28631
+ const message = createBaseListIssueCostsRequest();
28632
+ while (reader.pos < end) {
28633
+ const tag = reader.uint32();
28634
+ switch (tag >>> 3) {
28635
+ case 1: {
28636
+ if (tag !== 10) {
28637
+ break;
28638
+ }
28639
+
28640
+ message.organizationId = reader.string();
28641
+ continue;
28642
+ }
28643
+ case 2: {
28644
+ if (tag !== 16) {
28645
+ break;
28646
+ }
28647
+
28648
+ message.tracker = reader.int32() as any;
28649
+ continue;
28650
+ }
28651
+ case 3: {
28652
+ if (tag !== 24) {
28653
+ break;
28654
+ }
28655
+
28656
+ message.groupBy = reader.int32() as any;
28657
+ continue;
28658
+ }
28659
+ case 8: {
28660
+ if (tag !== 64) {
28661
+ break;
28662
+ }
28663
+
28664
+ message.attributionMethod = reader.int32() as any;
28665
+ continue;
28666
+ }
28667
+ case 4: {
28668
+ if (tag !== 34) {
28669
+ break;
28670
+ }
28671
+
28672
+ message.filter = IssueCostFilter.decode(reader, reader.uint32());
28673
+ continue;
28674
+ }
28675
+ case 5: {
28676
+ if (tag !== 40) {
28677
+ break;
28678
+ }
28679
+
28680
+ message.sort = reader.int32() as any;
28681
+ continue;
28682
+ }
28683
+ case 6: {
28684
+ if (tag !== 48) {
28685
+ break;
28686
+ }
28687
+
28688
+ message.page = reader.int32();
28689
+ continue;
28690
+ }
28691
+ case 7: {
28692
+ if (tag !== 56) {
28693
+ break;
28694
+ }
28695
+
28696
+ message.perPage = reader.int32();
28697
+ continue;
28698
+ }
28699
+ }
28700
+ if ((tag & 7) === 4 || tag === 0) {
28701
+ break;
28702
+ }
28703
+ reader.skip(tag & 7);
28704
+ }
28705
+ return message;
28706
+ } finally {
28707
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
28708
+ }
28709
+ },
28710
+
28711
+ fromJSON(object: any): ListIssueCostsRequest {
28712
+ return {
28713
+ organizationId: isSet(object.organizationId)
28714
+ ? globalThis.String(object.organizationId)
28715
+ : isSet(object.organization_id)
28716
+ ? globalThis.String(object.organization_id)
28717
+ : "",
28718
+ tracker: isSet(object.tracker) ? trackerFromJSON(object.tracker) : 0,
28719
+ groupBy: isSet(object.groupBy)
28720
+ ? issueCostGroupByFromJSON(object.groupBy)
28721
+ : isSet(object.group_by)
28722
+ ? issueCostGroupByFromJSON(object.group_by)
28723
+ : 0,
28724
+ attributionMethod: isSet(object.attributionMethod)
28725
+ ? issueCostAttributionMethodFromJSON(object.attributionMethod)
28726
+ : isSet(object.attribution_method)
28727
+ ? issueCostAttributionMethodFromJSON(object.attribution_method)
28728
+ : 0,
28729
+ filter: isSet(object.filter) ? IssueCostFilter.fromJSON(object.filter) : undefined,
28730
+ sort: isSet(object.sort) ? issueCostSortFromJSON(object.sort) : 0,
28731
+ page: isSet(object.page) ? globalThis.Number(object.page) : 0,
28732
+ perPage: isSet(object.perPage)
28733
+ ? globalThis.Number(object.perPage)
28734
+ : isSet(object.per_page)
28735
+ ? globalThis.Number(object.per_page)
28736
+ : 0,
28737
+ };
28738
+ },
28739
+
28740
+ toJSON(message: ListIssueCostsRequest): unknown {
28741
+ const obj: any = {};
28742
+ if (message.organizationId !== "") {
28743
+ obj.organizationId = message.organizationId;
28744
+ }
28745
+ if (message.tracker !== 0) {
28746
+ obj.tracker = trackerToJSON(message.tracker);
28747
+ }
28748
+ if (message.groupBy !== 0) {
28749
+ obj.groupBy = issueCostGroupByToJSON(message.groupBy);
28750
+ }
28751
+ if (message.attributionMethod !== 0) {
28752
+ obj.attributionMethod = issueCostAttributionMethodToJSON(message.attributionMethod);
28753
+ }
28754
+ if (message.filter !== undefined) {
28755
+ obj.filter = IssueCostFilter.toJSON(message.filter);
28756
+ }
28757
+ if (message.sort !== 0) {
28758
+ obj.sort = issueCostSortToJSON(message.sort);
28759
+ }
28760
+ if (message.page !== 0) {
28761
+ obj.page = Math.round(message.page);
28762
+ }
28763
+ if (message.perPage !== 0) {
28764
+ obj.perPage = Math.round(message.perPage);
28765
+ }
28766
+ return obj;
28767
+ },
28768
+
28769
+ create<I extends Exact<DeepPartial<ListIssueCostsRequest>, I>>(base?: I): ListIssueCostsRequest {
28770
+ return ListIssueCostsRequest.fromPartial(base ?? ({} as any));
28771
+ },
28772
+ fromPartial<I extends Exact<DeepPartial<ListIssueCostsRequest>, I>>(object: I): ListIssueCostsRequest {
28773
+ const message = createBaseListIssueCostsRequest();
28774
+ message.organizationId = object.organizationId ?? "";
28775
+ message.tracker = object.tracker ?? 0;
28776
+ message.groupBy = object.groupBy ?? 0;
28777
+ message.attributionMethod = object.attributionMethod ?? 0;
28778
+ message.filter = (object.filter !== undefined && object.filter !== null)
28779
+ ? IssueCostFilter.fromPartial(object.filter)
28780
+ : undefined;
28781
+ message.sort = object.sort ?? 0;
28782
+ message.page = object.page ?? 0;
28783
+ message.perPage = object.perPage ?? 0;
28784
+ return message;
28785
+ },
28786
+ };
28787
+
28788
+ function createBaseIssueCostFilter(): IssueCostFilter {
28789
+ return { startTime: undefined, endTime: undefined, parentIds: [], iterationIds: [] };
28790
+ }
28791
+
28792
+ export const IssueCostFilter: MessageFns<IssueCostFilter> = {
28793
+ encode(message: IssueCostFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
28794
+ if (message.startTime !== undefined) {
28795
+ Timestamp.encode(toTimestamp(message.startTime), writer.uint32(10).fork()).join();
28796
+ }
28797
+ if (message.endTime !== undefined) {
28798
+ Timestamp.encode(toTimestamp(message.endTime), writer.uint32(18).fork()).join();
28799
+ }
28800
+ for (const v of message.parentIds) {
28801
+ writer.uint32(26).string(v!);
28802
+ }
28803
+ for (const v of message.iterationIds) {
28804
+ writer.uint32(34).string(v!);
28805
+ }
28806
+ return writer;
28807
+ },
28808
+
28809
+ decode(input: BinaryReader | Uint8Array, length?: number): IssueCostFilter {
28810
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
28811
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
28812
+ if (previousRecursionDepth >= 100) {
28813
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
28814
+ }
28815
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
28816
+ try {
28817
+ const end = length === undefined ? reader.len : reader.pos + length;
28818
+ const message = createBaseIssueCostFilter();
28819
+ while (reader.pos < end) {
28820
+ const tag = reader.uint32();
28821
+ switch (tag >>> 3) {
28822
+ case 1: {
28823
+ if (tag !== 10) {
28824
+ break;
28825
+ }
28826
+
28827
+ message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
28828
+ continue;
28829
+ }
28830
+ case 2: {
28831
+ if (tag !== 18) {
28832
+ break;
28833
+ }
28834
+
28835
+ message.endTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
28836
+ continue;
28837
+ }
28838
+ case 3: {
28839
+ if (tag !== 26) {
28840
+ break;
28841
+ }
28842
+
28843
+ message.parentIds.push(reader.string());
28844
+ continue;
28845
+ }
28846
+ case 4: {
28847
+ if (tag !== 34) {
28848
+ break;
28849
+ }
28850
+
28851
+ message.iterationIds.push(reader.string());
28852
+ continue;
28853
+ }
28854
+ }
28855
+ if ((tag & 7) === 4 || tag === 0) {
28856
+ break;
28857
+ }
28858
+ reader.skip(tag & 7);
28859
+ }
28860
+ return message;
28861
+ } finally {
28862
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
28863
+ }
28864
+ },
28865
+
28866
+ fromJSON(object: any): IssueCostFilter {
28867
+ return {
28868
+ startTime: isSet(object.startTime)
28869
+ ? fromJsonTimestamp(object.startTime)
28870
+ : isSet(object.start_time)
28871
+ ? fromJsonTimestamp(object.start_time)
28872
+ : undefined,
28873
+ endTime: isSet(object.endTime)
28874
+ ? fromJsonTimestamp(object.endTime)
28875
+ : isSet(object.end_time)
28876
+ ? fromJsonTimestamp(object.end_time)
28877
+ : undefined,
28878
+ parentIds: globalThis.Array.isArray(object?.parentIds)
28879
+ ? object.parentIds.map((e: any) => globalThis.String(e))
28880
+ : globalThis.Array.isArray(object?.parent_ids)
28881
+ ? object.parent_ids.map((e: any) => globalThis.String(e))
28882
+ : [],
28883
+ iterationIds: globalThis.Array.isArray(object?.iterationIds)
28884
+ ? object.iterationIds.map((e: any) => globalThis.String(e))
28885
+ : globalThis.Array.isArray(object?.iteration_ids)
28886
+ ? object.iteration_ids.map((e: any) => globalThis.String(e))
28887
+ : [],
28888
+ };
28889
+ },
28890
+
28891
+ toJSON(message: IssueCostFilter): unknown {
28892
+ const obj: any = {};
28893
+ if (message.startTime !== undefined) {
28894
+ obj.startTime = message.startTime.toISOString();
28895
+ }
28896
+ if (message.endTime !== undefined) {
28897
+ obj.endTime = message.endTime.toISOString();
28898
+ }
28899
+ if (message.parentIds?.length) {
28900
+ obj.parentIds = message.parentIds;
28901
+ }
28902
+ if (message.iterationIds?.length) {
28903
+ obj.iterationIds = message.iterationIds;
28904
+ }
28905
+ return obj;
28906
+ },
28907
+
28908
+ create<I extends Exact<DeepPartial<IssueCostFilter>, I>>(base?: I): IssueCostFilter {
28909
+ return IssueCostFilter.fromPartial(base ?? ({} as any));
28910
+ },
28911
+ fromPartial<I extends Exact<DeepPartial<IssueCostFilter>, I>>(object: I): IssueCostFilter {
28912
+ const message = createBaseIssueCostFilter();
28913
+ message.startTime = object.startTime ?? undefined;
28914
+ message.endTime = object.endTime ?? undefined;
28915
+ message.parentIds = object.parentIds?.map((e) => e) || [];
28916
+ message.iterationIds = object.iterationIds?.map((e) => e) || [];
28917
+ return message;
28918
+ },
28919
+ };
28920
+
28921
+ function createBaseListIssueCostsResponse(): ListIssueCostsResponse {
28922
+ return {
28923
+ status: undefined,
28924
+ syncState: 0,
28925
+ lastSyncedAt: undefined,
28926
+ lastSyncError: 0,
28927
+ groups: [],
28928
+ pagination: undefined,
28929
+ totals: undefined,
28930
+ attributionMethod: 0,
28931
+ };
28932
+ }
28933
+
28934
+ export const ListIssueCostsResponse: MessageFns<ListIssueCostsResponse> = {
28935
+ encode(message: ListIssueCostsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
28936
+ if (message.status !== undefined) {
28937
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
28938
+ }
28939
+ if (message.syncState !== 0) {
28940
+ writer.uint32(16).int32(message.syncState);
28941
+ }
28942
+ if (message.lastSyncedAt !== undefined) {
28943
+ Timestamp.encode(toTimestamp(message.lastSyncedAt), writer.uint32(26).fork()).join();
28944
+ }
28945
+ if (message.lastSyncError !== 0) {
28946
+ writer.uint32(32).int32(message.lastSyncError);
28947
+ }
28948
+ for (const v of message.groups) {
28949
+ IssueCostGroup.encode(v!, writer.uint32(42).fork()).join();
28950
+ }
28951
+ if (message.pagination !== undefined) {
28952
+ IssueCostPagination.encode(message.pagination, writer.uint32(50).fork()).join();
28953
+ }
28954
+ if (message.totals !== undefined) {
28955
+ IssueCostTotals.encode(message.totals, writer.uint32(58).fork()).join();
28956
+ }
28957
+ if (message.attributionMethod !== 0) {
28958
+ writer.uint32(64).int32(message.attributionMethod);
28959
+ }
28960
+ return writer;
28961
+ },
28962
+
28963
+ decode(input: BinaryReader | Uint8Array, length?: number): ListIssueCostsResponse {
28964
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
28965
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
28966
+ if (previousRecursionDepth >= 100) {
28967
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
28968
+ }
28969
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
28970
+ try {
28971
+ const end = length === undefined ? reader.len : reader.pos + length;
28972
+ const message = createBaseListIssueCostsResponse();
28973
+ while (reader.pos < end) {
28974
+ const tag = reader.uint32();
28975
+ switch (tag >>> 3) {
28976
+ case 1: {
28977
+ if (tag !== 10) {
28978
+ break;
28979
+ }
28980
+
28981
+ message.status = ResponseStatus.decode(reader, reader.uint32());
28982
+ continue;
28983
+ }
28984
+ case 2: {
28985
+ if (tag !== 16) {
28986
+ break;
28987
+ }
28988
+
28989
+ message.syncState = reader.int32() as any;
28990
+ continue;
28991
+ }
28992
+ case 3: {
28993
+ if (tag !== 26) {
28994
+ break;
28995
+ }
28996
+
28997
+ message.lastSyncedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
28998
+ continue;
28999
+ }
29000
+ case 4: {
29001
+ if (tag !== 32) {
29002
+ break;
29003
+ }
29004
+
29005
+ message.lastSyncError = reader.int32() as any;
29006
+ continue;
29007
+ }
29008
+ case 5: {
29009
+ if (tag !== 42) {
29010
+ break;
29011
+ }
29012
+
29013
+ message.groups.push(IssueCostGroup.decode(reader, reader.uint32()));
29014
+ continue;
29015
+ }
29016
+ case 6: {
29017
+ if (tag !== 50) {
29018
+ break;
29019
+ }
29020
+
29021
+ message.pagination = IssueCostPagination.decode(reader, reader.uint32());
29022
+ continue;
29023
+ }
29024
+ case 7: {
29025
+ if (tag !== 58) {
29026
+ break;
29027
+ }
29028
+
29029
+ message.totals = IssueCostTotals.decode(reader, reader.uint32());
29030
+ continue;
29031
+ }
29032
+ case 8: {
29033
+ if (tag !== 64) {
29034
+ break;
29035
+ }
29036
+
29037
+ message.attributionMethod = reader.int32() as any;
29038
+ continue;
29039
+ }
29040
+ }
29041
+ if ((tag & 7) === 4 || tag === 0) {
29042
+ break;
29043
+ }
29044
+ reader.skip(tag & 7);
29045
+ }
29046
+ return message;
29047
+ } finally {
29048
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
29049
+ }
29050
+ },
29051
+
29052
+ fromJSON(object: any): ListIssueCostsResponse {
29053
+ return {
29054
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
29055
+ syncState: isSet(object.syncState)
29056
+ ? trackerSyncStateFromJSON(object.syncState)
29057
+ : isSet(object.sync_state)
29058
+ ? trackerSyncStateFromJSON(object.sync_state)
29059
+ : 0,
29060
+ lastSyncedAt: isSet(object.lastSyncedAt)
29061
+ ? fromJsonTimestamp(object.lastSyncedAt)
29062
+ : isSet(object.last_synced_at)
29063
+ ? fromJsonTimestamp(object.last_synced_at)
29064
+ : undefined,
29065
+ lastSyncError: isSet(object.lastSyncError)
29066
+ ? trackerSyncErrorFromJSON(object.lastSyncError)
29067
+ : isSet(object.last_sync_error)
29068
+ ? trackerSyncErrorFromJSON(object.last_sync_error)
29069
+ : 0,
29070
+ groups: globalThis.Array.isArray(object?.groups) ? object.groups.map((e: any) => IssueCostGroup.fromJSON(e)) : [],
29071
+ pagination: isSet(object.pagination) ? IssueCostPagination.fromJSON(object.pagination) : undefined,
29072
+ totals: isSet(object.totals) ? IssueCostTotals.fromJSON(object.totals) : undefined,
29073
+ attributionMethod: isSet(object.attributionMethod)
29074
+ ? issueCostAttributionMethodFromJSON(object.attributionMethod)
29075
+ : isSet(object.attribution_method)
29076
+ ? issueCostAttributionMethodFromJSON(object.attribution_method)
29077
+ : 0,
29078
+ };
29079
+ },
29080
+
29081
+ toJSON(message: ListIssueCostsResponse): unknown {
29082
+ const obj: any = {};
29083
+ if (message.status !== undefined) {
29084
+ obj.status = ResponseStatus.toJSON(message.status);
29085
+ }
29086
+ if (message.syncState !== 0) {
29087
+ obj.syncState = trackerSyncStateToJSON(message.syncState);
29088
+ }
29089
+ if (message.lastSyncedAt !== undefined) {
29090
+ obj.lastSyncedAt = message.lastSyncedAt.toISOString();
29091
+ }
29092
+ if (message.lastSyncError !== 0) {
29093
+ obj.lastSyncError = trackerSyncErrorToJSON(message.lastSyncError);
29094
+ }
29095
+ if (message.groups?.length) {
29096
+ obj.groups = message.groups.map((e) => IssueCostGroup.toJSON(e));
29097
+ }
29098
+ if (message.pagination !== undefined) {
29099
+ obj.pagination = IssueCostPagination.toJSON(message.pagination);
29100
+ }
29101
+ if (message.totals !== undefined) {
29102
+ obj.totals = IssueCostTotals.toJSON(message.totals);
29103
+ }
29104
+ if (message.attributionMethod !== 0) {
29105
+ obj.attributionMethod = issueCostAttributionMethodToJSON(message.attributionMethod);
29106
+ }
29107
+ return obj;
29108
+ },
29109
+
29110
+ create<I extends Exact<DeepPartial<ListIssueCostsResponse>, I>>(base?: I): ListIssueCostsResponse {
29111
+ return ListIssueCostsResponse.fromPartial(base ?? ({} as any));
29112
+ },
29113
+ fromPartial<I extends Exact<DeepPartial<ListIssueCostsResponse>, I>>(object: I): ListIssueCostsResponse {
29114
+ const message = createBaseListIssueCostsResponse();
29115
+ message.status = (object.status !== undefined && object.status !== null)
29116
+ ? ResponseStatus.fromPartial(object.status)
29117
+ : undefined;
29118
+ message.syncState = object.syncState ?? 0;
29119
+ message.lastSyncedAt = object.lastSyncedAt ?? undefined;
29120
+ message.lastSyncError = object.lastSyncError ?? 0;
29121
+ message.groups = object.groups?.map((e) => IssueCostGroup.fromPartial(e)) || [];
29122
+ message.pagination = (object.pagination !== undefined && object.pagination !== null)
29123
+ ? IssueCostPagination.fromPartial(object.pagination)
29124
+ : undefined;
29125
+ message.totals = (object.totals !== undefined && object.totals !== null)
29126
+ ? IssueCostTotals.fromPartial(object.totals)
29127
+ : undefined;
29128
+ message.attributionMethod = object.attributionMethod ?? 0;
29129
+ return message;
29130
+ },
29131
+ };
29132
+
29133
+ function createBaseIssueCostGroup(): IssueCostGroup {
29134
+ return { id: "", name: "", costUsdNanos: "0", sessionCount: 0, pullRequestCount: 0, issue: undefined };
29135
+ }
29136
+
29137
+ export const IssueCostGroup: MessageFns<IssueCostGroup> = {
29138
+ encode(message: IssueCostGroup, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
29139
+ if (message.id !== "") {
29140
+ writer.uint32(10).string(message.id);
29141
+ }
29142
+ if (message.name !== "") {
29143
+ writer.uint32(18).string(message.name);
29144
+ }
29145
+ if (message.costUsdNanos !== "0") {
29146
+ writer.uint32(24).int64(message.costUsdNanos);
29147
+ }
29148
+ if (message.sessionCount !== 0) {
29149
+ writer.uint32(32).int64(message.sessionCount);
29150
+ }
29151
+ if (message.pullRequestCount !== 0) {
29152
+ writer.uint32(40).int64(message.pullRequestCount);
29153
+ }
29154
+ if (message.issue !== undefined) {
29155
+ TrackerIssue.encode(message.issue, writer.uint32(50).fork()).join();
29156
+ }
29157
+ return writer;
29158
+ },
29159
+
29160
+ decode(input: BinaryReader | Uint8Array, length?: number): IssueCostGroup {
29161
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
29162
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
29163
+ if (previousRecursionDepth >= 100) {
29164
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
29165
+ }
29166
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
29167
+ try {
29168
+ const end = length === undefined ? reader.len : reader.pos + length;
29169
+ const message = createBaseIssueCostGroup();
29170
+ while (reader.pos < end) {
29171
+ const tag = reader.uint32();
29172
+ switch (tag >>> 3) {
29173
+ case 1: {
29174
+ if (tag !== 10) {
29175
+ break;
29176
+ }
29177
+
29178
+ message.id = reader.string();
29179
+ continue;
29180
+ }
29181
+ case 2: {
29182
+ if (tag !== 18) {
29183
+ break;
29184
+ }
29185
+
29186
+ message.name = reader.string();
29187
+ continue;
29188
+ }
29189
+ case 3: {
29190
+ if (tag !== 24) {
29191
+ break;
29192
+ }
29193
+
29194
+ message.costUsdNanos = reader.int64().toString();
29195
+ continue;
29196
+ }
29197
+ case 4: {
29198
+ if (tag !== 32) {
29199
+ break;
29200
+ }
29201
+
29202
+ message.sessionCount = longToNumber(reader.int64());
29203
+ continue;
29204
+ }
29205
+ case 5: {
29206
+ if (tag !== 40) {
29207
+ break;
29208
+ }
29209
+
29210
+ message.pullRequestCount = longToNumber(reader.int64());
29211
+ continue;
29212
+ }
29213
+ case 6: {
29214
+ if (tag !== 50) {
29215
+ break;
29216
+ }
29217
+
29218
+ message.issue = TrackerIssue.decode(reader, reader.uint32());
29219
+ continue;
29220
+ }
29221
+ }
29222
+ if ((tag & 7) === 4 || tag === 0) {
29223
+ break;
29224
+ }
29225
+ reader.skip(tag & 7);
29226
+ }
29227
+ return message;
29228
+ } finally {
29229
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
29230
+ }
29231
+ },
29232
+
29233
+ fromJSON(object: any): IssueCostGroup {
29234
+ return {
29235
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
29236
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
29237
+ costUsdNanos: isSet(object.costUsdNanos)
29238
+ ? globalThis.String(object.costUsdNanos)
29239
+ : isSet(object.cost_usd_nanos)
29240
+ ? globalThis.String(object.cost_usd_nanos)
29241
+ : "0",
29242
+ sessionCount: isSet(object.sessionCount)
29243
+ ? globalThis.Number(object.sessionCount)
29244
+ : isSet(object.session_count)
29245
+ ? globalThis.Number(object.session_count)
29246
+ : 0,
29247
+ pullRequestCount: isSet(object.pullRequestCount)
29248
+ ? globalThis.Number(object.pullRequestCount)
29249
+ : isSet(object.pull_request_count)
29250
+ ? globalThis.Number(object.pull_request_count)
29251
+ : 0,
29252
+ issue: isSet(object.issue) ? TrackerIssue.fromJSON(object.issue) : undefined,
29253
+ };
29254
+ },
29255
+
29256
+ toJSON(message: IssueCostGroup): unknown {
29257
+ const obj: any = {};
29258
+ if (message.id !== "") {
29259
+ obj.id = message.id;
29260
+ }
29261
+ if (message.name !== "") {
29262
+ obj.name = message.name;
29263
+ }
29264
+ if (message.costUsdNanos !== "0") {
29265
+ obj.costUsdNanos = globalThis.String(message.costUsdNanos);
29266
+ }
29267
+ if (message.sessionCount !== 0) {
29268
+ obj.sessionCount = Math.round(message.sessionCount);
29269
+ }
29270
+ if (message.pullRequestCount !== 0) {
29271
+ obj.pullRequestCount = Math.round(message.pullRequestCount);
29272
+ }
29273
+ if (message.issue !== undefined) {
29274
+ obj.issue = TrackerIssue.toJSON(message.issue);
29275
+ }
29276
+ return obj;
29277
+ },
29278
+
29279
+ create<I extends Exact<DeepPartial<IssueCostGroup>, I>>(base?: I): IssueCostGroup {
29280
+ return IssueCostGroup.fromPartial(base ?? ({} as any));
29281
+ },
29282
+ fromPartial<I extends Exact<DeepPartial<IssueCostGroup>, I>>(object: I): IssueCostGroup {
29283
+ const message = createBaseIssueCostGroup();
29284
+ message.id = object.id ?? "";
29285
+ message.name = object.name ?? "";
29286
+ message.costUsdNanos = object.costUsdNanos ?? "0";
29287
+ message.sessionCount = object.sessionCount ?? 0;
29288
+ message.pullRequestCount = object.pullRequestCount ?? 0;
29289
+ message.issue = (object.issue !== undefined && object.issue !== null)
29290
+ ? TrackerIssue.fromPartial(object.issue)
29291
+ : undefined;
29292
+ return message;
29293
+ },
29294
+ };
29295
+
29296
+ function createBaseTrackerIssue(): TrackerIssue {
29297
+ return {
29298
+ key: "",
29299
+ state: "",
29300
+ url: "",
29301
+ parentId: "",
29302
+ parentName: "",
29303
+ iterationId: "",
29304
+ iterationName: "",
29305
+ archivedAt: undefined,
29306
+ };
29307
+ }
29308
+
29309
+ export const TrackerIssue: MessageFns<TrackerIssue> = {
29310
+ encode(message: TrackerIssue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
29311
+ if (message.key !== "") {
29312
+ writer.uint32(10).string(message.key);
29313
+ }
29314
+ if (message.state !== "") {
29315
+ writer.uint32(18).string(message.state);
29316
+ }
29317
+ if (message.url !== "") {
29318
+ writer.uint32(26).string(message.url);
29319
+ }
29320
+ if (message.parentId !== "") {
29321
+ writer.uint32(34).string(message.parentId);
29322
+ }
29323
+ if (message.parentName !== "") {
29324
+ writer.uint32(42).string(message.parentName);
29325
+ }
29326
+ if (message.iterationId !== "") {
29327
+ writer.uint32(50).string(message.iterationId);
29328
+ }
29329
+ if (message.iterationName !== "") {
29330
+ writer.uint32(58).string(message.iterationName);
29331
+ }
29332
+ if (message.archivedAt !== undefined) {
29333
+ Timestamp.encode(toTimestamp(message.archivedAt), writer.uint32(66).fork()).join();
29334
+ }
29335
+ return writer;
29336
+ },
29337
+
29338
+ decode(input: BinaryReader | Uint8Array, length?: number): TrackerIssue {
29339
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
29340
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
29341
+ if (previousRecursionDepth >= 100) {
29342
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
29343
+ }
29344
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
29345
+ try {
29346
+ const end = length === undefined ? reader.len : reader.pos + length;
29347
+ const message = createBaseTrackerIssue();
29348
+ while (reader.pos < end) {
29349
+ const tag = reader.uint32();
29350
+ switch (tag >>> 3) {
29351
+ case 1: {
29352
+ if (tag !== 10) {
29353
+ break;
29354
+ }
29355
+
29356
+ message.key = reader.string();
29357
+ continue;
29358
+ }
29359
+ case 2: {
29360
+ if (tag !== 18) {
29361
+ break;
29362
+ }
29363
+
29364
+ message.state = reader.string();
29365
+ continue;
29366
+ }
29367
+ case 3: {
29368
+ if (tag !== 26) {
29369
+ break;
29370
+ }
29371
+
29372
+ message.url = reader.string();
29373
+ continue;
29374
+ }
29375
+ case 4: {
29376
+ if (tag !== 34) {
29377
+ break;
29378
+ }
29379
+
29380
+ message.parentId = reader.string();
29381
+ continue;
29382
+ }
29383
+ case 5: {
29384
+ if (tag !== 42) {
29385
+ break;
29386
+ }
29387
+
29388
+ message.parentName = reader.string();
29389
+ continue;
29390
+ }
29391
+ case 6: {
29392
+ if (tag !== 50) {
29393
+ break;
29394
+ }
29395
+
29396
+ message.iterationId = reader.string();
29397
+ continue;
29398
+ }
29399
+ case 7: {
29400
+ if (tag !== 58) {
29401
+ break;
29402
+ }
29403
+
29404
+ message.iterationName = reader.string();
29405
+ continue;
29406
+ }
29407
+ case 8: {
29408
+ if (tag !== 66) {
29409
+ break;
29410
+ }
29411
+
29412
+ message.archivedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
29413
+ continue;
29414
+ }
29415
+ }
29416
+ if ((tag & 7) === 4 || tag === 0) {
29417
+ break;
29418
+ }
29419
+ reader.skip(tag & 7);
29420
+ }
29421
+ return message;
29422
+ } finally {
29423
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
29424
+ }
29425
+ },
29426
+
29427
+ fromJSON(object: any): TrackerIssue {
29428
+ return {
29429
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
29430
+ state: isSet(object.state) ? globalThis.String(object.state) : "",
29431
+ url: isSet(object.url) ? globalThis.String(object.url) : "",
29432
+ parentId: isSet(object.parentId)
29433
+ ? globalThis.String(object.parentId)
29434
+ : isSet(object.parent_id)
29435
+ ? globalThis.String(object.parent_id)
29436
+ : "",
29437
+ parentName: isSet(object.parentName)
29438
+ ? globalThis.String(object.parentName)
29439
+ : isSet(object.parent_name)
29440
+ ? globalThis.String(object.parent_name)
29441
+ : "",
29442
+ iterationId: isSet(object.iterationId)
29443
+ ? globalThis.String(object.iterationId)
29444
+ : isSet(object.iteration_id)
29445
+ ? globalThis.String(object.iteration_id)
29446
+ : "",
29447
+ iterationName: isSet(object.iterationName)
29448
+ ? globalThis.String(object.iterationName)
29449
+ : isSet(object.iteration_name)
29450
+ ? globalThis.String(object.iteration_name)
29451
+ : "",
29452
+ archivedAt: isSet(object.archivedAt)
29453
+ ? fromJsonTimestamp(object.archivedAt)
29454
+ : isSet(object.archived_at)
29455
+ ? fromJsonTimestamp(object.archived_at)
29456
+ : undefined,
29457
+ };
29458
+ },
29459
+
29460
+ toJSON(message: TrackerIssue): unknown {
29461
+ const obj: any = {};
29462
+ if (message.key !== "") {
29463
+ obj.key = message.key;
29464
+ }
29465
+ if (message.state !== "") {
29466
+ obj.state = message.state;
29467
+ }
29468
+ if (message.url !== "") {
29469
+ obj.url = message.url;
29470
+ }
29471
+ if (message.parentId !== "") {
29472
+ obj.parentId = message.parentId;
29473
+ }
29474
+ if (message.parentName !== "") {
29475
+ obj.parentName = message.parentName;
29476
+ }
29477
+ if (message.iterationId !== "") {
29478
+ obj.iterationId = message.iterationId;
29479
+ }
29480
+ if (message.iterationName !== "") {
29481
+ obj.iterationName = message.iterationName;
29482
+ }
29483
+ if (message.archivedAt !== undefined) {
29484
+ obj.archivedAt = message.archivedAt.toISOString();
29485
+ }
29486
+ return obj;
29487
+ },
29488
+
29489
+ create<I extends Exact<DeepPartial<TrackerIssue>, I>>(base?: I): TrackerIssue {
29490
+ return TrackerIssue.fromPartial(base ?? ({} as any));
29491
+ },
29492
+ fromPartial<I extends Exact<DeepPartial<TrackerIssue>, I>>(object: I): TrackerIssue {
29493
+ const message = createBaseTrackerIssue();
29494
+ message.key = object.key ?? "";
29495
+ message.state = object.state ?? "";
29496
+ message.url = object.url ?? "";
29497
+ message.parentId = object.parentId ?? "";
29498
+ message.parentName = object.parentName ?? "";
29499
+ message.iterationId = object.iterationId ?? "";
29500
+ message.iterationName = object.iterationName ?? "";
29501
+ message.archivedAt = object.archivedAt ?? undefined;
29502
+ return message;
29503
+ },
29504
+ };
29505
+
29506
+ function createBaseIssueCostPagination(): IssueCostPagination {
29507
+ return { page: 0, perPage: 0, totalCount: 0, totalPages: 0 };
29508
+ }
29509
+
29510
+ export const IssueCostPagination: MessageFns<IssueCostPagination> = {
29511
+ encode(message: IssueCostPagination, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
29512
+ if (message.page !== 0) {
29513
+ writer.uint32(8).int32(message.page);
29514
+ }
29515
+ if (message.perPage !== 0) {
29516
+ writer.uint32(16).int32(message.perPage);
29517
+ }
29518
+ if (message.totalCount !== 0) {
29519
+ writer.uint32(24).int64(message.totalCount);
29520
+ }
29521
+ if (message.totalPages !== 0) {
29522
+ writer.uint32(32).int32(message.totalPages);
29523
+ }
29524
+ return writer;
29525
+ },
29526
+
29527
+ decode(input: BinaryReader | Uint8Array, length?: number): IssueCostPagination {
29528
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
29529
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
29530
+ if (previousRecursionDepth >= 100) {
29531
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
29532
+ }
29533
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
29534
+ try {
29535
+ const end = length === undefined ? reader.len : reader.pos + length;
29536
+ const message = createBaseIssueCostPagination();
29537
+ while (reader.pos < end) {
29538
+ const tag = reader.uint32();
29539
+ switch (tag >>> 3) {
29540
+ case 1: {
29541
+ if (tag !== 8) {
29542
+ break;
29543
+ }
29544
+
29545
+ message.page = reader.int32();
29546
+ continue;
29547
+ }
29548
+ case 2: {
29549
+ if (tag !== 16) {
29550
+ break;
29551
+ }
29552
+
29553
+ message.perPage = reader.int32();
29554
+ continue;
29555
+ }
29556
+ case 3: {
29557
+ if (tag !== 24) {
29558
+ break;
29559
+ }
29560
+
29561
+ message.totalCount = longToNumber(reader.int64());
29562
+ continue;
29563
+ }
29564
+ case 4: {
29565
+ if (tag !== 32) {
29566
+ break;
29567
+ }
29568
+
29569
+ message.totalPages = reader.int32();
29570
+ continue;
29571
+ }
29572
+ }
29573
+ if ((tag & 7) === 4 || tag === 0) {
29574
+ break;
29575
+ }
29576
+ reader.skip(tag & 7);
29577
+ }
29578
+ return message;
29579
+ } finally {
29580
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
29581
+ }
29582
+ },
29583
+
29584
+ fromJSON(object: any): IssueCostPagination {
29585
+ return {
29586
+ page: isSet(object.page) ? globalThis.Number(object.page) : 0,
29587
+ perPage: isSet(object.perPage)
29588
+ ? globalThis.Number(object.perPage)
29589
+ : isSet(object.per_page)
29590
+ ? globalThis.Number(object.per_page)
29591
+ : 0,
29592
+ totalCount: isSet(object.totalCount)
29593
+ ? globalThis.Number(object.totalCount)
29594
+ : isSet(object.total_count)
29595
+ ? globalThis.Number(object.total_count)
29596
+ : 0,
29597
+ totalPages: isSet(object.totalPages)
29598
+ ? globalThis.Number(object.totalPages)
29599
+ : isSet(object.total_pages)
29600
+ ? globalThis.Number(object.total_pages)
29601
+ : 0,
29602
+ };
29603
+ },
29604
+
29605
+ toJSON(message: IssueCostPagination): unknown {
29606
+ const obj: any = {};
29607
+ if (message.page !== 0) {
29608
+ obj.page = Math.round(message.page);
29609
+ }
29610
+ if (message.perPage !== 0) {
29611
+ obj.perPage = Math.round(message.perPage);
29612
+ }
29613
+ if (message.totalCount !== 0) {
29614
+ obj.totalCount = Math.round(message.totalCount);
29615
+ }
29616
+ if (message.totalPages !== 0) {
29617
+ obj.totalPages = Math.round(message.totalPages);
29618
+ }
29619
+ return obj;
29620
+ },
29621
+
29622
+ create<I extends Exact<DeepPartial<IssueCostPagination>, I>>(base?: I): IssueCostPagination {
29623
+ return IssueCostPagination.fromPartial(base ?? ({} as any));
29624
+ },
29625
+ fromPartial<I extends Exact<DeepPartial<IssueCostPagination>, I>>(object: I): IssueCostPagination {
29626
+ const message = createBaseIssueCostPagination();
29627
+ message.page = object.page ?? 0;
29628
+ message.perPage = object.perPage ?? 0;
29629
+ message.totalCount = object.totalCount ?? 0;
29630
+ message.totalPages = object.totalPages ?? 0;
29631
+ return message;
29632
+ },
29633
+ };
29634
+
29635
+ function createBaseIssueCostTotals(): IssueCostTotals {
29636
+ return {
29637
+ recordedCostUsdNanos: "0",
29638
+ attributedCostUsdNanos: "0",
29639
+ noPullRequestCostUsdNanos: "0",
29640
+ unlinkedPullRequestCostUsdNanos: "0",
29641
+ filteredCostUsdNanos: "0",
29642
+ };
29643
+ }
29644
+
29645
+ export const IssueCostTotals: MessageFns<IssueCostTotals> = {
29646
+ encode(message: IssueCostTotals, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
29647
+ if (message.recordedCostUsdNanos !== "0") {
29648
+ writer.uint32(8).int64(message.recordedCostUsdNanos);
29649
+ }
29650
+ if (message.attributedCostUsdNanos !== "0") {
29651
+ writer.uint32(16).int64(message.attributedCostUsdNanos);
29652
+ }
29653
+ if (message.noPullRequestCostUsdNanos !== "0") {
29654
+ writer.uint32(24).int64(message.noPullRequestCostUsdNanos);
29655
+ }
29656
+ if (message.unlinkedPullRequestCostUsdNanos !== "0") {
29657
+ writer.uint32(32).int64(message.unlinkedPullRequestCostUsdNanos);
29658
+ }
29659
+ if (message.filteredCostUsdNanos !== "0") {
29660
+ writer.uint32(40).int64(message.filteredCostUsdNanos);
29661
+ }
29662
+ return writer;
29663
+ },
29664
+
29665
+ decode(input: BinaryReader | Uint8Array, length?: number): IssueCostTotals {
29666
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
29667
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
29668
+ if (previousRecursionDepth >= 100) {
29669
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
29670
+ }
29671
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
29672
+ try {
29673
+ const end = length === undefined ? reader.len : reader.pos + length;
29674
+ const message = createBaseIssueCostTotals();
29675
+ while (reader.pos < end) {
29676
+ const tag = reader.uint32();
29677
+ switch (tag >>> 3) {
29678
+ case 1: {
29679
+ if (tag !== 8) {
29680
+ break;
29681
+ }
29682
+
29683
+ message.recordedCostUsdNanos = reader.int64().toString();
29684
+ continue;
29685
+ }
29686
+ case 2: {
29687
+ if (tag !== 16) {
29688
+ break;
29689
+ }
29690
+
29691
+ message.attributedCostUsdNanos = reader.int64().toString();
29692
+ continue;
29693
+ }
29694
+ case 3: {
29695
+ if (tag !== 24) {
29696
+ break;
29697
+ }
29698
+
29699
+ message.noPullRequestCostUsdNanos = reader.int64().toString();
29700
+ continue;
29701
+ }
29702
+ case 4: {
29703
+ if (tag !== 32) {
29704
+ break;
29705
+ }
29706
+
29707
+ message.unlinkedPullRequestCostUsdNanos = reader.int64().toString();
29708
+ continue;
29709
+ }
29710
+ case 5: {
29711
+ if (tag !== 40) {
29712
+ break;
29713
+ }
29714
+
29715
+ message.filteredCostUsdNanos = reader.int64().toString();
29716
+ continue;
29717
+ }
29718
+ }
29719
+ if ((tag & 7) === 4 || tag === 0) {
29720
+ break;
29721
+ }
29722
+ reader.skip(tag & 7);
29723
+ }
29724
+ return message;
29725
+ } finally {
29726
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
29727
+ }
29728
+ },
29729
+
29730
+ fromJSON(object: any): IssueCostTotals {
29731
+ return {
29732
+ recordedCostUsdNanos: isSet(object.recordedCostUsdNanos)
29733
+ ? globalThis.String(object.recordedCostUsdNanos)
29734
+ : isSet(object.recorded_cost_usd_nanos)
29735
+ ? globalThis.String(object.recorded_cost_usd_nanos)
29736
+ : "0",
29737
+ attributedCostUsdNanos: isSet(object.attributedCostUsdNanos)
29738
+ ? globalThis.String(object.attributedCostUsdNanos)
29739
+ : isSet(object.attributed_cost_usd_nanos)
29740
+ ? globalThis.String(object.attributed_cost_usd_nanos)
29741
+ : "0",
29742
+ noPullRequestCostUsdNanos: isSet(object.noPullRequestCostUsdNanos)
29743
+ ? globalThis.String(object.noPullRequestCostUsdNanos)
29744
+ : isSet(object.no_pull_request_cost_usd_nanos)
29745
+ ? globalThis.String(object.no_pull_request_cost_usd_nanos)
29746
+ : "0",
29747
+ unlinkedPullRequestCostUsdNanos: isSet(object.unlinkedPullRequestCostUsdNanos)
29748
+ ? globalThis.String(object.unlinkedPullRequestCostUsdNanos)
29749
+ : isSet(object.unlinked_pull_request_cost_usd_nanos)
29750
+ ? globalThis.String(object.unlinked_pull_request_cost_usd_nanos)
29751
+ : "0",
29752
+ filteredCostUsdNanos: isSet(object.filteredCostUsdNanos)
29753
+ ? globalThis.String(object.filteredCostUsdNanos)
29754
+ : isSet(object.filtered_cost_usd_nanos)
29755
+ ? globalThis.String(object.filtered_cost_usd_nanos)
29756
+ : "0",
29757
+ };
29758
+ },
29759
+
29760
+ toJSON(message: IssueCostTotals): unknown {
29761
+ const obj: any = {};
29762
+ if (message.recordedCostUsdNanos !== "0") {
29763
+ obj.recordedCostUsdNanos = globalThis.String(message.recordedCostUsdNanos);
29764
+ }
29765
+ if (message.attributedCostUsdNanos !== "0") {
29766
+ obj.attributedCostUsdNanos = globalThis.String(message.attributedCostUsdNanos);
29767
+ }
29768
+ if (message.noPullRequestCostUsdNanos !== "0") {
29769
+ obj.noPullRequestCostUsdNanos = globalThis.String(message.noPullRequestCostUsdNanos);
29770
+ }
29771
+ if (message.unlinkedPullRequestCostUsdNanos !== "0") {
29772
+ obj.unlinkedPullRequestCostUsdNanos = globalThis.String(message.unlinkedPullRequestCostUsdNanos);
29773
+ }
29774
+ if (message.filteredCostUsdNanos !== "0") {
29775
+ obj.filteredCostUsdNanos = globalThis.String(message.filteredCostUsdNanos);
29776
+ }
29777
+ return obj;
29778
+ },
29779
+
29780
+ create<I extends Exact<DeepPartial<IssueCostTotals>, I>>(base?: I): IssueCostTotals {
29781
+ return IssueCostTotals.fromPartial(base ?? ({} as any));
29782
+ },
29783
+ fromPartial<I extends Exact<DeepPartial<IssueCostTotals>, I>>(object: I): IssueCostTotals {
29784
+ const message = createBaseIssueCostTotals();
29785
+ message.recordedCostUsdNanos = object.recordedCostUsdNanos ?? "0";
29786
+ message.attributedCostUsdNanos = object.attributedCostUsdNanos ?? "0";
29787
+ message.noPullRequestCostUsdNanos = object.noPullRequestCostUsdNanos ?? "0";
29788
+ message.unlinkedPullRequestCostUsdNanos = object.unlinkedPullRequestCostUsdNanos ?? "0";
29789
+ message.filteredCostUsdNanos = object.filteredCostUsdNanos ?? "0";
29790
+ return message;
29791
+ },
29792
+ };
29793
+
29794
+ /**
29795
+ * AIGatewayService is the frontend-facing proxy over telemetry.api.v1.AIService.
29796
+ * It stamps the authorized organization/project and forwards telemetry-api-shaped messages.
29797
+ */
29798
+ export interface AIGatewayService {
29799
+ /**
29800
+ * One numbered page of the conversation catalog (sessions folded to
29801
+ * one rollup by source_system + session_id), ranked by sort. Weakly consistent
29802
+ * (latest-state, no frozen snapshot).
29803
+ */
29804
+ ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse>;
29805
+ /**
29806
+ * Keeps the first conversation page live: the whole top-N page re-derived each tick
29807
+ * as one SessionsSnapshot, replacing client state wholesale (not a delta feed).
29808
+ */
29809
+ StreamSessions(request: StreamSessionsRequest, metadata?: Metadata): Observable<SessionsSnapshot>;
29810
+ /** Live sidebar rollup (session_id + source_system): re-derived and re-emitted whole each tick. */
29811
+ StreamSessionSummary(request: GetSessionSummaryRequest, metadata?: Metadata): Observable<AISessionSummary>;
29812
+ ListSessionEvents(request: ListSessionEventsRequest, metadata?: Metadata): Promise<ListSessionEventsResponse>;
29813
+ StreamSessionEvents(request: StreamSessionEventsRequest, metadata?: Metadata): Observable<AISessionEventEnvelope>;
29814
+ /**
29815
+ * Live, backend-computed, per-event token series for one session (replacement snapshots):
29816
+ * one content-free point per logical event + whole-session totals; point count is capped.
29817
+ */
29818
+ StreamSessionTokenTimeline(
29819
+ request: SessionTokenTimelineRequest,
29820
+ metadata?: Metadata,
29821
+ ): Observable<SessionTokenTimeline>;
29822
+ /** Live "Files changed" card: per file the latest-observed git change-type + exact --numstat churn. */
29823
+ StreamSessionFileChanges(request: SessionFileChangesRequest, metadata?: Metadata): Observable<SessionFileChanges>;
29824
+ /** Filtered, keyset-paginated drill-down feed of git/GitHub actions (newest first). */
29825
+ ListGitActivities(request: ListGitActivitiesRequest, metadata?: Metadata): Promise<ListGitActivitiesResponse>;
29826
+ /**
29827
+ * Live stream of the filtered git/GitHub feed (UPSERT per activity keyed by
29828
+ * activity_id, a nonterminal GitActivitiesSnapshotCompleted, then open until cancel).
29829
+ */
29830
+ StreamGitActivities(request: StreamGitActivitiesRequest, metadata?: Metadata): Observable<GitActivityFrame>;
29831
+ /**
29832
+ * Live stream of the git dashboard's overview: a full windowed, dimension-sliced rollup of the filtered
29833
+ * git activities (whole-window totals ride each frame), re-derived each tick.
29834
+ */
29835
+ StreamGitActivitySummary(request: GitActivitySummaryRequest, metadata?: Metadata): Observable<GitActivitySummary>;
29836
+ /**
29837
+ * Live token burn calendar: a windowed, dimension-sliced token/cost trend series
29838
+ * plus whole-window totals.
29839
+ */
29840
+ StreamTokenActivitySummary(
29841
+ request: TokenActivitySummaryRequest,
29842
+ metadata?: Metadata,
29843
+ ): Observable<TokenActivitySummary>;
29844
+ /**
29845
+ * Live "burn rate now" gauge: the trailing-60s cost/hr + tokens/min (total plus a per-dimension
29846
+ * breakdown) and a fixed 60-minute one-minute rolling sparkline of that rate. Fixed horizon, fast
29847
+ * refresh; first frame is a full snapshot.
29848
+ */
29849
+ StreamBurnRate(request: BurnRateRequest, metadata?: Metadata): Observable<BurnRate>;
29850
+ /**
29851
+ * Live token-burn calendar over an inclusive UTC [start_date, end_date] range: one complete row per
29852
+ * covered day off the precomputed daily rollup. Covered empty days are zero; uncomputed history is
29853
+ * omitted; today is provisional.
29854
+ */
29855
+ StreamDailyActivity(request: DailyActivityRequest, metadata?: Metadata): Observable<DailyActivity>;
29856
+ /**
29857
+ * Live current-UTC-month spend forecast: month-to-date cost and the projected month-end total (a band from
29858
+ * replaying recent weeks), for the project, per model, provider and source system, and per principal, off the
29859
+ * same daily rollup as StreamDailyActivity; the filter narrows it by funding mode, source system and principal.
29860
+ * Mirrors telemetry.api.v1.
29861
+ */
28189
29862
  StreamSpendForecast(request: SpendForecastRequest, metadata?: Metadata): Observable<SpendForecast>;
28190
29863
  /**
28191
29864
  * Live weekly activity rhythm: a sparse (weekday, hour) heatmap over a bounded sliding window in an
@@ -28282,6 +29955,20 @@ export interface AIGatewayService {
28282
29955
  * Mirrors telemetry.api.v1.
28283
29956
  */
28284
29957
  ListRelayHeartbeats(request: ListRelayHeartbeatsRequest, metadata?: Metadata): Promise<ListRelayHeartbeatsResponse>;
29958
+ /**
29959
+ * The organization's recorded AI cost (provider cost, gross of any subscription) attributed to its tracker's issues
29960
+ * by attribution_method (PER_PR when unspecified): PER_PR splits each session's
29961
+ * cost evenly across the pull requests it links to, then each pull request's share evenly across the issues the
29962
+ * tracker attaches it to; PER_TICKET splits it evenly across the distinct issues of all its pull requests plus one
29963
+ * unattributed slot per pull request with no issue. Integer
29964
+ * nanodollars, over the whole organization before parent_ids and iteration_ids narrow the groups, so a shared
29965
+ * session never counts twice. An issue counts under its parent and iteration as last synced. One row per issue,
29966
+ * parent or iteration, highest cost first, numbered pages; totals add up to the window's recorded cost to the
29967
+ * nanodollar. Organization-level, for every member. Weakly consistent across pages. Nothing is served until the
29968
+ * tracker is connected and its first full sync has completed (sync_state); STATUS_CODE_UNAVAILABLE when Terma cannot
29969
+ * tell whether it is connected. Mirrors ai.api.v1.
29970
+ */
29971
+ ListIssueCosts(request: ListIssueCostsRequest, metadata?: Metadata): Promise<ListIssueCostsResponse>;
28285
29972
  }
28286
29973
 
28287
29974
  export const AIGatewayServiceServiceName = "gateway.web.v1.AIGatewayService";
@@ -28322,6 +30009,7 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
28322
30009
  this.GetPromptLabelTrend = this.GetPromptLabelTrend.bind(this);
28323
30010
  this.StreamEntitlements = this.StreamEntitlements.bind(this);
28324
30011
  this.ListRelayHeartbeats = this.ListRelayHeartbeats.bind(this);
30012
+ this.ListIssueCosts = this.ListIssueCosts.bind(this);
28325
30013
  }
28326
30014
  ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse> {
28327
30015
  const data = ListSessionsRequest.encode(request).finish();
@@ -28520,6 +30208,12 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
28520
30208
  const promise = this.rpc.request(this.service, "ListRelayHeartbeats", data, metadata);
28521
30209
  return promise.then((data) => ListRelayHeartbeatsResponse.decode(new BinaryReader(data)));
28522
30210
  }
30211
+
30212
+ ListIssueCosts(request: ListIssueCostsRequest, metadata?: Metadata): Promise<ListIssueCostsResponse> {
30213
+ const data = ListIssueCostsRequest.encode(request).finish();
30214
+ const promise = this.rpc.request(this.service, "ListIssueCosts", data, metadata);
30215
+ return promise.then((data) => ListIssueCostsResponse.decode(new BinaryReader(data)));
30216
+ }
28523
30217
  }
28524
30218
 
28525
30219
  interface Rpc {