@gitbook/api 0.198.0 → 0.199.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 CHANGED
@@ -35,6 +35,29 @@ export declare enum BillingStatus {
35
35
  Unpaid = "unpaid",
36
36
  Paused = "paused"
37
37
  }
38
+ /** Lifecycle state of a pull or merge request on the Git provider. */
39
+ export declare enum GitProviderChangeState {
40
+ Open = "open",
41
+ Closed = "closed",
42
+ Merged = "merged"
43
+ }
44
+ /** Lifecycle state of a durable Git Sync run. */
45
+ export declare enum GitSyncRunState {
46
+ Queued = "queued",
47
+ Running = "running",
48
+ Success = "success",
49
+ Failure = "failure",
50
+ Timeout = "timeout",
51
+ Cancelled = "cancelled"
52
+ }
53
+ /** Operation performed by a durable Git Sync run. */
54
+ export declare enum GitSyncRunOperation {
55
+ Import = "import",
56
+ Export = "export",
57
+ Check = "check",
58
+ Merge = "merge",
59
+ Recovery = "recovery"
60
+ }
38
61
  /**
39
62
  * Core stages of a Git Sync process. This is not exhaustive, but should cover
40
63
  * the important ones.
@@ -258,6 +281,10 @@ export declare enum SiteInsightsLinkPosition {
258
281
  Sidebar = "sidebar",
259
282
  Content = "content"
260
283
  }
284
+ /** How a page's markdown was requested. `page-action` means a reader used the site's page-actions menu — its copy or view-as-markdown action — rather than a client fetching the URL directly. */
285
+ export declare enum SiteInsightsMarkdownSource {
286
+ PageAction = "page-action"
287
+ }
261
288
  /** Context in which the event was recorded. */
262
289
  export declare enum SiteInsightsDisplayContext {
263
290
  Site = "site",
@@ -2307,6 +2334,26 @@ export type DocumentTableDefinitionImage = DocumentTableDefinitionBase & {
2307
2334
  type: "image";
2308
2335
  };
2309
2336
  export type DocumentTableDefinition = DocumentTableDefinitionText | DocumentTableDefinitionNumber | DocumentTableDefinitionCheckbox | DocumentTableDefinitionFiles | DocumentTableDefinitionUsers | DocumentTableDefinitionRating | DocumentTableDefinitionSelect | DocumentTableDefinitionContentRef | DocumentTableDefinitionImage;
2337
+ /**
2338
+ * Number of rows or columns covered by a table cell merge
2339
+ * @min 1
2340
+ * @max 50
2341
+ */
2342
+ export type DocumentTableCellSpan = number;
2343
+ /** Positional table cell merge range. The anchor and spans are resolved against the current sorted record order and visible column order. The current document model applies only non-overlapping horizontal or vertical merges of adjacent Text or Number body cells; unsupported ranges are removed during normalization. */
2344
+ export interface DocumentTableCellMerge {
2345
+ /** Cell at the top-left of the merged range */
2346
+ anchor: {
2347
+ /** ID of the anchor record */
2348
+ record: string;
2349
+ /** ID of the anchor column */
2350
+ column: string;
2351
+ };
2352
+ /** Number of rows or columns covered by a table cell merge */
2353
+ rowSpan: DocumentTableCellSpan;
2354
+ /** Number of rows or columns covered by a table cell merge */
2355
+ colSpan: DocumentTableCellSpan;
2356
+ }
2310
2357
  export interface DocumentFragment {
2311
2358
  object: "fragment";
2312
2359
  key?: string;
@@ -2323,6 +2370,8 @@ export interface DocumentBlockTable {
2323
2370
  view: DocumentTableViewGrid | DocumentTableViewCards;
2324
2371
  records: Record<string, DocumentTableRecord>;
2325
2372
  definition: Record<string, DocumentTableDefinition>;
2373
+ /** Positional table cell merge ranges. The current document model retains only non-overlapping horizontal or vertical merges between adjacent Text or Number body cells. Anchors and spans are resolved against the table's current sorted record order and visible column order. */
2374
+ cellMerges?: DocumentTableCellMerge[];
2326
2375
  /** Whether to render the block as a full width one */
2327
2376
  fullWidth?: boolean;
2328
2377
  /** Whether to show the search bar on the table. When unset, search is shown automatically on grid tables once they have enough rows. */
@@ -3417,8 +3466,10 @@ export interface AgentConversation {
3417
3466
  id: string;
3418
3467
  /** The title of the conversation, generated from the first message. Absent until generated. */
3419
3468
  title?: string;
3420
- /** Whether the conversation is shared with everyone who has access to the change request, rather than only its creator. Conversations are shared by default; a private conversation is only ever visible to its creator and stays private for good. */
3469
+ /** Whether the conversation is shared with everyone who has access to its context, rather than only its creator. Conversations are shared by default; a private conversation is only ever visible to its creator and stays private for good. */
3421
3470
  shared: boolean;
3471
+ /** The change request the conversation is currently editing in. Only set for organization agent conversations, which start without one and attach a change request the first time the agent needs to change content. Absent for change request conversations, whose change request is the conversation's context. */
3472
+ changeRequest?: string;
3422
3473
  createdAt: Timestamp;
3423
3474
  updatedAt: Timestamp;
3424
3475
  }
@@ -4606,6 +4657,8 @@ export type FetchVisitorAuthenticationEvent = SiteEvent & {
4606
4657
  location?: string;
4607
4658
  /** Whitelisted search parameters from the visitor authentication request. */
4608
4659
  searchParams?: Record<string, string>;
4660
+ /** Whitelisted cookies from the visitor authentication request. */
4661
+ cookies?: Record<string, string>;
4609
4662
  /** The visitor authentication action to resolve. If omitted, integrations resolve to the existing login redirect. */
4610
4663
  action?: "logout";
4611
4664
  };
@@ -7981,6 +8034,8 @@ export interface AIToolCallEditPage {
7981
8034
  /** The base revision ID used to compare the page change in the current conversation. */
7982
8035
  baseRevisionId: string;
7983
8036
  page: ChangedRevisionPage;
8037
+ /** The ID of the change request the edit was made in. Absent when the space itself was edited, through its unlocked live edits. */
8038
+ changeRequestId?: string;
7984
8039
  }
7985
8040
  export interface AIToolCallCreatePage {
7986
8041
  tool: "createPage";
@@ -7989,6 +8044,8 @@ export interface AIToolCallCreatePage {
7989
8044
  /** The base revision ID used to compare the page change in the current conversation. */
7990
8045
  baseRevisionId: string;
7991
8046
  page: ChangedRevisionPage;
8047
+ /** The ID of the change request the edit was made in. Absent when the space itself was edited, through its unlocked live edits. */
8048
+ changeRequestId?: string;
7992
8049
  }
7993
8050
  export interface AIToolCallDeletePage {
7994
8051
  tool: "deletePage";
@@ -7997,6 +8054,8 @@ export interface AIToolCallDeletePage {
7997
8054
  /** The base revision ID used to compare the page deletion in the current conversation. */
7998
8055
  baseRevisionId: string;
7999
8056
  page: ChangedRevisionPage;
8057
+ /** The ID of the change request the edit was made in. Absent when the space itself was edited, through its unlocked live edits. */
8058
+ changeRequestId?: string;
8000
8059
  }
8001
8060
  export interface AIToolCallRenamePage {
8002
8061
  tool: "renamePage";
@@ -8005,6 +8064,8 @@ export interface AIToolCallRenamePage {
8005
8064
  /** The base revision ID used to compare the page rename in the current conversation. */
8006
8065
  baseRevisionId: string;
8007
8066
  page: ChangedRevisionPage;
8067
+ /** The ID of the change request the edit was made in. Absent when the space itself was edited, through its unlocked live edits. */
8068
+ changeRequestId?: string;
8008
8069
  /** The new title of the page. */
8009
8070
  title: string;
8010
8071
  }
@@ -8015,6 +8076,8 @@ export interface AIToolCallMovePage {
8015
8076
  /** The base revision ID used to compare the page move in the current conversation. */
8016
8077
  baseRevisionId: string;
8017
8078
  page: ChangedRevisionPage;
8079
+ /** The ID of the change request the edit was made in. Absent when the space itself was edited, through its unlocked live edits. */
8080
+ changeRequestId?: string;
8018
8081
  to?: ChangedRevisionPage;
8019
8082
  /**
8020
8083
  * Indicates how the page was moved relative to the "to" page.
@@ -8325,6 +8388,11 @@ export interface AIMessage {
8325
8388
  task?: AIMessageTask;
8326
8389
  /** The response that generated this message. */
8327
8390
  response?: AIMessageResponseMetadata;
8391
+ /**
8392
+ * When the message was added to the conversation. Absent on messages recorded before this field existed.
8393
+ * @format date-time
8394
+ */
8395
+ createdAt?: string;
8328
8396
  }
8329
8397
  export type SiteQuestionAnswerWithResponse = SiteQuestionAnswer & {
8330
8398
  response: AIMessage;
@@ -8643,6 +8711,8 @@ export type SiteInsightsEventPageView = SiteInsightsEventBase & {
8643
8711
  };
8644
8712
  export type SiteInsightsEventPageMarkdownRequest = SiteInsightsEventBase & {
8645
8713
  type: "page_markdown_request";
8714
+ /** How a page's markdown was requested. `page-action` means a reader used the site's page-actions menu — its copy or view-as-markdown action — rather than a client fetching the URL directly. */
8715
+ markdownSource?: SiteInsightsMarkdownSource;
8646
8716
  };
8647
8717
  export type SiteInsightsEventSearchOpen = SiteInsightsEventBase & {
8648
8718
  type: "search_open";
@@ -8818,6 +8888,8 @@ export type SiteInsightsQueryEventsColumn = SiteInsightsQueryDateTimeColumn | {
8818
8888
  column: "eventLLMSVariant";
8819
8889
  } | {
8820
8890
  column: "eventPageNotFoundType";
8891
+ } | {
8892
+ column: "eventMarkdownSource";
8821
8893
  } | {
8822
8894
  column: "eventSearchQuery";
8823
8895
  } | {
@@ -8927,6 +8999,9 @@ export type SiteInsightsQueryEventsValues = {
8927
8999
  } | {
8928
9000
  column: "eventPageNotFoundType";
8929
9001
  values: (null | SiteInsightsPageNotFoundType)[];
9002
+ } | {
9003
+ column: "eventMarkdownSource";
9004
+ values: (null | SiteInsightsMarkdownSource)[];
8930
9005
  } | {
8931
9006
  column: "siteSpace";
8932
9007
  values: (string | null)[];
@@ -9776,7 +9851,7 @@ export interface GitSyncSiteOperation {
9776
9851
  error?: string;
9777
9852
  /** An action the user can take to resolve a failed Git Sync operation. */
9778
9853
  errorAction?: GitSyncOperationErrorAction;
9779
- spaces: Record<string, GitSyncSpaceOperation>;
9854
+ spaces?: Record<string, GitSyncSpaceOperation>;
9780
9855
  }
9781
9856
  /**
9782
9857
  * A section group — a container that nests sections (and other section
@@ -10574,12 +10649,26 @@ export interface AgentStreamMessageResponse {
10574
10649
  type: "message_response";
10575
10650
  response: AIStreamResponse;
10576
10651
  }
10652
+ /** A message waiting for the agent's current response to finish, held in the order it will be processed. The identifier addresses the entry to remove it from the queue or run it immediately. */
10653
+ export interface AgentQueuedMessage {
10654
+ /** Identifier of the queue entry, unique within the conversation. */
10655
+ id: string;
10656
+ /** Input version of an AI message. */
10657
+ message: AIMessageInput;
10658
+ /**
10659
+ * When the message entered the queue.
10660
+ * @format date-time
10661
+ */
10662
+ queuedAt: string;
10663
+ }
10577
10664
  /** Describes what the agent is currently doing while processing, used to display a live activity indicator in the conversation. */
10578
10665
  export interface AgentActivity {
10579
10666
  /** The kind of activity the agent is currently performing. `thinking` while it reasons or decides on a next action, `tool` while it runs a tool, and `responding` while it writes its answer. */
10580
10667
  type: "thinking" | "tool" | "responding";
10581
10668
  /** When `type` is `tool`, the name of the tool being called (matches `AIToolCall.tool`). */
10582
10669
  tool?: string;
10670
+ /** What to show the user instead of a label derived from `tool`, for a tool whose name means nothing to them — an MCP server's, say, where it reads "Searching documentation". */
10671
+ label?: string;
10583
10672
  }
10584
10673
  /** An option the user can pick when answering a question asked by the agent. */
10585
10674
  export interface AgentQuestionOption {
@@ -10597,16 +10686,27 @@ export interface AgentPendingQuestion {
10597
10686
  /** The options the user can choose from. */
10598
10687
  options: AgentQuestionOption[];
10599
10688
  }
10689
+ /** Where the agent's content edits land. Usually a change request, which is how published content is changed; a space whose live edits are unlocked is the exception, and is edited in place. Carries identifiers only: the client resolves the change request's number and subject, or the space's title, through the API. */
10690
+ export interface AgentEditTarget {
10691
+ /** The ID of the space the edits are made in. */
10692
+ spaceId: string;
10693
+ /** The ID of the change request the edits are made in. Absent when the space itself is the target, through its unlocked live edits. */
10694
+ changeRequestId?: string;
10695
+ }
10600
10696
  export interface AgentState {
10601
10697
  status: AgentStatus;
10602
10698
  /** List of response suggestions for the user to select from. */
10603
10699
  suggestions: string[];
10604
- /** List of messages sent by the users queued to processed. */
10700
+ /** List of messages sent by the users queued to processed. Superseded by `queue`, which carries the same messages with the identifiers needed to act on them; kept for compatibility with clients that predate it. */
10605
10701
  queuedMessages: AIMessageInput[];
10702
+ /** Messages waiting for the current response to finish, in the order they will be processed. */
10703
+ queue?: AgentQueuedMessage[];
10606
10704
  /** What the agent is currently doing. Only set while the agent is processing. */
10607
10705
  activity?: AgentActivity;
10608
10706
  /** A question the agent is waiting for the user to answer. While set, the client replaces the prompt with a choice control. */
10609
10707
  pendingQuestion?: AgentPendingQuestion;
10708
+ /** Where the agent currently edits content. Absent until something is attached: the organization agent starts read-only, while a change request agent always edits the change request it belongs to. */
10709
+ editTarget?: AgentEditTarget;
10610
10710
  }
10611
10711
  /** Payload emitted by the agent with its current state. */
10612
10712
  export interface AgentStreamState {
@@ -14799,6 +14899,60 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14799
14899
  /** Document describing the Docs agent instructions. */
14800
14900
  instructions: JSONDocument;
14801
14901
  }, params?: RequestParams) => Promise<HttpResponse<OrganizationAgentInstructions, any>>;
14902
+ /**
14903
+ * @description Returns a paginated list of the calling user's AI agent conversations with the organization agent. Unlike change request conversations, these are not tied to a single change request: the agent works across the organization and only attaches a change request when it needs to edit content. A conversation belongs to the user who started it and is never visible to anyone else.
14904
+ *
14905
+ * @tags organizations, agents
14906
+ * @name ListOrganizationAgentConversations
14907
+ * @summary List AI agent conversations in an organization
14908
+ * @request GET:/orgs/{organizationId}/agent/conversations
14909
+ * @secure
14910
+ */
14911
+ listOrganizationAgentConversations: (organizationId: EntityId, query?: {
14912
+ /** Identifier of the page results to fetch. */
14913
+ page?: string;
14914
+ /**
14915
+ * The number of results per page
14916
+ * @min 0
14917
+ * @max 1000
14918
+ */
14919
+ limit?: number;
14920
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
14921
+ items: AgentConversation[];
14922
+ }, any>>;
14923
+ /**
14924
+ * @description Prepares a conversation so the client can connect to it, giving the agent the credentials it acts with. Call this before opening a conversation; connecting to one that was never provisioned yields an agent whose tools all fail. The conversation itself is only recorded once the user sends a first message, so opening the agent and closing it again leaves nothing behind. Safe to call again to refresh an expiring session.
14925
+ *
14926
+ * @tags organizations, agents
14927
+ * @name ProvisionOrganizationAgentConversation
14928
+ * @summary Provision an AI agent conversation in an organization
14929
+ * @request PUT:/orgs/{organizationId}/agent/conversations/{conversationId}
14930
+ * @secure
14931
+ */
14932
+ provisionOrganizationAgentConversation: (organizationId: EntityId, conversationId: string, params?: RequestParams) => Promise<HttpResponse<void, any>>;
14933
+ /**
14934
+ * @description Updates one of the calling user's conversations with the organization agent. Use this to rename it.
14935
+ *
14936
+ * @tags organizations, agents
14937
+ * @name UpdateOrganizationAgentConversation
14938
+ * @summary Update an AI agent conversation in an organization
14939
+ * @request PATCH:/orgs/{organizationId}/agent/conversations/{conversationId}
14940
+ * @secure
14941
+ */
14942
+ updateOrganizationAgentConversation: (organizationId: EntityId, conversationId: string, data: {
14943
+ /** The new title of the conversation. */
14944
+ title: string;
14945
+ }, params?: RequestParams) => Promise<HttpResponse<AgentConversation, any>>;
14946
+ /**
14947
+ * @description Deletes one of the calling user's conversations with the organization agent, destroying the messages it holds. This cannot be undone.
14948
+ *
14949
+ * @tags organizations, agents
14950
+ * @name DeleteOrganizationAgentConversation
14951
+ * @summary Delete an agent conversation in an organization
14952
+ * @request DELETE:/orgs/{organizationId}/agent/conversations/{conversationId}
14953
+ * @secure
14954
+ */
14955
+ deleteOrganizationAgentConversation: (organizationId: EntityId, conversationId: string, params?: RequestParams) => Promise<HttpResponse<void, any>>;
14802
14956
  /**
14803
14957
  * No description
14804
14958
  *
@@ -185,6 +185,7 @@ export declare const AIMODEL_ENUM: ["fast", "reasoning-low", "reasoning-medium",
185
185
  export declare const SITE_SETTINGS_SCAN_TOPICS_ENUM: ["auto", "never"];
186
186
  export declare const SITE_SETTINGS_FINDING_CHANGE_REQUESTS_ENUM: ["always", "auto-fixable", "never"];
187
187
  export declare const SITE_INSIGHTS_DISPLAY_CONTEXT_ENUM: ["site", "server", "embed", "mcp"];
188
+ export declare const SITE_INSIGHTS_MARKDOWN_SOURCE_ENUM: ["page-action"];
188
189
  export declare const SITE_INSIGHTS_LINK_POSITION_ENUM: ["announcement", "header", "footer", "sidebar", "content"];
189
190
  export declare const SITE_INSIGHTS_TRADEMARK_PLACEMENT_ENUM: ["sidebar", "ad", "footer", "pdf", "embed"];
190
191
  export declare const SITE_INSIGHTS_AD_PLACEMENT_ENUM: ["aside"];
@@ -215,6 +216,9 @@ export declare const SHA256_MIN_LENGTH = 64;
215
216
  export declare const GIT_BOOK_USERS_ENUM: ["gitbook:agent"];
216
217
  export declare const REVISION_SEMANTIC_CHANGE_TYPE_ENUM: ["page_created", "page_edited", "page_deleted", "page_moved", "file_created", "file_edited", "file_deleted", "custom_fields_edited", "tag_created", "tag_deleted", "tag_edited"];
217
218
  export declare const GIT_SYNC_OPERATION_STAGE_ENUM: ["repo_fetch", "config_check", "content_process", "finalize"];
219
+ export declare const GIT_SYNC_RUN_OPERATION_ENUM: ["import", "export", "check", "merge", "recovery"];
220
+ export declare const GIT_SYNC_RUN_STATE_ENUM: ["queued", "running", "success", "failure", "timeout", "cancelled"];
221
+ export declare const GIT_PROVIDER_CHANGE_STATE_ENUM: ["open", "closed", "merged"];
218
222
  export declare const BILLING_STATUS_ENUM: ["trialing", "active", "past_due", "incomplete_expired", "canceled", "unpaid", "paused"];
219
223
  export declare const APIINTEGRATION_SCOPE_ENUM: ["integration:read", "integration:update", "integration:installation:read", "integration:installation:update"];
220
224
  export declare const CUSTOMIZATION_THEME_MODE_ENUM: ["light", "dark"];
package/dist/index.cjs CHANGED
@@ -317,6 +317,7 @@ __export(src_exports, {
317
317
  GITBOOK_DEFAULT_ENDPOINT: () => GITBOOK_DEFAULT_ENDPOINT,
318
318
  GIT_BOOK_USERS_ENUM: () => GIT_BOOK_USERS_ENUM,
319
319
  GIT_HUB_REPOSITORY_PATTERN_PATTERN: () => GIT_HUB_REPOSITORY_PATTERN_PATTERN,
320
+ GIT_PROVIDER_CHANGE_STATE_ENUM: () => GIT_PROVIDER_CHANGE_STATE_ENUM,
320
321
  GIT_SYNC_INSTALLATION_PRIORITY_ENUM: () => GIT_SYNC_INSTALLATION_PRIORITY_ENUM,
321
322
  GIT_SYNC_INSTALLATION_PROVIDER_ENUM: () => GIT_SYNC_INSTALLATION_PROVIDER_ENUM,
322
323
  GIT_SYNC_INSTALLATION_STATUS_ENUM: () => GIT_SYNC_INSTALLATION_STATUS_ENUM,
@@ -324,9 +325,12 @@ __export(src_exports, {
324
325
  GIT_SYNC_OPERATION_STAGE_ENUM: () => GIT_SYNC_OPERATION_STAGE_ENUM,
325
326
  GIT_SYNC_OPERATION_STATE_ENUM: () => GIT_SYNC_OPERATION_STATE_ENUM,
326
327
  GIT_SYNC_PROVIDER_ENUM: () => GIT_SYNC_PROVIDER_ENUM,
328
+ GIT_SYNC_RUN_OPERATION_ENUM: () => GIT_SYNC_RUN_OPERATION_ENUM,
329
+ GIT_SYNC_RUN_STATE_ENUM: () => GIT_SYNC_RUN_STATE_ENUM,
327
330
  GitBookAPI: () => GitBookAPI,
328
331
  GitBookAPIError: () => GitBookAPIError,
329
332
  GitBookUsers: () => GitBookUsers,
333
+ GitProviderChangeState: () => GitProviderChangeState,
330
334
  GitSyncInstallationPriority: () => GitSyncInstallationPriority,
331
335
  GitSyncInstallationProvider: () => GitSyncInstallationProvider,
332
336
  GitSyncInstallationStatus: () => GitSyncInstallationStatus,
@@ -334,6 +338,8 @@ __export(src_exports, {
334
338
  GitSyncOperationStage: () => GitSyncOperationStage,
335
339
  GitSyncOperationState: () => GitSyncOperationState,
336
340
  GitSyncProvider: () => GitSyncProvider,
341
+ GitSyncRunOperation: () => GitSyncRunOperation,
342
+ GitSyncRunState: () => GitSyncRunState,
337
343
  HttpClient: () => HttpClient,
338
344
  ICON_MAX_LENGTH: () => ICON_MAX_LENGTH,
339
345
  INTEGRATION_CATEGORY_ENUM: () => INTEGRATION_CATEGORY_ENUM,
@@ -431,6 +437,7 @@ __export(src_exports, {
431
437
  SITE_INSIGHTS_EVENT_TYPE_ENUM: () => SITE_INSIGHTS_EVENT_TYPE_ENUM,
432
438
  SITE_INSIGHTS_LINK_POSITION_ENUM: () => SITE_INSIGHTS_LINK_POSITION_ENUM,
433
439
  SITE_INSIGHTS_LLMSVARIANT_ENUM: () => SITE_INSIGHTS_LLMSVARIANT_ENUM,
440
+ SITE_INSIGHTS_MARKDOWN_SOURCE_ENUM: () => SITE_INSIGHTS_MARKDOWN_SOURCE_ENUM,
434
441
  SITE_INSIGHTS_PAGE_NOT_FOUND_TYPE_ENUM: () => SITE_INSIGHTS_PAGE_NOT_FOUND_TYPE_ENUM,
435
442
  SITE_INSIGHTS_QUERY_OPERATOR_ENUM: () => SITE_INSIGHTS_QUERY_OPERATOR_ENUM,
436
443
  SITE_INSIGHTS_QUERY_RANGE_PRESET_ENUM: () => SITE_INSIGHTS_QUERY_RANGE_PRESET_ENUM,
@@ -499,6 +506,7 @@ __export(src_exports, {
499
506
  SiteInsightsEventType: () => SiteInsightsEventType,
500
507
  SiteInsightsLLMSVariant: () => SiteInsightsLLMSVariant,
501
508
  SiteInsightsLinkPosition: () => SiteInsightsLinkPosition,
509
+ SiteInsightsMarkdownSource: () => SiteInsightsMarkdownSource,
502
510
  SiteInsightsPageNotFoundType: () => SiteInsightsPageNotFoundType,
503
511
  SiteInsightsQueryOperator: () => SiteInsightsQueryOperator,
504
512
  SiteInsightsQueryRangePreset: () => SiteInsightsQueryRangePreset,
@@ -544,7 +552,7 @@ module.exports = __toCommonJS(src_exports);
544
552
 
545
553
  // package.json
546
554
  var name = "@gitbook/api";
547
- var version = "0.198.0";
555
+ var version = "0.199.0";
548
556
 
549
557
  // src/client.ts
550
558
  var import_event_iterator = __toESM(require_node(), 1);
@@ -692,6 +700,29 @@ var BillingStatus = /* @__PURE__ */ ((BillingStatus2) => {
692
700
  BillingStatus2["Paused"] = "paused";
693
701
  return BillingStatus2;
694
702
  })(BillingStatus || {});
703
+ var GitProviderChangeState = /* @__PURE__ */ ((GitProviderChangeState2) => {
704
+ GitProviderChangeState2["Open"] = "open";
705
+ GitProviderChangeState2["Closed"] = "closed";
706
+ GitProviderChangeState2["Merged"] = "merged";
707
+ return GitProviderChangeState2;
708
+ })(GitProviderChangeState || {});
709
+ var GitSyncRunState = /* @__PURE__ */ ((GitSyncRunState2) => {
710
+ GitSyncRunState2["Queued"] = "queued";
711
+ GitSyncRunState2["Running"] = "running";
712
+ GitSyncRunState2["Success"] = "success";
713
+ GitSyncRunState2["Failure"] = "failure";
714
+ GitSyncRunState2["Timeout"] = "timeout";
715
+ GitSyncRunState2["Cancelled"] = "cancelled";
716
+ return GitSyncRunState2;
717
+ })(GitSyncRunState || {});
718
+ var GitSyncRunOperation = /* @__PURE__ */ ((GitSyncRunOperation2) => {
719
+ GitSyncRunOperation2["Import"] = "import";
720
+ GitSyncRunOperation2["Export"] = "export";
721
+ GitSyncRunOperation2["Check"] = "check";
722
+ GitSyncRunOperation2["Merge"] = "merge";
723
+ GitSyncRunOperation2["Recovery"] = "recovery";
724
+ return GitSyncRunOperation2;
725
+ })(GitSyncRunOperation || {});
695
726
  var GitSyncOperationStage = /* @__PURE__ */ ((GitSyncOperationStage2) => {
696
727
  GitSyncOperationStage2["RepoFetch"] = "repo_fetch";
697
728
  GitSyncOperationStage2["ConfigCheck"] = "config_check";
@@ -917,6 +948,10 @@ var SiteInsightsLinkPosition = /* @__PURE__ */ ((SiteInsightsLinkPosition2) => {
917
948
  SiteInsightsLinkPosition2["Content"] = "content";
918
949
  return SiteInsightsLinkPosition2;
919
950
  })(SiteInsightsLinkPosition || {});
951
+ var SiteInsightsMarkdownSource = /* @__PURE__ */ ((SiteInsightsMarkdownSource2) => {
952
+ SiteInsightsMarkdownSource2["PageAction"] = "page-action";
953
+ return SiteInsightsMarkdownSource2;
954
+ })(SiteInsightsMarkdownSource || {});
920
955
  var SiteInsightsDisplayContext = /* @__PURE__ */ ((SiteInsightsDisplayContext2) => {
921
956
  SiteInsightsDisplayContext2["Site"] = "site";
922
957
  SiteInsightsDisplayContext2["Server"] = "server";
@@ -3625,6 +3660,35 @@ var Api = class extends HttpClient {
3625
3660
  format: "json",
3626
3661
  ...params
3627
3662
  }),
3663
+ listOrganizationAgentConversations: (organizationId, query, params = {}) => this.request({
3664
+ path: `/orgs/${organizationId}/agent/conversations`,
3665
+ method: "GET",
3666
+ query,
3667
+ secure: true,
3668
+ format: "json",
3669
+ ...params
3670
+ }),
3671
+ provisionOrganizationAgentConversation: (organizationId, conversationId, params = {}) => this.request({
3672
+ path: `/orgs/${organizationId}/agent/conversations/${conversationId}`,
3673
+ method: "PUT",
3674
+ secure: true,
3675
+ ...params
3676
+ }),
3677
+ updateOrganizationAgentConversation: (organizationId, conversationId, data, params = {}) => this.request({
3678
+ path: `/orgs/${organizationId}/agent/conversations/${conversationId}`,
3679
+ method: "PATCH",
3680
+ body: data,
3681
+ secure: true,
3682
+ type: "application/json" /* Json */,
3683
+ format: "json",
3684
+ ...params
3685
+ }),
3686
+ deleteOrganizationAgentConversation: (organizationId, conversationId, params = {}) => this.request({
3687
+ path: `/orgs/${organizationId}/agent/conversations/${conversationId}`,
3688
+ method: "DELETE",
3689
+ secure: true,
3690
+ ...params
3691
+ }),
3628
3692
  listTranslations: (organizationId, query, params = {}) => this.request({
3629
3693
  path: `/orgs/${organizationId}/translations`,
3630
3694
  method: "GET",
@@ -5089,6 +5153,7 @@ var AIMODEL_ENUM = ["fast", "reasoning-low", "reasoning-medium", "reasoning-high
5089
5153
  var SITE_SETTINGS_SCAN_TOPICS_ENUM = ["auto", "never"];
5090
5154
  var SITE_SETTINGS_FINDING_CHANGE_REQUESTS_ENUM = ["always", "auto-fixable", "never"];
5091
5155
  var SITE_INSIGHTS_DISPLAY_CONTEXT_ENUM = ["site", "server", "embed", "mcp"];
5156
+ var SITE_INSIGHTS_MARKDOWN_SOURCE_ENUM = ["page-action"];
5092
5157
  var SITE_INSIGHTS_LINK_POSITION_ENUM = ["announcement", "header", "footer", "sidebar", "content"];
5093
5158
  var SITE_INSIGHTS_TRADEMARK_PLACEMENT_ENUM = ["sidebar", "ad", "footer", "pdf", "embed"];
5094
5159
  var SITE_INSIGHTS_AD_PLACEMENT_ENUM = ["aside"];
@@ -5119,6 +5184,9 @@ var SHA256_MIN_LENGTH = 64;
5119
5184
  var GIT_BOOK_USERS_ENUM = ["gitbook:agent"];
5120
5185
  var REVISION_SEMANTIC_CHANGE_TYPE_ENUM = ["page_created", "page_edited", "page_deleted", "page_moved", "file_created", "file_edited", "file_deleted", "custom_fields_edited", "tag_created", "tag_deleted", "tag_edited"];
5121
5186
  var GIT_SYNC_OPERATION_STAGE_ENUM = ["repo_fetch", "config_check", "content_process", "finalize"];
5187
+ var GIT_SYNC_RUN_OPERATION_ENUM = ["import", "export", "check", "merge", "recovery"];
5188
+ var GIT_SYNC_RUN_STATE_ENUM = ["queued", "running", "success", "failure", "timeout", "cancelled"];
5189
+ var GIT_PROVIDER_CHANGE_STATE_ENUM = ["open", "closed", "merged"];
5122
5190
  var BILLING_STATUS_ENUM = ["trialing", "active", "past_due", "incomplete_expired", "canceled", "unpaid", "paused"];
5123
5191
  var APIINTEGRATION_SCOPE_ENUM = ["integration:read", "integration:update", "integration:installation:read", "integration:installation:update"];
5124
5192
  var CUSTOMIZATION_THEME_MODE_ENUM = ["light", "dark"];
@@ -5333,6 +5401,7 @@ var GitBookAPI = class extends Api {
5333
5401
  GITBOOK_DEFAULT_ENDPOINT,
5334
5402
  GIT_BOOK_USERS_ENUM,
5335
5403
  GIT_HUB_REPOSITORY_PATTERN_PATTERN,
5404
+ GIT_PROVIDER_CHANGE_STATE_ENUM,
5336
5405
  GIT_SYNC_INSTALLATION_PRIORITY_ENUM,
5337
5406
  GIT_SYNC_INSTALLATION_PROVIDER_ENUM,
5338
5407
  GIT_SYNC_INSTALLATION_STATUS_ENUM,
@@ -5340,9 +5409,12 @@ var GitBookAPI = class extends Api {
5340
5409
  GIT_SYNC_OPERATION_STAGE_ENUM,
5341
5410
  GIT_SYNC_OPERATION_STATE_ENUM,
5342
5411
  GIT_SYNC_PROVIDER_ENUM,
5412
+ GIT_SYNC_RUN_OPERATION_ENUM,
5413
+ GIT_SYNC_RUN_STATE_ENUM,
5343
5414
  GitBookAPI,
5344
5415
  GitBookAPIError,
5345
5416
  GitBookUsers,
5417
+ GitProviderChangeState,
5346
5418
  GitSyncInstallationPriority,
5347
5419
  GitSyncInstallationProvider,
5348
5420
  GitSyncInstallationStatus,
@@ -5350,6 +5422,8 @@ var GitBookAPI = class extends Api {
5350
5422
  GitSyncOperationStage,
5351
5423
  GitSyncOperationState,
5352
5424
  GitSyncProvider,
5425
+ GitSyncRunOperation,
5426
+ GitSyncRunState,
5353
5427
  HttpClient,
5354
5428
  ICON_MAX_LENGTH,
5355
5429
  INTEGRATION_CATEGORY_ENUM,
@@ -5447,6 +5521,7 @@ var GitBookAPI = class extends Api {
5447
5521
  SITE_INSIGHTS_EVENT_TYPE_ENUM,
5448
5522
  SITE_INSIGHTS_LINK_POSITION_ENUM,
5449
5523
  SITE_INSIGHTS_LLMSVARIANT_ENUM,
5524
+ SITE_INSIGHTS_MARKDOWN_SOURCE_ENUM,
5450
5525
  SITE_INSIGHTS_PAGE_NOT_FOUND_TYPE_ENUM,
5451
5526
  SITE_INSIGHTS_QUERY_OPERATOR_ENUM,
5452
5527
  SITE_INSIGHTS_QUERY_RANGE_PRESET_ENUM,
@@ -5515,6 +5590,7 @@ var GitBookAPI = class extends Api {
5515
5590
  SiteInsightsEventType,
5516
5591
  SiteInsightsLLMSVariant,
5517
5592
  SiteInsightsLinkPosition,
5593
+ SiteInsightsMarkdownSource,
5518
5594
  SiteInsightsPageNotFoundType,
5519
5595
  SiteInsightsQueryOperator,
5520
5596
  SiteInsightsQueryRangePreset,
package/dist/index.js CHANGED
@@ -172,7 +172,7 @@ var require_node = __commonJS({
172
172
 
173
173
  // package.json
174
174
  var name = "@gitbook/api";
175
- var version = "0.198.0";
175
+ var version = "0.199.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -320,6 +320,29 @@ var BillingStatus = /* @__PURE__ */ ((BillingStatus2) => {
320
320
  BillingStatus2["Paused"] = "paused";
321
321
  return BillingStatus2;
322
322
  })(BillingStatus || {});
323
+ var GitProviderChangeState = /* @__PURE__ */ ((GitProviderChangeState2) => {
324
+ GitProviderChangeState2["Open"] = "open";
325
+ GitProviderChangeState2["Closed"] = "closed";
326
+ GitProviderChangeState2["Merged"] = "merged";
327
+ return GitProviderChangeState2;
328
+ })(GitProviderChangeState || {});
329
+ var GitSyncRunState = /* @__PURE__ */ ((GitSyncRunState2) => {
330
+ GitSyncRunState2["Queued"] = "queued";
331
+ GitSyncRunState2["Running"] = "running";
332
+ GitSyncRunState2["Success"] = "success";
333
+ GitSyncRunState2["Failure"] = "failure";
334
+ GitSyncRunState2["Timeout"] = "timeout";
335
+ GitSyncRunState2["Cancelled"] = "cancelled";
336
+ return GitSyncRunState2;
337
+ })(GitSyncRunState || {});
338
+ var GitSyncRunOperation = /* @__PURE__ */ ((GitSyncRunOperation2) => {
339
+ GitSyncRunOperation2["Import"] = "import";
340
+ GitSyncRunOperation2["Export"] = "export";
341
+ GitSyncRunOperation2["Check"] = "check";
342
+ GitSyncRunOperation2["Merge"] = "merge";
343
+ GitSyncRunOperation2["Recovery"] = "recovery";
344
+ return GitSyncRunOperation2;
345
+ })(GitSyncRunOperation || {});
323
346
  var GitSyncOperationStage = /* @__PURE__ */ ((GitSyncOperationStage2) => {
324
347
  GitSyncOperationStage2["RepoFetch"] = "repo_fetch";
325
348
  GitSyncOperationStage2["ConfigCheck"] = "config_check";
@@ -545,6 +568,10 @@ var SiteInsightsLinkPosition = /* @__PURE__ */ ((SiteInsightsLinkPosition2) => {
545
568
  SiteInsightsLinkPosition2["Content"] = "content";
546
569
  return SiteInsightsLinkPosition2;
547
570
  })(SiteInsightsLinkPosition || {});
571
+ var SiteInsightsMarkdownSource = /* @__PURE__ */ ((SiteInsightsMarkdownSource2) => {
572
+ SiteInsightsMarkdownSource2["PageAction"] = "page-action";
573
+ return SiteInsightsMarkdownSource2;
574
+ })(SiteInsightsMarkdownSource || {});
548
575
  var SiteInsightsDisplayContext = /* @__PURE__ */ ((SiteInsightsDisplayContext2) => {
549
576
  SiteInsightsDisplayContext2["Site"] = "site";
550
577
  SiteInsightsDisplayContext2["Server"] = "server";
@@ -3253,6 +3280,35 @@ var Api = class extends HttpClient {
3253
3280
  format: "json",
3254
3281
  ...params
3255
3282
  }),
3283
+ listOrganizationAgentConversations: (organizationId, query, params = {}) => this.request({
3284
+ path: `/orgs/${organizationId}/agent/conversations`,
3285
+ method: "GET",
3286
+ query,
3287
+ secure: true,
3288
+ format: "json",
3289
+ ...params
3290
+ }),
3291
+ provisionOrganizationAgentConversation: (organizationId, conversationId, params = {}) => this.request({
3292
+ path: `/orgs/${organizationId}/agent/conversations/${conversationId}`,
3293
+ method: "PUT",
3294
+ secure: true,
3295
+ ...params
3296
+ }),
3297
+ updateOrganizationAgentConversation: (organizationId, conversationId, data, params = {}) => this.request({
3298
+ path: `/orgs/${organizationId}/agent/conversations/${conversationId}`,
3299
+ method: "PATCH",
3300
+ body: data,
3301
+ secure: true,
3302
+ type: "application/json" /* Json */,
3303
+ format: "json",
3304
+ ...params
3305
+ }),
3306
+ deleteOrganizationAgentConversation: (organizationId, conversationId, params = {}) => this.request({
3307
+ path: `/orgs/${organizationId}/agent/conversations/${conversationId}`,
3308
+ method: "DELETE",
3309
+ secure: true,
3310
+ ...params
3311
+ }),
3256
3312
  listTranslations: (organizationId, query, params = {}) => this.request({
3257
3313
  path: `/orgs/${organizationId}/translations`,
3258
3314
  method: "GET",
@@ -4717,6 +4773,7 @@ var AIMODEL_ENUM = ["fast", "reasoning-low", "reasoning-medium", "reasoning-high
4717
4773
  var SITE_SETTINGS_SCAN_TOPICS_ENUM = ["auto", "never"];
4718
4774
  var SITE_SETTINGS_FINDING_CHANGE_REQUESTS_ENUM = ["always", "auto-fixable", "never"];
4719
4775
  var SITE_INSIGHTS_DISPLAY_CONTEXT_ENUM = ["site", "server", "embed", "mcp"];
4776
+ var SITE_INSIGHTS_MARKDOWN_SOURCE_ENUM = ["page-action"];
4720
4777
  var SITE_INSIGHTS_LINK_POSITION_ENUM = ["announcement", "header", "footer", "sidebar", "content"];
4721
4778
  var SITE_INSIGHTS_TRADEMARK_PLACEMENT_ENUM = ["sidebar", "ad", "footer", "pdf", "embed"];
4722
4779
  var SITE_INSIGHTS_AD_PLACEMENT_ENUM = ["aside"];
@@ -4747,6 +4804,9 @@ var SHA256_MIN_LENGTH = 64;
4747
4804
  var GIT_BOOK_USERS_ENUM = ["gitbook:agent"];
4748
4805
  var REVISION_SEMANTIC_CHANGE_TYPE_ENUM = ["page_created", "page_edited", "page_deleted", "page_moved", "file_created", "file_edited", "file_deleted", "custom_fields_edited", "tag_created", "tag_deleted", "tag_edited"];
4749
4806
  var GIT_SYNC_OPERATION_STAGE_ENUM = ["repo_fetch", "config_check", "content_process", "finalize"];
4807
+ var GIT_SYNC_RUN_OPERATION_ENUM = ["import", "export", "check", "merge", "recovery"];
4808
+ var GIT_SYNC_RUN_STATE_ENUM = ["queued", "running", "success", "failure", "timeout", "cancelled"];
4809
+ var GIT_PROVIDER_CHANGE_STATE_ENUM = ["open", "closed", "merged"];
4750
4810
  var BILLING_STATUS_ENUM = ["trialing", "active", "past_due", "incomplete_expired", "canceled", "unpaid", "paused"];
4751
4811
  var APIINTEGRATION_SCOPE_ENUM = ["integration:read", "integration:update", "integration:installation:read", "integration:installation:update"];
4752
4812
  var CUSTOMIZATION_THEME_MODE_ENUM = ["light", "dark"];
@@ -4960,6 +5020,7 @@ export {
4960
5020
  GITBOOK_DEFAULT_ENDPOINT,
4961
5021
  GIT_BOOK_USERS_ENUM,
4962
5022
  GIT_HUB_REPOSITORY_PATTERN_PATTERN,
5023
+ GIT_PROVIDER_CHANGE_STATE_ENUM,
4963
5024
  GIT_SYNC_INSTALLATION_PRIORITY_ENUM,
4964
5025
  GIT_SYNC_INSTALLATION_PROVIDER_ENUM,
4965
5026
  GIT_SYNC_INSTALLATION_STATUS_ENUM,
@@ -4967,9 +5028,12 @@ export {
4967
5028
  GIT_SYNC_OPERATION_STAGE_ENUM,
4968
5029
  GIT_SYNC_OPERATION_STATE_ENUM,
4969
5030
  GIT_SYNC_PROVIDER_ENUM,
5031
+ GIT_SYNC_RUN_OPERATION_ENUM,
5032
+ GIT_SYNC_RUN_STATE_ENUM,
4970
5033
  GitBookAPI,
4971
5034
  GitBookAPIError,
4972
5035
  GitBookUsers,
5036
+ GitProviderChangeState,
4973
5037
  GitSyncInstallationPriority,
4974
5038
  GitSyncInstallationProvider,
4975
5039
  GitSyncInstallationStatus,
@@ -4977,6 +5041,8 @@ export {
4977
5041
  GitSyncOperationStage,
4978
5042
  GitSyncOperationState,
4979
5043
  GitSyncProvider,
5044
+ GitSyncRunOperation,
5045
+ GitSyncRunState,
4980
5046
  HttpClient,
4981
5047
  ICON_MAX_LENGTH,
4982
5048
  INTEGRATION_CATEGORY_ENUM,
@@ -5074,6 +5140,7 @@ export {
5074
5140
  SITE_INSIGHTS_EVENT_TYPE_ENUM,
5075
5141
  SITE_INSIGHTS_LINK_POSITION_ENUM,
5076
5142
  SITE_INSIGHTS_LLMSVARIANT_ENUM,
5143
+ SITE_INSIGHTS_MARKDOWN_SOURCE_ENUM,
5077
5144
  SITE_INSIGHTS_PAGE_NOT_FOUND_TYPE_ENUM,
5078
5145
  SITE_INSIGHTS_QUERY_OPERATOR_ENUM,
5079
5146
  SITE_INSIGHTS_QUERY_RANGE_PRESET_ENUM,
@@ -5142,6 +5209,7 @@ export {
5142
5209
  SiteInsightsEventType,
5143
5210
  SiteInsightsLLMSVariant,
5144
5211
  SiteInsightsLinkPosition,
5212
+ SiteInsightsMarkdownSource,
5145
5213
  SiteInsightsPageNotFoundType,
5146
5214
  SiteInsightsQueryOperator,
5147
5215
  SiteInsightsQueryRangePreset,