@thinkai/tai-api-contract 2.130.0 → 2.132.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.
@@ -1544,7 +1544,7 @@ export interface paths {
1544
1544
  };
1545
1545
  /**
1546
1546
  * GitHub App installation status for workspace
1547
- * @description Returns whether a GitHub App installation is linked and cached repo metadata. When no installation exists, returns 200 with `installed: false` (never 404 for missing install). Use `refresh=true` to bypass cache and re-list repositories from GitHub, and to run inline productivity ingest (`on_demand`) for the current UTC week when backfill phase is `complete`.
1547
+ * @description Returns whether a GitHub App installation is linked and cached repo metadata. When no installation exists, returns 200 with `installed: false` (never 404 for missing install). Use `refresh=true` to bypass cache and re-list repositories from GitHub, and to run inline productivity ingest (`on_demand`) for the current UTC week.
1548
1548
  */
1549
1549
  get: operations["getWorkspaceGithubInstallationStatus"];
1550
1550
  put?: never;
@@ -3382,6 +3382,77 @@ export interface paths {
3382
3382
  patch?: never;
3383
3383
  trace?: never;
3384
3384
  };
3385
+ "/workspaces/{workspaceId}/code-chat/indexes/{indexId}/origin-prompt": {
3386
+ parameters: {
3387
+ query?: never;
3388
+ header?: never;
3389
+ path?: never;
3390
+ cookie?: never;
3391
+ };
3392
+ /** Origin prompt and symbol-index status for one repository index */
3393
+ get: operations["getCodeChatOriginPrompt"];
3394
+ put?: never;
3395
+ post?: never;
3396
+ delete?: never;
3397
+ options?: never;
3398
+ head?: never;
3399
+ patch?: never;
3400
+ trace?: never;
3401
+ };
3402
+ "/workspaces/{workspaceId}/code-chat/indexes/{indexId}/context-pack": {
3403
+ parameters: {
3404
+ query?: never;
3405
+ header?: never;
3406
+ path?: never;
3407
+ cookie?: never;
3408
+ };
3409
+ /**
3410
+ * Reader context pack for one repository index
3411
+ * @description Reader export. The agent tool remains POST …/code-chat/tools/get_context_pack.
3412
+ */
3413
+ get: operations["getCodeChatRepoContextPack"];
3414
+ put?: never;
3415
+ post?: never;
3416
+ delete?: never;
3417
+ options?: never;
3418
+ head?: never;
3419
+ patch?: never;
3420
+ trace?: never;
3421
+ };
3422
+ "/workspaces/{workspaceId}/code-chat/symbols/search": {
3423
+ parameters: {
3424
+ query?: never;
3425
+ header?: never;
3426
+ path?: never;
3427
+ cookie?: never;
3428
+ };
3429
+ /** Search stored symbols in the workspace */
3430
+ get: operations["searchCodeChatSymbols"];
3431
+ put?: never;
3432
+ post?: never;
3433
+ delete?: never;
3434
+ options?: never;
3435
+ head?: never;
3436
+ patch?: never;
3437
+ trace?: never;
3438
+ };
3439
+ "/workspaces/{workspaceId}/code-chat/symbols/refs": {
3440
+ parameters: {
3441
+ query?: never;
3442
+ header?: never;
3443
+ path?: never;
3444
+ cookie?: never;
3445
+ };
3446
+ /** List references for a stored symbol */
3447
+ get: operations["listCodeChatSymbolRefs"];
3448
+ put?: never;
3449
+ post?: never;
3450
+ delete?: never;
3451
+ options?: never;
3452
+ head?: never;
3453
+ patch?: never;
3454
+ trace?: never;
3455
+ };
3385
3456
  "/workspaces/{workspaceId}/code-chat/analyze/symbols": {
3386
3457
  parameters: {
3387
3458
  query?: never;
@@ -4053,7 +4124,7 @@ export interface paths {
4053
4124
  };
4054
4125
  /**
4055
4126
  * Ingest / backfill data coverage
4056
- * @description Read-only snapshot of historical ingest coverage for connected pipelines (productivity GitHub, AI usage/spend per provider, SDLC components, monitoring, HRIS). Aggregates existing watermarks and stored day/week evidence — does not trigger ingest or refresh. Requires workspace membership. Disconnected sources are omitted.
4127
+ * @description Read-only snapshot of historical ingest coverage for connected pipelines (productivity GitHub, AI usage/spend per provider, SDLC components, monitoring, HRIS). Aggregates existing watermarks and stored day/week evidence — does not trigger ingest or refresh. Productivity detail may include `selfHeal` (latest depth scan and week reconcile) read from stored activity rows; this GET does not run a scan. `selfHeal` is null when neither event exists. Requires workspace membership. Disconnected sources are omitted.
4057
4128
  */
4058
4129
  get: operations["getWorkspaceIngestCoverage"];
4059
4130
  put?: never;
@@ -7989,6 +8060,26 @@ export interface components {
7989
8060
  gaps?: components["schemas"]["IngestCoverageGapDto"][];
7990
8061
  lastErrorKind?: string | null;
7991
8062
  };
8063
+ /** @description Latest depth scan read from stored activity. `capturePercent` is the minimum existing capture ratio over that scan's repo checks with a GitHub merge count, or null when none qualify. */
8064
+ IngestCoverageProductivityDepthScanDto: {
8065
+ /** Format: date-time */
8066
+ completedAt: string | null;
8067
+ reposScanned: number;
8068
+ /** @description Metadata underIngestedCount from the completed depth-scan event. */
8069
+ gapCount: number;
8070
+ capturePercent: number | null;
8071
+ weeksQueued: number;
8072
+ };
8073
+ IngestCoverageProductivityWeekReconcileDto: {
8074
+ /** Format: date-time */
8075
+ completedAt: string | null;
8076
+ weeksChecked: number;
8077
+ weeksQueued: number;
8078
+ };
8079
+ IngestCoverageProductivitySelfHealDto: {
8080
+ depthScan: components["schemas"]["IngestCoverageProductivityDepthScanDto"];
8081
+ weekReconcile: components["schemas"]["IngestCoverageProductivityWeekReconcileDto"];
8082
+ };
7992
8083
  IngestCoverageProductivityDetailDto: {
7993
8084
  /** @enum {string|null} */
7994
8085
  phase?: "recent" | "historical" | "complete" | null;
@@ -7998,6 +8089,8 @@ export interface components {
7998
8089
  failedRepoCount?: number;
7999
8090
  coveragePercent?: number | null;
8000
8091
  repos?: components["schemas"]["IngestCoverageProductivityRepoDto"][];
8092
+ /** @description Latest depth-scan and week-reconcile summary from stored activity rows. Null when neither event exists. The coverage GET does not run a scan. */
8093
+ selfHeal?: components["schemas"]["IngestCoverageProductivitySelfHealDto"] | null;
8001
8094
  };
8002
8095
  IngestCoverageFactFamilyDto: {
8003
8096
  /** @enum {string} */
@@ -9168,6 +9261,16 @@ export interface components {
9168
9261
  kind: string;
9169
9262
  summary?: string;
9170
9263
  startLine?: number;
9264
+ label?: string;
9265
+ symbol?: string;
9266
+ role?: string;
9267
+ /** @enum {string} */
9268
+ precision?: "scip" | "structural";
9269
+ language?: string;
9270
+ /** @enum {string} */
9271
+ source?: "scip" | "structural" | "codegraph";
9272
+ /** Format: uuid */
9273
+ indexId?: string;
9171
9274
  /** Format: uuid */
9172
9275
  repoId?: string;
9173
9276
  repoName?: string;
@@ -9175,6 +9278,23 @@ export interface components {
9175
9278
  };
9176
9279
  CodeChatSymbolHitListDto: {
9177
9280
  items: components["schemas"]["CodeChatSymbolHitDto"][];
9281
+ /** @enum {string} */
9282
+ source?: "scip_store" | "codegraph";
9283
+ };
9284
+ CodeChatOriginPromptDto: {
9285
+ originPromptMd?: string | null;
9286
+ scipStatus?: {
9287
+ [key: string]: unknown;
9288
+ } | null;
9289
+ };
9290
+ CodeChatRepoContextPackDto: {
9291
+ markdown: string;
9292
+ tokenEstimate: number;
9293
+ maxTokens: number;
9294
+ sectionsIncluded: string[];
9295
+ pack?: {
9296
+ [key: string]: unknown;
9297
+ };
9178
9298
  };
9179
9299
  CodeChatReferenceQueryBodyDto: {
9180
9300
  symbol: string;
@@ -10219,6 +10339,9 @@ export type WorkspaceAbsenceListDto = components['schemas']['WorkspaceAbsenceLis
10219
10339
  export type IngestCoverageGapDto = components['schemas']['IngestCoverageGapDto'];
10220
10340
  export type IngestCoverageLastRunDto = components['schemas']['IngestCoverageLastRunDto'];
10221
10341
  export type IngestCoverageProductivityRepoDto = components['schemas']['IngestCoverageProductivityRepoDto'];
10342
+ export type IngestCoverageProductivityDepthScanDto = components['schemas']['IngestCoverageProductivityDepthScanDto'];
10343
+ export type IngestCoverageProductivityWeekReconcileDto = components['schemas']['IngestCoverageProductivityWeekReconcileDto'];
10344
+ export type IngestCoverageProductivitySelfHealDto = components['schemas']['IngestCoverageProductivitySelfHealDto'];
10222
10345
  export type IngestCoverageProductivityDetailDto = components['schemas']['IngestCoverageProductivityDetailDto'];
10223
10346
  export type IngestCoverageFactFamilyDto = components['schemas']['IngestCoverageFactFamilyDto'];
10224
10347
  export type IngestCoverageAiDetailDto = components['schemas']['IngestCoverageAiDetailDto'];
@@ -10340,6 +10463,8 @@ export type CodeChatWikiOkfExportDto = components['schemas']['CodeChatWikiOkfExp
10340
10463
  export type CodeChatSymbolQueryBodyDto = components['schemas']['CodeChatSymbolQueryBodyDto'];
10341
10464
  export type CodeChatSymbolHitDto = components['schemas']['CodeChatSymbolHitDto'];
10342
10465
  export type CodeChatSymbolHitListDto = components['schemas']['CodeChatSymbolHitListDto'];
10466
+ export type CodeChatOriginPromptDto = components['schemas']['CodeChatOriginPromptDto'];
10467
+ export type CodeChatRepoContextPackDto = components['schemas']['CodeChatRepoContextPackDto'];
10343
10468
  export type CodeChatReferenceQueryBodyDto = components['schemas']['CodeChatReferenceQueryBodyDto'];
10344
10469
  export type CodeChatReferenceHitDto = components['schemas']['CodeChatReferenceHitDto'];
10345
10470
  export type CodeChatReferenceHitListDto = components['schemas']['CodeChatReferenceHitListDto'];
@@ -14729,7 +14854,7 @@ export interface operations {
14729
14854
  getWorkspaceGithubInstallationStatus: {
14730
14855
  parameters: {
14731
14856
  query?: {
14732
- /** @description When true, bypass `tai_workspace_vcs_repos_cache` and re-fetch from GitHub. When productivity backfill phase is `complete`, also triggers inline `on_demand` ingest for the current UTC week (gap-fill only when metrics are missing). Response includes `productivityRefreshInProgress` while the workspace advisory lock is held. */
14857
+ /** @description When true, bypass `tai_workspace_vcs_repos_cache` and re-fetch from GitHub, then poll and merge productivity metrics for the current UTC week even while historical backfill is active or metrics already exist. Response includes `productivityRefreshInProgress` while the workspace advisory lock is held. */
14733
14858
  refresh?: boolean;
14734
14859
  /** @description When true, re-fetch GitHub App and installation permission metadata (used by the login permission gate after the user approves on GitHub). Clears App-permission and product-settings caches so the next `productSettingsRefresh` re-probes. Does not itself call alert-list APIs; use `productSettingsRefresh` for that. */
14735
14860
  permissionsRefresh?: boolean;
@@ -19210,6 +19335,133 @@ export interface operations {
19210
19335
  };
19211
19336
  };
19212
19337
  };
19338
+ getCodeChatOriginPrompt: {
19339
+ parameters: {
19340
+ query?: never;
19341
+ header?: never;
19342
+ path: {
19343
+ workspaceId: components["parameters"]["WorkspaceId"];
19344
+ indexId: string;
19345
+ };
19346
+ cookie?: never;
19347
+ };
19348
+ requestBody?: never;
19349
+ responses: {
19350
+ /** @description Stored origin prompt and symbol-index status */
19351
+ 200: {
19352
+ headers: {
19353
+ [name: string]: unknown;
19354
+ };
19355
+ content: {
19356
+ "application/json": components["schemas"]["CodeChatOriginPromptDto"];
19357
+ };
19358
+ };
19359
+ 401: components["responses"]["Unauthorized"];
19360
+ };
19361
+ };
19362
+ getCodeChatRepoContextPack: {
19363
+ parameters: {
19364
+ query?: never;
19365
+ header?: never;
19366
+ path: {
19367
+ workspaceId: components["parameters"]["WorkspaceId"];
19368
+ indexId: string;
19369
+ };
19370
+ cookie?: never;
19371
+ };
19372
+ requestBody?: never;
19373
+ responses: {
19374
+ /** @description Context pack markdown and section list */
19375
+ 200: {
19376
+ headers: {
19377
+ [name: string]: unknown;
19378
+ };
19379
+ content: {
19380
+ "application/json": components["schemas"]["CodeChatRepoContextPackDto"];
19381
+ };
19382
+ };
19383
+ 401: components["responses"]["Unauthorized"];
19384
+ /** @description Index not ready */
19385
+ 404: {
19386
+ headers: {
19387
+ [name: string]: unknown;
19388
+ };
19389
+ content: {
19390
+ "application/json": components["schemas"]["ErrorMessageDto"];
19391
+ };
19392
+ };
19393
+ };
19394
+ };
19395
+ searchCodeChatSymbols: {
19396
+ parameters: {
19397
+ query: {
19398
+ q: string;
19399
+ repoId?: string;
19400
+ };
19401
+ header?: never;
19402
+ path: {
19403
+ workspaceId: components["parameters"]["WorkspaceId"];
19404
+ };
19405
+ cookie?: never;
19406
+ };
19407
+ requestBody?: never;
19408
+ responses: {
19409
+ /** @description Symbol hits */
19410
+ 200: {
19411
+ headers: {
19412
+ [name: string]: unknown;
19413
+ };
19414
+ content: {
19415
+ "application/json": components["schemas"]["CodeChatSymbolHitListDto"];
19416
+ };
19417
+ };
19418
+ /** @description Missing query */
19419
+ 400: {
19420
+ headers: {
19421
+ [name: string]: unknown;
19422
+ };
19423
+ content: {
19424
+ "application/json": components["schemas"]["ErrorMessageDto"];
19425
+ };
19426
+ };
19427
+ 401: components["responses"]["Unauthorized"];
19428
+ };
19429
+ };
19430
+ listCodeChatSymbolRefs: {
19431
+ parameters: {
19432
+ query: {
19433
+ symbol: string;
19434
+ repoId?: string;
19435
+ };
19436
+ header?: never;
19437
+ path: {
19438
+ workspaceId: components["parameters"]["WorkspaceId"];
19439
+ };
19440
+ cookie?: never;
19441
+ };
19442
+ requestBody?: never;
19443
+ responses: {
19444
+ /** @description Reference hits */
19445
+ 200: {
19446
+ headers: {
19447
+ [name: string]: unknown;
19448
+ };
19449
+ content: {
19450
+ "application/json": components["schemas"]["CodeChatSymbolHitListDto"];
19451
+ };
19452
+ };
19453
+ /** @description Missing symbol */
19454
+ 400: {
19455
+ headers: {
19456
+ [name: string]: unknown;
19457
+ };
19458
+ content: {
19459
+ "application/json": components["schemas"]["ErrorMessageDto"];
19460
+ };
19461
+ };
19462
+ 401: components["responses"]["Unauthorized"];
19463
+ };
19464
+ };
19213
19465
  analyzeCodeChatSymbols: {
19214
19466
  parameters: {
19215
19467
  query?: never;
package/src/index.ts CHANGED
@@ -1315,6 +1315,34 @@ export interface IngestCoverageProductivityRepoDto {
1315
1315
  lastErrorKind?: string | null;
1316
1316
  }
1317
1317
 
1318
+ /** Latest depth-scan summary read from activity rows. Does not start a scan. */
1319
+ export interface IngestCoverageProductivityDepthScanDto {
1320
+ /** Newest `productivity.ingest.depth_scan_completed` time, or null when none. */
1321
+ completedAt: string | null;
1322
+ reposScanned: number;
1323
+ /** Metadata `underIngestedCount` on that completed event (0 when the scan found none). */
1324
+ gapCount: number;
1325
+ /**
1326
+ * Minimum `capturePercent(platformPrs, githubMerged180d)` over that scan's repo checks
1327
+ * with `githubMerged180d` > 0. Null when no such row.
1328
+ */
1329
+ capturePercent: number | null;
1330
+ weeksQueued: number;
1331
+ }
1332
+
1333
+ /** Latest week-reconcile summary read from activity rows. */
1334
+ export interface IngestCoverageProductivityWeekReconcileDto {
1335
+ /** Newest `productivity.ingest.week_reconcile` time, or null when none. */
1336
+ completedAt: string | null;
1337
+ weeksChecked: number;
1338
+ weeksQueued: number;
1339
+ }
1340
+
1341
+ export interface IngestCoverageProductivitySelfHealDto {
1342
+ depthScan: IngestCoverageProductivityDepthScanDto;
1343
+ weekReconcile: IngestCoverageProductivityWeekReconcileDto;
1344
+ }
1345
+
1318
1346
  export interface IngestCoverageProductivityDetailDto {
1319
1347
  phase?: "recent" | "historical" | "complete" | null;
1320
1348
  historicalWeekStart?: string | null;
@@ -1323,6 +1351,11 @@ export interface IngestCoverageProductivityDetailDto {
1323
1351
  failedRepoCount?: number;
1324
1352
  coveragePercent?: number | null;
1325
1353
  repos?: IngestCoverageProductivityRepoDto[];
1354
+ /**
1355
+ * Null when the pipeline exists but no depth-scan completed event and no week-reconcile
1356
+ * event are stored. Absent from pipelines that are omitted.
1357
+ */
1358
+ selfHeal?: IngestCoverageProductivitySelfHealDto | null;
1326
1359
  }
1327
1360
 
1328
1361
  export interface IngestCoverageFactFamilyDto {