@vibexp/api-client 0.72.0 → 0.74.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.
@@ -1122,6 +1122,51 @@ export type ValidateModelProviderResponse = {
1122
1122
  error_details?: string;
1123
1123
  };
1124
1124
  };
1125
+ /**
1126
+ * Inline connection details for the provider whose models to list. The provider does not have to be saved yet: this is what lets a model be picked while the base URL and key are still being entered.
1127
+ *
1128
+ */
1129
+ export type ListProviderModelsRequest = {
1130
+ provider_type: string;
1131
+ base_url: string;
1132
+ /**
1133
+ * Bearer key for the provider. Leave it blank together with `provider_id` to reuse that saved provider's stored key — the same rule an update applies to a blank key.
1134
+ *
1135
+ */
1136
+ api_key?: string | null;
1137
+ /**
1138
+ * A saved provider in this team whose stored API key is used when `api_key` is blank. Ignored when `api_key` is supplied.
1139
+ *
1140
+ */
1141
+ provider_id?: string;
1142
+ };
1143
+ export type ProviderModel = {
1144
+ /**
1145
+ * Model identifier, exactly as the provider reports it.
1146
+ */
1147
+ id: string;
1148
+ /**
1149
+ * Owner the provider reports for the model, when it reports one.
1150
+ */
1151
+ owned_by?: string;
1152
+ };
1153
+ export type ProviderModelList = {
1154
+ /**
1155
+ * Whether the provider answered its model listing. `false` when it does not implement `GET {base_url}/models` (many gateways expose only `/chat/completions`) or could not be reached; a client falls back to free-text model entry.
1156
+ *
1157
+ */
1158
+ supported: boolean;
1159
+ /**
1160
+ * Every model the provider reported, sorted by `id` and unfiltered. Empty when `supported` is `false`.
1161
+ *
1162
+ */
1163
+ models: Array<ProviderModel>;
1164
+ /**
1165
+ * Why the listing failed, as a fixed category — never the provider's raw response or the URL. Omitted on success and when the provider simply does not implement model listing.
1166
+ *
1167
+ */
1168
+ message?: 'connection_failed' | 'unauthorized' | 'misconfigured_provider' | 'destination_not_allowed';
1169
+ };
1125
1170
  /**
1126
1171
  * A team's own GitHub App registration. Never carries secret values.
1127
1172
  */
@@ -2284,6 +2329,97 @@ export type SearchResultsResponse = {
2284
2329
  */
2285
2330
  total_pages: number;
2286
2331
  };
2332
+ export type SearchSummaryRequest = {
2333
+ /**
2334
+ * The question to answer. It is run through the team's search, and the top matching documents are what the answer is grounded in.
2335
+ */
2336
+ query: string;
2337
+ /**
2338
+ * Resource types to draw documents from. Omit or leave empty to use all four types. Unknown values are rejected with a 400.
2339
+ */
2340
+ types?: Array<'prompts' | 'artifacts' | 'blueprints' | 'memories'>;
2341
+ /**
2342
+ * Optional project UUID. When set, only documents in this project are used.
2343
+ */
2344
+ project_id?: string;
2345
+ };
2346
+ /**
2347
+ * One document the summary was grounded in. Its `index` is the number the summary cites it by (`[1]`, `[2]`, ...).
2348
+ */
2349
+ export type SearchSummarySource = {
2350
+ /**
2351
+ * Citation number of this document in the summary, starting at 1
2352
+ */
2353
+ index: number;
2354
+ /**
2355
+ * Singular resource type of the document
2356
+ */
2357
+ type: 'prompt' | 'artifact' | 'blueprint' | 'memory';
2358
+ /**
2359
+ * ID of the document
2360
+ */
2361
+ id: string;
2362
+ /**
2363
+ * Title of the document
2364
+ */
2365
+ title: string;
2366
+ /**
2367
+ * Slug of the document, used to build slug-based detail-page links. Empty for memories, which are routed by id.
2368
+ */
2369
+ slug: string;
2370
+ /**
2371
+ * UUID of the document's project
2372
+ */
2373
+ project_id: string;
2374
+ /**
2375
+ * Human-readable name of the document's project
2376
+ */
2377
+ project_name: string;
2378
+ /**
2379
+ * Last-updated timestamp of the document
2380
+ */
2381
+ updated_at: string;
2382
+ /**
2383
+ * True when only the beginning of the document was given to the model, because it exceeded the per-document or total context budget.
2384
+ */
2385
+ truncated: boolean;
2386
+ };
2387
+ /**
2388
+ * Token usage the model provider reported for the completion.
2389
+ */
2390
+ export type SearchSummaryUsage = {
2391
+ /**
2392
+ * Tokens in the prompt sent to the model
2393
+ */
2394
+ prompt_tokens: number;
2395
+ /**
2396
+ * Tokens in the generated summary
2397
+ */
2398
+ completion_tokens: number;
2399
+ };
2400
+ export type SearchSummaryResponse = {
2401
+ /**
2402
+ * Markdown answer to the query, grounded in `sources` and citing them as `[n]`. When the documents do not contain the answer, the summary says so.
2403
+ */
2404
+ summary: string;
2405
+ /**
2406
+ * The documents given to the model, in citation order. Only documents that were actually included are listed.
2407
+ */
2408
+ sources: Array<SearchSummarySource>;
2409
+ /**
2410
+ * Model that generated the summary
2411
+ */
2412
+ model: string;
2413
+ /**
2414
+ * ID of the team model provider that generated the summary
2415
+ */
2416
+ provider_id: string;
2417
+ /**
2418
+ * When the summary was generated
2419
+ */
2420
+ generated_at: string;
2421
+ usage?: SearchSummaryUsage;
2422
+ };
2287
2423
  export type Blueprint = {
2288
2424
  /**
2289
2425
  * Unique identifier for the spec library
@@ -6601,6 +6737,59 @@ export type SearchTeamResourcesResponses = {
6601
6737
  200: SearchResultsResponse;
6602
6738
  };
6603
6739
  export type SearchTeamResourcesResponse = SearchTeamResourcesResponses[keyof SearchTeamResourcesResponses];
6740
+ export type SummarizeSearchResultsData = {
6741
+ body: SearchSummaryRequest;
6742
+ path: {
6743
+ /**
6744
+ * Team ID
6745
+ */
6746
+ team_id: string;
6747
+ };
6748
+ query?: never;
6749
+ url: '/api/v1/{team_id}/search/summary';
6750
+ };
6751
+ export type SummarizeSearchResultsErrors = {
6752
+ /**
6753
+ * Invalid request data or validation error
6754
+ */
6755
+ 400: ErrorResponse;
6756
+ /**
6757
+ * Unauthorized
6758
+ */
6759
+ 401: ErrorResponse;
6760
+ /**
6761
+ * User is not a member of the team
6762
+ */
6763
+ 403: ErrorResponse;
6764
+ /**
6765
+ * AI summaries are disabled for the team (`AI_SUMMARY_DISABLED`), or the team has no model provider (`AI_SUMMARY_NO_PROVIDER`)
6766
+ */
6767
+ 409: ErrorResponse;
6768
+ /**
6769
+ * The search returned no documents to summarize (`AI_SUMMARY_NO_RESULTS`)
6770
+ */
6771
+ 422: ErrorResponse;
6772
+ /**
6773
+ * Failed to generate the summary
6774
+ */
6775
+ 500: ErrorResponse;
6776
+ /**
6777
+ * The model provider could not produce a summary: it was unreachable (`AI_SUMMARY_PROVIDER_UNREACHABLE`), rejected the credentials (`AI_SUMMARY_UNAUTHORIZED`), or rejected the request (`AI_SUMMARY_MODEL_ERROR`)
6778
+ */
6779
+ 502: ErrorResponse;
6780
+ /**
6781
+ * The model provider did not answer in time (`AI_SUMMARY_TIMEOUT`)
6782
+ */
6783
+ 504: ErrorResponse;
6784
+ };
6785
+ export type SummarizeSearchResultsError = SummarizeSearchResultsErrors[keyof SummarizeSearchResultsErrors];
6786
+ export type SummarizeSearchResultsResponses = {
6787
+ /**
6788
+ * Summary generated successfully
6789
+ */
6790
+ 200: SearchSummaryResponse;
6791
+ };
6792
+ export type SummarizeSearchResultsResponse = SummarizeSearchResultsResponses[keyof SummarizeSearchResultsResponses];
6604
6793
  export type GetResourceAccessMetricsData = {
6605
6794
  body?: never;
6606
6795
  path: {
@@ -14549,6 +14738,47 @@ export type ValidateModelProviderResponses = {
14549
14738
  200: ValidateModelProviderResponse;
14550
14739
  };
14551
14740
  export type ValidateModelProviderResponse2 = ValidateModelProviderResponses[keyof ValidateModelProviderResponses];
14741
+ export type ListProviderModelsData = {
14742
+ body: ListProviderModelsRequest;
14743
+ path: {
14744
+ /**
14745
+ * Team that owns the model provider(s).
14746
+ */
14747
+ team_id: string;
14748
+ };
14749
+ query?: never;
14750
+ url: '/api/v1/{team_id}/model-providers/models';
14751
+ };
14752
+ export type ListProviderModelsErrors = {
14753
+ /**
14754
+ * Malformed JSON body (`BAD_REQUEST`) or missing required fields (`MODEL_PROVIDER_VALIDATION_FAILED` with `validation_errors`)
14755
+ */
14756
+ 400: ErrorResponse;
14757
+ /**
14758
+ * Unauthorized
14759
+ */
14760
+ 401: ErrorResponse;
14761
+ /**
14762
+ * Forbidden - managing provider settings requires team owner/admin (`FORBIDDEN`)
14763
+ */
14764
+ 403: ErrorResponse;
14765
+ /**
14766
+ * `api_key` was blank and `provider_id` names no provider in this team (`MODEL_PROVIDER_NOT_FOUND`)
14767
+ */
14768
+ 404: ErrorResponse;
14769
+ /**
14770
+ * Listing failed due to an internal service error (`INTERNAL_ERROR`)
14771
+ */
14772
+ 500: ErrorResponse;
14773
+ };
14774
+ export type ListProviderModelsError = ListProviderModelsErrors[keyof ListProviderModelsErrors];
14775
+ export type ListProviderModelsResponses = {
14776
+ /**
14777
+ * Listing completed (check `supported` for the outcome)
14778
+ */
14779
+ 200: ProviderModelList;
14780
+ };
14781
+ export type ListProviderModelsResponse = ListProviderModelsResponses[keyof ListProviderModelsResponses];
14552
14782
  export type ListModelProvidersSettingsData = {
14553
14783
  body?: never;
14554
14784
  path: {
@@ -14783,6 +15013,47 @@ export type ValidateModelProviderSettingsResponses = {
14783
15013
  200: ValidateModelProviderResponse;
14784
15014
  };
14785
15015
  export type ValidateModelProviderSettingsResponse = ValidateModelProviderSettingsResponses[keyof ValidateModelProviderSettingsResponses];
15016
+ export type ListProviderModelsSettingsData = {
15017
+ body: ListProviderModelsRequest;
15018
+ path: {
15019
+ /**
15020
+ * Team that owns the model provider(s).
15021
+ */
15022
+ team_id: string;
15023
+ };
15024
+ query?: never;
15025
+ url: '/api/v1/{team_id}/settings/model-providers/models';
15026
+ };
15027
+ export type ListProviderModelsSettingsErrors = {
15028
+ /**
15029
+ * Malformed JSON body (`BAD_REQUEST`) or missing required fields (`MODEL_PROVIDER_VALIDATION_FAILED` with `validation_errors`)
15030
+ */
15031
+ 400: ErrorResponse;
15032
+ /**
15033
+ * Unauthorized
15034
+ */
15035
+ 401: ErrorResponse;
15036
+ /**
15037
+ * Forbidden - managing provider settings requires team owner/admin (`FORBIDDEN`)
15038
+ */
15039
+ 403: ErrorResponse;
15040
+ /**
15041
+ * `api_key` was blank and `provider_id` names no provider in this team (`MODEL_PROVIDER_NOT_FOUND`)
15042
+ */
15043
+ 404: ErrorResponse;
15044
+ /**
15045
+ * Listing failed due to an internal service error (`INTERNAL_ERROR`)
15046
+ */
15047
+ 500: ErrorResponse;
15048
+ };
15049
+ export type ListProviderModelsSettingsError = ListProviderModelsSettingsErrors[keyof ListProviderModelsSettingsErrors];
15050
+ export type ListProviderModelsSettingsResponses = {
15051
+ /**
15052
+ * Listing completed (check `supported` for the outcome)
15053
+ */
15054
+ 200: ProviderModelList;
15055
+ };
15056
+ export type ListProviderModelsSettingsResponse = ListProviderModelsSettingsResponses[keyof ListProviderModelsSettingsResponses];
14786
15057
  export type CopyModelProviderFromTeamData = {
14787
15058
  body: CopyModelProviderRequest;
14788
15059
  path: {