@thinkai/tai-api-contract 2.11.0 → 2.12.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.
@@ -874,6 +874,26 @@ export interface paths {
874
874
  patch?: never;
875
875
  trace?: never;
876
876
  };
877
+ "/workspaces/{workspaceId}/readiness/initialize": {
878
+ parameters: {
879
+ query?: never;
880
+ header?: never;
881
+ path?: never;
882
+ cookie?: never;
883
+ };
884
+ get?: never;
885
+ put?: never;
886
+ /**
887
+ * Trigger initial readiness scans for all workspace repos (idempotent)
888
+ * @description Called automatically when a user first visits the Agentic Foundation dashboard. Enqueues readiness scans for every GitHub repo in the workspace that has not yet been scanned. Idempotent — if any readiness run has ever been queued for this workspace the request is a no-op and returns `already_triggered`. Safe to call on every page load; the backend enforces the once-per-workspace guarantee via the database.
889
+ */
890
+ post: operations["postReadinessInitialize"];
891
+ delete?: never;
892
+ options?: never;
893
+ head?: never;
894
+ patch?: never;
895
+ trace?: never;
896
+ };
877
897
  "/workspaces/{workspaceId}/readiness/analyze": {
878
898
  parameters: {
879
899
  query?: never;
@@ -928,7 +948,12 @@ export interface paths {
928
948
  delete?: never;
929
949
  options?: never;
930
950
  head?: never;
931
- patch?: never;
951
+ /**
952
+ * Archive (remove) or restore (re-add) a repository
953
+ * @description Set `archived: true` to soft-remove the repo (Inactive). Set `archived: false` to re-add a previously Inactive repo (Active). Re-add reuses the same `repo_id` row so historical scan foreign keys remain intact, and automatically enqueues a fresh readiness scan.
954
+ * Returns `409` with `code: repo_scan_in_progress` if a scan is queued or running when archiving. Returns `409` with `code: repo_already_active` if re-adding a repo that is already Active.
955
+ */
956
+ patch: operations["patchReadinessRepo"];
932
957
  trace?: never;
933
958
  };
934
959
  "/workspaces/{workspaceId}/readiness/repos/{repoId}/runs": {
@@ -971,6 +996,26 @@ export interface paths {
971
996
  patch?: never;
972
997
  trace?: never;
973
998
  };
999
+ "/workspaces/{workspaceId}/activity": {
1000
+ parameters: {
1001
+ query?: never;
1002
+ header?: never;
1003
+ path?: never;
1004
+ cookie?: never;
1005
+ };
1006
+ /**
1007
+ * Workspace activity log (paginated)
1008
+ * @description Paginated, chronological feed of workspace-scoped lifecycle events: repository add/remove/re-add and GitHub integration add/remove. Inactive repos remain visible in this log. Filter by `eventType`, `actorUserId`, or date range (`since`/`until`).
1009
+ */
1010
+ get: operations["listWorkspaceActivity"];
1011
+ put?: never;
1012
+ post?: never;
1013
+ delete?: never;
1014
+ options?: never;
1015
+ head?: never;
1016
+ patch?: never;
1017
+ trace?: never;
1018
+ };
974
1019
  "/workspaces/{workspaceId}/readiness/score-history": {
975
1020
  parameters: {
976
1021
  query?: never;
@@ -2535,6 +2580,15 @@ export interface components {
2535
2580
  /** @description GitHub owner/repo slug; compatibility path only */
2536
2581
  providerSlug?: string;
2537
2582
  } & (unknown | unknown);
2583
+ ReadinessInitializeResponseDto: {
2584
+ /**
2585
+ * @description `triggered` — scans were enqueued for the first time (HTTP 202). `already_triggered` — a previous session already started scans; nothing new enqueued (HTTP 200). `no_repos` — workspace has no GitHub repos connected yet (HTTP 200). `no_integration` — workspace has no GitHub App installation linked yet (HTTP 200).
2586
+ * @enum {string}
2587
+ */
2588
+ kind: "triggered" | "already_triggered" | "no_repos" | "no_integration";
2589
+ /** @description Number of repos enqueued. Present only when `kind` is `triggered`. */
2590
+ count?: number;
2591
+ };
2538
2592
  ReadinessAnalyzeResponseDto: {
2539
2593
  /** Format: uuid */
2540
2594
  runId: string;
@@ -3090,6 +3144,79 @@ export interface components {
3090
3144
  activeUsers: number;
3091
3145
  }[];
3092
3146
  };
3147
+ PatchRepoArchiveBodyDto: {
3148
+ /** @description `true` to soft-remove (Inactive). `false` to restore a previously Inactive repo (Active), which also enqueues a fresh readiness scan. */
3149
+ archived: boolean;
3150
+ };
3151
+ PatchRepoArchiveResponseDto: {
3152
+ /** Format: uuid */
3153
+ repoId: string;
3154
+ /**
3155
+ * @description Current lifecycle status of the repository after the operation.
3156
+ * @enum {string}
3157
+ */
3158
+ status: "Active" | "Inactive";
3159
+ /**
3160
+ * Format: uuid
3161
+ * @description ID of the freshly enqueued readiness scan run (only present on re-add).
3162
+ */
3163
+ runId?: string | null;
3164
+ };
3165
+ /**
3166
+ * @description Type of workspace lifecycle event.
3167
+ * @enum {string}
3168
+ */
3169
+ ActivityLogEventTypeDto: "repo.added" | "repo.removed" | "repo.readded" | "integration.github.added" | "integration.github.updated" | "integration.github.removed" | "integration.github.permissions_changed" | "integration.github.repo_added" | "integration.github.repo_removed" | "fix.requested" | "fix.generating" | "fix.pr_created" | "fix.merged" | "fix.failed" | "readiness.scan_started" | "readiness.scan_completed" | "readiness.scan_failed" | "readiness.scan_partial" | "config.cursor.added" | "config.cursor.updated" | "config.cursor.removed" | "config.cursor.platform_key_enabled" | "config.cursor.platform_key_disabled" | "config.claude.added" | "config.claude.updated" | "config.claude.removed" | "member.invited" | "member.role_changed" | "member.removed";
3170
+ ActivityLogActorDto: {
3171
+ /** Format: uuid */
3172
+ userId: string;
3173
+ /** Format: email */
3174
+ email?: string | null;
3175
+ name?: string | null;
3176
+ };
3177
+ ActivityLogEntryDto: {
3178
+ /** Format: uuid */
3179
+ id: string;
3180
+ eventType: components["schemas"]["ActivityLogEventTypeDto"];
3181
+ /** @description Namespace prefix derived from event_type (e.g. "fix", "repo", "config"). */
3182
+ eventCategory: string;
3183
+ /** Format: date-time */
3184
+ occurredAt: string;
3185
+ /**
3186
+ * @description Whether the event was triggered by a human user, a batch/system process, or a webhook.
3187
+ * @enum {string}
3188
+ */
3189
+ actorType: "user" | "system" | "webhook";
3190
+ actor?: components["schemas"]["ActivityLogActorDto"] | null;
3191
+ /** Format: uuid */
3192
+ repoId?: string | null;
3193
+ repoName?: string | null;
3194
+ /** Format: uuid */
3195
+ integrationId?: string | null;
3196
+ integrationType?: string | null;
3197
+ /**
3198
+ * Format: uuid
3199
+ * @description ID of the related fix request (fix.* events).
3200
+ */
3201
+ fixRequestId?: string | null;
3202
+ /**
3203
+ * Format: uuid
3204
+ * @description ID of the related readiness issue (fix.* events).
3205
+ */
3206
+ issueId?: string | null;
3207
+ /**
3208
+ * Format: uuid
3209
+ * @description ID of the related readiness run (readiness.* events).
3210
+ */
3211
+ readinessRunId?: string | null;
3212
+ /** @description Event-specific supplementary data (before/after state, installation IDs, etc.). */
3213
+ metadata?: {
3214
+ [key: string]: unknown;
3215
+ } | null;
3216
+ };
3217
+ ActivityLogPageDto: components["schemas"]["PageMetaDto"] & {
3218
+ items: components["schemas"]["ActivityLogEntryDto"][];
3219
+ };
3093
3220
  };
3094
3221
  responses: {
3095
3222
  /** @description Missing or invalid bearer token */
@@ -3249,6 +3376,7 @@ export type ReadinessDimensionDto = components['schemas']['ReadinessDimensionDto
3249
3376
  export type ReadinessDimensionId = components['schemas']['ReadinessDimensionId'];
3250
3377
  export type RepoProviderDto = components['schemas']['RepoProviderDto'];
3251
3378
  export type ReadinessAnalyzeBodyDto = components['schemas']['ReadinessAnalyzeBodyDto'];
3379
+ export type ReadinessInitializeResponseDto = components['schemas']['ReadinessInitializeResponseDto'];
3252
3380
  export type ReadinessAnalyzeResponseDto = components['schemas']['ReadinessAnalyzeResponseDto'];
3253
3381
  export type ReadinessRunStatusDto = components['schemas']['ReadinessRunStatusDto'];
3254
3382
  export type ReadinessRepoAnalysisStatusDto = components['schemas']['ReadinessRepoAnalysisStatusDto'];
@@ -3310,6 +3438,12 @@ export type YourAiJourneyReadinessAggregateDto = components['schemas']['YourAiJo
3310
3438
  export type YourAiJourneyAnalyticsDto = components['schemas']['YourAiJourneyAnalyticsDto'];
3311
3439
  export type YourAiJourneyAiSpendWeekDto = components['schemas']['YourAiJourneyAiSpendWeekDto'];
3312
3440
  export type YourAiJourneyAiSpendDto = components['schemas']['YourAiJourneyAiSpendDto'];
3441
+ export type PatchRepoArchiveBodyDto = components['schemas']['PatchRepoArchiveBodyDto'];
3442
+ export type PatchRepoArchiveResponseDto = components['schemas']['PatchRepoArchiveResponseDto'];
3443
+ export type ActivityLogEventTypeDto = components['schemas']['ActivityLogEventTypeDto'];
3444
+ export type ActivityLogActorDto = components['schemas']['ActivityLogActorDto'];
3445
+ export type ActivityLogEntryDto = components['schemas']['ActivityLogEntryDto'];
3446
+ export type ActivityLogPageDto = components['schemas']['ActivityLogPageDto'];
3313
3447
  export type ResponseUnauthorized = components['responses']['Unauthorized'];
3314
3448
  export type ResponseForbidden = components['responses']['Forbidden'];
3315
3449
  export type ParameterWorkspaceId = components['parameters']['WorkspaceId'];
@@ -5506,6 +5640,8 @@ export interface operations {
5506
5640
  search?: components["parameters"]["ReadinessRepoSearch"];
5507
5641
  /** @description Exact language filter (e.g. `typescript`). */
5508
5642
  language?: components["parameters"]["ReadinessRepoLanguage"];
5643
+ /** @description When `true`, includes Inactive (user-removed) repos alongside Active ones. Default is `false` (active only). */
5644
+ includeArchived?: boolean;
5509
5645
  };
5510
5646
  header?: never;
5511
5647
  path: {
@@ -5546,6 +5682,48 @@ export interface operations {
5546
5682
  };
5547
5683
  };
5548
5684
  };
5685
+ postReadinessInitialize: {
5686
+ parameters: {
5687
+ query?: never;
5688
+ header?: never;
5689
+ path: {
5690
+ workspaceId: components["parameters"]["WorkspaceId"];
5691
+ };
5692
+ cookie?: never;
5693
+ };
5694
+ requestBody?: never;
5695
+ responses: {
5696
+ /** @description Already triggered in a previous session — no new runs enqueued */
5697
+ 200: {
5698
+ headers: {
5699
+ [name: string]: unknown;
5700
+ };
5701
+ content: {
5702
+ "application/json": components["schemas"]["ReadinessInitializeResponseDto"];
5703
+ };
5704
+ };
5705
+ /** @description Scans enqueued for all repos (first-time trigger) */
5706
+ 202: {
5707
+ headers: {
5708
+ [name: string]: unknown;
5709
+ };
5710
+ content: {
5711
+ "application/json": components["schemas"]["ReadinessInitializeResponseDto"];
5712
+ };
5713
+ };
5714
+ 401: components["responses"]["Unauthorized"];
5715
+ 403: components["responses"]["Forbidden"];
5716
+ /** @description Feature not supported by this server build */
5717
+ 501: {
5718
+ headers: {
5719
+ [name: string]: unknown;
5720
+ };
5721
+ content: {
5722
+ "application/json": components["schemas"]["ErrorMessageDto"];
5723
+ };
5724
+ };
5725
+ };
5726
+ };
5549
5727
  postReadinessAnalyze: {
5550
5728
  parameters: {
5551
5729
  query?: never;
@@ -5678,6 +5856,62 @@ export interface operations {
5678
5856
  };
5679
5857
  };
5680
5858
  };
5859
+ patchReadinessRepo: {
5860
+ parameters: {
5861
+ query?: never;
5862
+ header?: never;
5863
+ path: {
5864
+ workspaceId: components["parameters"]["WorkspaceId"];
5865
+ repoId: components["parameters"]["RepoId"];
5866
+ };
5867
+ cookie?: never;
5868
+ };
5869
+ requestBody: {
5870
+ content: {
5871
+ "application/json": components["schemas"]["PatchRepoArchiveBodyDto"];
5872
+ };
5873
+ };
5874
+ responses: {
5875
+ /** @description Repo status updated */
5876
+ 200: {
5877
+ headers: {
5878
+ [name: string]: unknown;
5879
+ };
5880
+ content: {
5881
+ "application/json": components["schemas"]["PatchRepoArchiveResponseDto"];
5882
+ };
5883
+ };
5884
+ /** @description Malformed request body or repoId */
5885
+ 400: {
5886
+ headers: {
5887
+ [name: string]: unknown;
5888
+ };
5889
+ content: {
5890
+ "application/json": components["schemas"]["ErrorMessageDto"];
5891
+ };
5892
+ };
5893
+ 401: components["responses"]["Unauthorized"];
5894
+ 403: components["responses"]["Forbidden"];
5895
+ /** @description Workspace or repository not found */
5896
+ 404: {
5897
+ headers: {
5898
+ [name: string]: unknown;
5899
+ };
5900
+ content: {
5901
+ "application/json": components["schemas"]["ErrorMessageDto"];
5902
+ };
5903
+ };
5904
+ /** @description Conflict — scan in progress or repo already in the requested state */
5905
+ 409: {
5906
+ headers: {
5907
+ [name: string]: unknown;
5908
+ };
5909
+ content: {
5910
+ "application/json": components["schemas"]["ErrorMessageDto"];
5911
+ };
5912
+ };
5913
+ };
5914
+ };
5681
5915
  listReadinessRepoRuns: {
5682
5916
  parameters: {
5683
5917
  query?: {
@@ -5781,6 +6015,67 @@ export interface operations {
5781
6015
  };
5782
6016
  };
5783
6017
  };
6018
+ listWorkspaceActivity: {
6019
+ parameters: {
6020
+ query?: {
6021
+ /** @description Page size (default 25, max 100). */
6022
+ limit?: components["parameters"]["PaginationLimit"];
6023
+ /** @description Zero-based row offset into the filtered, sorted result set. */
6024
+ offset?: components["parameters"]["PaginationOffset"];
6025
+ /** @description Sort direction. */
6026
+ order?: components["parameters"]["PaginationOrder"];
6027
+ /** @description Filter to a specific event type. */
6028
+ eventType?: components["schemas"]["ActivityLogEventTypeDto"];
6029
+ /** @description Filter to events performed by a specific user (UUID). */
6030
+ actorUserId?: string;
6031
+ /** @description ISO-8601 lower bound on `occurredAt` (inclusive). */
6032
+ since?: string;
6033
+ /** @description ISO-8601 upper bound on `occurredAt` (inclusive). */
6034
+ until?: string;
6035
+ /** @description Filter by event namespace prefix (e.g. "fix", "repo", "integration", "readiness", "config", "member"). */
6036
+ eventCategory?: string;
6037
+ /** @description Case-insensitive substring filter applied across repo name, integration type, actor email, and actor display name. */
6038
+ search?: string;
6039
+ };
6040
+ header?: never;
6041
+ path: {
6042
+ workspaceId: components["parameters"]["WorkspaceId"];
6043
+ };
6044
+ cookie?: never;
6045
+ };
6046
+ requestBody?: never;
6047
+ responses: {
6048
+ /** @description Paginated activity log entries */
6049
+ 200: {
6050
+ headers: {
6051
+ [name: string]: unknown;
6052
+ };
6053
+ content: {
6054
+ "application/json": components["schemas"]["ActivityLogPageDto"];
6055
+ };
6056
+ };
6057
+ /** @description Invalid query parameters */
6058
+ 400: {
6059
+ headers: {
6060
+ [name: string]: unknown;
6061
+ };
6062
+ content: {
6063
+ "application/json": components["schemas"]["ErrorMessageDto"];
6064
+ };
6065
+ };
6066
+ 401: components["responses"]["Unauthorized"];
6067
+ 403: components["responses"]["Forbidden"];
6068
+ /** @description Workspace does not exist */
6069
+ 404: {
6070
+ headers: {
6071
+ [name: string]: unknown;
6072
+ };
6073
+ content: {
6074
+ "application/json": components["schemas"]["ErrorMessageDto"];
6075
+ };
6076
+ };
6077
+ };
6078
+ };
5784
6079
  getReadinessScoreHistory: {
5785
6080
  parameters: {
5786
6081
  query?: {