@miradorlabs/web-grpc 4.13.0 → 4.15.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.
@@ -2234,6 +2234,230 @@ export function trackerSyncErrorToJSON(object: TrackerSyncError): string {
2234
2234
  }
2235
2235
  }
2236
2236
 
2237
+ /** AIProjectInsightAvailability is whether a project has an insights analysis to show. */
2238
+ export enum AIProjectInsightAvailability {
2239
+ AI_PROJECT_INSIGHT_AVAILABILITY_UNSPECIFIED = 0,
2240
+ /** AI_PROJECT_INSIGHT_AVAILABILITY_NOT_COMPUTED - No successful run yet: no window and no coverage. */
2241
+ AI_PROJECT_INSIGHT_AVAILABILITY_NOT_COMPUTED = 1,
2242
+ /**
2243
+ * AI_PROJECT_INSIGHT_AVAILABILITY_INSUFFICIENT_DATA - The run succeeded, but the window's eligible sessions belong to fewer than two linked people, so no model ran and
2244
+ * no card could be grounded.
2245
+ */
2246
+ AI_PROJECT_INSIGHT_AVAILABILITY_INSUFFICIENT_DATA = 2,
2247
+ /** AI_PROJECT_INSIGHT_AVAILABILITY_READY - A valid analysis. Zero cards means no supported recommendation in the evidence the run read. */
2248
+ AI_PROJECT_INSIGHT_AVAILABILITY_READY = 3,
2249
+ UNRECOGNIZED = -1,
2250
+ }
2251
+
2252
+ export function aIProjectInsightAvailabilityFromJSON(object: any): AIProjectInsightAvailability {
2253
+ switch (object) {
2254
+ case 0:
2255
+ case "AI_PROJECT_INSIGHT_AVAILABILITY_UNSPECIFIED":
2256
+ return AIProjectInsightAvailability.AI_PROJECT_INSIGHT_AVAILABILITY_UNSPECIFIED;
2257
+ case 1:
2258
+ case "AI_PROJECT_INSIGHT_AVAILABILITY_NOT_COMPUTED":
2259
+ return AIProjectInsightAvailability.AI_PROJECT_INSIGHT_AVAILABILITY_NOT_COMPUTED;
2260
+ case 2:
2261
+ case "AI_PROJECT_INSIGHT_AVAILABILITY_INSUFFICIENT_DATA":
2262
+ return AIProjectInsightAvailability.AI_PROJECT_INSIGHT_AVAILABILITY_INSUFFICIENT_DATA;
2263
+ case 3:
2264
+ case "AI_PROJECT_INSIGHT_AVAILABILITY_READY":
2265
+ return AIProjectInsightAvailability.AI_PROJECT_INSIGHT_AVAILABILITY_READY;
2266
+ case -1:
2267
+ case "UNRECOGNIZED":
2268
+ default:
2269
+ return AIProjectInsightAvailability.UNRECOGNIZED;
2270
+ }
2271
+ }
2272
+
2273
+ export function aIProjectInsightAvailabilityToJSON(object: AIProjectInsightAvailability): string {
2274
+ switch (object) {
2275
+ case AIProjectInsightAvailability.AI_PROJECT_INSIGHT_AVAILABILITY_UNSPECIFIED:
2276
+ return "AI_PROJECT_INSIGHT_AVAILABILITY_UNSPECIFIED";
2277
+ case AIProjectInsightAvailability.AI_PROJECT_INSIGHT_AVAILABILITY_NOT_COMPUTED:
2278
+ return "AI_PROJECT_INSIGHT_AVAILABILITY_NOT_COMPUTED";
2279
+ case AIProjectInsightAvailability.AI_PROJECT_INSIGHT_AVAILABILITY_INSUFFICIENT_DATA:
2280
+ return "AI_PROJECT_INSIGHT_AVAILABILITY_INSUFFICIENT_DATA";
2281
+ case AIProjectInsightAvailability.AI_PROJECT_INSIGHT_AVAILABILITY_READY:
2282
+ return "AI_PROJECT_INSIGHT_AVAILABILITY_READY";
2283
+ case AIProjectInsightAvailability.UNRECOGNIZED:
2284
+ default:
2285
+ return "UNRECOGNIZED";
2286
+ }
2287
+ }
2288
+
2289
+ export enum AIProjectInsightCoverageStatus {
2290
+ AI_PROJECT_INSIGHT_COVERAGE_STATUS_UNSPECIFIED = 0,
2291
+ /** AI_PROJECT_INSIGHT_COVERAGE_STATUS_COMPLETE - Every eligible session's evidence was read, whole. */
2292
+ AI_PROJECT_INSIGHT_COVERAGE_STATUS_COMPLETE = 1,
2293
+ /**
2294
+ * AI_PROJECT_INSIGHT_COVERAGE_STATUS_PARTIAL - Only part of the window was read: a budget stopped the reading, sessions went unread, or evidence was withheld or
2295
+ * truncated.
2296
+ */
2297
+ AI_PROJECT_INSIGHT_COVERAGE_STATUS_PARTIAL = 2,
2298
+ UNRECOGNIZED = -1,
2299
+ }
2300
+
2301
+ export function aIProjectInsightCoverageStatusFromJSON(object: any): AIProjectInsightCoverageStatus {
2302
+ switch (object) {
2303
+ case 0:
2304
+ case "AI_PROJECT_INSIGHT_COVERAGE_STATUS_UNSPECIFIED":
2305
+ return AIProjectInsightCoverageStatus.AI_PROJECT_INSIGHT_COVERAGE_STATUS_UNSPECIFIED;
2306
+ case 1:
2307
+ case "AI_PROJECT_INSIGHT_COVERAGE_STATUS_COMPLETE":
2308
+ return AIProjectInsightCoverageStatus.AI_PROJECT_INSIGHT_COVERAGE_STATUS_COMPLETE;
2309
+ case 2:
2310
+ case "AI_PROJECT_INSIGHT_COVERAGE_STATUS_PARTIAL":
2311
+ return AIProjectInsightCoverageStatus.AI_PROJECT_INSIGHT_COVERAGE_STATUS_PARTIAL;
2312
+ case -1:
2313
+ case "UNRECOGNIZED":
2314
+ default:
2315
+ return AIProjectInsightCoverageStatus.UNRECOGNIZED;
2316
+ }
2317
+ }
2318
+
2319
+ export function aIProjectInsightCoverageStatusToJSON(object: AIProjectInsightCoverageStatus): string {
2320
+ switch (object) {
2321
+ case AIProjectInsightCoverageStatus.AI_PROJECT_INSIGHT_COVERAGE_STATUS_UNSPECIFIED:
2322
+ return "AI_PROJECT_INSIGHT_COVERAGE_STATUS_UNSPECIFIED";
2323
+ case AIProjectInsightCoverageStatus.AI_PROJECT_INSIGHT_COVERAGE_STATUS_COMPLETE:
2324
+ return "AI_PROJECT_INSIGHT_COVERAGE_STATUS_COMPLETE";
2325
+ case AIProjectInsightCoverageStatus.AI_PROJECT_INSIGHT_COVERAGE_STATUS_PARTIAL:
2326
+ return "AI_PROJECT_INSIGHT_COVERAGE_STATUS_PARTIAL";
2327
+ case AIProjectInsightCoverageStatus.UNRECOGNIZED:
2328
+ default:
2329
+ return "UNRECOGNIZED";
2330
+ }
2331
+ }
2332
+
2333
+ /** AIProjectInsightStopReason is the budget that stopped a partial analysis's reading. */
2334
+ export enum AIProjectInsightStopReason {
2335
+ AI_PROJECT_INSIGHT_STOP_REASON_UNSPECIFIED = 0,
2336
+ AI_PROJECT_INSIGHT_STOP_REASON_OVERVIEW_PAGES = 1,
2337
+ AI_PROJECT_INSIGHT_STOP_REASON_EVIDENCE_PAGES = 2,
2338
+ AI_PROJECT_INSIGHT_STOP_REASON_EVIDENCE_BUDGET = 3,
2339
+ UNRECOGNIZED = -1,
2340
+ }
2341
+
2342
+ export function aIProjectInsightStopReasonFromJSON(object: any): AIProjectInsightStopReason {
2343
+ switch (object) {
2344
+ case 0:
2345
+ case "AI_PROJECT_INSIGHT_STOP_REASON_UNSPECIFIED":
2346
+ return AIProjectInsightStopReason.AI_PROJECT_INSIGHT_STOP_REASON_UNSPECIFIED;
2347
+ case 1:
2348
+ case "AI_PROJECT_INSIGHT_STOP_REASON_OVERVIEW_PAGES":
2349
+ return AIProjectInsightStopReason.AI_PROJECT_INSIGHT_STOP_REASON_OVERVIEW_PAGES;
2350
+ case 2:
2351
+ case "AI_PROJECT_INSIGHT_STOP_REASON_EVIDENCE_PAGES":
2352
+ return AIProjectInsightStopReason.AI_PROJECT_INSIGHT_STOP_REASON_EVIDENCE_PAGES;
2353
+ case 3:
2354
+ case "AI_PROJECT_INSIGHT_STOP_REASON_EVIDENCE_BUDGET":
2355
+ return AIProjectInsightStopReason.AI_PROJECT_INSIGHT_STOP_REASON_EVIDENCE_BUDGET;
2356
+ case -1:
2357
+ case "UNRECOGNIZED":
2358
+ default:
2359
+ return AIProjectInsightStopReason.UNRECOGNIZED;
2360
+ }
2361
+ }
2362
+
2363
+ export function aIProjectInsightStopReasonToJSON(object: AIProjectInsightStopReason): string {
2364
+ switch (object) {
2365
+ case AIProjectInsightStopReason.AI_PROJECT_INSIGHT_STOP_REASON_UNSPECIFIED:
2366
+ return "AI_PROJECT_INSIGHT_STOP_REASON_UNSPECIFIED";
2367
+ case AIProjectInsightStopReason.AI_PROJECT_INSIGHT_STOP_REASON_OVERVIEW_PAGES:
2368
+ return "AI_PROJECT_INSIGHT_STOP_REASON_OVERVIEW_PAGES";
2369
+ case AIProjectInsightStopReason.AI_PROJECT_INSIGHT_STOP_REASON_EVIDENCE_PAGES:
2370
+ return "AI_PROJECT_INSIGHT_STOP_REASON_EVIDENCE_PAGES";
2371
+ case AIProjectInsightStopReason.AI_PROJECT_INSIGHT_STOP_REASON_EVIDENCE_BUDGET:
2372
+ return "AI_PROJECT_INSIGHT_STOP_REASON_EVIDENCE_BUDGET";
2373
+ case AIProjectInsightStopReason.UNRECOGNIZED:
2374
+ default:
2375
+ return "UNRECOGNIZED";
2376
+ }
2377
+ }
2378
+
2379
+ /** AIProjectInsightKind is what a card recommends, for display. */
2380
+ export enum AIProjectInsightKind {
2381
+ AI_PROJECT_INSIGHT_KIND_UNSPECIFIED = 0,
2382
+ /** AI_PROJECT_INSIGHT_KIND_REUSABLE_WORKFLOW - A repeated workflow worth turning into a new reusable skill. */
2383
+ AI_PROJECT_INSIGHT_KIND_REUSABLE_WORKFLOW = 1,
2384
+ AI_PROJECT_INSIGHT_KIND_REPOSITORY_STRUCTURE = 2,
2385
+ /** AI_PROJECT_INSIGHT_KIND_SECURITY_REVIEW - An observed concern to investigate, never a confirmed vulnerability. */
2386
+ AI_PROJECT_INSIGHT_KIND_SECURITY_REVIEW = 3,
2387
+ AI_PROJECT_INSIGHT_KIND_TOOLING_MCP = 4,
2388
+ /** AI_PROJECT_INSIGHT_KIND_COORDINATION - Members duplicating work, or needing to coordinate it. */
2389
+ AI_PROJECT_INSIGHT_KIND_COORDINATION = 5,
2390
+ /** AI_PROJECT_INSIGHT_KIND_SHARED_FOCUS - Members working on the same product, feature or area, who would gain from knowing it. */
2391
+ AI_PROJECT_INSIGHT_KIND_SHARED_FOCUS = 6,
2392
+ /** AI_PROJECT_INSIGHT_KIND_SKILL_SHARING - A practice, skill or know-how one member shows that others working nearby would benefit from. */
2393
+ AI_PROJECT_INSIGHT_KIND_SKILL_SHARING = 7,
2394
+ /** AI_PROJECT_INSIGHT_KIND_AGENT_EXPERIENCE - How members get on with their agents: models or tools they favour, and where work flowed or stalled. */
2395
+ AI_PROJECT_INSIGHT_KIND_AGENT_EXPERIENCE = 8,
2396
+ UNRECOGNIZED = -1,
2397
+ }
2398
+
2399
+ export function aIProjectInsightKindFromJSON(object: any): AIProjectInsightKind {
2400
+ switch (object) {
2401
+ case 0:
2402
+ case "AI_PROJECT_INSIGHT_KIND_UNSPECIFIED":
2403
+ return AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_UNSPECIFIED;
2404
+ case 1:
2405
+ case "AI_PROJECT_INSIGHT_KIND_REUSABLE_WORKFLOW":
2406
+ return AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_REUSABLE_WORKFLOW;
2407
+ case 2:
2408
+ case "AI_PROJECT_INSIGHT_KIND_REPOSITORY_STRUCTURE":
2409
+ return AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_REPOSITORY_STRUCTURE;
2410
+ case 3:
2411
+ case "AI_PROJECT_INSIGHT_KIND_SECURITY_REVIEW":
2412
+ return AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_SECURITY_REVIEW;
2413
+ case 4:
2414
+ case "AI_PROJECT_INSIGHT_KIND_TOOLING_MCP":
2415
+ return AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_TOOLING_MCP;
2416
+ case 5:
2417
+ case "AI_PROJECT_INSIGHT_KIND_COORDINATION":
2418
+ return AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_COORDINATION;
2419
+ case 6:
2420
+ case "AI_PROJECT_INSIGHT_KIND_SHARED_FOCUS":
2421
+ return AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_SHARED_FOCUS;
2422
+ case 7:
2423
+ case "AI_PROJECT_INSIGHT_KIND_SKILL_SHARING":
2424
+ return AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_SKILL_SHARING;
2425
+ case 8:
2426
+ case "AI_PROJECT_INSIGHT_KIND_AGENT_EXPERIENCE":
2427
+ return AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_AGENT_EXPERIENCE;
2428
+ case -1:
2429
+ case "UNRECOGNIZED":
2430
+ default:
2431
+ return AIProjectInsightKind.UNRECOGNIZED;
2432
+ }
2433
+ }
2434
+
2435
+ export function aIProjectInsightKindToJSON(object: AIProjectInsightKind): string {
2436
+ switch (object) {
2437
+ case AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_UNSPECIFIED:
2438
+ return "AI_PROJECT_INSIGHT_KIND_UNSPECIFIED";
2439
+ case AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_REUSABLE_WORKFLOW:
2440
+ return "AI_PROJECT_INSIGHT_KIND_REUSABLE_WORKFLOW";
2441
+ case AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_REPOSITORY_STRUCTURE:
2442
+ return "AI_PROJECT_INSIGHT_KIND_REPOSITORY_STRUCTURE";
2443
+ case AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_SECURITY_REVIEW:
2444
+ return "AI_PROJECT_INSIGHT_KIND_SECURITY_REVIEW";
2445
+ case AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_TOOLING_MCP:
2446
+ return "AI_PROJECT_INSIGHT_KIND_TOOLING_MCP";
2447
+ case AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_COORDINATION:
2448
+ return "AI_PROJECT_INSIGHT_KIND_COORDINATION";
2449
+ case AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_SHARED_FOCUS:
2450
+ return "AI_PROJECT_INSIGHT_KIND_SHARED_FOCUS";
2451
+ case AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_SKILL_SHARING:
2452
+ return "AI_PROJECT_INSIGHT_KIND_SKILL_SHARING";
2453
+ case AIProjectInsightKind.AI_PROJECT_INSIGHT_KIND_AGENT_EXPERIENCE:
2454
+ return "AI_PROJECT_INSIGHT_KIND_AGENT_EXPERIENCE";
2455
+ case AIProjectInsightKind.UNRECOGNIZED:
2456
+ default:
2457
+ return "UNRECOGNIZED";
2458
+ }
2459
+ }
2460
+
2237
2461
  /**
2238
2462
  * AIAgentKind is whose run made a model call: the session's main thread or a subagent run inside it. Mirrors
2239
2463
  * ai.api.v1.
@@ -4671,6 +4895,150 @@ export interface IssueSession {
4671
4895
  costUsdNanos: string;
4672
4896
  }
4673
4897
 
4898
+ export interface ListProjectInsightsRequest {
4899
+ organizationId: string;
4900
+ projectId: string;
4901
+ /** The most cards returned per run: 0 is 5, above 5 is 5, and a negative value is a validation error. */
4902
+ limit: number;
4903
+ }
4904
+
4905
+ export interface ListProjectInsightsResponse {
4906
+ status:
4907
+ | ResponseStatus
4908
+ | undefined;
4909
+ /**
4910
+ * current's availability, NOT_COMPUTED when the project has no successful run; UNSPECIFIED only when status is not
4911
+ * SUCCESS.
4912
+ */
4913
+ availability: AIProjectInsightAvailability;
4914
+ /**
4915
+ * The active timezone's latest local day, whatever its availability: the project's latest state. Absent when
4916
+ * NOT_COMPUTED.
4917
+ */
4918
+ current:
4919
+ | AIProjectInsightRun
4920
+ | undefined;
4921
+ /**
4922
+ * Present only when current is not READY: the most recent earlier local day's analysis, in any timezone, only if
4923
+ * that day is READY and at most three days before the newest stored day (the read looks back no further).
4924
+ * Historical context, labelled by its own local_date, never shown as current's state.
4925
+ */
4926
+ previous: AIProjectInsightRun | undefined;
4927
+ }
4928
+
4929
+ /**
4930
+ * AIProjectInsightRun is the latest successful analysis of one local day of the project. Show its day, window and
4931
+ * analyzed_at with its cards ("Today until 14:00, analyzed 14:06", "Nov 3 (final)").
4932
+ */
4933
+ export interface AIProjectInsightRun {
4934
+ runId: string;
4935
+ /** READY or INSUFFICIENT_DATA; previous is always READY. */
4936
+ availability: AIProjectInsightAvailability;
4937
+ /** The day the run analyzed, YYYY-MM-DD in time_zone: what a client labels the run with. */
4938
+ localDate: string;
4939
+ /** The IANA timezone the day is in: the organization's, or "UTC" when it had none. */
4940
+ timeZone: string;
4941
+ /**
4942
+ * False when the organization had no timezone and "UTC" is the fallback (prompt the user to set one); true when
4943
+ * time_zone is the organization's choice, UTC included.
4944
+ */
4945
+ timeZoneSet: boolean;
4946
+ /** True when the window is the whole local day, final for that day; false while the day is still running. */
4947
+ windowClosed: boolean;
4948
+ /**
4949
+ * The window [window_start, window_end). window_start is local_date's first instant in time_zone (midnight, or
4950
+ * where a daylight-saving gap that skips midnight ends); an open window ends at the tick that analyzed it, a closed
4951
+ * one at the next day's first instant.
4952
+ */
4953
+ windowStart: Date | undefined;
4954
+ windowEnd:
4955
+ | Date
4956
+ | undefined;
4957
+ /** When the run analyzed the window, not when the job last found it unchanged. */
4958
+ analyzedAt:
4959
+ | Date
4960
+ | undefined;
4961
+ /** The model, and the analysis version: the task, tools and selection versions and the budgets the run used. */
4962
+ model: string;
4963
+ analysisVersion: string;
4964
+ /** The window's eligible sessions, and those whose principal links to no person. */
4965
+ eligibleSessionCount: number;
4966
+ unresolvedSessionCount: number;
4967
+ /** Distinct linked people behind the eligible sessions. */
4968
+ linkedPersonCount: number;
4969
+ /** What the analysis read; absent on an INSUFFICIENT_DATA run, which reads nothing. */
4970
+ coverage:
4971
+ | AIProjectInsightCoverage
4972
+ | undefined;
4973
+ /** Up to the request's limit of the run's cards, in rank order. */
4974
+ insights: AIProjectInsight[];
4975
+ /** The run's exact card count (0 to 5), so a capped preview tells one card from one of five. */
4976
+ totalCount: number;
4977
+ }
4978
+
4979
+ /**
4980
+ * AIProjectInsightCoverage is how much of the window's evidence the analysis read. Show the sessions read against the
4981
+ * eligible ones, and a partial analysis's stop reason, beside the cards; never extrapolate to unread sessions.
4982
+ */
4983
+ export interface AIProjectInsightCoverage {
4984
+ status: AIProjectInsightCoverageStatus;
4985
+ /** Unspecified is no stop: no budget cut the reading short. */
4986
+ stopReason: AIProjectInsightStopReason;
4987
+ /** Distinct sessions the model saw in an overview, and those whose evidence it read. */
4988
+ overviewSessionCount: number;
4989
+ evidenceSessionCount: number;
4990
+ /** Distinct linked people whose evidence the model read. */
4991
+ evidencePersonCount: number;
4992
+ /** Evidence items held back from the model, and items cut to their size cap. */
4993
+ withheldEvidenceCount: number;
4994
+ truncatedEvidenceCount: number;
4995
+ }
4996
+
4997
+ /**
4998
+ * AIProjectInsight is one recommendation about the project's work, grounded in sessions of at least two linked people.
4999
+ * title, pattern, explanation, action and limitations are model-written text; the counts and spend come from
5000
+ * SQL, never from the model. Cards are new on every run: id names this run's card, not a pattern across runs.
5001
+ */
5002
+ export interface AIProjectInsight {
5003
+ id: string;
5004
+ /** 1 is the model's highest priority; unique within the run. */
5005
+ rank: number;
5006
+ /** For display only; not evidence. */
5007
+ kind: AIProjectInsightKind;
5008
+ title: string;
5009
+ /** The observed pattern. */
5010
+ pattern: string;
5011
+ /** How the cited sessions connect, and why the action follows. */
5012
+ explanation: string;
5013
+ /** The proposed action. Nothing is done automatically. */
5014
+ action: string;
5015
+ /** What is still uncertain. */
5016
+ limitations: string;
5017
+ /** Distinct supporting sessions (at most 50) and their linked people (at least 2). */
5018
+ sessionCount: number;
5019
+ personCount: number;
5020
+ /**
5021
+ * Recorded spend in the supporting sessions during the window, in USD, as an exact decimal string ("12.5"). It is a
5022
+ * sum of Decimal(18,9) amounts, so it can exceed a double's precision or int64 nanodollars. Absent when it could
5023
+ * not be measured, never "0" for unknown. Cards' sessions overlap: never add amounts across cards.
5024
+ */
5025
+ spendUsd?:
5026
+ | string
5027
+ | undefined;
5028
+ /** The events the card cites, in the model's order; each names a session of the project. */
5029
+ citations: AIProjectInsightCitation[];
5030
+ }
5031
+
5032
+ /**
5033
+ * AIProjectInsightCitation is one cited event: its session's identity (source_system with session_id) and the
5034
+ * event's stored identity in that session.
5035
+ */
5036
+ export interface AIProjectInsightCitation {
5037
+ sourceSystem: string;
5038
+ sessionId: string;
5039
+ eventRef: AISessionEventRef | undefined;
5040
+ }
5041
+
4674
5042
  function createBaseListSessionsRequest(): ListSessionsRequest {
4675
5043
  return { organizationId: "", projectId: "", filter: undefined, sort: 0, page: 0, perPage: 0 };
4676
5044
  }
@@ -32683,119 +33051,1334 @@ export const IssueSession: MessageFns<IssueSession> = {
32683
33051
  },
32684
33052
  };
32685
33053
 
32686
- /**
32687
- * AIGatewayService is the frontend-facing proxy over telemetry.api.v1.AIService.
32688
- * It stamps the authorized organization/project and forwards telemetry-api-shaped messages.
32689
- */
32690
- export interface AIGatewayService {
32691
- /**
32692
- * One numbered page of the conversation catalog (sessions folded to
32693
- * one rollup by source_system + session_id), ranked by sort. Weakly consistent
32694
- * (latest-state, no frozen snapshot).
32695
- */
32696
- ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse>;
32697
- /**
32698
- * Keeps the first conversation page live: the whole top-N page re-derived each tick
32699
- * as one SessionsSnapshot, replacing client state wholesale (not a delta feed).
32700
- */
32701
- StreamSessions(request: StreamSessionsRequest, metadata?: Metadata): Observable<SessionsSnapshot>;
32702
- /** Live sidebar rollup (session_id + source_system): re-derived and re-emitted whole each tick. */
32703
- StreamSessionSummary(request: GetSessionSummaryRequest, metadata?: Metadata): Observable<AISessionSummary>;
32704
- ListSessionEvents(request: ListSessionEventsRequest, metadata?: Metadata): Promise<ListSessionEventsResponse>;
32705
- StreamSessionEvents(request: StreamSessionEventsRequest, metadata?: Metadata): Observable<AISessionEventEnvelope>;
32706
- /**
32707
- * Live, backend-computed, per-event token series for one session (replacement snapshots):
32708
- * one content-free point per logical event + whole-session totals; point count is capped.
32709
- */
32710
- StreamSessionTokenTimeline(
32711
- request: SessionTokenTimelineRequest,
32712
- metadata?: Metadata,
32713
- ): Observable<SessionTokenTimeline>;
32714
- /** Live "Files changed" card: per file the latest-observed git change-type + exact --numstat churn. */
32715
- StreamSessionFileChanges(request: SessionFileChangesRequest, metadata?: Metadata): Observable<SessionFileChanges>;
32716
- /** Filtered, keyset-paginated drill-down feed of git/GitHub actions (newest first). */
32717
- ListGitActivities(request: ListGitActivitiesRequest, metadata?: Metadata): Promise<ListGitActivitiesResponse>;
32718
- /**
32719
- * Live stream of the filtered git/GitHub feed (UPSERT per activity keyed by
32720
- * activity_id, a nonterminal GitActivitiesSnapshotCompleted, then open until cancel).
32721
- */
32722
- StreamGitActivities(request: StreamGitActivitiesRequest, metadata?: Metadata): Observable<GitActivityFrame>;
32723
- /**
32724
- * Live stream of the git dashboard's overview: a full windowed, dimension-sliced rollup of the filtered
32725
- * git activities (whole-window totals ride each frame), re-derived each tick.
32726
- */
32727
- StreamGitActivitySummary(request: GitActivitySummaryRequest, metadata?: Metadata): Observable<GitActivitySummary>;
32728
- /**
32729
- * Live token burn calendar: a windowed, dimension-sliced token/cost trend series
32730
- * plus whole-window totals.
32731
- */
32732
- StreamTokenActivitySummary(
32733
- request: TokenActivitySummaryRequest,
32734
- metadata?: Metadata,
32735
- ): Observable<TokenActivitySummary>;
32736
- /**
32737
- * Live "burn rate now" gauge: the trailing-60s cost/hr + tokens/min (total plus a per-dimension
32738
- * breakdown) and a fixed 60-minute one-minute rolling sparkline of that rate. Fixed horizon, fast
32739
- * refresh; first frame is a full snapshot.
32740
- */
32741
- StreamBurnRate(request: BurnRateRequest, metadata?: Metadata): Observable<BurnRate>;
32742
- /**
32743
- * Live token-burn calendar over an inclusive UTC [start_date, end_date] range: one complete row per
32744
- * covered day off the precomputed daily rollup. Covered empty days are zero; uncomputed history is
32745
- * omitted; today is provisional.
32746
- */
32747
- StreamDailyActivity(request: DailyActivityRequest, metadata?: Metadata): Observable<DailyActivity>;
32748
- /**
32749
- * Live current-UTC-month spend forecast: month-to-date cost and the projected month-end total (a band from
32750
- * replaying recent weeks), for the project, per model, provider and source system, and per principal, off the
32751
- * same daily rollup as StreamDailyActivity; the filter narrows it by funding mode, source system and principal.
32752
- * Mirrors telemetry.api.v1.
32753
- */
32754
- StreamSpendForecast(request: SpendForecastRequest, metadata?: Metadata): Observable<SpendForecast>;
32755
- /**
32756
- * Live weekly activity rhythm: a sparse (weekday, hour) heatmap over a bounded sliding window in an
32757
- * explicit IANA time zone. Every latest logical event counts; settled model calls add token/cost.
32758
- */
32759
- StreamActivityRhythm(request: ActivityRhythmRequest, metadata?: Metadata): Observable<ActivityRhythm>;
32760
- /**
32761
- * Live stream of one project's dashboard bundle: headline totals, model/provider/source mix,
32762
- * and top sessions by cost.
32763
- */
32764
- StreamProjectOverview(request: ProjectOverviewRequest, metadata?: Metadata): Observable<ProjectOverview>;
32765
- /**
32766
- * Live organization home cards: one summary per requested project (zeros when it has no AI activity) —
32767
- * conversations last active in the window, their principals and git counts, and the window's burn by model.
32768
- */
32769
- StreamProjectSummaries(request: ProjectSummariesRequest, metadata?: Metadata): Observable<ProjectSummaries>;
32770
- /**
32771
- * Per-file working-state feed (keyset-paginated) behind the unlanded-work funnel: one row per
32772
- * (repository_key, ref, path) the AI edited (with filter.sessions or filter.paths, one they name): its kept
32773
- * checkout copies' edits, costs and tokens added up, its state from the most-edited copy. Mirrors telemetry.api.v1.
32774
- */
32775
- ListFiles(request: ListFilesRequest, metadata?: Metadata): Promise<ListFilesResponse>;
32776
- /**
32777
- * ListFiles' files rolled up by directory, one row per (repository_key, directory), every matching directory in
32778
- * one response (unpaged). Mirrors telemetry.api.v1.
32779
- */
32780
- ListFileDirectories(request: ListFileDirectoriesRequest, metadata?: Metadata): Promise<ListFileDirectoriesResponse>;
32781
- /**
32782
- * Live stream of the unlanded-work funnel: aging tiers + discarded (git-invisible churn), a complete
32783
- * snapshot re-derived each tick. Every checkout copy, edited or not, lands in its own bucket; files and
32784
- * sessions are distinct counts, so they do not add up across buckets or groups. Mirrors telemetry.api.v1.
32785
- */
32786
- StreamFilesSummary(request: FilesSummaryRequest, metadata?: Metadata): Observable<FilesSummary>;
32787
- /** Latest observed list price per catalog listing from the global catalog, under stored names. */
32788
- ListModelPrices(request: ListModelPricesRequest, metadata?: Metadata): Promise<ListModelPricesResponse>;
32789
- /**
32790
- * Every stored observation for the filtered models over a time range, oldest first —
32791
- * the rows ListModelPrices collapses. filter.model_raws is required.
32792
- */
32793
- ListModelPriceHistory(
32794
- request: ListModelPriceHistoryRequest,
32795
- metadata?: Metadata,
32796
- ): Promise<ListModelPriceHistoryResponse>;
32797
- /**
32798
- * Top-N most-used resources of one kind (skills / tools / files / URLs / bash commands) over a
33054
+ function createBaseListProjectInsightsRequest(): ListProjectInsightsRequest {
33055
+ return { organizationId: "", projectId: "", limit: 0 };
33056
+ }
33057
+
33058
+ export const ListProjectInsightsRequest: MessageFns<ListProjectInsightsRequest> = {
33059
+ encode(message: ListProjectInsightsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
33060
+ if (message.organizationId !== "") {
33061
+ writer.uint32(10).string(message.organizationId);
33062
+ }
33063
+ if (message.projectId !== "") {
33064
+ writer.uint32(18).string(message.projectId);
33065
+ }
33066
+ if (message.limit !== 0) {
33067
+ writer.uint32(24).int32(message.limit);
33068
+ }
33069
+ return writer;
33070
+ },
33071
+
33072
+ decode(input: BinaryReader | Uint8Array, length?: number): ListProjectInsightsRequest {
33073
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
33074
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
33075
+ if (previousRecursionDepth >= 100) {
33076
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
33077
+ }
33078
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
33079
+ try {
33080
+ const end = length === undefined ? reader.len : reader.pos + length;
33081
+ const message = createBaseListProjectInsightsRequest();
33082
+ while (reader.pos < end) {
33083
+ const tag = reader.uint32();
33084
+ switch (tag >>> 3) {
33085
+ case 1: {
33086
+ if (tag !== 10) {
33087
+ break;
33088
+ }
33089
+
33090
+ message.organizationId = reader.string();
33091
+ continue;
33092
+ }
33093
+ case 2: {
33094
+ if (tag !== 18) {
33095
+ break;
33096
+ }
33097
+
33098
+ message.projectId = reader.string();
33099
+ continue;
33100
+ }
33101
+ case 3: {
33102
+ if (tag !== 24) {
33103
+ break;
33104
+ }
33105
+
33106
+ message.limit = reader.int32();
33107
+ continue;
33108
+ }
33109
+ }
33110
+ if ((tag & 7) === 4 || tag === 0) {
33111
+ break;
33112
+ }
33113
+ reader.skip(tag & 7);
33114
+ }
33115
+ return message;
33116
+ } finally {
33117
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
33118
+ }
33119
+ },
33120
+
33121
+ fromJSON(object: any): ListProjectInsightsRequest {
33122
+ return {
33123
+ organizationId: isSet(object.organizationId)
33124
+ ? globalThis.String(object.organizationId)
33125
+ : isSet(object.organization_id)
33126
+ ? globalThis.String(object.organization_id)
33127
+ : "",
33128
+ projectId: isSet(object.projectId)
33129
+ ? globalThis.String(object.projectId)
33130
+ : isSet(object.project_id)
33131
+ ? globalThis.String(object.project_id)
33132
+ : "",
33133
+ limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
33134
+ };
33135
+ },
33136
+
33137
+ toJSON(message: ListProjectInsightsRequest): unknown {
33138
+ const obj: any = {};
33139
+ if (message.organizationId !== "") {
33140
+ obj.organizationId = message.organizationId;
33141
+ }
33142
+ if (message.projectId !== "") {
33143
+ obj.projectId = message.projectId;
33144
+ }
33145
+ if (message.limit !== 0) {
33146
+ obj.limit = Math.round(message.limit);
33147
+ }
33148
+ return obj;
33149
+ },
33150
+
33151
+ create<I extends Exact<DeepPartial<ListProjectInsightsRequest>, I>>(base?: I): ListProjectInsightsRequest {
33152
+ return ListProjectInsightsRequest.fromPartial(base ?? ({} as any));
33153
+ },
33154
+ fromPartial<I extends Exact<DeepPartial<ListProjectInsightsRequest>, I>>(object: I): ListProjectInsightsRequest {
33155
+ const message = createBaseListProjectInsightsRequest();
33156
+ message.organizationId = object.organizationId ?? "";
33157
+ message.projectId = object.projectId ?? "";
33158
+ message.limit = object.limit ?? 0;
33159
+ return message;
33160
+ },
33161
+ };
33162
+
33163
+ function createBaseListProjectInsightsResponse(): ListProjectInsightsResponse {
33164
+ return { status: undefined, availability: 0, current: undefined, previous: undefined };
33165
+ }
33166
+
33167
+ export const ListProjectInsightsResponse: MessageFns<ListProjectInsightsResponse> = {
33168
+ encode(message: ListProjectInsightsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
33169
+ if (message.status !== undefined) {
33170
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
33171
+ }
33172
+ if (message.availability !== 0) {
33173
+ writer.uint32(16).int32(message.availability);
33174
+ }
33175
+ if (message.current !== undefined) {
33176
+ AIProjectInsightRun.encode(message.current, writer.uint32(26).fork()).join();
33177
+ }
33178
+ if (message.previous !== undefined) {
33179
+ AIProjectInsightRun.encode(message.previous, writer.uint32(34).fork()).join();
33180
+ }
33181
+ return writer;
33182
+ },
33183
+
33184
+ decode(input: BinaryReader | Uint8Array, length?: number): ListProjectInsightsResponse {
33185
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
33186
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
33187
+ if (previousRecursionDepth >= 100) {
33188
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
33189
+ }
33190
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
33191
+ try {
33192
+ const end = length === undefined ? reader.len : reader.pos + length;
33193
+ const message = createBaseListProjectInsightsResponse();
33194
+ while (reader.pos < end) {
33195
+ const tag = reader.uint32();
33196
+ switch (tag >>> 3) {
33197
+ case 1: {
33198
+ if (tag !== 10) {
33199
+ break;
33200
+ }
33201
+
33202
+ message.status = ResponseStatus.decode(reader, reader.uint32());
33203
+ continue;
33204
+ }
33205
+ case 2: {
33206
+ if (tag !== 16) {
33207
+ break;
33208
+ }
33209
+
33210
+ message.availability = reader.int32() as any;
33211
+ continue;
33212
+ }
33213
+ case 3: {
33214
+ if (tag !== 26) {
33215
+ break;
33216
+ }
33217
+
33218
+ message.current = AIProjectInsightRun.decode(reader, reader.uint32());
33219
+ continue;
33220
+ }
33221
+ case 4: {
33222
+ if (tag !== 34) {
33223
+ break;
33224
+ }
33225
+
33226
+ message.previous = AIProjectInsightRun.decode(reader, reader.uint32());
33227
+ continue;
33228
+ }
33229
+ }
33230
+ if ((tag & 7) === 4 || tag === 0) {
33231
+ break;
33232
+ }
33233
+ reader.skip(tag & 7);
33234
+ }
33235
+ return message;
33236
+ } finally {
33237
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
33238
+ }
33239
+ },
33240
+
33241
+ fromJSON(object: any): ListProjectInsightsResponse {
33242
+ return {
33243
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
33244
+ availability: isSet(object.availability) ? aIProjectInsightAvailabilityFromJSON(object.availability) : 0,
33245
+ current: isSet(object.current) ? AIProjectInsightRun.fromJSON(object.current) : undefined,
33246
+ previous: isSet(object.previous) ? AIProjectInsightRun.fromJSON(object.previous) : undefined,
33247
+ };
33248
+ },
33249
+
33250
+ toJSON(message: ListProjectInsightsResponse): unknown {
33251
+ const obj: any = {};
33252
+ if (message.status !== undefined) {
33253
+ obj.status = ResponseStatus.toJSON(message.status);
33254
+ }
33255
+ if (message.availability !== 0) {
33256
+ obj.availability = aIProjectInsightAvailabilityToJSON(message.availability);
33257
+ }
33258
+ if (message.current !== undefined) {
33259
+ obj.current = AIProjectInsightRun.toJSON(message.current);
33260
+ }
33261
+ if (message.previous !== undefined) {
33262
+ obj.previous = AIProjectInsightRun.toJSON(message.previous);
33263
+ }
33264
+ return obj;
33265
+ },
33266
+
33267
+ create<I extends Exact<DeepPartial<ListProjectInsightsResponse>, I>>(base?: I): ListProjectInsightsResponse {
33268
+ return ListProjectInsightsResponse.fromPartial(base ?? ({} as any));
33269
+ },
33270
+ fromPartial<I extends Exact<DeepPartial<ListProjectInsightsResponse>, I>>(object: I): ListProjectInsightsResponse {
33271
+ const message = createBaseListProjectInsightsResponse();
33272
+ message.status = (object.status !== undefined && object.status !== null)
33273
+ ? ResponseStatus.fromPartial(object.status)
33274
+ : undefined;
33275
+ message.availability = object.availability ?? 0;
33276
+ message.current = (object.current !== undefined && object.current !== null)
33277
+ ? AIProjectInsightRun.fromPartial(object.current)
33278
+ : undefined;
33279
+ message.previous = (object.previous !== undefined && object.previous !== null)
33280
+ ? AIProjectInsightRun.fromPartial(object.previous)
33281
+ : undefined;
33282
+ return message;
33283
+ },
33284
+ };
33285
+
33286
+ function createBaseAIProjectInsightRun(): AIProjectInsightRun {
33287
+ return {
33288
+ runId: "",
33289
+ availability: 0,
33290
+ localDate: "",
33291
+ timeZone: "",
33292
+ timeZoneSet: false,
33293
+ windowClosed: false,
33294
+ windowStart: undefined,
33295
+ windowEnd: undefined,
33296
+ analyzedAt: undefined,
33297
+ model: "",
33298
+ analysisVersion: "",
33299
+ eligibleSessionCount: 0,
33300
+ unresolvedSessionCount: 0,
33301
+ linkedPersonCount: 0,
33302
+ coverage: undefined,
33303
+ insights: [],
33304
+ totalCount: 0,
33305
+ };
33306
+ }
33307
+
33308
+ export const AIProjectInsightRun: MessageFns<AIProjectInsightRun> = {
33309
+ encode(message: AIProjectInsightRun, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
33310
+ if (message.runId !== "") {
33311
+ writer.uint32(10).string(message.runId);
33312
+ }
33313
+ if (message.availability !== 0) {
33314
+ writer.uint32(16).int32(message.availability);
33315
+ }
33316
+ if (message.localDate !== "") {
33317
+ writer.uint32(26).string(message.localDate);
33318
+ }
33319
+ if (message.timeZone !== "") {
33320
+ writer.uint32(34).string(message.timeZone);
33321
+ }
33322
+ if (message.timeZoneSet !== false) {
33323
+ writer.uint32(40).bool(message.timeZoneSet);
33324
+ }
33325
+ if (message.windowClosed !== false) {
33326
+ writer.uint32(48).bool(message.windowClosed);
33327
+ }
33328
+ if (message.windowStart !== undefined) {
33329
+ Timestamp.encode(toTimestamp(message.windowStart), writer.uint32(58).fork()).join();
33330
+ }
33331
+ if (message.windowEnd !== undefined) {
33332
+ Timestamp.encode(toTimestamp(message.windowEnd), writer.uint32(66).fork()).join();
33333
+ }
33334
+ if (message.analyzedAt !== undefined) {
33335
+ Timestamp.encode(toTimestamp(message.analyzedAt), writer.uint32(74).fork()).join();
33336
+ }
33337
+ if (message.model !== "") {
33338
+ writer.uint32(82).string(message.model);
33339
+ }
33340
+ if (message.analysisVersion !== "") {
33341
+ writer.uint32(90).string(message.analysisVersion);
33342
+ }
33343
+ if (message.eligibleSessionCount !== 0) {
33344
+ writer.uint32(96).uint32(message.eligibleSessionCount);
33345
+ }
33346
+ if (message.unresolvedSessionCount !== 0) {
33347
+ writer.uint32(104).uint32(message.unresolvedSessionCount);
33348
+ }
33349
+ if (message.linkedPersonCount !== 0) {
33350
+ writer.uint32(112).uint32(message.linkedPersonCount);
33351
+ }
33352
+ if (message.coverage !== undefined) {
33353
+ AIProjectInsightCoverage.encode(message.coverage, writer.uint32(122).fork()).join();
33354
+ }
33355
+ for (const v of message.insights) {
33356
+ AIProjectInsight.encode(v!, writer.uint32(130).fork()).join();
33357
+ }
33358
+ if (message.totalCount !== 0) {
33359
+ writer.uint32(136).uint32(message.totalCount);
33360
+ }
33361
+ return writer;
33362
+ },
33363
+
33364
+ decode(input: BinaryReader | Uint8Array, length?: number): AIProjectInsightRun {
33365
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
33366
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
33367
+ if (previousRecursionDepth >= 100) {
33368
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
33369
+ }
33370
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
33371
+ try {
33372
+ const end = length === undefined ? reader.len : reader.pos + length;
33373
+ const message = createBaseAIProjectInsightRun();
33374
+ while (reader.pos < end) {
33375
+ const tag = reader.uint32();
33376
+ switch (tag >>> 3) {
33377
+ case 1: {
33378
+ if (tag !== 10) {
33379
+ break;
33380
+ }
33381
+
33382
+ message.runId = reader.string();
33383
+ continue;
33384
+ }
33385
+ case 2: {
33386
+ if (tag !== 16) {
33387
+ break;
33388
+ }
33389
+
33390
+ message.availability = reader.int32() as any;
33391
+ continue;
33392
+ }
33393
+ case 3: {
33394
+ if (tag !== 26) {
33395
+ break;
33396
+ }
33397
+
33398
+ message.localDate = reader.string();
33399
+ continue;
33400
+ }
33401
+ case 4: {
33402
+ if (tag !== 34) {
33403
+ break;
33404
+ }
33405
+
33406
+ message.timeZone = reader.string();
33407
+ continue;
33408
+ }
33409
+ case 5: {
33410
+ if (tag !== 40) {
33411
+ break;
33412
+ }
33413
+
33414
+ message.timeZoneSet = reader.bool();
33415
+ continue;
33416
+ }
33417
+ case 6: {
33418
+ if (tag !== 48) {
33419
+ break;
33420
+ }
33421
+
33422
+ message.windowClosed = reader.bool();
33423
+ continue;
33424
+ }
33425
+ case 7: {
33426
+ if (tag !== 58) {
33427
+ break;
33428
+ }
33429
+
33430
+ message.windowStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
33431
+ continue;
33432
+ }
33433
+ case 8: {
33434
+ if (tag !== 66) {
33435
+ break;
33436
+ }
33437
+
33438
+ message.windowEnd = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
33439
+ continue;
33440
+ }
33441
+ case 9: {
33442
+ if (tag !== 74) {
33443
+ break;
33444
+ }
33445
+
33446
+ message.analyzedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
33447
+ continue;
33448
+ }
33449
+ case 10: {
33450
+ if (tag !== 82) {
33451
+ break;
33452
+ }
33453
+
33454
+ message.model = reader.string();
33455
+ continue;
33456
+ }
33457
+ case 11: {
33458
+ if (tag !== 90) {
33459
+ break;
33460
+ }
33461
+
33462
+ message.analysisVersion = reader.string();
33463
+ continue;
33464
+ }
33465
+ case 12: {
33466
+ if (tag !== 96) {
33467
+ break;
33468
+ }
33469
+
33470
+ message.eligibleSessionCount = reader.uint32();
33471
+ continue;
33472
+ }
33473
+ case 13: {
33474
+ if (tag !== 104) {
33475
+ break;
33476
+ }
33477
+
33478
+ message.unresolvedSessionCount = reader.uint32();
33479
+ continue;
33480
+ }
33481
+ case 14: {
33482
+ if (tag !== 112) {
33483
+ break;
33484
+ }
33485
+
33486
+ message.linkedPersonCount = reader.uint32();
33487
+ continue;
33488
+ }
33489
+ case 15: {
33490
+ if (tag !== 122) {
33491
+ break;
33492
+ }
33493
+
33494
+ message.coverage = AIProjectInsightCoverage.decode(reader, reader.uint32());
33495
+ continue;
33496
+ }
33497
+ case 16: {
33498
+ if (tag !== 130) {
33499
+ break;
33500
+ }
33501
+
33502
+ message.insights.push(AIProjectInsight.decode(reader, reader.uint32()));
33503
+ continue;
33504
+ }
33505
+ case 17: {
33506
+ if (tag !== 136) {
33507
+ break;
33508
+ }
33509
+
33510
+ message.totalCount = reader.uint32();
33511
+ continue;
33512
+ }
33513
+ }
33514
+ if ((tag & 7) === 4 || tag === 0) {
33515
+ break;
33516
+ }
33517
+ reader.skip(tag & 7);
33518
+ }
33519
+ return message;
33520
+ } finally {
33521
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
33522
+ }
33523
+ },
33524
+
33525
+ fromJSON(object: any): AIProjectInsightRun {
33526
+ return {
33527
+ runId: isSet(object.runId)
33528
+ ? globalThis.String(object.runId)
33529
+ : isSet(object.run_id)
33530
+ ? globalThis.String(object.run_id)
33531
+ : "",
33532
+ availability: isSet(object.availability) ? aIProjectInsightAvailabilityFromJSON(object.availability) : 0,
33533
+ localDate: isSet(object.localDate)
33534
+ ? globalThis.String(object.localDate)
33535
+ : isSet(object.local_date)
33536
+ ? globalThis.String(object.local_date)
33537
+ : "",
33538
+ timeZone: isSet(object.timeZone)
33539
+ ? globalThis.String(object.timeZone)
33540
+ : isSet(object.time_zone)
33541
+ ? globalThis.String(object.time_zone)
33542
+ : "",
33543
+ timeZoneSet: isSet(object.timeZoneSet)
33544
+ ? globalThis.Boolean(object.timeZoneSet)
33545
+ : isSet(object.time_zone_set)
33546
+ ? globalThis.Boolean(object.time_zone_set)
33547
+ : false,
33548
+ windowClosed: isSet(object.windowClosed)
33549
+ ? globalThis.Boolean(object.windowClosed)
33550
+ : isSet(object.window_closed)
33551
+ ? globalThis.Boolean(object.window_closed)
33552
+ : false,
33553
+ windowStart: isSet(object.windowStart)
33554
+ ? fromJsonTimestamp(object.windowStart)
33555
+ : isSet(object.window_start)
33556
+ ? fromJsonTimestamp(object.window_start)
33557
+ : undefined,
33558
+ windowEnd: isSet(object.windowEnd)
33559
+ ? fromJsonTimestamp(object.windowEnd)
33560
+ : isSet(object.window_end)
33561
+ ? fromJsonTimestamp(object.window_end)
33562
+ : undefined,
33563
+ analyzedAt: isSet(object.analyzedAt)
33564
+ ? fromJsonTimestamp(object.analyzedAt)
33565
+ : isSet(object.analyzed_at)
33566
+ ? fromJsonTimestamp(object.analyzed_at)
33567
+ : undefined,
33568
+ model: isSet(object.model) ? globalThis.String(object.model) : "",
33569
+ analysisVersion: isSet(object.analysisVersion)
33570
+ ? globalThis.String(object.analysisVersion)
33571
+ : isSet(object.analysis_version)
33572
+ ? globalThis.String(object.analysis_version)
33573
+ : "",
33574
+ eligibleSessionCount: isSet(object.eligibleSessionCount)
33575
+ ? globalThis.Number(object.eligibleSessionCount)
33576
+ : isSet(object.eligible_session_count)
33577
+ ? globalThis.Number(object.eligible_session_count)
33578
+ : 0,
33579
+ unresolvedSessionCount: isSet(object.unresolvedSessionCount)
33580
+ ? globalThis.Number(object.unresolvedSessionCount)
33581
+ : isSet(object.unresolved_session_count)
33582
+ ? globalThis.Number(object.unresolved_session_count)
33583
+ : 0,
33584
+ linkedPersonCount: isSet(object.linkedPersonCount)
33585
+ ? globalThis.Number(object.linkedPersonCount)
33586
+ : isSet(object.linked_person_count)
33587
+ ? globalThis.Number(object.linked_person_count)
33588
+ : 0,
33589
+ coverage: isSet(object.coverage) ? AIProjectInsightCoverage.fromJSON(object.coverage) : undefined,
33590
+ insights: globalThis.Array.isArray(object?.insights)
33591
+ ? object.insights.map((e: any) => AIProjectInsight.fromJSON(e))
33592
+ : [],
33593
+ totalCount: isSet(object.totalCount)
33594
+ ? globalThis.Number(object.totalCount)
33595
+ : isSet(object.total_count)
33596
+ ? globalThis.Number(object.total_count)
33597
+ : 0,
33598
+ };
33599
+ },
33600
+
33601
+ toJSON(message: AIProjectInsightRun): unknown {
33602
+ const obj: any = {};
33603
+ if (message.runId !== "") {
33604
+ obj.runId = message.runId;
33605
+ }
33606
+ if (message.availability !== 0) {
33607
+ obj.availability = aIProjectInsightAvailabilityToJSON(message.availability);
33608
+ }
33609
+ if (message.localDate !== "") {
33610
+ obj.localDate = message.localDate;
33611
+ }
33612
+ if (message.timeZone !== "") {
33613
+ obj.timeZone = message.timeZone;
33614
+ }
33615
+ if (message.timeZoneSet !== false) {
33616
+ obj.timeZoneSet = message.timeZoneSet;
33617
+ }
33618
+ if (message.windowClosed !== false) {
33619
+ obj.windowClosed = message.windowClosed;
33620
+ }
33621
+ if (message.windowStart !== undefined) {
33622
+ obj.windowStart = message.windowStart.toISOString();
33623
+ }
33624
+ if (message.windowEnd !== undefined) {
33625
+ obj.windowEnd = message.windowEnd.toISOString();
33626
+ }
33627
+ if (message.analyzedAt !== undefined) {
33628
+ obj.analyzedAt = message.analyzedAt.toISOString();
33629
+ }
33630
+ if (message.model !== "") {
33631
+ obj.model = message.model;
33632
+ }
33633
+ if (message.analysisVersion !== "") {
33634
+ obj.analysisVersion = message.analysisVersion;
33635
+ }
33636
+ if (message.eligibleSessionCount !== 0) {
33637
+ obj.eligibleSessionCount = Math.round(message.eligibleSessionCount);
33638
+ }
33639
+ if (message.unresolvedSessionCount !== 0) {
33640
+ obj.unresolvedSessionCount = Math.round(message.unresolvedSessionCount);
33641
+ }
33642
+ if (message.linkedPersonCount !== 0) {
33643
+ obj.linkedPersonCount = Math.round(message.linkedPersonCount);
33644
+ }
33645
+ if (message.coverage !== undefined) {
33646
+ obj.coverage = AIProjectInsightCoverage.toJSON(message.coverage);
33647
+ }
33648
+ if (message.insights?.length) {
33649
+ obj.insights = message.insights.map((e) => AIProjectInsight.toJSON(e));
33650
+ }
33651
+ if (message.totalCount !== 0) {
33652
+ obj.totalCount = Math.round(message.totalCount);
33653
+ }
33654
+ return obj;
33655
+ },
33656
+
33657
+ create<I extends Exact<DeepPartial<AIProjectInsightRun>, I>>(base?: I): AIProjectInsightRun {
33658
+ return AIProjectInsightRun.fromPartial(base ?? ({} as any));
33659
+ },
33660
+ fromPartial<I extends Exact<DeepPartial<AIProjectInsightRun>, I>>(object: I): AIProjectInsightRun {
33661
+ const message = createBaseAIProjectInsightRun();
33662
+ message.runId = object.runId ?? "";
33663
+ message.availability = object.availability ?? 0;
33664
+ message.localDate = object.localDate ?? "";
33665
+ message.timeZone = object.timeZone ?? "";
33666
+ message.timeZoneSet = object.timeZoneSet ?? false;
33667
+ message.windowClosed = object.windowClosed ?? false;
33668
+ message.windowStart = object.windowStart ?? undefined;
33669
+ message.windowEnd = object.windowEnd ?? undefined;
33670
+ message.analyzedAt = object.analyzedAt ?? undefined;
33671
+ message.model = object.model ?? "";
33672
+ message.analysisVersion = object.analysisVersion ?? "";
33673
+ message.eligibleSessionCount = object.eligibleSessionCount ?? 0;
33674
+ message.unresolvedSessionCount = object.unresolvedSessionCount ?? 0;
33675
+ message.linkedPersonCount = object.linkedPersonCount ?? 0;
33676
+ message.coverage = (object.coverage !== undefined && object.coverage !== null)
33677
+ ? AIProjectInsightCoverage.fromPartial(object.coverage)
33678
+ : undefined;
33679
+ message.insights = object.insights?.map((e) => AIProjectInsight.fromPartial(e)) || [];
33680
+ message.totalCount = object.totalCount ?? 0;
33681
+ return message;
33682
+ },
33683
+ };
33684
+
33685
+ function createBaseAIProjectInsightCoverage(): AIProjectInsightCoverage {
33686
+ return {
33687
+ status: 0,
33688
+ stopReason: 0,
33689
+ overviewSessionCount: 0,
33690
+ evidenceSessionCount: 0,
33691
+ evidencePersonCount: 0,
33692
+ withheldEvidenceCount: 0,
33693
+ truncatedEvidenceCount: 0,
33694
+ };
33695
+ }
33696
+
33697
+ export const AIProjectInsightCoverage: MessageFns<AIProjectInsightCoverage> = {
33698
+ encode(message: AIProjectInsightCoverage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
33699
+ if (message.status !== 0) {
33700
+ writer.uint32(8).int32(message.status);
33701
+ }
33702
+ if (message.stopReason !== 0) {
33703
+ writer.uint32(16).int32(message.stopReason);
33704
+ }
33705
+ if (message.overviewSessionCount !== 0) {
33706
+ writer.uint32(24).uint32(message.overviewSessionCount);
33707
+ }
33708
+ if (message.evidenceSessionCount !== 0) {
33709
+ writer.uint32(32).uint32(message.evidenceSessionCount);
33710
+ }
33711
+ if (message.evidencePersonCount !== 0) {
33712
+ writer.uint32(40).uint32(message.evidencePersonCount);
33713
+ }
33714
+ if (message.withheldEvidenceCount !== 0) {
33715
+ writer.uint32(48).uint32(message.withheldEvidenceCount);
33716
+ }
33717
+ if (message.truncatedEvidenceCount !== 0) {
33718
+ writer.uint32(56).uint32(message.truncatedEvidenceCount);
33719
+ }
33720
+ return writer;
33721
+ },
33722
+
33723
+ decode(input: BinaryReader | Uint8Array, length?: number): AIProjectInsightCoverage {
33724
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
33725
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
33726
+ if (previousRecursionDepth >= 100) {
33727
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
33728
+ }
33729
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
33730
+ try {
33731
+ const end = length === undefined ? reader.len : reader.pos + length;
33732
+ const message = createBaseAIProjectInsightCoverage();
33733
+ while (reader.pos < end) {
33734
+ const tag = reader.uint32();
33735
+ switch (tag >>> 3) {
33736
+ case 1: {
33737
+ if (tag !== 8) {
33738
+ break;
33739
+ }
33740
+
33741
+ message.status = reader.int32() as any;
33742
+ continue;
33743
+ }
33744
+ case 2: {
33745
+ if (tag !== 16) {
33746
+ break;
33747
+ }
33748
+
33749
+ message.stopReason = reader.int32() as any;
33750
+ continue;
33751
+ }
33752
+ case 3: {
33753
+ if (tag !== 24) {
33754
+ break;
33755
+ }
33756
+
33757
+ message.overviewSessionCount = reader.uint32();
33758
+ continue;
33759
+ }
33760
+ case 4: {
33761
+ if (tag !== 32) {
33762
+ break;
33763
+ }
33764
+
33765
+ message.evidenceSessionCount = reader.uint32();
33766
+ continue;
33767
+ }
33768
+ case 5: {
33769
+ if (tag !== 40) {
33770
+ break;
33771
+ }
33772
+
33773
+ message.evidencePersonCount = reader.uint32();
33774
+ continue;
33775
+ }
33776
+ case 6: {
33777
+ if (tag !== 48) {
33778
+ break;
33779
+ }
33780
+
33781
+ message.withheldEvidenceCount = reader.uint32();
33782
+ continue;
33783
+ }
33784
+ case 7: {
33785
+ if (tag !== 56) {
33786
+ break;
33787
+ }
33788
+
33789
+ message.truncatedEvidenceCount = reader.uint32();
33790
+ continue;
33791
+ }
33792
+ }
33793
+ if ((tag & 7) === 4 || tag === 0) {
33794
+ break;
33795
+ }
33796
+ reader.skip(tag & 7);
33797
+ }
33798
+ return message;
33799
+ } finally {
33800
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
33801
+ }
33802
+ },
33803
+
33804
+ fromJSON(object: any): AIProjectInsightCoverage {
33805
+ return {
33806
+ status: isSet(object.status) ? aIProjectInsightCoverageStatusFromJSON(object.status) : 0,
33807
+ stopReason: isSet(object.stopReason)
33808
+ ? aIProjectInsightStopReasonFromJSON(object.stopReason)
33809
+ : isSet(object.stop_reason)
33810
+ ? aIProjectInsightStopReasonFromJSON(object.stop_reason)
33811
+ : 0,
33812
+ overviewSessionCount: isSet(object.overviewSessionCount)
33813
+ ? globalThis.Number(object.overviewSessionCount)
33814
+ : isSet(object.overview_session_count)
33815
+ ? globalThis.Number(object.overview_session_count)
33816
+ : 0,
33817
+ evidenceSessionCount: isSet(object.evidenceSessionCount)
33818
+ ? globalThis.Number(object.evidenceSessionCount)
33819
+ : isSet(object.evidence_session_count)
33820
+ ? globalThis.Number(object.evidence_session_count)
33821
+ : 0,
33822
+ evidencePersonCount: isSet(object.evidencePersonCount)
33823
+ ? globalThis.Number(object.evidencePersonCount)
33824
+ : isSet(object.evidence_person_count)
33825
+ ? globalThis.Number(object.evidence_person_count)
33826
+ : 0,
33827
+ withheldEvidenceCount: isSet(object.withheldEvidenceCount)
33828
+ ? globalThis.Number(object.withheldEvidenceCount)
33829
+ : isSet(object.withheld_evidence_count)
33830
+ ? globalThis.Number(object.withheld_evidence_count)
33831
+ : 0,
33832
+ truncatedEvidenceCount: isSet(object.truncatedEvidenceCount)
33833
+ ? globalThis.Number(object.truncatedEvidenceCount)
33834
+ : isSet(object.truncated_evidence_count)
33835
+ ? globalThis.Number(object.truncated_evidence_count)
33836
+ : 0,
33837
+ };
33838
+ },
33839
+
33840
+ toJSON(message: AIProjectInsightCoverage): unknown {
33841
+ const obj: any = {};
33842
+ if (message.status !== 0) {
33843
+ obj.status = aIProjectInsightCoverageStatusToJSON(message.status);
33844
+ }
33845
+ if (message.stopReason !== 0) {
33846
+ obj.stopReason = aIProjectInsightStopReasonToJSON(message.stopReason);
33847
+ }
33848
+ if (message.overviewSessionCount !== 0) {
33849
+ obj.overviewSessionCount = Math.round(message.overviewSessionCount);
33850
+ }
33851
+ if (message.evidenceSessionCount !== 0) {
33852
+ obj.evidenceSessionCount = Math.round(message.evidenceSessionCount);
33853
+ }
33854
+ if (message.evidencePersonCount !== 0) {
33855
+ obj.evidencePersonCount = Math.round(message.evidencePersonCount);
33856
+ }
33857
+ if (message.withheldEvidenceCount !== 0) {
33858
+ obj.withheldEvidenceCount = Math.round(message.withheldEvidenceCount);
33859
+ }
33860
+ if (message.truncatedEvidenceCount !== 0) {
33861
+ obj.truncatedEvidenceCount = Math.round(message.truncatedEvidenceCount);
33862
+ }
33863
+ return obj;
33864
+ },
33865
+
33866
+ create<I extends Exact<DeepPartial<AIProjectInsightCoverage>, I>>(base?: I): AIProjectInsightCoverage {
33867
+ return AIProjectInsightCoverage.fromPartial(base ?? ({} as any));
33868
+ },
33869
+ fromPartial<I extends Exact<DeepPartial<AIProjectInsightCoverage>, I>>(object: I): AIProjectInsightCoverage {
33870
+ const message = createBaseAIProjectInsightCoverage();
33871
+ message.status = object.status ?? 0;
33872
+ message.stopReason = object.stopReason ?? 0;
33873
+ message.overviewSessionCount = object.overviewSessionCount ?? 0;
33874
+ message.evidenceSessionCount = object.evidenceSessionCount ?? 0;
33875
+ message.evidencePersonCount = object.evidencePersonCount ?? 0;
33876
+ message.withheldEvidenceCount = object.withheldEvidenceCount ?? 0;
33877
+ message.truncatedEvidenceCount = object.truncatedEvidenceCount ?? 0;
33878
+ return message;
33879
+ },
33880
+ };
33881
+
33882
+ function createBaseAIProjectInsight(): AIProjectInsight {
33883
+ return {
33884
+ id: "",
33885
+ rank: 0,
33886
+ kind: 0,
33887
+ title: "",
33888
+ pattern: "",
33889
+ explanation: "",
33890
+ action: "",
33891
+ limitations: "",
33892
+ sessionCount: 0,
33893
+ personCount: 0,
33894
+ spendUsd: undefined,
33895
+ citations: [],
33896
+ };
33897
+ }
33898
+
33899
+ export const AIProjectInsight: MessageFns<AIProjectInsight> = {
33900
+ encode(message: AIProjectInsight, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
33901
+ if (message.id !== "") {
33902
+ writer.uint32(10).string(message.id);
33903
+ }
33904
+ if (message.rank !== 0) {
33905
+ writer.uint32(16).uint32(message.rank);
33906
+ }
33907
+ if (message.kind !== 0) {
33908
+ writer.uint32(24).int32(message.kind);
33909
+ }
33910
+ if (message.title !== "") {
33911
+ writer.uint32(34).string(message.title);
33912
+ }
33913
+ if (message.pattern !== "") {
33914
+ writer.uint32(42).string(message.pattern);
33915
+ }
33916
+ if (message.explanation !== "") {
33917
+ writer.uint32(50).string(message.explanation);
33918
+ }
33919
+ if (message.action !== "") {
33920
+ writer.uint32(58).string(message.action);
33921
+ }
33922
+ if (message.limitations !== "") {
33923
+ writer.uint32(66).string(message.limitations);
33924
+ }
33925
+ if (message.sessionCount !== 0) {
33926
+ writer.uint32(72).uint32(message.sessionCount);
33927
+ }
33928
+ if (message.personCount !== 0) {
33929
+ writer.uint32(80).uint32(message.personCount);
33930
+ }
33931
+ if (message.spendUsd !== undefined) {
33932
+ writer.uint32(90).string(message.spendUsd);
33933
+ }
33934
+ for (const v of message.citations) {
33935
+ AIProjectInsightCitation.encode(v!, writer.uint32(98).fork()).join();
33936
+ }
33937
+ return writer;
33938
+ },
33939
+
33940
+ decode(input: BinaryReader | Uint8Array, length?: number): AIProjectInsight {
33941
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
33942
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
33943
+ if (previousRecursionDepth >= 100) {
33944
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
33945
+ }
33946
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
33947
+ try {
33948
+ const end = length === undefined ? reader.len : reader.pos + length;
33949
+ const message = createBaseAIProjectInsight();
33950
+ while (reader.pos < end) {
33951
+ const tag = reader.uint32();
33952
+ switch (tag >>> 3) {
33953
+ case 1: {
33954
+ if (tag !== 10) {
33955
+ break;
33956
+ }
33957
+
33958
+ message.id = reader.string();
33959
+ continue;
33960
+ }
33961
+ case 2: {
33962
+ if (tag !== 16) {
33963
+ break;
33964
+ }
33965
+
33966
+ message.rank = reader.uint32();
33967
+ continue;
33968
+ }
33969
+ case 3: {
33970
+ if (tag !== 24) {
33971
+ break;
33972
+ }
33973
+
33974
+ message.kind = reader.int32() as any;
33975
+ continue;
33976
+ }
33977
+ case 4: {
33978
+ if (tag !== 34) {
33979
+ break;
33980
+ }
33981
+
33982
+ message.title = reader.string();
33983
+ continue;
33984
+ }
33985
+ case 5: {
33986
+ if (tag !== 42) {
33987
+ break;
33988
+ }
33989
+
33990
+ message.pattern = reader.string();
33991
+ continue;
33992
+ }
33993
+ case 6: {
33994
+ if (tag !== 50) {
33995
+ break;
33996
+ }
33997
+
33998
+ message.explanation = reader.string();
33999
+ continue;
34000
+ }
34001
+ case 7: {
34002
+ if (tag !== 58) {
34003
+ break;
34004
+ }
34005
+
34006
+ message.action = reader.string();
34007
+ continue;
34008
+ }
34009
+ case 8: {
34010
+ if (tag !== 66) {
34011
+ break;
34012
+ }
34013
+
34014
+ message.limitations = reader.string();
34015
+ continue;
34016
+ }
34017
+ case 9: {
34018
+ if (tag !== 72) {
34019
+ break;
34020
+ }
34021
+
34022
+ message.sessionCount = reader.uint32();
34023
+ continue;
34024
+ }
34025
+ case 10: {
34026
+ if (tag !== 80) {
34027
+ break;
34028
+ }
34029
+
34030
+ message.personCount = reader.uint32();
34031
+ continue;
34032
+ }
34033
+ case 11: {
34034
+ if (tag !== 90) {
34035
+ break;
34036
+ }
34037
+
34038
+ message.spendUsd = reader.string();
34039
+ continue;
34040
+ }
34041
+ case 12: {
34042
+ if (tag !== 98) {
34043
+ break;
34044
+ }
34045
+
34046
+ message.citations.push(AIProjectInsightCitation.decode(reader, reader.uint32()));
34047
+ continue;
34048
+ }
34049
+ }
34050
+ if ((tag & 7) === 4 || tag === 0) {
34051
+ break;
34052
+ }
34053
+ reader.skip(tag & 7);
34054
+ }
34055
+ return message;
34056
+ } finally {
34057
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
34058
+ }
34059
+ },
34060
+
34061
+ fromJSON(object: any): AIProjectInsight {
34062
+ return {
34063
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
34064
+ rank: isSet(object.rank) ? globalThis.Number(object.rank) : 0,
34065
+ kind: isSet(object.kind) ? aIProjectInsightKindFromJSON(object.kind) : 0,
34066
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
34067
+ pattern: isSet(object.pattern) ? globalThis.String(object.pattern) : "",
34068
+ explanation: isSet(object.explanation) ? globalThis.String(object.explanation) : "",
34069
+ action: isSet(object.action) ? globalThis.String(object.action) : "",
34070
+ limitations: isSet(object.limitations) ? globalThis.String(object.limitations) : "",
34071
+ sessionCount: isSet(object.sessionCount)
34072
+ ? globalThis.Number(object.sessionCount)
34073
+ : isSet(object.session_count)
34074
+ ? globalThis.Number(object.session_count)
34075
+ : 0,
34076
+ personCount: isSet(object.personCount)
34077
+ ? globalThis.Number(object.personCount)
34078
+ : isSet(object.person_count)
34079
+ ? globalThis.Number(object.person_count)
34080
+ : 0,
34081
+ spendUsd: isSet(object.spendUsd)
34082
+ ? globalThis.String(object.spendUsd)
34083
+ : isSet(object.spend_usd)
34084
+ ? globalThis.String(object.spend_usd)
34085
+ : undefined,
34086
+ citations: globalThis.Array.isArray(object?.citations)
34087
+ ? object.citations.map((e: any) => AIProjectInsightCitation.fromJSON(e))
34088
+ : [],
34089
+ };
34090
+ },
34091
+
34092
+ toJSON(message: AIProjectInsight): unknown {
34093
+ const obj: any = {};
34094
+ if (message.id !== "") {
34095
+ obj.id = message.id;
34096
+ }
34097
+ if (message.rank !== 0) {
34098
+ obj.rank = Math.round(message.rank);
34099
+ }
34100
+ if (message.kind !== 0) {
34101
+ obj.kind = aIProjectInsightKindToJSON(message.kind);
34102
+ }
34103
+ if (message.title !== "") {
34104
+ obj.title = message.title;
34105
+ }
34106
+ if (message.pattern !== "") {
34107
+ obj.pattern = message.pattern;
34108
+ }
34109
+ if (message.explanation !== "") {
34110
+ obj.explanation = message.explanation;
34111
+ }
34112
+ if (message.action !== "") {
34113
+ obj.action = message.action;
34114
+ }
34115
+ if (message.limitations !== "") {
34116
+ obj.limitations = message.limitations;
34117
+ }
34118
+ if (message.sessionCount !== 0) {
34119
+ obj.sessionCount = Math.round(message.sessionCount);
34120
+ }
34121
+ if (message.personCount !== 0) {
34122
+ obj.personCount = Math.round(message.personCount);
34123
+ }
34124
+ if (message.spendUsd !== undefined) {
34125
+ obj.spendUsd = message.spendUsd;
34126
+ }
34127
+ if (message.citations?.length) {
34128
+ obj.citations = message.citations.map((e) => AIProjectInsightCitation.toJSON(e));
34129
+ }
34130
+ return obj;
34131
+ },
34132
+
34133
+ create<I extends Exact<DeepPartial<AIProjectInsight>, I>>(base?: I): AIProjectInsight {
34134
+ return AIProjectInsight.fromPartial(base ?? ({} as any));
34135
+ },
34136
+ fromPartial<I extends Exact<DeepPartial<AIProjectInsight>, I>>(object: I): AIProjectInsight {
34137
+ const message = createBaseAIProjectInsight();
34138
+ message.id = object.id ?? "";
34139
+ message.rank = object.rank ?? 0;
34140
+ message.kind = object.kind ?? 0;
34141
+ message.title = object.title ?? "";
34142
+ message.pattern = object.pattern ?? "";
34143
+ message.explanation = object.explanation ?? "";
34144
+ message.action = object.action ?? "";
34145
+ message.limitations = object.limitations ?? "";
34146
+ message.sessionCount = object.sessionCount ?? 0;
34147
+ message.personCount = object.personCount ?? 0;
34148
+ message.spendUsd = object.spendUsd ?? undefined;
34149
+ message.citations = object.citations?.map((e) => AIProjectInsightCitation.fromPartial(e)) || [];
34150
+ return message;
34151
+ },
34152
+ };
34153
+
34154
+ function createBaseAIProjectInsightCitation(): AIProjectInsightCitation {
34155
+ return { sourceSystem: "", sessionId: "", eventRef: undefined };
34156
+ }
34157
+
34158
+ export const AIProjectInsightCitation: MessageFns<AIProjectInsightCitation> = {
34159
+ encode(message: AIProjectInsightCitation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
34160
+ if (message.sourceSystem !== "") {
34161
+ writer.uint32(10).string(message.sourceSystem);
34162
+ }
34163
+ if (message.sessionId !== "") {
34164
+ writer.uint32(18).string(message.sessionId);
34165
+ }
34166
+ if (message.eventRef !== undefined) {
34167
+ AISessionEventRef.encode(message.eventRef, writer.uint32(26).fork()).join();
34168
+ }
34169
+ return writer;
34170
+ },
34171
+
34172
+ decode(input: BinaryReader | Uint8Array, length?: number): AIProjectInsightCitation {
34173
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
34174
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
34175
+ if (previousRecursionDepth >= 100) {
34176
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
34177
+ }
34178
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
34179
+ try {
34180
+ const end = length === undefined ? reader.len : reader.pos + length;
34181
+ const message = createBaseAIProjectInsightCitation();
34182
+ while (reader.pos < end) {
34183
+ const tag = reader.uint32();
34184
+ switch (tag >>> 3) {
34185
+ case 1: {
34186
+ if (tag !== 10) {
34187
+ break;
34188
+ }
34189
+
34190
+ message.sourceSystem = reader.string();
34191
+ continue;
34192
+ }
34193
+ case 2: {
34194
+ if (tag !== 18) {
34195
+ break;
34196
+ }
34197
+
34198
+ message.sessionId = reader.string();
34199
+ continue;
34200
+ }
34201
+ case 3: {
34202
+ if (tag !== 26) {
34203
+ break;
34204
+ }
34205
+
34206
+ message.eventRef = AISessionEventRef.decode(reader, reader.uint32());
34207
+ continue;
34208
+ }
34209
+ }
34210
+ if ((tag & 7) === 4 || tag === 0) {
34211
+ break;
34212
+ }
34213
+ reader.skip(tag & 7);
34214
+ }
34215
+ return message;
34216
+ } finally {
34217
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
34218
+ }
34219
+ },
34220
+
34221
+ fromJSON(object: any): AIProjectInsightCitation {
34222
+ return {
34223
+ sourceSystem: isSet(object.sourceSystem)
34224
+ ? globalThis.String(object.sourceSystem)
34225
+ : isSet(object.source_system)
34226
+ ? globalThis.String(object.source_system)
34227
+ : "",
34228
+ sessionId: isSet(object.sessionId)
34229
+ ? globalThis.String(object.sessionId)
34230
+ : isSet(object.session_id)
34231
+ ? globalThis.String(object.session_id)
34232
+ : "",
34233
+ eventRef: isSet(object.eventRef)
34234
+ ? AISessionEventRef.fromJSON(object.eventRef)
34235
+ : isSet(object.event_ref)
34236
+ ? AISessionEventRef.fromJSON(object.event_ref)
34237
+ : undefined,
34238
+ };
34239
+ },
34240
+
34241
+ toJSON(message: AIProjectInsightCitation): unknown {
34242
+ const obj: any = {};
34243
+ if (message.sourceSystem !== "") {
34244
+ obj.sourceSystem = message.sourceSystem;
34245
+ }
34246
+ if (message.sessionId !== "") {
34247
+ obj.sessionId = message.sessionId;
34248
+ }
34249
+ if (message.eventRef !== undefined) {
34250
+ obj.eventRef = AISessionEventRef.toJSON(message.eventRef);
34251
+ }
34252
+ return obj;
34253
+ },
34254
+
34255
+ create<I extends Exact<DeepPartial<AIProjectInsightCitation>, I>>(base?: I): AIProjectInsightCitation {
34256
+ return AIProjectInsightCitation.fromPartial(base ?? ({} as any));
34257
+ },
34258
+ fromPartial<I extends Exact<DeepPartial<AIProjectInsightCitation>, I>>(object: I): AIProjectInsightCitation {
34259
+ const message = createBaseAIProjectInsightCitation();
34260
+ message.sourceSystem = object.sourceSystem ?? "";
34261
+ message.sessionId = object.sessionId ?? "";
34262
+ message.eventRef = (object.eventRef !== undefined && object.eventRef !== null)
34263
+ ? AISessionEventRef.fromPartial(object.eventRef)
34264
+ : undefined;
34265
+ return message;
34266
+ },
34267
+ };
34268
+
34269
+ /**
34270
+ * AIGatewayService is the frontend-facing proxy over telemetry.api.v1.AIService.
34271
+ * It stamps the authorized organization/project and forwards telemetry-api-shaped messages.
34272
+ */
34273
+ export interface AIGatewayService {
34274
+ /**
34275
+ * One numbered page of the conversation catalog (sessions folded to
34276
+ * one rollup by source_system + session_id), ranked by sort. Weakly consistent
34277
+ * (latest-state, no frozen snapshot).
34278
+ */
34279
+ ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse>;
34280
+ /**
34281
+ * Keeps the first conversation page live: the whole top-N page re-derived each tick
34282
+ * as one SessionsSnapshot, replacing client state wholesale (not a delta feed).
34283
+ */
34284
+ StreamSessions(request: StreamSessionsRequest, metadata?: Metadata): Observable<SessionsSnapshot>;
34285
+ /** Live sidebar rollup (session_id + source_system): re-derived and re-emitted whole each tick. */
34286
+ StreamSessionSummary(request: GetSessionSummaryRequest, metadata?: Metadata): Observable<AISessionSummary>;
34287
+ ListSessionEvents(request: ListSessionEventsRequest, metadata?: Metadata): Promise<ListSessionEventsResponse>;
34288
+ StreamSessionEvents(request: StreamSessionEventsRequest, metadata?: Metadata): Observable<AISessionEventEnvelope>;
34289
+ /**
34290
+ * Live, backend-computed, per-event token series for one session (replacement snapshots):
34291
+ * one content-free point per logical event + whole-session totals; point count is capped.
34292
+ */
34293
+ StreamSessionTokenTimeline(
34294
+ request: SessionTokenTimelineRequest,
34295
+ metadata?: Metadata,
34296
+ ): Observable<SessionTokenTimeline>;
34297
+ /** Live "Files changed" card: per file the latest-observed git change-type + exact --numstat churn. */
34298
+ StreamSessionFileChanges(request: SessionFileChangesRequest, metadata?: Metadata): Observable<SessionFileChanges>;
34299
+ /** Filtered, keyset-paginated drill-down feed of git/GitHub actions (newest first). */
34300
+ ListGitActivities(request: ListGitActivitiesRequest, metadata?: Metadata): Promise<ListGitActivitiesResponse>;
34301
+ /**
34302
+ * Live stream of the filtered git/GitHub feed (UPSERT per activity keyed by
34303
+ * activity_id, a nonterminal GitActivitiesSnapshotCompleted, then open until cancel).
34304
+ */
34305
+ StreamGitActivities(request: StreamGitActivitiesRequest, metadata?: Metadata): Observable<GitActivityFrame>;
34306
+ /**
34307
+ * Live stream of the git dashboard's overview: a full windowed, dimension-sliced rollup of the filtered
34308
+ * git activities (whole-window totals ride each frame), re-derived each tick.
34309
+ */
34310
+ StreamGitActivitySummary(request: GitActivitySummaryRequest, metadata?: Metadata): Observable<GitActivitySummary>;
34311
+ /**
34312
+ * Live token burn calendar: a windowed, dimension-sliced token/cost trend series
34313
+ * plus whole-window totals.
34314
+ */
34315
+ StreamTokenActivitySummary(
34316
+ request: TokenActivitySummaryRequest,
34317
+ metadata?: Metadata,
34318
+ ): Observable<TokenActivitySummary>;
34319
+ /**
34320
+ * Live "burn rate now" gauge: the trailing-60s cost/hr + tokens/min (total plus a per-dimension
34321
+ * breakdown) and a fixed 60-minute one-minute rolling sparkline of that rate. Fixed horizon, fast
34322
+ * refresh; first frame is a full snapshot.
34323
+ */
34324
+ StreamBurnRate(request: BurnRateRequest, metadata?: Metadata): Observable<BurnRate>;
34325
+ /**
34326
+ * Live token-burn calendar over an inclusive UTC [start_date, end_date] range: one complete row per
34327
+ * covered day off the precomputed daily rollup. Covered empty days are zero; uncomputed history is
34328
+ * omitted; today is provisional.
34329
+ */
34330
+ StreamDailyActivity(request: DailyActivityRequest, metadata?: Metadata): Observable<DailyActivity>;
34331
+ /**
34332
+ * Live current-UTC-month spend forecast: month-to-date cost and the projected month-end total (a band from
34333
+ * replaying recent weeks), for the project, per model, provider and source system, and per principal, off the
34334
+ * same daily rollup as StreamDailyActivity; the filter narrows it by funding mode, source system and principal.
34335
+ * Mirrors telemetry.api.v1.
34336
+ */
34337
+ StreamSpendForecast(request: SpendForecastRequest, metadata?: Metadata): Observable<SpendForecast>;
34338
+ /**
34339
+ * Live weekly activity rhythm: a sparse (weekday, hour) heatmap over a bounded sliding window in an
34340
+ * explicit IANA time zone. Every latest logical event counts; settled model calls add token/cost.
34341
+ */
34342
+ StreamActivityRhythm(request: ActivityRhythmRequest, metadata?: Metadata): Observable<ActivityRhythm>;
34343
+ /**
34344
+ * Live stream of one project's dashboard bundle: headline totals, model/provider/source mix,
34345
+ * and top sessions by cost.
34346
+ */
34347
+ StreamProjectOverview(request: ProjectOverviewRequest, metadata?: Metadata): Observable<ProjectOverview>;
34348
+ /**
34349
+ * Live organization home cards: one summary per requested project (zeros when it has no AI activity) —
34350
+ * conversations last active in the window, their principals and git counts, and the window's burn by model.
34351
+ */
34352
+ StreamProjectSummaries(request: ProjectSummariesRequest, metadata?: Metadata): Observable<ProjectSummaries>;
34353
+ /**
34354
+ * Per-file working-state feed (keyset-paginated) behind the unlanded-work funnel: one row per
34355
+ * (repository_key, ref, path) the AI edited (with filter.sessions or filter.paths, one they name): its kept
34356
+ * checkout copies' edits, costs and tokens added up, its state from the most-edited copy. Mirrors telemetry.api.v1.
34357
+ */
34358
+ ListFiles(request: ListFilesRequest, metadata?: Metadata): Promise<ListFilesResponse>;
34359
+ /**
34360
+ * ListFiles' files rolled up by directory, one row per (repository_key, directory), every matching directory in
34361
+ * one response (unpaged). Mirrors telemetry.api.v1.
34362
+ */
34363
+ ListFileDirectories(request: ListFileDirectoriesRequest, metadata?: Metadata): Promise<ListFileDirectoriesResponse>;
34364
+ /**
34365
+ * Live stream of the unlanded-work funnel: aging tiers + discarded (git-invisible churn), a complete
34366
+ * snapshot re-derived each tick. Every checkout copy, edited or not, lands in its own bucket; files and
34367
+ * sessions are distinct counts, so they do not add up across buckets or groups. Mirrors telemetry.api.v1.
34368
+ */
34369
+ StreamFilesSummary(request: FilesSummaryRequest, metadata?: Metadata): Observable<FilesSummary>;
34370
+ /** Latest observed list price per catalog listing from the global catalog, under stored names. */
34371
+ ListModelPrices(request: ListModelPricesRequest, metadata?: Metadata): Promise<ListModelPricesResponse>;
34372
+ /**
34373
+ * Every stored observation for the filtered models over a time range, oldest first —
34374
+ * the rows ListModelPrices collapses. filter.model_raws is required.
34375
+ */
34376
+ ListModelPriceHistory(
34377
+ request: ListModelPriceHistoryRequest,
34378
+ metadata?: Metadata,
34379
+ ): Promise<ListModelPriceHistoryResponse>;
34380
+ /**
34381
+ * Top-N most-used resources of one kind (skills / tools / files / URLs / bash commands) over a
32799
34382
  * sliding window, each with the prior equal-length window's count for a trend delta and distinct
32800
34383
  * sessions. Mirrors telemetry.api.v1.
32801
34384
  */
@@ -32897,6 +34480,12 @@ export interface AIGatewayService {
32897
34480
  * ai.api.v1.
32898
34481
  */
32899
34482
  ListIssueSessions(request: ListIssueSessionsRequest, metadata?: Metadata): Promise<ListIssueSessionsResponse>;
34483
+ /**
34484
+ * The project's insights: the active timezone's latest local day (current) and, when it is not READY, the most
34485
+ * recent earlier local day's READY analysis (previous), each with a capped preview of its cards and their exact
34486
+ * count. Mirrors ai.api.v1.
34487
+ */
34488
+ ListProjectInsights(request: ListProjectInsightsRequest, metadata?: Metadata): Promise<ListProjectInsightsResponse>;
32900
34489
  }
32901
34490
 
32902
34491
  export const AIGatewayServiceServiceName = "gateway.web.v1.AIGatewayService";
@@ -32943,6 +34532,7 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
32943
34532
  this.ListIssueCosts = this.ListIssueCosts.bind(this);
32944
34533
  this.GetSessionIssues = this.GetSessionIssues.bind(this);
32945
34534
  this.ListIssueSessions = this.ListIssueSessions.bind(this);
34535
+ this.ListProjectInsights = this.ListProjectInsights.bind(this);
32946
34536
  }
32947
34537
  ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse> {
32948
34538
  const data = ListSessionsRequest.encode(request).finish();
@@ -33186,6 +34776,12 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
33186
34776
  const promise = this.rpc.request(this.service, "ListIssueSessions", data, metadata);
33187
34777
  return promise.then((data) => ListIssueSessionsResponse.decode(new BinaryReader(data)));
33188
34778
  }
34779
+
34780
+ ListProjectInsights(request: ListProjectInsightsRequest, metadata?: Metadata): Promise<ListProjectInsightsResponse> {
34781
+ const data = ListProjectInsightsRequest.encode(request).finish();
34782
+ const promise = this.rpc.request(this.service, "ListProjectInsights", data, metadata);
34783
+ return promise.then((data) => ListProjectInsightsResponse.decode(new BinaryReader(data)));
34784
+ }
33189
34785
  }
33190
34786
 
33191
34787
  interface Rpc {