@thinkai/tai-api-contract 2.143.0 → 2.144.1

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.
@@ -2944,6 +2944,50 @@ export interface paths {
2944
2944
  patch?: never;
2945
2945
  trace?: never;
2946
2946
  };
2947
+ "/workspaces/{workspaceId}/code-intelligence/agent-md": {
2948
+ parameters: {
2949
+ query?: never;
2950
+ header?: never;
2951
+ path?: never;
2952
+ cookie?: never;
2953
+ };
2954
+ /**
2955
+ * Read the workspace agent.md
2956
+ * @description Any workspace member. Returns the persisted workspace agent file, or null fields when none has been written. 403 `code_intelligence_disabled` when Engineering Context Graph is off.
2957
+ */
2958
+ get: operations["getCodeIntelligenceAgentMd"];
2959
+ /**
2960
+ * Save an admin edit of the workspace agent.md
2961
+ * @description Admin only. Body is 1 to 12,000 characters. Saves source `admin`. Auto-generate and the cadence tick do not overwrite this text until an admin regenerates it. A non-admin receives 403.
2962
+ */
2963
+ put: operations["putCodeIntelligenceAgentMd"];
2964
+ post?: never;
2965
+ delete?: never;
2966
+ options?: never;
2967
+ head?: never;
2968
+ patch?: never;
2969
+ trace?: never;
2970
+ };
2971
+ "/workspaces/{workspaceId}/code-intelligence/agent-md/regenerate": {
2972
+ parameters: {
2973
+ query?: never;
2974
+ header?: never;
2975
+ path?: never;
2976
+ cookie?: never;
2977
+ };
2978
+ get?: never;
2979
+ put?: never;
2980
+ /**
2981
+ * Rewrite workspace agent.md from ready code graphs
2982
+ * @description Admin only. Rewrites the file from current ready eligible graphs and sets source `generated`. Returns 409 `agent_md_not_ready` when no eligible repository index is ready. Does not call an LLM and does not clone repositories.
2983
+ */
2984
+ post: operations["regenerateCodeIntelligenceAgentMd"];
2985
+ delete?: never;
2986
+ options?: never;
2987
+ head?: never;
2988
+ patch?: never;
2989
+ trace?: never;
2990
+ };
2947
2991
  "/workspaces/{workspaceId}/code-intelligence/token-usage/summary": {
2948
2992
  parameters: {
2949
2993
  query?: never;
@@ -3108,7 +3152,10 @@ export interface paths {
3108
3152
  };
3109
3153
  get?: never;
3110
3154
  put?: never;
3111
- /** Enqueue indexing for all (or selected) readiness GitHub repos */
3155
+ /**
3156
+ * Enqueue indexing for all (or selected) readiness GitHub repos
3157
+ * @description `indexOnly: true` enqueues a graph-only job. `{ "indexOnly": true, "force": true }` with no `repoIds` is admin-only and opens one index wave for every eligible GitHub repository. A single-repo indexOnly sync does not open a wave. Members who send that admin body receive 403.
3158
+ */
3112
3159
  post: operations["syncCodeChatIndexes"];
3113
3160
  delete?: never;
3114
3161
  options?: never;
@@ -3116,6 +3163,26 @@ export interface paths {
3116
3163
  patch?: never;
3117
3164
  trace?: never;
3118
3165
  };
3166
+ "/workspaces/{workspaceId}/code-chat/readiness": {
3167
+ parameters: {
3168
+ query?: never;
3169
+ header?: never;
3170
+ path?: never;
3171
+ cookie?: never;
3172
+ };
3173
+ /**
3174
+ * Workspace chat readiness
3175
+ * @description Any workspace member. 403 `code_intelligence_disabled` when Engineering Context Graph is off. `status` is `indexing`, `generating_agent_md`, `failed`, or `ready`. Chat stays closed until `ready`: create thread and post message return `409 chat_not_ready` with `progressMessage` when status is not ready. An open index wave reports `indexing` until every job in that wave is terminal.
3176
+ */
3177
+ get: operations["getCodeChatReadiness"];
3178
+ put?: never;
3179
+ post?: never;
3180
+ delete?: never;
3181
+ options?: never;
3182
+ head?: never;
3183
+ patch?: never;
3184
+ trace?: never;
3185
+ };
3119
3186
  "/workspaces/{workspaceId}/code-chat/indexes/{indexId}": {
3120
3187
  parameters: {
3121
3188
  query?: never;
@@ -4287,6 +4354,8 @@ export interface components {
4287
4354
  error: string;
4288
4355
  /** @description Machine-readable error code when present (for example `last_admin`). */
4289
4356
  code?: string;
4357
+ /** @description Human-readable progress when `code` is `chat_not_ready` (same text as `error` for that response). */
4358
+ progressMessage?: string;
4290
4359
  };
4291
4360
  TeamMemberDto: {
4292
4361
  /** Format: uuid */
@@ -4845,6 +4914,13 @@ export interface components {
4845
4914
  provider?: components["schemas"]["AgentExecutionProviderDto"] | null;
4846
4915
  cursorModel?: string | null;
4847
4916
  claudeModel?: string | null;
4917
+ /** @description When false, turning Engineering Context Graph on and the cadence tick do not enqueue index jobs. Stored graphs, wiki pages, and agent.md stay. Defaults to true. */
4918
+ indexingEnabled?: boolean;
4919
+ /**
4920
+ * @description How often the code-knowledge worker enqueues an index-only wave for eligible GitHub repositories. `manual` never ticks. Defaults to `daily`.
4921
+ * @enum {string}
4922
+ */
4923
+ indexingCadence?: "daily" | "weekly" | "manual";
4848
4924
  /** @description Deep Wiki documentation focus for this workspace. Steers topic planning when generating Engineering Context wiki pages. Optional in-repo `.aidrivensdlc/wiki.json` still overrides the topic outline when present. */
4849
4925
  wikiGuidance?: components["schemas"]["CodeWikiGuidanceDto"] | null;
4850
4926
  };
@@ -4854,6 +4930,30 @@ export interface components {
4854
4930
  /** @description Title of the parent topic for hierarchy (must match another topic title). */
4855
4931
  parentTitle?: string | null;
4856
4932
  };
4933
+ PutCodeIntelligenceAgentMdDto: {
4934
+ body: string;
4935
+ };
4936
+ CodeIntelligenceAgentMdDto: {
4937
+ body: string | null;
4938
+ /** @enum {string|null} */
4939
+ source: "generated" | "admin" | null;
4940
+ /** Format: date-time */
4941
+ updatedAt: string | null;
4942
+ };
4943
+ CodeChatReadinessDto: {
4944
+ /** @enum {string} */
4945
+ status: "indexing" | "generating_agent_md" | "failed" | "ready";
4946
+ progressMessage: string;
4947
+ eligibleCount: number;
4948
+ readyCount: number;
4949
+ failedCount: number;
4950
+ inProgressCount: number;
4951
+ indexingEnabled: boolean;
4952
+ /** @enum {string} */
4953
+ indexingCadence: "daily" | "weekly" | "manual";
4954
+ /** @enum {string|null} */
4955
+ agentMdSource: "generated" | "admin" | null;
4956
+ };
4857
4957
  CodeWikiGuidanceDto: {
4858
4958
  /**
4859
4959
  * @description Free-form notes describing what the wiki should emphasize.
@@ -4888,6 +4988,13 @@ export interface components {
4888
4988
  codeIntelligenceCursorModel?: string | null;
4889
4989
  /** @description Optional Claude model override for Code Intelligence (null/empty → env default). */
4890
4990
  codeIntelligenceClaudeModel?: string | null;
4991
+ /** @description When false, enable-enqueue and the cadence tick do not start an index wave. Defaults to true. */
4992
+ codeIntelligenceIndexingEnabled?: boolean;
4993
+ /**
4994
+ * @description Index wave cadence. `manual` does not tick. Defaults to `daily`.
4995
+ * @enum {string}
4996
+ */
4997
+ codeIntelligenceIndexingCadence?: "daily" | "weekly" | "manual";
4891
4998
  /** @description True when a dedicated `code_intelligence` source has a stored executionToken. */
4892
4999
  hasCodeIntelligenceExecutionToken?: boolean;
4893
5000
  /** @description Federated-readiness delivery topology: which connected repos hold terraform / gitops / ci_templates / api_contracts truth for this workspace. Null when not configured. Change via `PUT /workspaces/{workspaceId}/delivery-topology`. */
@@ -8990,7 +9097,7 @@ export interface components {
8990
9097
  */
8991
9098
  force: boolean;
8992
9099
  /**
8993
- * @description When true, each enqueued knowledge job clones the repository, builds the code graph, marks the index ready, and finishes with wiki tracks skipped. It does not write wiki pages and does not require an execution key. Omit or false to keep the full pipeline, including wiki. Distinct from skipLlm, which still writes a skeleton wiki. A job that is already queued or running keeps the options it was enqueued with.
9100
+ * @description When true, each enqueued knowledge job clones the repository, builds the code graph, marks the index ready, and finishes with wiki tracks skipped. It does not write wiki pages and does not require an execution key. Omit or false to keep the full pipeline, including wiki. Distinct from skipLlm, which still writes a skeleton wiki. A job that is already queued or running keeps the options it was enqueued with. Together with `force: true` and no `repoIds`, this opens an admin index wave.
8994
9101
  * @default false
8995
9102
  */
8996
9103
  indexOnly: boolean;
@@ -9006,10 +9113,10 @@ export interface components {
9006
9113
  repoId: string;
9007
9114
  repoName: string;
9008
9115
  /**
9009
- * @description Stable machine-readable skip reason
9116
+ * @description Stable machine-readable skip reason. `ecg_source_off` covers a source turned off for Engineering Context Graph and non-GitHub providers that stay listed but are never indexed.
9010
9117
  * @enum {string}
9011
9118
  */
9012
- code: "repo_ineligible" | "indexed_recently" | "index_in_progress";
9119
+ code: "repo_ineligible" | "indexed_recently" | "index_in_progress" | "ecg_source_off";
9013
9120
  };
9014
9121
  CodeChatThreadDto: {
9015
9122
  /** Format: uuid */
@@ -9022,6 +9129,11 @@ export interface components {
9022
9129
  repoIds: string[];
9023
9130
  revisionRef?: string | null;
9024
9131
  title: string;
9132
+ /**
9133
+ * @description `workspace` when `repoIds` is empty or has more than one id (Conversations). `repo` when exactly one repository is bound (System / Wiki).
9134
+ * @enum {string}
9135
+ */
9136
+ scope: "workspace" | "repo";
9025
9137
  /** Format: date-time */
9026
9138
  createdAt: string;
9027
9139
  /** Format: date-time */
@@ -9031,12 +9143,17 @@ export interface components {
9031
9143
  items: components["schemas"]["CodeChatThreadDto"][];
9032
9144
  };
9033
9145
  CodeChatCreateThreadBodyDto: {
9146
+ /**
9147
+ * @description Create a workspace conversation with empty `repoIds`. Does not reuse an older thread. Requires chat readiness and an execution key.
9148
+ * @enum {string}
9149
+ */
9150
+ scope?: "workspace";
9034
9151
  /**
9035
9152
  * Format: uuid
9036
9153
  * @description Legacy single-index bind; prefer repoIds for workspace scope.
9037
9154
  */
9038
9155
  indexId?: string;
9039
- /** @description Empty or omitted = all ready repos. */
9156
+ /** @description Empty or omitted = all ready repos. Ignored when scope is workspace. */
9040
9157
  repoIds?: string[];
9041
9158
  revisionRef?: string;
9042
9159
  title?: string;
@@ -9083,10 +9200,10 @@ export interface components {
9083
9200
  };
9084
9201
  CodeChatMessageReplyDto: components["schemas"]["CodeChatMessageDto"] & {
9085
9202
  /**
9086
- * @description How the assistant answer was produced. `inventory` returns a deterministic catalog (APIs or modules) rather than LLM synthesis.
9203
+ * @description How the assistant answer was produced. `inventory` returns a deterministic catalog (APIs or modules) rather than LLM synthesis. `failed` is a short assistant message after provider timeout or error (no retrieval substitute).
9087
9204
  * @enum {string}
9088
9205
  */
9089
- mode: "llm" | "retrieval" | "inventory";
9206
+ mode: "llm" | "retrieval" | "inventory" | "failed";
9090
9207
  /** @description Optional typed inventory payload for rich UI tables */
9091
9208
  structured?: components["schemas"]["CodeChatStructuredBlockDto"];
9092
9209
  /** @description True when wiki pages from one or more repos contributed to LLM context */
@@ -10320,6 +10437,9 @@ export type JiraSourceConfigDto = components['schemas']['JiraSourceConfigDto'];
10320
10437
  export type AgentExecutionProviderDto = components['schemas']['AgentExecutionProviderDto'];
10321
10438
  export type PutCodeIntelligenceSettingsDto = components['schemas']['PutCodeIntelligenceSettingsDto'];
10322
10439
  export type CodeWikiGuidanceTopicDto = components['schemas']['CodeWikiGuidanceTopicDto'];
10440
+ export type PutCodeIntelligenceAgentMdDto = components['schemas']['PutCodeIntelligenceAgentMdDto'];
10441
+ export type CodeIntelligenceAgentMdDto = components['schemas']['CodeIntelligenceAgentMdDto'];
10442
+ export type CodeChatReadinessDto = components['schemas']['CodeChatReadinessDto'];
10323
10443
  export type CodeWikiGuidanceDto = components['schemas']['CodeWikiGuidanceDto'];
10324
10444
  export type WorkspaceConfigDto = components['schemas']['WorkspaceConfigDto'];
10325
10445
  export type DeliveryRoleConfigDto = components['schemas']['DeliveryRoleConfigDto'];
@@ -18671,6 +18791,130 @@ export interface operations {
18671
18791
  403: components["responses"]["Forbidden"];
18672
18792
  };
18673
18793
  };
18794
+ getCodeIntelligenceAgentMd: {
18795
+ parameters: {
18796
+ query?: never;
18797
+ header?: never;
18798
+ path: {
18799
+ workspaceId: components["parameters"]["WorkspaceId"];
18800
+ };
18801
+ cookie?: never;
18802
+ };
18803
+ requestBody?: never;
18804
+ responses: {
18805
+ /** @description Persisted agent.md */
18806
+ 200: {
18807
+ headers: {
18808
+ [name: string]: unknown;
18809
+ };
18810
+ content: {
18811
+ "application/json": components["schemas"]["CodeIntelligenceAgentMdDto"];
18812
+ };
18813
+ };
18814
+ 401: components["responses"]["Unauthorized"];
18815
+ /** @description Engineering Context Graph is off, or the caller is not a member */
18816
+ 403: {
18817
+ headers: {
18818
+ [name: string]: unknown;
18819
+ };
18820
+ content: {
18821
+ "application/json": components["schemas"]["ErrorMessageDto"];
18822
+ };
18823
+ };
18824
+ };
18825
+ };
18826
+ putCodeIntelligenceAgentMd: {
18827
+ parameters: {
18828
+ query?: never;
18829
+ header?: never;
18830
+ path: {
18831
+ workspaceId: components["parameters"]["WorkspaceId"];
18832
+ };
18833
+ cookie?: never;
18834
+ };
18835
+ requestBody: {
18836
+ content: {
18837
+ "application/json": components["schemas"]["PutCodeIntelligenceAgentMdDto"];
18838
+ };
18839
+ };
18840
+ responses: {
18841
+ /** @description Saved agent.md */
18842
+ 200: {
18843
+ headers: {
18844
+ [name: string]: unknown;
18845
+ };
18846
+ content: {
18847
+ "application/json": components["schemas"]["CodeIntelligenceAgentMdDto"];
18848
+ };
18849
+ };
18850
+ /** @description Body missing or outside 1 to 12,000 characters */
18851
+ 400: {
18852
+ headers: {
18853
+ [name: string]: unknown;
18854
+ };
18855
+ content: {
18856
+ "application/json": components["schemas"]["ErrorMessageDto"];
18857
+ };
18858
+ };
18859
+ 401: components["responses"]["Unauthorized"];
18860
+ /** @description Caller is not an admin, or Engineering Context Graph is off */
18861
+ 403: {
18862
+ headers: {
18863
+ [name: string]: unknown;
18864
+ };
18865
+ content: {
18866
+ "application/json": components["schemas"]["ErrorMessageDto"];
18867
+ };
18868
+ };
18869
+ };
18870
+ };
18871
+ regenerateCodeIntelligenceAgentMd: {
18872
+ parameters: {
18873
+ query?: never;
18874
+ header?: never;
18875
+ path: {
18876
+ workspaceId: components["parameters"]["WorkspaceId"];
18877
+ };
18878
+ cookie?: never;
18879
+ };
18880
+ requestBody?: never;
18881
+ responses: {
18882
+ /** @description Regenerated agent.md */
18883
+ 200: {
18884
+ headers: {
18885
+ [name: string]: unknown;
18886
+ };
18887
+ content: {
18888
+ "application/json": components["schemas"]["CodeIntelligenceAgentMdDto"];
18889
+ };
18890
+ };
18891
+ 401: components["responses"]["Unauthorized"];
18892
+ /** @description Caller is not an admin, or Engineering Context Graph is off */
18893
+ 403: {
18894
+ headers: {
18895
+ [name: string]: unknown;
18896
+ };
18897
+ content: {
18898
+ "application/json": components["schemas"]["ErrorMessageDto"];
18899
+ };
18900
+ };
18901
+ /** @description No ready eligible index */
18902
+ 409: {
18903
+ headers: {
18904
+ [name: string]: unknown;
18905
+ };
18906
+ content: {
18907
+ /**
18908
+ * @example {
18909
+ * "error": "No ready repository index is available to write the workspace agent file.",
18910
+ * "code": "agent_md_not_ready"
18911
+ * }
18912
+ */
18913
+ "application/json": components["schemas"]["ErrorMessageDto"];
18914
+ };
18915
+ };
18916
+ };
18917
+ };
18674
18918
  getCodeIntelligenceTokenUsageSummary: {
18675
18919
  parameters: {
18676
18920
  query?: {
@@ -19070,6 +19314,53 @@ export interface operations {
19070
19314
  };
19071
19315
  };
19072
19316
  401: components["responses"]["Unauthorized"];
19317
+ /** @description Engineering Context Graph is off, or a member sent the admin force body (`indexOnly` and `force` with no `repoIds`). */
19318
+ 403: {
19319
+ headers: {
19320
+ [name: string]: unknown;
19321
+ };
19322
+ content: {
19323
+ "application/json": components["schemas"]["ErrorMessageDto"];
19324
+ };
19325
+ };
19326
+ };
19327
+ };
19328
+ getCodeChatReadiness: {
19329
+ parameters: {
19330
+ query?: never;
19331
+ header?: never;
19332
+ path: {
19333
+ workspaceId: components["parameters"]["WorkspaceId"];
19334
+ };
19335
+ cookie?: never;
19336
+ };
19337
+ requestBody?: never;
19338
+ responses: {
19339
+ /** @description Readiness snapshot */
19340
+ 200: {
19341
+ headers: {
19342
+ [name: string]: unknown;
19343
+ };
19344
+ content: {
19345
+ "application/json": components["schemas"]["CodeChatReadinessDto"];
19346
+ };
19347
+ };
19348
+ 401: components["responses"]["Unauthorized"];
19349
+ /** @description Engineering Context Graph is off */
19350
+ 403: {
19351
+ headers: {
19352
+ [name: string]: unknown;
19353
+ };
19354
+ content: {
19355
+ /**
19356
+ * @example {
19357
+ * "error": "Code Intelligence is disabled for this workspace",
19358
+ * "code": "code_intelligence_disabled"
19359
+ * }
19360
+ */
19361
+ "application/json": components["schemas"]["ErrorMessageDto"];
19362
+ };
19363
+ };
19073
19364
  };
19074
19365
  };
19075
19366
  getCodeChatIndex: {
@@ -19153,6 +19444,15 @@ export interface operations {
19153
19444
  };
19154
19445
  };
19155
19446
  401: components["responses"]["Unauthorized"];
19447
+ /** @description Engineering Context Graph is off */
19448
+ 403: {
19449
+ headers: {
19450
+ [name: string]: unknown;
19451
+ };
19452
+ content: {
19453
+ "application/json": components["schemas"]["ErrorMessageDto"];
19454
+ };
19455
+ };
19156
19456
  /** @description Not found */
19157
19457
  404: {
19158
19458
  headers: {
@@ -19162,12 +19462,23 @@ export interface operations {
19162
19462
  "application/json": components["schemas"]["ErrorMessageDto"];
19163
19463
  };
19164
19464
  };
19165
- /** @description Index not ready */
19465
+ /** @description Chat not ready, or no ready corpus for a repo-scoped thread */
19166
19466
  409: {
19167
19467
  headers: {
19168
19468
  [name: string]: unknown;
19169
19469
  };
19170
- content?: never;
19470
+ content: {
19471
+ "application/json": components["schemas"]["ErrorMessageDto"];
19472
+ };
19473
+ };
19474
+ /** @description Execution key required */
19475
+ 422: {
19476
+ headers: {
19477
+ [name: string]: unknown;
19478
+ };
19479
+ content: {
19480
+ "application/json": components["schemas"]["ErrorMessageDto"];
19481
+ };
19171
19482
  };
19172
19483
  };
19173
19484
  };
@@ -19259,6 +19570,15 @@ export interface operations {
19259
19570
  };
19260
19571
  };
19261
19572
  401: components["responses"]["Unauthorized"];
19573
+ /** @description Engineering Context Graph is off */
19574
+ 403: {
19575
+ headers: {
19576
+ [name: string]: unknown;
19577
+ };
19578
+ content: {
19579
+ "application/json": components["schemas"]["ErrorMessageDto"];
19580
+ };
19581
+ };
19262
19582
  /** @description Not found */
19263
19583
  404: {
19264
19584
  headers: {
@@ -19268,12 +19588,23 @@ export interface operations {
19268
19588
  "application/json": components["schemas"]["ErrorMessageDto"];
19269
19589
  };
19270
19590
  };
19271
- /** @description Index not ready */
19591
+ /** @description Chat not ready, or no ready corpus in thread scope */
19272
19592
  409: {
19273
19593
  headers: {
19274
19594
  [name: string]: unknown;
19275
19595
  };
19276
- content?: never;
19596
+ content: {
19597
+ "application/json": components["schemas"]["ErrorMessageDto"];
19598
+ };
19599
+ };
19600
+ /** @description Execution key required */
19601
+ 422: {
19602
+ headers: {
19603
+ [name: string]: unknown;
19604
+ };
19605
+ content: {
19606
+ "application/json": components["schemas"]["ErrorMessageDto"];
19607
+ };
19277
19608
  };
19278
19609
  };
19279
19610
  };