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