@gitbook/api 0.161.0 → 0.163.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.
- package/dist/client.d.ts +756 -410
- package/dist/constants.d.ts +7 -1
- package/dist/index.cjs +121 -15
- package/dist/index.js +110 -15
- package/package.json +1 -1
- package/spec/openapi.json +2220 -1142
- package/spec/openapi.yaml +1577 -891
package/dist/client.d.ts
CHANGED
|
@@ -1710,12 +1710,18 @@ export type RevisionReusableContent = {
|
|
|
1710
1710
|
document?: string;
|
|
1711
1711
|
});
|
|
1712
1712
|
/** A reusable tag that different types of content can be associated to (e.g. pages, update entries) */
|
|
1713
|
-
export
|
|
1713
|
+
export type RevisionTag = {
|
|
1714
1714
|
/** The slug identifier for the tag, immutable after creation. */
|
|
1715
1715
|
slug: string;
|
|
1716
1716
|
/** Display label for the tag. Can be renamed and differ from the slug. */
|
|
1717
1717
|
label: string;
|
|
1718
|
-
}
|
|
1718
|
+
} & ({
|
|
1719
|
+
/** Unicode codepoint or character of the emoji */
|
|
1720
|
+
emoji: Emoji;
|
|
1721
|
+
} | {
|
|
1722
|
+
/** Name of the icon */
|
|
1723
|
+
icon?: Icon;
|
|
1724
|
+
});
|
|
1719
1725
|
export interface GitSyncCommit {
|
|
1720
1726
|
/** SHA for the commit */
|
|
1721
1727
|
oid: string;
|
|
@@ -1855,6 +1861,7 @@ export interface ApplySpaceTemplate {
|
|
|
1855
1861
|
* Name of the organization
|
|
1856
1862
|
* @minLength 2
|
|
1857
1863
|
* @maxLength 255
|
|
1864
|
+
* @pattern \S.*\S
|
|
1858
1865
|
*/
|
|
1859
1866
|
export type OrganizationTitle = string;
|
|
1860
1867
|
export type OrganizationEmailDomains = string[];
|
|
@@ -4448,6 +4455,7 @@ export interface BillingMeterUsage {
|
|
|
4448
4455
|
}
|
|
4449
4456
|
/** Search result representing a space. */
|
|
4450
4457
|
export interface SearchSpaceResult {
|
|
4458
|
+
type: 'space';
|
|
4451
4459
|
id: string;
|
|
4452
4460
|
title: string;
|
|
4453
4461
|
pages: SearchPageResult[];
|
|
@@ -5764,6 +5772,21 @@ export type SiteSearchScope = {
|
|
|
5764
5772
|
/** Search in all sections and site spaces. This scope is wide and deep. */
|
|
5765
5773
|
mode: 'all';
|
|
5766
5774
|
};
|
|
5775
|
+
/** Search result representing a site context record. */
|
|
5776
|
+
export interface SearchRecordResult {
|
|
5777
|
+
type: 'record';
|
|
5778
|
+
/** The ID of the context record. */
|
|
5779
|
+
id: string;
|
|
5780
|
+
/** The title of the record. */
|
|
5781
|
+
title: string;
|
|
5782
|
+
/** The description of the record. */
|
|
5783
|
+
description?: string;
|
|
5784
|
+
/**
|
|
5785
|
+
* URL of the record in the source system.
|
|
5786
|
+
* @format uri
|
|
5787
|
+
*/
|
|
5788
|
+
url: string;
|
|
5789
|
+
}
|
|
5767
5790
|
export declare enum ContextRecordType {
|
|
5768
5791
|
Ticket = "ticket",
|
|
5769
5792
|
Document = "document"
|
|
@@ -5897,12 +5920,46 @@ export type ContextConnection = {
|
|
|
5897
5920
|
location: string;
|
|
5898
5921
|
};
|
|
5899
5922
|
} & ContextConnectorSetup;
|
|
5900
|
-
|
|
5923
|
+
/** Aggregated feedback for answers linked to a site question. */
|
|
5924
|
+
export interface SiteQuestionStatsFeedback {
|
|
5925
|
+
/** Count of answers with positive feedback. */
|
|
5926
|
+
positive: number;
|
|
5927
|
+
/** Count of answers with negative feedback. */
|
|
5928
|
+
negative: number;
|
|
5929
|
+
/** Count of answers without feedback. */
|
|
5930
|
+
unrated: number;
|
|
5931
|
+
}
|
|
5932
|
+
/** Aggregated answered assessment for answers linked to a site question. */
|
|
5933
|
+
export interface SiteQuestionStatsAnswered {
|
|
5934
|
+
/** Count of answers assessed as fully answered. */
|
|
5935
|
+
yes: number;
|
|
5936
|
+
/** Count of answers assessed as partially answered. */
|
|
5937
|
+
partially: number;
|
|
5938
|
+
/** Count of answers assessed as not answered. */
|
|
5939
|
+
no: number;
|
|
5940
|
+
}
|
|
5941
|
+
/** Aggregated stats for answers linked to a site question. */
|
|
5942
|
+
export interface SiteQuestionStats {
|
|
5943
|
+
/** Total count of answers linked to the question. */
|
|
5944
|
+
answers: number;
|
|
5945
|
+
/** Aggregated feedback for answers linked to a site question. */
|
|
5946
|
+
feedback: SiteQuestionStatsFeedback;
|
|
5947
|
+
/** Aggregated answered assessment for answers linked to a site question. */
|
|
5948
|
+
answered: SiteQuestionStatsAnswered;
|
|
5949
|
+
}
|
|
5950
|
+
export interface SiteTopic {
|
|
5901
5951
|
object: 'context-topic';
|
|
5902
5952
|
/** The ID of the topic */
|
|
5903
5953
|
id: string;
|
|
5904
5954
|
/** The label of the topic */
|
|
5905
5955
|
label: string;
|
|
5956
|
+
/** The parent topic when this topic is nested under another one */
|
|
5957
|
+
parent?: {
|
|
5958
|
+
/** The ID of the parent topic */
|
|
5959
|
+
id: string;
|
|
5960
|
+
/** The label of the parent topic */
|
|
5961
|
+
label: string;
|
|
5962
|
+
};
|
|
5906
5963
|
createdAt: Timestamp;
|
|
5907
5964
|
updatedAt: Timestamp;
|
|
5908
5965
|
/** Name of the icon */
|
|
@@ -5910,17 +5967,17 @@ export interface ContextTopic {
|
|
|
5910
5967
|
summary: JSONDocument;
|
|
5911
5968
|
usageSettings: ContextUsageSettings;
|
|
5912
5969
|
/**
|
|
5913
|
-
* The weekly pulse of
|
|
5970
|
+
* The weekly pulse of related question answers for the past 3 months
|
|
5914
5971
|
* @maxItems 13
|
|
5915
5972
|
* @minItems 13
|
|
5916
5973
|
*/
|
|
5917
5974
|
weeklyPulse: number[];
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5975
|
+
/** The number of pages associated with the topic */
|
|
5976
|
+
pages: number;
|
|
5977
|
+
/** The number of records in the topic */
|
|
5978
|
+
records: number;
|
|
5979
|
+
/** Aggregated stats for answers linked to a site question. */
|
|
5980
|
+
questions: SiteQuestionStats;
|
|
5924
5981
|
/** URLs associated with the topic */
|
|
5925
5982
|
urls: {
|
|
5926
5983
|
/**
|
|
@@ -5930,143 +5987,314 @@ export interface ContextTopic {
|
|
|
5930
5987
|
location: string;
|
|
5931
5988
|
};
|
|
5932
5989
|
}
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5990
|
+
/** Type classification of the user question. */
|
|
5991
|
+
export declare enum SiteQuestionType {
|
|
5992
|
+
Exploring = "exploring",
|
|
5993
|
+
HowTo = "how-to",
|
|
5994
|
+
Troubleshooting = "troubleshooting",
|
|
5995
|
+
Reference = "reference",
|
|
5996
|
+
Unknown = "unknown"
|
|
5997
|
+
}
|
|
5998
|
+
export interface SiteQuestion {
|
|
5999
|
+
object: 'site-question';
|
|
6000
|
+
/** The ID of the site question. */
|
|
5940
6001
|
id: string;
|
|
6002
|
+
/** Canonical text for the unique site question. */
|
|
6003
|
+
question: string;
|
|
6004
|
+
/** Type classification of the user question. */
|
|
6005
|
+
type: SiteQuestionType;
|
|
6006
|
+
createdAt: Timestamp;
|
|
6007
|
+
/** Aggregated stats for answers linked to a site question. */
|
|
6008
|
+
stats: SiteQuestionStats;
|
|
6009
|
+
/** URLs associated with the site question. */
|
|
6010
|
+
urls: {
|
|
6011
|
+
/**
|
|
6012
|
+
* URL of the site question in the API.
|
|
6013
|
+
* @format uri
|
|
6014
|
+
*/
|
|
6015
|
+
location: string;
|
|
6016
|
+
};
|
|
5941
6017
|
}
|
|
5942
|
-
/**
|
|
5943
|
-
export
|
|
5944
|
-
|
|
5945
|
-
|
|
6018
|
+
/** Whether the response answered the question. */
|
|
6019
|
+
export declare enum SiteQuestionAnswerResolution {
|
|
6020
|
+
No = "no",
|
|
6021
|
+
Partially = "partially",
|
|
6022
|
+
Yes = "yes"
|
|
5946
6023
|
}
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
6024
|
+
/** Confidence in whether the response answered the question. */
|
|
6025
|
+
export declare enum SiteQuestionAnswerConfidence {
|
|
6026
|
+
Low = "low",
|
|
6027
|
+
Medium = "medium",
|
|
6028
|
+
High = "high"
|
|
5951
6029
|
}
|
|
5952
|
-
/**
|
|
5953
|
-
export
|
|
5954
|
-
|
|
5955
|
-
|
|
6030
|
+
/** Relevance classification of the user question. */
|
|
6031
|
+
export declare enum SiteQuestionAnswerRelevance {
|
|
6032
|
+
Relevant = "relevant",
|
|
6033
|
+
Spam = "spam",
|
|
6034
|
+
OffTopic = "off-topic",
|
|
6035
|
+
Unclear = "unclear"
|
|
5956
6036
|
}
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
/**
|
|
5960
|
-
|
|
6037
|
+
/** Identifiers for a GitBook site session, used for analytics and adaptive content. */
|
|
6038
|
+
export interface SiteInsightsSession {
|
|
6039
|
+
/** GitBook's unique identifier of the visitor. */
|
|
6040
|
+
visitorId: string;
|
|
6041
|
+
/** GitBook's unique identifier of the visitor's session. */
|
|
6042
|
+
sessionId: string;
|
|
5961
6043
|
}
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
6044
|
+
export interface SiteQuestionAnswer {
|
|
6045
|
+
object: 'site-question-answer';
|
|
6046
|
+
/** The ID of the site question answer. */
|
|
6047
|
+
id: string;
|
|
6048
|
+
question: {
|
|
6049
|
+
/** The ID of the parent site question. */
|
|
6050
|
+
id: string;
|
|
6051
|
+
/** Type classification of the user question. */
|
|
6052
|
+
type: SiteQuestionType;
|
|
6053
|
+
};
|
|
6054
|
+
/** The IDs of the associated site topics. */
|
|
6055
|
+
topics: string[];
|
|
6056
|
+
input: {
|
|
6057
|
+
/** Normalized question text for this answer. */
|
|
6058
|
+
text?: string;
|
|
6059
|
+
/** Raw question text as asked by the user. */
|
|
6060
|
+
raw?: string;
|
|
6061
|
+
};
|
|
6062
|
+
thread?: {
|
|
6063
|
+
/** The ID of the thread this answer belongs to. */
|
|
6064
|
+
id: string;
|
|
6065
|
+
/** ID of the previous answer in the same thread. */
|
|
6066
|
+
previous: string;
|
|
6067
|
+
};
|
|
6068
|
+
/** Identifiers for a GitBook site session, used for analytics and adaptive content. */
|
|
6069
|
+
session?: SiteInsightsSession;
|
|
6070
|
+
feedback?: {
|
|
6071
|
+
/** Feedback rating provided by the user. */
|
|
6072
|
+
rating: -1 | 1;
|
|
6073
|
+
};
|
|
6074
|
+
/** The response identifier for this answer. */
|
|
6075
|
+
responseId: string;
|
|
6076
|
+
/** ISO language code of the question. */
|
|
6077
|
+
language: string;
|
|
6078
|
+
/** Whether the response answered the question. */
|
|
6079
|
+
answered: SiteQuestionAnswerResolution;
|
|
6080
|
+
/** Confidence in whether the response answered the question. */
|
|
6081
|
+
confidence: SiteQuestionAnswerConfidence;
|
|
6082
|
+
/** Relevance classification of the user question. */
|
|
6083
|
+
relevance: SiteQuestionAnswerRelevance;
|
|
6084
|
+
createdAt: Timestamp;
|
|
6085
|
+
updatedAt?: Timestamp;
|
|
6086
|
+
/** URLs associated with the site question answer. */
|
|
6087
|
+
urls: {
|
|
6088
|
+
/**
|
|
6089
|
+
* URL of the site question answer in the API.
|
|
6090
|
+
* @format uri
|
|
6091
|
+
*/
|
|
6092
|
+
location: string;
|
|
6093
|
+
};
|
|
5966
6094
|
}
|
|
5967
|
-
export
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
/** @minItems 1 */
|
|
5972
|
-
users: string[];
|
|
5973
|
-
}) & {
|
|
5974
|
-
/** Role to set. */
|
|
5975
|
-
role: MemberRole;
|
|
5976
|
-
};
|
|
5977
|
-
export interface OrganizationPointer {
|
|
5978
|
-
type: 'organization';
|
|
5979
|
-
/** Unique identifier for the organization */
|
|
5980
|
-
organization: string;
|
|
6095
|
+
export declare enum AIMessageRole {
|
|
6096
|
+
User = "user",
|
|
6097
|
+
Assistant = "assistant",
|
|
6098
|
+
Developer = "developer"
|
|
5981
6099
|
}
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
/** The
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
6100
|
+
export interface AIToolCallGetPageContent {
|
|
6101
|
+
tool: 'getPageContent';
|
|
6102
|
+
/** The ID of the space being accessed. */
|
|
6103
|
+
spaceId: string;
|
|
6104
|
+
/** The ID of the revision within which the page content is being fetched. */
|
|
6105
|
+
revisionId: string;
|
|
6106
|
+
page: ChangedRevisionPage;
|
|
5989
6107
|
}
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
/**
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
* "review": Can review content.
|
|
5997
|
-
* "edit": Can edit the content (live or change requests).
|
|
5998
|
-
* "comment": Can access the content and its discussions.
|
|
5999
|
-
* "read": Can access the content, but cannot update it in any way.
|
|
6000
|
-
*/
|
|
6001
|
-
permission: MemberRole;
|
|
6002
|
-
user: User;
|
|
6108
|
+
export interface AIToolCallGetPages {
|
|
6109
|
+
tool: 'getPages';
|
|
6110
|
+
/** The ID of the space being accessed. */
|
|
6111
|
+
spaceId: string;
|
|
6112
|
+
/** The revision ID of the space. */
|
|
6113
|
+
revisionId: string;
|
|
6003
6114
|
}
|
|
6004
|
-
|
|
6005
|
-
|
|
6115
|
+
export interface AIToolCallGetReusableContents {
|
|
6116
|
+
tool: 'getReusableContents';
|
|
6117
|
+
/** The ID of the space being accessed. */
|
|
6118
|
+
spaceId: string;
|
|
6119
|
+
/** The revision ID of the space. */
|
|
6120
|
+
revisionId: string;
|
|
6121
|
+
}
|
|
6122
|
+
/**
|
|
6123
|
+
* Page result
|
|
6124
|
+
* Result of a search matching a page.
|
|
6125
|
+
*/
|
|
6126
|
+
export interface AIToolCallSearchResultPage {
|
|
6127
|
+
type: 'page';
|
|
6128
|
+
/** The ID of the space */
|
|
6129
|
+
spaceId: string;
|
|
6130
|
+
/** The ID of the page */
|
|
6131
|
+
pageId: string;
|
|
6132
|
+
/** The revision ID of the result */
|
|
6133
|
+
revisionId: string;
|
|
6134
|
+
/** The anchor of the result */
|
|
6135
|
+
anchor?: string;
|
|
6136
|
+
/** The title of the result */
|
|
6137
|
+
title: string;
|
|
6138
|
+
/** The description of the result */
|
|
6139
|
+
description?: string;
|
|
6140
|
+
}
|
|
6141
|
+
/**
|
|
6142
|
+
* Site context record result
|
|
6143
|
+
* Result of a search matching a site context record.
|
|
6144
|
+
*/
|
|
6145
|
+
export interface AIToolCallSearchResultRecord {
|
|
6146
|
+
type: 'record';
|
|
6147
|
+
/** The ID of the site owning the context record */
|
|
6148
|
+
siteId: string;
|
|
6149
|
+
/** The ID of the context record */
|
|
6150
|
+
recordId: string;
|
|
6151
|
+
/** The title of the record */
|
|
6152
|
+
title: string;
|
|
6153
|
+
/** The description of the record */
|
|
6154
|
+
description?: string;
|
|
6006
6155
|
/**
|
|
6007
|
-
*
|
|
6008
|
-
*
|
|
6009
|
-
* "create": Can create content.
|
|
6010
|
-
* "review": Can review content.
|
|
6011
|
-
* "edit": Can edit the content (live or change requests).
|
|
6012
|
-
* "comment": Can access the content and its discussions.
|
|
6013
|
-
* "read": Can access the content, but cannot update it in any way.
|
|
6156
|
+
* URL of the record in its original source
|
|
6157
|
+
* @format uri
|
|
6014
6158
|
*/
|
|
6015
|
-
|
|
6016
|
-
team: OrganizationTeam;
|
|
6159
|
+
url?: string;
|
|
6017
6160
|
}
|
|
6018
|
-
/**
|
|
6019
|
-
export
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6161
|
+
/** Result of a search */
|
|
6162
|
+
export type AIToolCallSearchResult = AIToolCallSearchResultPage | AIToolCallSearchResultRecord;
|
|
6163
|
+
/** Tool to search for content */
|
|
6164
|
+
export interface AIToolCallSearch {
|
|
6165
|
+
tool: 'search';
|
|
6166
|
+
/** The query that has been searched for. */
|
|
6167
|
+
query: string;
|
|
6168
|
+
results: AIToolCallSearchResult[];
|
|
6026
6169
|
}
|
|
6027
|
-
export interface
|
|
6028
|
-
|
|
6029
|
-
|
|
6170
|
+
export interface AIToolCallEditPage {
|
|
6171
|
+
tool: 'editPage';
|
|
6172
|
+
/** The ID of the space being edited. */
|
|
6173
|
+
spaceId: string;
|
|
6174
|
+
page: ChangedRevisionPage;
|
|
6030
6175
|
}
|
|
6031
|
-
export interface
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
contentType: 'application/pdf';
|
|
6176
|
+
export interface AIToolCallCreatePage {
|
|
6177
|
+
tool: 'createPage';
|
|
6178
|
+
/** The ID of the space being edited. */
|
|
6179
|
+
spaceId: string;
|
|
6180
|
+
page: ChangedRevisionPage;
|
|
6037
6181
|
}
|
|
6038
|
-
export
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
/** Context about the current user sending a message. */
|
|
6044
|
-
context?: AIMessageContext;
|
|
6045
|
-
attachments?: AIAttachment[];
|
|
6182
|
+
export interface AIToolCallDeletePage {
|
|
6183
|
+
tool: 'deletePage';
|
|
6184
|
+
/** The ID of the space being edited. */
|
|
6185
|
+
spaceId: string;
|
|
6186
|
+
page: ChangedRevisionPage;
|
|
6046
6187
|
}
|
|
6047
|
-
export
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6188
|
+
export interface AIToolCallRenamePage {
|
|
6189
|
+
tool: 'renamePage';
|
|
6190
|
+
/** The ID of the space being edited. */
|
|
6191
|
+
spaceId: string;
|
|
6192
|
+
page: ChangedRevisionPage;
|
|
6193
|
+
/** The new title of the page. */
|
|
6194
|
+
title: string;
|
|
6052
6195
|
}
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
/** The
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
/**
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6196
|
+
export interface AIToolCallMovePage {
|
|
6197
|
+
tool: 'movePage';
|
|
6198
|
+
/** The ID of the space being edited. */
|
|
6199
|
+
spaceId: string;
|
|
6200
|
+
page: ChangedRevisionPage;
|
|
6201
|
+
to?: ChangedRevisionPage;
|
|
6202
|
+
/**
|
|
6203
|
+
* Indicates how the page was moved relative to the "to" page.
|
|
6204
|
+
* - `within`: moved as the last child of the target page (or to the root when `to` is omitted)
|
|
6205
|
+
* - `before`: moved directly before the target page
|
|
6206
|
+
* - `after`: moved directly after the target page
|
|
6207
|
+
*/
|
|
6208
|
+
moveType: 'within' | 'before' | 'after';
|
|
6209
|
+
}
|
|
6210
|
+
export interface AIToolCallListModifiedPages {
|
|
6211
|
+
tool: 'listModifiedPages';
|
|
6212
|
+
/** The ID of the space being accessed. */
|
|
6213
|
+
spaceId: string;
|
|
6214
|
+
}
|
|
6215
|
+
export interface AIToolCallGetPageDiff {
|
|
6216
|
+
tool: 'getPageDiff';
|
|
6217
|
+
/** The ID of the space being accessed. */
|
|
6218
|
+
spaceId: string;
|
|
6219
|
+
page: ChangedRevisionPage;
|
|
6220
|
+
}
|
|
6221
|
+
export interface AIToolCallCreateReusableContent {
|
|
6222
|
+
tool: 'createReusableContent';
|
|
6223
|
+
/** The ID of the space being edited. */
|
|
6224
|
+
spaceId: string;
|
|
6225
|
+
reusableContent: ChangedRevisionReusableContent;
|
|
6226
|
+
}
|
|
6227
|
+
export interface AIToolCallEditReusableContent {
|
|
6228
|
+
tool: 'editReusableContent';
|
|
6229
|
+
/** The ID of the space being edited. */
|
|
6230
|
+
spaceId: string;
|
|
6231
|
+
reusableContent: ChangedRevisionReusableContent;
|
|
6232
|
+
}
|
|
6233
|
+
export interface AIToolCallGetReusableContent {
|
|
6234
|
+
tool: 'getReusableContent';
|
|
6235
|
+
/** The ID of the space being accessed. */
|
|
6236
|
+
spaceId: string;
|
|
6237
|
+
/** The ID of the revision within which the reusable content is being fetched. */
|
|
6238
|
+
revisionId: string;
|
|
6239
|
+
reusableContent: ChangedRevisionReusableContent;
|
|
6240
|
+
}
|
|
6241
|
+
export interface AIToolCallCreateChangeRequest {
|
|
6242
|
+
tool: 'createChangeRequest';
|
|
6243
|
+
/** The ID of the space the change request belongs to. */
|
|
6244
|
+
spaceId: string;
|
|
6245
|
+
action: 'create' | 'update';
|
|
6246
|
+
changeRequest: {
|
|
6247
|
+
/** The unique identifier of the change request. */
|
|
6248
|
+
id: string;
|
|
6249
|
+
/** Incremental identifier of the change request. */
|
|
6250
|
+
number: number;
|
|
6251
|
+
/** A brief summary of the change request. */
|
|
6252
|
+
subject: string;
|
|
6068
6253
|
};
|
|
6069
6254
|
}
|
|
6255
|
+
export interface AIToolCallComment {
|
|
6256
|
+
tool: 'comment';
|
|
6257
|
+
/** The ID of the space being commented. */
|
|
6258
|
+
spaceId: string;
|
|
6259
|
+
/** The page being commented. */
|
|
6260
|
+
page?: ChangedRevisionPage;
|
|
6261
|
+
/** The ID of the comment being posted. */
|
|
6262
|
+
commentId: string;
|
|
6263
|
+
}
|
|
6264
|
+
export interface AIToolCallReplyToComment {
|
|
6265
|
+
tool: 'replyToComment';
|
|
6266
|
+
/** The ID of the space being commented. */
|
|
6267
|
+
spaceId: string;
|
|
6268
|
+
/** The page being commented. */
|
|
6269
|
+
page?: ChangedRevisionPage;
|
|
6270
|
+
/** The ID of the comment being replied to. */
|
|
6271
|
+
commentId: string;
|
|
6272
|
+
/** The ID of the reply being posted. */
|
|
6273
|
+
replyId: string;
|
|
6274
|
+
}
|
|
6275
|
+
export interface AIToolCallSubmitChangeRequestReview {
|
|
6276
|
+
tool: 'submitChangeRequestReview';
|
|
6277
|
+
/** The ID of the space where the review was submitted. */
|
|
6278
|
+
spaceId: string;
|
|
6279
|
+
/** The ID of the change request being reviewed. */
|
|
6280
|
+
changeRequestId: string;
|
|
6281
|
+
/** Result of the review. */
|
|
6282
|
+
status: ChangeRequestReviewStatus;
|
|
6283
|
+
/** Identifier of the review that was created. */
|
|
6284
|
+
reviewId: string;
|
|
6285
|
+
/** Identifier of the comment that was created as part of the review. */
|
|
6286
|
+
commentId: string;
|
|
6287
|
+
}
|
|
6288
|
+
/** Tool called from an MCP server */
|
|
6289
|
+
export interface AIToolCallMCP {
|
|
6290
|
+
tool: 'mcp';
|
|
6291
|
+
/** The ID of the MCP server that has been called. */
|
|
6292
|
+
mcpServerId: string;
|
|
6293
|
+
/** The name of the tool that has been called. */
|
|
6294
|
+
mcpToolName: string;
|
|
6295
|
+
/** The title of the tool that has been called. */
|
|
6296
|
+
mcpToolTitle?: string;
|
|
6297
|
+
}
|
|
6070
6298
|
/** Summary of a generic tool call. */
|
|
6071
6299
|
export interface AIToolCallOtherSummary {
|
|
6072
6300
|
/** Name of the icon */
|
|
@@ -6074,16 +6302,39 @@ export interface AIToolCallOtherSummary {
|
|
|
6074
6302
|
/** Text to display to the user to describe the tool call. */
|
|
6075
6303
|
text: string;
|
|
6076
6304
|
}
|
|
6077
|
-
/**
|
|
6078
|
-
export interface
|
|
6079
|
-
|
|
6080
|
-
tool: string;
|
|
6081
|
-
/** The ID of the tool call. */
|
|
6082
|
-
toolCallId: string;
|
|
6083
|
-
/** The output to the tool call. */
|
|
6084
|
-
output: object;
|
|
6305
|
+
/** Any tool call that is unknown by GitBook */
|
|
6306
|
+
export interface AIToolCallOther {
|
|
6307
|
+
tool: 'other';
|
|
6085
6308
|
/** Summary of a generic tool call. */
|
|
6086
|
-
summary
|
|
6309
|
+
summary: AIToolCallOtherSummary;
|
|
6310
|
+
}
|
|
6311
|
+
export type AIToolCall = AIToolCallGetPageContent | AIToolCallGetPages | AIToolCallGetReusableContents | AIToolCallSearch | AIToolCallEditPage | AIToolCallCreatePage | AIToolCallDeletePage | AIToolCallRenamePage | AIToolCallMovePage | AIToolCallListModifiedPages | AIToolCallGetPageDiff | AIToolCallCreateReusableContent | AIToolCallEditReusableContent | AIToolCallGetReusableContent | AIToolCallCreateChangeRequest | AIToolCallComment | AIToolCallReplyToComment | AIToolCallSubmitChangeRequestReview | AIToolCallMCP | AIToolCallOther;
|
|
6312
|
+
export interface Timerange {
|
|
6313
|
+
start: Timestamp;
|
|
6314
|
+
end: Timestamp;
|
|
6315
|
+
}
|
|
6316
|
+
export interface AIAttachmentImage {
|
|
6317
|
+
type: 'image';
|
|
6318
|
+
url: URL;
|
|
6319
|
+
}
|
|
6320
|
+
export interface AIAttachmentFile {
|
|
6321
|
+
type: 'file';
|
|
6322
|
+
url: URL;
|
|
6323
|
+
/** Name of the file. */
|
|
6324
|
+
filename: string;
|
|
6325
|
+
contentType: 'application/pdf';
|
|
6326
|
+
}
|
|
6327
|
+
export type AIAttachment = AIAttachmentImage | AIAttachmentFile;
|
|
6328
|
+
/** A step in a message from the AI agent. */
|
|
6329
|
+
export interface AIMessageStep {
|
|
6330
|
+
content: JSONDocument;
|
|
6331
|
+
reasoning?: JSONDocument;
|
|
6332
|
+
toolCalls?: AIToolCall[];
|
|
6333
|
+
/** The timing of the step. */
|
|
6334
|
+
timing?: {
|
|
6335
|
+
reasoning?: Timerange;
|
|
6336
|
+
};
|
|
6337
|
+
attachments?: AIAttachment[];
|
|
6087
6338
|
}
|
|
6088
6339
|
/** When the agent is responding to a comment. */
|
|
6089
6340
|
export type AIMessageTask = {
|
|
@@ -6107,14 +6358,6 @@ export type AIMessageTask = {
|
|
|
6107
6358
|
/** The ID of the change request to implement the task in. */
|
|
6108
6359
|
changeRequestId: string;
|
|
6109
6360
|
};
|
|
6110
|
-
/** Message emitted by the server to indicate the start of the AI response. */
|
|
6111
|
-
export interface AIStreamResponseStart {
|
|
6112
|
-
type: 'response_start';
|
|
6113
|
-
/** The ID of the message that this event is composing. */
|
|
6114
|
-
messageId: string;
|
|
6115
|
-
/** When the agent is responding to a comment. */
|
|
6116
|
-
task?: AIMessageTask;
|
|
6117
|
-
}
|
|
6118
6361
|
/** The response that generated this message. */
|
|
6119
6362
|
export interface AIMessageResponseMetadata {
|
|
6120
6363
|
/** The reason the response was stopped. If not defined, the response finished normally. */
|
|
@@ -6124,242 +6367,226 @@ export interface AIMessageResponseMetadata {
|
|
|
6124
6367
|
/** The ID of the previous response that this message is based on. */
|
|
6125
6368
|
previous?: string;
|
|
6126
6369
|
}
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
*/
|
|
6136
|
-
responseId?: string;
|
|
6137
|
-
/** The response metadata associated with the message. */
|
|
6138
|
-
response: AIMessageResponseMetadata;
|
|
6139
|
-
}
|
|
6140
|
-
/** Message emitted by the server to indicate the latest block of the document. The block can either be a new block or an update to the previous block. */
|
|
6141
|
-
export interface AIStreamResponseDocument {
|
|
6142
|
-
type: 'response_document' | 'response_reasoning';
|
|
6143
|
-
/** The ID of the message that this event is composing. */
|
|
6144
|
-
messageId: string;
|
|
6145
|
-
/** The index of the step of the message that this event is composing. */
|
|
6146
|
-
stepIndex: number;
|
|
6147
|
-
operation: 'insert' | 'update';
|
|
6148
|
-
blocks: DocumentBlocksTopLevels[];
|
|
6149
|
-
}
|
|
6150
|
-
/** Message emitted by the server to indicate a chunk of the JSON object response. */
|
|
6151
|
-
export interface AIStreamResponseObject {
|
|
6152
|
-
type: 'response_object';
|
|
6153
|
-
/** The ID of the message that this event is composing. */
|
|
6154
|
-
messageId: string;
|
|
6155
|
-
/** The chunk of the JSON object response */
|
|
6156
|
-
jsonChunk: string;
|
|
6157
|
-
}
|
|
6158
|
-
export interface AIToolCallGetPageContent {
|
|
6159
|
-
tool: 'getPageContent';
|
|
6160
|
-
/** The ID of the space being accessed. */
|
|
6161
|
-
spaceId: string;
|
|
6162
|
-
/** The ID of the revision within which the page content is being fetched. */
|
|
6163
|
-
revisionId: string;
|
|
6164
|
-
page: ChangedRevisionPage;
|
|
6165
|
-
}
|
|
6166
|
-
export interface AIToolCallGetPages {
|
|
6167
|
-
tool: 'getPages';
|
|
6168
|
-
/** The ID of the space being accessed. */
|
|
6169
|
-
spaceId: string;
|
|
6170
|
-
/** The revision ID of the space. */
|
|
6171
|
-
revisionId: string;
|
|
6172
|
-
}
|
|
6173
|
-
export interface AIToolCallGetReusableContents {
|
|
6174
|
-
tool: 'getReusableContents';
|
|
6175
|
-
/** The ID of the space being accessed. */
|
|
6176
|
-
spaceId: string;
|
|
6177
|
-
/** The revision ID of the space. */
|
|
6178
|
-
revisionId: string;
|
|
6370
|
+
export interface AIMessage {
|
|
6371
|
+
id: string;
|
|
6372
|
+
role: AIMessageRole;
|
|
6373
|
+
steps: AIMessageStep[];
|
|
6374
|
+
/** When the agent is responding to a comment. */
|
|
6375
|
+
task?: AIMessageTask;
|
|
6376
|
+
/** The response that generated this message. */
|
|
6377
|
+
response?: AIMessageResponseMetadata;
|
|
6179
6378
|
}
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
/** The revision ID of the result */
|
|
6191
|
-
revisionId: string;
|
|
6192
|
-
/** The anchor of the result */
|
|
6193
|
-
anchor?: string;
|
|
6194
|
-
/** The title of the result */
|
|
6379
|
+
export type SiteQuestionAnswerWithResponse = SiteQuestionAnswer & {
|
|
6380
|
+
response: AIMessage;
|
|
6381
|
+
};
|
|
6382
|
+
export interface SiteQuestionAnswerSourceBase {
|
|
6383
|
+
object: 'site-question-answer-source';
|
|
6384
|
+
/** The ID of the source. */
|
|
6385
|
+
id: string;
|
|
6386
|
+
/** Relative weight of this source in the generated answer. */
|
|
6387
|
+
weight: number;
|
|
6388
|
+
/** The title of the source. */
|
|
6195
6389
|
title: string;
|
|
6196
|
-
/**
|
|
6197
|
-
|
|
6390
|
+
/** URLs associated with the site question answer. */
|
|
6391
|
+
urls: {
|
|
6392
|
+
/**
|
|
6393
|
+
* URL of the site question answer in the API.
|
|
6394
|
+
* @format uri
|
|
6395
|
+
*/
|
|
6396
|
+
location: string;
|
|
6397
|
+
};
|
|
6198
6398
|
}
|
|
6199
|
-
/**
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
*/
|
|
6203
|
-
|
|
6399
|
+
/** Source data pointing to a page used for a site question answer. */
|
|
6400
|
+
export type SiteQuestionAnswerSourcePage = SiteQuestionAnswerSourceBase & {
|
|
6401
|
+
type: 'page';
|
|
6402
|
+
/** The space ID of the source page. */
|
|
6403
|
+
space: string;
|
|
6404
|
+
/** The revision ID used for this source page. */
|
|
6405
|
+
revision: string;
|
|
6406
|
+
/** The page ID of the source page. */
|
|
6407
|
+
page: string;
|
|
6408
|
+
};
|
|
6409
|
+
export type SiteQuestionAnswerSourceRecord = SiteQuestionAnswerSourceBase & {
|
|
6204
6410
|
type: 'record';
|
|
6205
|
-
/** The
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
url?: string;
|
|
6411
|
+
/** The site context record ID. */
|
|
6412
|
+
record: string;
|
|
6413
|
+
};
|
|
6414
|
+
export type SiteQuestionAnswerSource = SiteQuestionAnswerSourcePage | SiteQuestionAnswerSourceRecord;
|
|
6415
|
+
export type SiteSpaceCustomizationSettings = SiteCustomizationSettings & {
|
|
6416
|
+
/** Indicates whether the site customization settings have been overridden. */
|
|
6417
|
+
hasOverrides: boolean;
|
|
6418
|
+
};
|
|
6419
|
+
export interface SiteSectionGroupPointer {
|
|
6420
|
+
type: 'site-section' | 'site-section-group';
|
|
6421
|
+
/** Unique identifier for the site section */
|
|
6422
|
+
id: string;
|
|
6218
6423
|
}
|
|
6219
|
-
/**
|
|
6220
|
-
export
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
tool: 'search';
|
|
6224
|
-
/** The query that has been searched for. */
|
|
6225
|
-
query: string;
|
|
6226
|
-
results: AIToolCallSearchResult[];
|
|
6424
|
+
/** Position at which to move the site section group. */
|
|
6425
|
+
export interface SiteSectionGroupMovePosition {
|
|
6426
|
+
before?: SiteSectionGroupPointer;
|
|
6427
|
+
after?: SiteSectionGroupPointer;
|
|
6227
6428
|
}
|
|
6228
|
-
export interface
|
|
6229
|
-
|
|
6230
|
-
/**
|
|
6231
|
-
|
|
6232
|
-
page: ChangedRevisionPage;
|
|
6429
|
+
export interface SiteSectionPointer {
|
|
6430
|
+
type: 'site-section';
|
|
6431
|
+
/** Unique identifier for the site section */
|
|
6432
|
+
siteSection: string;
|
|
6233
6433
|
}
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
page: ChangedRevisionPage;
|
|
6434
|
+
/** Position at which to move the site section to. */
|
|
6435
|
+
export interface SiteSectionMovePosition {
|
|
6436
|
+
before?: SiteSectionPointer;
|
|
6437
|
+
after?: SiteSectionPointer;
|
|
6239
6438
|
}
|
|
6240
|
-
export interface
|
|
6241
|
-
|
|
6242
|
-
/**
|
|
6243
|
-
|
|
6244
|
-
page: ChangedRevisionPage;
|
|
6439
|
+
export interface SiteSpacePointer {
|
|
6440
|
+
type: 'site-space';
|
|
6441
|
+
/** Unique identifier for the site space */
|
|
6442
|
+
siteSpace: string;
|
|
6245
6443
|
}
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
page: ChangedRevisionPage;
|
|
6251
|
-
/** The new title of the page. */
|
|
6252
|
-
title: string;
|
|
6444
|
+
/** Position at which to move the site space to. */
|
|
6445
|
+
export interface SiteSpaceMovePosition {
|
|
6446
|
+
before?: SiteSpacePointer;
|
|
6447
|
+
after?: SiteSpacePointer;
|
|
6253
6448
|
}
|
|
6254
|
-
export
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6449
|
+
export type InviteSiteUsersAndTeams = ({
|
|
6450
|
+
/** @minItems 1 */
|
|
6451
|
+
teams: string[];
|
|
6452
|
+
} | {
|
|
6453
|
+
/** @minItems 1 */
|
|
6454
|
+
users: string[];
|
|
6455
|
+
}) & {
|
|
6456
|
+
/** Role to set. */
|
|
6457
|
+
role: MemberRole;
|
|
6458
|
+
};
|
|
6459
|
+
export interface OrganizationPointer {
|
|
6460
|
+
type: 'organization';
|
|
6461
|
+
/** Unique identifier for the organization */
|
|
6462
|
+
organization: string;
|
|
6463
|
+
}
|
|
6464
|
+
/** Permission of a user in a site. */
|
|
6465
|
+
export interface UserSitePermission {
|
|
6466
|
+
/** The role of a member in an organization, null for guests */
|
|
6467
|
+
permission: MemberRoleOrGuest;
|
|
6468
|
+
user: User;
|
|
6469
|
+
/** The content or organization that enforced this permission level. */
|
|
6470
|
+
origin: SpacePointer | OrganizationPointer;
|
|
6471
|
+
}
|
|
6472
|
+
/** Permission override of a user in a site. */
|
|
6473
|
+
export interface UserSitePermissionOverride {
|
|
6260
6474
|
/**
|
|
6261
|
-
*
|
|
6262
|
-
*
|
|
6263
|
-
*
|
|
6264
|
-
*
|
|
6475
|
+
* "The role of a member in an organization.
|
|
6476
|
+
* "admin": Can administrate the content: create, delete spaces, ...
|
|
6477
|
+
* "create": Can create content.
|
|
6478
|
+
* "review": Can review content.
|
|
6479
|
+
* "edit": Can edit the content (live or change requests).
|
|
6480
|
+
* "comment": Can access the content and its discussions.
|
|
6481
|
+
* "read": Can access the content, but cannot update it in any way.
|
|
6265
6482
|
*/
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
export interface AIToolCallListModifiedPages {
|
|
6269
|
-
tool: 'listModifiedPages';
|
|
6270
|
-
/** The ID of the space being accessed. */
|
|
6271
|
-
spaceId: string;
|
|
6483
|
+
permission: MemberRole;
|
|
6484
|
+
user: User;
|
|
6272
6485
|
}
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
/**
|
|
6276
|
-
|
|
6277
|
-
|
|
6486
|
+
/** Permission override of a team in a site. */
|
|
6487
|
+
export interface TeamSitePermissionOverride {
|
|
6488
|
+
/**
|
|
6489
|
+
* "The role of a member in an organization.
|
|
6490
|
+
* "admin": Can administrate the content: create, delete spaces, ...
|
|
6491
|
+
* "create": Can create content.
|
|
6492
|
+
* "review": Can review content.
|
|
6493
|
+
* "edit": Can edit the content (live or change requests).
|
|
6494
|
+
* "comment": Can access the content and its discussions.
|
|
6495
|
+
* "read": Can access the content, but cannot update it in any way.
|
|
6496
|
+
*/
|
|
6497
|
+
permission: MemberRole;
|
|
6498
|
+
team: OrganizationTeam;
|
|
6278
6499
|
}
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6500
|
+
/** Context about the current user sending a message. */
|
|
6501
|
+
export interface AIMessageContext {
|
|
6502
|
+
location?: {
|
|
6503
|
+
/** ID of the current space. */
|
|
6504
|
+
spaceId: string;
|
|
6505
|
+
/** ID of the current page. */
|
|
6506
|
+
pageId: string;
|
|
6507
|
+
};
|
|
6284
6508
|
}
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6509
|
+
/** Input version of an AI message. */
|
|
6510
|
+
export interface AIMessageInput {
|
|
6511
|
+
role: 'user';
|
|
6512
|
+
content: string | JSONDocument;
|
|
6513
|
+
/** Context about the current user sending a message. */
|
|
6514
|
+
context?: AIMessageContext;
|
|
6515
|
+
attachments?: AIAttachment[];
|
|
6290
6516
|
}
|
|
6291
|
-
export
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
revisionId: string;
|
|
6297
|
-
reusableContent: ChangedRevisionReusableContent;
|
|
6517
|
+
export declare enum AIModel {
|
|
6518
|
+
Fast = "fast",
|
|
6519
|
+
ReasoningLow = "reasoning-low",
|
|
6520
|
+
ReasoningMedium = "reasoning-medium",
|
|
6521
|
+
ReasoningHigh = "reasoning-high"
|
|
6298
6522
|
}
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
/** The
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6523
|
+
/** Description of a tool that can be called from an AI agent. */
|
|
6524
|
+
export interface AIToolDefinition {
|
|
6525
|
+
/** The name of the tool. It should be unique within the agent. */
|
|
6526
|
+
name: string;
|
|
6527
|
+
/** The description of the tool, passed to the AI agent. */
|
|
6528
|
+
description: string;
|
|
6529
|
+
/** JSON schema describing the input of the tool. */
|
|
6530
|
+
inputSchema?: {
|
|
6531
|
+
type: 'object';
|
|
6532
|
+
properties: Record<string, {
|
|
6533
|
+
type: 'string' | 'number' | 'boolean' | 'array' | 'object';
|
|
6534
|
+
/** Description of the property. */
|
|
6535
|
+
description: string;
|
|
6536
|
+
[key: string]: any;
|
|
6537
|
+
}>;
|
|
6311
6538
|
};
|
|
6312
6539
|
}
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
/** The
|
|
6316
|
-
|
|
6317
|
-
/** The
|
|
6318
|
-
|
|
6319
|
-
/** The
|
|
6320
|
-
|
|
6540
|
+
/** Result of a tool call. */
|
|
6541
|
+
export interface AIToolCallResult {
|
|
6542
|
+
/** The name of the tool that was called. */
|
|
6543
|
+
tool: string;
|
|
6544
|
+
/** The ID of the tool call. */
|
|
6545
|
+
toolCallId: string;
|
|
6546
|
+
/** The output to the tool call. */
|
|
6547
|
+
output: object;
|
|
6548
|
+
/** Summary of a generic tool call. */
|
|
6549
|
+
summary?: AIToolCallOtherSummary;
|
|
6321
6550
|
}
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
commentId: string;
|
|
6330
|
-
/** The ID of the reply being posted. */
|
|
6331
|
-
replyId: string;
|
|
6551
|
+
/** Message emitted by the server to indicate the start of the AI response. */
|
|
6552
|
+
export interface AIStreamResponseStart {
|
|
6553
|
+
type: 'response_start';
|
|
6554
|
+
/** The ID of the message that this event is composing. */
|
|
6555
|
+
messageId: string;
|
|
6556
|
+
/** When the agent is responding to a comment. */
|
|
6557
|
+
task?: AIMessageTask;
|
|
6332
6558
|
}
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
/**
|
|
6344
|
-
|
|
6559
|
+
/** Message emitted by the server to indicate the end of the AI response. It contains the ID of the response to be referenced for followup requests. */
|
|
6560
|
+
export interface AIStreamResponseFinish {
|
|
6561
|
+
type: 'response_finish';
|
|
6562
|
+
/** The ID of the message that this event is composing. */
|
|
6563
|
+
messageId: string;
|
|
6564
|
+
/**
|
|
6565
|
+
* The ID of the response
|
|
6566
|
+
* @deprecated
|
|
6567
|
+
*/
|
|
6568
|
+
responseId?: string;
|
|
6569
|
+
/** The response metadata associated with the message. */
|
|
6570
|
+
response: AIMessageResponseMetadata;
|
|
6345
6571
|
}
|
|
6346
|
-
/**
|
|
6347
|
-
export interface
|
|
6348
|
-
|
|
6349
|
-
/** The ID of the
|
|
6350
|
-
|
|
6351
|
-
/** The
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6572
|
+
/** Message emitted by the server to indicate the latest block of the document. The block can either be a new block or an update to the previous block. */
|
|
6573
|
+
export interface AIStreamResponseDocument {
|
|
6574
|
+
type: 'response_document' | 'response_reasoning';
|
|
6575
|
+
/** The ID of the message that this event is composing. */
|
|
6576
|
+
messageId: string;
|
|
6577
|
+
/** The index of the step of the message that this event is composing. */
|
|
6578
|
+
stepIndex: number;
|
|
6579
|
+
operation: 'insert' | 'update';
|
|
6580
|
+
blocks: DocumentBlocksTopLevels[];
|
|
6355
6581
|
}
|
|
6356
|
-
/**
|
|
6357
|
-
export interface
|
|
6358
|
-
|
|
6359
|
-
/**
|
|
6360
|
-
|
|
6582
|
+
/** Message emitted by the server to indicate a chunk of the JSON object response. */
|
|
6583
|
+
export interface AIStreamResponseObject {
|
|
6584
|
+
type: 'response_object';
|
|
6585
|
+
/** The ID of the message that this event is composing. */
|
|
6586
|
+
messageId: string;
|
|
6587
|
+
/** The chunk of the JSON object response */
|
|
6588
|
+
jsonChunk: string;
|
|
6361
6589
|
}
|
|
6362
|
-
export type AIToolCall = AIToolCallGetPageContent | AIToolCallGetPages | AIToolCallGetReusableContents | AIToolCallSearch | AIToolCallEditPage | AIToolCallCreatePage | AIToolCallDeletePage | AIToolCallRenamePage | AIToolCallMovePage | AIToolCallListModifiedPages | AIToolCallGetPageDiff | AIToolCallCreateReusableContent | AIToolCallEditReusableContent | AIToolCallGetReusableContent | AIToolCallCreateChangeRequest | AIToolCallComment | AIToolCallReplyToComment | AIToolCallSubmitChangeRequestReview | AIToolCallMCP | AIToolCallOther;
|
|
6363
6590
|
/** Message emitted by the server to indicate that the AI has called a tool. */
|
|
6364
6591
|
export interface AIStreamResponseToolCall {
|
|
6365
6592
|
type: 'response_tool_call';
|
|
@@ -6404,11 +6631,7 @@ export interface AIStreamResponseAttachment {
|
|
|
6404
6631
|
}
|
|
6405
6632
|
export type AIStreamResponse = AIStreamResponseStart | AIStreamResponseFinish | AIStreamResponseDocument | AIStreamResponseObject | AIStreamResponseToolCall | AIStreamResponseToolCallPending | AIStreamResponseFollowupSuggestion | AIStreamResponseAttachment;
|
|
6406
6633
|
/** Analytics info on the GitBook's site session. */
|
|
6407
|
-
export
|
|
6408
|
-
/** GitBook's unique identifier of the visitor. */
|
|
6409
|
-
visitorId: string;
|
|
6410
|
-
/** GitBook's unique identifier of the visitor's session. */
|
|
6411
|
-
sessionId: string;
|
|
6634
|
+
export type SiteInsightsEventSession = SiteInsightsSession & {
|
|
6412
6635
|
/** The visitors cookies. */
|
|
6413
6636
|
cookies: Record<string, string>;
|
|
6414
6637
|
/**
|
|
@@ -6438,7 +6661,7 @@ export interface SiteInsightsEventSession {
|
|
|
6438
6661
|
* This is used to identify the visitor with adaptive content.
|
|
6439
6662
|
*/
|
|
6440
6663
|
visitorAuthClaims?: PlainObject;
|
|
6441
|
-
}
|
|
6664
|
+
};
|
|
6442
6665
|
/** Context in which the event was recorded. */
|
|
6443
6666
|
export declare enum SiteInsightsDisplayContext {
|
|
6444
6667
|
Site = "site",
|
|
@@ -6959,6 +7182,14 @@ export interface SiteRedirect {
|
|
|
6959
7182
|
source: SiteRedirectSourcePath;
|
|
6960
7183
|
destination: SiteRedirectDestination;
|
|
6961
7184
|
}
|
|
7185
|
+
export interface SiteRedirectInputDestinationPath {
|
|
7186
|
+
kind: 'path';
|
|
7187
|
+
/** Unique identifier for the space containing the page referenced by the path. */
|
|
7188
|
+
spaceId: string;
|
|
7189
|
+
/** Path to the page within the space revision to resolve. */
|
|
7190
|
+
path: string;
|
|
7191
|
+
}
|
|
7192
|
+
export type SiteRedirectInputDestination = SiteRedirectDestination | SiteRedirectInputDestinationPath;
|
|
6962
7193
|
/**
|
|
6963
7194
|
* Name of the MCP server
|
|
6964
7195
|
* @minLength 1
|
|
@@ -7236,10 +7467,6 @@ export interface SiteVisitorPayload {
|
|
|
7236
7467
|
jwtToken?: string;
|
|
7237
7468
|
unsignedClaims?: PlainObject;
|
|
7238
7469
|
}
|
|
7239
|
-
export interface Timerange {
|
|
7240
|
-
start: Timestamp;
|
|
7241
|
-
end: Timestamp;
|
|
7242
|
-
}
|
|
7243
7470
|
/**
|
|
7244
7471
|
* @minLength 64
|
|
7245
7472
|
* @maxLength 64
|
|
@@ -7978,6 +8205,11 @@ export declare enum SiteAdsStatus {
|
|
|
7978
8205
|
Rejected = "rejected",
|
|
7979
8206
|
Disabled = "disabled"
|
|
7980
8207
|
}
|
|
8208
|
+
/** Source type used to answer a site question. */
|
|
8209
|
+
export declare enum SiteQuestionAnswerSourceType {
|
|
8210
|
+
Page = "page",
|
|
8211
|
+
Record = "record"
|
|
8212
|
+
}
|
|
7981
8213
|
export interface Seat {
|
|
7982
8214
|
object: 'seat';
|
|
7983
8215
|
/** The unique ID of the organization */
|
|
@@ -7989,31 +8221,6 @@ export interface Seat {
|
|
|
7989
8221
|
/** @format date-time */
|
|
7990
8222
|
updatedAt: string;
|
|
7991
8223
|
}
|
|
7992
|
-
export declare enum AIMessageRole {
|
|
7993
|
-
User = "user",
|
|
7994
|
-
Assistant = "assistant",
|
|
7995
|
-
Developer = "developer"
|
|
7996
|
-
}
|
|
7997
|
-
/** A step in a message from the AI agent. */
|
|
7998
|
-
export interface AIMessageStep {
|
|
7999
|
-
content: JSONDocument;
|
|
8000
|
-
reasoning?: JSONDocument;
|
|
8001
|
-
toolCalls?: AIToolCall[];
|
|
8002
|
-
/** The timing of the step. */
|
|
8003
|
-
timing?: {
|
|
8004
|
-
reasoning?: Timerange;
|
|
8005
|
-
};
|
|
8006
|
-
attachments?: AIAttachment[];
|
|
8007
|
-
}
|
|
8008
|
-
export interface AIMessage {
|
|
8009
|
-
id: string;
|
|
8010
|
-
role: AIMessageRole;
|
|
8011
|
-
steps: AIMessageStep[];
|
|
8012
|
-
/** When the agent is responding to a comment. */
|
|
8013
|
-
task?: AIMessageTask;
|
|
8014
|
-
/** The response that generated this message. */
|
|
8015
|
-
response?: AIMessageResponseMetadata;
|
|
8016
|
-
}
|
|
8017
8224
|
/** Payload emitted by the agent to reset the messages. */
|
|
8018
8225
|
export interface AgentStreamMessages {
|
|
8019
8226
|
type: 'messages';
|
|
@@ -13318,7 +13525,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
13318
13525
|
*/
|
|
13319
13526
|
limit?: number;
|
|
13320
13527
|
}, params?: RequestParams) => Promise<HttpResponse<List & {
|
|
13321
|
-
items: SearchSpaceResult[];
|
|
13528
|
+
items: (SearchSpaceResult | SearchRecordResult)[];
|
|
13322
13529
|
}, any>>;
|
|
13323
13530
|
/**
|
|
13324
13531
|
* @description The response is streamed.
|
|
@@ -13383,6 +13590,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
13383
13590
|
connector?: ContextConnector;
|
|
13384
13591
|
/** Filter context records by connection id. */
|
|
13385
13592
|
connection?: string;
|
|
13593
|
+
/** Filter context records by associated site topic ID. */
|
|
13594
|
+
topic?: string;
|
|
13386
13595
|
}, params?: RequestParams) => Promise<HttpResponse<List & {
|
|
13387
13596
|
items: ContextRecord[];
|
|
13388
13597
|
}, any>>;
|
|
@@ -13483,12 +13692,48 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
13483
13692
|
* No description
|
|
13484
13693
|
*
|
|
13485
13694
|
* @tags site-context
|
|
13486
|
-
* @name
|
|
13487
|
-
* @summary List all
|
|
13488
|
-
* @request GET:/orgs/{organizationId}/sites/{siteId}/
|
|
13695
|
+
* @name ListSiteTopics
|
|
13696
|
+
* @summary List all topics
|
|
13697
|
+
* @request GET:/orgs/{organizationId}/sites/{siteId}/topics
|
|
13698
|
+
* @secure
|
|
13699
|
+
*/
|
|
13700
|
+
listSiteTopics: (organizationId: string, siteId: string, params?: RequestParams) => Promise<HttpResponse<{
|
|
13701
|
+
items: SiteTopic[];
|
|
13702
|
+
}, any>>;
|
|
13703
|
+
/**
|
|
13704
|
+
* No description
|
|
13705
|
+
*
|
|
13706
|
+
* @tags site-context
|
|
13707
|
+
* @name GetSiteTopicById
|
|
13708
|
+
* @summary Get a topic
|
|
13709
|
+
* @request GET:/orgs/{organizationId}/sites/{siteId}/topics/{siteTopicId}
|
|
13710
|
+
* @secure
|
|
13711
|
+
*/
|
|
13712
|
+
getSiteTopicById: (organizationId: string, siteId: string, siteTopicId: string, params?: RequestParams) => Promise<HttpResponse<SiteTopic, any>>;
|
|
13713
|
+
/**
|
|
13714
|
+
* No description
|
|
13715
|
+
*
|
|
13716
|
+
* @tags site-context
|
|
13717
|
+
* @name UpdateSiteTopicById
|
|
13718
|
+
* @summary Update a topic
|
|
13719
|
+
* @request PATCH:/orgs/{organizationId}/sites/{siteId}/topics/{siteTopicId}
|
|
13720
|
+
* @secure
|
|
13721
|
+
*/
|
|
13722
|
+
updateSiteTopicById: (organizationId: string, siteId: string, siteTopicId: string, data: {
|
|
13723
|
+
usageSettings: ContextUsageSettings;
|
|
13724
|
+
}, params?: RequestParams) => Promise<HttpResponse<SiteTopic, any>>;
|
|
13725
|
+
/**
|
|
13726
|
+
* No description
|
|
13727
|
+
*
|
|
13728
|
+
* @tags site-questions
|
|
13729
|
+
* @name ListSiteQuestions
|
|
13730
|
+
* @summary List all questions in a site
|
|
13731
|
+
* @request GET:/orgs/{organizationId}/sites/{siteId}/questions
|
|
13489
13732
|
* @secure
|
|
13490
13733
|
*/
|
|
13491
|
-
|
|
13734
|
+
listSiteQuestions: (organizationId: string, siteId: string, query?: {
|
|
13735
|
+
/** Filter questions by question type. */
|
|
13736
|
+
type?: SiteQuestionType;
|
|
13492
13737
|
/** Identifier of the page results to fetch. */
|
|
13493
13738
|
page?: string;
|
|
13494
13739
|
/**
|
|
@@ -13498,30 +13743,86 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
13498
13743
|
*/
|
|
13499
13744
|
limit?: number;
|
|
13500
13745
|
}, params?: RequestParams) => Promise<HttpResponse<List & {
|
|
13501
|
-
items:
|
|
13746
|
+
items: SiteQuestion[];
|
|
13502
13747
|
}, any>>;
|
|
13503
13748
|
/**
|
|
13504
13749
|
* No description
|
|
13505
13750
|
*
|
|
13506
|
-
* @tags site-
|
|
13507
|
-
* @name
|
|
13508
|
-
* @summary Get a
|
|
13509
|
-
* @request GET:/orgs/{organizationId}/sites/{siteId}/
|
|
13751
|
+
* @tags site-questions
|
|
13752
|
+
* @name GetSiteQuestionById
|
|
13753
|
+
* @summary Get a site question by ID
|
|
13754
|
+
* @request GET:/orgs/{organizationId}/sites/{siteId}/questions/{siteQuestionId}
|
|
13510
13755
|
* @secure
|
|
13511
13756
|
*/
|
|
13512
|
-
|
|
13757
|
+
getSiteQuestionById: (organizationId: string, siteId: string, siteQuestionId: string, params?: RequestParams) => Promise<HttpResponse<SiteQuestion, any>>;
|
|
13513
13758
|
/**
|
|
13514
13759
|
* No description
|
|
13515
13760
|
*
|
|
13516
|
-
* @tags site-
|
|
13517
|
-
* @name
|
|
13518
|
-
* @summary
|
|
13519
|
-
* @request
|
|
13761
|
+
* @tags site-questions
|
|
13762
|
+
* @name ListSiteQuestionAnswers
|
|
13763
|
+
* @summary List all answers for a site
|
|
13764
|
+
* @request GET:/orgs/{organizationId}/sites/{siteId}/answers
|
|
13520
13765
|
* @secure
|
|
13521
13766
|
*/
|
|
13522
|
-
|
|
13523
|
-
|
|
13524
|
-
|
|
13767
|
+
listSiteQuestionAnswers: (organizationId: string, siteId: string, query?: {
|
|
13768
|
+
/** Filter answers to a specific site question ID. */
|
|
13769
|
+
question?: string;
|
|
13770
|
+
/** Filter answers by ISO language code. */
|
|
13771
|
+
language?: string;
|
|
13772
|
+
/** Filter answers by answered resolution. */
|
|
13773
|
+
answered?: SiteQuestionAnswerResolution;
|
|
13774
|
+
/** Filter answers by answered confidence. */
|
|
13775
|
+
confidence?: SiteQuestionAnswerConfidence;
|
|
13776
|
+
/** Filter answers by question relevance. */
|
|
13777
|
+
relevance?: SiteQuestionAnswerRelevance;
|
|
13778
|
+
/** Filter answers by question type. */
|
|
13779
|
+
questionType?: SiteQuestionType;
|
|
13780
|
+
/** Filter answers by associated site topic ID. */
|
|
13781
|
+
topic?: string;
|
|
13782
|
+
/** Filter answers by thread root answer ID. Includes the root answer itself. */
|
|
13783
|
+
thread?: string;
|
|
13784
|
+
/** Identifier of the page results to fetch. */
|
|
13785
|
+
page?: string;
|
|
13786
|
+
/**
|
|
13787
|
+
* The number of results per page
|
|
13788
|
+
* @min 0
|
|
13789
|
+
* @max 1000
|
|
13790
|
+
*/
|
|
13791
|
+
limit?: number;
|
|
13792
|
+
}, params?: RequestParams) => Promise<HttpResponse<List & {
|
|
13793
|
+
items: SiteQuestionAnswer[];
|
|
13794
|
+
}, any>>;
|
|
13795
|
+
/**
|
|
13796
|
+
* No description
|
|
13797
|
+
*
|
|
13798
|
+
* @tags site-questions
|
|
13799
|
+
* @name GetSiteQuestionAnswerById
|
|
13800
|
+
* @summary Get a site answer by ID
|
|
13801
|
+
* @request GET:/orgs/{organizationId}/sites/{siteId}/answers/{siteQuestionAnswerId}
|
|
13802
|
+
* @secure
|
|
13803
|
+
*/
|
|
13804
|
+
getSiteQuestionAnswerById: (organizationId: string, siteId: string, siteQuestionAnswerId: string, params?: RequestParams) => Promise<HttpResponse<SiteQuestionAnswerWithResponse, any>>;
|
|
13805
|
+
/**
|
|
13806
|
+
* No description
|
|
13807
|
+
*
|
|
13808
|
+
* @tags site-questions
|
|
13809
|
+
* @name ListSiteQuestionAnswerSources
|
|
13810
|
+
* @summary List the sources for an answer
|
|
13811
|
+
* @request GET:/orgs/{organizationId}/sites/{siteId}/answers/{siteQuestionAnswerId}/sources
|
|
13812
|
+
* @secure
|
|
13813
|
+
*/
|
|
13814
|
+
listSiteQuestionAnswerSources: (organizationId: string, siteId: string, siteQuestionAnswerId: string, query?: {
|
|
13815
|
+
/** Identifier of the page results to fetch. */
|
|
13816
|
+
page?: string;
|
|
13817
|
+
/**
|
|
13818
|
+
* The number of results per page
|
|
13819
|
+
* @min 0
|
|
13820
|
+
* @max 1000
|
|
13821
|
+
*/
|
|
13822
|
+
limit?: number;
|
|
13823
|
+
}, params?: RequestParams) => Promise<HttpResponse<List & {
|
|
13824
|
+
items: SiteQuestionAnswerSource[];
|
|
13825
|
+
}, any>>;
|
|
13525
13826
|
/**
|
|
13526
13827
|
* No description
|
|
13527
13828
|
*
|
|
@@ -13980,6 +14281,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
13980
14281
|
tools?: AIToolDefinition[];
|
|
13981
14282
|
/** Result of a tool call. */
|
|
13982
14283
|
toolCall?: AIToolCallResult;
|
|
14284
|
+
/** Identifiers for a GitBook site session, used for analytics and adaptive content. */
|
|
14285
|
+
session?: SiteInsightsSession;
|
|
13983
14286
|
}, params?: RequestParams) => EventIterator<AIStreamResponse>;
|
|
13984
14287
|
/**
|
|
13985
14288
|
* No description
|
|
@@ -14041,8 +14344,51 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
14041
14344
|
createSiteRedirect: (organizationId: string, siteId: string, data: {
|
|
14042
14345
|
/** The source path to redirect from. */
|
|
14043
14346
|
source: SiteRedirectSourcePath;
|
|
14044
|
-
destination:
|
|
14347
|
+
destination: SiteRedirectInputDestination;
|
|
14045
14348
|
}, params?: RequestParams) => Promise<HttpResponse<SiteRedirect, any>>;
|
|
14349
|
+
/**
|
|
14350
|
+
* No description
|
|
14351
|
+
*
|
|
14352
|
+
* @tags site-redirects
|
|
14353
|
+
* @name BulkUpsertSiteRedirects
|
|
14354
|
+
* @summary Create or update site redirects in bulk
|
|
14355
|
+
* @request PUT:/orgs/{organizationId}/sites/{siteId}/redirects
|
|
14356
|
+
* @secure
|
|
14357
|
+
*/
|
|
14358
|
+
bulkUpsertSiteRedirects: (organizationId: string, siteId: string, data: {
|
|
14359
|
+
/**
|
|
14360
|
+
* @maxItems 500
|
|
14361
|
+
* @minItems 1
|
|
14362
|
+
*/
|
|
14363
|
+
redirects: {
|
|
14364
|
+
/** The source path to redirect from. */
|
|
14365
|
+
source: SiteRedirectSourcePath;
|
|
14366
|
+
destination: SiteRedirectInputDestination;
|
|
14367
|
+
}[];
|
|
14368
|
+
}, params?: RequestParams) => Promise<HttpResponse<{
|
|
14369
|
+
results: ({
|
|
14370
|
+
/** The redirect was created. */
|
|
14371
|
+
status: "created";
|
|
14372
|
+
/** The source path to redirect from. */
|
|
14373
|
+
source: SiteRedirectSourcePath;
|
|
14374
|
+
/** The ID of the created redirect. */
|
|
14375
|
+
id: string;
|
|
14376
|
+
} | {
|
|
14377
|
+
/** The redirect was updated. */
|
|
14378
|
+
status: "updated";
|
|
14379
|
+
/** The source path to redirect from. */
|
|
14380
|
+
source: SiteRedirectSourcePath;
|
|
14381
|
+
/** The ID of the updated redirect. */
|
|
14382
|
+
id: string;
|
|
14383
|
+
} | {
|
|
14384
|
+
/** There was an error processing the redirect. */
|
|
14385
|
+
status: "error";
|
|
14386
|
+
/** The source path to redirect from. */
|
|
14387
|
+
source: SiteRedirectSourcePath;
|
|
14388
|
+
/** The error message. */
|
|
14389
|
+
error: string;
|
|
14390
|
+
})[];
|
|
14391
|
+
}, any>>;
|
|
14046
14392
|
/**
|
|
14047
14393
|
* No description
|
|
14048
14394
|
*
|